"use strict";var _o=Object.create;var Gt=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Po=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,No=Object.prototype.hasOwnProperty;var xo=(b,r)=>{for(var o in r)Gt(b,o,{get:r[o],enumerable:!0})},Sr=(b,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let v of Po(r))!No.call(b,v)&&v!==o&&Gt(b,v,{get:()=>r[v],enumerable:!(u=Ro(r,v))||u.enumerable});return b};var at=(b,r,o)=>(o=b!=null?_o(Io(b)):{},Sr(r||!b||!b.__esModule?Gt(o,"default",{value:b,enumerable:!0}):o,b)),ko=b=>Sr(Gt({},"__esModule",{value:!0}),b);var Sa={};xo(Sa,{Client:()=>wt,CronExpression:()=>oi,NovuRequestHandler:()=>Mn,workflow:()=>ms});module.exports=ko(Sa);var Ur=require("liquidjs");var Pt=(u=>(u.TRIGGER="trigger",u.EXECUTE="execute",u.PREVIEW="preview",u))(Pt||{}),Kt=(u=>(u.DISCOVER="discover",u.HEALTH_CHECK="health-check",u.CODE="code",u))(Kt||{});var oi=(D=>(D.EVERY_SECOND="* * * * * *",D.EVERY_5_SECONDS="*/5 * * * * *",D.EVERY_10_SECONDS="*/10 * * * * *",D.EVERY_30_SECONDS="*/30 * * * * *",D.EVERY_MINUTE="*/1 * * * *",D.EVERY_5_MINUTES="0 */5 * * * *",D.EVERY_10_MINUTES="0 */10 * * * *",D.EVERY_30_MINUTES="0 */30 * * * *",D.EVERY_HOUR="0 0-23/1 * * *",D.EVERY_2_HOURS="0 0-23/2 * * *",D.EVERY_3_HOURS="0 0-23/3 * * *",D.EVERY_4_HOURS="0 0-23/4 * * *",D.EVERY_5_HOURS="0 0-23/5 * * *",D.EVERY_6_HOURS="0 0-23/6 * * *",D.EVERY_7_HOURS="0 0-23/7 * * *",D.EVERY_8_HOURS="0 0-23/8 * * *",D.EVERY_9_HOURS="0 0-23/9 * * *",D.EVERY_10_HOURS="0 0-23/10 * * *",D.EVERY_11_HOURS="0 0-23/11 * * *",D.EVERY_12_HOURS="0 0-23/12 * * *",D.EVERY_DAY_AT_1AM="0 01 * * *",D.EVERY_DAY_AT_2AM="0 02 * * *",D.EVERY_DAY_AT_3AM="0 03 * * *",D.EVERY_DAY_AT_4AM="0 04 * * *",D.EVERY_DAY_AT_5AM="0 05 * * *",D.EVERY_DAY_AT_6AM="0 06 * * *",D.EVERY_DAY_AT_7AM="0 07 * * *",D.EVERY_DAY_AT_8AM="0 08 * * *",D.EVERY_DAY_AT_9AM="0 09 * * *",D.EVERY_DAY_AT_10AM="0 10 * * *",D.EVERY_DAY_AT_11AM="0 11 * * *",D.EVERY_DAY_AT_NOON="0 12 * * *",D.EVERY_DAY_AT_1PM="0 13 * * *",D.EVERY_DAY_AT_2PM="0 14 * * *",D.EVERY_DAY_AT_3PM="0 15 * * *",D.EVERY_DAY_AT_4PM="0 16 * * *",D.EVERY_DAY_AT_5PM="0 17 * * *",D.EVERY_DAY_AT_6PM="0 18 * * *",D.EVERY_DAY_AT_7PM="0 19 * * *",D.EVERY_DAY_AT_8PM="0 20 * * *",D.EVERY_DAY_AT_9PM="0 21 * * *",D.EVERY_DAY_AT_10PM="0 22 * * *",D.EVERY_DAY_AT_11PM="0 23 * * *",D.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",D.EVERY_WEEK="0 0 * * 0",D.EVERY_WEEKDAY="0 0 * * 1-5",D.EVERY_WEEKEND="0 0 * * 6,0",D.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",D.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",D.EVERY_2ND_HOUR="0 */2 * * *",D.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",D.EVERY_2ND_MONTH="0 0 1 */2 *",D.EVERY_QUARTER="0 0 1 */3 *",D.EVERY_6_MONTHS="0 0 1 */6 *",D.EVERY_YEAR="0 0 1 0 *",D.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",D.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",D.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",D.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",D.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",D.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",D.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",D.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",D.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",D.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",D.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",D.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",D.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",D.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",D.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",D.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",D.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",D.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",D.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",D.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",D.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",D.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",D.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",D.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",D.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",D.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",D.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",D.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5",D))(oi||{});var We=(le=>(le.BRIDGE_ERROR="BridgeError",le.EXECUTION_EVENT_CONTROL_INVALID_ERROR="ExecutionEventControlInvalidError",le.EXECUTION_EVENT_PAYLOAD_INVALID_ERROR="ExecutionEventPayloadInvalidError",le.EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR="ExecutionProviderOutputInvalidError",le.EXECUTION_STATE_CONTROL_INVALID_ERROR="ExecutionStateControlInvalidError",le.EXECUTION_STATE_CORRUPT_ERROR="ExecutionStateCorruptError",le.EXECUTION_STATE_OUTPUT_INVALID_ERROR="ExecutionStateOutputInvalidError",le.EXECUTION_STATE_RESULT_INVALID_ERROR="ExecutionStateResultInvalidError",le.INVALID_ACTION_ERROR="InvalidActionError",le.METHOD_NOT_ALLOWED_ERROR="MethodNotAllowedError",le.MISSING_DEPENDENCY_ERROR="MissingDependencyError",le.MISSING_SECRET_KEY_ERROR="MissingSecretKeyError",le.PROVIDER_EXECUTION_FAILED_ERROR="ProviderExecutionFailedError",le.PROVIDER_NOT_FOUND_ERROR="ProviderNotFoundError",le.SIGNATURE_EXPIRED_ERROR="SignatureExpiredError",le.SIGNATURE_INVALID_ERROR="SignatureInvalidError",le.SIGNATURE_MISMATCH_ERROR="SignatureMismatchError",le.SIGNATURE_NOT_FOUND_ERROR="SignatureNotFoundError",le.SIGNATURE_VERSION_INVALID_ERROR="SignatureVersionInvalidError",le.SIGNING_KEY_NOT_FOUND_ERROR="SigningKeyNotFoundError",le.STEP_ALREADY_EXISTS_ERROR="StepAlreadyExistsError",le.STEP_CONTROL_COMPILATION_FAILED_ERROR="StepControlCompilationFailedError",le.STEP_EXECUTION_FAILED_ERROR="StepExecutionFailedError",le.STEP_NOT_FOUND_ERROR="StepNotFoundError",le.WORKFLOW_ALREADY_EXISTS_ERROR="WorkflowAlreadyExistsError",le.WORKFLOW_NOT_FOUND_ERROR="WorkflowNotFoundError",le.WORKFLOW_PAYLOAD_INVALID_ERROR="WorkflowPayloadInvalidError",le))(We||{});var Ht=(u=>(u.POST="POST",u.GET="GET",u.OPTIONS="OPTIONS",u))(Ht||{});var zt=(j=>(j.EMAIL="email",j.SMS="sms",j.PUSH="push",j.CHAT="chat",j.IN_APP="in_app",j))(zt||{});var Mo=b=>{var o,u;if(typeof b!="object"||b===null)return!1;let r=Object.getPrototypeOf(b);return(u=(o=r==null?void 0:r.constructor)==null?void 0:o.name.endsWith("Error"))!=null?u:!1},et=class extends Error{},Xt=class extends et{constructor(){super(...arguments);this.statusCode=404}},Ce=class extends et{constructor(){super(...arguments);this.statusCode=400}},it=class extends et{constructor(){super(...arguments);this.statusCode=401}},rt=class extends et{constructor(r,{cause:o}={}){var u;Mo(o)?(super(`${r}: ${o.message}`),this.data={stack:(u=o.stack)!=null?u:r}):(super(`${r}${o?`: ${JSON.stringify(o,null,2)}`:""}`),this.data={stack:r})}},Qt=class extends et{constructor(){super(...arguments);this.statusCode=409}};var mt=class extends rt{constructor(o){super("Unknown BridgeError",{cause:o});this.statusCode=500;this.code="BridgeError"}};var Zt=class extends Ce{constructor(o,u){super(`Workflow with id: \`${o}\` has a corrupt state. Step with id: \`${u}\` does not exist. Please provide the missing state.`);this.code="ExecutionStateCorruptError";this.data={workflowId:o,stepId:u}}},Nt=class extends Ce{constructor(o,u){super(`Workflow with id: \`${o}\` has invalid \`payload\`. Please provide the correct event payload.`);this.code="ExecutionEventPayloadInvalidError";this.data=u}},en=class extends Ce{constructor(o,u){super(`Workflow with id: \`${o}\` has invalid \`controls\`. Please provide the correct event controls.`);this.code="ExecutionEventControlInvalidError";this.data=u}},tn=class extends Ce{constructor(o,u,v){super(`Workflow with id: \`${o}\` has an invalid state. Step with id: \`${u}\` has invalid \`controls\`. Please provide the correct step controls.`);this.code="ExecutionStateControlInvalidError";this.data=v}},nn=class extends Ce{constructor(o,u,v){super(`Workflow with id: \`${o}\` has an invalid state. Step with id: \`${u}\` has invalid output. Please provide the correct step output.`);this.code="ExecutionStateOutputInvalidError";this.data=v}},rn=class extends Ce{constructor(o,u,v){super(`Workflow with id: \`${o}\` has an invalid state. Step with id: \`${u}\` has invalid result. Please provide the correct step result.`);this.code="ExecutionStateResultInvalidError";this.data=v}},sn=class extends Ce{constructor(o,u,v){super(`Workflow with id: \`${o}\` has invalid controls syntax in step with id: \`${u}\`. Please correct step control syntax.`);this.code="StepControlCompilationFailedError";this.data=v}},on=class extends Ce{constructor(o,u,v,j){super(`Workflow with id: \`${o}\` has an invalid state. Step with id: \`${u}\` and provider with id: \`${v}\` has invalid output. Please provide the correct provider output.`);this.code="ExecutionProviderOutputInvalidError";this.data=j}},an=class extends Ce{constructor(o,u){super(`Workflow with id: \`${o}\` has invalid \`payload\`. Please provide the correct payload.`);this.code="WorkflowPayloadInvalidError";this.data=u}};var ai=b=>Object.values(b).map(r=>`\`${r}\``).join(", "),ln=b=>b.replaceAll(/(\w)(\w*)/g,(r,o,u)=>o.toUpperCase()+u.toLowerCase()).replaceAll(/[\s-]+/g,""),li=(b,r=0)=>Array.isArray(b)||typeof b=="object"&&b!==null?JSON.stringify(b,null,r).replace(/"/g,"'").replace(/\n/g,"\\n"):String(b);var cn=class extends et{constructor(){super(...arguments);this.code="MethodNotAllowedError";this.statusCode=405;this.message=`Method not allowed. Please use one of ${ai(Ht)}`}},xt=class extends Ce{constructor(o,u){super(`Invalid query string: \`action\`=\`${o}\`. Please use one of ${ai(u)}`);this.code="InvalidActionError"}},pn=class extends Ce{constructor(){super("Missing secret key. Set the `NOVU_SECRET_KEY` environment variable or pass `secretKey` to the client options.");this.code="MissingSecretKeyError"}};var un=class extends Error{constructor(r,o,u){super(),this.data={message:u},this.statusCode=r,this.code=o}};var kt=class extends Qt{constructor(r,o){super(`${ln(r)} with id: \`${o}\` already exists. Please use a different id.`)}},st=class extends Xt{constructor(r,o){super(`${ln(r)} with id: \`${o}\` does not exist. Please provide a valid id.`)}},yt=class extends rt{constructor(o,u,v,j){super(`Failed to ${v} ${ln(o)} with id: \`${u}\``,{cause:j});this.statusCode=502}};var dn=class extends st{constructor(o){super("provider",o);this.code="ProviderNotFoundError"}},fn=class extends yt{constructor(o,u,v){super("provider",o,u,v);this.code="ProviderExecutionFailedError"}};var hn=class extends it{constructor(){super("Signature does not match the expected signature. Please ensure the signature provided in the `novu-signature` header is correct and try again.");this.code="SignatureMismatchError"}},mn=class extends it{constructor(){super("Signature not found. Please provide a signature in the `novu-signature` header");this.code="SignatureNotFoundError"}},yn=class extends it{constructor(){super("Signature is invalid. Please provide a valid signature in the `novu-signature` header");this.code="SignatureInvalidError"}},gn=class extends it{constructor(){super(`Signature expired. Please provide a signature with a timestamp no older than ${5} minutes in the \`novu-signature\` header`);this.code="SignatureExpiredError"}},wn=class extends it{constructor(){super("Signature key not found. Please provide a valid key in the Client constructor `config.secretKey`");this.code="SigningKeyNotFoundError"}};var bn=class extends st{constructor(o){super("step",o);this.code="StepNotFoundError"}},Sn=class extends kt{constructor(o){super("step",o);this.code="StepAlreadyExistsError"}},Mt=class extends yt{constructor(o,u,v){super("step",o,u,v);this.code="StepExecutionFailedError"}};var Ct=class extends st{constructor(o){super("workflow",o);this.code="WorkflowNotFoundError"}};var lt=b=>Object.values(We).includes(b==null?void 0:b.code),Or=b=>!lt(b)&&typeof b.statusCode=="number"&&b.statusCode>=400&&b.statusCode<500;var Er=async(b,r)=>{let o=new TextEncoder,u=o.encode(b),v=o.encode(r),j=await crypto.subtle.importKey("raw",u,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),$=await crypto.subtle.sign("HMAC",j,v);return Array.from(new Uint8Array($)).map(ie=>ie.toString(16).padStart(2,"0")).join("")};var Do=require("cross-fetch");var vr=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"){let r=await(await fetch("http://localhost:2022/.well-known/novu")).json();return`${r.tunnelOrigin}${r.route}`}}catch(b){console.error(b)}return""};var Ar=require("@novu/shared");var Tn=(b,r)=>{if(!b)throw new pn;return{post:async(o,u)=>{let v=await fetch(`${r}/v1${o}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${b}`},body:JSON.stringify(u)}),j=await v.json();if(v.ok)return j;throw(0,Ar.checkIsResponseError)(j)?new un(j.statusCode,j.error,j.message):new mt(j)},delete:async o=>(await fetch(`${r}/v1${o}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`ApiKey ${b}`}})).json()}};var ct=at(require("chalk"),1),we={info:b=>ct.default.blue(b),warning:b=>ct.default.yellow(b),error:b=>ct.default.red(b),success:b=>ct.default.green(b),underline:b=>ct.default.underline(b),bold:b=>ct.default.bold(b)},_e={SUCCESS:we.success("\u2714"),ERROR:we.error("\u2717"),WARNING:we.warning("\u26A0"),INFO:we.info("\u2139"),ARROW:we.bold("\u2192"),MOCK:we.info("\u25CB"),HYDRATED:we.bold(we.info("\u2192")),STEP:we.info("\u03C3"),ACTION:we.info("\u03B1"),DURATION:we.info("\u0394"),PROVIDER:we.info("\u2699"),OUTPUT:we.info("\u21E2"),INPUT:we.info("\u21E0"),WORKFLOW:we.info("\u03C9"),STATE:we.info("\u03C3"),EXECUTE:we.info("\u03B5"),PREVIEW:we.info("\u03C1")};function On(b){return b||process.env.NOVU_API_URL||"https://api.novu.co"}function En(b){return b||process.env.NOVU_SECRET_KEY||process.env.NOVU_API_KEY||""}var ci=at(require("sanitize-html"),1),$o={allowedTags:ci.default.defaults.allowedTags.concat(["style","img","html","head","body","link","meta","title"]),allowedAttributes:!1,allowVulnerableTags:!0,parseStyleAttributes:!1,parser:{lowerCaseAttributeNames:!0}},_r=b=>{if(!b)return b;let r=/^/,o=b.match(r),u=(0,ci.default)(b,$o);return o?o[0]+u:u},vn=b=>Object.keys(b).reduce((r,o)=>{let u=b[o];return typeof u=="string"?r[o]=_r(u):Array.isArray(u)?r[o]=u.map(v=>typeof v=="string"?_r(v):typeof v=="object"?vn(v):v):typeof u=="object"&&u!==null?r[o]=vn(u):r[o]=u,r},{});var Pr=at(require("ajv"),1),Ir=at(require("ajv-formats"),1);var Rr=b=>typeof structuredClone=="function"?structuredClone(b):JSON.parse(JSON.stringify(b));var An=class extends rt{constructor(o,u){let v=u.length===1?"it":"them";super(`Tried to use a ${o} in @novu/framework without ${u.join(", ")} installed. Please install ${v} by running \`npm install ${u.join(" ")}\`.`);this.statusCode=500;this.code="MissingDependencyError"}};var _n=async(b,r)=>{let o=new Set;if((await Promise.allSettled(b.map(v=>v.import))).forEach((v,j)=>{let $=b[j];v.status==="fulfilled"&&$.exports.every(pe=>v.value[pe]!==void 0)||o.add($.name)}),o.size>0)throw new An(r,Array.from(o))};var Rn=class{constructor(){this.requiredImports=[];this.ajv=new Pr.default({useDefaults:!0,removeAdditional:"failing"}),(0,Ir.default)(this.ajv),this.compiledSchemas=new Map}async canHandle(r){let o=r.type==="object"||!!r.anyOf||!!r.allOf||!!r.oneOf;return o&&await _n(this.requiredImports,"JSON schema"),o}async validate(r,o){let u=this.compiledSchemas.get(o);u||(u=this.ajv.compile(o),this.compiledSchemas.set(o,u));let v=Rr(r);return u(v)?{success:!0,data:v}:{success:!1,errors:u.errors.map($=>({path:$.instancePath,message:$.message}))}}async transformToJsonSchema(r){return r}};var Pn=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 o=r.safeParseAsync!==void 0;return o&&await _n(this.requiredImports,"Zod schema"),o}async validate(r,o){let u=await o.safeParseAsync(r);return u.success?{success:!0,data:u.data}:{success:!1,errors:u.error.errors.map(v=>({path:`/${v.path.join("/")}`,message:v.message}))}}async transformToJsonSchema(r){let{zodToJsonSchema:o}=await import("zod-to-json-schema");return o(r)}};var In=new Pn,Nn=new Rn,xn=async(b,r)=>{if(await In.canHandle(b))return In.validate(r,b);if(await Nn.canHandle(b))return Nn.validate(r,b);throw new Error("Invalid schema")},Ne=async b=>{if(await In.canHandle(b))return In.transformToJsonSchema(b);if(await Nn.canHandle(b))return Nn.transformToJsonSchema(b);throw new Error("Invalid schema")};var kn=(()=>{var b=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,v=(e,t)=>function(){return e&&(t=(0,e[o(e)[0]])(e=0)),t},j=(e,t)=>function(){return t||(0,e[o(e)[0]])((t={exports:{}}).exports,t),t.exports},$=(e,t)=>{for(var n in t)b(e,n,{get:t[n],enumerable:!0})},ie=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of o(t))!u.call(e,c)&&c!==n&&b(e,c,{get:()=>t[c],enumerable:!(l=r(t,c))||l.enumerable});return e},pe=e=>ie(b({},"__esModule",{value:!0}),e),ve={};$(ve,{JSONSchemaFaker:()=>wr,default:()=>br,setDependencies:()=>Mi});function Le(e,t){return typeof e=="string"?typeof t!="undefined"?Et.register(e,t):Et.get(e):Et.registerMany(e)}function $e(e,t){return e=typeof e=="undefined"?He.MIN_INTEGER:e,t=typeof t=="undefined"?He.MAX_INTEGER:t,Math.floor(ee("random")()*(t-e+1))+e}function Re(e){return jt.default.prototype.max=ee("defaultRandExpMax"),jt.default.prototype.randInt=(n,l)=>n+Math.floor(ee("random")()*(1+(l-n))),new jt.default(e).gen()}function De(e){return e[Math.floor(ee("random")()*e.length)]}function Fe(e){let t,n,l=e.length,c=e.slice();for(;l>0;)n=Math.floor(ee("random")()*l),l-=1,t=c[l],c[l]=c[n],c[n]=t;return c}function ot(e,t){return ee("random")()*(t-e)+e}function Je(e,t,n,l,c=!1){return n=typeof n=="undefined"?He.MIN_NUMBER:n,l=typeof l=="undefined"?He.MAX_NUMBER:l,e=typeof e=="undefined"?n:e,t=typeof t=="undefined"?l:t,t0;){let f=l.shift();if(!c[f])throw new Error(`Prop not found: ${f} (${t})`);c=c[f]}return c}function Ut(e){return typeof e=="string"&&Vi.test(e)}function Ge(e){return["number","boolean"].includes(typeof e)}function Ke(e,...t){return t.filter(n=>typeof e[n]!="undefined").length>0}function hi(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,n,l]=e.split("T")[0].split("-");return n=`0${Math.max(1,Math.min(12,n))}`.slice(-2),l=`0${Math.max(1,Math.min(31,l))}`.slice(-2),`${t}-${n}-${l}`}function ys(e){if(e.includes(" "))return new Date(e).toISOString().substr(0,10);let[t,n]=e.split("T"),[l,c,f]=t.split("-"),[d,T,L]=n.substr(0,8).split(":");return c=`0${Math.max(1,Math.min(12,c))}`.slice(-2),f=`0${Math.max(1,Math.min(31,f))}`.slice(-2),d=`0${Math.max(1,Math.min(23,d))}`.slice(-2),T=`0${Math.max(1,Math.min(59,T))}`.slice(-2),L=`0${Math.max(1,Math.min(59,L))}`.slice(-2),`${l}-${c}-${f}T${d}:${T}:${L}.000Z`}function gs(e,t,n){let l={};switch(e||t.type){case"integer":case"number":if(typeof t.minimum!="undefined"&&(l.minimum=t.minimum),typeof t.maximum!="undefined"&&(l.maximum=t.maximum),t.enum){let f=Math.max(l.minimum||0,0),d=Math.min(l.maximum||1/0,1/0);t.exclusiveMinimum&&f===t.minimum&&(f+=t.multipleOf||1),t.exclusiveMaximum&&d===t.maximum&&(d-=t.multipleOf||1),(f||d!==1/0)&&(t.enum=t.enum.filter(T=>T>=f&&T<=d))}break;case"string":{l.minLength=ee("minLength")||0,l.maxLength=ee("maxLength")||Number.MAX_SAFE_INTEGER,typeof t.minLength!="undefined"&&(l.minLength=Math.max(l.minLength,t.minLength)),typeof t.maxLength!="undefined"&&(l.maxLength=Math.min(l.maxLength,t.maxLength));break}default:break}let c=n(l);if(c==null)return null;switch(e||t.type){case"number":c=Ut(c)?parseFloat(c):c;break;case"integer":c=Ut(c)?parseInt(c,10):c;break;case"boolean":c=!!c;break;case"string":{if(Ge(c))return c;c=String(c);let f=Math.max(l.minLength||0,0),d=Math.min(l.maxLength||1/0,1/0),T,L=0;for(;c.lengthd&&(c=c.substr(0,d)),t.format){case"date-time":case"datetime":c=new Date(ys(c)).toISOString().replace(/([0-9])0+Z$/,"$1Z");break;case"full-date":case"date":c=new Date(hi(c)).toISOString().substr(0,10);break;case"time":c=new Date(`1969-01-01 ${c}`).toISOString().substr(11);break;default:break}break}default:break}return c}function dt(e,t){return Object.keys(t).forEach(n=>{typeof t[n]!="object"||t[n]===null?e[n]=t[n]:Array.isArray(t[n])?(e[n]=e[n]||[],t[n].forEach((l,c)=>{e.type==="array"&&t.type==="array"?e[n][c]=dt(e[n][c]||{},l,!0):Array.isArray(e[n])&&e[n].indexOf(l)===-1&&e[n].push(l)})):typeof e[n]!="object"||e[n]===null||Array.isArray(e[n])?e[n]=dt({},t[n]):e[n]=dt(e[n],t[n])}),e}function le(e,t=new Map){if(!e||typeof e!="object")return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let l=[];return t.set(e,l),l.push(...e.map(c=>le(c,t))),l}let n={};return t.set(e,n),Object.keys(e).reduce((l,c)=>(l[c]=le(e[c],t),l),n)}function ws(e){let t=JSON.stringify(e),n=JSON.stringify(e,null,2);return t.length>400?`${n.substr(0,400)}...`:n}function mi(){return Q.pick([!1,!0,null,-1,NaN,Math.PI,1/0,void 0,[],{},Math.random(),Math.random().toString(36).substr(2)])}function bs(e,t){if(e.enum)return e.enum.includes(t);if(e.const)return e.const===t}function Ss(e,t){let n=dt({},t);if(typeof e.minimum!="undefined"&&(n.maximum=e.minimum,n.exclusiveMaximum=!0),typeof e.maximum!="undefined"&&(n.minimum=e.maximum>n.maximum?0:e.maximum,n.exclusiveMinimum=!0),typeof e.minLength!="undefined"&&(n.maxLength=e.minLength),typeof e.maxLength!="undefined"&&(n.minLength=e.maxLength>n.maxLength?0:e.maxLength),e.type)n.type=Q.pick(He.SCALAR_TYPES.filter(l=>(Array.isArray(e.type)?e.type:[e.type]).every(f=>l==="number"||l==="integer"?f!=="number"&&f!=="integer":l!==f)));else if(e.enum){let l;do l=mi();while(e.enum.indexOf(l)!==-1);n.enum=[l]}return e.required&&n.properties&&e.required.forEach(l=>{delete n.properties[l]}),n}function Un(e,t){let n=t.minimum!==void 0,l=t.maximum!==void 0;return(n||l)&&(!n||e>=t.minimum)&&(!l||e<=t.maximum)}function Ts(e,t){return!t.every(n=>Un(e,n))}function Os(e,t){return t.reduce((l,c)=>l+(Un(e,c)?1:0),0)===1}function Es(e){return["enum","const","default","examples","required","definitions","items","properties"].includes(e)}function vs(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,l)=>(Array.isArray(e[l])?n[l]=e[l].slice():n[l]=e[l]instanceof Object?dt({},e[l]):e[l],n),{})}function yi(e,t){return Array.isArray(e)?e.map(n=>yi(n,t)):(typeof e=="string"&&(e=e.replace(/#\{([\w.-]+)\}/g,(n,l)=>t[l])),e)}function Fn(e){return Object.prototype.toString.call(e)==="[object Object]"&&!Object.keys(e).length}function gi(e,t){t=t.items||t;let n=ee("alwaysFakeOptionals"),l=Array.isArray(t.required)&&t.required.includes(e)||n,c=typeof t.thunk=="function"||t.additionalProperties&&typeof t.additionalProperties.thunk=="function";return!l&&!c}function jn(e,t,n=!1){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(l=>jn(l,t,!0)).filter(l=>typeof l!="undefined");if(Object.keys(e).forEach(l=>{if(Fn(e[l]))gi(l,t)&&delete e[l];else{let c=t;t&&t.properties&&t.properties[l]&&(c=t.properties[l]);let f=jn(e[l],c);Fn(f)||(e[l]=f)}typeof e[l]=="undefined"&&delete e[l]}),!(!Object.keys(e).length&&n))return e}function As(e){return(t,n,l,c)=>{let f=t,d=[];typeof t=="object"&&(f=Object.keys(t)[0],Array.isArray(t[f])?d=t[f]:d.push(t[f]));let T=f.split("."),L=e();for(;T.length>1;)L=L[T.shift()];return t=typeof L=="object"?L[T[0]]:L,typeof t=="function"&&(t=t.apply(L,d.map(S=>de.template(S,c)))),Object.prototype.toString.call(t)==="[object Object]"&&Object.keys(t).forEach(S=>{if(typeof t[S]=="function")throw new Error(`Cannot resolve value for '${l}: ${f}', given: ${t}`)}),t}}function _s(e,t){if(typeof e=="undefined")return ht.list();if(typeof e=="string")if(typeof t=="function")ht.register(e,t);else if(t===null||t===!1)ht.unregister(e);else return ht.get(e);else ht.registerMany(e)}function Rs(e,t,n){return Object.keys(e).filter(l=>{let c=Gi.indexOf(t)>-1;return n.indexOf(l)>-1&&!c}).length>0}function Ps(e,t){let n=Object.keys(vt);for(let l=0;l.5}function Ns(){return null}function xs(e,t,n,l,c,f){let d=[],T=[];function L(U){let A=JSON.stringify(U.value);return T.indexOf(A)===-1?(T.push(A),d.push(U),!0):!1}t.forEach(L);let S=100;for(;d.length!==t.length&&(L(f(n.items||l,e,c))||(S-=1),!!S););return d}function ks(e,t,n,l){let c=[];if(!(e.items||e.additionalItems)){if(de.hasProperties(e,"minItems","maxItems","uniqueItems")&&(e.minItems!==0||e.maxItems!==0))throw new Yt(`missing items for ${de.short(e)}`,t);return c}if(Array.isArray(e.items))return e.items.map((W,oe)=>{let X=t.concat(["items",oe]);return l(W,X,n)});let f=e.minItems,d=e.maxItems,T=ee("minItems"),L=ee("maxItems");T&&(f=typeof f=="undefined"?T:Math.min(T,f)),L&&(d=typeof d=="undefined"?L:Math.min(L,d),d&&d>L&&(d=L),f&&f>L&&(f=d));let S=ee("alwaysFakeOptionals")===!0?1:ee("optionalsProbability"),U=ee("alwaysFakeOptionals")||ee("fixedProbabilities")||!1,A=Q.number(f,d,1,5);S!==null&&(A=Math.max(U?Math.round((d||A)*S):Math.abs(Q.number(f,d)*S),f||0));let q=typeof e.additionalItems=="object"?e.additionalItems:{};for(let W=c.length;W0){let W=Q.number(0,A-1);c[W]=l(e.contains,t.concat(["items",W]),n)}return e.uniqueItems?xs(t.concat(["items"]),c,e,q,n,l):c}function Ms(e){let t=typeof e.minimum=="undefined"||e.minimum===-Number.MAX_VALUE?He.MIN_INTEGER:e.minimum,n=typeof e.maximum=="undefined"||e.maximum===Number.MAX_VALUE?He.MAX_INTEGER:e.maximum,l=e.multipleOf,c=l&&String(l).match(/e-(\d)|\.(\d+)$/);if(c){let f=(Math.random()*Q.number(0,10)+1)*l,d=c[1]||c[2].length,T=parseFloat(f.toFixed(d)),L=Q.number(t,n-1);return String(T).includes(".")?L+T:(L+T).toExponential()}if(l&&(n=Math.floor(n/l)*l,t=Math.ceil(t/l)*l),e.exclusiveMinimum&&t===e.minimum&&(t+=l||1),e.exclusiveMaximum&&n===e.maximum&&(n-=l||1),t>n)return NaN;if(l){let f=Q.number(Math.floor(t/l),Math.floor(n/l))*l;for(;f(T.indexOf(h)===-1&&Y.push(h),Y),[]),q=T.concat(A),W=L&&e.additionalProperties===!0?Vt:e.additionalProperties;if(!L&&S.length===0&&U.length===0&&de.hasProperties(e,"minProperties","maxProperties","dependencies","required"))return null;if(ee("requiredOnly")===!0)return T.forEach(Y=>{f[Y]&&(c[Y]=f[Y])}),l(c,t.concat(["properties"]),n,e);let oe=ee("alwaysFakeOptionals")===!0?1:ee("optionalsProbability"),X=ee("alwaysFakeOptionals")||ee("fixedProbabilities")||!1,te=ee("ignoreProperties")||[],he=ee("reuseProperties"),ye=ee("fillProperties"),F=e.maxProperties||q.length+(L?Q.number(1,5):0),g=Math.max(e.minProperties||0,T.length),w=Math.max(0,q.length-g);q.length===1&&!T.length&&(g=Math.max(Q.number(ye?1:0,F),g)),oe!==null&&(X===!0?w=Math.round(g-T.length+oe*(q.length-g)):w=Q.number(g-T.length,oe*(q.length-g)));let R=Q.shuffle(A).slice(0,w),I=A.filter(Y=>R.indexOf(Y)!==-1),M=oe!==null||T.length===F?F:Q.number(0,F),_=T.concat(Q.shuffle(I).slice(0,M)).slice(0,F),N=[],k=[];if(e.dependencies&&(Object.keys(e.dependencies).forEach(Y=>{let h=e.dependencies[Y];if(_.indexOf(Y)!==-1)if(Array.isArray(h))h.forEach(x=>{_.indexOf(x)===-1&&_.push(x)});else if(Array.isArray(h.oneOf||h.anyOf)){let x=h.oneOf||h.anyOf;k.push({prop:Y,values:x})}else N.push(h)}),N.length))return delete e.dependencies,l({allOf:N.concat(e)},t.concat(["properties"]),n,e);let V=[],J=[];_.forEach(Y=>{if(f[Y]&&["{}","true"].includes(JSON.stringify(f[Y].not)))return;for(let x=0;x{Y.match(new RegExp(x))&&(h=!0,c[Y]?de.merge(c[Y],d[x]):c[Q.randexp(Y)]=d[x])}),!h){let x=d[Y]||W;x&&W!==!1?c[d[Y]?Q.randexp(Y):Y]=f[Y]||x:J.push(Y)}});let Z=Object.keys(c).length+(ye?0:V.length),Te=Y=>Q.randexp(`_?[_a-f\\d]{1,3}${Y?"\\$?":""}`);function Oe(Y){let h;do{if(!Y.length)break;h=Y.shift()}while(c[h]);return h}let Ae=g;if(L&&!T.length&&(Ae=Math.max(oe===null||W?Q.number(ye?1:0,F):0,g)),!I.length&&!w&&L&&X===!0&&ye){let Y=Q.number(0,F);for(let h=0;h=Ae);){if(L)if(he&&S.length-Z>Ae){let Y=0,h;do{if(Y+=1,Y>1e3)break;h=Oe(T)||Q.pick(S)}while(typeof c[h]!="undefined");typeof c[h]=="undefined"&&(c[h]=f[h],Z+=1)}else if(U.length&&!W){let Y=Q.pick(U),h=Q.randexp(Y);c[h]||(c[h]=d[Y],Z+=1)}else{let Y=Oe(T)||Wt(1)+Te();c[Y]||(c[Y]=W||Vt,Z+=1)}for(let Y=0;Zee("sortProperties")?x.localeCompare(G):Y.indexOf(x)-Y.indexOf(G)).reduce((x,G)=>(x[G]=c[G],x),{})}let xe=l(Pe,t.concat(["properties"]),n,e);return k.forEach(Y=>{for(let h of Y.values)if(de.hasValue(h.properties[Y.prop],xe.value[Y.prop])){Object.keys(h.properties).forEach(x=>{x!==Y.prop&&de.merge(xe.value,l(h.properties,t.concat(["properties"]),n,e).value)});break}}),xe}function wi(){let e=Q.number(1,5);return Wt(e).join(" ")}function $s(e=0,t=140){let n=Math.max(0,e),l=Q.number(n,t),c=wi();for(;c.lengthl&&(c=c.substr(0,l)),c}function Us(){return[0,0,0,0].map(()=>Q.number(0,255)).join(".")}function Fs(){return Q.date().toISOString()}function js(){return Bt().slice(0,10)}function Ys(){return Bt().slice(11)}function Ws(e){return Q.randexp(je[e]).replace(cr,(t,n)=>Q.randexp(je[n]))}function Vs(e,t){let n=ei(e.format);if(typeof n=="function")return n(e);switch(e.format){case"date-time":case"datetime":return Bt();case"date":return or();case"time":return ar();case"ipv4":return sr();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 pr(e.format);default:if(typeof n=="undefined"){if(ee("failOnInvalidFormat"))throw new Error(`unknown registry key ${de.short(e.format)}`);return t()}throw new Error(`unsupported format '${e.format}'`)}}function Bs(e){return de.typecast("string",e,n=>e.format?Vs(e,()=>ni(n.minLength,n.maxLength)):e.pattern?Q.randexp(e.pattern):ni(n.minLength,n.maxLength))}function qs({$comment:e,title:t,description:n}){return Object.entries({comment:e,title:t,description:n}).filter(([,l])=>l).reduce((l,[c,f])=>(l[c]=f,l),{})}function ft(e,t,n,l){if(e=n(e,null,t),e&&(e.oneOf||e.anyOf||e.allOf)&&(e=n(e,null,t)),!e)throw new Error(`Cannot traverse at '${t.join(".")}', given '${JSON.stringify(l)}'`);let c={...qs(e),schemaPath:t};if(t[t.length-1]!=="properties"){if(ee("useExamplesValue")&&Array.isArray(e.examples)){let S=e.examples.concat("default"in e?[e.default]:[]);return{value:de.typecast(null,e,()=>Q.pick(S)),context:c}}if(ee("useExamplesValue")&&typeof e.example!="undefined")return{value:de.typecast(null,e,()=>e.example),context:c};if(ee("useDefaultValue")&&"default"in e&&(e.default!==""||!ee("replaceEmptyByRandomValue")))return{value:e.default,context:c};if("template"in e)return{value:de.template(e.template,l),context:c};if("const"in e)return{value:e.const,context:c}}if(e.not&&typeof e.not=="object"&&(e=de.notValue(e.not,de.omitProps(e,["not"])),e.type&&e.type==="object")){let{value:S,context:U}=ft(e,t.concat(["not"]),n,l);return{value:de.clean(S,e,!1),context:{...c,items:U}}}if(typeof e.thunk=="function"){let{value:S,context:U}=ft(e.thunk(l),t,n);return{value:S,context:{...c,items:U}}}if(e.jsonPath)return{value:e,context:c};let f=e.type;if(Array.isArray(f)?f=Q.pick(f):typeof f=="undefined"&&(f=Ki(e,t)||f,f&&(e.type=f)),typeof e.generate=="function"){let S=de.typecast(null,e,()=>e.generate(l,t)),U=S===null?"null":typeof S;if(U===f||U==="number"&&f==="integer"||Array.isArray(S)&&f==="array")return{value:S,context:c}}if(typeof e.pattern=="string")return{value:de.typecast("string",e,()=>Q.randexp(e.pattern)),context:c};if(Array.isArray(e.enum))return{value:de.typecast(null,e,()=>Q.pick(e.enum)),context:c};if(typeof f=="string")if(At[f])try{let S=At[f](e,t,n,ft);return f==="array"?{value:S.map(({value:U})=>U),context:{...c,items:S.map(Array.isArray(e.items)?({context:U})=>U:({context:U})=>({...U,schemaPath:U.schemaPath.slice(0,-1)}))}}:f==="object"?S!==null?{value:S.value,context:{...c,items:S.context}}:{value:{},context:c}:{value:S,context:c}}catch(S){throw typeof S.path=="undefined"?new Yt(S.stack,t):S}else{if(ee("failOnInvalidTypes"))throw new Yt(`unknown primitive ${de.short(f)}`,t.concat(["type"]));{let S=ee("defaultInvalidTypeProduct");return typeof S=="string"&&At[S]?{value:At[S](e,t,n,ft),context:c}:{value:S,context:c}}}let d={},T={...c};Array.isArray(e)&&(d=[]);let L=ee("pruneProperties")||[];return Object.keys(e).forEach(S=>{if(!L.includes(S)&&e[S]!==null)if(typeof e[S]=="object"&&S!=="definitions"){let{value:U,context:A}=ft(e[S],t.concat([S]),n,d);d[S]=de.clean(U,e[S],!1),T[S]=A,d[S]===null&&ee("omitNulls")&&(delete d[S],delete T[S])}else d[S]=e[S]}),{value:d,context:T}}function Js(e){return Array.isArray(e)?Q.pick(e):e}function Gs(e,t){if(!Array.isArray(e))return e;let n=t?e.pop():e.shift();return t?e.unshift(n):e.push(n),n}function Yn(e,t,n,l){if(!e||typeof e!="object")return e;if(n||(n={}),t||(t=e),Array.isArray(e))return e.map(c=>Yn(c,t,n,l));if(e.jsonPath){let{JSONPath:c}=Hn(),f=typeof e.jsonPath!="object"?{path:e.jsonPath}:e.jsonPath;f.group=e.group||f.group||l,f.cycle=e.cycle||f.cycle||!1,f.reverse=e.reverse||f.reverse||!1,f.count=e.count||f.count||1;let d=`${f.group}__${f.path}`;return n[d]||(f.count>1?n[d]=c(f.path,t).slice(0,f.count):n[d]=c(f.path,t)),f.cycle||f.reverse?Gs(n[d],f.reverse):Js(n[d])}return Object.keys(e).forEach(c=>{e[c]=Yn(e[c],t,n,c)}),e}function Ks(e,t,n,l){if(Object.prototype.toString.call(t)!=="[object Object]")throw new Error(`Invalid input, expecting object but given ${typeof t}`);let c=ee("refDepthMin")||0,f=ee("refDepthMax")||3;try{let{resolveSchema:d}=mr({refs:e,schema:t,container:n,synchronous:l,refDepthMin:c,refDepthMax:f}),T=fr(de.clone(t),[],d);return ee("resolveJsonPath")?{value:Yn(T.value),context:T.context}:T}catch(d){throw d.path?new Error(`${d.message} in /${d.path.join("/")}`):d}}function Hs(e){return e.value}function zs(e,t){return t.reduce((n,l)=>l in n?n[l]:{},e)}function Wn(e,t,n,l=n){let{title:c,description:f,comment:d}=zs(e,t),T=[];ee("renderTitle")&&c&&T.push(` ${c}`,""),ee("renderDescription")&&f&&T.push(` ${f}`),ee("renderComment")&&d&&T.push(` ${d}`),n.commentBefore=T.join(` `),l instanceof yr?l.items.forEach(L=>{Wn(e,[...t,"items",L.key.value],L.key,L.value)}):l instanceof gr&&l.items.forEach((L,S)=>{Wn(e,[...t,"items",S],L)})}function Xs({value:e,context:t}){let n=_t.createNode(e);Wn(t,[],n);let l=new _t.Document;return l.contents=n,l.toString()}function bi(){Xe.define("autoIncrement",function(t,n){if(!this.offset){let l=n.minimum||1,c=l+He.MAX_NUMBER,f=t.initialOffset||n.initialOffset;this.offset=f||Q.number(l,c)}return t?this.offset++:n}),Xe.define("sequentialDate",function(t,n){if(this.now||(this.now=Q.date()),t){if(n=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()+Q.date(t))}return n})}function Si(e,t){let n={};Array.isArray(e)?e.forEach(c=>{n[c.$id||c.id]=c}):n=e||{};function l(c){if(!c||typeof c!="object")return;if(Array.isArray(c))return c.forEach(l);let f=c.$id||c.id;typeof f=="string"&&!n[f]&&(n[f]=c),Object.keys(c).forEach(d=>{l(c[d])})}return l(e),l(t),n}var Ti,Vn,Oi,Bn,Ei,vi,Ue,Ai,qn,D,Jn,_i,Ri,Pi,Ii,Ni,Ot,Ft,Gn,xi,ki,Kn,Hn,Mi,Ci,zn,ue,Xn,Li,Di,Et,ee,Qn,Zn,$i,Ui,Fi,ji,Yi,Wi,He,jt,Q,Vi,de,Bi,qi,ht,ei,Ji,Yt,vt,Gi,Ki,Hi,zi,Xi,Qi,Zi,er,tr,ti,nr,ir,Wt,Vt,rr,ni,sr,Bt,or,ar,ii,qt,lr,je,cr,pr,ur,dr,At,fr,hr,mr,ri,si,ke,Qs,Zs,eo,to,no,io,ro,so,oo,ao,lo,co,yr,gr,_t,Xe,Se,wr,br,po=v({"src/shared.js"(){Ti=Object.create,Vn=Object.defineProperty,Oi=Object.getOwnPropertyDescriptor,Bn=Object.getOwnPropertyNames,Ei=Object.getPrototypeOf,vi=Object.prototype.hasOwnProperty,Ue=(e,t)=>function(){return t||(0,e[Bn(e)[0]])((t={exports:{}}).exports,t),t.exports},Ai=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of Bn(t))!vi.call(e,c)&&c!==n&&Vn(e,c,{get:()=>t[c],enumerable:!(l=Oi(t,c))||l.enumerable});return e},qn=(e,t,n)=>(n=e!=null?Ti(Ei(e)):{},Ai(t||!e||!e.__esModule?Vn(n,"default",{value:e,enumerable:!0}):n,e)),D=Ue({"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}}}),Jn=Ue({"node_modules/ret/lib/sets.js"(e){var t=D(),n=()=>[{type:t.RANGE,from:48,to:57}],l=()=>[{type:t.CHAR,value:95},{type:t.RANGE,from:97,to:122},{type:t.RANGE,from:65,to:90}].concat(n()),c=()=>[{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}],f=()=>[{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:l(),not:!1}),e.notWords=()=>({type:t.SET,set:l(),not:!0}),e.ints=()=>({type:t.SET,set:n(),not:!1}),e.notInts=()=>({type:t.SET,set:n(),not:!0}),e.whitespace=()=>({type:t.SET,set:c(),not:!1}),e.notWhitespace=()=>({type:t.SET,set:c(),not:!0}),e.anyChar=()=>({type:t.SET,set:f(),not:!0})}}),_i=Ue({"node_modules/ret/lib/util.js"(e){var t=D(),n=Jn(),l="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",c={0:0,t:9,n:10,v:11,f:12,r:13};e.strToChars=function(f){var d=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return f=f.replace(d,function(T,L,S,U,A,q,W,oe){if(S)return T;var X=L?8:U?parseInt(U,16):A?parseInt(A,16):q?parseInt(q,8):W?l.indexOf(W):c[oe],te=String.fromCharCode(X);return/[[\]{}^$.|?*+()]/.test(te)&&(te="\\"+te),te}),f},e.tokenizeClass=(f,d)=>{for(var T=[],L=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,S,U;(S=L.exec(f))!=null;)if(S[1])T.push(n.words());else if(S[2])T.push(n.ints());else if(S[3])T.push(n.whitespace());else if(S[4])T.push(n.notWords());else if(S[5])T.push(n.notInts());else if(S[6])T.push(n.notWhitespace());else if(S[7])T.push({type:t.RANGE,from:(S[8]||S[9]).charCodeAt(0),to:S[10].charCodeAt(0)});else if(U=S[12])T.push({type:t.CHAR,value:U.charCodeAt(0)});else return[T,L.lastIndex];e.error(d,"Unterminated character class")},e.error=(f,d)=>{throw new SyntaxError("Invalid regular expression: /"+f+"/: "+d)}}}),Ri=Ue({"node_modules/ret/lib/positions.js"(e){var t=D();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:"$"})}}),Pi=Ue({"node_modules/ret/lib/index.js"(e,t){var n=_i(),l=D(),c=Jn(),f=Ri();t.exports=d=>{var T=0,L,S,U={type:l.ROOT,stack:[]},A=U,q=U.stack,W=[],oe=I=>{n.error(d,`Nothing to repeat at column ${I-1}`)},X=n.strToChars(d);for(L=X.length;Tf.high)}touches(f){return!(this.high+1f.high)}add(f){return new gt(Math.min(this.low,f.low),Math.max(this.high,f.high))}subtract(f){return f.low<=this.low&&f.high>=this.high?[]:f.low>this.low&&f.highf+d.length,0)}add(f,d){var T=L=>{for(var S=0;S{for(var S=0;S{for(var U=0;U{for(var T=d.low;T<=d.high;)f.push(T),T++;return f},[])}subranges(){return this.ranges.map(f=>({low:f.low,high:f.high,length:1+f.high-f.low}))}};t.exports=l}}),Ni=Ue({"node_modules/randexp/lib/randexp.js"(e,t){var n=Pi(),l=Ii(),c=n.types;t.exports=class Dt{constructor(d,T){if(this._setDefaults(d),d instanceof RegExp)this.ignoreCase=d.ignoreCase,this.multiline=d.multiline,d=d.source;else if(typeof d=="string")this.ignoreCase=T&&T.indexOf("i")!==-1,this.multiline=T&&T.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=n(d)}_setDefaults(d){this.max=d.max!=null?d.max:Dt.prototype.max!=null?Dt.prototype.max:100,this.defaultRange=d.defaultRange?d.defaultRange:this.defaultRange.clone(),d.randInt&&(this.randInt=d.randInt)}gen(){return this._gen(this.tokens,[])}_gen(d,T){var L,S,U,A,q;switch(d.type){case c.ROOT:case c.GROUP:if(d.followedBy||d.notFollowedBy)return"";for(d.remember&&d.groupNumber===void 0&&(d.groupNumber=T.push(null)-1),L=d.options?this._randSelect(d.options):d.stack,S="",A=0,q=L.length;AR.length)return null;for(let M=0;M=1)||F>w.length)return null;let I=w[F-1],M=w[F];for(;M&&M>I&&R[M-1]===` `;)--M;return R.slice(I,M)}function S({start:F,end:g},w,R=80){let I=L(F.line,w);if(!I)return null;let{col:M}=F;if(I.length>R)if(M<=R-10)I=I.substr(0,R-1)+"\u2026";else{let J=Math.round(R/2);I.length>M+J&&(I=I.substr(0,M+J-1)+"\u2026"),M-=I.length-R,I="\u2026"+I.substr(1-R)}let _=1,N="";g&&(g.line===F.line&&M+(g.col-F.col)<=R+1?_=g.col-F.col:(_=Math.min(I.length+1,R)-M,N="\u2026"));let k=M>1?" ".repeat(M-1):"",V="^".repeat(_);return`${I} ${k}${V}${N}`}var U=class Nr{static copy(g){return new Nr(g.start,g.end)}constructor(g,w){this.start=g,this.end=w||g}isEmpty(){return typeof this.start!="number"||!this.end||this.end<=this.start}setOrigRange(g,w){let{start:R,end:I}=this;if(g.length===0||I<=g[0])return this.origStart=R,this.origEnd=I,w;let M=w;for(;MR);)++M;this.origStart=R+M;let _=M;for(;M=I);)++M;return this.origEnd=I+M,_}},A=class tt{static addStringTerminator(g,w,R){if(R[R.length-1]===` `)return R;let I=tt.endOfWhiteSpace(g,w);return I>=g.length||g[I]===` `?R+` `:R}static atDocumentBoundary(g,w,R){let I=g[w];if(!I)return!0;let M=g[w-1];if(M&&M!==` `)return!1;if(R){if(I!==R)return!1}else if(I!==t.DIRECTIVES_END&&I!==t.DOCUMENT_END)return!1;let _=g[w+1],N=g[w+2];if(_!==I||N!==I)return!1;let k=g[w+3];return!k||k===` `||k===" "||k===" "}static endOfIdentifier(g,w){let R=g[w],I=R==="<",M=I?[` `," "," ",">"]:[` `," "," ","[","]","{","}",","];for(;R&&M.indexOf(R)===-1;)R=g[w+=1];return I&&R===">"&&(w+=1),w}static endOfIndent(g,w){let R=g[w];for(;R===" ";)R=g[w+=1];return w}static endOfLine(g,w){let R=g[w];for(;R&&R!==` `;)R=g[w+=1];return w}static endOfWhiteSpace(g,w){let R=g[w];for(;R===" "||R===" ";)R=g[w+=1];return w}static startOfLine(g,w){let R=g[w-1];if(R===` `)return w;for(;R&&R!==` `;)R=g[w-=1];return w+1}static endOfBlockIndent(g,w,R){let I=tt.endOfIndent(g,R);if(I>R+w)return I;{let M=tt.endOfWhiteSpace(g,I),_=g[M];if(!_||_===` `)return M}return null}static atBlank(g,w,R){let I=g[w];return I===` `||I===" "||I===" "||R&&!I}static nextNodeIsIndented(g,w,R){return!g||w<0?!1:w>0?!0:R&&g==="-"}static normalizeOffset(g,w){let R=g[w];return R?R!==` `&&g[w-1]===` `?w-1:tt.endOfWhiteSpace(g,w):w}static foldNewline(g,w,R){let I=0,M=!1,_="",N=g[w+1];for(;N===" "||N===" "||N===` `;){switch(N){case` `:I=0,w+=1,_+=` `;break;case" ":I<=R&&(M=!0),w=tt.endOfWhiteSpace(g,w+2)-1;break;case" ":I+=1,w+=1;break}N=g[w+1]}return _||(_=" "),N&&I<=R&&(M=!0),{fold:_,offset:w,error:M}}constructor(g,w,R){Object.defineProperty(this,"context",{value:R||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=w||[],this.type=g,this.value=null}getPropValue(g,w,R){if(!this.context)return null;let{src:I}=this.context,M=this.props[g];return M&&I[M.start]===w?I.slice(M.start+(R?1:0),M.end):null}get anchor(){for(let g=0;g0?g.join(` `):null}commentHasRequiredWhitespace(g){let{src:w}=this.context;if(this.header&&g===this.header.end||!this.valueRange)return!1;let{end:R}=this.valueRange;return g!==R||tt.atBlank(w,R-1)}get hasComment(){if(this.context){let{src:g}=this.context;for(let w=0;wR.setOrigRange(g,w)),w}toString(){let{context:{src:g},range:w,value:R}=this;if(R!=null)return R;let I=g.slice(w.start,w.end);return tt.addStringTerminator(g,w.end,I)}},q=class extends Error{constructor(F,g,w){if(!w||!(g instanceof A))throw new Error(`Invalid arguments for new ${F}`);super(),this.name=F,this.message=w,this.source=g}makePretty(){if(!this.source)return;this.nodeType=this.source.type;let F=this.source.context&&this.source.context.root;if(typeof this.offset=="number"){this.range=new U(this.offset,this.offset+1);let g=F&&T(this.offset,F);if(g){let w={line:g.line,col:g.col+1};this.linePos={start:g,end:w}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){let{line:g,col:w}=this.linePos.start;this.message+=` at line ${g}, column ${w}`;let R=F&&S(this.linePos,F);R&&(this.message+=`: ${R} `)}delete this.source}},W=class extends q{constructor(F,g){super("YAMLReferenceError",F,g)}},oe=class extends q{constructor(F,g){super("YAMLSemanticError",F,g)}},X=class extends q{constructor(F,g){super("YAMLSyntaxError",F,g)}},te=class extends q{constructor(F,g){super("YAMLWarning",F,g)}};function he(F,g,w){return g in F?Object.defineProperty(F,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):F[g]=w,F}var ye=class pi extends A{static endOfLine(g,w,R){let I=g[w],M=w;for(;I&&I!==` `&&!(R&&(I==="["||I==="]"||I==="{"||I==="}"||I===","));){let _=g[M+1];if(I===":"&&(!_||_===` `||_===" "||_===" "||R&&_===",")||(I===" "||I===" ")&&_==="#")break;M+=1,I=_}return M}get strValue(){if(!this.valueRange||!this.context)return null;let{start:g,end:w}=this.valueRange,{src:R}=this.context,I=R[w-1];for(;gV?R.slice(V,N+1):k)}else M+=k}let _=R[g];switch(_){case" ":{let N="Plain value cannot start with a tab character";return{errors:[new oe(this,N)],str:M}}case"@":case"`":{let N=`Plain value cannot start with reserved character ${_}`;return{errors:[new oe(this,N)],str:M}}default:return M}}parseBlockValue(g){let{indent:w,inFlow:R,src:I}=this.context,M=g,_=g;for(let N=I[M];N===` `&&!A.atDocumentBoundary(I,M+1);N=I[M]){let k=A.endOfBlockIndent(I,w,M+1);if(k===null||I[k]==="#")break;I[k]===` `?M=k:(_=pi.endOfLine(I,k,R),M=_)}return this.valueRange.isEmpty()&&(this.valueRange.start=g),this.valueRange.end=_,_}parse(g,w){this.context=g;let{inFlow:R,src:I}=g,M=w,_=I[M];return _&&_!=="#"&&_!==` `&&(M=pi.endOfLine(I,w,R)),this.valueRange=new U(w,M),M=A.endOfWhiteSpace(I,M),M=this.parseComment(M),(!this.hasComment||this.valueRange.isEmpty())&&(M=this.parseBlockValue(M)),M}};e.Char=t,e.Node=A,e.PlainValue=ye,e.Range=U,e.Type=n,e.YAMLError=q,e.YAMLReferenceError=W,e.YAMLSemanticError=oe,e.YAMLSyntaxError=X,e.YAMLWarning=te,e._defineProperty=he,e.defaultTagPrefix=l,e.defaultTags=c}}),Ft=Ue({"node_modules/yaml/dist/resolveSeq-d03cb037.js"(e){"use strict";var t=Ot();function n(s,i,a){return a?`#${a.replace(/[\s\S]^/gm,`$&${i}#`)} ${i}${s}`:s}function l(s,i,a){return a?a.indexOf(` `)===-1?`${s} #${a}`:`${s} `+a.replace(/^/gm,`${i||""}#`):s}var c=class{};function f(s,i,a){if(Array.isArray(s))return s.map((p,m)=>f(p,String(m),a));if(s&&typeof s.toJSON=="function"){let p=a&&a.anchors&&a.anchors.get(s);p&&(a.onCreate=y=>{p.res=y,delete a.onCreate});let m=s.toJSON(i,a);return p&&a.onCreate&&a.onCreate(m),m}return(!a||!a.keep)&&typeof s=="bigint"?Number(s):s}var d=class extends c{constructor(s){super(),this.value=s}toJSON(s,i){return i&&i.keep?this.value:f(this.value,s,i)}toString(){return String(this.value)}};function T(s,i,a){let p=a;for(let m=i.length-1;m>=0;--m){let y=i[m];if(Number.isInteger(y)&&y>=0){let O=[];O[y]=p,p=O}else{let O={};Object.defineProperty(O,y,{value:p,writable:!0,enumerable:!0,configurable:!0}),p=O}}return s.createNode(p,!1)}var L=s=>s==null||typeof s=="object"&&s[Symbol.iterator]().next().done,S=class pt extends c{constructor(i){super(),t._defineProperty(this,"items",[]),this.schema=i}addIn(i,a){if(L(i))this.add(a);else{let[p,...m]=i,y=this.get(p,!0);if(y instanceof pt)y.addIn(m,a);else if(y===void 0&&this.schema)this.set(p,T(this.schema,m,a));else throw new Error(`Expected YAML collection at ${p}. Remaining path: ${m}`)}}deleteIn([i,...a]){if(a.length===0)return this.delete(i);let p=this.get(i,!0);if(p instanceof pt)return p.deleteIn(a);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}getIn([i,...a],p){let m=this.get(i,!0);return a.length===0?!p&&m instanceof d?m.value:m:m instanceof pt?m.getIn(a,p):void 0}hasAllNullValues(){return this.items.every(i=>{if(!i||i.type!=="PAIR")return!1;let a=i.value;return a==null||a instanceof d&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn([i,...a]){if(a.length===0)return this.has(i);let p=this.get(i,!0);return p instanceof pt?p.hasIn(a):!1}setIn([i,...a],p){if(a.length===0)this.set(i,p);else{let m=this.get(i,!0);if(m instanceof pt)m.setIn(a,p);else if(m===void 0&&this.schema)this.set(i,T(this.schema,a,p));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${a}`)}}toJSON(){return null}toString(i,{blockItem:a,flowChars:p,isMap:m,itemIndent:y},O,E){let{indent:P,indentStep:C,stringify:B}=i,z=this.type===t.Type.FLOW_MAP||this.type===t.Type.FLOW_SEQ||i.inFlow;z&&(y+=C);let be=m&&this.hasAllNullValues();i=Object.assign({},i,{allNullValues:be,indent:y,inFlow:z,type:null});let re=!1,ge=!1,se=this.items.reduce((Ie,ce,Ee)=>{let fe;ce&&(!re&&ce.spaceBefore&&Ie.push({type:"comment",str:""}),ce.commentBefore&&ce.commentBefore.match(/^.*$/gm).forEach(Ao=>{Ie.push({type:"comment",str:`#${Ao}`})}),ce.comment&&(fe=ce.comment),z&&(!re&&ce.spaceBefore||ce.commentBefore||ce.comment||ce.key&&(ce.key.commentBefore||ce.key.comment)||ce.value&&(ce.value.commentBefore||ce.value.comment))&&(ge=!0)),re=!1;let Me=B(ce,i,()=>fe=null,()=>re=!0);return z&&!ge&&Me.includes(` `)&&(ge=!0),z&&Eefe.str);if(ge||Ee.reduce((fe,Me)=>fe+Me.length+2,2)>pt.maxFlowStringSingleLineLength){me=Ie;for(let fe of Ee)me+=fe?` ${C}${P}${fe}`:` `;me+=` ${P}${ce}`}else me=`${Ie} ${Ee.join(" ")} ${ce}`}else{let Ie=se.map(a);me=Ie.shift();for(let ce of Ie)me+=ce?` ${P}${ce}`:` `}return this.comment?(me+=` `+this.comment.replace(/^/gm,`${P}#`),O&&O()):re&&E&&E(),me}};t._defineProperty(S,"maxFlowStringSingleLineLength",60);function U(s){let i=s instanceof d?s.value:s;return i&&typeof i=="string"&&(i=Number(i)),Number.isInteger(i)&&i>=0?i:null}var A=class extends S{add(s){this.items.push(s)}delete(s){let i=U(s);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(s,i){let a=U(s);if(typeof a!="number")return;let p=this.items[a];return!i&&p instanceof d?p.value:p}has(s){let i=U(s);return typeof i=="number"&&ip.type==="comment"?p.str:`- ${p.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(s.indent||"")+" "},i,a):JSON.stringify(this)}},q=(s,i,a)=>i===null?"":typeof i!="object"?String(i):s instanceof c&&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(i),W=class xr extends c{constructor(i,a=null){super(),this.key=i,this.value=a,this.type=xr.Type.PAIR}get commentBefore(){return this.key instanceof c?this.key.commentBefore:void 0}set commentBefore(i){if(this.key==null&&(this.key=new d(null)),this.key instanceof c)this.key.commentBefore=i;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(i,a){let p=f(this.key,"",i);if(a instanceof Map){let m=f(this.value,p,i);a.set(p,m)}else if(a instanceof Set)a.add(p);else{let m=q(this.key,p,i),y=f(this.value,m,i);m in a?Object.defineProperty(a,m,{value:y,writable:!0,enumerable:!0,configurable:!0}):a[m]=y}return a}toJSON(i,a){let p=a&&a.mapAsMap?new Map:{};return this.addToJSMap(a,p)}toString(i,a,p){if(!i||!i.doc)return JSON.stringify(this);let{indent:m,indentSeq:y,simpleKeys:O}=i.doc.options,{key:E,value:P}=this,C=E instanceof c&&E.comment;if(O){if(C)throw new Error("With simple keys, key nodes cannot have comments");if(E instanceof S){let Me="With simple keys, collection cannot be used as a key value";throw new Error(Me)}}let B=!O&&(!E||C||(E instanceof c?E instanceof S||E.type===t.Type.BLOCK_FOLDED||E.type===t.Type.BLOCK_LITERAL:typeof E=="object")),{doc:z,indent:be,indentStep:re,stringify:ge}=i;i=Object.assign({},i,{implicitKey:!B,indent:be+re});let se=!1,me=ge(E,i,()=>C=null,()=>se=!0);if(me=l(me,i.indent,C),!B&&me.length>1024){if(O)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");B=!0}if(i.allNullValues&&!O)return this.comment?(me=l(me,i.indent,this.comment),a&&a()):se&&!C&&p&&p(),i.inFlow&&!B?me:`? ${me}`;me=B?`? ${me} ${be}:`:`${me}:`,this.comment&&(me=l(me,i.indent,this.comment),a&&a());let Ie="",ce=null;if(P instanceof c){if(P.spaceBefore&&(Ie=` `),P.commentBefore){let Me=P.commentBefore.replace(/^/gm,`${i.indent}#`);Ie+=` ${Me}`}ce=P.comment}else P&&typeof P=="object"&&(P=z.schema.createNode(P,!0));i.implicitKey=!1,!B&&!this.comment&&P instanceof d&&(i.indentAtStart=me.length+1),se=!1,!y&&m>=2&&!i.inFlow&&!B&&P instanceof A&&P.type!==t.Type.FLOW_SEQ&&!P.tag&&!z.anchors.getName(P)&&(i.indent=i.indent.substr(2));let Ee=ge(P,i,()=>ce=null,()=>se=!0),fe=" ";return Ie||this.comment?fe=`${Ie} ${i.indent}`:!B&&P instanceof S?(!(Ee[0]==="["||Ee[0]==="{")||Ee.includes(` `))&&(fe=` ${i.indent}`):Ee[0]===` `&&(fe=""),se&&!ce&&p&&p(),l(me+fe+Ee,i.indent,ce)}};t._defineProperty(W,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});var oe=(s,i)=>{if(s instanceof X){let a=i.get(s.source);return a.count*a.aliasCount}else if(s instanceof S){let a=0;for(let p of s.items){let m=oe(p,i);m>a&&(a=m)}return a}else if(s instanceof W){let a=oe(s.key,i),p=oe(s.value,i);return Math.max(a,p)}return 1},X=class kr extends c{static stringify({range:i,source:a},{anchors:p,doc:m,implicitKey:y,inStringifyKey:O}){let E=Object.keys(p).find(C=>p[C]===a);if(!E&&O&&(E=m.anchors.getName(a)||m.anchors.newName()),E)return`*${E}${y?" ":""}`;let P=m.anchors.getName(a)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${P} [${i}]`)}constructor(i){super(),this.source=i,this.type=t.Type.ALIAS}set tag(i){throw new Error("Alias nodes cannot have tags")}toJSON(i,a){if(!a)return f(this.source,i,a);let{anchors:p,maxAliasCount:m}=a,y=p.get(this.source);if(!y||y.res===void 0){let O="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,O):new ReferenceError(O)}if(m>=0&&(y.count+=1,y.aliasCount===0&&(y.aliasCount=oe(this.source,p)),y.count*y.aliasCount>m)){let O="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new t.YAMLReferenceError(this.cstNode,O):new ReferenceError(O)}return y.res}toString(i){return kr.stringify(this,i)}};t._defineProperty(X,"default",!0);function te(s,i){let a=i instanceof d?i.value:i;for(let p of s)if(p instanceof W&&(p.key===i||p.key===a||p.key&&p.key.value===a))return p}var he=class extends S{add(s,i){s?s instanceof W||(s=new W(s.key||s,s.value)):s=new W(s);let a=te(this.items,s.key),p=this.schema&&this.schema.sortMapEntries;if(a)if(i)a.value=s.value;else throw new Error(`Key ${s.key} already set`);else if(p){let m=this.items.findIndex(y=>p(s,y)<0);m===-1?this.items.push(s):this.items.splice(m,0,s)}else this.items.push(s)}delete(s){let i=te(this.items,s);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(s,i){let a=te(this.items,s),p=a&&a.value;return!i&&p instanceof d?p.value:p}has(s){return!!te(this.items,s)}set(s,i){this.add(new W(s,i),!0)}toJSON(s,i,a){let p=a?new a:i&&i.mapAsMap?new Map:{};i&&i.onCreate&&i.onCreate(p);for(let m of this.items)m.addToJSMap(i,p);return p}toString(s,i,a){if(!s)return JSON.stringify(this);for(let p of this.items)if(!(p instanceof W))throw new Error(`Map items must all be pairs; found ${JSON.stringify(p)} instead`);return super.toString(s,{blockItem:p=>p.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:s.indent||""},i,a)}},ye="<<",F=class extends W{constructor(s){if(s instanceof W){let i=s.value;i instanceof A||(i=new A,i.items.push(s.value),i.range=s.value.range),super(s.key,i),this.range=s.range}else super(new d(ye),new A);this.type=W.Type.MERGE_PAIR}addToJSMap(s,i){for(let{source:a}of this.value.items){if(!(a instanceof he))throw new Error("Merge sources must be maps");let p=a.toJSON(null,s,Map);for(let[m,y]of p)i instanceof Map?i.has(m)||i.set(m,y):i instanceof Set?i.add(m):Object.prototype.hasOwnProperty.call(i,m)||Object.defineProperty(i,m,{value:y,writable:!0,enumerable:!0,configurable:!0})}return i}toString(s,i){let a=this.value;if(a.items.length>1)return super.toString(s,i);this.value=a.items[0];let p=super.toString(s,i);return this.value=a,p}},g={defaultType:t.Type.BLOCK_LITERAL,lineWidth:76},w={trueStr:"true",falseStr:"false"},R={asBigInt:!1},I={nullStr:"null"},M={defaultType:t.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function _(s,i,a){for(let{format:p,test:m,resolve:y}of i)if(m){let O=s.match(m);if(O){let E=y.apply(null,O);return E instanceof d||(E=new d(E)),p&&(E.format=p),E}}return a&&(s=a(s)),new d(s)}var N="flow",k="block",V="quoted",J=(s,i)=>{let a=s[i+1];for(;a===" "||a===" ";){do a=s[i+=1];while(a&&a!==` `);a=s[i+1]}return i};function Z(s,i,a,{indentAtStart:p,lineWidth:m=80,minContentWidth:y=20,onFold:O,onOverflow:E}){if(!m||m<0)return s;let P=Math.max(1+y,1+m-i.length);if(s.length<=P)return s;let C=[],B={},z=m-i.length;typeof p=="number"&&(p>m-Math.max(2,y)?C.push(0):z=m-p);let be,re,ge=!1,se=-1,me=-1,Ie=-1;a===k&&(se=J(s,se),se!==-1&&(z=se+P));for(let Ee;Ee=s[se+=1];){if(a===V&&Ee==="\\"){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(Ee===` `)a===k&&(se=J(s,se)),z=se+P,be=void 0;else{if(Ee===" "&&re&&re!==" "&&re!==` `&&re!==" "){let fe=s[se+1];fe&&fe!==" "&&fe!==` `&&fe!==" "&&(be=se)}if(se>=z)if(be)C.push(be),z=be+P,be=void 0;else if(a===V){for(;re===" "||re===" ";)re=Ee,Ee=s[se+=1],ge=!0;let fe=se>Ie+1?se-2:me-1;if(B[fe])return s;C.push(fe),B[fe]=!0,z=fe+P,be=void 0}else ge=!0}re=Ee}if(ge&&E&&E(),C.length===0)return s;O&&O();let ce=s.slice(0,C[0]);for(let Ee=0;Ees?Object.assign({indentAtStart:s},M.fold):M.fold,Oe=s=>/^(%|---|\.\.\.)/m.test(s);function Ae(s,i,a){if(!i||i<0)return!1;let p=i-a,m=s.length;if(m<=p)return!1;for(let y=0,O=0;yp)return!0;if(O=y+1,m-O<=p)return!1}return!0}function Pe(s,i){let{implicitKey:a}=i,{jsonEncoding:p,minMultiLineLength:m}=M.doubleQuoted,y=JSON.stringify(s);if(p)return y;let O=i.indent||(Oe(s)?" ":""),E="",P=0;for(let C=0,B=y[C];B;B=y[++C])if(B===" "&&y[C+1]==="\\"&&y[C+2]==="n"&&(E+=y.slice(P,C)+"\\ ",C+=1,P=C,B="\\"),B==="\\")switch(y[C+1]){case"u":{E+=y.slice(P,C);let z=y.substr(C+2,4);switch(z){case"0000":E+="\\0";break;case"0007":E+="\\a";break;case"000b":E+="\\v";break;case"001b":E+="\\e";break;case"0085":E+="\\N";break;case"00a0":E+="\\_";break;case"2028":E+="\\L";break;case"2029":E+="\\P";break;default:z.substr(0,2)==="00"?E+="\\x"+z.substr(2):E+=y.substr(C,6)}C+=5,P=C+1}break;case"n":if(a||y[C+2]==='"'||y.length";if(!a)return C+` `;let B="",z="";if(a=a.replace(/[\n\t ]*$/,re=>{let ge=re.indexOf(` `);return ge===-1?C+="-":(a===re||ge!==re.length-1)&&(C+="+",y&&y()),z=re.replace(/\n$/,""),""}).replace(/^[\n ]*/,re=>{re.indexOf(" ")!==-1&&(C+=E);let ge=re.match(/ +$/);return ge?(B=re.slice(0,-ge[0].length),ge[0]):(B=re,"")}),z&&(z=z.replace(/\n+(?!\n|$)/g,`$&${O}`)),B&&(B=B.replace(/\n+/g,`$&${O}`)),s&&(C+=" #"+s.replace(/ ?[\r\n]+/g," "),m&&m()),!a)return`${C}${E} ${O}${z}`;if(P)return a=a.replace(/\n+/g,`$&${O}`),`${C} ${O}${B}${a}${z}`;a=a.replace(/\n+/g,` $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${O}`);let be=Z(`${B}${a}${z}`,O,k,M.fold);return`${C} ${O}${be}`}function h(s,i,a,p){let{comment:m,type:y,value:O}=s,{actualString:E,implicitKey:P,indent:C,inFlow:B}=i;if(P&&/[\n[\]{},]/.test(O)||B&&/[[\]{},]/.test(O))return Pe(O,i);if(!O||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(O))return P||B||O.indexOf(` `)===-1?O.indexOf('"')!==-1&&O.indexOf("'")===-1?xe(O,i):Pe(O,i):Y(s,i,a,p);if(!P&&!B&&y!==t.Type.PLAIN&&O.indexOf(` `)!==-1)return Y(s,i,a,p);if(C===""&&Oe(O))return i.forceBlockIndent=!0,Y(s,i,a,p);let z=O.replace(/\n+/g,`$& ${C}`);if(E){let{tags:re}=i.doc.schema;if(typeof _(z,re,re.scalarFallback).value!="string")return Pe(O,i)}let be=P?z:Z(z,C,N,Te(i));return m&&!B&&(be.indexOf(` `)!==-1||m.indexOf(` `)!==-1)?(a&&a(),n(be,C,m)):be}function x(s,i,a,p){let{defaultType:m}=M,{implicitKey:y,inFlow:O}=i,{type:E,value:P}=s;typeof P!="string"&&(P=String(P),s=Object.assign({},s,{value:P}));let C=z=>{switch(z){case t.Type.BLOCK_FOLDED:case t.Type.BLOCK_LITERAL:return Y(s,i,a,p);case t.Type.QUOTE_DOUBLE:return Pe(P,i);case t.Type.QUOTE_SINGLE:return xe(P,i);case t.Type.PLAIN:return h(s,i,a,p);default:return null}};(E!==t.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(P)||(y||O)&&(E===t.Type.BLOCK_FOLDED||E===t.Type.BLOCK_LITERAL))&&(E=t.Type.QUOTE_DOUBLE);let B=C(E);if(B===null&&(B=C(m),B===null))throw new Error(`Unsupported default string type ${m}`);return B}function G({format:s,minFractionDigits:i,tag:a,value:p}){if(typeof p=="bigint")return String(p);if(!isFinite(p))return isNaN(p)?".nan":p<0?"-.inf":".inf";let m=JSON.stringify(p);if(!s&&i&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(m)){let y=m.indexOf(".");y<0&&(y=m.length,m+=".");let O=i-(m.length-y-1);for(;O-- >0;)m+="0"}return m}function K(s,i){let a,p;switch(i.type){case t.Type.FLOW_MAP:a="}",p="flow map";break;case t.Type.FLOW_SEQ:a="]",p="flow sequence";break;default:s.push(new t.YAMLSemanticError(i,"Not a flow collection!?"));return}let m;for(let y=i.items.length-1;y>=0;--y){let O=i.items[y];if(!O||O.type!==t.Type.COMMENT){m=O;break}}if(m&&m.char!==a){let y=`Expected ${p} to end with ${a}`,O;typeof m.offset=="number"?(O=new t.YAMLSemanticError(i,y),O.offset=m.offset+1):(O=new t.YAMLSemanticError(m,y),m.range&&m.range.end&&(O.offset=m.range.end-m.range.start)),s.push(O)}}function ne(s,i){let a=i.context.src[i.range.start-1];if(a!==` `&&a!==" "&&a!==" "){let p="Comments must be separated from other tokens by white space characters";s.push(new t.YAMLSemanticError(i,p))}}function ae(s,i){let a=String(i),p=a.substr(0,8)+"..."+a.substr(-8);return new t.YAMLSemanticError(s,`The "${p}" key is too long`)}function Ye(s,i){for(let{afterKey:a,before:p,comment:m}of i){let y=s.items[p];y?(a&&y.value&&(y=y.value),m===void 0?(a||!y.commentBefore)&&(y.spaceBefore=!0):y.commentBefore?y.commentBefore+=` `+m:y.commentBefore=m):m!==void 0&&(s.comment?s.comment+=` `+m:s.comment=m)}}function Qe(s,i){let a=i.strValue;return a?typeof a=="string"?a:(a.errors.forEach(p=>{p.source||(p.source=i),s.errors.push(p)}),a.str):""}function Ze(s,i){let{handle:a,suffix:p}=i.tag,m=s.tagPrefixes.find(y=>y.handle===a);if(!m){let y=s.getDefaults().tagPrefixes;if(y&&(m=y.find(O=>O.handle===a)),!m)throw new t.YAMLSemanticError(i,`The ${a} tag handle is non-default and was not declared.`)}if(!p)throw new t.YAMLSemanticError(i,`The ${a} tag has no suffix.`);if(a==="!"&&(s.version||s.options.version)==="1.0"){if(p[0]==="^")return s.warnings.push(new t.YAMLWarning(i,"YAML 1.0 ^ tag expansion is not supported")),p;if(/[:/]/.test(p)){let y=p.match(/^([a-z0-9-]+)\/(.*)/i);return y?`tag:${y[1]}.yaml.org,2002:${y[2]}`:`tag:${p}`}}return m.prefix+decodeURIComponent(p)}function ze(s,i){let{tag:a,type:p}=i,m=!1;if(a){let{handle:y,suffix:O,verbatim:E}=a;if(E){if(E!=="!"&&E!=="!!")return E;let P=`Verbatim tags aren't resolved, so ${E} is invalid.`;s.errors.push(new t.YAMLSemanticError(i,P))}else if(y==="!"&&!O)m=!0;else try{return Ze(s,i)}catch(P){s.errors.push(P)}}switch(p){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 m?t.defaultTags.STR:null;default:return null}}function Rt(s,i,a){let{tags:p}=s.schema,m=[];for(let O of p)if(O.tag===a)if(O.test)m.push(O);else{let E=O.resolve(s,i);return E instanceof S?E:new d(E)}let y=Qe(s,i);return typeof y=="string"&&m.length>0?_(y,m,p.scalarFallback):null}function Jt({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 fo(s,i,a){try{let p=Rt(s,i,a);if(p)return a&&i.tag&&(p.tag=a),p}catch(p){return p.source||(p.source=i),s.errors.push(p),null}try{let p=Jt(i);if(!p)throw new Error(`The tag ${a} is unavailable`);let m=`The tag ${a} is unavailable, falling back to ${p}`;s.warnings.push(new t.YAMLWarning(i,m));let y=Rt(s,i,p);return y.tag=a,y}catch(p){let m=new t.YAMLReferenceError(i,p.message);return m.stack=p.stack,s.errors.push(m),null}}var ho=s=>{if(!s)return!1;let{type:i}=s;return i===t.Type.MAP_KEY||i===t.Type.MAP_VALUE||i===t.Type.SEQ_ITEM};function mo(s,i){let a={before:[],after:[]},p=!1,m=!1,y=ho(i.context.parent)?i.context.parent.props.concat(i.props):i.props;for(let{start:O,end:E}of y)switch(i.context.src[O]){case t.Char.COMMENT:{if(!i.commentHasRequiredWhitespace(O)){let z="Comments must be separated from other tokens by white space characters";s.push(new t.YAMLSemanticError(i,z))}let{header:P,valueRange:C}=i;(C&&(O>C.start||P&&O>P.start)?a.after:a.before).push(i.context.src.slice(O+1,E));break}case t.Char.ANCHOR:if(p){let P="A node can have at most one anchor";s.push(new t.YAMLSemanticError(i,P))}p=!0;break;case t.Char.TAG:if(m){let P="A node can have at most one tag";s.push(new t.YAMLSemanticError(i,P))}m=!0;break}return{comments:a,hasAnchor:p,hasTag:m}}function yo(s,i){let{anchors:a,errors:p,schema:m}=s;if(i.type===t.Type.ALIAS){let O=i.rawValue,E=a.getNode(O);if(!E){let C=`Aliased anchor not found: ${O}`;return p.push(new t.YAMLReferenceError(i,C)),null}let P=new X(E);return a._cstAliases.push(P),P}let y=ze(s,i);if(y)return fo(s,i,y);if(i.type!==t.Type.PLAIN){let O=`Failed to resolve ${i.type} node here`;return p.push(new t.YAMLSyntaxError(i,O)),null}try{let O=Qe(s,i);return _(O,m.tags,m.tags.scalarFallback)}catch(O){return O.source||(O.source=i),p.push(O),null}}function nt(s,i){if(!i)return null;i.error&&s.errors.push(i.error);let{comments:a,hasAnchor:p,hasTag:m}=mo(s.errors,i);if(p){let{anchors:O}=s,E=i.anchor,P=O.getNode(E);P&&(O.map[O.newName(E)]=P),O.map[E]=i}if(i.type===t.Type.ALIAS&&(p||m)){let O="An alias node must not specify any properties";s.errors.push(new t.YAMLSemanticError(i,O))}let y=yo(s,i);if(y){y.range=[i.range.start,i.range.end],s.options.keepCstNodes&&(y.cstNode=i),s.options.keepNodeTypes&&(y.type=i.type);let O=a.before.join(` `);O&&(y.commentBefore=y.commentBefore?`${y.commentBefore} ${O}`:O);let E=a.after.join(` `);E&&(y.comment=y.comment?`${y.comment} ${E}`:E)}return i.resolved=y}function go(s,i){if(i.type!==t.Type.MAP&&i.type!==t.Type.FLOW_MAP){let O=`A ${i.type} node cannot be resolved as a mapping`;return s.errors.push(new t.YAMLSyntaxError(i,O)),null}let{comments:a,items:p}=i.type===t.Type.FLOW_MAP?To(s,i):So(s,i),m=new he;m.items=p,Ye(m,a);let y=!1;for(let O=0;O{if(B instanceof X){let{type:z}=B.source;return z===t.Type.MAP||z===t.Type.FLOW_MAP?!1:C="Merge nodes aliases can only point to maps"}return C="Merge nodes can only have Alias nodes as values"}),C&&s.errors.push(new t.YAMLSemanticError(i,C))}else for(let P=O+1;P{if(p.length===0)return!1;let{start:m}=p[0];if(i&&m>i.valueRange.start||a[m]!==t.Char.COMMENT)return!1;for(let y=s;y0){P=new t.PlainValue(t.Type.PLAIN,[]),P.context={parent:E,src:E.context.src};let B=E.range.start+1;if(P.range={start:B,end:B},P.valueRange={start:B,end:B},typeof E.range.origStart=="number"){let z=E.range.origStart+1;P.range.origStart=P.range.origEnd=z,P.valueRange.origStart=P.valueRange.origEnd=z}}let C=new W(m,nt(s,P));bo(E,C),p.push(C),m&&typeof y=="number"&&E.range.start>y+1024&&s.errors.push(ae(i,m)),m=void 0,y=null}break;default:m!==void 0&&p.push(new W(m)),m=nt(s,E),y=E.range.start,E.error&&s.errors.push(E.error);e:for(let P=O+1;;++P){let C=i.items[P];switch(C&&C.type){case t.Type.BLANK_LINE:case t.Type.COMMENT:continue e;case t.Type.MAP_VALUE:break e;default:{let B="Implicit map keys need to be followed by map values";s.errors.push(new t.YAMLSemanticError(E,B));break e}}}if(E.valueRangeContainsNewline){let P="Implicit map keys need to be on a single line";s.errors.push(new t.YAMLSemanticError(E,P))}}}return m!==void 0&&p.push(new W(m)),{comments:a,items:p}}function To(s,i){let a=[],p=[],m,y=!1,O="{";for(let E=0;Ey instanceof W&&y.key instanceof S)){let y="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(i,y))}return i.resolved=m,m}function Eo(s,i){let a=[],p=[];for(let m=0;mO+1024&&s.errors.push(ae(i,y));let{src:ge}=P.context;for(let se=O;se_ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(_,N)=>{let k=n.resolveString(_,N);if(typeof Buffer=="function")return Buffer.from(k,"base64");if(typeof atob=="function"){let V=atob(k.replace(/[\n\r]/g,"")),J=new Uint8Array(V.length);for(let Z=0;Z{let Te;if(typeof Buffer=="function")Te=k instanceof Buffer?k.toString("base64"):Buffer.from(k.buffer).toString("base64");else if(typeof btoa=="function"){let Oe="";for(let Ae=0;Ae1){let Te="Each pair must have its own sequence indicator";throw new t.YAMLSemanticError(N,Te)}let Z=J.items[0]||new n.Pair;J.commentBefore&&(Z.commentBefore=Z.commentBefore?`${J.commentBefore} ${Z.commentBefore}`:J.commentBefore),J.comment&&(Z.comment=Z.comment?`${J.comment} ${Z.comment}`:J.comment),J=Z}k.items[V]=J instanceof n.Pair?J:new n.Pair(J)}}return k}function f(_,N,k){let V=new n.YAMLSeq(_);V.tag="tag:yaml.org,2002:pairs";for(let J of N){let Z,Te;if(Array.isArray(J))if(J.length===2)Z=J[0],Te=J[1];else throw new TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let Ae=Object.keys(J);if(Ae.length===1)Z=Ae[0],Te=J[Z];else throw new TypeError(`Expected { key: value } tuple: ${J}`)}else Z=J;let Oe=_.createPair(Z,Te,k);V.items.push(Oe)}return V}var d={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:c,createNode:f},T=class Mr extends n.YAMLSeq{constructor(){super(),t._defineProperty(this,"add",n.YAMLMap.prototype.add.bind(this)),t._defineProperty(this,"delete",n.YAMLMap.prototype.delete.bind(this)),t._defineProperty(this,"get",n.YAMLMap.prototype.get.bind(this)),t._defineProperty(this,"has",n.YAMLMap.prototype.has.bind(this)),t._defineProperty(this,"set",n.YAMLMap.prototype.set.bind(this)),this.tag=Mr.tag}toJSON(N,k){let V=new Map;k&&k.onCreate&&k.onCreate(V);for(let J of this.items){let Z,Te;if(J instanceof n.Pair?(Z=n.toJSON(J.key,"",k),Te=n.toJSON(J.value,Z,k)):Z=n.toJSON(J,"",k),V.has(Z))throw new Error("Ordered maps must not include duplicate keys");V.set(Z,Te)}return V}};t._defineProperty(T,"tag","tag:yaml.org,2002:omap");function L(_,N){let k=c(_,N),V=[];for(let{key:J}of k.items)if(J instanceof n.Scalar)if(V.includes(J.value)){let Z="Ordered maps must not include duplicate keys";throw new t.YAMLSemanticError(N,Z)}else V.push(J.value);return Object.assign(new T,k)}function S(_,N,k){let V=f(_,N,k),J=new T;return J.items=V.items,J}var U={identify:_=>_ instanceof Map,nodeClass:T,default:!1,tag:"tag:yaml.org,2002:omap",resolve:L,createNode:S},A=class Cr extends n.YAMLMap{constructor(){super(),this.tag=Cr.tag}add(N){let k=N instanceof n.Pair?N:new n.Pair(N);n.findPair(this.items,k.key)||this.items.push(k)}get(N,k){let V=n.findPair(this.items,N);return!k&&V instanceof n.Pair?V.key instanceof n.Scalar?V.key.value:V.key:V}set(N,k){if(typeof k!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof k}`);let V=n.findPair(this.items,N);V&&!k?this.items.splice(this.items.indexOf(V),1):!V&&k&&this.items.push(new n.Pair(N))}toJSON(N,k){return super.toJSON(N,k,Set)}toString(N,k,V){if(!N)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(N,k,V);throw new Error("Set items must all have null values")}};t._defineProperty(A,"tag","tag:yaml.org,2002:set");function q(_,N){let k=n.resolveMap(_,N);if(!k.hasAllNullValues())throw new t.YAMLSemanticError(N,"Set items must all have null values");return Object.assign(new A,k)}function W(_,N,k){let V=new A;for(let J of N)V.items.push(_.createPair(J,null,k));return V}var oe={identify:_=>_ instanceof Set,nodeClass:A,default:!1,tag:"tag:yaml.org,2002:set",resolve:q,createNode:W},X=(_,N)=>{let k=N.split(":").reduce((V,J)=>V*60+Number(J),0);return _==="-"?-k:k},te=({value:_})=>{if(isNaN(_)||!isFinite(_))return n.stringifyNumber(_);let N="";_<0&&(N="-",_=Math.abs(_));let k=[_%60];return _<60?k.unshift(0):(_=Math.round((_-k[0])/60),k.unshift(_%60),_>=60&&(_=Math.round((_-k[0])/60),k.unshift(_))),N+k.map(V=>V<10?"0"+String(V):String(V)).join(":").replace(/000000\d*$/,"")},he={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(_,N,k)=>X(N,k.replace(/_/g,"")),stringify:te},ye={identify:_=>typeof _=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(_,N,k)=>X(N,k.replace(/_/g,"")),stringify:te},F={identify:_=>_ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([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:(_,N,k,V,J,Z,Te,Oe,Ae)=>{Oe&&(Oe=(Oe+"00").substr(1,3));let Pe=Date.UTC(N,k-1,V,J||0,Z||0,Te||0,Oe||0);if(Ae&&Ae!=="Z"){let xe=X(Ae[0],Ae.slice(1));Math.abs(xe)<30&&(xe*=60),Pe-=6e4*xe}return new Date(Pe)},stringify:({value:_})=>_.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function g(_){let N=typeof process!="undefined"&&process.env||{};return _?typeof YAML_SILENCE_DEPRECATION_WARNINGS!="undefined"?!YAML_SILENCE_DEPRECATION_WARNINGS:!N.YAML_SILENCE_DEPRECATION_WARNINGS:typeof YAML_SILENCE_WARNINGS!="undefined"?!YAML_SILENCE_WARNINGS:!N.YAML_SILENCE_WARNINGS}function w(_,N){if(g(!1)){let k=typeof process!="undefined"&&process.emitWarning;k?k(_,N):console.warn(N?`${N}: ${_}`:_)}}function R(_){if(g(!0)){let N=_.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/");w(`The endpoint 'yaml/${N}' will be removed in a future release.`,"DeprecationWarning")}}var I={};function M(_,N){if(!I[_]&&g(!0)){I[_]=!0;let k=`The option '${_}' will be removed in a future release`;k+=N?`, use '${N}' instead.`:".",w(k,"DeprecationWarning")}}e.binary=l,e.floatTime=ye,e.intTime=he,e.omap=U,e.pairs=d,e.set=oe,e.timestamp=F,e.warn=w,e.warnFileDeprecation=R,e.warnOptionDeprecation=M}}),xi=Ue({"node_modules/yaml/dist/Schema-88e323a7.js"(e){"use strict";var t=Ot(),n=Ft(),l=Gn();function c(h,x,G){let K=new n.YAMLMap(h);if(x instanceof Map)for(let[ne,ae]of x)K.items.push(h.createPair(ne,ae,G));else if(x&&typeof x=="object")for(let ne of Object.keys(x))K.items.push(h.createPair(ne,x[ne],G));return typeof h.sortMapEntries=="function"&&K.items.sort(h.sortMapEntries),K}var f={createNode:c,default:!0,nodeClass:n.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:n.resolveMap};function d(h,x,G){let K=new n.YAMLSeq(h);if(x&&x[Symbol.iterator])for(let ne of x){let ae=h.createNode(ne,G.wrapScalars,null,G);K.items.push(ae)}return K}var T={createNode:d,default:!0,nodeClass:n.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:n.resolveSeq},L={identify:h=>typeof h=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n.resolveString,stringify(h,x,G,K){return x=Object.assign({actualString:!0},x),n.stringifyString(h,x,G,K)},options:n.strOptions},S=[f,T,L],U=h=>typeof h=="bigint"||Number.isInteger(h),A=(h,x,G)=>n.intOptions.asBigInt?BigInt(h):parseInt(x,G);function q(h,x,G){let{value:K}=h;return U(K)&&K>=0?G+K.toString(x):n.stringifyNumber(h)}var W={identify:h=>h==null,createNode:(h,x,G)=>G.wrapScalars?new n.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:n.nullOptions,stringify:()=>n.nullOptions.nullStr},oe={identify:h=>typeof h=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:h=>h[0]==="t"||h[0]==="T",options:n.boolOptions,stringify:({value:h})=>h?n.boolOptions.trueStr:n.boolOptions.falseStr},X={identify:h=>U(h)&&h>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(h,x)=>A(h,x,8),options:n.intOptions,stringify:h=>q(h,8,"0o")},te={identify:U,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:h=>A(h,h,10),options:n.intOptions,stringify:n.stringifyNumber},he={identify:h=>U(h)&&h>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(h,x)=>A(h,x,16),options:n.intOptions,stringify:h=>q(h,16,"0x")},ye={identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(h,x)=>x?NaN:h[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},F={identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:h=>parseFloat(h),stringify:({value:h})=>Number(h).toExponential()},g={identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(h,x,G){let K=x||G,ne=new n.Scalar(parseFloat(h));return K&&K[K.length-1]==="0"&&(ne.minFractionDigits=K.length),ne},stringify:n.stringifyNumber},w=S.concat([W,oe,X,te,he,ye,F,g]),R=h=>typeof h=="bigint"||Number.isInteger(h),I=({value:h})=>JSON.stringify(h),M=[f,T,{identify:h=>typeof h=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n.resolveString,stringify:I},{identify:h=>h==null,createNode:(h,x,G)=>G.wrapScalars?new n.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:I},{identify:h=>typeof h=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:h=>h==="true",stringify:I},{identify:R,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:h=>n.intOptions.asBigInt?BigInt(h):parseInt(h,10),stringify:({value:h})=>R(h)?h.toString():JSON.stringify(h)},{identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:h=>parseFloat(h),stringify:I}];M.scalarFallback=h=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(h)}`)};var _=({value:h})=>h?n.boolOptions.trueStr:n.boolOptions.falseStr,N=h=>typeof h=="bigint"||Number.isInteger(h);function k(h,x,G){let K=x.replace(/_/g,"");if(n.intOptions.asBigInt){switch(G){case 2:K=`0b${K}`;break;case 8:K=`0o${K}`;break;case 16:K=`0x${K}`;break}let ae=BigInt(K);return h==="-"?BigInt(-1)*ae:ae}let ne=parseInt(K,G);return h==="-"?-1*ne:ne}function V(h,x,G){let{value:K}=h;if(N(K)){let ne=K.toString(x);return K<0?"-"+G+ne.substr(1):G+ne}return n.stringifyNumber(h)}var J=S.concat([{identify:h=>h==null,createNode:(h,x,G)=>G.wrapScalars?new n.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:n.nullOptions,stringify:()=>n.nullOptions.nullStr},{identify:h=>typeof h=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:n.boolOptions,stringify:_},{identify:h=>typeof h=="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:n.boolOptions,stringify:_},{identify:N,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(h,x,G)=>k(x,G,2),stringify:h=>V(h,2,"0b")},{identify:N,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(h,x,G)=>k(x,G,8),stringify:h=>V(h,8,"0")},{identify:N,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(h,x,G)=>k(x,G,10),stringify:n.stringifyNumber},{identify:N,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(h,x,G)=>k(x,G,16),stringify:h=>V(h,16,"0x")},{identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(h,x)=>x?NaN:h[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:n.stringifyNumber},{identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:h=>parseFloat(h.replace(/_/g,"")),stringify:({value:h})=>Number(h).toExponential()},{identify:h=>typeof h=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(h,x){let G=new n.Scalar(parseFloat(h.replace(/_/g,"")));if(x){let K=x.replace(/_/g,"");K[K.length-1]==="0"&&(G.minFractionDigits=K.length)}return G},stringify:n.stringifyNumber}],l.binary,l.omap,l.pairs,l.set,l.intTime,l.floatTime,l.timestamp),Z={core:w,failsafe:S,json:M,yaml11:J},Te={binary:l.binary,bool:oe,float:g,floatExp:F,floatNaN:ye,floatTime:l.floatTime,int:te,intHex:he,intOct:X,intTime:l.intTime,map:f,null:W,omap:l.omap,pairs:l.pairs,seq:T,set:l.set,timestamp:l.timestamp};function Oe(h,x,G){if(x){let K=G.filter(ae=>ae.tag===x),ne=K.find(ae=>!ae.format)||K[0];if(!ne)throw new Error(`Tag ${x} not found`);return ne}return G.find(K=>(K.identify&&K.identify(h)||K.class&&h instanceof K.class)&&!K.format)}function Ae(h,x,G){if(h instanceof n.Node)return h;let{defaultPrefix:K,onTagObj:ne,prevObjects:ae,schema:Ye,wrapScalars:Qe}=G;x&&x.startsWith("!!")&&(x=K+x.slice(2));let Ze=Oe(h,x,Ye.tags);if(!Ze){if(typeof h.toJSON=="function"&&(h=h.toJSON()),!h||typeof h!="object")return Qe?new n.Scalar(h):h;Ze=h instanceof Map?f:h[Symbol.iterator]?T:f}ne&&(ne(Ze),delete G.onTagObj);let ze={value:void 0,node:void 0};if(h&&typeof h=="object"&&ae){let Rt=ae.get(h);if(Rt){let Jt=new n.Alias(Rt);return G.aliasNodes.push(Jt),Jt}ze.value=h,ae.set(h,ze)}return ze.node=Ze.createNode?Ze.createNode(G.schema,h,G):Qe?new n.Scalar(h):h,x&&ze.node instanceof n.Node&&(ze.node.tag=x),ze.node}function Pe(h,x,G,K){let ne=h[K.replace(/\W/g,"")];if(!ne){let ae=Object.keys(h).map(Ye=>JSON.stringify(Ye)).join(", ");throw new Error(`Unknown schema "${K}"; use one of ${ae}`)}if(Array.isArray(G))for(let ae of G)ne=ne.concat(ae);else typeof G=="function"&&(ne=G(ne.slice()));for(let ae=0;aeJSON.stringify(ze)).join(", ");throw new Error(`Unknown custom tag "${Ye}"; use one of ${Ze}`)}ne[ae]=Qe}}return ne}var xe=(h,x)=>h.keyx.key?1:0,Y=class Lr{constructor({customTags:x,merge:G,schema:K,sortMapEntries:ne,tags:ae}){this.merge=!!G,this.name=K,this.sortMapEntries=ne===!0?xe:ne||null,!x&&ae&&l.warnOptionDeprecation("tags","customTags"),this.tags=Pe(Z,Te,x||ae,K)}createNode(x,G,K,ne){let ae={defaultPrefix:Lr.defaultPrefix,schema:this,wrapScalars:G},Ye=ne?Object.assign(ne,ae):ae;return Ae(x,K,Ye)}createPair(x,G,K){K||(K={wrapScalars:!0});let ne=this.createNode(x,K.wrapScalars,null,K),ae=this.createNode(G,K.wrapScalars,null,K);return new n.Pair(ne,ae)}};t._defineProperty(Y,"defaultPrefix",t.defaultTagPrefix),t._defineProperty(Y,"defaultTags",t.defaultTags),e.Schema=Y}}),ki=Ue({"node_modules/yaml/dist/types.js"(e){"use strict";var t=Ft(),n=xi();Ot(),Gn(),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=n.Schema}}),Kn={},Hn=()=>Kn,Mi=e=>{Object.assign(Kn,e)},Ci=class{constructor(){this.data={}}unregister(e){e?delete this.data[e]:this.data={}}register(e,t){this.data[e]=t}registerMany(e){Object.keys(e).forEach(t=>{this.data[t]=e[t]})}get(e){return this.data[e]}list(){return this.data}},zn=Ci,ue={},Xn=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,Li=class extends zn{constructor(){super(),this.data={...Xn},this._defaults=Xn}get defaults(){return{...this._defaults}}},Di=Li,Et=new Di,Le.getDefaults=()=>Et.defaults,ee=Le,Qn=["integer","number","string","boolean"],Zn=Qn.concat(["null"]),$i=["array","object"].concat(Zn),Ui=2524608e6,Fi=-1e8,ji=1e8,Yi=-100,Wi=100,He={ALLOWED_TYPES:Qn,SCALAR_TYPES:Zn,ALL_TYPES:$i,MIN_NUMBER:Yi,MAX_NUMBER:Wi,MIN_INTEGER:Fi,MAX_INTEGER:ji,MOST_NEAR_DATETIME:Ui},jt=qn(Ni(),1),Q={pick:De,date:$n,shuffle:Fe,number:Je,randexp:Re},Vi=/^(0|[1-9][0-9]*)$/,de={hasProperties:Ke,getLocalRef:fi,omitProps:vs,typecast:gs,merge:dt,clone:le,short:ws,hasValue:bs,notValue:Ss,anyValue:mi,validate:Ts,validateValueForSchema:Un,validateValueForOneOf:Os,isKey:Es,template:yi,shouldClean:gi,clean:jn,isEmpty:Fn,clampDate:hi},Bi=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]=As(()=>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),n={},l=t.length;for(;l--;){let c=t[l].replace(/^x-/,""),f=this.support[c];if(typeof f=="function"){Object.defineProperty(e,"generate",{configurable:!1,enumerable:!1,writable:!1,value:(d,T)=>f.call(n,e[t[l]],e,t[l],d,T.slice())});break}}}return e}},qi=Bi,ht=new zn,ei=_s,Ji=class extends Error{constructor(e,t){super(),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="ParseError",this.message=e,this.path=t}},Yt=Ji,vt={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"]},vt.number=vt.integer,Gi=["additionalItems","items","additionalProperties","dependencies","patternProperties","properties"],Ki=Ps,Hi=Is,zi=Hi,Xi=zi,Qi=Ns,Zi=Qi,er=Zi,tr=ks,ti=Ms,nr=Cs,ir=`Lorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum`.split(/\W/),Wt=Ls,Vt={type:He.ALLOWED_TYPES},rr=Ds,ni=$s,sr=Us,Bt=Fs,or=js,ar=Ys,ii="[a-zA-Z][a-zA-Z0-9+-.]*",qt=`https?://{hostname}(?:${ii})+`,lr="(?:\\?([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:qt,slug:"[a-zA-Z\\d_-]+","uri-reference":`${qt}${lr}`,"uri-template":qt.replace("(?:","(?:/\\{[a-z][:a-zA-Z0-9-]*\\}|"),"json-pointer":`(/(?:${ii.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,cr=new RegExp(`\\{(${Object.keys(je).join("|")})\\}`),pr=Ws,ur=Bs,dr={boolean:Xi,null:er,array:tr,integer:nr,number:ti,object:rr,string:ur},At=dr,fr=ft,hr=({refs:e,schema:t,container:n,synchronous:l,refDepthMax:c,refDepthMin:f})=>{let d={},T={},L=0,S,U;return d.resolveSchema=(A,q,W)=>{if(A==null)return null;if(typeof A.generate=="function")return A;if(typeof(A.$id||A.id)=="string"&&(delete A.id,delete A.$id,delete A.$schema),typeof A.$ref=="string"){let X=Math.max(f,c)-1;if(A.$ref==="#"||T[A.$ref]<0||S===A.$ref&&++L>X)return A.$ref!=="#"&&U&&U.length===W.length?de.getLocalRef(t,A.$ref,l&&e):(delete A.$ref,A);typeof T[A.$ref]=="undefined"&&(T[A.$ref]=Q.number(f,c)-1),U=W,S=A.$ref;let te;A.$ref.indexOf("#/")===-1?te=e[A.$ref]||null:te=de.getLocalRef(t,A.$ref,l&&e)||null;let he;if(typeof te!="undefined"){if(!te&&ee("ignoreMissingRefs")!==!0)throw new Error(`Reference not found: ${A.$ref}`);T[A.$ref]-=1,de.merge(A,te||{}),he=l&&te&&te.$ref}return he||delete A.$ref,A}if(Array.isArray(A.allOf)){let X=A.allOf;delete A.allOf,X.forEach(te=>{let he=d.resolveSchema(te,null,W);de.merge(A,typeof he.thunk=="function"?he.thunk(A):he),Array.isArray(A.allOf)&&d.resolveSchema(A,q,W)})}if(Array.isArray(A.oneOf||A.anyOf)&&W[W.length-2]!=="dependencies"){let X=A.oneOf||A.anyOf;return A.enum&&A.oneOf&&(A.enum=A.enum.filter(te=>de.validate(te,X))),{thunk(te){let he=de.omitProps(A,["anyOf","oneOf"]),ye=Q.pick(X);return de.merge(he,ye),X.forEach(F=>{F.required&&F!==ye&&F.required.forEach(g=>{if(ye.required&&ye.required.includes(g))return;let w=he.required&&he.required.includes(g);he.properties&&!w&&delete he.properties[g],te&&te.properties&&delete te.properties[g]})}),he}}}if(Object.keys(A).forEach(X=>{(Array.isArray(A[X])||typeof A[X]=="object")&&!de.isKey(X)&&(A[X]=d.resolveSchema(A[X],X,W.concat(X)))}),W){let X=W[W.length-1];if(X==="properties"||X==="items")return A}return n.wrap(A)},d},mr=hr,ri=Ks,si=Hs,ke=qn(ki(),1),Qs=ke.default.binaryOptions,Zs=ke.default.boolOptions,eo=ke.default.intOptions,to=ke.default.nullOptions,no=ke.default.strOptions,io=ke.default.Schema,ro=ke.default.Alias,so=ke.default.Collection,oo=ke.default.Merge,ao=ke.default.Node,lo=ke.default.Pair,co=ke.default.Scalar,yr=ke.default.YAMLMap,gr=ke.default.YAMLSeq,_t=Xs,Xe=new qi,Se=(e,t,n)=>(console.debug("[json-schema-faker] calling JSONSchemaFaker() is deprecated, call either .generate() or .resolve()"),n&&console.debug("[json-schema-faker] local references are only supported by calling .resolve()"),Se.generate(e,t)),Se.generateWithContext=(e,t)=>{let n=Si(t,e);return ri(n,e,Xe,!0)},Se.generate=(e,t)=>si(Se.generateWithContext(e,t)),Se.generateYAML=(e,t)=>_t(Se.generateWithContext(e,t)),Se.resolveWithContext=(e,t,n)=>{typeof t=="string"&&(n=t,t={}),n=n||(typeof process!="undefined"&&typeof process.cwd=="function"?process.cwd():""),n=`${n.replace(/\/+$/,"")}/`;let l=Si(t,e),c={order:1,canRead(d){let T=d.url.replace("/:",":");return l[T]||l[T.split("/").pop()]},read(d,T){try{T(null,this.canRead(d))}catch(L){T(L)}}},{$RefParser:f}=Hn();return f.bundle(n,e,{resolve:{file:{order:100},http:{order:200},fixedRefs:c},dereference:{circular:"ignore"}}).then(d=>ri(l,d,Xe)).catch(d=>{throw new Error(`Error while resolving schema (${d.message})`)})},Se.resolve=(e,t,n)=>Se.resolveWithContext(e,t,n).then(si),Se.resolveYAML=(e,t,n)=>Se.resolveWithContext(e,t,n).then(_t),bi(),Se.format=ei,Se.option=ee,Se.random=Q,Se.extend=(e,t)=>(Xe.extend(e,t),Se),Se.define=(e,t)=>(Xe.define(e,t),Se),Se.reset=e=>(Xe.reset(e),bi(),Se),Se.locate=e=>Xe.get(e),Se.VERSION="0.5.5",wr={...Se},br=Se}}),uo=j({"src/src/main.iife.js"(e,t){var n=(po(),pe(ve));typeof $RefParser!="undefined"&&typeof JSONPath!="undefined"&&n.setDependencies({...JSONPath,$RefParser}),typeof window!="undefined"&&(window.JSONSchemaFaker=n.default),t.exports=n.default,t.exports.JSONSchemaFaker=n.JSONSchemaFaker}});return uo()})();(function(b,r){b.JSONSchemaFaker=r()})(typeof self!="undefined"?self:typeof window!="undefined"?window:globalThis,()=>kn);kn.random.shuffle=function(){return["[placeholder]"]};kn.option({useDefaultValue:!0,alwaysFakeOptionals:!0});function Dr(b){return kn.generate(b)}function $r(b){console.log(` ${we.bold(we.underline("Discovered workflowId:"))} '${b.workflowId}'`),b.steps.forEach((r,o)=>{let u=o===b.steps.length-1;console.log(`${u?"\u2514":"\u251C"} ${_e.STEP} Discovered stepId: '${r.stepId}' Type: '${r.type}'`),r.providers.forEach((j,$)=>{let ie=$===r.providers.length-1;console.log(`${u?" ":"\u2502"} ${ie?"\u2514":"\u251C"} ${_e.PROVIDER} Discovered provider: '${j.type}'`)})})}function ui(b,r){let o={...b};for(let u of Object.keys(r)){let v=r[u];v&&typeof v=="object"&&!Array.isArray(v)?o[u]=ui(o[u]||{},v):(Array.isArray(v),o[u]=v)}return o}function Uo(){return["development",void 0].includes(process.env.NODE_ENV)}var wt=class{constructor(r){this.discoveredWorkflows=new Map;this.discoverWorkflowPromises=new Map;this.templateEngine=new Ur.Liquid({outputEscape:r=>li(r)});this.version="2.5.0";let o=this.buildOptions(r);this.apiUrl=o.apiUrl,this.secretKey=o.secretKey,this.strictAuthentication=o.strictAuthentication,this.templateEngine.registerFilter("json",(u,v)=>li(u,v))}buildOptions(r){let o={apiUrl:On(r==null?void 0:r.apiUrl),secretKey:En(r==null?void 0:r.secretKey),strictAuthentication:!Uo()};return(r==null?void 0:r.strictAuthentication)!==void 0?o.strictAuthentication=r.strictAuthentication:process.env.NOVU_STRICT_AUTHENTICATION_ENABLED!==void 0&&(o.strictAuthentication=process.env.NOVU_STRICT_AUTHENTICATION_ENABLED==="true"),o}async addWorkflows(r){for(let o of r){if(this.discoveredWorkflows.has(o.id))continue;let u=this.discoverWorkflowPromises.get(o.id);if(u){await u;continue}let v=this.addWorkflow(o);this.discoverWorkflowPromises.set(o.id,v),await v}}async addWorkflow(r){try{let o=await r.discover();$r(o),this.discoveredWorkflows.set(r.id,o)}finally{this.discoverWorkflowPromises.delete(r.id)}}healthCheck(){let r=this.getRegisteredWorkflows(),o=r.length,u=r.reduce((v,j)=>v+j.steps.length,0);return{status:"ok",sdkVersion:"2.5.0",frameworkVersion:"2024-06-26",discovered:{workflows:o,steps:u}}}getWorkflow(r){let o=this.discoveredWorkflows.get(r);if(o)return o;throw new Ct(r)}getStep(r,o){let v=this.getWorkflow(r).steps.find(j=>j.stepId===o);if(v)return v;throw new bn(o)}getRegisteredWorkflows(){return Array.from(this.discoveredWorkflows.values())}discover(){return{workflows:this.getRegisteredWorkflows()}}mock(r){return Dr(r)}async validate(r,o,u,v,j,$,ie){let pe=await xn(o,r);if(pe.success)return pe.data;switch(u){case"event":this.throwInvalidEvent(v,j,pe.errors);case"step":this.throwInvalidStep($,v,j,pe.errors);case"provider":this.throwInvalidProvider($,ie,v,j,pe.errors);default:throw new Error(`Invalid component: '${u}'`)}}throwInvalidProvider(r,o,u,v,j){if(!r)throw new Error("stepId is required");if(!o)throw new Error("providerId is required");switch(u){case"output":throw new on(v,r,o,j);default:throw new Error(`Invalid payload type: '${u}'`)}}throwInvalidStep(r,o,u,v){if(!r)throw new Error("stepId is required");switch(o){case"output":throw new nn(u,r,v);case"result":throw new rn(u,r,v);case"controls":throw new tn(u,r,v);default:throw new Error(`Invalid payload type: '${o}'`)}}throwInvalidEvent(r,o,u){switch(r){case"controls":throw new en(o,u);case"payload":throw new Nt(o,u);default:throw new Error(`Invalid payload type: '${r}'`)}}executeStepFactory(r,o,u){return async(v,j,$)=>{if(u())return;let ie=this.getStep(r.workflowId,v),pe=r.action==="preview";if(!pe&&v===r.stepId){let De=await this.createStepControls(ie,r);if(await this.shouldSkip($==null?void 0:$.skip,De))return o({options:{skip:!0},outputs:{},providers:{}}),{}}let ve=this.previewStep.bind(this),Le=this.executeStep.bind(this),Re=await(pe?ve:Le)(r,{...ie,providers:ie.providers.map(De=>{var ot;let Fe=(ot=$==null?void 0:$.providers)==null?void 0:ot[De.type];if(!Fe)throw new dn(De.type);return{...De,resolve:Fe}}),resolve:j});return Object.values(zt).includes(ie.type)&&($==null?void 0:$.disableOutputSanitization)!==!0&&(Re={...Re,outputs:vn(Re.outputs)}),v===r.stepId&&o({...Re,options:{skip:!1}}),Re.outputs}}async shouldSkip(r,o){return r?r(o):!1}async executeWorkflow(r){let v=`${{execute:"Executing",preview:"Previewing"}[r.action]} workflowId:`;console.log(` ${we.bold(we.underline(v))} '${r.workflowId}'`);let j=this.getWorkflow(r.workflowId),$=process.hrtime(),ie={outputs:{},providers:{},options:{skip:!1}},pe,ve=!1,Le=new Promise(Ge=>{pe=Ge}),$e=Ge=>{if(ve)throw new Error("setResult can only be called once per workflow execution");pe(),ve=!0,ie=Ge},Re=()=>ve,De;try{if(r.action==="execute"&&!r.payload)throw new Nt(r.workflowId,{message:"Event `payload` is required"});let Ge=await this.createExecutionPayload(r,j),Ke={...r,payload:Ge};await Promise.race([Le,j.execute({payload:Ge,environment:{},controls:{},subscriber:r.subscriber,step:{email:this.executeStepFactory(Ke,$e,Re),sms:this.executeStepFactory(Ke,$e,Re),inApp:this.executeStepFactory(Ke,$e,Re),digest:this.executeStepFactory(Ke,$e,Re),delay:this.executeStepFactory(Ke,$e,Re),push:this.executeStepFactory(Ke,$e,Re),chat:this.executeStepFactory(Ke,$e,Re),custom:this.executeStepFactory(Ke,$e,Re)}})])}catch(Ge){De=Ge}let Fe=process.hrtime($),ot=Fe[0],Je=Fe[1],$t=ot*1e3+Je/1e6,$n=De?_e.ERROR:_e.SUCCESS,Ut={execute:"Executed",preview:"Previewed"}[r.action];if(console.log(`${$n} ${Ut} workflowId: \`${r.workflowId}\``),this.prettyPrintExecute(r,$t,De),De)throw De;return{outputs:ie.outputs,providers:ie.providers,options:ie.options,metadata:{status:"success",error:!1,duration:$t}}}async createExecutionPayload(r,o){let{payload:u}=r;if(r.action==="preview"){let j=this.mock(o.payload.schema);u=Object.assign(j,u)}return await this.validate(u,o.payload.unknownSchema,"event","payload",r.workflowId)}prettyPrintExecute(r,o,u){let v=u?_e.ERROR:_e.SUCCESS,$={execute:"Executed",preview:"Previewed"}[r.action],ie=u?"Failed to execute":$,pe=u?we.error:we.success,ve=`${v} ${ie} workflowId: '${r.workflowId}`;console.log(` ${we.bold(pe(ve))}'`),console.log(` \u251C ${_e.STEP} stepId: '${r.stepId}'`),console.log(` \u251C ${_e.ACTION} action: '${r.action}'`),console.log(` \u2514 ${_e.DURATION} duration: '${o.toFixed(2)}ms' `)}async executeProviders(r,o,u){return o.providers.reduce(async(v,j)=>{let $=await v,ie=this.previewProvider.bind(this),pe=this.executeProvider.bind(this),Le=await(r.action==="preview"?ie:pe)(r,o,j,u);return{...$,[j.type]:Le}},Promise.resolve({}))}previewProvider(r,o,u,v){return console.log(` ${_e.MOCK} Mocked provider: \`${u.type}\``),this.mock(u.outputs.schema)}async executeProvider(r,o,u,v){try{if(r.stepId===o.stepId){let j=await this.createStepControls(o,r),$=await u.resolve({controls:j,outputs:v}),ie=await this.validate($,u.outputs.unknownSchema,"step","output",r.workflowId,o.stepId,u.type);return console.log(` ${_e.SUCCESS} Executed provider: \`${u.type}\``),{...ie,_passthrough:$._passthrough}}else return console.log(` ${_e.HYDRATED} Hydrated provider: \`${u.type}\``),{}}catch(j){throw console.log(` ${_e.ERROR} Failed to execute provider: \`${u.type}\``),new fn(u.type,r.action,j)}}async executeStep(r,o){if(r.stepId===o.stepId)try{let u=await this.createStepControls(o,r),v=await this.compileControls(u,r),j=await o.resolve(v),$=await this.validate(j,o.outputs.unknownSchema,"step","output",r.workflowId,o.stepId),ie=await this.executeProviders(r,o,$);return console.log(` ${_e.SUCCESS} Executed stepId: \`${o.stepId}\``),{outputs:$,providers:ie}}catch(u){throw console.log(` ${_e.ERROR} Failed to execute stepId: \`${o.stepId}\``),lt(u)?u:new Mt(o.stepId,r.action,u)}else try{let u=this.getStepState(r,o.stepId);if(u){let v=await this.validate(u.outputs,o.results.unknownSchema,"step","result",r.workflowId,o.stepId);return console.log(` ${_e.HYDRATED} Hydrated stepId: \`${o.stepId}\``),{outputs:v,providers:await this.executeProviders(r,o,v)}}else throw new Zt(r.workflowId,o.stepId)}catch(u){throw console.log(` ${_e.ERROR} Failed to hydrate stepId: \`${o.stepId}\``),u}}async compileControls(r,o){try{let u=this.templateEngine.parse(JSON.stringify(r)),v=await this.templateEngine.render(u,{payload:o.payload,subscriber:o.subscriber,steps:Fo(o.state)});return JSON.parse(v)}catch(u){throw new sn(o.workflowId,o.stepId,u)}}async createStepControls(r,o){return await this.validate(o.controls,r.controls.unknownSchema,"step","controls",o.workflowId,r.stepId)}async previewStep(r,o){try{return await this.constructStepForPreview(r,o)}catch(u){throw console.log(` ${_e.ERROR} Failed to preview stepId: \`${o.stepId}\``),lt(u)?u:new Mt(o.stepId,r.action,u)}}async constructStepForPreview(r,o){return r.stepId===o.stepId?await this.previewRequiredStep(o,r):await this.extractMockDataForPreviousSteps(r,o)}async extractMockDataForPreviousSteps(r,o){let u={},v=this.getStepState(r,o.stepId),j=this.mock(o.results.schema);return{outputs:ui(j,(v==null?void 0:v.outputs)||{}),providers:await this.executeProviders(r,o,u)}}async previewRequiredStep(r,o){let u=await this.createStepControls(r,o),v=await this.compileControls(u,o),j=await r.resolve(v),$=await this.validate(j,r.outputs.unknownSchema,"step","output",o.workflowId,r.stepId);return console.log(` ${_e.MOCK} Mocked stepId: \`${r.stepId}\``),{outputs:$,providers:await this.executeProviders(o,r,$)}}getStepState(r,o){return r.state.find(u=>u.stepId===o)}getStepCode(r,o){return{code:this.getStep(r,o).resolve.toString()}}getWorkflowCode(r){return{code:this.getWorkflow(r).execute.toString()}}getCode(r,o){let u;if(r)o?u=this.getStepCode(r,o):u=this.getWorkflowCode(r);else throw new Ct(r);return u}};function Fo(b){let r={};for(let o of b)r[o.stepId]=o.outputs;return r}var Mn=class{constructor(r){this.handler=r.handler,this.client=r.client?r.client:new wt,this.workflows=r.workflows,this.http=Tn(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 o=await this.handler(...r),u=await this.handleAction({actions:o});return o.transformResponse(u)}}getStaticHeaders(){let r=`novu-framework:v${this.client.version}`;return{"content-type":"application/json","access-control-allow-origin":"*","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.5.0","novu-framework-server":this.frameworkName,"user-agent":r}}createResponse(r,o){return{status:r,body:JSON.stringify(o),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 o=await r.url(),u=await r.method(),v=o.searchParams.get("action")||"health-check",j=o.searchParams.get("workflowId")||"",$=o.searchParams.get("stepId")||"",ie=await r.headers("novu-signature")||"",pe={};try{u==="POST"&&(pe=await r.body())}catch{}try{v!=="health-check"&&await this.validateHmac(pe,ie);let ve=this.getPostActionMap(pe,j,$,v),Le=this.getGetActionMap(j,$);if(u==="POST")return await this.handlePostAction(v,ve);if(u==="GET")return await this.handleGetAction(v,Le);if(u==="OPTIONS")return this.createResponse(200,{})}catch(ve){return this.handleError(ve)}return this.createError(new cn(u))}getPostActionMap(r,o,u,v){return{trigger:this.triggerAction({workflowId:o,...r}),execute:async()=>{let j=await this.client.executeWorkflow({...r,workflowId:o,stepId:u,action:v});return this.createResponse(200,j)},preview:async()=>{let j=await this.client.executeWorkflow({...r,workflowId:o,stepId:u,action:v});return this.createResponse(200,j)}}}triggerAction(r){return async()=>{let o={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}},u=await this.http.post("/events/trigger",o);return this.createResponse(200,u)}}getGetActionMap(r,o){return{discover:async()=>{let u=await this.client.discover();return this.createResponse(200,u)},"health-check":async()=>{let u=await this.client.healthCheck();return this.createResponse(200,u)},code:async()=>{let u=await this.client.getCode(r,o);return this.createResponse(200,u)}}}async handlePostAction(r,o){if(Object.values(Pt).includes(r)){let u=o[r];return u()}else throw new xt(r,Pt)}async handleGetAction(r,o){if(Object.values(Kt).includes(r)){let u=o[r];return u()}else throw new xt(r,Kt)}handleError(r){if(lt(r))return r.statusCode>=500&&console.error(r),this.createError(r);if(Or(r))return this.createError(r);{let o=new mt(r);return console.error(o),this.createError(o)}}async validateHmac(r,o){if(!this.hmacEnabled)return;if(!o)throw new mn;if(!this.client.secretKey)throw new wn;let[u,v]=o.split(",");if(!u||!v)throw new yn;let[j,$]=u.split("="),[ie,pe]=v.split("=");if(Number(j)"},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},qr={output:Ko};var Jr={braze:H,clickatell:H,nodemailer:Vr,emailjs:H,"email-webhook":H,"infobip-email":H,mailersend:H,mailgun:Yr,mailjet:Wr,mailtrap:H,mandrill:H,netcore:H,"novu-email":Br,outlook365:H,plunk:H,postmark:H,resend:H,sendgrid:qr,sendinblue:H,ses:H,sparkpost:H};var Ho={type:"object",properties:{},required:[],additionalProperties:!1},Gr={output:Ho};var Kr={novu:Gr};var Hr={anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{name:{type:"string"},volume:{type:"number"},critical:{type:"number"}},required:["name","volume","critical"]}]},zo={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: 10 - The push notification is sent to the device immediately. (Default) 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. 5 - The push message is sent at a time that conserves power on the device receiving it.`},collapseId:{type:"string"},pushType:{type:"string",enum:["background","alert","voip"],description:`The type of the notification. The value of this header is alert or background. Specify alert when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify background for silent notifications that do not interact with the user. The value of this header must accurately reflect the contents of your notification's payload. If there is a mismatch, or if the header is missing on required systems, APNs may delay the delivery of the notification or drop it altogether.`},threadId:{type:"string"},payload:{type:"object",additionalProperties:!0},aps:{type:"object",additionalProperties:!0,properties:{badge:{type:"number"},sound:Hr,category:{type:"string"},contentAvailable:{type:"number"},launchImage:{type:"number"},mutableContent:{type:"number"},urlArgs:{type:"array",items:{type:"string"}}}},rawPayload:{type:"object",additionalProperties:!0},badge:{type:"number"},sound:Hr,alert:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0,properties:{title:{type:"string"},body:{type:"string"},subtitle:{type:"string"},titleLocKey:{type:"string"},titleLocArgs:{type:"array",items:{type:"string"}},actionLocKey:{type:"string"},locKey:{type:"string"},locArgs:{type:"array",items:{type:"string"}},launchImage:{type:"string"}},required:["body"]}]},contentAvailable:{type:"boolean"},mutableContent:{type:"boolean"},mdm:{anyOf:[{type:"string"},{type:"object",additionalProperties:!0}]},urlArgs:{type:"array",items:{type:"string"}}},required:[],additionalProperties:!0},zr={output:zo};var Xo={type:"object",properties:{to:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"An Expo push token or an array of Expo push tokens specifying the recipient(s) of this message."},data:{type:"object",additionalProperties:!0,description:'A JSON object delivered to your app. It may be up to about 4KiB; the total notification payload sent to Apple and Google must be at most 4KiB or else you will get a "Message Too Big" error.'},title:{type:"string",description:"The title to display in the notification. Often displayed above the notification body."},subtitle:{type:"string",description:"The subtitle to display in the notification below the title."},body:{type:"string",description:"The message to display in the notification."},sound:{anyOf:[{type:"string"},{type:"null"},{type:"object",properties:{name:{anyOf:[{type:"string",enum:["default"]},{type:"null"}]},volume:{type:"number"},critical:{type:"boolean"}},additionalProperties:!0}],description:"Play a sound when the recipient receives this notification. Specify default to play the device's default notification sound, or omit this field to play no sound. Custom sounds are not supported."},ttl:{type:"number",description:"Time to Live: the number of seconds for which the message may be kept around for redelivery if it hasn't been delivered yet. Defaults to undefined to use the respective defaults of each provider (2419200 (4 weeks) for Android/FCM and 0 for iOS/APNs)."},expiration:{type:"number",description:"Timestamp since the Unix epoch specifying when the message expires. Same effect as ttl (ttl takes precedence over expiration)."},priority:{type:"string",enum:["default","normal","high"],description:'The delivery priority of the message. Specify default or omit this field to use the default priority on each platform ("normal" on Android and "high" on iOS).'},badge:{type:"number",description:"Number to display in the badge on the app icon. Specify zero to clear the badge."},channelId:{type:"string",description:"ID of the Notification Channel through which to display this notification. If an ID is specified but the corresponding channel does not exist on the device (that has not yet been created by your app), the notification will not be displayed to the user."},categoryId:{type:"string",description:"ID of the notification category that this notification is associated with."},mutableContent:{type:"boolean",description:"Specifies whether this notification can be intercepted by the client app. In Expo Go, this defaults to true, and if you change that to false, you may experience issues. In standalone and bare apps, this defaults to false."}},required:[],additionalProperties:!0},Xr={output:Xo};var Qo={type:"object",properties:{to:{description:`This parameter specifies the recipient of a message. The value must be a registration token, notification key, or topic. Do not set this field when sending to multiple topics. See **condition**. `,type:"string"},registrationIds:{description:`This parameter specifies a list of devices (registration tokens, or IDs) receiving a multicast message. It must contain at least 1 and at most 1000 registration tokens. Use this parameter only for multicast messaging, not for single recipients. Multicast messages (sending to more than 1 registration tokens) are allowed using HTTP JSON format only. `,type:"array",items:{type:"string"}},condition:{description:`This parameter specifies a logical expression of conditions that determine the message target. Supported condition: Topic, formatted as yourTopic in topics. This value is case-insensitive. Supported operators: &&, ||. Maximum two operators per topic message supported. `,type:"string"},notificationKey:{description:`This parameter is deprecated. Instead, use **to** to specify message recipients. For more information on how to send messages to multiple devices using **to**, see [Device Group Messaging](https://firebase.google.com/docs/cloud-messaging/notifications). `,type:"string"},collapseKey:{description:'This parameter identifies a group of messages (e.g., with ```"collapseKey": "Updates Available"```) that can be collapsed, so that only the last message gets sent when delivery can be resumed. This is intended to avoid sending too many of the same messages when the device comes back online or becomes active (see **delayWhileIdle**).\nNote that there is no guarantee of the order in which messages get sent.\nNote: A maximum of 4 different collapse keys is allowed at any given time. This means a FCM connection server can simultaneously store 4 different send-to-sync messages per client app. If you exceed this number, there is no guarantee which 4 collapse keys the FCM connection server will keep.\n',type:"string"},priority:{description:`Sets the priority of the message. Valid values are normal and high. On iOS, these correspond to APNs priorities 5 and 10. By default, messages are sent with normal priority. Normal priority optimizes the client app's battery consumption and should be used unless immediate delivery is required. For messages with normal priority, the app may receive the message with unspecified delay. When a message is sent with high priority, it is sent immediately, and the app can wake a sleeping device and open a network connection to your server.For more information, see [Setting the priority of a message](https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message). `,type:"string",enum:["normal","high"]},contentAvailable:{description:"On iOS, use this field to represent **content-available** in the APNS payload. When a notification or message is sent and this is set to ```true```, an inactive client app is awoken. On Android, data messages wake the app by default. On Chrome, currently not supported.\n",type:"boolean"},mutableContent:{description:`Currently for iOS 10+ devices only. On iOS, use this field to represent mutable-content in the APNS payload. When a notification is sent and this is set to true, the content of the notification can be modified before it is displayed, using a [Notification Service app extension](https://developer.apple.com/reference/usernotifications/unnotificationserviceextension). This parameter will be ignored for Android and web. `,type:"boolean"},delayWhileIdle:{description:"When this parameter is set to ```true```, it indicates that the message should not be sent until the device becomes active.\nThe default value is ```false```.\n",type:"boolean"},timeToLive:{description:`This parameter specifies how long (in seconds) the message should be kept in FCM storage if the device is offline. The maximum time to live supported is 4 weeks, and the default value is 4 weeks. For more information, see [Setting the lifespan of a message](https://firebase.google.com/docs/cloud-messaging/concept-options#ttl). `,type:"number"},restrictedPackageName:{description:`This parameter specifies the package name of the application where the registration tokens must match in order to receive the message. `,type:"string"},dryRun:{description:"This parameter, when set to ```true```, allows developers to test a request without actually sending a message.\nThe default value is ```false```.\n",type:"boolean"},data:{description:'This parameter specifies the custom key-value pairs of the message\'s payload.\nFor example, with ```"data":{"score":"3x1"}```:\nOn iOS, if the message is sent via APNS, it represents the custom data fields. If it is sent via FCM connection server, it would be represented as key value dictionary in ```AppDelegate application:didReceiveRemoteNotification:```.\nOn Android, this would result in an intent extra named **score** with the string value **3x1**.\nThe key should not be a reserved word ("from" or any word starting with "google" or "gcm"). Do not use any of the words defined in this table (such as **collapseKey**).\n',type:"object",additionalProperties:{type:"string"}},notification:{description:`Notification payload. For more information about notification message and data message options, see [Payload](https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages). `,type:"object",properties:{title:{description:"Indicates notification title. This field is not visible on iOS phones and tablets. Field is required for android.",type:"string"},body:{description:"Indicates notification body text.",type:"string"},icon:{description:"android: Indicates notification icon. Sets value to **myicon** for drawable resource **myicon**.",type:"string"},sound:{description:`Indicates a sound to play when the device receives a notification. * iOS: Sound files can be in the main bundle of the client app or in the Library/Sounds folder of the app's data container. See the [iOS Developer Library](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6) for more information). * android: Supports default or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/. `,type:"string"},badge:{description:"iOS: Indicates the badge on the client app home icon.",type:"string"},tag:{description:`android: Indicates whether each notification results in a new entry in the notification drawer. If not set, each request creates a new notification. If set, and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification drawer. `,type:"string"},color:{description:"android: Indicates color of the icon, expressed in #rrggbb format",type:"string"},clickAction:{description:`Indicates the action associated with a user click on the notification. * iOS: Corresponds to category in the APNs payload. * android: When this is set, an activity with a matching intent filter is launched when user clicks the notification. `,type:"string"},bodyLocKey:{description:`Indicates the key to the body string for localization. * iOS: Corresponds to "loc-key" in the APNs payload. * android: Use the key in the app's string resources when populating this value. `,type:"string"},bodyLocArgs:{description:`Indicates the string value to replace format specifiers in the body string for localization. * iOS: Corresponds to "loc-args" in the APNs payload. * android: See [Formatting and Styling](https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling). `,type:"string"},titleLocKey:{description:`Indicates the key to the title string for localization. * iOS: Corresponds to "title-loc-key" in the APNs payload. * android: Use the key in the app's string resources when populating this value. `,type:"string"},titleLocArgs:{description:`Indicates the string value to replace format specifiers in the title string for localization. * iOS: Corresponds to "title-loc-args" in the APNs payload. * android: See [Formatting strings](https://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling). `,type:"string"}}}},required:[],additionalProperties:!0},Qr={output:Qo};var Zo={allOf:[{allOf:[{anyOf:[{type:"object",properties:{includedSegments:{type:"array",description:`The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excludedSegments. Example: ["Active Users", "Inactive Users"] `,items:{type:"string"}},excludedSegments:{type:"array",description:`Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in includedSegments. This targeting parameter is only compatible with includedSegments. Example: ["Active Users", "Inactive Users"] `,items:{type:"string"}}}},{type:"object",properties:{includePlayerIds:{type:"array",description:`Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: ["1dd608f2-c6a1-11e3-851d-000c2940e62c"] Limit of 2,000 entries per REST API call `,items:{type:"string"},nullable:!0},includeExternalUserIds:{type:"array",description:`Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: ["custom-id-assigned-by-api"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channelForExternalUserIds to indicate you are sending a push or email or sms. `,items:{type:"string"},nullable:!0},includeEmailTokens:{type:"array",description:`Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call `,items:{type:"string"}},includePhoneNumbers:{type:"array",description:`Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeIosTokens:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeWpWnsUris:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeAmazonRegIds:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeChromeRegIds:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeChromeWebRegIds:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeAndroidRegIds:{type:"array",description:`Not Recommended: Please consider using includePlayerIds or includeExternalUserIds instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call `,items:{type:"string"}},includeAliases:{type:"object",properties:{aliasLabel:{type:"array",items:{type:"string"}}},nullable:!0},targetChannel:{type:"string",enum:["push","email","sms"]}}}]},{type:"object",properties:{id:{type:"string"},value:{type:"integer",readOnly:!0},name:{type:"string",description:`Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user.`,writeOnly:!0,nullable:!0},aggregation:{type:"string",enum:["sum","count"],readOnly:!0},isIos:{type:"boolean",description:"Indicates whether to send to all devices registered under your app's Apple iOS platform.",writeOnly:!0,nullable:!0},isAndroid:{type:"boolean",description:"Indicates whether to send to all devices registered under your app's Google Android platform.",writeOnly:!0,nullable:!0},isHuawei:{type:"boolean",description:"Indicates whether to send to all devices registered under your app's Huawei Android platform.",writeOnly:!0,nullable:!0},isAnyWeb:{type:"boolean",description:`Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. `,writeOnly:!0,nullable:!0},isChromeWeb:{type:"boolean",writeOnly:!0,nullable:!0,description:"Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform."},isFirefox:{type:"boolean",writeOnly:!0,nullable:!0,description:"Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform."},isSafari:{type:"boolean",writeOnly:!0,nullable:!0,description:"Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari"},isWpWns:{type:"boolean",writeOnly:!0,nullable:!0,description:"Indicates whether to send to all devices registered under your app's Windows platform."},isAdm:{type:"boolean",writeOnly:!0,nullable:!0,description:"Indicates whether to send to all devices registered under your app's Amazon Fire platform."},isChrome:{type:"boolean",writeOnly:!0,nullable:!0,description:`This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. `},channelForExternalUserIds:{type:"string",writeOnly:!0,description:`Indicates if the message type when targeting with includeExternalUserIds for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string "push" to indicate you are sending a push notification or the string "email"for sending emails or "sms"for sending SMS. `},appId:{type:"string",description:`Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. `,writeOnly:!0},externalId:{type:"string",description:`Correlation and idempotency key. A request received with this parameter will first look for another notification with the same externalId. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same externalId will be sent again. See Idempotent Notification Requests for more details writeOnly: true `,nullable:!0},contents:{allOf:[{type:"object",properties:{en:{type:"string",description:"Text in English. Will be used as a fallback"},ar:{type:"string",description:"Text in Arabic."},bs:{type:"string",description:"Text in Bosnian."},bg:{type:"string",description:"Text in Bulgarian."},ca:{type:"string",description:"Text in Catalan."},"zh-Hans":{type:"string",description:"Text in Chinese (Simplified)."},"zh-Hant":{type:"string",description:"Text in Chinese (Traditional)."},zh:{type:"string",description:"Alias for zh-Hans."},hr:{type:"string",description:"Text in Croatian."},cs:{type:"string",description:"Text in Czech."},da:{type:"string",description:"Text in Danish."},nl:{type:"string",description:"Text in Dutch."},et:{type:"string",description:"Text in Estonian."},fi:{type:"string",description:"Text in Finnish."},fr:{type:"string",description:"Text in French."},ka:{type:"string",description:"Text in Georgian."},de:{type:"string",description:"Text in German."},el:{type:"string",description:"Text in Greek."},hi:{type:"string",description:"Text in Hindi."},he:{type:"string",description:"Text in Hebrew."},hu:{type:"string",description:"Text in Hungarian."},id:{type:"string",description:"Text in Indonesian."},it:{type:"string",description:"Text in Italian."},ja:{type:"string",description:"Text in Japanese."},ko:{type:"string",description:"Text in Korean."},lv:{type:"string",description:"Text in Latvian."},lt:{type:"string",description:"Text in Lithuanian."},ms:{type:"string",description:"Text in Malay."},nb:{type:"string",description:"Text in Norwegian."},pl:{type:"string",description:"Text in Polish."},fa:{type:"string",description:"Text in Persian."},pt:{type:"string",description:"Text in Portuguese."},pa:{type:"string",description:"Text in Punjabi."},ro:{type:"string",description:"Text in Romanian."},ru:{type:"string",description:"Text in Russian."},sr:{type:"string",description:"Text in Serbian."},sk:{type:"string",description:"Text in Slovak."},es:{type:"string",description:"Text in Spanish."},sv:{type:"string",description:"Text in Swedish."},th:{type:"string",description:"Text in Thai."},tr:{type:"string",description:"Text in Turkish."},uk:{type:"string",description:"Text in Ukrainian."},vi:{type:"string",description:"Text in Vietnamese."}}},{description:`Required unless contentAvailable=true or templateId is set. The message's content (excluding the title), a map of language codes to text for each language. Each hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language. This field supports inline substitutions. English must be included in the hash. Example: {"en": "English Message", "es": "Spanish Message"} `,writeOnly:!0}]},headings:{allOf:[{type:"object",properties:{en:{type:"string",description:"Text in English. Will be used as a fallback"},ar:{type:"string",description:"Text in Arabic."},bs:{type:"string",description:"Text in Bosnian."},bg:{type:"string",description:"Text in Bulgarian."},ca:{type:"string",description:"Text in Catalan."},"zh-Hans":{type:"string",description:"Text in Chinese (Simplified)."},"zh-Hant":{type:"string",description:"Text in Chinese (Traditional)."},zh:{type:"string",description:"Alias for zh-Hans."},hr:{type:"string",description:"Text in Croatian."},cs:{type:"string",description:"Text in Czech."},da:{type:"string",description:"Text in Danish."},nl:{type:"string",description:"Text in Dutch."},et:{type:"string",description:"Text in Estonian."},fi:{type:"string",description:"Text in Finnish."},fr:{type:"string",description:"Text in French."},ka:{type:"string",description:"Text in Georgian."},de:{type:"string",description:"Text in German."},el:{type:"string",description:"Text in Greek."},hi:{type:"string",description:"Text in Hindi."},he:{type:"string",description:"Text in Hebrew."},hu:{type:"string",description:"Text in Hungarian."},id:{type:"string",description:"Text in Indonesian."},it:{type:"string",description:"Text in Italian."},ja:{type:"string",description:"Text in Japanese."},ko:{type:"string",description:"Text in Korean."},lv:{type:"string",description:"Text in Latvian."},lt:{type:"string",description:"Text in Lithuanian."},ms:{type:"string",description:"Text in Malay."},nb:{type:"string",description:"Text in Norwegian."},pl:{type:"string",description:"Text in Polish."},fa:{type:"string",description:"Text in Persian."},pt:{type:"string",description:"Text in Portuguese."},pa:{type:"string",description:"Text in Punjabi."},ro:{type:"string",description:"Text in Romanian."},ru:{type:"string",description:"Text in Russian."},sr:{type:"string",description:"Text in Serbian."},sk:{type:"string",description:"Text in Slovak."},es:{type:"string",description:"Text in Spanish."},sv:{type:"string",description:"Text in Swedish."},th:{type:"string",description:"Text in Thai."},tr:{type:"string",description:"Text in Turkish."},uk:{type:"string",description:"Text in Ukrainian."},vi:{type:"string",description:"Text in Vietnamese."}}},{description:`The message's title, a map of language codes to text for each language. Each hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language. This field supports inline substitutions. Example: {"en": "English Title", "es": "Spanish Title"} `,writeOnly:!0}]},subtitle:{allOf:[{type:"object",properties:{en:{type:"string",description:"Text in English. Will be used as a fallback"},ar:{type:"string",description:"Text in Arabic."},bs:{type:"string",description:"Text in Bosnian."},bg:{type:"string",description:"Text in Bulgarian."},ca:{type:"string",description:"Text in Catalan."},"zh-Hans":{type:"string",description:"Text in Chinese (Simplified)."},"zh-Hant":{type:"string",description:"Text in Chinese (Traditional)."},zh:{type:"string",description:"Alias for zh-Hans."},hr:{type:"string",description:"Text in Croatian."},cs:{type:"string",description:"Text in Czech."},da:{type:"string",description:"Text in Danish."},nl:{type:"string",description:"Text in Dutch."},et:{type:"string",description:"Text in Estonian."},fi:{type:"string",description:"Text in Finnish."},fr:{type:"string",description:"Text in French."},ka:{type:"string",description:"Text in Georgian."},de:{type:"string",description:"Text in German."},el:{type:"string",description:"Text in Greek."},hi:{type:"string",description:"Text in Hindi."},he:{type:"string",description:"Text in Hebrew."},hu:{type:"string",description:"Text in Hungarian."},id:{type:"string",description:"Text in Indonesian."},it:{type:"string",description:"Text in Italian."},ja:{type:"string",description:"Text in Japanese."},ko:{type:"string",description:"Text in Korean."},lv:{type:"string",description:"Text in Latvian."},lt:{type:"string",description:"Text in Lithuanian."},ms:{type:"string",description:"Text in Malay."},nb:{type:"string",description:"Text in Norwegian."},pl:{type:"string",description:"Text in Polish."},fa:{type:"string",description:"Text in Persian."},pt:{type:"string",description:"Text in Portuguese."},pa:{type:"string",description:"Text in Punjabi."},ro:{type:"string",description:"Text in Romanian."},ru:{type:"string",description:"Text in Russian."},sr:{type:"string",description:"Text in Serbian."},sk:{type:"string",description:"Text in Slovak."},es:{type:"string",description:"Text in Spanish."},sv:{type:"string",description:"Text in Swedish."},th:{type:"string",description:"Text in Thai."},tr:{type:"string",description:"Text in Turkish."},uk:{type:"string",description:"Text in Ukrainian."},vi:{type:"string",description:"Text in Vietnamese."}}},{description:`The message's subtitle, a map of language codes to text for each language. Each hash must have a language code string for a key, mapped to the localized text you would like users to receive for that language. This field supports inline substitutions. Example: {"en": "English Subtitle", "es": "Spanish Subtitle"} `,writeOnly:!0}]},data:{type:"object",description:`Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {"abc": 123, "foo": "bar", "event_performed": true, "amount": 12.1} `,writeOnly:!0,nullable:!0},huaweiMsgType:{type:"string",description:`Channel: Push Notifications Platform: Huawei Use "data" or "message" depending on the type of notification you are sending. More details in Data & Background Notifications. `,writeOnly:!0,nullable:!0},url:{type:"string",description:`Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including webUrl or appUrl Example: https://onesignal.com `,writeOnly:!0,nullable:!0},webUrl:{type:"string",description:`Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com `,writeOnly:!0,nullable:!0},appUrl:{type:"string",description:`Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com `,writeOnly:!0,nullable:!0},iosAttachments:{type:"object",description:`Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutableContent to download attachments. The OneSignal SDK does this automatically Example: {"id1": "https://domain.com/image.jpg"} `,writeOnly:!0,nullable:!0},templateId:{type:"string",description:`Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The templateId is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c `,writeOnly:!0,nullable:!0},contentAvailable:{type:"boolean",description:`Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the "force-quit" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. `,writeOnly:!0,nullable:!0},mutableContent:{type:"boolean",description:`Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. `,writeOnly:!0},targetContentIdentifier:{type:"string",description:`Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. `,writeOnly:!0,nullable:!0},bigPicture:{type:"string",description:`Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. `,writeOnly:!0,nullable:!0},huaweiBigPicture:{type:"string",description:`Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. `,writeOnly:!0,nullable:!0},admBigPicture:{type:"string",description:`Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. `,writeOnly:!0,nullable:!0},chromeBigPicture:{type:"string",description:`Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. `,writeOnly:!0,nullable:!0},chromeWebImage:{type:"string",description:`Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. `,writeOnly:!0,nullable:!0},buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},text:{type:"string"},icon:{type:"string"}},required:["id"]},description:`Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{"id": "id2", "text": "second button", "icon": "ic_menu_share"}, {"id": "id1", "text": "first button", "icon": "ic_menu_send"}] `,writeOnly:!0,nullable:!0},webButtons:{type:"array",items:{type:"object",properties:{id:{type:"string"},text:{type:"string"},icon:{type:"string"}},required:["id"]},description:`Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{"id": "like-button", "text": "Like", "icon": "http://i.imgur.com/N8SN8ZS.png", "url": "https://yoursite.com"}, {"id": "read-more-button", "text": "Read more", "icon": "http://i.imgur.com/MIxJp1L.png", "url": "https://yoursite.com"}] `,writeOnly:!0,nullable:!0},iosCategory:{type:"string",description:`Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. `,writeOnly:!0,nullable:!0},androidChannelId:{type:"string",description:`Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. `,writeOnly:!0},huaweiChannelId:{type:"string",description:`Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. `,writeOnly:!0,nullable:!0},existingAndroidChannelId:{type:"string",description:`Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. `,writeOnly:!0},huaweiExistingChannelId:{type:"string",description:`Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. `,writeOnly:!0,nullable:!0},androidBackgroundLayout:{type:"object",description:`Channel: Push Notifications Platform: Android Allowing setting a background image for the notification. This is a JSON object containing the following keys. See our Background Image documentation for image sizes. `,properties:{image:{type:"string",description:"Asset file, android resource name, or URL to remote image."},headingsColor:{type:"string",description:'Title text color ARGB Hex format. Example(Blue) "FF0000FF".'},contentsColor:{type:"string",description:'Body text color ARGB Hex format. Example(Red) "FFFF0000".'}},writeOnly:!0},smallIcon:{type:"string",description:`Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons `,writeOnly:!0,nullable:!0},huaweiSmallIcon:{type:"string",description:`Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/smallIcon). Defaults to your app icon if not set. `,writeOnly:!0,nullable:!0},largeIcon:{type:"string",description:`Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons `,writeOnly:!0,nullable:!0},huaweiLargeIcon:{type:"string",description:`Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons `,writeOnly:!0,nullable:!0},admSmallIcon:{type:"string",description:`Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons `,writeOnly:!0,nullable:!0},admLargeIcon:{type:"string",description:`Channel: Push Notifications Platform: Amazon If blank the smallIcon is used. Can be a drawable resource name or a URL. See: How to create large icons `,writeOnly:!0,nullable:!0},chromeWebIcon:{type:"string",description:`Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefoxIcon. `,nullable:!0},chromeWebBadge:{type:"string",description:`Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. `,writeOnly:!0,nullable:!0},firefoxIcon:{type:"string",description:`Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chromeWebIcon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. `,writeOnly:!0,nullable:!0},chromeIcon:{type:"string",description:`Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chromeWebIcon instead. The local URL to an icon to use. If blank, the app icon will be used. `,writeOnly:!0,nullable:!0},iosSound:{type:"string",description:`Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: "notification.wav" `,writeOnly:!0,nullable:!0},androidSound:{type:"string",description:`Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: "notification" `,writeOnly:!0,nullable:!0},huaweiSound:{type:"string",description:`Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: "/res/raw/notification" `,writeOnly:!0,nullable:!0},admSound:{type:"string",description:`Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: "notification" `,writeOnly:!0,nullable:!0},wpWnsSound:{type:"string",description:`Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: "notification.wav" `,writeOnly:!0,nullable:!0},androidLedColor:{type:"string",description:`Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): "FF0000FF" `,writeOnly:!0,nullable:!0},huaweiLedColor:{type:"string",description:`Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): "0000FF" `,writeOnly:!0,nullable:!0},androidAccentColor:{type:"string",description:`Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): "FFFF0000" `,writeOnly:!0,nullable:!0},huaweiAccentColor:{type:"string",description:`Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. `,writeOnly:!0,nullable:!0},androidVisibility:{type:"integer",description:`Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set "Hide sensitive notification content" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) `,writeOnly:!0,nullable:!0},huaweiVisibility:{type:"integer",nullable:!0,description:`Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set "Hide sensitive notification content" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) `,writeOnly:!0},iosBadgeType:{type:"string",description:"Channel: Push Notifications\nPlatform: iOS\nDescribes whether to set or increase/decrease your app's iOS badge count by the iosBadgeCount specified count. Can specify None, SetTo, or Increase.\n`None` leaves the count unaffected.\n`SetTo` directly sets the badge count to the number specified in iosBadgeCount.\n`Increase` adds the number specified in iosBadgeCount to the total. Use a negative number to decrease the badge count.\n",writeOnly:!0,nullable:!0},iosBadgeCount:{type:"integer",nullable:!0,description:`Channel: Push Notifications Platform: iOS Used with iosBadgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an iosBadgeType of Increase. `,writeOnly:!0},collapseId:{type:"string",description:`Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. `,writeOnly:!0},webPushTopic:{type:"string",description:`Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. `,nullable:!0},apnsAlert:{type:"object",description:`Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apnsAlert. Please see Apple's guide on localizing push notifications to learn more. `,writeOnly:!0,nullable:!0},delayedOption:{type:"string",description:`Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If sendAfter is used, this takes effect after the sendAfter time has elapsed. `,writeOnly:!0,nullable:!0},deliveryTimeOfDay:{type:"string",description:`Channel: All Use with delayedOption=timezone. Examples: "9:00AM" "21:45" "9:45:30" `,writeOnly:!0,nullable:!0},ttl:{type:"integer",nullable:!0,description:`Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). `,writeOnly:!0},priority:{type:"integer",nullable:!0,description:`Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. `,writeOnly:!0},apnsPushTypeOverride:{type:"string",description:`Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal `,writeOnly:!0},throttleRatePerMinute:{type:"string",description:`Channel: All Apps with throttling enabled: - the parameter value will be used to override the default application throttling value set from the dashboard settings. - parameter value 0 indicates not to apply throttling to the notification. - if the parameter is not passed then the default app throttling value will be applied to the notification. Apps with throttling disabled: - this parameter can be used to throttle delivery for the notification even though throttling is not enabled at the application level. Refer to throttling for more details. `,writeOnly:!0,nullable:!0},androidGroup:{type:"string",description:`Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. `,writeOnly:!0,nullable:!0},androidGroupMessage:{type:"string",description:`Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is "# new messages". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. "en" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {"en": "You have $[notif_count] new messages"} `,writeOnly:!0,nullable:!0},admGroup:{type:"string",description:`Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. `,writeOnly:!0,nullable:!0},admGroupMessage:{type:"object",description:`Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is "# new messages". Include $[notif_count] in your message and it will be replaced with the current number. "en" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {"en": "You have $[notif_count] new messages"} `,writeOnly:!0,nullable:!0},threadId:{type:"string",description:`Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. `,writeOnly:!0,nullable:!0},summaryArg:{type:"string",description:`Channel: Push Notifications Platform: iOS 12+ When using threadId to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say "12 more notifications from John Doe". The summaryArg lets you set the name of the person/thing the notifications are coming from, and will show up as "X more notifications from summaryArg" `,writeOnly:!0},summaryArgCount:{type:"integer",description:`Channel: Push Notifications Platform: iOS 12+ When using threadId, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summaryArgCount = 2, the new total will be 14 and the summary will be "14 more notifications from summaryArg" `,writeOnly:!0},emailSubject:{type:"string",description:`Channel: Email Required. The subject of the email. `,writeOnly:!0,nullable:!0},emailBody:{type:"string",description:`Channel: Email Required unless templateId is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. `,writeOnly:!0},emailFromName:{type:"string",description:`Channel: Email The name the email is from. If not specified, will default to "from name" set in the OneSignal Dashboard Email Settings. `,writeOnly:!0,nullable:!0},emailFromAddress:{type:"string",description:`Channel: Email The email address the email is from. If not specified, will default to "from email" set in the OneSignal Dashboard Email Settings. `,writeOnly:!0,nullable:!0},emailPreheader:{type:"string",description:`Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. `,writeOnly:!0,nullable:!0},includeUnsubscribed:{type:"boolean",description:"Channel: Email\nDefault is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `templateId` is provided, the `includeUnsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared.",writeOnly:!0},smsFrom:{type:"string",description:`Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. `,writeOnly:!0,nullable:!0},smsMediaUrls:{type:"array",items:{type:"string"},description:`Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. `,writeOnly:!0,nullable:!0},filters:{type:"array",nullable:!0,items:{type:"object",properties:{field:{type:"string",description:"Name of the field to use as the first operand in the filter expression."},key:{type:"string",description:"If `field` is `tag`, this field is *required* to specify `key` inside the tags."},value:{type:"string",description:"Constant value to use as the second operand in the filter expression. This value is *required* when the relation operator is a binary operator."},relation:{type:"string",description:"Operator of a filter expression.",enum:[">","<","=","!=","exists","not_exists","time_elapsed_gt","time_elapsed_lt"]}},required:["field","relation"]}},customData:{type:"object",description:`Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {"order_id": 123, "currency": "USD", "amount": 25} `,writeOnly:!0,nullable:!0}}},{required:["appId"]}]},{type:"object",properties:{sendAfter:{type:"string",format:"date-time",description:`Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. "Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)" "September 24th 2015, 2:00:00 pm UTC-07:00" "2015-09-24 14:00:00 GMT-0700" "Sept 24 2015 14:00:00 GMT-0700" "Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)" Note: SMS currently only supports sendAfter parameter. `,writeOnly:!0,nullable:!0}}}],required:[],additionalProperties:!0},Zr={output:Zo};var es={apns:zr,expo:Xr,fcm:Qr,"one-signal":Zr,"pusher-beams":H,pushpad:H,"push-webhook":H};var ea={type:"object",properties:{},required:[],additionalProperties:!1},ts={output:ea};var ta={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},ns={output:ta};var is={"africas-talking":H,"azure-sms":H,bandwidth:H,"brevo-sms":H,"bulk-sms":H,"burst-sms":H,clickatell:H,clicksend:H,"eazy-sms":H,firetext:H,"forty-six-elks":H,"generic-sms":H,gupshup:H,"infobip-sms":H,"isend-sms":H,kannel:H,maqsam:H,messagebird:H,mobishastra:H,nexmo:H,"novu-sms":ts,plivo:H,"ring-central":H,sendchamp:H,simpletexting:H,sms77:H,"sms-central":H,sns:H,telnyx:H,termii:H,twilio:ns};var rs={chat:jr,sms:is,email:Jr,push:es,in_app:Kr};var na={type:"object",properties:{type:{enum:["regular"],default:"regular"},amount:{type:"number"},unit:{type:"string",enum:["seconds","minutes","hours","days","weeks","months"]}},required:["amount","unit"],additionalProperties:!1},ia={type:"object",properties:{duration:{type:"number"}},required:["duration"],additionalProperties:!1},Ln={output:na,result:ia};var ra={type:"object",properties:{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}},required:["amount","unit"],additionalProperties:!1},sa={type:"object",properties:{cron:{type:"string"},digestKey:{type:"string"}},required:["cron"],additionalProperties:!1},oa={oneOf:[ra,sa]},aa={type:"object",properties:{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},Dn={output:oa,result:aa};var la={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},ca={type:"object",properties:{},required:[],additionalProperties:!1},ss={output:la,result:ca};var pa={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},ua={type:"object",properties:{},required:[],additionalProperties:!1},os={output:pa,result:ua};var da="^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$",ls={type:"object",properties:{url:{type:"string",pattern:da},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},as={type:"object",properties:{label:{type:"string"},redirect:ls},required:["label"],additionalProperties:!1},fa={type:"object",properties:{subject:{type:"string"},body:{type:"string"},avatar:{type:"string",format:"uri"},primaryAction:as,secondaryAction:as,data:{type:"object",additionalProperties:!0},redirect:ls},required:["body"],additionalProperties:!1},ha={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},cs={output:fa,result:ha};var ma={type:"object",properties:{subject:{type:"string"},body:{type:"string"}},required:["subject","body"],additionalProperties:!1},ya={type:"object",properties:{},required:[],additionalProperties:!1},ps={output:ma,result:ya};var ga={type:"object",properties:{body:{type:"string"}},required:["body"],additionalProperties:!1},wa={type:"object",properties:{},required:[],additionalProperties:!1},us={output:ga,result:wa};var qe={chat:ss,sms:us,push:ps,email:os,in_app:cs};var Ve={type:"object",properties:{},required:[],additionalProperties:!1};async function bt(b,r,o){if(b.steps.some(u=>u.stepId===r))throw new Sn(r);b.steps.push(o)}async function di(b,r,o,u){return async(v,j,$={})=>{let ie=($==null?void 0:$.controlSchema)||Ve;return await bt(b,v,{stepId:v,type:r,controls:{schema:await Ne(ie),unknownSchema:ie},outputs:{schema:await Ne(o),unknownSchema:o},results:{schema:await Ne(u),unknownSchema:u},resolve:j,code:j.toString(),options:$,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function ds(b,r,o){let u=rs[r],v=Object.entries(o).map(async([j,$])=>{let ie=u[j];return{type:j,code:$.toString(),resolve:$,outputs:{schema:await Ne(ie.output),unknownSchema:ie.output}}});b.providers.push(...await Promise.all(v))}async function St(b,r,o,u){return async(v,j,$={})=>{let ie=($==null?void 0:$.controlSchema)||Ve,pe={stepId:v,type:r,controls:{schema:await Ne(ie),unknownSchema:ie},outputs:{schema:await Ne(o),unknownSchema:o},results:{schema:await Ne(u),unknownSchema:u},resolve:j,code:j.toString(),options:$,providers:[]};return await bt(b,v,pe),Object.keys($.providers||{}).length>0&&await ds(pe,r,$.providers||{}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}async function fs(b,r){return async(o,u,v={})=>{let j=(v==null?void 0:v.controlSchema)||Ve,$=(v==null?void 0:v.outputSchema)||Ve;return await bt(b,o,{stepId:o,type:r,controls:{schema:await Ne(j),unknownSchema:j},outputs:{schema:await Ne($),unknownSchema:$},results:{schema:await Ne($),unknownSchema:$},resolve:u,code:u.toString(),options:v,providers:[]}),{_ctx:{timestamp:Date.now(),state:{status:"pending",error:!1}}}}}var Tt=require("@novu/shared");var ba={email:Tt.ChannelTypeEnum.EMAIL,sms:Tt.ChannelTypeEnum.SMS,push:Tt.ChannelTypeEnum.PUSH,inApp:Tt.ChannelTypeEnum.IN_APP,chat:Tt.ChannelTypeEnum.CHAT};function hs(b){if(!b)return{};let r={};return b.all&&(r.all=b.all),Object.entries(b.channels||{}).forEach(([o,u])=>{let v=ba[o];v&&(r.channels||(r.channels={}),r.channels[v]=u)}),r}function ms(b,r,o){let u=o||{};return{id:b,trigger:async $=>{let ie=Tn(En($.secretKey),On($.apiUrl)),pe=$.payload||{},ve;if(u.payloadSchema){let Fe=await xn(u.payloadSchema,pe);if(Fe.success===!1)throw new an(b,Fe.errors);ve=Fe.data}else ve=$.payload;let Le=await vr(),$e={name:b,to:$.to,payload:{...ve},...$.transactionId&&{transactionId:$.transactionId},...$.overrides&&{overrides:$.overrides},...$.actor&&{actor:$.actor},...Le&&{bridgeUrl:Le}},Re=await ie.post("/events/trigger",$e);return{cancel:async()=>ie.delete(`/events/trigger/${Re.transactionId}`),data:Re}},discover:async()=>{let $={workflowId:b,steps:[],code:r.toString(),payload:{schema:await Ne(u.payloadSchema||Ve),unknownSchema:u.payloadSchema||Ve},controls:{schema:await Ne(u.controlSchema||Ve),unknownSchema:u.controlSchema||Ve},tags:u.tags||[],preferences:hs(u.preferences),name:u.name,description:u.description,execute:r};return await r({payload:{},subscriber:{},environment:{},controls:{},step:{push:await St($,"push",qe.push.output,qe.push.result),chat:await St($,"chat",qe.chat.output,qe.chat.result),email:await St($,"email",qe.email.output,qe.email.result),sms:await St($,"sms",qe.sms.output,qe.sms.result),inApp:await St($,"in_app",qe.in_app.output,qe.in_app.result),digest:await di($,"digest",Dn.output,Dn.result),delay:await di($,"delay",Ln.output,Ln.result),custom:await fs($,"custom")}}),$}}}0&&(module.exports={Client,CronExpression,NovuRequestHandler,workflow});