@bonsae/nrg-runtime 0.39.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,25 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.nrg-tray-content[data-v-7094eb2b]{height:100%;padding:12px;box-sizing:border-box}.nrg-label[data-v-ec9d13ab]{display:inline-block;width:100%;margin-bottom:4px;cursor:default}.nrg-label i[data-v-ec9d13ab]{margin-right:5px}.nrg-required[data-v-ec9d13ab]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-a054dd53]{position:relative}.expand-button[data-v-a054dd53]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.expanded-editor-host[data-v-a054dd53]{height:100%}.nrg-schema-tray[data-v-feefe431]{display:flex;flex-direction:column;height:100%}.nrg-schema-editor[data-v-feefe431]{display:block;flex:1 1 auto;min-height:0}.nrg-schema-editor[data-v-feefe431] .container,.nrg-schema-editor[data-v-feefe431] .editor-wrapper{height:100%}.nrg-form-app[data-v-90f2411f]{padding-bottom:16px}.nrg-lifecycle-port[data-v-90f2411f]{white-space:nowrap}.nrg-lifecycle td.nrg-lifecycle-desc[data-v-90f2411f]{text-align:left;white-space:nowrap;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list[data-v-90f2411f]{margin:4px 0 6px;padding-left:16px;font-size:11px;line-height:1.5;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list li[data-v-90f2411f]{margin:1px 0}.nrg-section[data-v-90f2411f]{border-top:1px solid var(--red-ui-secondary-border-color, #ddd);margin-top:12px;padding-top:8px}.nrg-section-title[data-v-90f2411f]{font-weight:700;font-size:14px;margin-bottom:8px}.nrg-help[data-v-90f2411f]{white-space:nowrap;font-size:11px;line-height:1.4;color:var(--red-ui-text-color-disabled, #999);margin:2px 0 6px}.nrg-help-link[data-v-90f2411f]{color:var(--red-ui-text-color-link, #2196f3);white-space:nowrap}.nrg-help-link[data-v-90f2411f]:hover{text-decoration:underline}.nrg-subsection[data-v-90f2411f]{margin-bottom:10px}.nrg-subsection-title[data-v-90f2411f]{font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--red-ui-text-color-disabled, #777);margin:6px 0 4px}.nrg-outputs[data-v-90f2411f],.nrg-lifecycle[data-v-90f2411f],.nrg-input[data-v-90f2411f]{width:100%;max-width:100%;table-layout:fixed;margin-top:6px;border-collapse:separate;border-spacing:0;border:1px solid var(--red-ui-secondary-border-color, #d9d9d9);border-radius:3px;overflow:hidden;font-size:12px}.nrg-lifecycle[data-v-90f2411f],.nrg-input[data-v-90f2411f]{table-layout:auto}.nrg-input[data-v-90f2411f],.nrg-lifecycle .nrg-outputs-flag[data-v-90f2411f],.nrg-input .nrg-outputs-flag[data-v-90f2411f]{width:auto}.nrg-outputs th[data-v-90f2411f],.nrg-outputs td[data-v-90f2411f],.nrg-lifecycle th[data-v-90f2411f],.nrg-lifecycle td[data-v-90f2411f],.nrg-input th[data-v-90f2411f],.nrg-input td[data-v-90f2411f]{padding:5px 8px;text-align:center;vertical-align:middle;border-right:1px solid var(--red-ui-secondary-border-color, #e6e6e6);border-bottom:1px solid var(--red-ui-secondary-border-color, #e6e6e6)}.nrg-outputs th[data-v-90f2411f]:last-child,.nrg-outputs td[data-v-90f2411f]:last-child,.nrg-lifecycle th[data-v-90f2411f]:last-child,.nrg-lifecycle td[data-v-90f2411f]:last-child,.nrg-input th[data-v-90f2411f]:last-child,.nrg-input td[data-v-90f2411f]:last-child{border-right:none}.nrg-outputs tbody tr:last-child td[data-v-90f2411f],.nrg-lifecycle tbody tr:last-child td[data-v-90f2411f],.nrg-input tbody tr:last-child td[data-v-90f2411f]{border-bottom:none}.nrg-outputs thead th[data-v-90f2411f],.nrg-lifecycle thead th[data-v-90f2411f],.nrg-input thead th[data-v-90f2411f]{background:var(--red-ui-tertiary-background, #f3f3f3);color:var(--red-ui-text-color-disabled, #777);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.nrg-outputs-index[data-v-90f2411f]{width:3em}.nrg-outputs-label[data-v-90f2411f]{width:200px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nrg-outputs-return-col[data-v-90f2411f]{width:150px;white-space:nowrap}.nrg-outputs-context-col[data-v-90f2411f]{width:130px;white-space:nowrap}.nrg-outputs-flag[data-v-90f2411f]{width:116px}.nrg-outputs-flag .nrg-toggle-wrapper[data-v-90f2411f]{display:flex;align-items:center;justify-content:center}.nrg-json-schema-logo-defs[data-v-90f2411f]{position:absolute;width:0;height:0}.nrg-outputs-schema-btn[data-v-90f2411f]{display:inline-flex;align-items:center;justify-content:center}.nrg-outputs-schema-btn .nrg-schema-glyph[data-v-90f2411f]{display:inline-flex;align-items:center;line-height:0}.nrg-outputs-schema-btn .nrg-schema-glyph svg[data-v-90f2411f]{display:block;height:14px;width:auto}.nrg-outputs-schema-btn.nrg-schema-btn-error[data-v-90f2411f]{border-color:var(--red-ui-text-color-error, #d33)}.nrg-outputs-schema-btn.nrg-schema-btn-error .nrg-schema-glyph[data-v-90f2411f]{color:var(--red-ui-text-color-error, #d33)}.nrg-outputs-flag .nrg-outputs-schema-btn[data-v-90f2411f]{height:28px;box-sizing:border-box;border-radius:5px}.nrg-input thead th[data-v-90f2411f],.nrg-outputs thead th[data-v-90f2411f]{white-space:nowrap}.nrg-outputs-return[data-v-90f2411f]{width:100%;height:28px;box-sizing:border-box;padding:0 6px;text-align:left;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:5px;background:var(--red-ui-form-input-background, #fff);color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-90f2411f]{width:100%;height:28px;box-sizing:border-box;padding:0 22px 0 6px;text-align:center;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:5px;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-color:var(--red-ui-form-input-background, #fff);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:10px 6px;color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-90f2411f]:disabled{opacity:.6;cursor:not-allowed}.nrg-outputs td .nrg-outputs-return[data-v-90f2411f]{height:28px;margin:0;padding:0 6px;line-height:normal}.nrg-outputs td .nrg-outputs-context[data-v-90f2411f]{height:28px;margin:0;padding:0 22px 0 6px;line-height:normal}[data-v-90f2411f] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-90f2411f] .form-row input[type=text],[data-v-90f2411f] .form-row input[type=number],[data-v-90f2411f] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-toggle-wrapper[data-v-9d4b2ecb]{display:inline-flex;align-items:center}.nrg-toggle[data-v-9d4b2ecb]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none;margin:0!important}.nrg-toggle__input[data-v-9d4b2ecb]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-9d4b2ecb]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-9d4b2ecb]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle__input:focus-visible~.nrg-toggle__slider[data-v-9d4b2ecb]{outline:2px solid var(--red-ui-form-input-focus-color, #2b6ec9);outline-offset:2px}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]:after{transform:translate(16px)}.nrg-toggle__label[data-v-9d4b2ecb]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-9d4b2ecb]{margin-right:2px}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var ea=Object.defineProperty,ta=(e,t,r)=>t in e?ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tt=(e,t,r)=>ta(e,typeof t!="symbol"?t+"":t,r);import{ref as ra,defineComponent as we,openBlock as K,createElementBlock as J,Fragment as Ae,createCommentVNode as Q,createBlock as ve,Teleport as na,createElementVNode as q,renderSlot as Te,resolveDynamicComponent as oa,withCtx as Zt,normalizeClass as Ke,createTextVNode as xe,toDisplayString as Z,shallowRef as Ie,resolveComponent as ie,withDirectives as aa,vShow as sa,createVNode as fe,renderList as rt,createApp as ia,inject as Qt}from"/nrg/assets/vue.esm-browser.prod.js";const la=["error","complete","status"];function wr(e){return la.filter(t=>e[`${t}Port`]===!0)}function ua(e){return Math.max(0,Number(e.outputs??0)-wr(e).length)}function ca(e,t){const r=ua(e);if(t<r)return{kind:"base",index:t};const n=wr(e)[t-r];return n?{kind:n}:null}function da(e,t,r){var n;return t.validateInputTypes===!0?!0:r.kind==="base"&&((n=e.validateOutputTypes)==null?void 0:n[r.index])===!0}function _r(e){return`${e.source.id}:${e.sourcePort}:${e.target.id}`}function Sr(e,t){var r,n;return t(e.type)?(n=(r=e._def)==null?void 0:r.set)==null?void 0:n.module:void 0}function Er(e,t){var r,n;const o=ca(e.source,e.sourcePort);if(!o||!da(e.source,e.target,o))return null;const l=o.kind==="base"?{kind:"base",index:o.index,returnKey:(r=e.source.outputReturnProperties)==null?void 0:r[o.index],mode:(n=e.source.outputContextModes)==null?void 0:n[o.index]}:{kind:o.kind};return{id:_r(e),source:{type:e.source.type,module:Sr(e.source,t),port:l},target:{type:e.target.type,module:Sr(e.target,t)}}}function pa(e){return`Wire type mismatch \u2014 ${e.message??"the source output is not assignable to the target input"}`}function fa(e){return`Type Validation for wire ${e.id} couldn't be done because ${e.reason??"the wire could not be resolved"}`}function ha(e){const t=e.filter(o=>o.checked&&!o.ok),r=e.filter(o=>!o.checked&&o.reason);if(!t.length&&!r.length)return null;const n=[];return t.length&&n.push(`${t.length} wire${t.length>1?"s":""} failed type validation:`,...t.map(o=>`\u2022 ${o.id}: ${o.message??"type mismatch"}`)),r.length&&(n.length&&n.push(""),n.push(...r.map(o=>`\u2022 ${fa(o)}`))),{level:t.length?"error":"warning",text:n.join(`
2
- `)}}const xr=new Set;function ma(e){xr.add(e)}function Pr(e){return xr.has(e)}const Yt="nrg/type-check";function kr(e,t){return new Promise(r=>{try{$.ajax({url:e,method:"POST",contentType:"application/json",data:JSON.stringify(t),dataType:"json",success:n=>r(n),error:()=>r(null)})}catch{r(null)}})}function ya(e){return new Promise(t=>{try{$.ajax({url:e,method:"GET",dataType:"json",success:r=>t(r),error:()=>t(null)})}catch{t(null)}})}async function va(){const e=await ya(`${Yt}/status`);return{available:e?.available===!0}}function Nr(e){return typeof e=="object"&&e!==null&&typeof e.ok=="boolean"}async function ga(e){const t=await kr(Yt,e);return Nr(t)?t:null}async function ba(e){const t=await kr(`${Yt}/batch`,{wires:e}),r=t?.results;return Array.isArray(r)&&r.every(Nr)?r:null}const nt=ra(!1);async function $a(){const e=await va();nt.value=e.available}let jr=!1;const Or=[];let Xt=!1;const er=new Set,Cr=new Set;let tr=!1;function wa(){Xt||(Xt=!0,Promise.resolve().then(_a))}function _a(){const e=Or.splice(0);Xt=!1,e.length===1&&Sa(e[0])}function Sa(e){const t=Er(e,Pr);if(!t)return;const r=t.id;er.add(r),ga(t).then(n=>{if(er.delete(r),!Cr.delete(r)&&!(!n||!n.checked||n.ok)){tr=!0;try{RED.nodes.removeLink(e),RED.view.redraw(!0)}catch{}finally{tr=!1}RED.notify(pa(n),{type:"error",timeout:8e3})}})}function Ea(e){!jr||!nt.value||(Or.push(e),wa())}function xa(e){if(tr)return;const t=_r(e);er.has(t)&&Cr.add(t)}function Pa(){if(!nt.value)return;const e=[];RED.nodes.eachLink(t=>{const r=Er(t,Pr);r&&e.push(r)}),e.length&&ba(e).then(t=>{if(!t)return;const r=ha(t);r&&RED.notify(r.text,{type:r.level,timeout:r.level==="error"?0:1e4})})}function ka(){typeof RED>"u"||!RED.events||($a(),RED.events.on("flows:load",()=>{jr=!0}),RED.events.on("links:add",e=>Ea(e)),RED.events.on("links:remove",e=>xa(e)),RED.events.on("deploy",Pa))}ka();function Na(e){return e}function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={},Tr;function ja(){if(Tr)return Be;Tr=1;var e=/~/,t=/~[01]/g;function r(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function n(d){return e.test(d)?d.replace(t,r):d}function o(d,m,P){for(var b,u,v=1,x=m.length;v<x;){if(m[v]==="constructor"||m[v]==="prototype"||m[v]==="__proto__")return d;if(b=n(m[v++]),u=x>v,typeof d[b]>"u"&&(Array.isArray(d)&&b==="-"&&(b=d.length),u&&(m[v]!==""&&m[v]<1/0||m[v]==="-"?d[b]=[]:d[b]={})),!u)break;d=d[b]}var h=d[b];return P===void 0?delete d[b]:d[b]=P,h}function l(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const m of d)if(typeof m!="string"&&typeof m!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function s(d,m){if(typeof d!="object")throw new Error("Invalid input object.");m=l(m);var P=m.length;if(P===1)return d;for(var b=1;b<P;){if(d=d[n(m[b++])],P===b)return d;if(typeof d!="object"||d===null)return}}function c(d,m,P){if(typeof d!="object")throw new Error("Invalid input object.");if(m=l(m),m.length===0)throw new Error("Invalid JSON pointer for set.");return o(d,m,P)}function y(d){var m=l(d);return{get:function(P){return s(P,m)},set:function(P,b){return c(P,m,b)}}}return Be.get=s,Be.set=c,Be.compile=y,Be}var Oa=ja();const Ir=ot(Oa);function Ca(e,t,{signal:r,edges:n}={}){let o,l=null;const s=n!=null&&n.includes("leading"),c=n==null||n.includes("trailing"),y=()=>{l!==null&&(e.apply(o,l),o=void 0,l=null)},d=()=>{c&&y(),u()};let m=null;const P=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,d()},t)},b=()=>{m!==null&&(clearTimeout(m),m=null)},u=()=>{b(),o=void 0,l=null},v=()=>{y()},x=function(...h){if(r!=null&&r.aborted)return;o=this,l=h;const p=m==null;P(),s&&p&&y()};return x.schedule=P,x.cancel=u,x.flush=v,r?.addEventListener("abort",u,{once:!0}),x}function Ta(){}function Ia(e){return e==null||typeof e!="object"&&typeof e!="function"}function Va(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rr(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function nr(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Vr="[object RegExp]",Rr="[object String]",Lr="[object Number]",Mr="[object Boolean]",or="[object Arguments]",Ar="[object Symbol]",qr="[object Date]",Dr="[object Map]",zr="[object Set]",Fr="[object Array]",Ra="[object Function]",Ur="[object ArrayBuffer]",at="[object Object]",La="[object Error]",Kr="[object DataView]",Br="[object Uint8Array]",Wr="[object Uint8ClampedArray]",Gr="[object Uint16Array]",Hr="[object Uint32Array]",Ma="[object BigUint64Array]",Jr="[object Int8Array]",Zr="[object Int16Array]",Qr="[object Int32Array]",Aa="[object BigInt64Array]",Yr="[object Float32Array]",Xr="[object Float64Array]";function qe(e,t,r,n=new Map,o=void 0){const l=o?.(e,t,r,n);if(l!==void 0)return l;if(Ia(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const s=new Array(e.length);n.set(e,s);for(let c=0;c<e.length;c++)s[c]=qe(e[c],c,r,n,o);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;n.set(e,s);for(const[c,y]of e)s.set(c,qe(y,c,r,n,o));return s}if(e instanceof Set){const s=new Set;n.set(e,s);for(const c of e)s.add(qe(c,void 0,r,n,o));return s}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Va(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,s);for(let c=0;c<e.length;c++)s[c]=qe(e[c],c,r,n,o);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,s),Oe(s,e,r,n,o),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return n.set(e,s),Oe(s,e,r,n,o),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return n.set(e,s),Oe(s,e,r,n,o),s}if(e instanceof Error){const s=structuredClone(e);return n.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Oe(s,e,r,n,o),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return n.set(e,s),Oe(s,e,r,n,o),s}if(e instanceof Number){const s=new Number(e.valueOf());return n.set(e,s),Oe(s,e,r,n,o),s}if(e instanceof String){const s=new String(e.valueOf());return n.set(e,s),Oe(s,e,r,n,o),s}if(typeof e=="object"&&qa(e)){const s=Object.create(Object.getPrototypeOf(e));return n.set(e,s),Oe(s,e,r,n,o),s}return e}function Oe(e,t,r=e,n,o){const l=[...Object.keys(t),...rr(t)];for(let s=0;s<l.length;s++){const c=l[s],y=Object.getOwnPropertyDescriptor(e,c);(y==null||y.writable)&&(e[c]=qe(t[c],c,r,n,o))}}function qa(e){switch(nr(e)){case or:case Fr:case Ur:case Kr:case Mr:case qr:case Yr:case Xr:case Jr:case Zr:case Qr:case Dr:case Lr:case at:case Vr:case zr:case Rr:case Ar:case Br:case Wr:case Gr:case Hr:return!0;default:return!1}}function en(e){return qe(e,void 0,e,new Map,void 0)}function tn(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function Da(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function za(e,t,r){return We(e,t,void 0,void 0,void 0,void 0,r)}function We(e,t,r,n,o,l,s){const c=s(e,t,r,n,o,l);if(c!==void 0)return c;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Ge(e,t,l,s)}return Ge(e,t,l,s)}function Ge(e,t,r,n){if(Object.is(e,t))return!0;let o=nr(e),l=nr(t);if(o===or&&(o=at),l===or&&(l=at),o!==l)return!1;switch(o){case Rr:return e.toString()===t.toString();case Lr:{const y=e.valueOf(),d=t.valueOf();return Da(y,d)}case Mr:case qr:case Ar:return Object.is(e.valueOf(),t.valueOf());case Vr:return e.source===t.source&&e.flags===t.flags;case Ra:return e===t}r=r??new Map;const s=r.get(e),c=r.get(t);if(s!=null&&c!=null)return s===t;r.set(e,t),r.set(t,e);try{switch(o){case Dr:{if(e.size!==t.size)return!1;for(const[y,d]of e.entries())if(!t.has(y)||!We(d,t.get(y),y,e,t,r,n))return!1;return!0}case zr:{if(e.size!==t.size)return!1;const y=Array.from(e.values()),d=Array.from(t.values());for(let m=0;m<y.length;m++){const P=y[m],b=d.findIndex(u=>We(P,u,void 0,e,t,r,n));if(b===-1)return!1;d.splice(b,1)}return!0}case Fr:case Br:case Wr:case Gr:case Hr:case Ma:case Jr:case Zr:case Qr:case Aa:case Yr:case Xr:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let y=0;y<e.length;y++)if(!We(e[y],t[y],y,e,t,r,n))return!1;return!0}case Ur:return e.byteLength!==t.byteLength?!1:Ge(new Uint8Array(e),new Uint8Array(t),r,n);case Kr:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Ge(new Uint8Array(e),new Uint8Array(t),r,n);case La:return e.name===t.name&&e.message===t.message;case at:{if(!(Ge(e.constructor,t.constructor,r,n)||tn(e)&&tn(t)))return!1;const y=[...Object.keys(e),...rr(e)],d=[...Object.keys(t),...rr(t)];if(y.length!==d.length)return!1;for(let m=0;m<y.length;m++){const P=y[m],b=e[P];if(!Object.hasOwn(t,P))return!1;const u=t[P];if(!We(b,u,P,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function Fa(e,t){return za(e,t,Ta)}var ar={exports:{}},rn={},Pe={},Ve={},nn={},on={},an={},sn;function He(){return sn||(sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(a){if(super(),!e.IDENTIFIER.test(a))throw new Error("CodeGen: name must be a valid identifier");this.str=a}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(a){super(),this._items=typeof a=="string"?[a]:a}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const a=this._items[0];return a===""||a==='""'}get str(){var a;return(a=this._str)!==null&&a!==void 0?a:this._str=this._items.reduce((i,w)=>`${i}${w}`,"")}get names(){var a;return(a=this._names)!==null&&a!==void 0?a:this._names=this._items.reduce((i,w)=>(w instanceof r&&(i[w.str]=(i[w.str]||0)+1),i),{})}}e._Code=n,e.nil=new n("");function o(p,...a){const i=[p[0]];let w=0;for(;w<a.length;)c(i,a[w]),i.push(p[++w]);return new n(i)}e._=o;const l=new n("+");function s(p,...a){const i=[u(p[0])];let w=0;for(;w<a.length;)i.push(l),c(i,a[w]),i.push(l,u(p[++w]));return y(i),new n(i)}e.str=s;function c(p,a){a instanceof n?p.push(...a._items):a instanceof r?p.push(a):p.push(P(a))}e.addCodeArg=c;function y(p){let a=1;for(;a<p.length-1;){if(p[a]===l){const i=d(p[a-1],p[a+1]);if(i!==void 0){p.splice(a-1,3,i);continue}p[a++]="+"}a++}}function d(p,a){if(a==='""')return p;if(p==='""')return a;if(typeof p=="string")return a instanceof r||p[p.length-1]!=='"'?void 0:typeof a!="string"?`${p.slice(0,-1)}${a}"`:a[0]==='"'?p.slice(0,-1)+a.slice(1):void 0;if(typeof a=="string"&&a[0]==='"'&&!(p instanceof r))return`"${p}${a.slice(1)}`}function m(p,a){return a.emptyStr()?p:p.emptyStr()?a:s`${p}${a}`}e.strConcat=m;function P(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:u(Array.isArray(p)?p.join(","):p)}function b(p){return new n(u(p))}e.stringify=b;function u(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=u;function v(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):o`[${p}]`}e.getProperty=v;function x(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=x;function h(p){return new n(p.toString())}e.regexpCode=h})(an)),an}var ln={},un;function cn(){return un||(un=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=He();class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(y){y[y.Started=0]="Started",y[y.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:d,parent:m}={}){this._names={},this._prefixes=d,this._parent=m}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const m=this._names[d]||this._nameGroup(d);return`${d}${m.index++}`}_nameGroup(d){var m,P;if(!((P=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||P===void 0)&&P.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=o;class l extends t.Name{constructor(d,m){super(m),this.prefix=d}setValue(d,{property:m,itemIndex:P}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(m)}[${P}]`}}e.ValueScopeName=l;const s=(0,t._)`\n`;class c extends o{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?s:t.nil}}get(){return this._scope}name(d){return new l(d,this._newName(d))}value(d,m){var P;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(d),{prefix:u}=b,v=(P=m.key)!==null&&P!==void 0?P:m.ref;let x=this._values[u];if(x){const a=x.get(v);if(a)return a}else x=this._values[u]=new Map;x.set(v,b);const h=this._scope[u]||(this._scope[u]=[]),p=h.length;return h[p]=m.ref,b.setValue(m,{property:u,itemIndex:p}),b}getValue(d,m){const P=this._values[d];if(P)return P.get(m)}scopeRefs(d,m=this._values){return this._reduceValues(m,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,t._)`${d}${P.scopePath}`})}scopeCode(d=this._values,m,P){return this._reduceValues(d,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},m,P)}_reduceValues(d,m,P={},b){let u=t.nil;for(const v in d){const x=d[v];if(!x)continue;const h=P[v]=P[v]||new Map;x.forEach(p=>{if(h.has(p))return;h.set(p,n.Started);let a=m(p);if(a){const i=this.opts.es5?e.varKinds.var:e.varKinds.const;u=(0,t._)`${u}${i} ${p} = ${a};${this.opts._n}`}else if(a=b?.(p))u=(0,t._)`${u}${a}${this.opts._n}`;else throw new r(p);h.set(p,n.Completed)})}return u}}e.ValueScope=c})(ln)),ln}var dn;function X(){return dn||(dn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=He(),r=cn();var n=He();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=cn();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class l{optimizeNodes(){return this}optimizeNames(f,S){return this}}class s extends l{constructor(f,S,T){super(),this.varKind=f,this.name=S,this.rhs=T}render({es5:f,_n:S}){const T=f?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${F};`+S}optimizeNames(f,S){if(f[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,f,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends l{constructor(f,S,T){super(),this.lhs=f,this.rhs=S,this.sideEffects=T}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,S){if(!(this.lhs instanceof t.Name&&!f[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,f,S),this}get names(){const f=this.lhs instanceof t.Name?{}:{...this.lhs.names};return B(f,this.rhs)}}class y extends c{constructor(f,S,T,F){super(f,T,F),this.op=S}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class d extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class m extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class P extends l{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class b extends l{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,S){return this.code=G(this.code,f,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class u extends l{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((S,T)=>S+T.render(f),"")}optimizeNodes(){const{nodes:f}=this;let S=f.length;for(;S--;){const T=f[S].optimizeNodes();Array.isArray(T)?f.splice(S,1,...T):T?f[S]=T:f.splice(S,1)}return f.length>0?this:void 0}optimizeNames(f,S){const{nodes:T}=this;let F=T.length;for(;F--;){const M=T[F];M.optimizeNames(f,S)||(ae(f,M.names),T.splice(F,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((f,S)=>U(f,S.names),{})}}class v extends u{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class x extends u{}class h extends v{}h.kind="else";class p extends v{constructor(f,S){super(S),this.condition=f}render(f){let S=`if(${this.condition})`+super.render(f);return this.else&&(S+="else "+this.else.render(f)),S}optimizeNodes(){super.optimizeNodes();const f=this.condition;if(f===!0)return this.nodes;let S=this.else;if(S){const T=S.optimizeNodes();S=this.else=Array.isArray(T)?new h(T):T}if(S)return f===!1?S instanceof p?S:S.nodes:this.nodes.length?this:new p(se(f),S instanceof p?[S]:S.nodes);if(!(f===!1||!this.nodes.length))return this}optimizeNames(f,S){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(f,S),!!(super.optimizeNames(f,S)||this.else))return this.condition=G(this.condition,f,S),this}get names(){const f=super.names;return B(f,this.condition),this.else&&U(f,this.else.names),f}}p.kind="if";class a extends v{}a.kind="for";class i extends a{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,S){if(super.optimizeNames(f,S))return this.iteration=G(this.iteration,f,S),this}get names(){return U(super.names,this.iteration.names)}}class w extends a{constructor(f,S,T,F){super(),this.varKind=f,this.name=S,this.from=T,this.to=F}render(f){const S=f.es5?r.varKinds.var:this.varKind,{name:T,from:F,to:M}=this;return`for(${S} ${T}=${F}; ${T}<${M}; ${T}++)`+super.render(f)}get names(){const f=B(super.names,this.from);return B(f,this.to)}}class g extends a{constructor(f,S,T,F){super(),this.loop=f,this.varKind=S,this.name=T,this.iterable=F}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,S){if(super.optimizeNames(f,S))return this.iterable=G(this.iterable,f,S),this}get names(){return U(super.names,this.iterable.names)}}class _ extends v{constructor(f,S,T){super(),this.name=f,this.args=S,this.async=T}render(f){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(f)}}_.kind="func";class E extends u{render(f){return"return "+super.render(f)}}E.kind="return";class I extends v{render(f){let S="try"+super.render(f);return this.catch&&(S+=this.catch.render(f)),this.finally&&(S+=this.finally.render(f)),S}optimizeNodes(){var f,S;return super.optimizeNodes(),(f=this.catch)===null||f===void 0||f.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(f,S){var T,F;return super.optimizeNames(f,S),(T=this.catch)===null||T===void 0||T.optimizeNames(f,S),(F=this.finally)===null||F===void 0||F.optimizeNames(f,S),this}get names(){const f=super.names;return this.catch&&U(f,this.catch.names),this.finally&&U(f,this.finally.names),f}}class A extends v{constructor(f){super(),this.error=f}render(f){return`catch(${this.error})`+super.render(f)}}A.kind="catch";class z extends v{render(f){return"finally"+super.render(f)}}z.kind="finally";class R{constructor(f,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
3
- `:""},this._extScope=f,this._scope=new r.Scope({parent:f}),this._nodes=[new x]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,S){const T=this._extScope.value(f,S);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(f,S){return this._extScope.getValue(f,S)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,S,T,F){const M=this._scope.toName(S);return T!==void 0&&F&&(this._constants[M.str]=T),this._leafNode(new s(f,M,T)),M}const(f,S,T){return this._def(r.varKinds.const,f,S,T)}let(f,S,T){return this._def(r.varKinds.let,f,S,T)}var(f,S,T){return this._def(r.varKinds.var,f,S,T)}assign(f,S,T){return this._leafNode(new c(f,S,T))}add(f,S){return this._leafNode(new y(f,e.operators.ADD,S))}code(f){return typeof f=="function"?f():f!==t.nil&&this._leafNode(new b(f)),this}object(...f){const S=["{"];for(const[T,F]of f)S.length>1&&S.push(","),S.push(T),(T!==F||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,F));return S.push("}"),new t._Code(S)}if(f,S,T){if(this._blockNode(new p(f)),S&&T)this.code(S).else().code(T).endIf();else if(S)this.code(S).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new p(f))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(p,h)}_for(f,S){return this._blockNode(f),S&&this.code(S).endFor(),this}for(f,S){return this._for(new i(f),S)}forRange(f,S,T,F,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const W=this._scope.toName(f);return this._for(new w(M,W,S,T),()=>F(W))}forOf(f,S,T,F=r.varKinds.const){const M=this._scope.toName(f);if(this.opts.es5){const W=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${W}.length`,Y=>{this.var(M,(0,t._)`${W}[${Y}]`),T(M)})}return this._for(new g("of",F,M,S),()=>T(M))}forIn(f,S,T,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(f,(0,t._)`Object.keys(${S})`,T);const M=this._scope.toName(f);return this._for(new g("in",F,M,S),()=>T(M))}endFor(){return this._endBlockNode(a)}label(f){return this._leafNode(new d(f))}break(f){return this._leafNode(new m(f))}return(f){const S=new E;if(this._blockNode(S),this.code(f),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(f,S,T){if(!S&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new I;if(this._blockNode(F),this.code(f),S){const M=this.name("e");this._currNode=F.catch=new A(M),S(M)}return T&&(this._currNode=F.finally=new z,this.code(T)),this._endBlockNode(A,z)}throw(f){return this._leafNode(new P(f))}block(f,S){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(S),this}endBlock(f){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-S;if(T<0||f!==void 0&&T!==f)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${f} expected`);return this._nodes.length=S,this}func(f,S=t.nil,T,F){return this._blockNode(new _(f,S,T)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,S){const T=this._currNode;if(T instanceof f||S&&T instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${f.kind}/${S.kind}`:f.kind}"`)}_elseNode(f){const S=this._currNode;if(!(S instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const S=this._nodes;S[S.length-1]=f}}e.CodeGen=R;function U(k,f){for(const S in f)k[S]=(k[S]||0)+(f[S]||0);return k}function B(k,f){return f instanceof t._CodeOrName?U(k,f.names):k}function G(k,f,S){if(k instanceof t.Name)return T(k);if(!F(k))return k;return new t._Code(k._items.reduce((M,W)=>(W instanceof t.Name&&(W=T(W)),W instanceof t._Code?M.push(...W._items):M.push(W),M),[]));function T(M){const W=S[M.str];return W===void 0||f[M.str]!==1?M:(delete f[M.str],W)}function F(M){return M instanceof t._Code&&M._items.some(W=>W instanceof t.Name&&f[W.str]===1&&S[W.str]!==void 0)}}function ae(k,f){for(const S in f)k[S]=(k[S]||0)-(f[S]||0)}function se(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,t._)`!${C(k)}`}e.not=se;const de=O(e.operators.AND);function ne(...k){return k.reduce(de)}e.and=ne;const pe=O(e.operators.OR);function L(...k){return k.reduce(pe)}e.or=L;function O(k){return(f,S)=>f===t.nil?S:S===t.nil?f:(0,t._)`${C(f)} ${k} ${C(S)}`}function C(k){return k instanceof t.Name?k:(0,t._)`(${k})`}})(on)),on}var ee={},pn;function re(){if(pn)return ee;pn=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;const e=X(),t=He();function r(g){const _={};for(const E of g)_[E]=!0;return _}ee.toHash=r;function n(g,_){return typeof _=="boolean"?_:Object.keys(_).length===0?!0:(o(g,_),!l(_,g.self.RULES.all))}ee.alwaysValidSchema=n;function o(g,_=g.schema){const{opts:E,self:I}=g;if(!E.strictSchema||typeof _=="boolean")return;const A=I.RULES.keywords;for(const z in _)A[z]||w(g,`unknown keyword: "${z}"`)}ee.checkUnknownRules=o;function l(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(_[E])return!0;return!1}ee.schemaHasRules=l;function s(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(E!=="$ref"&&_.all[E])return!0;return!1}ee.schemaHasRulesButRef=s;function c({topSchemaRef:g,schemaPath:_},E,I,A){if(!A){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${g}${_}${(0,e.getProperty)(I)}`}ee.schemaRefOrVal=c;function y(g){return P(decodeURIComponent(g))}ee.unescapeFragment=y;function d(g){return encodeURIComponent(m(g))}ee.escapeFragment=d;function m(g){return typeof g=="number"?`${g}`:g.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=m;function P(g){return g.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=P;function b(g,_){if(Array.isArray(g))for(const E of g)_(E);else _(g)}ee.eachItem=b;function u({mergeNames:g,mergeToName:_,mergeValues:E,resultToName:I}){return(A,z,R,U)=>{const B=R===void 0?z:R instanceof e.Name?(z instanceof e.Name?g(A,z,R):_(A,z,R),R):z instanceof e.Name?(_(A,R,z),z):E(z,R);return U===e.Name&&!(B instanceof e.Name)?I(A,B):B}}ee.mergeEvaluated={props:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>{g.if((0,e._)`${_} === true`,()=>g.assign(E,!0),()=>g.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${_})`))}),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>{_===!0?g.assign(E,!0):(g.assign(E,(0,e._)`${E} || {}`),x(g,E,_))}),mergeValues:(g,_)=>g===!0?!0:{...g,..._},resultToName:v}),items:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>g.assign(E,(0,e._)`${_} === true ? true : ${E} > ${_} ? ${E} : ${_}`)),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>g.assign(E,_===!0?!0:(0,e._)`${E} > ${_} ? ${E} : ${_}`)),mergeValues:(g,_)=>g===!0?!0:Math.max(g,_),resultToName:(g,_)=>g.var("items",_)})};function v(g,_){if(_===!0)return g.var("props",!0);const E=g.var("props",(0,e._)`{}`);return _!==void 0&&x(g,E,_),E}ee.evaluatedPropsToName=v;function x(g,_,E){Object.keys(E).forEach(I=>g.assign((0,e._)`${_}${(0,e.getProperty)(I)}`,!0))}ee.setEvaluated=x;const h={};function p(g,_){return g.scopeValue("func",{ref:_,code:h[_.code]||(h[_.code]=new t._Code(_.code))})}ee.useFunc=p;var a;(function(g){g[g.Num=0]="Num",g[g.Str=1]="Str"})(a||(ee.Type=a={}));function i(g,_,E){if(g instanceof e.Name){const I=_===a.Num;return E?I?(0,e._)`"[" + ${g} + "]"`:(0,e._)`"['" + ${g} + "']"`:I?(0,e._)`"/" + ${g}`:(0,e._)`"/" + ${g}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(g).toString():"/"+m(g)}ee.getErrorPath=i;function w(g,_,E=g.opts.strictSchema){if(E){if(_=`strict mode: ${_}`,E===!0)throw new Error(_);g.self.logger.warn(_)}}return ee.checkStrictMode=w,ee}var st={},fn;function ke(){if(fn)return st;fn=1,Object.defineProperty(st,"__esModule",{value:!0});const e=X(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return st.default=t,st}var hn;function Je(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=X(),r=re(),n=ke();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:p})=>p?(0,t.str)`"${h}" keyword must be ${p} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function o(h,p=e.keywordError,a,i){const{it:w}=h,{gen:g,compositeRule:_,allErrors:E}=w,I=P(h,p,a);i??(_||E)?y(g,I):d(w,(0,t._)`[${I}]`)}e.reportError=o;function l(h,p=e.keywordError,a){const{it:i}=h,{gen:w,compositeRule:g,allErrors:_}=i,E=P(h,p,a);y(w,E),g||_||d(i,n.default.vErrors)}e.reportExtraError=l;function s(h,p){h.assign(n.default.errors,p),h.if((0,t._)`${n.default.vErrors} !== null`,()=>h.if(p,()=>h.assign((0,t._)`${n.default.vErrors}.length`,p),()=>h.assign(n.default.vErrors,null)))}e.resetErrorsCount=s;function c({gen:h,keyword:p,schemaValue:a,data:i,errsCount:w,it:g}){if(w===void 0)throw new Error("ajv implementation error");const _=h.name("err");h.forRange("i",w,n.default.errors,E=>{h.const(_,(0,t._)`${n.default.vErrors}[${E}]`),h.if((0,t._)`${_}.instancePath === undefined`,()=>h.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,g.errorPath))),h.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${g.errSchemaPath}/${p}`),g.opts.verbose&&(h.assign((0,t._)`${_}.schema`,a),h.assign((0,t._)`${_}.data`,i))})}e.extendErrors=c;function y(h,p){const a=h.const("err",p);h.if((0,t._)`${n.default.vErrors} === null`,()=>h.assign(n.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${n.default.vErrors}.push(${a})`),h.code((0,t._)`${n.default.errors}++`)}function d(h,p){const{gen:a,validateName:i,schemaEnv:w}=h;w.$async?a.throw((0,t._)`new ${h.ValidationError}(${p})`):(a.assign((0,t._)`${i}.errors`,p),a.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function P(h,p,a){const{createErrors:i}=h.it;return i===!1?(0,t._)`{}`:b(h,p,a)}function b(h,p,a={}){const{gen:i,it:w}=h,g=[u(w,a),v(h,a)];return x(h,p,g),i.object(...g)}function u({errorPath:h},{instancePath:p}){const a=p?(0,t.str)`${h}${(0,r.getErrorPath)(p,r.Type.Str)}`:h;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,a)]}function v({keyword:h,it:{errSchemaPath:p}},{schemaPath:a,parentSchema:i}){let w=i?p:(0,t.str)`${p}/${h}`;return a&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(a,r.Type.Str)}`),[m.schemaPath,w]}function x(h,{params:p,message:a},i){const{keyword:w,data:g,schemaValue:_,it:E}=h,{opts:I,propertyName:A,topSchemaRef:z,schemaPath:R}=E;i.push([m.keyword,w],[m.params,typeof p=="function"?p(h):p||(0,t._)`{}`]),I.messages&&i.push([m.message,typeof a=="function"?a(h):a]),I.verbose&&i.push([m.schema,_],[m.parentSchema,(0,t._)`${z}${R}`],[n.default.data,g]),A&&i.push([m.propertyName,A])}})(nn)),nn}var mn;function Ua(){if(mn)return Ve;mn=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.boolOrEmptySchema=Ve.topBoolOrEmptySchema=void 0;const e=Je(),t=X(),r=ke(),n={message:"boolean schema is false"};function o(c){const{gen:y,schema:d,validateName:m}=c;d===!1?s(c,!1):typeof d=="object"&&d.$async===!0?y.return(r.default.data):(y.assign((0,t._)`${m}.errors`,null),y.return(!0))}Ve.topBoolOrEmptySchema=o;function l(c,y){const{gen:d,schema:m}=c;m===!1?(d.var(y,!1),s(c)):d.var(y,!0)}Ve.boolOrEmptySchema=l;function s(c,y){const{gen:d,data:m}=c,P={gen:d,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(P,n,void 0,y)}return Ve}var ce={},Re={},yn;function vn(){if(yn)return Re;yn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.getRules=Re.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(o){return typeof o=="string"&&t.has(o)}Re.isJSONType=r;function n(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return Re.getRules=n,Re}var Ne={},gn;function bn(){if(gn)return Ne;gn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.shouldUseRule=Ne.shouldUseGroup=Ne.schemaHasRulesForType=void 0;function e({schema:n,self:o},l){const s=o.RULES.types[l];return s&&s!==!0&&t(n,s)}Ne.schemaHasRulesForType=e;function t(n,o){return o.rules.some(l=>r(n,l))}Ne.shouldUseGroup=t;function r(n,o){var l;return n[o.keyword]!==void 0||((l=o.definition.implements)===null||l===void 0?void 0:l.some(s=>n[s]!==void 0))}return Ne.shouldUseRule=r,Ne}var $n;function it(){if($n)return ce;$n=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.reportTypeError=ce.checkDataTypes=ce.checkDataType=ce.coerceAndCheckDataType=ce.getJSONTypes=ce.getSchemaTypes=ce.DataType=void 0;const e=vn(),t=bn(),r=Je(),n=X(),o=re();var l;(function(a){a[a.Correct=0]="Correct",a[a.Wrong=1]="Wrong"})(l||(ce.DataType=l={}));function s(a){const i=c(a.type);if(i.includes("null")){if(a.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&a.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');a.nullable===!0&&i.push("null")}return i}ce.getSchemaTypes=s;function c(a){const i=Array.isArray(a)?a:a?[a]:[];if(i.every(e.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}ce.getJSONTypes=c;function y(a,i){const{gen:w,data:g,opts:_}=a,E=m(i,_.coerceTypes),I=i.length>0&&!(E.length===0&&i.length===1&&(0,t.schemaHasRulesForType)(a,i[0]));if(I){const A=v(i,g,_.strictNumbers,l.Wrong);w.if(A,()=>{E.length?P(a,i,E):h(a)})}return I}ce.coerceAndCheckDataType=y;const d=new Set(["string","number","integer","boolean","null"]);function m(a,i){return i?a.filter(w=>d.has(w)||i==="array"&&w==="array"):[]}function P(a,i,w){const{gen:g,data:_,opts:E}=a,I=g.let("dataType",(0,n._)`typeof ${_}`),A=g.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&g.if((0,n._)`${I} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>g.assign(_,(0,n._)`${_}[0]`).assign(I,(0,n._)`typeof ${_}`).if(v(i,_,E.strictNumbers),()=>g.assign(A,_))),g.if((0,n._)`${A} !== undefined`);for(const R of w)(d.has(R)||R==="array"&&E.coerceTypes==="array")&&z(R);g.else(),h(a),g.endIf(),g.if((0,n._)`${A} !== undefined`,()=>{g.assign(_,A),b(a,A)});function z(R){switch(R){case"string":g.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(A,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(A,(0,n._)`""`);return;case"number":g.elseIf((0,n._)`${I} == "boolean" || ${_} === null
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.nrg-tray-content[data-v-7094eb2b]{height:100%;padding:12px;box-sizing:border-box}.nrg-label[data-v-ec9d13ab]{display:inline-block;width:100%;margin-bottom:4px;cursor:default}.nrg-label i[data-v-ec9d13ab]{margin-right:5px}.nrg-required[data-v-ec9d13ab]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-a054dd53]{position:relative}.expand-button[data-v-a054dd53]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.expanded-editor-host[data-v-a054dd53]{height:100%}.nrg-schema-tray[data-v-feefe431]{display:flex;flex-direction:column;height:100%}.nrg-schema-editor[data-v-feefe431]{display:block;flex:1 1 auto;min-height:0}.nrg-schema-editor[data-v-feefe431] .container,.nrg-schema-editor[data-v-feefe431] .editor-wrapper{height:100%}.nrg-form-app[data-v-90f2411f]{padding-bottom:16px}.nrg-lifecycle-port[data-v-90f2411f]{white-space:nowrap}.nrg-lifecycle td.nrg-lifecycle-desc[data-v-90f2411f]{text-align:left;white-space:nowrap;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list[data-v-90f2411f]{margin:4px 0 6px;padding-left:16px;font-size:11px;line-height:1.5;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list li[data-v-90f2411f]{margin:1px 0}.nrg-section[data-v-90f2411f]{border-top:1px solid var(--red-ui-secondary-border-color, #ddd);margin-top:12px;padding-top:8px}.nrg-section-title[data-v-90f2411f]{font-weight:700;font-size:14px;margin-bottom:8px}.nrg-help[data-v-90f2411f]{white-space:nowrap;font-size:11px;line-height:1.4;color:var(--red-ui-text-color-disabled, #999);margin:2px 0 6px}.nrg-help-link[data-v-90f2411f]{color:var(--red-ui-text-color-link, #2196f3);white-space:nowrap}.nrg-help-link[data-v-90f2411f]:hover{text-decoration:underline}.nrg-subsection[data-v-90f2411f]{margin-bottom:10px}.nrg-subsection-title[data-v-90f2411f]{font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--red-ui-text-color-disabled, #777);margin:6px 0 4px}.nrg-outputs[data-v-90f2411f],.nrg-lifecycle[data-v-90f2411f],.nrg-input[data-v-90f2411f]{width:100%;max-width:100%;table-layout:fixed;margin-top:6px;border-collapse:separate;border-spacing:0;border:1px solid var(--red-ui-secondary-border-color, #d9d9d9);border-radius:3px;overflow:hidden;font-size:12px}.nrg-lifecycle[data-v-90f2411f],.nrg-input[data-v-90f2411f]{table-layout:auto}.nrg-input[data-v-90f2411f],.nrg-lifecycle .nrg-outputs-flag[data-v-90f2411f],.nrg-input .nrg-outputs-flag[data-v-90f2411f]{width:auto}.nrg-outputs th[data-v-90f2411f],.nrg-outputs td[data-v-90f2411f],.nrg-lifecycle th[data-v-90f2411f],.nrg-lifecycle td[data-v-90f2411f],.nrg-input th[data-v-90f2411f],.nrg-input td[data-v-90f2411f]{padding:5px 8px;text-align:center;vertical-align:middle;border-right:1px solid var(--red-ui-secondary-border-color, #e6e6e6);border-bottom:1px solid var(--red-ui-secondary-border-color, #e6e6e6)}.nrg-outputs th[data-v-90f2411f]:last-child,.nrg-outputs td[data-v-90f2411f]:last-child,.nrg-lifecycle th[data-v-90f2411f]:last-child,.nrg-lifecycle td[data-v-90f2411f]:last-child,.nrg-input th[data-v-90f2411f]:last-child,.nrg-input td[data-v-90f2411f]:last-child{border-right:none}.nrg-outputs tbody tr:last-child td[data-v-90f2411f],.nrg-lifecycle tbody tr:last-child td[data-v-90f2411f],.nrg-input tbody tr:last-child td[data-v-90f2411f]{border-bottom:none}.nrg-outputs thead th[data-v-90f2411f],.nrg-lifecycle thead th[data-v-90f2411f],.nrg-input thead th[data-v-90f2411f]{background:var(--red-ui-tertiary-background, #f3f3f3);color:var(--red-ui-text-color-disabled, #777);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.nrg-outputs-index[data-v-90f2411f]{width:3em}.nrg-outputs-label[data-v-90f2411f]{width:200px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nrg-outputs-return-col[data-v-90f2411f]{width:150px;white-space:nowrap}.nrg-outputs-context-col[data-v-90f2411f]{width:130px;white-space:nowrap}.nrg-outputs-flag[data-v-90f2411f]{width:116px}.nrg-outputs-flag .nrg-toggle-wrapper[data-v-90f2411f]{display:flex;align-items:center;justify-content:center}.nrg-json-schema-logo-defs[data-v-90f2411f]{position:absolute;width:0;height:0}.nrg-outputs-schema-btn[data-v-90f2411f]{display:inline-flex;align-items:center;justify-content:center}.nrg-outputs-schema-btn .nrg-schema-glyph[data-v-90f2411f]{display:inline-flex;align-items:center;line-height:0}.nrg-outputs-schema-btn .nrg-schema-glyph svg[data-v-90f2411f]{display:block;height:14px;width:auto}.nrg-outputs-schema-btn.nrg-schema-btn-error[data-v-90f2411f]{border-color:var(--red-ui-text-color-error, #d33)}.nrg-outputs-schema-btn.nrg-schema-btn-error .nrg-schema-glyph[data-v-90f2411f]{color:var(--red-ui-text-color-error, #d33)}.nrg-outputs-flag .nrg-outputs-schema-btn[data-v-90f2411f]{height:28px;box-sizing:border-box;border-radius:5px}.nrg-input thead th[data-v-90f2411f],.nrg-outputs thead th[data-v-90f2411f]{white-space:nowrap}.nrg-outputs-return[data-v-90f2411f]{width:100%;height:28px;box-sizing:border-box;padding:0 6px;text-align:left;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:5px;background:var(--red-ui-form-input-background, #fff);color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-90f2411f]{width:100%;height:28px;box-sizing:border-box;padding:0 22px 0 6px;text-align:center;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:5px;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-color:var(--red-ui-form-input-background, #fff);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:10px 6px;color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-90f2411f]:disabled{opacity:.6;cursor:not-allowed}.nrg-outputs td .nrg-outputs-return[data-v-90f2411f]{height:28px;margin:0;padding:0 6px;line-height:normal}.nrg-outputs td .nrg-outputs-context[data-v-90f2411f]{height:28px;margin:0;padding:0 22px 0 6px;line-height:normal}[data-v-90f2411f] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-90f2411f] .form-row input[type=text],[data-v-90f2411f] .form-row input[type=number],[data-v-90f2411f] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-toggle-wrapper[data-v-9d4b2ecb]{display:inline-flex;align-items:center}.nrg-toggle[data-v-9d4b2ecb]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none;margin:0!important}.nrg-toggle__input[data-v-9d4b2ecb]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-9d4b2ecb]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-9d4b2ecb]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle__input:focus-visible~.nrg-toggle__slider[data-v-9d4b2ecb]{outline:2px solid var(--red-ui-form-input-focus-color, #2b6ec9);outline-offset:2px}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]:after{transform:translate(16px)}.nrg-toggle__label[data-v-9d4b2ecb]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-9d4b2ecb]{margin-right:2px}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var Xo=Object.defineProperty,ea=(e,t,r)=>t in e?Xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tt=(e,t,r)=>ea(e,typeof t!="symbol"?t+"":t,r);import{ref as ta,defineComponent as we,openBlock as K,createElementBlock as J,Fragment as Ae,createCommentVNode as Q,createBlock as ve,Teleport as ra,createElementVNode as q,renderSlot as Te,resolveDynamicComponent as na,withCtx as Zt,normalizeClass as Ke,createTextVNode as xe,toDisplayString as Z,shallowRef as Ie,resolveComponent as ie,withDirectives as oa,vShow as aa,createVNode as fe,renderList as rt,createApp as sa,inject as Qt}from"/nrg/assets/vue.esm-browser.prod.js";const ia=["error","complete","status"];function wr(e){return ia.filter(t=>e[`${t}Port`]===!0)}function la(e){return Math.max(0,Number(e.outputs??0)-wr(e).length)}function ua(e,t){const r=la(e);if(t<r)return{kind:"base",index:t};const n=wr(e)[t-r];return n?{kind:n}:null}function ca(e,t,r){var n;return t.validateInputTypes===!0?!0:r.kind==="base"&&((n=e.validateOutputTypes)==null?void 0:n[r.index])===!0}function _r(e){return`${e.source.id}:${e.sourcePort}:${e.target.id}`}function Sr(e,t){var r,n;return t(e.type)?(n=(r=e._def)==null?void 0:r.set)==null?void 0:n.module:void 0}function Er(e,t){var r,n;const o=ua(e.source,e.sourcePort);if(!o||!ca(e.source,e.target,o))return null;const l=o.kind==="base"?{kind:"base",index:o.index,returnKey:(r=e.source.outputReturnProperties)==null?void 0:r[o.index],mode:(n=e.source.outputContextModes)==null?void 0:n[o.index]}:{kind:o.kind};return{id:_r(e),source:{type:e.source.type,module:Sr(e.source,t),port:l},target:{type:e.target.type,module:Sr(e.target,t)}}}function da(e){return`Wire type mismatch \u2014 ${e.message??"the source output is not assignable to the target input"}`}function pa(e){return`Type Validation for wire ${e.id} couldn't be done because ${e.reason??"the wire could not be resolved"}`}function fa(e){const t=e.filter(o=>o.checked&&!o.ok),r=e.filter(o=>!o.checked&&o.reason);if(!t.length&&!r.length)return null;const n=[];return t.length&&n.push(`${t.length} wire${t.length>1?"s":""} failed type validation:`,...t.map(o=>`\u2022 ${o.id}: ${o.message??"type mismatch"}`)),r.length&&(n.length&&n.push(""),n.push(...r.map(o=>`\u2022 ${pa(o)}`))),{level:t.length?"error":"warning",text:n.join(`
2
+ `)}}const xr=new Set;function ha(e){xr.add(e)}function Pr(e){return xr.has(e)}const Yt="nrg/type-check";function kr(e,t){return new Promise(r=>{try{$.ajax({url:e,method:"POST",contentType:"application/json",data:JSON.stringify(t),dataType:"json",success:n=>r(n),error:()=>r(null)})}catch{r(null)}})}function ma(e){return new Promise(t=>{try{$.ajax({url:e,method:"GET",dataType:"json",success:r=>t(r),error:()=>t(null)})}catch{t(null)}})}async function ya(){const e=await ma(`${Yt}/status`);return{available:e?.available===!0}}function Nr(e){return typeof e=="object"&&e!==null&&typeof e.ok=="boolean"}async function va(e){const t=await kr(Yt,e);return Nr(t)?t:null}async function ga(e){const t=await kr(`${Yt}/batch`,{wires:e}),r=t?.results;return Array.isArray(r)&&r.every(Nr)?r:null}const nt=ta(!1);async function ba(){const e=await ya();nt.value=e.available}let jr=!1;const Or=[];let Xt=!1;const er=new Set,Cr=new Set;let tr=!1;function $a(){Xt||(Xt=!0,Promise.resolve().then(wa))}function wa(){const e=Or.splice(0);Xt=!1,e.length===1&&_a(e[0])}function _a(e){const t=Er(e,Pr);if(!t)return;const r=t.id;er.add(r),va(t).then(n=>{if(er.delete(r),!Cr.delete(r)&&!(!n||!n.checked||n.ok)){tr=!0;try{RED.nodes.removeLink(e),RED.view.redraw(!0)}catch{}finally{tr=!1}RED.notify(da(n),{type:"error",timeout:8e3})}})}function Sa(e){!jr||!nt.value||(Or.push(e),$a())}function Ea(e){if(tr)return;const t=_r(e);er.has(t)&&Cr.add(t)}function xa(){if(!nt.value)return;const e=[];RED.nodes.eachLink(t=>{const r=Er(t,Pr);r&&e.push(r)}),e.length&&ga(e).then(t=>{if(!t)return;const r=fa(t);r&&RED.notify(r.text,{type:r.level,timeout:r.level==="error"?0:1e4})})}function Pa(){typeof RED>"u"||!RED.events||(ba(),RED.events.on("flows:load",()=>{jr=!0}),RED.events.on("links:add",e=>Sa(e)),RED.events.on("links:remove",e=>Ea(e)),RED.events.on("deploy",xa))}Pa();function ka(e){return e}function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={},Tr;function Na(){if(Tr)return Be;Tr=1;var e=/~/,t=/~[01]/g;function r(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function n(d){return e.test(d)?d.replace(t,r):d}function o(d,m,P){for(var b,u,v=1,x=m.length;v<x;){if(m[v]==="constructor"||m[v]==="prototype"||m[v]==="__proto__")return d;if(b=n(m[v++]),u=x>v,typeof d[b]>"u"&&(Array.isArray(d)&&b==="-"&&(b=d.length),u&&(m[v]!==""&&m[v]<1/0||m[v]==="-"?d[b]=[]:d[b]={})),!u)break;d=d[b]}var h=d[b];return P===void 0?delete d[b]:d[b]=P,h}function l(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const m of d)if(typeof m!="string"&&typeof m!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function a(d,m){if(typeof d!="object")throw new Error("Invalid input object.");m=l(m);var P=m.length;if(P===1)return d;for(var b=1;b<P;){if(d=d[n(m[b++])],P===b)return d;if(typeof d!="object"||d===null)return}}function c(d,m,P){if(typeof d!="object")throw new Error("Invalid input object.");if(m=l(m),m.length===0)throw new Error("Invalid JSON pointer for set.");return o(d,m,P)}function y(d){var m=l(d);return{get:function(P){return a(P,m)},set:function(P,b){return c(P,m,b)}}}return Be.get=a,Be.set=c,Be.compile=y,Be}var ja=Na();const Ir=ot(ja);function Oa(e,t,{signal:r,edges:n}={}){let o,l=null;const a=n!=null&&n.includes("leading"),c=n==null||n.includes("trailing"),y=()=>{l!==null&&(e.apply(o,l),o=void 0,l=null)},d=()=>{c&&y(),u()};let m=null;const P=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,d()},t)},b=()=>{m!==null&&(clearTimeout(m),m=null)},u=()=>{b(),o=void 0,l=null},v=()=>{y()},x=function(...h){if(r!=null&&r.aborted)return;o=this,l=h;const p=m==null;P(),a&&p&&y()};return x.schedule=P,x.cancel=u,x.flush=v,r?.addEventListener("abort",u,{once:!0}),x}function Ca(){}function Ta(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ia(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rr(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function nr(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Vr="[object RegExp]",Rr="[object String]",Lr="[object Number]",Mr="[object Boolean]",or="[object Arguments]",Ar="[object Symbol]",qr="[object Date]",Dr="[object Map]",zr="[object Set]",Fr="[object Array]",Va="[object Function]",Ur="[object ArrayBuffer]",at="[object Object]",Ra="[object Error]",Kr="[object DataView]",Br="[object Uint8Array]",Wr="[object Uint8ClampedArray]",Gr="[object Uint16Array]",Hr="[object Uint32Array]",La="[object BigUint64Array]",Jr="[object Int8Array]",Zr="[object Int16Array]",Qr="[object Int32Array]",Ma="[object BigInt64Array]",Yr="[object Float32Array]",Xr="[object Float64Array]";function qe(e,t,r,n=new Map,o=void 0){const l=o?.(e,t,r,n);if(l!==void 0)return l;if(Ta(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const a=new Array(e.length);n.set(e,a);for(let c=0;c<e.length;c++)a[c]=qe(e[c],c,r,n,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;n.set(e,a);for(const[c,y]of e)a.set(c,qe(y,c,r,n,o));return a}if(e instanceof Set){const a=new Set;n.set(e,a);for(const c of e)a.add(qe(c,void 0,r,n,o));return a}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Ia(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,a);for(let c=0;c<e.length;c++)a[c]=qe(e[c],c,r,n,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,a),Oe(a,e,r,n,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return n.set(e,a),Oe(a,e,r,n,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return n.set(e,a),Oe(a,e,r,n,o),a}if(e instanceof Error){const a=structuredClone(e);return n.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,Oe(a,e,r,n,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return n.set(e,a),Oe(a,e,r,n,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return n.set(e,a),Oe(a,e,r,n,o),a}if(e instanceof String){const a=new String(e.valueOf());return n.set(e,a),Oe(a,e,r,n,o),a}if(typeof e=="object"&&Aa(e)){const a=Object.create(Object.getPrototypeOf(e));return n.set(e,a),Oe(a,e,r,n,o),a}return e}function Oe(e,t,r=e,n,o){const l=[...Object.keys(t),...rr(t)];for(let a=0;a<l.length;a++){const c=l[a],y=Object.getOwnPropertyDescriptor(e,c);(y==null||y.writable)&&(e[c]=qe(t[c],c,r,n,o))}}function Aa(e){switch(nr(e)){case or:case Fr:case Ur:case Kr:case Mr:case qr:case Yr:case Xr:case Jr:case Zr:case Qr:case Dr:case Lr:case at:case Vr:case zr:case Rr:case Ar:case Br:case Wr:case Gr:case Hr:return!0;default:return!1}}function en(e){return qe(e,void 0,e,new Map,void 0)}function tn(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function qa(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Da(e,t,r){return We(e,t,void 0,void 0,void 0,void 0,r)}function We(e,t,r,n,o,l,a){const c=a(e,t,r,n,o,l);if(c!==void 0)return c;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Ge(e,t,l,a)}return Ge(e,t,l,a)}function Ge(e,t,r,n){if(Object.is(e,t))return!0;let o=nr(e),l=nr(t);if(o===or&&(o=at),l===or&&(l=at),o!==l)return!1;switch(o){case Rr:return e.toString()===t.toString();case Lr:{const y=e.valueOf(),d=t.valueOf();return qa(y,d)}case Mr:case qr:case Ar:return Object.is(e.valueOf(),t.valueOf());case Vr:return e.source===t.source&&e.flags===t.flags;case Va:return e===t}r=r??new Map;const a=r.get(e),c=r.get(t);if(a!=null&&c!=null)return a===t;r.set(e,t),r.set(t,e);try{switch(o){case Dr:{if(e.size!==t.size)return!1;for(const[y,d]of e.entries())if(!t.has(y)||!We(d,t.get(y),y,e,t,r,n))return!1;return!0}case zr:{if(e.size!==t.size)return!1;const y=Array.from(e.values()),d=Array.from(t.values());for(let m=0;m<y.length;m++){const P=y[m],b=d.findIndex(u=>We(P,u,void 0,e,t,r,n));if(b===-1)return!1;d.splice(b,1)}return!0}case Fr:case Br:case Wr:case Gr:case Hr:case La:case Jr:case Zr:case Qr:case Ma:case Yr:case Xr:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let y=0;y<e.length;y++)if(!We(e[y],t[y],y,e,t,r,n))return!1;return!0}case Ur:return e.byteLength!==t.byteLength?!1:Ge(new Uint8Array(e),new Uint8Array(t),r,n);case Kr:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:Ge(new Uint8Array(e),new Uint8Array(t),r,n);case Ra:return e.name===t.name&&e.message===t.message;case at:{if(!(Ge(e.constructor,t.constructor,r,n)||tn(e)&&tn(t)))return!1;const y=[...Object.keys(e),...rr(e)],d=[...Object.keys(t),...rr(t)];if(y.length!==d.length)return!1;for(let m=0;m<y.length;m++){const P=y[m],b=e[P];if(!Object.hasOwn(t,P))return!1;const u=t[P];if(!We(b,u,P,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function za(e,t){return Da(e,t,Ca)}var ar={exports:{}},rn={},Pe={},Ve={},nn={},on={},an={},sn;function He(){return sn||(sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(s){if(super(),!e.IDENTIFIER.test(s))throw new Error("CodeGen: name must be a valid identifier");this.str=s}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(s){super(),this._items=typeof s=="string"?[s]:s}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const s=this._items[0];return s===""||s==='""'}get str(){var s;return(s=this._str)!==null&&s!==void 0?s:this._str=this._items.reduce((i,w)=>`${i}${w}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s:this._names=this._items.reduce((i,w)=>(w instanceof r&&(i[w.str]=(i[w.str]||0)+1),i),{})}}e._Code=n,e.nil=new n("");function o(p,...s){const i=[p[0]];let w=0;for(;w<s.length;)c(i,s[w]),i.push(p[++w]);return new n(i)}e._=o;const l=new n("+");function a(p,...s){const i=[u(p[0])];let w=0;for(;w<s.length;)i.push(l),c(i,s[w]),i.push(l,u(p[++w]));return y(i),new n(i)}e.str=a;function c(p,s){s instanceof n?p.push(...s._items):s instanceof r?p.push(s):p.push(P(s))}e.addCodeArg=c;function y(p){let s=1;for(;s<p.length-1;){if(p[s]===l){const i=d(p[s-1],p[s+1]);if(i!==void 0){p.splice(s-1,3,i);continue}p[s++]="+"}s++}}function d(p,s){if(s==='""')return p;if(p==='""')return s;if(typeof p=="string")return s instanceof r||p[p.length-1]!=='"'?void 0:typeof s!="string"?`${p.slice(0,-1)}${s}"`:s[0]==='"'?p.slice(0,-1)+s.slice(1):void 0;if(typeof s=="string"&&s[0]==='"'&&!(p instanceof r))return`"${p}${s.slice(1)}`}function m(p,s){return s.emptyStr()?p:p.emptyStr()?s:a`${p}${s}`}e.strConcat=m;function P(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:u(Array.isArray(p)?p.join(","):p)}function b(p){return new n(u(p))}e.stringify=b;function u(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=u;function v(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):o`[${p}]`}e.getProperty=v;function x(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=x;function h(p){return new n(p.toString())}e.regexpCode=h})(an)),an}var ln={},un;function cn(){return un||(un=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=He();class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(y){y[y.Started=0]="Started",y[y.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:d,parent:m}={}){this._names={},this._prefixes=d,this._parent=m}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const m=this._names[d]||this._nameGroup(d);return`${d}${m.index++}`}_nameGroup(d){var m,P;if(!((P=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||P===void 0)&&P.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=o;class l extends t.Name{constructor(d,m){super(m),this.prefix=d}setValue(d,{property:m,itemIndex:P}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(m)}[${P}]`}}e.ValueScopeName=l;const a=(0,t._)`\n`;class c extends o{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?a:t.nil}}get(){return this._scope}name(d){return new l(d,this._newName(d))}value(d,m){var P;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(d),{prefix:u}=b,v=(P=m.key)!==null&&P!==void 0?P:m.ref;let x=this._values[u];if(x){const s=x.get(v);if(s)return s}else x=this._values[u]=new Map;x.set(v,b);const h=this._scope[u]||(this._scope[u]=[]),p=h.length;return h[p]=m.ref,b.setValue(m,{property:u,itemIndex:p}),b}getValue(d,m){const P=this._values[d];if(P)return P.get(m)}scopeRefs(d,m=this._values){return this._reduceValues(m,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,t._)`${d}${P.scopePath}`})}scopeCode(d=this._values,m,P){return this._reduceValues(d,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},m,P)}_reduceValues(d,m,P={},b){let u=t.nil;for(const v in d){const x=d[v];if(!x)continue;const h=P[v]=P[v]||new Map;x.forEach(p=>{if(h.has(p))return;h.set(p,n.Started);let s=m(p);if(s){const i=this.opts.es5?e.varKinds.var:e.varKinds.const;u=(0,t._)`${u}${i} ${p} = ${s};${this.opts._n}`}else if(s=b?.(p))u=(0,t._)`${u}${s}${this.opts._n}`;else throw new r(p);h.set(p,n.Completed)})}return u}}e.ValueScope=c})(ln)),ln}var dn;function X(){return dn||(dn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=He(),r=cn();var n=He();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=cn();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class l{optimizeNodes(){return this}optimizeNames(f,S){return this}}class a extends l{constructor(f,S,T){super(),this.varKind=f,this.name=S,this.rhs=T}render({es5:f,_n:S}){const T=f?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${F};`+S}optimizeNames(f,S){if(f[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,f,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends l{constructor(f,S,T){super(),this.lhs=f,this.rhs=S,this.sideEffects=T}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,S){if(!(this.lhs instanceof t.Name&&!f[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,f,S),this}get names(){const f=this.lhs instanceof t.Name?{}:{...this.lhs.names};return B(f,this.rhs)}}class y extends c{constructor(f,S,T,F){super(f,T,F),this.op=S}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class d extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class m extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class P extends l{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class b extends l{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,S){return this.code=G(this.code,f,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class u extends l{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((S,T)=>S+T.render(f),"")}optimizeNodes(){const{nodes:f}=this;let S=f.length;for(;S--;){const T=f[S].optimizeNodes();Array.isArray(T)?f.splice(S,1,...T):T?f[S]=T:f.splice(S,1)}return f.length>0?this:void 0}optimizeNames(f,S){const{nodes:T}=this;let F=T.length;for(;F--;){const M=T[F];M.optimizeNames(f,S)||(ae(f,M.names),T.splice(F,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((f,S)=>U(f,S.names),{})}}class v extends u{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class x extends u{}class h extends v{}h.kind="else";class p extends v{constructor(f,S){super(S),this.condition=f}render(f){let S=`if(${this.condition})`+super.render(f);return this.else&&(S+="else "+this.else.render(f)),S}optimizeNodes(){super.optimizeNodes();const f=this.condition;if(f===!0)return this.nodes;let S=this.else;if(S){const T=S.optimizeNodes();S=this.else=Array.isArray(T)?new h(T):T}if(S)return f===!1?S instanceof p?S:S.nodes:this.nodes.length?this:new p(se(f),S instanceof p?[S]:S.nodes);if(!(f===!1||!this.nodes.length))return this}optimizeNames(f,S){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(f,S),!!(super.optimizeNames(f,S)||this.else))return this.condition=G(this.condition,f,S),this}get names(){const f=super.names;return B(f,this.condition),this.else&&U(f,this.else.names),f}}p.kind="if";class s extends v{}s.kind="for";class i extends s{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,S){if(super.optimizeNames(f,S))return this.iteration=G(this.iteration,f,S),this}get names(){return U(super.names,this.iteration.names)}}class w extends s{constructor(f,S,T,F){super(),this.varKind=f,this.name=S,this.from=T,this.to=F}render(f){const S=f.es5?r.varKinds.var:this.varKind,{name:T,from:F,to:M}=this;return`for(${S} ${T}=${F}; ${T}<${M}; ${T}++)`+super.render(f)}get names(){const f=B(super.names,this.from);return B(f,this.to)}}class g extends s{constructor(f,S,T,F){super(),this.loop=f,this.varKind=S,this.name=T,this.iterable=F}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,S){if(super.optimizeNames(f,S))return this.iterable=G(this.iterable,f,S),this}get names(){return U(super.names,this.iterable.names)}}class _ extends v{constructor(f,S,T){super(),this.name=f,this.args=S,this.async=T}render(f){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(f)}}_.kind="func";class E extends u{render(f){return"return "+super.render(f)}}E.kind="return";class I extends v{render(f){let S="try"+super.render(f);return this.catch&&(S+=this.catch.render(f)),this.finally&&(S+=this.finally.render(f)),S}optimizeNodes(){var f,S;return super.optimizeNodes(),(f=this.catch)===null||f===void 0||f.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(f,S){var T,F;return super.optimizeNames(f,S),(T=this.catch)===null||T===void 0||T.optimizeNames(f,S),(F=this.finally)===null||F===void 0||F.optimizeNames(f,S),this}get names(){const f=super.names;return this.catch&&U(f,this.catch.names),this.finally&&U(f,this.finally.names),f}}class A extends v{constructor(f){super(),this.error=f}render(f){return`catch(${this.error})`+super.render(f)}}A.kind="catch";class z extends v{render(f){return"finally"+super.render(f)}}z.kind="finally";class R{constructor(f,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
3
+ `:""},this._extScope=f,this._scope=new r.Scope({parent:f}),this._nodes=[new x]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,S){const T=this._extScope.value(f,S);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(f,S){return this._extScope.getValue(f,S)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,S,T,F){const M=this._scope.toName(S);return T!==void 0&&F&&(this._constants[M.str]=T),this._leafNode(new a(f,M,T)),M}const(f,S,T){return this._def(r.varKinds.const,f,S,T)}let(f,S,T){return this._def(r.varKinds.let,f,S,T)}var(f,S,T){return this._def(r.varKinds.var,f,S,T)}assign(f,S,T){return this._leafNode(new c(f,S,T))}add(f,S){return this._leafNode(new y(f,e.operators.ADD,S))}code(f){return typeof f=="function"?f():f!==t.nil&&this._leafNode(new b(f)),this}object(...f){const S=["{"];for(const[T,F]of f)S.length>1&&S.push(","),S.push(T),(T!==F||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,F));return S.push("}"),new t._Code(S)}if(f,S,T){if(this._blockNode(new p(f)),S&&T)this.code(S).else().code(T).endIf();else if(S)this.code(S).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new p(f))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(p,h)}_for(f,S){return this._blockNode(f),S&&this.code(S).endFor(),this}for(f,S){return this._for(new i(f),S)}forRange(f,S,T,F,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const W=this._scope.toName(f);return this._for(new w(M,W,S,T),()=>F(W))}forOf(f,S,T,F=r.varKinds.const){const M=this._scope.toName(f);if(this.opts.es5){const W=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${W}.length`,Y=>{this.var(M,(0,t._)`${W}[${Y}]`),T(M)})}return this._for(new g("of",F,M,S),()=>T(M))}forIn(f,S,T,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(f,(0,t._)`Object.keys(${S})`,T);const M=this._scope.toName(f);return this._for(new g("in",F,M,S),()=>T(M))}endFor(){return this._endBlockNode(s)}label(f){return this._leafNode(new d(f))}break(f){return this._leafNode(new m(f))}return(f){const S=new E;if(this._blockNode(S),this.code(f),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(f,S,T){if(!S&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new I;if(this._blockNode(F),this.code(f),S){const M=this.name("e");this._currNode=F.catch=new A(M),S(M)}return T&&(this._currNode=F.finally=new z,this.code(T)),this._endBlockNode(A,z)}throw(f){return this._leafNode(new P(f))}block(f,S){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(S),this}endBlock(f){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-S;if(T<0||f!==void 0&&T!==f)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${f} expected`);return this._nodes.length=S,this}func(f,S=t.nil,T,F){return this._blockNode(new _(f,S,T)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,S){const T=this._currNode;if(T instanceof f||S&&T instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${f.kind}/${S.kind}`:f.kind}"`)}_elseNode(f){const S=this._currNode;if(!(S instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const S=this._nodes;S[S.length-1]=f}}e.CodeGen=R;function U(k,f){for(const S in f)k[S]=(k[S]||0)+(f[S]||0);return k}function B(k,f){return f instanceof t._CodeOrName?U(k,f.names):k}function G(k,f,S){if(k instanceof t.Name)return T(k);if(!F(k))return k;return new t._Code(k._items.reduce((M,W)=>(W instanceof t.Name&&(W=T(W)),W instanceof t._Code?M.push(...W._items):M.push(W),M),[]));function T(M){const W=S[M.str];return W===void 0||f[M.str]!==1?M:(delete f[M.str],W)}function F(M){return M instanceof t._Code&&M._items.some(W=>W instanceof t.Name&&f[W.str]===1&&S[W.str]!==void 0)}}function ae(k,f){for(const S in f)k[S]=(k[S]||0)-(f[S]||0)}function se(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,t._)`!${C(k)}`}e.not=se;const de=O(e.operators.AND);function ne(...k){return k.reduce(de)}e.and=ne;const pe=O(e.operators.OR);function L(...k){return k.reduce(pe)}e.or=L;function O(k){return(f,S)=>f===t.nil?S:S===t.nil?f:(0,t._)`${C(f)} ${k} ${C(S)}`}function C(k){return k instanceof t.Name?k:(0,t._)`(${k})`}})(on)),on}var ee={},pn;function re(){if(pn)return ee;pn=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;const e=X(),t=He();function r(g){const _={};for(const E of g)_[E]=!0;return _}ee.toHash=r;function n(g,_){return typeof _=="boolean"?_:Object.keys(_).length===0?!0:(o(g,_),!l(_,g.self.RULES.all))}ee.alwaysValidSchema=n;function o(g,_=g.schema){const{opts:E,self:I}=g;if(!E.strictSchema||typeof _=="boolean")return;const A=I.RULES.keywords;for(const z in _)A[z]||w(g,`unknown keyword: "${z}"`)}ee.checkUnknownRules=o;function l(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(_[E])return!0;return!1}ee.schemaHasRules=l;function a(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(E!=="$ref"&&_.all[E])return!0;return!1}ee.schemaHasRulesButRef=a;function c({topSchemaRef:g,schemaPath:_},E,I,A){if(!A){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${g}${_}${(0,e.getProperty)(I)}`}ee.schemaRefOrVal=c;function y(g){return P(decodeURIComponent(g))}ee.unescapeFragment=y;function d(g){return encodeURIComponent(m(g))}ee.escapeFragment=d;function m(g){return typeof g=="number"?`${g}`:g.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=m;function P(g){return g.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=P;function b(g,_){if(Array.isArray(g))for(const E of g)_(E);else _(g)}ee.eachItem=b;function u({mergeNames:g,mergeToName:_,mergeValues:E,resultToName:I}){return(A,z,R,U)=>{const B=R===void 0?z:R instanceof e.Name?(z instanceof e.Name?g(A,z,R):_(A,z,R),R):z instanceof e.Name?(_(A,R,z),z):E(z,R);return U===e.Name&&!(B instanceof e.Name)?I(A,B):B}}ee.mergeEvaluated={props:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>{g.if((0,e._)`${_} === true`,()=>g.assign(E,!0),()=>g.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${_})`))}),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>{_===!0?g.assign(E,!0):(g.assign(E,(0,e._)`${E} || {}`),x(g,E,_))}),mergeValues:(g,_)=>g===!0?!0:{...g,..._},resultToName:v}),items:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>g.assign(E,(0,e._)`${_} === true ? true : ${E} > ${_} ? ${E} : ${_}`)),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>g.assign(E,_===!0?!0:(0,e._)`${E} > ${_} ? ${E} : ${_}`)),mergeValues:(g,_)=>g===!0?!0:Math.max(g,_),resultToName:(g,_)=>g.var("items",_)})};function v(g,_){if(_===!0)return g.var("props",!0);const E=g.var("props",(0,e._)`{}`);return _!==void 0&&x(g,E,_),E}ee.evaluatedPropsToName=v;function x(g,_,E){Object.keys(E).forEach(I=>g.assign((0,e._)`${_}${(0,e.getProperty)(I)}`,!0))}ee.setEvaluated=x;const h={};function p(g,_){return g.scopeValue("func",{ref:_,code:h[_.code]||(h[_.code]=new t._Code(_.code))})}ee.useFunc=p;var s;(function(g){g[g.Num=0]="Num",g[g.Str=1]="Str"})(s||(ee.Type=s={}));function i(g,_,E){if(g instanceof e.Name){const I=_===s.Num;return E?I?(0,e._)`"[" + ${g} + "]"`:(0,e._)`"['" + ${g} + "']"`:I?(0,e._)`"/" + ${g}`:(0,e._)`"/" + ${g}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(g).toString():"/"+m(g)}ee.getErrorPath=i;function w(g,_,E=g.opts.strictSchema){if(E){if(_=`strict mode: ${_}`,E===!0)throw new Error(_);g.self.logger.warn(_)}}return ee.checkStrictMode=w,ee}var st={},fn;function ke(){if(fn)return st;fn=1,Object.defineProperty(st,"__esModule",{value:!0});const e=X(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return st.default=t,st}var hn;function Je(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=X(),r=re(),n=ke();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:p})=>p?(0,t.str)`"${h}" keyword must be ${p} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function o(h,p=e.keywordError,s,i){const{it:w}=h,{gen:g,compositeRule:_,allErrors:E}=w,I=P(h,p,s);i??(_||E)?y(g,I):d(w,(0,t._)`[${I}]`)}e.reportError=o;function l(h,p=e.keywordError,s){const{it:i}=h,{gen:w,compositeRule:g,allErrors:_}=i,E=P(h,p,s);y(w,E),g||_||d(i,n.default.vErrors)}e.reportExtraError=l;function a(h,p){h.assign(n.default.errors,p),h.if((0,t._)`${n.default.vErrors} !== null`,()=>h.if(p,()=>h.assign((0,t._)`${n.default.vErrors}.length`,p),()=>h.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function c({gen:h,keyword:p,schemaValue:s,data:i,errsCount:w,it:g}){if(w===void 0)throw new Error("ajv implementation error");const _=h.name("err");h.forRange("i",w,n.default.errors,E=>{h.const(_,(0,t._)`${n.default.vErrors}[${E}]`),h.if((0,t._)`${_}.instancePath === undefined`,()=>h.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,g.errorPath))),h.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${g.errSchemaPath}/${p}`),g.opts.verbose&&(h.assign((0,t._)`${_}.schema`,s),h.assign((0,t._)`${_}.data`,i))})}e.extendErrors=c;function y(h,p){const s=h.const("err",p);h.if((0,t._)`${n.default.vErrors} === null`,()=>h.assign(n.default.vErrors,(0,t._)`[${s}]`),(0,t._)`${n.default.vErrors}.push(${s})`),h.code((0,t._)`${n.default.errors}++`)}function d(h,p){const{gen:s,validateName:i,schemaEnv:w}=h;w.$async?s.throw((0,t._)`new ${h.ValidationError}(${p})`):(s.assign((0,t._)`${i}.errors`,p),s.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function P(h,p,s){const{createErrors:i}=h.it;return i===!1?(0,t._)`{}`:b(h,p,s)}function b(h,p,s={}){const{gen:i,it:w}=h,g=[u(w,s),v(h,s)];return x(h,p,g),i.object(...g)}function u({errorPath:h},{instancePath:p}){const s=p?(0,t.str)`${h}${(0,r.getErrorPath)(p,r.Type.Str)}`:h;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,s)]}function v({keyword:h,it:{errSchemaPath:p}},{schemaPath:s,parentSchema:i}){let w=i?p:(0,t.str)`${p}/${h}`;return s&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(s,r.Type.Str)}`),[m.schemaPath,w]}function x(h,{params:p,message:s},i){const{keyword:w,data:g,schemaValue:_,it:E}=h,{opts:I,propertyName:A,topSchemaRef:z,schemaPath:R}=E;i.push([m.keyword,w],[m.params,typeof p=="function"?p(h):p||(0,t._)`{}`]),I.messages&&i.push([m.message,typeof s=="function"?s(h):s]),I.verbose&&i.push([m.schema,_],[m.parentSchema,(0,t._)`${z}${R}`],[n.default.data,g]),A&&i.push([m.propertyName,A])}})(nn)),nn}var mn;function Fa(){if(mn)return Ve;mn=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.boolOrEmptySchema=Ve.topBoolOrEmptySchema=void 0;const e=Je(),t=X(),r=ke(),n={message:"boolean schema is false"};function o(c){const{gen:y,schema:d,validateName:m}=c;d===!1?a(c,!1):typeof d=="object"&&d.$async===!0?y.return(r.default.data):(y.assign((0,t._)`${m}.errors`,null),y.return(!0))}Ve.topBoolOrEmptySchema=o;function l(c,y){const{gen:d,schema:m}=c;m===!1?(d.var(y,!1),a(c)):d.var(y,!0)}Ve.boolOrEmptySchema=l;function a(c,y){const{gen:d,data:m}=c,P={gen:d,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(P,n,void 0,y)}return Ve}var ce={},Re={},yn;function vn(){if(yn)return Re;yn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.getRules=Re.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(o){return typeof o=="string"&&t.has(o)}Re.isJSONType=r;function n(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return Re.getRules=n,Re}var Ne={},gn;function bn(){if(gn)return Ne;gn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.shouldUseRule=Ne.shouldUseGroup=Ne.schemaHasRulesForType=void 0;function e({schema:n,self:o},l){const a=o.RULES.types[l];return a&&a!==!0&&t(n,a)}Ne.schemaHasRulesForType=e;function t(n,o){return o.rules.some(l=>r(n,l))}Ne.shouldUseGroup=t;function r(n,o){var l;return n[o.keyword]!==void 0||((l=o.definition.implements)===null||l===void 0?void 0:l.some(a=>n[a]!==void 0))}return Ne.shouldUseRule=r,Ne}var $n;function it(){if($n)return ce;$n=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.reportTypeError=ce.checkDataTypes=ce.checkDataType=ce.coerceAndCheckDataType=ce.getJSONTypes=ce.getSchemaTypes=ce.DataType=void 0;const e=vn(),t=bn(),r=Je(),n=X(),o=re();var l;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(l||(ce.DataType=l={}));function a(s){const i=c(s.type);if(i.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&i.push("null")}return i}ce.getSchemaTypes=a;function c(s){const i=Array.isArray(s)?s:s?[s]:[];if(i.every(e.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}ce.getJSONTypes=c;function y(s,i){const{gen:w,data:g,opts:_}=s,E=m(i,_.coerceTypes),I=i.length>0&&!(E.length===0&&i.length===1&&(0,t.schemaHasRulesForType)(s,i[0]));if(I){const A=v(i,g,_.strictNumbers,l.Wrong);w.if(A,()=>{E.length?P(s,i,E):h(s)})}return I}ce.coerceAndCheckDataType=y;const d=new Set(["string","number","integer","boolean","null"]);function m(s,i){return i?s.filter(w=>d.has(w)||i==="array"&&w==="array"):[]}function P(s,i,w){const{gen:g,data:_,opts:E}=s,I=g.let("dataType",(0,n._)`typeof ${_}`),A=g.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&g.if((0,n._)`${I} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>g.assign(_,(0,n._)`${_}[0]`).assign(I,(0,n._)`typeof ${_}`).if(v(i,_,E.strictNumbers),()=>g.assign(A,_))),g.if((0,n._)`${A} !== undefined`);for(const R of w)(d.has(R)||R==="array"&&E.coerceTypes==="array")&&z(R);g.else(),h(s),g.endIf(),g.if((0,n._)`${A} !== undefined`,()=>{g.assign(_,A),b(s,A)});function z(R){switch(R){case"string":g.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(A,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(A,(0,n._)`""`);return;case"number":g.elseIf((0,n._)`${I} == "boolean" || ${_} === null
4
4
  || (${I} == "string" && ${_} && ${_} == +${_})`).assign(A,(0,n._)`+${_}`);return;case"integer":g.elseIf((0,n._)`${I} === "boolean" || ${_} === null
5
5
  || (${I} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(A,(0,n._)`+${_}`);return;case"boolean":g.elseIf((0,n._)`${_} === "false" || ${_} === 0 || ${_} === null`).assign(A,!1).elseIf((0,n._)`${_} === "true" || ${_} === 1`).assign(A,!0);return;case"null":g.elseIf((0,n._)`${_} === "" || ${_} === 0 || ${_} === false`),g.assign(A,null);return;case"array":g.elseIf((0,n._)`${I} === "string" || ${I} === "number"
6
- || ${I} === "boolean" || ${_} === null`).assign(A,(0,n._)`[${_}]`)}}}function b({gen:a,parentData:i,parentDataProperty:w},g){a.if((0,n._)`${i} !== undefined`,()=>a.assign((0,n._)`${i}[${w}]`,g))}function u(a,i,w,g=l.Correct){const _=g===l.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(a){case"null":return(0,n._)`${i} ${_} null`;case"array":E=(0,n._)`Array.isArray(${i})`;break;case"object":E=(0,n._)`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":E=I((0,n._)`!(${i} % 1) && !isNaN(${i})`);break;case"number":E=I();break;default:return(0,n._)`typeof ${i} ${_} ${a}`}return g===l.Correct?E:(0,n.not)(E);function I(A=n.nil){return(0,n.and)((0,n._)`typeof ${i} == "number"`,A,w?(0,n._)`isFinite(${i})`:n.nil)}}ce.checkDataType=u;function v(a,i,w,g){if(a.length===1)return u(a[0],i,w,g);let _;const E=(0,o.toHash)(a);if(E.array&&E.object){const I=(0,n._)`typeof ${i} != "object"`;_=E.null?I:(0,n._)`!${i} || ${I}`,delete E.null,delete E.array,delete E.object}else _=n.nil;E.number&&delete E.integer;for(const I in E)_=(0,n.and)(_,u(I,i,w,g));return _}ce.checkDataTypes=v;const x={message:({schema:a})=>`must be ${a}`,params:({schema:a,schemaValue:i})=>typeof a=="string"?(0,n._)`{type: ${a}}`:(0,n._)`{type: ${i}}`};function h(a){const i=p(a);(0,r.reportError)(i,x)}ce.reportTypeError=h;function p(a){const{gen:i,data:w,schema:g}=a,_=(0,o.schemaRefOrVal)(a,g,"type");return{gen:i,keyword:"type",data:w,schema:g.type,schemaCode:_,schemaValue:_,parentSchema:g,params:{},it:a}}return ce}var Ze={},wn;function Ka(){if(wn)return Ze;wn=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.assignDefaults=void 0;const e=X(),t=re();function r(o,l){const{properties:s,items:c}=o.schema;if(l==="object"&&s)for(const y in s)n(o,y,s[y].default);else l==="array"&&Array.isArray(c)&&c.forEach((y,d)=>n(o,d,y.default))}Ze.assignDefaults=r;function n(o,l,s){const{gen:c,compositeRule:y,data:d,opts:m}=o;if(s===void 0)return;const P=(0,e._)`${d}${(0,e.getProperty)(l)}`;if(y){(0,t.checkStrictMode)(o,`default is ignored for: ${P}`);return}let b=(0,e._)`${P} === undefined`;m.useDefaults==="empty"&&(b=(0,e._)`${b} || ${P} === null || ${P} === ""`),c.if(b,(0,e._)`${P} = ${(0,e.stringify)(s)}`)}return Ze}var _e={},oe={},_n;function Se(){if(_n)return oe;_n=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.validateUnion=oe.validateArray=oe.usePattern=oe.callValidateCode=oe.schemaProperties=oe.allSchemaProperties=oe.noPropertyInData=oe.propertyInData=oe.isOwnProperty=oe.hasPropFunc=oe.reportMissingProp=oe.checkMissingProp=oe.checkReportMissingProp=void 0;const e=X(),t=re(),r=ke(),n=re();function o(a,i){const{gen:w,data:g,it:_}=a;w.if(m(w,g,i,_.opts.ownProperties),()=>{a.setParams({missingProperty:(0,e._)`${i}`},!0),a.error()})}oe.checkReportMissingProp=o;function l({gen:a,data:i,it:{opts:w}},g,_){return(0,e.or)(...g.map(E=>(0,e.and)(m(a,i,E,w.ownProperties),(0,e._)`${_} = ${E}`)))}oe.checkMissingProp=l;function s(a,i){a.setParams({missingProperty:i},!0),a.error()}oe.reportMissingProp=s;function c(a){return a.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}oe.hasPropFunc=c;function y(a,i,w){return(0,e._)`${c(a)}.call(${i}, ${w})`}oe.isOwnProperty=y;function d(a,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} !== undefined`;return g?(0,e._)`${_} && ${y(a,i,w)}`:_}oe.propertyInData=d;function m(a,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} === undefined`;return g?(0,e.or)(_,(0,e.not)(y(a,i,w))):_}oe.noPropertyInData=m;function P(a){return a?Object.keys(a).filter(i=>i!=="__proto__"):[]}oe.allSchemaProperties=P;function b(a,i){return P(i).filter(w=>!(0,t.alwaysValidSchema)(a,i[w]))}oe.schemaProperties=b;function u({schemaCode:a,data:i,it:{gen:w,topSchemaRef:g,schemaPath:_,errorPath:E},it:I},A,z,R){const U=R?(0,e._)`${a}, ${i}, ${g}${_}`:i,B=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];I.opts.dynamicRef&&B.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,e._)`${U}, ${w.object(...B)}`;return z!==e.nil?(0,e._)`${A}.call(${z}, ${G})`:(0,e._)`${A}(${G})`}oe.callValidateCode=u;const v=(0,e._)`new RegExp`;function x({gen:a,it:{opts:i}},w){const g=i.unicodeRegExp?"u":"",{regExp:_}=i.code,E=_(w,g);return a.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${_.code==="new RegExp"?v:(0,n.useFunc)(a,_)}(${w}, ${g})`})}oe.usePattern=x;function h(a){const{gen:i,data:w,keyword:g,it:_}=a,E=i.name("valid");if(_.allErrors){const A=i.let("valid",!0);return I(()=>i.assign(A,!1)),A}return i.var(E,!0),I(()=>i.break()),E;function I(A){const z=i.const("len",(0,e._)`${w}.length`);i.forRange("i",0,z,R=>{a.subschema({keyword:g,dataProp:R,dataPropType:t.Type.Num},E),i.if((0,e.not)(E),A)})}}oe.validateArray=h;function p(a){const{gen:i,schema:w,keyword:g,it:_}=a;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(A=>(0,t.alwaysValidSchema)(_,A))&&!_.opts.unevaluated)return;const E=i.let("valid",!1),I=i.name("_valid");i.block(()=>w.forEach((A,z)=>{const R=a.subschema({keyword:g,schemaProp:z,compositeRule:!0},I);i.assign(E,(0,e._)`${E} || ${I}`),a.mergeValidEvaluated(R,I)||i.if((0,e.not)(E))})),a.result(E,()=>a.reset(),()=>a.error(!0))}return oe.validateUnion=p,oe}var Sn;function Ba(){if(Sn)return _e;Sn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.validateKeywordUsage=_e.validSchemaType=_e.funcKeywordCode=_e.macroKeywordCode=void 0;const e=X(),t=ke(),r=Se(),n=Je();function o(b,u){const{gen:v,keyword:x,schema:h,parentSchema:p,it:a}=b,i=u.macro.call(a.self,h,p,a),w=d(v,x,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const g=v.name("valid");b.subschema({schema:i,schemaPath:e.nil,errSchemaPath:`${a.errSchemaPath}/${x}`,topSchemaRef:w,compositeRule:!0},g),b.pass(g,()=>b.error(!0))}_e.macroKeywordCode=o;function l(b,u){var v;const{gen:x,keyword:h,schema:p,parentSchema:a,$data:i,it:w}=b;y(w,u);const g=!i&&u.compile?u.compile.call(w.self,p,a,w):u.validate,_=d(x,h,g),E=x.let("valid");b.block$data(E,I),b.ok((v=u.valid)!==null&&v!==void 0?v:E);function I(){if(u.errors===!1)R(),u.modifying&&s(b),U(()=>b.error());else{const B=u.async?A():z();u.modifying&&s(b),U(()=>c(b,B))}}function A(){const B=x.let("ruleErrs",null);return x.try(()=>R((0,e._)`await `),G=>x.assign(E,!1).if((0,e._)`${G} instanceof ${w.ValidationError}`,()=>x.assign(B,(0,e._)`${G}.errors`),()=>x.throw(G))),B}function z(){const B=(0,e._)`${_}.errors`;return x.assign(B,null),R(e.nil),B}function R(B=u.async?(0,e._)`await `:e.nil){const G=w.opts.passContext?t.default.this:t.default.self,ae=!("compile"in u&&!i||u.schema===!1);x.assign(E,(0,e._)`${B}${(0,r.callValidateCode)(b,_,G,ae)}`,u.modifying)}function U(B){var G;x.if((0,e.not)((G=u.valid)!==null&&G!==void 0?G:E),B)}}_e.funcKeywordCode=l;function s(b){const{gen:u,data:v,it:x}=b;u.if(x.parentData,()=>u.assign(v,(0,e._)`${x.parentData}[${x.parentDataProperty}]`))}function c(b,u){const{gen:v}=b;v.if((0,e._)`Array.isArray(${u})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${u} : ${t.default.vErrors}.concat(${u})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(b)},()=>b.error())}function y({schemaEnv:b},u){if(u.async&&!b.$async)throw new Error("async keyword in sync schema")}function d(b,u,v){if(v===void 0)throw new Error(`keyword "${u}" failed to compile`);return b.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function m(b,u,v=!1){return!u.length||u.some(x=>x==="array"?Array.isArray(b):x==="object"?b&&typeof b=="object"&&!Array.isArray(b):typeof b==x||v&&typeof b>"u")}_e.validSchemaType=m;function P({schema:b,opts:u,self:v,errSchemaPath:x},h,p){if(Array.isArray(h.keyword)?!h.keyword.includes(p):h.keyword!==p)throw new Error("ajv implementation error");const a=h.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(b,i)))throw new Error(`parent schema must have dependencies of ${p}: ${a.join(",")}`);if(h.validateSchema&&!h.validateSchema(b[p])){const i=`keyword "${p}" value is invalid at path "${x}": `+v.errorsText(h.validateSchema.errors);if(u.validateSchema==="log")v.logger.error(i);else throw new Error(i)}}return _e.validateKeywordUsage=P,_e}var je={},En;function Wa(){if(En)return je;En=1,Object.defineProperty(je,"__esModule",{value:!0}),je.extendSubschemaMode=je.extendSubschemaData=je.getSubschema=void 0;const e=X(),t=re();function r(l,{keyword:s,schemaProp:c,schema:y,schemaPath:d,errSchemaPath:m,topSchemaRef:P}){if(s!==void 0&&y!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const b=l.schema[s];return c===void 0?{schema:b,schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${l.errSchemaPath}/${s}`}:{schema:b[c],schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(c)}`,errSchemaPath:`${l.errSchemaPath}/${s}/${(0,t.escapeFragment)(c)}`}}if(y!==void 0){if(d===void 0||m===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:y,schemaPath:d,topSchemaRef:P,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}je.getSubschema=r;function n(l,s,{dataProp:c,dataPropType:y,data:d,dataTypes:m,propertyName:P}){if(d!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=s;if(c!==void 0){const{errorPath:v,dataPathArr:x,opts:h}=s,p=b.let("data",(0,e._)`${s.data}${(0,e.getProperty)(c)}`,!0);u(p),l.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(c,y,h.jsPropertySyntax)}`,l.parentDataProperty=(0,e._)`${c}`,l.dataPathArr=[...x,l.parentDataProperty]}if(d!==void 0){const v=d instanceof e.Name?d:b.let("data",d,!0);u(v),P!==void 0&&(l.propertyName=P)}m&&(l.dataTypes=m);function u(v){l.data=v,l.dataLevel=s.dataLevel+1,l.dataTypes=[],s.definedProperties=new Set,l.parentData=s.data,l.dataNames=[...s.dataNames,v]}}je.extendSubschemaData=n;function o(l,{jtdDiscriminator:s,jtdMetadata:c,compositeRule:y,createErrors:d,allErrors:m}){y!==void 0&&(l.compositeRule=y),d!==void 0&&(l.createErrors=d),m!==void 0&&(l.allErrors=m),l.jtdDiscriminator=s,l.jtdMetadata=c}return je.extendSubschemaMode=o,je}var he={},xn,Pn;function kn(){return Pn||(Pn=1,xn=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,l;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(l=Object.keys(t),n=l.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,l[o]))return!1;for(o=n;o--!==0;){var s=l[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}),xn}var sr={exports:{}},Nn;function Ga(){if(Nn)return sr.exports;Nn=1;var e=sr.exports=function(n,o,l){typeof o=="function"&&(l=o,o={}),l=o.cb||l;var s=typeof l=="function"?l:l.pre||function(){},c=l.post||function(){};t(o,s,c,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,o,l,s,c,y,d,m,P,b){if(s&&typeof s=="object"&&!Array.isArray(s)){o(s,c,y,d,m,P,b);for(var u in s){var v=s[u];if(Array.isArray(v)){if(u in e.arrayKeywords)for(var x=0;x<v.length;x++)t(n,o,l,v[x],c+"/"+u+"/"+x,y,c,u,s,x)}else if(u in e.propsKeywords){if(v&&typeof v=="object")for(var h in v)t(n,o,l,v[h],c+"/"+u+"/"+r(h),y,c,u,s,h)}else(u in e.keywords||n.allKeys&&!(u in e.skipKeywords))&&t(n,o,l,v,c+"/"+u,y,c,u,s)}l(s,c,y,d,m,P,b)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return sr.exports}var jn;function lt(){if(jn)return he;jn=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const e=re(),t=kn(),r=Ga(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(x,h=!0){return typeof x=="boolean"?!0:h===!0?!s(x):h?c(x)<=h:!1}he.inlineRef=o;const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(x){for(const h in x){if(l.has(h))return!0;const p=x[h];if(Array.isArray(p)&&p.some(s)||typeof p=="object"&&s(p))return!0}return!1}function c(x){let h=0;for(const p in x)if(p==="$ref"||(h++,!n.has(p)&&(typeof x[p]=="object"&&(0,e.eachItem)(x[p],a=>h+=c(a)),h===1/0)))return 1/0;return h}function y(x,h="",p){p!==!1&&(h=P(h));const a=x.parse(h);return d(x,a)}he.getFullPath=y;function d(x,h){return x.serialize(h).split("#")[0]+"#"}he._getFullPath=d;const m=/#\/?$/;function P(x){return x?x.replace(m,""):""}he.normalizeId=P;function b(x,h,p){return p=P(p),x.resolve(h,p)}he.resolveUrl=b;const u=/^[a-z_][-a-z0-9._]*$/i;function v(x,h){if(typeof x=="boolean")return{};const{schemaId:p,uriResolver:a}=this.opts,i=P(x[p]||h),w={"":i},g=y(a,i,!1),_={},E=new Set;return r(x,{allKeys:!0},(z,R,U,B)=>{if(B===void 0)return;const G=g+R;let ae=w[B];typeof z[p]=="string"&&(ae=se.call(this,z[p])),de.call(this,z.$anchor),de.call(this,z.$dynamicAnchor),w[R]=ae;function se(ne){const pe=this.opts.uriResolver.resolve;if(ne=P(ae?pe(ae,ne):ne),E.has(ne))throw A(ne);E.add(ne);let L=this.refs[ne];return typeof L=="string"&&(L=this.refs[L]),typeof L=="object"?I(z,L.schema,ne):ne!==P(G)&&(ne[0]==="#"?(I(z,_[ne],ne),_[ne]=z):this.refs[ne]=G),ne}function de(ne){if(typeof ne=="string"){if(!u.test(ne))throw new Error(`invalid anchor "${ne}"`);se.call(this,`#${ne}`)}}}),_;function I(z,R,U){if(R!==void 0&&!t(z,R))throw A(U)}function A(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return he.getSchemaRefs=v,he}var On;function Qe(){if(On)return Pe;On=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.getData=Pe.KeywordCxt=Pe.validateFunctionCode=void 0;const e=Ua(),t=it(),r=bn(),n=it(),o=Ka(),l=Ba(),s=Wa(),c=X(),y=ke(),d=lt(),m=re(),P=Je();function b(N){if(g(N)&&(E(N),w(N))){h(N);return}u(N,()=>(0,e.topBoolOrEmptySchema)(N))}Pe.validateFunctionCode=b;function u({gen:N,validateName:j,schema:V,schemaEnv:D,opts:H},te){H.code.es5?N.func(j,(0,c._)`${y.default.data}, ${y.default.valCxt}`,D.$async,()=>{N.code((0,c._)`"use strict"; ${a(V,H)}`),x(N,H),N.code(te)}):N.func(j,(0,c._)`${y.default.data}, ${v(H)}`,D.$async,()=>N.code(a(V,H)).code(te))}function v(N){return(0,c._)`{${y.default.instancePath}="", ${y.default.parentData}, ${y.default.parentDataProperty}, ${y.default.rootData}=${y.default.data}${N.dynamicRef?(0,c._)`, ${y.default.dynamicAnchors}={}`:c.nil}}={}`}function x(N,j){N.if(y.default.valCxt,()=>{N.var(y.default.instancePath,(0,c._)`${y.default.valCxt}.${y.default.instancePath}`),N.var(y.default.parentData,(0,c._)`${y.default.valCxt}.${y.default.parentData}`),N.var(y.default.parentDataProperty,(0,c._)`${y.default.valCxt}.${y.default.parentDataProperty}`),N.var(y.default.rootData,(0,c._)`${y.default.valCxt}.${y.default.rootData}`),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`${y.default.valCxt}.${y.default.dynamicAnchors}`)},()=>{N.var(y.default.instancePath,(0,c._)`""`),N.var(y.default.parentData,(0,c._)`undefined`),N.var(y.default.parentDataProperty,(0,c._)`undefined`),N.var(y.default.rootData,y.default.data),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`{}`)})}function h(N){const{schema:j,opts:V,gen:D}=N;u(N,()=>{V.$comment&&j.$comment&&B(N),z(N),D.let(y.default.vErrors,null),D.let(y.default.errors,0),V.unevaluated&&p(N),I(N),G(N)})}function p(N){const{gen:j,validateName:V}=N;N.evaluated=j.const("evaluated",(0,c._)`${V}.evaluated`),j.if((0,c._)`${N.evaluated}.dynamicProps`,()=>j.assign((0,c._)`${N.evaluated}.props`,(0,c._)`undefined`)),j.if((0,c._)`${N.evaluated}.dynamicItems`,()=>j.assign((0,c._)`${N.evaluated}.items`,(0,c._)`undefined`))}function a(N,j){const V=typeof N=="object"&&N[j.schemaId];return V&&(j.code.source||j.code.process)?(0,c._)`/*# sourceURL=${V} */`:c.nil}function i(N,j){if(g(N)&&(E(N),w(N))){_(N,j);return}(0,e.boolOrEmptySchema)(N,j)}function w({schema:N,self:j}){if(typeof N=="boolean")return!N;for(const V in N)if(j.RULES.all[V])return!0;return!1}function g(N){return typeof N.schema!="boolean"}function _(N,j){const{schema:V,gen:D,opts:H}=N;H.$comment&&V.$comment&&B(N),R(N),U(N);const te=D.const("_errs",y.default.errors);I(N,te),D.var(j,(0,c._)`${te} === ${y.default.errors}`)}function E(N){(0,m.checkUnknownRules)(N),A(N)}function I(N,j){if(N.opts.jtd)return se(N,[],!1,j);const V=(0,t.getSchemaTypes)(N.schema),D=(0,t.coerceAndCheckDataType)(N,V);se(N,V,!D,j)}function A(N){const{schema:j,errSchemaPath:V,opts:D,self:H}=N;j.$ref&&D.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(j,H.RULES)&&H.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function z(N){const{schema:j,opts:V}=N;j.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,m.checkStrictMode)(N,"default is ignored in the schema root")}function R(N){const j=N.schema[N.opts.schemaId];j&&(N.baseId=(0,d.resolveUrl)(N.opts.uriResolver,N.baseId,j))}function U(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function B({gen:N,schemaEnv:j,schema:V,errSchemaPath:D,opts:H}){const te=V.$comment;if(H.$comment===!0)N.code((0,c._)`${y.default.self}.logger.log(${te})`);else if(typeof H.$comment=="function"){const le=(0,c.str)`${D}/$comment`,$e=N.scopeValue("root",{ref:j.root});N.code((0,c._)`${y.default.self}.opts.$comment(${te}, ${le}, ${$e}.schema)`)}}function G(N){const{gen:j,schemaEnv:V,validateName:D,ValidationError:H,opts:te}=N;V.$async?j.if((0,c._)`${y.default.errors} === 0`,()=>j.return(y.default.data),()=>j.throw((0,c._)`new ${H}(${y.default.vErrors})`)):(j.assign((0,c._)`${D}.errors`,y.default.vErrors),te.unevaluated&&ae(N),j.return((0,c._)`${y.default.errors} === 0`))}function ae({gen:N,evaluated:j,props:V,items:D}){V instanceof c.Name&&N.assign((0,c._)`${j}.props`,V),D instanceof c.Name&&N.assign((0,c._)`${j}.items`,D)}function se(N,j,V,D){const{gen:H,schema:te,data:le,allErrors:$e,opts:me,self:ye}=N,{RULES:ue}=ye;if(te.$ref&&(me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(te,ue))){H.block(()=>F(N,"$ref",ue.all.$ref.definition));return}me.jtd||ne(N,j),H.block(()=>{for(const be of ue.rules)Me(be);Me(ue.post)});function Me(be){(0,r.shouldUseGroup)(te,be)&&(be.type?(H.if((0,n.checkDataType)(be.type,le,me.strictNumbers)),de(N,be),j.length===1&&j[0]===be.type&&V&&(H.else(),(0,n.reportTypeError)(N)),H.endIf()):de(N,be),$e||H.if((0,c._)`${y.default.errors} === ${D||0}`))}}function de(N,j){const{gen:V,schema:D,opts:{useDefaults:H}}=N;H&&(0,o.assignDefaults)(N,j.type),V.block(()=>{for(const te of j.rules)(0,r.shouldUseRule)(D,te)&&F(N,te.keyword,te.definition,j.type)})}function ne(N,j){N.schemaEnv.meta||!N.opts.strictTypes||(pe(N,j),N.opts.allowUnionTypes||L(N,j),O(N,N.dataTypes))}function pe(N,j){if(j.length){if(!N.dataTypes.length){N.dataTypes=j;return}j.forEach(V=>{k(N.dataTypes,V)||S(N,`type "${V}" not allowed by context "${N.dataTypes.join(",")}"`)}),f(N,j)}}function L(N,j){j.length>1&&!(j.length===2&&j.includes("null"))&&S(N,"use allowUnionTypes to allow union type keyword")}function O(N,j){const V=N.self.RULES.all;for(const D in V){const H=V[D];if(typeof H=="object"&&(0,r.shouldUseRule)(N.schema,H)){const{type:te}=H.definition;te.length&&!te.some(le=>C(j,le))&&S(N,`missing type "${te.join(",")}" for keyword "${D}"`)}}}function C(N,j){return N.includes(j)||j==="number"&&N.includes("integer")}function k(N,j){return N.includes(j)||j==="integer"&&N.includes("number")}function f(N,j){const V=[];for(const D of N.dataTypes)k(j,D)?V.push(D):j.includes("integer")&&D==="number"&&V.push("integer");N.dataTypes=V}function S(N,j){const V=N.schemaEnv.baseId+N.errSchemaPath;j+=` at "${V}" (strictTypes)`,(0,m.checkStrictMode)(N,j,N.opts.strictTypes)}class T{constructor(j,V,D){if((0,l.validateKeywordUsage)(j,V,D),this.gen=j.gen,this.allErrors=j.allErrors,this.keyword=D,this.data=j.data,this.schema=j.schema[D],this.$data=V.$data&&j.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(j,this.schema,D,this.$data),this.schemaType=V.schemaType,this.parentSchema=j.schema,this.params={},this.it=j,this.def=V,this.$data)this.schemaCode=j.gen.const("vSchema",Y(this.$data,j));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=j.gen.const("_errs",y.default.errors))}result(j,V,D){this.failResult((0,c.not)(j),V,D)}failResult(j,V,D){this.gen.if(j),D?D():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(j,V){this.failResult((0,c.not)(j),void 0,V)}fail(j){if(j===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(j),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(j){if(!this.$data)return this.fail(j);const{schemaCode:V}=this;this.fail((0,c._)`${V} !== undefined && (${(0,c.or)(this.invalid$data(),j)})`)}error(j,V,D){if(V){this.setParams(V),this._error(j,D),this.setParams({});return}this._error(j,D)}_error(j,V){(j?P.reportExtraError:P.reportError)(this,this.def.error,V)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(j){this.allErrors||this.gen.if(j)}setParams(j,V){V?Object.assign(this.params,j):this.params=j}block$data(j,V,D=c.nil){this.gen.block(()=>{this.check$data(j,D),V()})}check$data(j=c.nil,V=c.nil){if(!this.$data)return;const{gen:D,schemaCode:H,schemaType:te,def:le}=this;D.if((0,c.or)((0,c._)`${H} === undefined`,V)),j!==c.nil&&D.assign(j,!0),(te.length||le.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),j!==c.nil&&D.assign(j,!1)),D.else()}invalid$data(){const{gen:j,schemaCode:V,schemaType:D,def:H,it:te}=this;return(0,c.or)(le(),$e());function le(){if(D.length){if(!(V instanceof c.Name))throw new Error("ajv implementation error");const me=Array.isArray(D)?D:[D];return(0,c._)`${(0,n.checkDataTypes)(me,V,te.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function $e(){if(H.validateSchema){const me=j.scopeValue("validate$data",{ref:H.validateSchema});return(0,c._)`!${me}(${V})`}return c.nil}}subschema(j,V){const D=(0,s.getSubschema)(this.it,j);(0,s.extendSubschemaData)(D,this.it,j),(0,s.extendSubschemaMode)(D,j);const H={...this.it,...D,items:void 0,props:void 0};return i(H,V),H}mergeEvaluated(j,V){const{it:D,gen:H}=this;D.opts.unevaluated&&(D.props!==!0&&j.props!==void 0&&(D.props=m.mergeEvaluated.props(H,j.props,D.props,V)),D.items!==!0&&j.items!==void 0&&(D.items=m.mergeEvaluated.items(H,j.items,D.items,V)))}mergeValidEvaluated(j,V){const{it:D,gen:H}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return H.if(V,()=>this.mergeEvaluated(j,c.Name)),!0}}Pe.KeywordCxt=T;function F(N,j,V,D){const H=new T(N,V,j);"code"in V?V.code(H,D):H.$data&&V.validate?(0,l.funcKeywordCode)(H,V):"macro"in V?(0,l.macroKeywordCode)(H,V):(V.compile||V.validate)&&(0,l.funcKeywordCode)(H,V)}const M=/^\/(?:[^~]|~0|~1)*$/,W=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(N,{dataLevel:j,dataNames:V,dataPathArr:D}){let H,te;if(N==="")return y.default.rootData;if(N[0]==="/"){if(!M.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);H=N,te=y.default.rootData}else{const ye=W.exec(N);if(!ye)throw new Error(`Invalid JSON-pointer: ${N}`);const ue=+ye[1];if(H=ye[2],H==="#"){if(ue>=j)throw new Error(me("property/index",ue));return D[j-ue]}if(ue>j)throw new Error(me("data",ue));if(te=V[j-ue],!H)return te}let le=te;const $e=H.split("/");for(const ye of $e)ye&&(te=(0,c._)`${te}${(0,c.getProperty)((0,m.unescapeJsonPointer)(ye))}`,le=(0,c._)`${le} && ${te}`);return le;function me(ye,ue){return`Cannot access ${ye} ${ue} levels up, current level is ${j}`}}return Pe.getData=Y,Pe}var ut={},Cn;function ir(){if(Cn)return ut;Cn=1,Object.defineProperty(ut,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return ut.default=e,ut}var ct={},Tn;function dt(){if(Tn)return ct;Tn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=lt();class t extends Error{constructor(n,o,l,s){super(s||`can't resolve reference ${l} from id ${o}`),this.missingRef=(0,e.resolveUrl)(n,o,l),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ct.default=t,ct}var ge={},In;function lr(){if(In)return ge;In=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.resolveSchema=ge.getCompilingSchema=ge.resolveRef=ge.compileSchema=ge.SchemaEnv=void 0;const e=X(),t=ir(),r=ke(),n=lt(),o=re(),l=Qe();class s{constructor(p){var a;this.refs={},this.dynamicAnchors={};let i;typeof p.schema=="object"&&(i=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(a=p.baseId)!==null&&a!==void 0?a:(0,n.normalizeId)(i?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=i?.$async,this.refs={}}}ge.SchemaEnv=s;function c(h){const p=m.call(this,h);if(p)return p;const a=(0,n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:i,lines:w}=this.opts.code,{ownProperties:g}=this.opts,_=new e.CodeGen(this.scope,{es5:i,lines:w,ownProperties:g});let E;h.$async&&(E=_.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");h.validateName=I;const A={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:h.schema,code:(0,e.stringify)(h.schema)}:{ref:h.schema}),validateName:I,ValidationError:E,schema:h.schema,schemaEnv:h,rootId:a,baseId:h.baseId||a,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(h),(0,l.validateFunctionCode)(A),_.optimize(this.opts.code.optimize);const R=_.toString();z=`${_.scopeRefs(r.default.scope)}return ${R}`,this.opts.code.process&&(z=this.opts.code.process(z,h));const U=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(I,{ref:U}),U.errors=null,U.schema=h.schema,U.schemaEnv=h,h.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:I,validateCode:R,scopeValues:_._values}),this.opts.unevaluated){const{props:B,items:G}=A;U.evaluated={props:B instanceof e.Name?void 0:B,items:G instanceof e.Name?void 0:G,dynamicProps:B instanceof e.Name,dynamicItems:G instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return h.validate=U,h}catch(R){throw delete h.validate,delete h.validateName,z&&this.logger.error("Error compiling schema, function code:",z),R}finally{this._compilations.delete(h)}}ge.compileSchema=c;function y(h,p,a){var i;a=(0,n.resolveUrl)(this.opts.uriResolver,p,a);const w=h.refs[a];if(w)return w;let g=b.call(this,h,a);if(g===void 0){const _=(i=h.localRefs)===null||i===void 0?void 0:i[a],{schemaId:E}=this.opts;_&&(g=new s({schema:_,schemaId:E,root:h,baseId:p}))}if(g!==void 0)return h.refs[a]=d.call(this,g)}ge.resolveRef=y;function d(h){return(0,n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function m(h){for(const p of this._compilations)if(P(p,h))return p}ge.getCompilingSchema=m;function P(h,p){return h.schema===p.schema&&h.root===p.root&&h.baseId===p.baseId}function b(h,p){let a;for(;typeof(a=this.refs[p])=="string";)p=a;return a||this.schemas[p]||u.call(this,h,p)}function u(h,p){const a=this.opts.uriResolver.parse(p),i=(0,n._getFullPath)(this.opts.uriResolver,a);let w=(0,n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&i===w)return x.call(this,a,h);const g=(0,n.normalizeId)(i),_=this.refs[g]||this.schemas[g];if(typeof _=="string"){const E=u.call(this,h,_);return typeof E?.schema!="object"?void 0:x.call(this,a,E)}if(typeof _?.schema=="object"){if(_.validate||c.call(this,_),g===(0,n.normalizeId)(p)){const{schema:E}=_,{schemaId:I}=this.opts,A=E[I];return A&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,A)),new s({schema:E,schemaId:I,root:h,baseId:w})}return x.call(this,a,_)}}ge.resolveSchema=u;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function x(h,{baseId:p,schema:a,root:i}){var w;if(((w=h.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(const E of h.fragment.slice(1).split("/")){if(typeof a=="boolean")return;const I=a[(0,o.unescapeFragment)(E)];if(I===void 0)return;a=I;const A=typeof a=="object"&&a[this.opts.schemaId];!v.has(E)&&A&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,A))}let g;if(typeof a!="boolean"&&a.$ref&&!(0,o.schemaHasRulesButRef)(a,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,p,a.$ref);g=u.call(this,i,E)}const{schemaId:_}=this.opts;if(g=g||new s({schema:a,schemaId:_,root:i,baseId:p}),g.schema!==g.root.schema)return g}return ge}const Ha="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ja="Meta-schema for $data reference (JSON AnySchema extension proposal)",Za="object",Qa=["$data"],Ya={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Xa=!1,es={$id:Ha,description:Ja,type:Za,required:Qa,properties:Ya,additionalProperties:Xa};var pt={},Ye={exports:{}},ur,Vn;function Rn(){if(Vn)return ur;Vn=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(b){let u="",v=0,x=0;for(x=0;x<b.length;x++)if(v=b[x].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[x];break}for(x+=1;x<b.length;x++){if(v=b[x].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[x]}return u}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(b){return b.length=0,!0}function l(b,u,v){if(b.length){const x=r(b);if(x!=="")u.push(x);else return v.error=!0,!1;b.length=0}return!0}function s(b){let u=0;const v={error:!1,address:"",zone:""},x=[],h=[];let p=!1,a=!1,i=l;for(let w=0;w<b.length;w++){const g=b[w];if(!(g==="["||g==="]"))if(g===":"){if(p===!0&&(a=!0),!i(h,x,v))break;if(++u>7){v.error=!0;break}w>0&&b[w-1]===":"&&(p=!0),x.push(":");continue}else if(g==="%"){if(!i(h,x,v))break;i=o}else{h.push(g);continue}}return h.length&&(i===o?v.zone=h.join(""):a?x.push(h.join("")):x.push(r(h))),v.address=x.join(""),v}function c(b){if(y(b,":")<2)return{host:b,isIPV6:!1};const u=s(b);if(u.error)return{host:b,isIPV6:!1};{let v=u.address,x=u.address;return u.zone&&(v+="%"+u.zone,x+="%25"+u.zone),{host:v,isIPV6:!0,escapedHost:x}}}function y(b,u){let v=0;for(let x=0;x<b.length;x++)b[x]===u&&v++;return v}function d(b){let u=b;const v=[];let x=-1,h=0;for(;h=u.length;){if(h===1){if(u===".")break;if(u==="/"){v.push("/");break}else{v.push(u);break}}else if(h===2){if(u[0]==="."){if(u[1]===".")break;if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&(u[1]==="."||u[1]==="/")){v.push("/");break}}else if(h===3&&u==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(u[0]==="."){if(u[1]==="."){if(u[2]==="/"){u=u.slice(3);continue}}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&u[1]==="."){if(u[2]==="/"){u=u.slice(2);continue}else if(u[2]==="."&&u[3]==="/"){u=u.slice(3),v.length!==0&&v.pop();continue}}if((x=u.indexOf("/",1))===-1){v.push(u);break}else v.push(u.slice(0,x)),u=u.slice(x)}return v.join("")}function m(b,u){const v=u!==!0?escape:unescape;return b.scheme!==void 0&&(b.scheme=v(b.scheme)),b.userinfo!==void 0&&(b.userinfo=v(b.userinfo)),b.host!==void 0&&(b.host=v(b.host)),b.path!==void 0&&(b.path=v(b.path)),b.query!==void 0&&(b.query=v(b.query)),b.fragment!==void 0&&(b.fragment=v(b.fragment)),b}function P(b){const u=[];if(b.userinfo!==void 0&&(u.push(b.userinfo),u.push("@")),b.host!==void 0){let v=unescape(b.host);if(!t(v)){const x=c(v);x.isIPV6===!0?v=`[${x.escapedHost}]`:v=b.host}u.push(v)}return(typeof b.port=="number"||typeof b.port=="string")&&(u.push(":"),u.push(String(b.port))),u.length?u.join(""):void 0}return ur={nonSimpleDomain:n,recomposeAuthority:P,normalizeComponentEncoding:m,removeDotSegments:d,isIPv4:t,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:r},ur}var cr,Ln;function ts(){if(Ln)return cr;Ln=1;const{isUUID:e}=Rn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(i){return r.indexOf(i)!==-1}function o(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function l(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function s(i){const w=String(i.scheme).toLowerCase()==="https";return(i.port===(w?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function c(i){return i.secure=o(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function y(i){if((i.port===(o(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[w,g]=i.resourceName.split("?");i.path=w&&w!=="/"?w:void 0,i.query=g,i.resourceName=void 0}return i.fragment=void 0,i}function d(i,w){if(!i.path)return i.error="URN can not be parsed",i;const g=i.path.match(t);if(g){const _=w.scheme||i.scheme||"urn";i.nid=g[1].toLowerCase(),i.nss=g[2];const E=`${_}:${w.nid||i.nid}`,I=a(E);i.path=void 0,I&&(i=I.parse(i,w))}else i.error=i.error||"URN can not be parsed.";return i}function m(i,w){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const g=w.scheme||i.scheme||"urn",_=i.nid.toLowerCase(),E=`${g}:${w.nid||_}`,I=a(E);I&&(i=I.serialize(i,w));const A=i,z=i.nss;return A.path=`${_||w.nid}:${z}`,w.skipEscape=!0,A}function P(i,w){const g=i;return g.uuid=g.nss,g.nss=void 0,!w.tolerant&&(!g.uuid||!e(g.uuid))&&(g.error=g.error||"UUID is not valid."),g}function b(i){const w=i;return w.nss=(i.uuid||"").toLowerCase(),w}const u={scheme:"http",domainHost:!0,parse:l,serialize:s},v={scheme:"https",domainHost:u.domainHost,parse:l,serialize:s},x={scheme:"ws",domainHost:!0,parse:c,serialize:y},h={scheme:"wss",domainHost:x.domainHost,parse:x.parse,serialize:x.serialize},p={http:u,https:v,ws:x,wss:h,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:b,skipNormalize:!0}};Object.setPrototypeOf(p,null);function a(i){return i&&(p[i]||p[i.toLowerCase()])||void 0}return cr={wsIsSecure:o,SCHEMES:p,isValidSchemeName:n,getSchemeHandler:a},cr}var Mn;function rs(){if(Mn)return Ye.exports;Mn=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:o,nonSimpleDomain:l}=Rn(),{SCHEMES:s,getSchemeHandler:c}=ts();function y(h,p){return typeof h=="string"?h=b(v(h,p),p):typeof h=="object"&&(h=v(b(h,p),p)),h}function d(h,p,a){const i=a?Object.assign({scheme:"null"},a):{scheme:"null"},w=m(v(h,i),v(p,i),i,!0);return i.skipEscape=!0,b(w,i)}function m(h,p,a,i){const w={};return i||(h=v(b(h,a),a),p=v(b(p,a),a)),a=a||{},!a.tolerant&&p.scheme?(w.scheme=p.scheme,w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.path?(p.path[0]==="/"?w.path=t(p.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?w.path="/"+p.path:h.path?w.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+p.path:w.path=p.path,w.path=t(w.path)),w.query=p.query):(w.path=h.path,p.query!==void 0?w.query=p.query:w.query=h.query),w.userinfo=h.userinfo,w.host=h.host,w.port=h.port),w.scheme=h.scheme),w.fragment=p.fragment,w}function P(h,p,a){return typeof h=="string"?(h=unescape(h),h=b(n(v(h,a),!0),{...a,skipEscape:!0})):typeof h=="object"&&(h=b(n(h,!0),{...a,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=b(n(v(p,a),!0),{...a,skipEscape:!0})):typeof p=="object"&&(p=b(n(p,!0),{...a,skipEscape:!0})),h.toLowerCase()===p.toLowerCase()}function b(h,p){const a={host:h.host,scheme:h.scheme,userinfo:h.userinfo,port:h.port,path:h.path,query:h.query,nid:h.nid,nss:h.nss,uuid:h.uuid,fragment:h.fragment,reference:h.reference,resourceName:h.resourceName,secure:h.secure,error:""},i=Object.assign({},p),w=[],g=c(i.scheme||a.scheme);g&&g.serialize&&g.serialize(a,i),a.path!==void 0&&(i.skipEscape?a.path=unescape(a.path):(a.path=escape(a.path),a.scheme!==void 0&&(a.path=a.path.split("%3A").join(":")))),i.reference!=="suffix"&&a.scheme&&w.push(a.scheme,":");const _=r(a);if(_!==void 0&&(i.reference!=="suffix"&&w.push("//"),w.push(_),a.path&&a.path[0]!=="/"&&w.push("/")),a.path!==void 0){let E=a.path;!i.absolutePath&&(!g||!g.absolutePath)&&(E=t(E)),_===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),w.push(E)}return a.query!==void 0&&w.push("?",a.query),a.fragment!==void 0&&w.push("#",a.fragment),w.join("")}const u=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(h,p){const a=Object.assign({},p),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let w=!1;a.reference==="suffix"&&(a.scheme?h=a.scheme+":"+h:h="//"+h);const g=h.match(u);if(g){if(i.scheme=g[1],i.userinfo=g[3],i.host=g[4],i.port=parseInt(g[5],10),i.path=g[6]||"",i.query=g[7],i.fragment=g[8],isNaN(i.port)&&(i.port=g[5]),i.host)if(o(i.host)===!1){const E=e(i.host);i.host=E.host.toLowerCase(),w=E.isIPV6}else w=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",a.reference&&a.reference!=="suffix"&&a.reference!==i.reference&&(i.error=i.error||"URI is not a "+a.reference+" reference.");const _=c(a.scheme||i.scheme);if(!a.unicodeSupport&&(!_||!_.unicodeSupport)&&i.host&&(a.domainHost||_&&_.domainHost)&&w===!1&&l(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(E){i.error=i.error||"Host's domain name can not be converted to ASCII: "+E}(!_||_&&!_.skipNormalize)&&(h.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),_&&_.parse&&_.parse(i,a)}else i.error=i.error||"URI can not be parsed.";return i}const x={SCHEMES:s,normalize:y,resolve:d,resolveComponent:m,equal:P,serialize:b,parse:v};return Ye.exports=x,Ye.exports.default=x,Ye.exports.fastUri=x,Ye.exports}var An;function ns(){if(An)return pt;An=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=rs();return e.code='require("ajv/dist/runtime/uri").default',pt.default=e,pt}var qn;function os(){return qn||(qn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Qe();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=X();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ir(),o=dt(),l=vn(),s=lr(),c=X(),y=lt(),d=it(),m=re(),P=es,b=ns(),u=(L,O)=>new RegExp(L,O);u.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],x=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},a=200;function i(L){var O,C,k,f,S,T,F,M,W,Y,N,j,V,D,H,te,le,$e,me,ye,ue,Me,be,Gt,Ht;const Ue=L.strict,Jt=(O=L.code)===null||O===void 0?void 0:O.optimize,br=Jt===!0||Jt===void 0?1:Jt||0,$r=(k=(C=L.code)===null||C===void 0?void 0:C.regExp)!==null&&k!==void 0?k:u,Xo=(f=L.uriResolver)!==null&&f!==void 0?f:b.default;return{strictSchema:(T=(S=L.strictSchema)!==null&&S!==void 0?S:Ue)!==null&&T!==void 0?T:!0,strictNumbers:(M=(F=L.strictNumbers)!==null&&F!==void 0?F:Ue)!==null&&M!==void 0?M:!0,strictTypes:(Y=(W=L.strictTypes)!==null&&W!==void 0?W:Ue)!==null&&Y!==void 0?Y:"log",strictTuples:(j=(N=L.strictTuples)!==null&&N!==void 0?N:Ue)!==null&&j!==void 0?j:"log",strictRequired:(D=(V=L.strictRequired)!==null&&V!==void 0?V:Ue)!==null&&D!==void 0?D:!1,code:L.code?{...L.code,optimize:br,regExp:$r}:{optimize:br,regExp:$r},loopRequired:(H=L.loopRequired)!==null&&H!==void 0?H:a,loopEnum:(te=L.loopEnum)!==null&&te!==void 0?te:a,meta:(le=L.meta)!==null&&le!==void 0?le:!0,messages:($e=L.messages)!==null&&$e!==void 0?$e:!0,inlineRefs:(me=L.inlineRefs)!==null&&me!==void 0?me:!0,schemaId:(ye=L.schemaId)!==null&&ye!==void 0?ye:"$id",addUsedSchema:(ue=L.addUsedSchema)!==null&&ue!==void 0?ue:!0,validateSchema:(Me=L.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(be=L.validateFormats)!==null&&be!==void 0?be:!0,unicodeRegExp:(Gt=L.unicodeRegExp)!==null&&Gt!==void 0?Gt:!0,int32range:(Ht=L.int32range)!==null&&Ht!==void 0?Ht:!0,uriResolver:Xo}}class w{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...i(O)};const{es5:C,lines:k}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:x,es5:C,lines:k}),this.logger=U(O.logger);const f=O.validateFormats;O.validateFormats=!1,this.RULES=(0,l.getRules)(),g.call(this,h,O,"NOT SUPPORTED"),g.call(this,p,O,"DEPRECATED","warn"),this._metaOpts=z.call(this),O.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&A.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:k}=this.opts;let f=P;k==="id"&&(f={...P},f.id=f.$id,delete f.$id),C&&O&&this.addMetaSchema(f,f[k],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let k;if(typeof O=="string"){if(k=this.getSchema(O),!k)throw new Error(`no schema with key or ref "${O}"`)}else k=this.compile(O);const f=k(C);return"$async"in k||(this.errors=k.errors),f}compile(O,C){const k=this._addSchema(O,C);return k.validate||this._compileSchemaEnv(k)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:k}=this.opts;return f.call(this,O,C);async function f(Y,N){await S.call(this,Y.$schema);const j=this._addSchema(Y,N);return j.validate||T.call(this,j)}async function S(Y){Y&&!this.getSchema(Y)&&await f.call(this,{$ref:Y},!0)}async function T(Y){try{return this._compileSchemaEnv(Y)}catch(N){if(!(N instanceof o.default))throw N;return F.call(this,N),await M.call(this,N.missingSchema),T.call(this,Y)}}function F({missingSchema:Y,missingRef:N}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${N} cannot be resolved`)}async function M(Y){const N=await W.call(this,Y);this.refs[Y]||await S.call(this,N.$schema),this.refs[Y]||this.addSchema(N,Y,C)}async function W(Y){const N=this._loading[Y];if(N)return N;try{return await(this._loading[Y]=k(Y))}finally{delete this._loading[Y]}}}addSchema(O,C,k,f=this.opts.validateSchema){if(Array.isArray(O)){for(const T of O)this.addSchema(T,void 0,k,f);return this}let S;if(typeof O=="object"){const{schemaId:T}=this.opts;if(S=O[T],S!==void 0&&typeof S!="string")throw new Error(`schema ${T} must be string`)}return C=(0,y.normalizeId)(C||S),this._checkUnique(C),this.schemas[C]=this._addSchema(O,k,C,f,!0),this}addMetaSchema(O,C,k=this.opts.validateSchema){return this.addSchema(O,C,!0,k),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let k;if(k=O.$schema,k!==void 0&&typeof k!="string")throw new Error("$schema must be a string");if(k=k||this.opts.defaultMeta||this.defaultMeta(),!k)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(k,O);if(!f&&C){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return f}getSchema(O){let C;for(;typeof(C=_.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:k}=this.opts,f=new s.SchemaEnv({schema:{},schemaId:k});if(C=s.resolveSchema.call(this,f,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=_.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let k=O[this.opts.schemaId];return k&&(k=(0,y.normalizeId)(k),delete this.schemas[k],delete this.refs[k]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let k;if(typeof O=="string")k=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=k);else if(typeof O=="object"&&C===void 0){if(C=O,k=C.keyword,Array.isArray(k)&&!k.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,k,C),!C)return(0,m.eachItem)(k,S=>ae.call(this,S)),this;de.call(this,C);const f={...C,type:(0,d.getJSONTypes)(C.type),schemaType:(0,d.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(k,f.type.length===0?S=>ae.call(this,S,f):S=>f.type.forEach(T=>ae.call(this,S,f,T))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const k of C.rules){const f=k.rules.findIndex(S=>S.keyword===O);f>=0&&k.rules.splice(f,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:k="data"}={}){return!O||O.length===0?"No errors":O.map(f=>`${k}${f.instancePath} ${f.message}`).reduce((f,S)=>f+C+S)}$dataMetaSchema(O,C){const k=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const f of C){const S=f.split("/").slice(1);let T=O;for(const F of S)T=T[F];for(const F in k){const M=k[F];if(typeof M!="object")continue;const{$data:W}=M.definition,Y=T[F];W&&Y&&(T[F]=pe(Y))}}return O}_removeAllSchemas(O,C){for(const k in O){const f=O[k];(!C||C.test(k))&&(typeof f=="string"?delete O[k]:f&&!f.meta&&(this._cache.delete(f.schema),delete O[k]))}}_addSchema(O,C,k,f=this.opts.validateSchema,S=this.opts.addUsedSchema){let T;const{schemaId:F}=this.opts;if(typeof O=="object")T=O[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get(O);if(M!==void 0)return M;k=(0,y.normalizeId)(T||k);const W=y.getSchemaRefs.call(this,O,k);return M=new s.SchemaEnv({schema:O,schemaId:F,meta:C,baseId:k,localRefs:W}),this._cache.set(M.schema,M),S&&!k.startsWith("#")&&(k&&this._checkUnique(k),this.refs[k]=M),f&&this.validateSchema(O,!0),M}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):s.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,O)}finally{this.opts=C}}}w.ValidationError=n.default,w.MissingRefError=o.default,e.default=w;function g(L,O,C,k="error"){for(const f in L){const S=f;S in O&&this.logger[k](`${C}: option ${f}. ${L[S]}`)}}function _(L){return L=(0,y.normalizeId)(L),this.schemas[L]||this.refs[L]}function E(){const L=this.opts.schemas;if(L)if(Array.isArray(L))this.addSchema(L);else for(const O in L)this.addSchema(L[O],O)}function I(){for(const L in this.opts.formats){const O=this.opts.formats[L];O&&this.addFormat(L,O)}}function A(L){if(Array.isArray(L)){this.addVocabulary(L);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in L){const C=L[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function z(){const L={...this.opts};for(const O of v)delete L[O];return L}const R={log(){},warn(){},error(){}};function U(L){if(L===!1)return R;if(L===void 0)return console;if(L.log&&L.warn&&L.error)return L;throw new Error("logger must implement log, warn and error methods")}const B=/^[a-z_$][a-z0-9_$:-]*$/i;function G(L,O){const{RULES:C}=this;if((0,m.eachItem)(L,k=>{if(C.keywords[k])throw new Error(`Keyword ${k} is already defined`);if(!B.test(k))throw new Error(`Keyword ${k} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function ae(L,O,C){var k;const f=O?.post;if(C&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let T=f?S.post:S.rules.find(({type:M})=>M===C);if(T||(T={type:C,rules:[]},S.rules.push(T)),S.keywords[L]=!0,!O)return;const F={keyword:L,definition:{...O,type:(0,d.getJSONTypes)(O.type),schemaType:(0,d.getJSONTypes)(O.schemaType)}};O.before?se.call(this,T,F,O.before):T.rules.push(F),S.all[L]=F,(k=O.implements)===null||k===void 0||k.forEach(M=>this.addKeyword(M))}function se(L,O,C){const k=L.rules.findIndex(f=>f.keyword===C);k>=0?L.rules.splice(k,0,O):(L.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function de(L){let{metaSchema:O}=L;O!==void 0&&(L.$data&&this.opts.$data&&(O=pe(O)),L.validateSchema=this.compile(O,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(L){return{anyOf:[L,ne]}}})(rn)),rn}var ft={},ht={},mt={},Dn;function as(){if(Dn)return mt;Dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return mt.default=e,mt}var Ce={},zn;function ss(){if(zn)return Ce;zn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.callRef=Ce.getValidate=void 0;const e=dt(),t=Se(),r=X(),n=ke(),o=lr(),l=re(),s={keyword:"$ref",schemaType:"string",code(d){const{gen:m,schema:P,it:b}=d,{baseId:u,schemaEnv:v,validateName:x,opts:h,self:p}=b,{root:a}=v;if((P==="#"||P==="#/")&&u===a.baseId)return w();const i=o.resolveRef.call(p,a,u,P);if(i===void 0)throw new e.default(b.opts.uriResolver,u,P);if(i instanceof o.SchemaEnv)return g(i);return _(i);function w(){if(v===a)return y(d,x,v,v.$async);const E=m.scopeValue("root",{ref:a});return y(d,(0,r._)`${E}.validate`,a,a.$async)}function g(E){const I=c(d,E);y(d,I,E,E.$async)}function _(E){const I=m.scopeValue("schema",h.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),A=m.name("valid"),z=d.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:P},A);d.mergeEvaluated(z),d.ok(A)}}};function c(d,m){const{gen:P}=d;return m.validate?P.scopeValue("validate",{ref:m.validate}):(0,r._)`${P.scopeValue("wrapper",{ref:m})}.validate`}Ce.getValidate=c;function y(d,m,P,b){const{gen:u,it:v}=d,{allErrors:x,schemaEnv:h,opts:p}=v,a=p.passContext?n.default.this:r.nil;b?i():w();function i(){if(!h.$async)throw new Error("async schema referenced by sync schema");const E=u.let("valid");u.try(()=>{u.code((0,r._)`await ${(0,t.callValidateCode)(d,m,a)}`),_(m),x||u.assign(E,!0)},I=>{u.if((0,r._)`!(${I} instanceof ${v.ValidationError})`,()=>u.throw(I)),g(I),x||u.assign(E,!1)}),d.ok(E)}function w(){d.result((0,t.callValidateCode)(d,m,a),()=>_(m),()=>g(m))}function g(E){const I=(0,r._)`${E}.errors`;u.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),u.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(E){var I;if(!v.opts.unevaluated)return;const A=(I=P?.validate)===null||I===void 0?void 0:I.evaluated;if(v.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(v.props=l.mergeEvaluated.props(u,A.props,v.props));else{const z=u.var("props",(0,r._)`${E}.evaluated.props`);v.props=l.mergeEvaluated.props(u,z,v.props,r.Name)}if(v.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(v.items=l.mergeEvaluated.items(u,A.items,v.items));else{const z=u.var("items",(0,r._)`${E}.evaluated.items`);v.items=l.mergeEvaluated.items(u,z,v.items,r.Name)}}}return Ce.callRef=y,Ce.default=s,Ce}var Fn;function is(){if(Fn)return ht;Fn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=as(),t=ss(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ht.default=r,ht}var yt={},vt={},Un;function ls(){if(Un)return vt;Un=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=X(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:l,schemaCode:s})=>(0,e.str)`must be ${r[l].okStr} ${s}`,params:({keyword:l,schemaCode:s})=>(0,e._)`{comparison: ${r[l].okStr}, limit: ${s}}`},o={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(l){const{keyword:s,data:c,schemaCode:y}=l;l.fail$data((0,e._)`${c} ${r[s].fail} ${y} || isNaN(${c})`)}};return vt.default=o,vt}var gt={},Kn;function us(){if(Kn)return gt;Kn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=X(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:n,data:o,schemaCode:l,it:s}=r,c=s.opts.multipleOfPrecision,y=n.let("res"),d=c?(0,e._)`Math.abs(Math.round(${y}) - ${y}) > 1e-${c}`:(0,e._)`${y} !== parseInt(${y})`;r.fail$data((0,e._)`(${l} === 0 || (${y} = ${o}/${l}, ${d}))`)}};return gt.default=t,gt}var bt={},$t={},Bn;function cs(){if(Bn)return $t;Bn=1,Object.defineProperty($t,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,o=0,l;for(;o<r;)n++,l=t.charCodeAt(o++),l>=55296&&l<=56319&&o<r&&(l=t.charCodeAt(o),(l&64512)===56320&&o++);return n}return $t.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',$t}var Wn;function ds(){if(Wn)return bt;Wn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=X(),t=re(),r=cs(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:l}){const s=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${l} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:l,data:s,schemaCode:c,it:y}=o,d=l==="maxLength"?e.operators.GT:e.operators.LT,m=y.opts.unicode===!1?(0,e._)`${s}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${s})`;o.fail$data((0,e._)`${m} ${d} ${c}`)}};return bt.default=n,bt}var wt={},Gn;function ps(){if(Gn)return wt;Gn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Se(),t=re(),r=X(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:l,data:s,$data:c,schema:y,schemaCode:d,it:m}=o,P=m.opts.unicodeRegExp?"u":"";if(c){const{regExp:b}=m.opts.code,u=b.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(l,b),v=l.let("valid");l.try(()=>l.assign(v,(0,r._)`${u}(${d}, ${P}).test(${s})`),()=>l.assign(v,!1)),o.fail$data((0,r._)`!${v}`)}else{const b=(0,e.usePattern)(o,y);o.fail$data((0,r._)`!${b}.test(${s})`)}}};return wt.default=n,wt}var _t={},Hn;function fs(){if(Hn)return _t;Hn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=X(),t={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,s=n==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${o}).length ${s} ${l}`)}};return _t.default=t,_t}var St={},Jn;function hs(){if(Jn)return St;Jn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=Se(),t=X(),r=re(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:l,schema:s,schemaCode:c,data:y,$data:d,it:m}=o,{opts:P}=m;if(!d&&s.length===0)return;const b=s.length>=P.loopRequired;if(m.allErrors?u():v(),P.strictRequired){const p=o.parentSchema.properties,{definedProperties:a}=o.it;for(const i of s)if(p?.[i]===void 0&&!a.has(i)){const w=m.schemaEnv.baseId+m.errSchemaPath,g=`required property "${i}" is not defined at "${w}" (strictRequired)`;(0,r.checkStrictMode)(m,g,m.opts.strictRequired)}}function u(){if(b||d)o.block$data(t.nil,x);else for(const p of s)(0,e.checkReportMissingProp)(o,p)}function v(){const p=l.let("missing");if(b||d){const a=l.let("valid",!0);o.block$data(a,()=>h(p,a)),o.ok(a)}else l.if((0,e.checkMissingProp)(o,s,p)),(0,e.reportMissingProp)(o,p),l.else()}function x(){l.forOf("prop",c,p=>{o.setParams({missingProperty:p}),l.if((0,e.noPropertyInData)(l,y,p,P.ownProperties),()=>o.error())})}function h(p,a){o.setParams({missingProperty:p}),l.forOf(p,c,()=>{l.assign(a,(0,e.propertyInData)(l,y,p,P.ownProperties)),l.if((0,t.not)(a),()=>{o.error(),l.break()})},t.nil)}}};return St.default=n,St}var Et={},Zn;function ms(){if(Zn)return Et;Zn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=X(),t={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,s=n==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${o}.length ${s} ${l}`)}};return Et.default=t,Et}var xt={},Pt={},Qn;function dr(){if(Qn)return Pt;Qn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=kn();return e.code='require("ajv/dist/runtime/equal").default',Pt.default=e,Pt}var Yn;function ys(){if(Yn)return xt;Yn=1,Object.defineProperty(xt,"__esModule",{value:!0});const e=it(),t=X(),r=re(),n=dr(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:s}})=>(0,t.str)`must NOT have duplicate items (items ## ${s} and ${l} are identical)`,params:({params:{i:l,j:s}})=>(0,t._)`{i: ${l}, j: ${s}}`},code(l){const{gen:s,data:c,$data:y,schema:d,parentSchema:m,schemaCode:P,it:b}=l;if(!y&&!d)return;const u=s.let("valid"),v=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(u,x,(0,t._)`${P} === false`),l.ok(u);function x(){const i=s.let("i",(0,t._)`${c}.length`),w=s.let("j");l.setParams({i,j:w}),s.assign(u,!0),s.if((0,t._)`${i} > 1`,()=>(h()?p:a)(i,w))}function h(){return v.length>0&&!v.some(i=>i==="object"||i==="array")}function p(i,w){const g=s.name("item"),_=(0,e.checkDataTypes)(v,g,b.opts.strictNumbers,e.DataType.Wrong),E=s.const("indices",(0,t._)`{}`);s.for((0,t._)`;${i}--;`,()=>{s.let(g,(0,t._)`${c}[${i}]`),s.if(_,(0,t._)`continue`),v.length>1&&s.if((0,t._)`typeof ${g} == "string"`,(0,t._)`${g} += "_"`),s.if((0,t._)`typeof ${E}[${g}] == "number"`,()=>{s.assign(w,(0,t._)`${E}[${g}]`),l.error(),s.assign(u,!1).break()}).code((0,t._)`${E}[${g}] = ${i}`)})}function a(i,w){const g=(0,r.useFunc)(s,n.default),_=s.name("outer");s.label(_).for((0,t._)`;${i}--;`,()=>s.for((0,t._)`${w} = ${i}; ${w}--;`,()=>s.if((0,t._)`${g}(${c}[${i}], ${c}[${w}])`,()=>{l.error(),s.assign(u,!1).break(_)})))}}};return xt.default=o,xt}var kt={},Xn;function vs(){if(Xn)return kt;Xn=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=X(),t=re(),r=dr(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:l,data:s,$data:c,schemaCode:y,schema:d}=o;c||d&&typeof d=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(l,r.default)}(${s}, ${y})`):o.fail((0,e._)`${d} !== ${s}`)}};return kt.default=n,kt}var Nt={},eo;function gs(){if(eo)return Nt;eo=1,Object.defineProperty(Nt,"__esModule",{value:!0});const e=X(),t=re(),r=dr(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:l,data:s,$data:c,schema:y,schemaCode:d,it:m}=o;if(!c&&y.length===0)throw new Error("enum must have non-empty array");const P=y.length>=m.opts.loopEnum;let b;const u=()=>b??(b=(0,t.useFunc)(l,r.default));let v;if(P||c)v=l.let("valid"),o.block$data(v,x);else{if(!Array.isArray(y))throw new Error("ajv implementation error");const p=l.const("vSchema",d);v=(0,e.or)(...y.map((a,i)=>h(p,i)))}o.pass(v);function x(){l.assign(v,!1),l.forOf("v",d,p=>l.if((0,e._)`${u()}(${s}, ${p})`,()=>l.assign(v,!0).break()))}function h(p,a){const i=y[a];return typeof i=="object"&&i!==null?(0,e._)`${u()}(${s}, ${p}[${a}])`:(0,e._)`${s} === ${i}`}}};return Nt.default=n,Nt}var to;function bs(){if(to)return yt;to=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=ls(),t=us(),r=ds(),n=ps(),o=fs(),l=hs(),s=ms(),c=ys(),y=vs(),d=gs(),m=[e.default,t.default,r.default,n.default,o.default,l.default,s.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},y.default,d.default];return yt.default=m,yt}var jt={},De={},ro;function no(){if(ro)return De;ro=1,Object.defineProperty(De,"__esModule",{value:!0}),De.validateAdditionalItems=void 0;const e=X(),t=re(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:l,it:s}=o,{items:c}=l;if(!Array.isArray(c)){(0,t.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(o,c)}};function n(o,l){const{gen:s,schema:c,data:y,keyword:d,it:m}=o;m.items=!0;const P=s.const("len",(0,e._)`${y}.length`);if(c===!1)o.setParams({len:l.length}),o.pass((0,e._)`${P} <= ${l.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(m,c)){const u=s.var("valid",(0,e._)`${P} <= ${l.length}`);s.if((0,e.not)(u),()=>b(u)),o.ok(u)}function b(u){s.forRange("i",l.length,P,v=>{o.subschema({keyword:d,dataProp:v,dataPropType:t.Type.Num},u),m.allErrors||s.if((0,e.not)(u),()=>s.break())})}}return De.validateAdditionalItems=n,De.default=r,De}var Ot={},ze={},oo;function ao(){if(oo)return ze;oo=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.validateTuple=void 0;const e=X(),t=re(),r=Se(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(l){const{schema:s,it:c}=l;if(Array.isArray(s))return o(l,"additionalItems",s);c.items=!0,!(0,t.alwaysValidSchema)(c,s)&&l.ok((0,r.validateArray)(l))}};function o(l,s,c=l.schema){const{gen:y,parentSchema:d,data:m,keyword:P,it:b}=l;x(d),b.opts.unevaluated&&c.length&&b.items!==!0&&(b.items=t.mergeEvaluated.items(y,c.length,b.items));const u=y.name("valid"),v=y.const("len",(0,e._)`${m}.length`);c.forEach((h,p)=>{(0,t.alwaysValidSchema)(b,h)||(y.if((0,e._)`${v} > ${p}`,()=>l.subschema({keyword:P,schemaProp:p,dataProp:p},u)),l.ok(u))});function x(h){const{opts:p,errSchemaPath:a}=b,i=c.length,w=i===h.minItems&&(i===h.maxItems||h[s]===!1);if(p.strictTuples&&!w){const g=`"${P}" is ${i}-tuple, but minItems or maxItems/${s} are not specified or different at path "${a}"`;(0,t.checkStrictMode)(b,g,p.strictTuples)}}}return ze.validateTuple=o,ze.default=n,ze}var so;function $s(){if(so)return Ot;so=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=ao(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Ot.default=t,Ot}var Ct={},io;function ws(){if(io)return Ct;io=1,Object.defineProperty(Ct,"__esModule",{value:!0});const e=X(),t=re(),r=Se(),n=no(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:s,parentSchema:c,it:y}=l,{prefixItems:d}=c;y.items=!0,!(0,t.alwaysValidSchema)(y,s)&&(d?(0,n.validateAdditionalItems)(l,d):l.ok((0,r.validateArray)(l)))}};return Ct.default=o,Ct}var Tt={},lo;function _s(){if(lo)return Tt;lo=1,Object.defineProperty(Tt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:o}})=>o===void 0?(0,e.str)`must contain at least ${n} valid item(s)`:(0,e.str)`must contain at least ${n} and no more than ${o} valid item(s)`,params:({params:{min:n,max:o}})=>o===void 0?(0,e._)`{minContains: ${n}}`:(0,e._)`{minContains: ${n}, maxContains: ${o}}`},code(n){const{gen:o,schema:l,parentSchema:s,data:c,it:y}=n;let d,m;const{minContains:P,maxContains:b}=s;y.opts.next?(d=P===void 0?1:P,m=b):d=1;const u=o.const("len",(0,e._)`${c}.length`);if(n.setParams({min:d,max:m}),m===void 0&&d===0){(0,t.checkStrictMode)(y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&d>m){(0,t.checkStrictMode)(y,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,t.alwaysValidSchema)(y,l)){let a=(0,e._)`${u} >= ${d}`;m!==void 0&&(a=(0,e._)`${a} && ${u} <= ${m}`),n.pass(a);return}y.items=!0;const v=o.name("valid");m===void 0&&d===1?h(v,()=>o.if(v,()=>o.break())):d===0?(o.let(v,!0),m!==void 0&&o.if((0,e._)`${c}.length > 0`,x)):(o.let(v,!1),x()),n.result(v,()=>n.reset());function x(){const a=o.name("_valid"),i=o.let("count",0);h(a,()=>o.if(a,()=>p(i)))}function h(a,i){o.forRange("i",0,u,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:t.Type.Num,compositeRule:!0},a),i()})}function p(a){o.code((0,e._)`${a}++`),m===void 0?o.if((0,e._)`${a} >= ${d}`,()=>o.assign(v,!0).break()):(o.if((0,e._)`${a} > ${m}`,()=>o.assign(v,!1).break()),d===1?o.assign(v,!0):o.if((0,e._)`${a} >= ${d}`,()=>o.assign(v,!0)))}}};return Tt.default=r,Tt}var uo={},co;function Ss(){return co||(co=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=X(),r=re(),n=Se();e.error={message:({params:{property:y,depsCount:d,deps:m}})=>{const P=d===1?"property":"properties";return(0,t.str)`must have ${P} ${m} when property ${y} is present`},params:({params:{property:y,depsCount:d,deps:m,missingProperty:P}})=>(0,t._)`{property: ${y},
6
+ || ${I} === "boolean" || ${_} === null`).assign(A,(0,n._)`[${_}]`)}}}function b({gen:s,parentData:i,parentDataProperty:w},g){s.if((0,n._)`${i} !== undefined`,()=>s.assign((0,n._)`${i}[${w}]`,g))}function u(s,i,w,g=l.Correct){const _=g===l.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(s){case"null":return(0,n._)`${i} ${_} null`;case"array":E=(0,n._)`Array.isArray(${i})`;break;case"object":E=(0,n._)`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":E=I((0,n._)`!(${i} % 1) && !isNaN(${i})`);break;case"number":E=I();break;default:return(0,n._)`typeof ${i} ${_} ${s}`}return g===l.Correct?E:(0,n.not)(E);function I(A=n.nil){return(0,n.and)((0,n._)`typeof ${i} == "number"`,A,w?(0,n._)`isFinite(${i})`:n.nil)}}ce.checkDataType=u;function v(s,i,w,g){if(s.length===1)return u(s[0],i,w,g);let _;const E=(0,o.toHash)(s);if(E.array&&E.object){const I=(0,n._)`typeof ${i} != "object"`;_=E.null?I:(0,n._)`!${i} || ${I}`,delete E.null,delete E.array,delete E.object}else _=n.nil;E.number&&delete E.integer;for(const I in E)_=(0,n.and)(_,u(I,i,w,g));return _}ce.checkDataTypes=v;const x={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:i})=>typeof s=="string"?(0,n._)`{type: ${s}}`:(0,n._)`{type: ${i}}`};function h(s){const i=p(s);(0,r.reportError)(i,x)}ce.reportTypeError=h;function p(s){const{gen:i,data:w,schema:g}=s,_=(0,o.schemaRefOrVal)(s,g,"type");return{gen:i,keyword:"type",data:w,schema:g.type,schemaCode:_,schemaValue:_,parentSchema:g,params:{},it:s}}return ce}var Ze={},wn;function Ua(){if(wn)return Ze;wn=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.assignDefaults=void 0;const e=X(),t=re();function r(o,l){const{properties:a,items:c}=o.schema;if(l==="object"&&a)for(const y in a)n(o,y,a[y].default);else l==="array"&&Array.isArray(c)&&c.forEach((y,d)=>n(o,d,y.default))}Ze.assignDefaults=r;function n(o,l,a){const{gen:c,compositeRule:y,data:d,opts:m}=o;if(a===void 0)return;const P=(0,e._)`${d}${(0,e.getProperty)(l)}`;if(y){(0,t.checkStrictMode)(o,`default is ignored for: ${P}`);return}let b=(0,e._)`${P} === undefined`;m.useDefaults==="empty"&&(b=(0,e._)`${b} || ${P} === null || ${P} === ""`),c.if(b,(0,e._)`${P} = ${(0,e.stringify)(a)}`)}return Ze}var _e={},oe={},_n;function Se(){if(_n)return oe;_n=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.validateUnion=oe.validateArray=oe.usePattern=oe.callValidateCode=oe.schemaProperties=oe.allSchemaProperties=oe.noPropertyInData=oe.propertyInData=oe.isOwnProperty=oe.hasPropFunc=oe.reportMissingProp=oe.checkMissingProp=oe.checkReportMissingProp=void 0;const e=X(),t=re(),r=ke(),n=re();function o(s,i){const{gen:w,data:g,it:_}=s;w.if(m(w,g,i,_.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${i}`},!0),s.error()})}oe.checkReportMissingProp=o;function l({gen:s,data:i,it:{opts:w}},g,_){return(0,e.or)(...g.map(E=>(0,e.and)(m(s,i,E,w.ownProperties),(0,e._)`${_} = ${E}`)))}oe.checkMissingProp=l;function a(s,i){s.setParams({missingProperty:i},!0),s.error()}oe.reportMissingProp=a;function c(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}oe.hasPropFunc=c;function y(s,i,w){return(0,e._)`${c(s)}.call(${i}, ${w})`}oe.isOwnProperty=y;function d(s,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} !== undefined`;return g?(0,e._)`${_} && ${y(s,i,w)}`:_}oe.propertyInData=d;function m(s,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} === undefined`;return g?(0,e.or)(_,(0,e.not)(y(s,i,w))):_}oe.noPropertyInData=m;function P(s){return s?Object.keys(s).filter(i=>i!=="__proto__"):[]}oe.allSchemaProperties=P;function b(s,i){return P(i).filter(w=>!(0,t.alwaysValidSchema)(s,i[w]))}oe.schemaProperties=b;function u({schemaCode:s,data:i,it:{gen:w,topSchemaRef:g,schemaPath:_,errorPath:E},it:I},A,z,R){const U=R?(0,e._)`${s}, ${i}, ${g}${_}`:i,B=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];I.opts.dynamicRef&&B.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const G=(0,e._)`${U}, ${w.object(...B)}`;return z!==e.nil?(0,e._)`${A}.call(${z}, ${G})`:(0,e._)`${A}(${G})`}oe.callValidateCode=u;const v=(0,e._)`new RegExp`;function x({gen:s,it:{opts:i}},w){const g=i.unicodeRegExp?"u":"",{regExp:_}=i.code,E=_(w,g);return s.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${_.code==="new RegExp"?v:(0,n.useFunc)(s,_)}(${w}, ${g})`})}oe.usePattern=x;function h(s){const{gen:i,data:w,keyword:g,it:_}=s,E=i.name("valid");if(_.allErrors){const A=i.let("valid",!0);return I(()=>i.assign(A,!1)),A}return i.var(E,!0),I(()=>i.break()),E;function I(A){const z=i.const("len",(0,e._)`${w}.length`);i.forRange("i",0,z,R=>{s.subschema({keyword:g,dataProp:R,dataPropType:t.Type.Num},E),i.if((0,e.not)(E),A)})}}oe.validateArray=h;function p(s){const{gen:i,schema:w,keyword:g,it:_}=s;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(A=>(0,t.alwaysValidSchema)(_,A))&&!_.opts.unevaluated)return;const E=i.let("valid",!1),I=i.name("_valid");i.block(()=>w.forEach((A,z)=>{const R=s.subschema({keyword:g,schemaProp:z,compositeRule:!0},I);i.assign(E,(0,e._)`${E} || ${I}`),s.mergeValidEvaluated(R,I)||i.if((0,e.not)(E))})),s.result(E,()=>s.reset(),()=>s.error(!0))}return oe.validateUnion=p,oe}var Sn;function Ka(){if(Sn)return _e;Sn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.validateKeywordUsage=_e.validSchemaType=_e.funcKeywordCode=_e.macroKeywordCode=void 0;const e=X(),t=ke(),r=Se(),n=Je();function o(b,u){const{gen:v,keyword:x,schema:h,parentSchema:p,it:s}=b,i=u.macro.call(s.self,h,p,s),w=d(v,x,i);s.opts.validateSchema!==!1&&s.self.validateSchema(i,!0);const g=v.name("valid");b.subschema({schema:i,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${x}`,topSchemaRef:w,compositeRule:!0},g),b.pass(g,()=>b.error(!0))}_e.macroKeywordCode=o;function l(b,u){var v;const{gen:x,keyword:h,schema:p,parentSchema:s,$data:i,it:w}=b;y(w,u);const g=!i&&u.compile?u.compile.call(w.self,p,s,w):u.validate,_=d(x,h,g),E=x.let("valid");b.block$data(E,I),b.ok((v=u.valid)!==null&&v!==void 0?v:E);function I(){if(u.errors===!1)R(),u.modifying&&a(b),U(()=>b.error());else{const B=u.async?A():z();u.modifying&&a(b),U(()=>c(b,B))}}function A(){const B=x.let("ruleErrs",null);return x.try(()=>R((0,e._)`await `),G=>x.assign(E,!1).if((0,e._)`${G} instanceof ${w.ValidationError}`,()=>x.assign(B,(0,e._)`${G}.errors`),()=>x.throw(G))),B}function z(){const B=(0,e._)`${_}.errors`;return x.assign(B,null),R(e.nil),B}function R(B=u.async?(0,e._)`await `:e.nil){const G=w.opts.passContext?t.default.this:t.default.self,ae=!("compile"in u&&!i||u.schema===!1);x.assign(E,(0,e._)`${B}${(0,r.callValidateCode)(b,_,G,ae)}`,u.modifying)}function U(B){var G;x.if((0,e.not)((G=u.valid)!==null&&G!==void 0?G:E),B)}}_e.funcKeywordCode=l;function a(b){const{gen:u,data:v,it:x}=b;u.if(x.parentData,()=>u.assign(v,(0,e._)`${x.parentData}[${x.parentDataProperty}]`))}function c(b,u){const{gen:v}=b;v.if((0,e._)`Array.isArray(${u})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${u} : ${t.default.vErrors}.concat(${u})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(b)},()=>b.error())}function y({schemaEnv:b},u){if(u.async&&!b.$async)throw new Error("async keyword in sync schema")}function d(b,u,v){if(v===void 0)throw new Error(`keyword "${u}" failed to compile`);return b.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function m(b,u,v=!1){return!u.length||u.some(x=>x==="array"?Array.isArray(b):x==="object"?b&&typeof b=="object"&&!Array.isArray(b):typeof b==x||v&&typeof b>"u")}_e.validSchemaType=m;function P({schema:b,opts:u,self:v,errSchemaPath:x},h,p){if(Array.isArray(h.keyword)?!h.keyword.includes(p):h.keyword!==p)throw new Error("ajv implementation error");const s=h.dependencies;if(s!=null&&s.some(i=>!Object.prototype.hasOwnProperty.call(b,i)))throw new Error(`parent schema must have dependencies of ${p}: ${s.join(",")}`);if(h.validateSchema&&!h.validateSchema(b[p])){const i=`keyword "${p}" value is invalid at path "${x}": `+v.errorsText(h.validateSchema.errors);if(u.validateSchema==="log")v.logger.error(i);else throw new Error(i)}}return _e.validateKeywordUsage=P,_e}var je={},En;function Ba(){if(En)return je;En=1,Object.defineProperty(je,"__esModule",{value:!0}),je.extendSubschemaMode=je.extendSubschemaData=je.getSubschema=void 0;const e=X(),t=re();function r(l,{keyword:a,schemaProp:c,schema:y,schemaPath:d,errSchemaPath:m,topSchemaRef:P}){if(a!==void 0&&y!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const b=l.schema[a];return c===void 0?{schema:b,schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${l.errSchemaPath}/${a}`}:{schema:b[c],schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(c)}`,errSchemaPath:`${l.errSchemaPath}/${a}/${(0,t.escapeFragment)(c)}`}}if(y!==void 0){if(d===void 0||m===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:y,schemaPath:d,topSchemaRef:P,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}je.getSubschema=r;function n(l,a,{dataProp:c,dataPropType:y,data:d,dataTypes:m,propertyName:P}){if(d!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=a;if(c!==void 0){const{errorPath:v,dataPathArr:x,opts:h}=a,p=b.let("data",(0,e._)`${a.data}${(0,e.getProperty)(c)}`,!0);u(p),l.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(c,y,h.jsPropertySyntax)}`,l.parentDataProperty=(0,e._)`${c}`,l.dataPathArr=[...x,l.parentDataProperty]}if(d!==void 0){const v=d instanceof e.Name?d:b.let("data",d,!0);u(v),P!==void 0&&(l.propertyName=P)}m&&(l.dataTypes=m);function u(v){l.data=v,l.dataLevel=a.dataLevel+1,l.dataTypes=[],a.definedProperties=new Set,l.parentData=a.data,l.dataNames=[...a.dataNames,v]}}je.extendSubschemaData=n;function o(l,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:y,createErrors:d,allErrors:m}){y!==void 0&&(l.compositeRule=y),d!==void 0&&(l.createErrors=d),m!==void 0&&(l.allErrors=m),l.jtdDiscriminator=a,l.jtdMetadata=c}return je.extendSubschemaMode=o,je}var he={},xn,Pn;function kn(){return Pn||(Pn=1,xn=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,l;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(l=Object.keys(t),n=l.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,l[o]))return!1;for(o=n;o--!==0;){var a=l[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),xn}var sr={exports:{}},Nn;function Wa(){if(Nn)return sr.exports;Nn=1;var e=sr.exports=function(n,o,l){typeof o=="function"&&(l=o,o={}),l=o.cb||l;var a=typeof l=="function"?l:l.pre||function(){},c=l.post||function(){};t(o,a,c,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,o,l,a,c,y,d,m,P,b){if(a&&typeof a=="object"&&!Array.isArray(a)){o(a,c,y,d,m,P,b);for(var u in a){var v=a[u];if(Array.isArray(v)){if(u in e.arrayKeywords)for(var x=0;x<v.length;x++)t(n,o,l,v[x],c+"/"+u+"/"+x,y,c,u,a,x)}else if(u in e.propsKeywords){if(v&&typeof v=="object")for(var h in v)t(n,o,l,v[h],c+"/"+u+"/"+r(h),y,c,u,a,h)}else(u in e.keywords||n.allKeys&&!(u in e.skipKeywords))&&t(n,o,l,v,c+"/"+u,y,c,u,a)}l(a,c,y,d,m,P,b)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return sr.exports}var jn;function lt(){if(jn)return he;jn=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const e=re(),t=kn(),r=Wa(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(x,h=!0){return typeof x=="boolean"?!0:h===!0?!a(x):h?c(x)<=h:!1}he.inlineRef=o;const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(x){for(const h in x){if(l.has(h))return!0;const p=x[h];if(Array.isArray(p)&&p.some(a)||typeof p=="object"&&a(p))return!0}return!1}function c(x){let h=0;for(const p in x)if(p==="$ref"||(h++,!n.has(p)&&(typeof x[p]=="object"&&(0,e.eachItem)(x[p],s=>h+=c(s)),h===1/0)))return 1/0;return h}function y(x,h="",p){p!==!1&&(h=P(h));const s=x.parse(h);return d(x,s)}he.getFullPath=y;function d(x,h){return x.serialize(h).split("#")[0]+"#"}he._getFullPath=d;const m=/#\/?$/;function P(x){return x?x.replace(m,""):""}he.normalizeId=P;function b(x,h,p){return p=P(p),x.resolve(h,p)}he.resolveUrl=b;const u=/^[a-z_][-a-z0-9._]*$/i;function v(x,h){if(typeof x=="boolean")return{};const{schemaId:p,uriResolver:s}=this.opts,i=P(x[p]||h),w={"":i},g=y(s,i,!1),_={},E=new Set;return r(x,{allKeys:!0},(z,R,U,B)=>{if(B===void 0)return;const G=g+R;let ae=w[B];typeof z[p]=="string"&&(ae=se.call(this,z[p])),de.call(this,z.$anchor),de.call(this,z.$dynamicAnchor),w[R]=ae;function se(ne){const pe=this.opts.uriResolver.resolve;if(ne=P(ae?pe(ae,ne):ne),E.has(ne))throw A(ne);E.add(ne);let L=this.refs[ne];return typeof L=="string"&&(L=this.refs[L]),typeof L=="object"?I(z,L.schema,ne):ne!==P(G)&&(ne[0]==="#"?(I(z,_[ne],ne),_[ne]=z):this.refs[ne]=G),ne}function de(ne){if(typeof ne=="string"){if(!u.test(ne))throw new Error(`invalid anchor "${ne}"`);se.call(this,`#${ne}`)}}}),_;function I(z,R,U){if(R!==void 0&&!t(z,R))throw A(U)}function A(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return he.getSchemaRefs=v,he}var On;function Qe(){if(On)return Pe;On=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.getData=Pe.KeywordCxt=Pe.validateFunctionCode=void 0;const e=Fa(),t=it(),r=bn(),n=it(),o=Ua(),l=Ka(),a=Ba(),c=X(),y=ke(),d=lt(),m=re(),P=Je();function b(N){if(g(N)&&(E(N),w(N))){h(N);return}u(N,()=>(0,e.topBoolOrEmptySchema)(N))}Pe.validateFunctionCode=b;function u({gen:N,validateName:j,schema:V,schemaEnv:D,opts:H},te){H.code.es5?N.func(j,(0,c._)`${y.default.data}, ${y.default.valCxt}`,D.$async,()=>{N.code((0,c._)`"use strict"; ${s(V,H)}`),x(N,H),N.code(te)}):N.func(j,(0,c._)`${y.default.data}, ${v(H)}`,D.$async,()=>N.code(s(V,H)).code(te))}function v(N){return(0,c._)`{${y.default.instancePath}="", ${y.default.parentData}, ${y.default.parentDataProperty}, ${y.default.rootData}=${y.default.data}${N.dynamicRef?(0,c._)`, ${y.default.dynamicAnchors}={}`:c.nil}}={}`}function x(N,j){N.if(y.default.valCxt,()=>{N.var(y.default.instancePath,(0,c._)`${y.default.valCxt}.${y.default.instancePath}`),N.var(y.default.parentData,(0,c._)`${y.default.valCxt}.${y.default.parentData}`),N.var(y.default.parentDataProperty,(0,c._)`${y.default.valCxt}.${y.default.parentDataProperty}`),N.var(y.default.rootData,(0,c._)`${y.default.valCxt}.${y.default.rootData}`),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`${y.default.valCxt}.${y.default.dynamicAnchors}`)},()=>{N.var(y.default.instancePath,(0,c._)`""`),N.var(y.default.parentData,(0,c._)`undefined`),N.var(y.default.parentDataProperty,(0,c._)`undefined`),N.var(y.default.rootData,y.default.data),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`{}`)})}function h(N){const{schema:j,opts:V,gen:D}=N;u(N,()=>{V.$comment&&j.$comment&&B(N),z(N),D.let(y.default.vErrors,null),D.let(y.default.errors,0),V.unevaluated&&p(N),I(N),G(N)})}function p(N){const{gen:j,validateName:V}=N;N.evaluated=j.const("evaluated",(0,c._)`${V}.evaluated`),j.if((0,c._)`${N.evaluated}.dynamicProps`,()=>j.assign((0,c._)`${N.evaluated}.props`,(0,c._)`undefined`)),j.if((0,c._)`${N.evaluated}.dynamicItems`,()=>j.assign((0,c._)`${N.evaluated}.items`,(0,c._)`undefined`))}function s(N,j){const V=typeof N=="object"&&N[j.schemaId];return V&&(j.code.source||j.code.process)?(0,c._)`/*# sourceURL=${V} */`:c.nil}function i(N,j){if(g(N)&&(E(N),w(N))){_(N,j);return}(0,e.boolOrEmptySchema)(N,j)}function w({schema:N,self:j}){if(typeof N=="boolean")return!N;for(const V in N)if(j.RULES.all[V])return!0;return!1}function g(N){return typeof N.schema!="boolean"}function _(N,j){const{schema:V,gen:D,opts:H}=N;H.$comment&&V.$comment&&B(N),R(N),U(N);const te=D.const("_errs",y.default.errors);I(N,te),D.var(j,(0,c._)`${te} === ${y.default.errors}`)}function E(N){(0,m.checkUnknownRules)(N),A(N)}function I(N,j){if(N.opts.jtd)return se(N,[],!1,j);const V=(0,t.getSchemaTypes)(N.schema),D=(0,t.coerceAndCheckDataType)(N,V);se(N,V,!D,j)}function A(N){const{schema:j,errSchemaPath:V,opts:D,self:H}=N;j.$ref&&D.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(j,H.RULES)&&H.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function z(N){const{schema:j,opts:V}=N;j.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,m.checkStrictMode)(N,"default is ignored in the schema root")}function R(N){const j=N.schema[N.opts.schemaId];j&&(N.baseId=(0,d.resolveUrl)(N.opts.uriResolver,N.baseId,j))}function U(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function B({gen:N,schemaEnv:j,schema:V,errSchemaPath:D,opts:H}){const te=V.$comment;if(H.$comment===!0)N.code((0,c._)`${y.default.self}.logger.log(${te})`);else if(typeof H.$comment=="function"){const le=(0,c.str)`${D}/$comment`,$e=N.scopeValue("root",{ref:j.root});N.code((0,c._)`${y.default.self}.opts.$comment(${te}, ${le}, ${$e}.schema)`)}}function G(N){const{gen:j,schemaEnv:V,validateName:D,ValidationError:H,opts:te}=N;V.$async?j.if((0,c._)`${y.default.errors} === 0`,()=>j.return(y.default.data),()=>j.throw((0,c._)`new ${H}(${y.default.vErrors})`)):(j.assign((0,c._)`${D}.errors`,y.default.vErrors),te.unevaluated&&ae(N),j.return((0,c._)`${y.default.errors} === 0`))}function ae({gen:N,evaluated:j,props:V,items:D}){V instanceof c.Name&&N.assign((0,c._)`${j}.props`,V),D instanceof c.Name&&N.assign((0,c._)`${j}.items`,D)}function se(N,j,V,D){const{gen:H,schema:te,data:le,allErrors:$e,opts:me,self:ye}=N,{RULES:ue}=ye;if(te.$ref&&(me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(te,ue))){H.block(()=>F(N,"$ref",ue.all.$ref.definition));return}me.jtd||ne(N,j),H.block(()=>{for(const be of ue.rules)Me(be);Me(ue.post)});function Me(be){(0,r.shouldUseGroup)(te,be)&&(be.type?(H.if((0,n.checkDataType)(be.type,le,me.strictNumbers)),de(N,be),j.length===1&&j[0]===be.type&&V&&(H.else(),(0,n.reportTypeError)(N)),H.endIf()):de(N,be),$e||H.if((0,c._)`${y.default.errors} === ${D||0}`))}}function de(N,j){const{gen:V,schema:D,opts:{useDefaults:H}}=N;H&&(0,o.assignDefaults)(N,j.type),V.block(()=>{for(const te of j.rules)(0,r.shouldUseRule)(D,te)&&F(N,te.keyword,te.definition,j.type)})}function ne(N,j){N.schemaEnv.meta||!N.opts.strictTypes||(pe(N,j),N.opts.allowUnionTypes||L(N,j),O(N,N.dataTypes))}function pe(N,j){if(j.length){if(!N.dataTypes.length){N.dataTypes=j;return}j.forEach(V=>{k(N.dataTypes,V)||S(N,`type "${V}" not allowed by context "${N.dataTypes.join(",")}"`)}),f(N,j)}}function L(N,j){j.length>1&&!(j.length===2&&j.includes("null"))&&S(N,"use allowUnionTypes to allow union type keyword")}function O(N,j){const V=N.self.RULES.all;for(const D in V){const H=V[D];if(typeof H=="object"&&(0,r.shouldUseRule)(N.schema,H)){const{type:te}=H.definition;te.length&&!te.some(le=>C(j,le))&&S(N,`missing type "${te.join(",")}" for keyword "${D}"`)}}}function C(N,j){return N.includes(j)||j==="number"&&N.includes("integer")}function k(N,j){return N.includes(j)||j==="integer"&&N.includes("number")}function f(N,j){const V=[];for(const D of N.dataTypes)k(j,D)?V.push(D):j.includes("integer")&&D==="number"&&V.push("integer");N.dataTypes=V}function S(N,j){const V=N.schemaEnv.baseId+N.errSchemaPath;j+=` at "${V}" (strictTypes)`,(0,m.checkStrictMode)(N,j,N.opts.strictTypes)}class T{constructor(j,V,D){if((0,l.validateKeywordUsage)(j,V,D),this.gen=j.gen,this.allErrors=j.allErrors,this.keyword=D,this.data=j.data,this.schema=j.schema[D],this.$data=V.$data&&j.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(j,this.schema,D,this.$data),this.schemaType=V.schemaType,this.parentSchema=j.schema,this.params={},this.it=j,this.def=V,this.$data)this.schemaCode=j.gen.const("vSchema",Y(this.$data,j));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=j.gen.const("_errs",y.default.errors))}result(j,V,D){this.failResult((0,c.not)(j),V,D)}failResult(j,V,D){this.gen.if(j),D?D():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(j,V){this.failResult((0,c.not)(j),void 0,V)}fail(j){if(j===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(j),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(j){if(!this.$data)return this.fail(j);const{schemaCode:V}=this;this.fail((0,c._)`${V} !== undefined && (${(0,c.or)(this.invalid$data(),j)})`)}error(j,V,D){if(V){this.setParams(V),this._error(j,D),this.setParams({});return}this._error(j,D)}_error(j,V){(j?P.reportExtraError:P.reportError)(this,this.def.error,V)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(j){this.allErrors||this.gen.if(j)}setParams(j,V){V?Object.assign(this.params,j):this.params=j}block$data(j,V,D=c.nil){this.gen.block(()=>{this.check$data(j,D),V()})}check$data(j=c.nil,V=c.nil){if(!this.$data)return;const{gen:D,schemaCode:H,schemaType:te,def:le}=this;D.if((0,c.or)((0,c._)`${H} === undefined`,V)),j!==c.nil&&D.assign(j,!0),(te.length||le.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),j!==c.nil&&D.assign(j,!1)),D.else()}invalid$data(){const{gen:j,schemaCode:V,schemaType:D,def:H,it:te}=this;return(0,c.or)(le(),$e());function le(){if(D.length){if(!(V instanceof c.Name))throw new Error("ajv implementation error");const me=Array.isArray(D)?D:[D];return(0,c._)`${(0,n.checkDataTypes)(me,V,te.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function $e(){if(H.validateSchema){const me=j.scopeValue("validate$data",{ref:H.validateSchema});return(0,c._)`!${me}(${V})`}return c.nil}}subschema(j,V){const D=(0,a.getSubschema)(this.it,j);(0,a.extendSubschemaData)(D,this.it,j),(0,a.extendSubschemaMode)(D,j);const H={...this.it,...D,items:void 0,props:void 0};return i(H,V),H}mergeEvaluated(j,V){const{it:D,gen:H}=this;D.opts.unevaluated&&(D.props!==!0&&j.props!==void 0&&(D.props=m.mergeEvaluated.props(H,j.props,D.props,V)),D.items!==!0&&j.items!==void 0&&(D.items=m.mergeEvaluated.items(H,j.items,D.items,V)))}mergeValidEvaluated(j,V){const{it:D,gen:H}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return H.if(V,()=>this.mergeEvaluated(j,c.Name)),!0}}Pe.KeywordCxt=T;function F(N,j,V,D){const H=new T(N,V,j);"code"in V?V.code(H,D):H.$data&&V.validate?(0,l.funcKeywordCode)(H,V):"macro"in V?(0,l.macroKeywordCode)(H,V):(V.compile||V.validate)&&(0,l.funcKeywordCode)(H,V)}const M=/^\/(?:[^~]|~0|~1)*$/,W=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(N,{dataLevel:j,dataNames:V,dataPathArr:D}){let H,te;if(N==="")return y.default.rootData;if(N[0]==="/"){if(!M.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);H=N,te=y.default.rootData}else{const ye=W.exec(N);if(!ye)throw new Error(`Invalid JSON-pointer: ${N}`);const ue=+ye[1];if(H=ye[2],H==="#"){if(ue>=j)throw new Error(me("property/index",ue));return D[j-ue]}if(ue>j)throw new Error(me("data",ue));if(te=V[j-ue],!H)return te}let le=te;const $e=H.split("/");for(const ye of $e)ye&&(te=(0,c._)`${te}${(0,c.getProperty)((0,m.unescapeJsonPointer)(ye))}`,le=(0,c._)`${le} && ${te}`);return le;function me(ye,ue){return`Cannot access ${ye} ${ue} levels up, current level is ${j}`}}return Pe.getData=Y,Pe}var ut={},Cn;function ir(){if(Cn)return ut;Cn=1,Object.defineProperty(ut,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return ut.default=e,ut}var ct={},Tn;function dt(){if(Tn)return ct;Tn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=lt();class t extends Error{constructor(n,o,l,a){super(a||`can't resolve reference ${l} from id ${o}`),this.missingRef=(0,e.resolveUrl)(n,o,l),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ct.default=t,ct}var ge={},In;function lr(){if(In)return ge;In=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.resolveSchema=ge.getCompilingSchema=ge.resolveRef=ge.compileSchema=ge.SchemaEnv=void 0;const e=X(),t=ir(),r=ke(),n=lt(),o=re(),l=Qe();class a{constructor(p){var s;this.refs={},this.dynamicAnchors={};let i;typeof p.schema=="object"&&(i=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(s=p.baseId)!==null&&s!==void 0?s:(0,n.normalizeId)(i?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=i?.$async,this.refs={}}}ge.SchemaEnv=a;function c(h){const p=m.call(this,h);if(p)return p;const s=(0,n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:i,lines:w}=this.opts.code,{ownProperties:g}=this.opts,_=new e.CodeGen(this.scope,{es5:i,lines:w,ownProperties:g});let E;h.$async&&(E=_.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");h.validateName=I;const A={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:h.schema,code:(0,e.stringify)(h.schema)}:{ref:h.schema}),validateName:I,ValidationError:E,schema:h.schema,schemaEnv:h,rootId:s,baseId:h.baseId||s,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(h),(0,l.validateFunctionCode)(A),_.optimize(this.opts.code.optimize);const R=_.toString();z=`${_.scopeRefs(r.default.scope)}return ${R}`,this.opts.code.process&&(z=this.opts.code.process(z,h));const U=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(I,{ref:U}),U.errors=null,U.schema=h.schema,U.schemaEnv=h,h.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:I,validateCode:R,scopeValues:_._values}),this.opts.unevaluated){const{props:B,items:G}=A;U.evaluated={props:B instanceof e.Name?void 0:B,items:G instanceof e.Name?void 0:G,dynamicProps:B instanceof e.Name,dynamicItems:G instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return h.validate=U,h}catch(R){throw delete h.validate,delete h.validateName,z&&this.logger.error("Error compiling schema, function code:",z),R}finally{this._compilations.delete(h)}}ge.compileSchema=c;function y(h,p,s){var i;s=(0,n.resolveUrl)(this.opts.uriResolver,p,s);const w=h.refs[s];if(w)return w;let g=b.call(this,h,s);if(g===void 0){const _=(i=h.localRefs)===null||i===void 0?void 0:i[s],{schemaId:E}=this.opts;_&&(g=new a({schema:_,schemaId:E,root:h,baseId:p}))}if(g!==void 0)return h.refs[s]=d.call(this,g)}ge.resolveRef=y;function d(h){return(0,n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function m(h){for(const p of this._compilations)if(P(p,h))return p}ge.getCompilingSchema=m;function P(h,p){return h.schema===p.schema&&h.root===p.root&&h.baseId===p.baseId}function b(h,p){let s;for(;typeof(s=this.refs[p])=="string";)p=s;return s||this.schemas[p]||u.call(this,h,p)}function u(h,p){const s=this.opts.uriResolver.parse(p),i=(0,n._getFullPath)(this.opts.uriResolver,s);let w=(0,n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&i===w)return x.call(this,s,h);const g=(0,n.normalizeId)(i),_=this.refs[g]||this.schemas[g];if(typeof _=="string"){const E=u.call(this,h,_);return typeof E?.schema!="object"?void 0:x.call(this,s,E)}if(typeof _?.schema=="object"){if(_.validate||c.call(this,_),g===(0,n.normalizeId)(p)){const{schema:E}=_,{schemaId:I}=this.opts,A=E[I];return A&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,A)),new a({schema:E,schemaId:I,root:h,baseId:w})}return x.call(this,s,_)}}ge.resolveSchema=u;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function x(h,{baseId:p,schema:s,root:i}){var w;if(((w=h.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(const E of h.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const I=s[(0,o.unescapeFragment)(E)];if(I===void 0)return;s=I;const A=typeof s=="object"&&s[this.opts.schemaId];!v.has(E)&&A&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,A))}let g;if(typeof s!="boolean"&&s.$ref&&!(0,o.schemaHasRulesButRef)(s,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,p,s.$ref);g=u.call(this,i,E)}const{schemaId:_}=this.opts;if(g=g||new a({schema:s,schemaId:_,root:i,baseId:p}),g.schema!==g.root.schema)return g}return ge}const Ga="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ha="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ja="object",Za=["$data"],Qa={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ya=!1,Xa={$id:Ga,description:Ha,type:Ja,required:Za,properties:Qa,additionalProperties:Ya};var pt={},Ye={exports:{}},ur,Vn;function Rn(){if(Vn)return ur;Vn=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(b){let u="",v=0,x=0;for(x=0;x<b.length;x++)if(v=b[x].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[x];break}for(x+=1;x<b.length;x++){if(v=b[x].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[x]}return u}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(b){return b.length=0,!0}function l(b,u,v){if(b.length){const x=r(b);if(x!=="")u.push(x);else return v.error=!0,!1;b.length=0}return!0}function a(b){let u=0;const v={error:!1,address:"",zone:""},x=[],h=[];let p=!1,s=!1,i=l;for(let w=0;w<b.length;w++){const g=b[w];if(!(g==="["||g==="]"))if(g===":"){if(p===!0&&(s=!0),!i(h,x,v))break;if(++u>7){v.error=!0;break}w>0&&b[w-1]===":"&&(p=!0),x.push(":");continue}else if(g==="%"){if(!i(h,x,v))break;i=o}else{h.push(g);continue}}return h.length&&(i===o?v.zone=h.join(""):s?x.push(h.join("")):x.push(r(h))),v.address=x.join(""),v}function c(b){if(y(b,":")<2)return{host:b,isIPV6:!1};const u=a(b);if(u.error)return{host:b,isIPV6:!1};{let v=u.address,x=u.address;return u.zone&&(v+="%"+u.zone,x+="%25"+u.zone),{host:v,isIPV6:!0,escapedHost:x}}}function y(b,u){let v=0;for(let x=0;x<b.length;x++)b[x]===u&&v++;return v}function d(b){let u=b;const v=[];let x=-1,h=0;for(;h=u.length;){if(h===1){if(u===".")break;if(u==="/"){v.push("/");break}else{v.push(u);break}}else if(h===2){if(u[0]==="."){if(u[1]===".")break;if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&(u[1]==="."||u[1]==="/")){v.push("/");break}}else if(h===3&&u==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(u[0]==="."){if(u[1]==="."){if(u[2]==="/"){u=u.slice(3);continue}}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&u[1]==="."){if(u[2]==="/"){u=u.slice(2);continue}else if(u[2]==="."&&u[3]==="/"){u=u.slice(3),v.length!==0&&v.pop();continue}}if((x=u.indexOf("/",1))===-1){v.push(u);break}else v.push(u.slice(0,x)),u=u.slice(x)}return v.join("")}function m(b,u){const v=u!==!0?escape:unescape;return b.scheme!==void 0&&(b.scheme=v(b.scheme)),b.userinfo!==void 0&&(b.userinfo=v(b.userinfo)),b.host!==void 0&&(b.host=v(b.host)),b.path!==void 0&&(b.path=v(b.path)),b.query!==void 0&&(b.query=v(b.query)),b.fragment!==void 0&&(b.fragment=v(b.fragment)),b}function P(b){const u=[];if(b.userinfo!==void 0&&(u.push(b.userinfo),u.push("@")),b.host!==void 0){let v=unescape(b.host);if(!t(v)){const x=c(v);x.isIPV6===!0?v=`[${x.escapedHost}]`:v=b.host}u.push(v)}return(typeof b.port=="number"||typeof b.port=="string")&&(u.push(":"),u.push(String(b.port))),u.length?u.join(""):void 0}return ur={nonSimpleDomain:n,recomposeAuthority:P,normalizeComponentEncoding:m,removeDotSegments:d,isIPv4:t,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:r},ur}var cr,Ln;function es(){if(Ln)return cr;Ln=1;const{isUUID:e}=Rn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(i){return r.indexOf(i)!==-1}function o(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function l(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function a(i){const w=String(i.scheme).toLowerCase()==="https";return(i.port===(w?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function c(i){return i.secure=o(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function y(i){if((i.port===(o(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[w,g]=i.resourceName.split("?");i.path=w&&w!=="/"?w:void 0,i.query=g,i.resourceName=void 0}return i.fragment=void 0,i}function d(i,w){if(!i.path)return i.error="URN can not be parsed",i;const g=i.path.match(t);if(g){const _=w.scheme||i.scheme||"urn";i.nid=g[1].toLowerCase(),i.nss=g[2];const E=`${_}:${w.nid||i.nid}`,I=s(E);i.path=void 0,I&&(i=I.parse(i,w))}else i.error=i.error||"URN can not be parsed.";return i}function m(i,w){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const g=w.scheme||i.scheme||"urn",_=i.nid.toLowerCase(),E=`${g}:${w.nid||_}`,I=s(E);I&&(i=I.serialize(i,w));const A=i,z=i.nss;return A.path=`${_||w.nid}:${z}`,w.skipEscape=!0,A}function P(i,w){const g=i;return g.uuid=g.nss,g.nss=void 0,!w.tolerant&&(!g.uuid||!e(g.uuid))&&(g.error=g.error||"UUID is not valid."),g}function b(i){const w=i;return w.nss=(i.uuid||"").toLowerCase(),w}const u={scheme:"http",domainHost:!0,parse:l,serialize:a},v={scheme:"https",domainHost:u.domainHost,parse:l,serialize:a},x={scheme:"ws",domainHost:!0,parse:c,serialize:y},h={scheme:"wss",domainHost:x.domainHost,parse:x.parse,serialize:x.serialize},p={http:u,https:v,ws:x,wss:h,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:b,skipNormalize:!0}};Object.setPrototypeOf(p,null);function s(i){return i&&(p[i]||p[i.toLowerCase()])||void 0}return cr={wsIsSecure:o,SCHEMES:p,isValidSchemeName:n,getSchemeHandler:s},cr}var Mn;function ts(){if(Mn)return Ye.exports;Mn=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:o,nonSimpleDomain:l}=Rn(),{SCHEMES:a,getSchemeHandler:c}=es();function y(h,p){return typeof h=="string"?h=b(v(h,p),p):typeof h=="object"&&(h=v(b(h,p),p)),h}function d(h,p,s){const i=s?Object.assign({scheme:"null"},s):{scheme:"null"},w=m(v(h,i),v(p,i),i,!0);return i.skipEscape=!0,b(w,i)}function m(h,p,s,i){const w={};return i||(h=v(b(h,s),s),p=v(b(p,s),s)),s=s||{},!s.tolerant&&p.scheme?(w.scheme=p.scheme,w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.path?(p.path[0]==="/"?w.path=t(p.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?w.path="/"+p.path:h.path?w.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+p.path:w.path=p.path,w.path=t(w.path)),w.query=p.query):(w.path=h.path,p.query!==void 0?w.query=p.query:w.query=h.query),w.userinfo=h.userinfo,w.host=h.host,w.port=h.port),w.scheme=h.scheme),w.fragment=p.fragment,w}function P(h,p,s){return typeof h=="string"?(h=unescape(h),h=b(n(v(h,s),!0),{...s,skipEscape:!0})):typeof h=="object"&&(h=b(n(h,!0),{...s,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=b(n(v(p,s),!0),{...s,skipEscape:!0})):typeof p=="object"&&(p=b(n(p,!0),{...s,skipEscape:!0})),h.toLowerCase()===p.toLowerCase()}function b(h,p){const s={host:h.host,scheme:h.scheme,userinfo:h.userinfo,port:h.port,path:h.path,query:h.query,nid:h.nid,nss:h.nss,uuid:h.uuid,fragment:h.fragment,reference:h.reference,resourceName:h.resourceName,secure:h.secure,error:""},i=Object.assign({},p),w=[],g=c(i.scheme||s.scheme);g&&g.serialize&&g.serialize(s,i),s.path!==void 0&&(i.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),i.reference!=="suffix"&&s.scheme&&w.push(s.scheme,":");const _=r(s);if(_!==void 0&&(i.reference!=="suffix"&&w.push("//"),w.push(_),s.path&&s.path[0]!=="/"&&w.push("/")),s.path!==void 0){let E=s.path;!i.absolutePath&&(!g||!g.absolutePath)&&(E=t(E)),_===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),w.push(E)}return s.query!==void 0&&w.push("?",s.query),s.fragment!==void 0&&w.push("#",s.fragment),w.join("")}const u=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(h,p){const s=Object.assign({},p),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let w=!1;s.reference==="suffix"&&(s.scheme?h=s.scheme+":"+h:h="//"+h);const g=h.match(u);if(g){if(i.scheme=g[1],i.userinfo=g[3],i.host=g[4],i.port=parseInt(g[5],10),i.path=g[6]||"",i.query=g[7],i.fragment=g[8],isNaN(i.port)&&(i.port=g[5]),i.host)if(o(i.host)===!1){const E=e(i.host);i.host=E.host.toLowerCase(),w=E.isIPV6}else w=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==i.reference&&(i.error=i.error||"URI is not a "+s.reference+" reference.");const _=c(s.scheme||i.scheme);if(!s.unicodeSupport&&(!_||!_.unicodeSupport)&&i.host&&(s.domainHost||_&&_.domainHost)&&w===!1&&l(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(E){i.error=i.error||"Host's domain name can not be converted to ASCII: "+E}(!_||_&&!_.skipNormalize)&&(h.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),_&&_.parse&&_.parse(i,s)}else i.error=i.error||"URI can not be parsed.";return i}const x={SCHEMES:a,normalize:y,resolve:d,resolveComponent:m,equal:P,serialize:b,parse:v};return Ye.exports=x,Ye.exports.default=x,Ye.exports.fastUri=x,Ye.exports}var An;function rs(){if(An)return pt;An=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=ts();return e.code='require("ajv/dist/runtime/uri").default',pt.default=e,pt}var qn;function ns(){return qn||(qn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Qe();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=X();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ir(),o=dt(),l=vn(),a=lr(),c=X(),y=lt(),d=it(),m=re(),P=Xa,b=rs(),u=(L,O)=>new RegExp(L,O);u.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],x=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},s=200;function i(L){var O,C,k,f,S,T,F,M,W,Y,N,j,V,D,H,te,le,$e,me,ye,ue,Me,be,Gt,Ht;const Ue=L.strict,Jt=(O=L.code)===null||O===void 0?void 0:O.optimize,br=Jt===!0||Jt===void 0?1:Jt||0,$r=(k=(C=L.code)===null||C===void 0?void 0:C.regExp)!==null&&k!==void 0?k:u,Yo=(f=L.uriResolver)!==null&&f!==void 0?f:b.default;return{strictSchema:(T=(S=L.strictSchema)!==null&&S!==void 0?S:Ue)!==null&&T!==void 0?T:!0,strictNumbers:(M=(F=L.strictNumbers)!==null&&F!==void 0?F:Ue)!==null&&M!==void 0?M:!0,strictTypes:(Y=(W=L.strictTypes)!==null&&W!==void 0?W:Ue)!==null&&Y!==void 0?Y:"log",strictTuples:(j=(N=L.strictTuples)!==null&&N!==void 0?N:Ue)!==null&&j!==void 0?j:"log",strictRequired:(D=(V=L.strictRequired)!==null&&V!==void 0?V:Ue)!==null&&D!==void 0?D:!1,code:L.code?{...L.code,optimize:br,regExp:$r}:{optimize:br,regExp:$r},loopRequired:(H=L.loopRequired)!==null&&H!==void 0?H:s,loopEnum:(te=L.loopEnum)!==null&&te!==void 0?te:s,meta:(le=L.meta)!==null&&le!==void 0?le:!0,messages:($e=L.messages)!==null&&$e!==void 0?$e:!0,inlineRefs:(me=L.inlineRefs)!==null&&me!==void 0?me:!0,schemaId:(ye=L.schemaId)!==null&&ye!==void 0?ye:"$id",addUsedSchema:(ue=L.addUsedSchema)!==null&&ue!==void 0?ue:!0,validateSchema:(Me=L.validateSchema)!==null&&Me!==void 0?Me:!0,validateFormats:(be=L.validateFormats)!==null&&be!==void 0?be:!0,unicodeRegExp:(Gt=L.unicodeRegExp)!==null&&Gt!==void 0?Gt:!0,int32range:(Ht=L.int32range)!==null&&Ht!==void 0?Ht:!0,uriResolver:Yo}}class w{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...i(O)};const{es5:C,lines:k}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:x,es5:C,lines:k}),this.logger=U(O.logger);const f=O.validateFormats;O.validateFormats=!1,this.RULES=(0,l.getRules)(),g.call(this,h,O,"NOT SUPPORTED"),g.call(this,p,O,"DEPRECATED","warn"),this._metaOpts=z.call(this),O.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&A.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:k}=this.opts;let f=P;k==="id"&&(f={...P},f.id=f.$id,delete f.$id),C&&O&&this.addMetaSchema(f,f[k],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let k;if(typeof O=="string"){if(k=this.getSchema(O),!k)throw new Error(`no schema with key or ref "${O}"`)}else k=this.compile(O);const f=k(C);return"$async"in k||(this.errors=k.errors),f}compile(O,C){const k=this._addSchema(O,C);return k.validate||this._compileSchemaEnv(k)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:k}=this.opts;return f.call(this,O,C);async function f(Y,N){await S.call(this,Y.$schema);const j=this._addSchema(Y,N);return j.validate||T.call(this,j)}async function S(Y){Y&&!this.getSchema(Y)&&await f.call(this,{$ref:Y},!0)}async function T(Y){try{return this._compileSchemaEnv(Y)}catch(N){if(!(N instanceof o.default))throw N;return F.call(this,N),await M.call(this,N.missingSchema),T.call(this,Y)}}function F({missingSchema:Y,missingRef:N}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${N} cannot be resolved`)}async function M(Y){const N=await W.call(this,Y);this.refs[Y]||await S.call(this,N.$schema),this.refs[Y]||this.addSchema(N,Y,C)}async function W(Y){const N=this._loading[Y];if(N)return N;try{return await(this._loading[Y]=k(Y))}finally{delete this._loading[Y]}}}addSchema(O,C,k,f=this.opts.validateSchema){if(Array.isArray(O)){for(const T of O)this.addSchema(T,void 0,k,f);return this}let S;if(typeof O=="object"){const{schemaId:T}=this.opts;if(S=O[T],S!==void 0&&typeof S!="string")throw new Error(`schema ${T} must be string`)}return C=(0,y.normalizeId)(C||S),this._checkUnique(C),this.schemas[C]=this._addSchema(O,k,C,f,!0),this}addMetaSchema(O,C,k=this.opts.validateSchema){return this.addSchema(O,C,!0,k),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let k;if(k=O.$schema,k!==void 0&&typeof k!="string")throw new Error("$schema must be a string");if(k=k||this.opts.defaultMeta||this.defaultMeta(),!k)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(k,O);if(!f&&C){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return f}getSchema(O){let C;for(;typeof(C=_.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:k}=this.opts,f=new a.SchemaEnv({schema:{},schemaId:k});if(C=a.resolveSchema.call(this,f,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=_.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let k=O[this.opts.schemaId];return k&&(k=(0,y.normalizeId)(k),delete this.schemas[k],delete this.refs[k]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let k;if(typeof O=="string")k=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=k);else if(typeof O=="object"&&C===void 0){if(C=O,k=C.keyword,Array.isArray(k)&&!k.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,k,C),!C)return(0,m.eachItem)(k,S=>ae.call(this,S)),this;de.call(this,C);const f={...C,type:(0,d.getJSONTypes)(C.type),schemaType:(0,d.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(k,f.type.length===0?S=>ae.call(this,S,f):S=>f.type.forEach(T=>ae.call(this,S,f,T))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const k of C.rules){const f=k.rules.findIndex(S=>S.keyword===O);f>=0&&k.rules.splice(f,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:k="data"}={}){return!O||O.length===0?"No errors":O.map(f=>`${k}${f.instancePath} ${f.message}`).reduce((f,S)=>f+C+S)}$dataMetaSchema(O,C){const k=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const f of C){const S=f.split("/").slice(1);let T=O;for(const F of S)T=T[F];for(const F in k){const M=k[F];if(typeof M!="object")continue;const{$data:W}=M.definition,Y=T[F];W&&Y&&(T[F]=pe(Y))}}return O}_removeAllSchemas(O,C){for(const k in O){const f=O[k];(!C||C.test(k))&&(typeof f=="string"?delete O[k]:f&&!f.meta&&(this._cache.delete(f.schema),delete O[k]))}}_addSchema(O,C,k,f=this.opts.validateSchema,S=this.opts.addUsedSchema){let T;const{schemaId:F}=this.opts;if(typeof O=="object")T=O[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get(O);if(M!==void 0)return M;k=(0,y.normalizeId)(T||k);const W=y.getSchemaRefs.call(this,O,k);return M=new a.SchemaEnv({schema:O,schemaId:F,meta:C,baseId:k,localRefs:W}),this._cache.set(M.schema,M),S&&!k.startsWith("#")&&(k&&this._checkUnique(k),this.refs[k]=M),f&&this.validateSchema(O,!0),M}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):a.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,O)}finally{this.opts=C}}}w.ValidationError=n.default,w.MissingRefError=o.default,e.default=w;function g(L,O,C,k="error"){for(const f in L){const S=f;S in O&&this.logger[k](`${C}: option ${f}. ${L[S]}`)}}function _(L){return L=(0,y.normalizeId)(L),this.schemas[L]||this.refs[L]}function E(){const L=this.opts.schemas;if(L)if(Array.isArray(L))this.addSchema(L);else for(const O in L)this.addSchema(L[O],O)}function I(){for(const L in this.opts.formats){const O=this.opts.formats[L];O&&this.addFormat(L,O)}}function A(L){if(Array.isArray(L)){this.addVocabulary(L);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in L){const C=L[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function z(){const L={...this.opts};for(const O of v)delete L[O];return L}const R={log(){},warn(){},error(){}};function U(L){if(L===!1)return R;if(L===void 0)return console;if(L.log&&L.warn&&L.error)return L;throw new Error("logger must implement log, warn and error methods")}const B=/^[a-z_$][a-z0-9_$:-]*$/i;function G(L,O){const{RULES:C}=this;if((0,m.eachItem)(L,k=>{if(C.keywords[k])throw new Error(`Keyword ${k} is already defined`);if(!B.test(k))throw new Error(`Keyword ${k} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function ae(L,O,C){var k;const f=O?.post;if(C&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let T=f?S.post:S.rules.find(({type:M})=>M===C);if(T||(T={type:C,rules:[]},S.rules.push(T)),S.keywords[L]=!0,!O)return;const F={keyword:L,definition:{...O,type:(0,d.getJSONTypes)(O.type),schemaType:(0,d.getJSONTypes)(O.schemaType)}};O.before?se.call(this,T,F,O.before):T.rules.push(F),S.all[L]=F,(k=O.implements)===null||k===void 0||k.forEach(M=>this.addKeyword(M))}function se(L,O,C){const k=L.rules.findIndex(f=>f.keyword===C);k>=0?L.rules.splice(k,0,O):(L.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function de(L){let{metaSchema:O}=L;O!==void 0&&(L.$data&&this.opts.$data&&(O=pe(O)),L.validateSchema=this.compile(O,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(L){return{anyOf:[L,ne]}}})(rn)),rn}var ft={},ht={},mt={},Dn;function os(){if(Dn)return mt;Dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return mt.default=e,mt}var Ce={},zn;function as(){if(zn)return Ce;zn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.callRef=Ce.getValidate=void 0;const e=dt(),t=Se(),r=X(),n=ke(),o=lr(),l=re(),a={keyword:"$ref",schemaType:"string",code(d){const{gen:m,schema:P,it:b}=d,{baseId:u,schemaEnv:v,validateName:x,opts:h,self:p}=b,{root:s}=v;if((P==="#"||P==="#/")&&u===s.baseId)return w();const i=o.resolveRef.call(p,s,u,P);if(i===void 0)throw new e.default(b.opts.uriResolver,u,P);if(i instanceof o.SchemaEnv)return g(i);return _(i);function w(){if(v===s)return y(d,x,v,v.$async);const E=m.scopeValue("root",{ref:s});return y(d,(0,r._)`${E}.validate`,s,s.$async)}function g(E){const I=c(d,E);y(d,I,E,E.$async)}function _(E){const I=m.scopeValue("schema",h.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),A=m.name("valid"),z=d.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:P},A);d.mergeEvaluated(z),d.ok(A)}}};function c(d,m){const{gen:P}=d;return m.validate?P.scopeValue("validate",{ref:m.validate}):(0,r._)`${P.scopeValue("wrapper",{ref:m})}.validate`}Ce.getValidate=c;function y(d,m,P,b){const{gen:u,it:v}=d,{allErrors:x,schemaEnv:h,opts:p}=v,s=p.passContext?n.default.this:r.nil;b?i():w();function i(){if(!h.$async)throw new Error("async schema referenced by sync schema");const E=u.let("valid");u.try(()=>{u.code((0,r._)`await ${(0,t.callValidateCode)(d,m,s)}`),_(m),x||u.assign(E,!0)},I=>{u.if((0,r._)`!(${I} instanceof ${v.ValidationError})`,()=>u.throw(I)),g(I),x||u.assign(E,!1)}),d.ok(E)}function w(){d.result((0,t.callValidateCode)(d,m,s),()=>_(m),()=>g(m))}function g(E){const I=(0,r._)`${E}.errors`;u.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),u.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(E){var I;if(!v.opts.unevaluated)return;const A=(I=P?.validate)===null||I===void 0?void 0:I.evaluated;if(v.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(v.props=l.mergeEvaluated.props(u,A.props,v.props));else{const z=u.var("props",(0,r._)`${E}.evaluated.props`);v.props=l.mergeEvaluated.props(u,z,v.props,r.Name)}if(v.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(v.items=l.mergeEvaluated.items(u,A.items,v.items));else{const z=u.var("items",(0,r._)`${E}.evaluated.items`);v.items=l.mergeEvaluated.items(u,z,v.items,r.Name)}}}return Ce.callRef=y,Ce.default=a,Ce}var Fn;function ss(){if(Fn)return ht;Fn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=os(),t=as(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ht.default=r,ht}var yt={},vt={},Un;function is(){if(Un)return vt;Un=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=X(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:l,schemaCode:a})=>(0,e.str)`must be ${r[l].okStr} ${a}`,params:({keyword:l,schemaCode:a})=>(0,e._)`{comparison: ${r[l].okStr}, limit: ${a}}`},o={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(l){const{keyword:a,data:c,schemaCode:y}=l;l.fail$data((0,e._)`${c} ${r[a].fail} ${y} || isNaN(${c})`)}};return vt.default=o,vt}var gt={},Kn;function ls(){if(Kn)return gt;Kn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=X(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:n,data:o,schemaCode:l,it:a}=r,c=a.opts.multipleOfPrecision,y=n.let("res"),d=c?(0,e._)`Math.abs(Math.round(${y}) - ${y}) > 1e-${c}`:(0,e._)`${y} !== parseInt(${y})`;r.fail$data((0,e._)`(${l} === 0 || (${y} = ${o}/${l}, ${d}))`)}};return gt.default=t,gt}var bt={},$t={},Bn;function us(){if(Bn)return $t;Bn=1,Object.defineProperty($t,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,o=0,l;for(;o<r;)n++,l=t.charCodeAt(o++),l>=55296&&l<=56319&&o<r&&(l=t.charCodeAt(o),(l&64512)===56320&&o++);return n}return $t.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',$t}var Wn;function cs(){if(Wn)return bt;Wn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=X(),t=re(),r=us(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:l}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${l} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:l,data:a,schemaCode:c,it:y}=o,d=l==="maxLength"?e.operators.GT:e.operators.LT,m=y.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data((0,e._)`${m} ${d} ${c}`)}};return bt.default=n,bt}var wt={},Gn;function ds(){if(Gn)return wt;Gn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Se(),t=re(),r=X(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:l,data:a,$data:c,schema:y,schemaCode:d,it:m}=o,P=m.opts.unicodeRegExp?"u":"";if(c){const{regExp:b}=m.opts.code,u=b.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(l,b),v=l.let("valid");l.try(()=>l.assign(v,(0,r._)`${u}(${d}, ${P}).test(${a})`),()=>l.assign(v,!1)),o.fail$data((0,r._)`!${v}`)}else{const b=(0,e.usePattern)(o,y);o.fail$data((0,r._)`!${b}.test(${a})`)}}};return wt.default=n,wt}var _t={},Hn;function ps(){if(Hn)return _t;Hn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=X(),t={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,a=n==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${o}).length ${a} ${l}`)}};return _t.default=t,_t}var St={},Jn;function fs(){if(Jn)return St;Jn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=Se(),t=X(),r=re(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:l,schema:a,schemaCode:c,data:y,$data:d,it:m}=o,{opts:P}=m;if(!d&&a.length===0)return;const b=a.length>=P.loopRequired;if(m.allErrors?u():v(),P.strictRequired){const p=o.parentSchema.properties,{definedProperties:s}=o.it;for(const i of a)if(p?.[i]===void 0&&!s.has(i)){const w=m.schemaEnv.baseId+m.errSchemaPath,g=`required property "${i}" is not defined at "${w}" (strictRequired)`;(0,r.checkStrictMode)(m,g,m.opts.strictRequired)}}function u(){if(b||d)o.block$data(t.nil,x);else for(const p of a)(0,e.checkReportMissingProp)(o,p)}function v(){const p=l.let("missing");if(b||d){const s=l.let("valid",!0);o.block$data(s,()=>h(p,s)),o.ok(s)}else l.if((0,e.checkMissingProp)(o,a,p)),(0,e.reportMissingProp)(o,p),l.else()}function x(){l.forOf("prop",c,p=>{o.setParams({missingProperty:p}),l.if((0,e.noPropertyInData)(l,y,p,P.ownProperties),()=>o.error())})}function h(p,s){o.setParams({missingProperty:p}),l.forOf(p,c,()=>{l.assign(s,(0,e.propertyInData)(l,y,p,P.ownProperties)),l.if((0,t.not)(s),()=>{o.error(),l.break()})},t.nil)}}};return St.default=n,St}var Et={},Zn;function hs(){if(Zn)return Et;Zn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=X(),t={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,a=n==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${o}.length ${a} ${l}`)}};return Et.default=t,Et}var xt={},Pt={},Qn;function dr(){if(Qn)return Pt;Qn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=kn();return e.code='require("ajv/dist/runtime/equal").default',Pt.default=e,Pt}var Yn;function ms(){if(Yn)return xt;Yn=1,Object.defineProperty(xt,"__esModule",{value:!0});const e=it(),t=X(),r=re(),n=dr(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${l} are identical)`,params:({params:{i:l,j:a}})=>(0,t._)`{i: ${l}, j: ${a}}`},code(l){const{gen:a,data:c,$data:y,schema:d,parentSchema:m,schemaCode:P,it:b}=l;if(!y&&!d)return;const u=a.let("valid"),v=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(u,x,(0,t._)`${P} === false`),l.ok(u);function x(){const i=a.let("i",(0,t._)`${c}.length`),w=a.let("j");l.setParams({i,j:w}),a.assign(u,!0),a.if((0,t._)`${i} > 1`,()=>(h()?p:s)(i,w))}function h(){return v.length>0&&!v.some(i=>i==="object"||i==="array")}function p(i,w){const g=a.name("item"),_=(0,e.checkDataTypes)(v,g,b.opts.strictNumbers,e.DataType.Wrong),E=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${i}--;`,()=>{a.let(g,(0,t._)`${c}[${i}]`),a.if(_,(0,t._)`continue`),v.length>1&&a.if((0,t._)`typeof ${g} == "string"`,(0,t._)`${g} += "_"`),a.if((0,t._)`typeof ${E}[${g}] == "number"`,()=>{a.assign(w,(0,t._)`${E}[${g}]`),l.error(),a.assign(u,!1).break()}).code((0,t._)`${E}[${g}] = ${i}`)})}function s(i,w){const g=(0,r.useFunc)(a,n.default),_=a.name("outer");a.label(_).for((0,t._)`;${i}--;`,()=>a.for((0,t._)`${w} = ${i}; ${w}--;`,()=>a.if((0,t._)`${g}(${c}[${i}], ${c}[${w}])`,()=>{l.error(),a.assign(u,!1).break(_)})))}}};return xt.default=o,xt}var kt={},Xn;function ys(){if(Xn)return kt;Xn=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=X(),t=re(),r=dr(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:l,data:a,$data:c,schemaCode:y,schema:d}=o;c||d&&typeof d=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(l,r.default)}(${a}, ${y})`):o.fail((0,e._)`${d} !== ${a}`)}};return kt.default=n,kt}var Nt={},eo;function vs(){if(eo)return Nt;eo=1,Object.defineProperty(Nt,"__esModule",{value:!0});const e=X(),t=re(),r=dr(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:l,data:a,$data:c,schema:y,schemaCode:d,it:m}=o;if(!c&&y.length===0)throw new Error("enum must have non-empty array");const P=y.length>=m.opts.loopEnum;let b;const u=()=>b??(b=(0,t.useFunc)(l,r.default));let v;if(P||c)v=l.let("valid"),o.block$data(v,x);else{if(!Array.isArray(y))throw new Error("ajv implementation error");const p=l.const("vSchema",d);v=(0,e.or)(...y.map((s,i)=>h(p,i)))}o.pass(v);function x(){l.assign(v,!1),l.forOf("v",d,p=>l.if((0,e._)`${u()}(${a}, ${p})`,()=>l.assign(v,!0).break()))}function h(p,s){const i=y[s];return typeof i=="object"&&i!==null?(0,e._)`${u()}(${a}, ${p}[${s}])`:(0,e._)`${a} === ${i}`}}};return Nt.default=n,Nt}var to;function gs(){if(to)return yt;to=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=is(),t=ls(),r=cs(),n=ds(),o=ps(),l=fs(),a=hs(),c=ms(),y=ys(),d=vs(),m=[e.default,t.default,r.default,n.default,o.default,l.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},y.default,d.default];return yt.default=m,yt}var jt={},De={},ro;function no(){if(ro)return De;ro=1,Object.defineProperty(De,"__esModule",{value:!0}),De.validateAdditionalItems=void 0;const e=X(),t=re(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:l,it:a}=o,{items:c}=l;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(o,c)}};function n(o,l){const{gen:a,schema:c,data:y,keyword:d,it:m}=o;m.items=!0;const P=a.const("len",(0,e._)`${y}.length`);if(c===!1)o.setParams({len:l.length}),o.pass((0,e._)`${P} <= ${l.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(m,c)){const u=a.var("valid",(0,e._)`${P} <= ${l.length}`);a.if((0,e.not)(u),()=>b(u)),o.ok(u)}function b(u){a.forRange("i",l.length,P,v=>{o.subschema({keyword:d,dataProp:v,dataPropType:t.Type.Num},u),m.allErrors||a.if((0,e.not)(u),()=>a.break())})}}return De.validateAdditionalItems=n,De.default=r,De}var Ot={},ze={},oo;function ao(){if(oo)return ze;oo=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.validateTuple=void 0;const e=X(),t=re(),r=Se(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(l){const{schema:a,it:c}=l;if(Array.isArray(a))return o(l,"additionalItems",a);c.items=!0,!(0,t.alwaysValidSchema)(c,a)&&l.ok((0,r.validateArray)(l))}};function o(l,a,c=l.schema){const{gen:y,parentSchema:d,data:m,keyword:P,it:b}=l;x(d),b.opts.unevaluated&&c.length&&b.items!==!0&&(b.items=t.mergeEvaluated.items(y,c.length,b.items));const u=y.name("valid"),v=y.const("len",(0,e._)`${m}.length`);c.forEach((h,p)=>{(0,t.alwaysValidSchema)(b,h)||(y.if((0,e._)`${v} > ${p}`,()=>l.subschema({keyword:P,schemaProp:p,dataProp:p},u)),l.ok(u))});function x(h){const{opts:p,errSchemaPath:s}=b,i=c.length,w=i===h.minItems&&(i===h.maxItems||h[a]===!1);if(p.strictTuples&&!w){const g=`"${P}" is ${i}-tuple, but minItems or maxItems/${a} are not specified or different at path "${s}"`;(0,t.checkStrictMode)(b,g,p.strictTuples)}}}return ze.validateTuple=o,ze.default=n,ze}var so;function bs(){if(so)return Ot;so=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=ao(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Ot.default=t,Ot}var Ct={},io;function $s(){if(io)return Ct;io=1,Object.defineProperty(Ct,"__esModule",{value:!0});const e=X(),t=re(),r=Se(),n=no(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:a,parentSchema:c,it:y}=l,{prefixItems:d}=c;y.items=!0,!(0,t.alwaysValidSchema)(y,a)&&(d?(0,n.validateAdditionalItems)(l,d):l.ok((0,r.validateArray)(l)))}};return Ct.default=o,Ct}var Tt={},lo;function ws(){if(lo)return Tt;lo=1,Object.defineProperty(Tt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:o}})=>o===void 0?(0,e.str)`must contain at least ${n} valid item(s)`:(0,e.str)`must contain at least ${n} and no more than ${o} valid item(s)`,params:({params:{min:n,max:o}})=>o===void 0?(0,e._)`{minContains: ${n}}`:(0,e._)`{minContains: ${n}, maxContains: ${o}}`},code(n){const{gen:o,schema:l,parentSchema:a,data:c,it:y}=n;let d,m;const{minContains:P,maxContains:b}=a;y.opts.next?(d=P===void 0?1:P,m=b):d=1;const u=o.const("len",(0,e._)`${c}.length`);if(n.setParams({min:d,max:m}),m===void 0&&d===0){(0,t.checkStrictMode)(y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&d>m){(0,t.checkStrictMode)(y,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,t.alwaysValidSchema)(y,l)){let s=(0,e._)`${u} >= ${d}`;m!==void 0&&(s=(0,e._)`${s} && ${u} <= ${m}`),n.pass(s);return}y.items=!0;const v=o.name("valid");m===void 0&&d===1?h(v,()=>o.if(v,()=>o.break())):d===0?(o.let(v,!0),m!==void 0&&o.if((0,e._)`${c}.length > 0`,x)):(o.let(v,!1),x()),n.result(v,()=>n.reset());function x(){const s=o.name("_valid"),i=o.let("count",0);h(s,()=>o.if(s,()=>p(i)))}function h(s,i){o.forRange("i",0,u,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:t.Type.Num,compositeRule:!0},s),i()})}function p(s){o.code((0,e._)`${s}++`),m===void 0?o.if((0,e._)`${s} >= ${d}`,()=>o.assign(v,!0).break()):(o.if((0,e._)`${s} > ${m}`,()=>o.assign(v,!1).break()),d===1?o.assign(v,!0):o.if((0,e._)`${s} >= ${d}`,()=>o.assign(v,!0)))}}};return Tt.default=r,Tt}var uo={},co;function _s(){return co||(co=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=X(),r=re(),n=Se();e.error={message:({params:{property:y,depsCount:d,deps:m}})=>{const P=d===1?"property":"properties";return(0,t.str)`must have ${P} ${m} when property ${y} is present`},params:({params:{property:y,depsCount:d,deps:m,missingProperty:P}})=>(0,t._)`{property: ${y},
7
7
  missingProperty: ${P},
8
8
  depsCount: ${d},
9
- deps: ${m}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(y){const[d,m]=l(y);s(y,d),c(y,m)}};function l({schema:y}){const d={},m={};for(const P in y){if(P==="__proto__")continue;const b=Array.isArray(y[P])?d:m;b[P]=y[P]}return[d,m]}function s(y,d=y.schema){const{gen:m,data:P,it:b}=y;if(Object.keys(d).length===0)return;const u=m.let("missing");for(const v in d){const x=d[v];if(x.length===0)continue;const h=(0,n.propertyInData)(m,P,v,b.opts.ownProperties);y.setParams({property:v,depsCount:x.length,deps:x.join(", ")}),b.allErrors?m.if(h,()=>{for(const p of x)(0,n.checkReportMissingProp)(y,p)}):(m.if((0,t._)`${h} && (${(0,n.checkMissingProp)(y,x,u)})`),(0,n.reportMissingProp)(y,u),m.else())}}e.validatePropertyDeps=s;function c(y,d=y.schema){const{gen:m,data:P,keyword:b,it:u}=y,v=m.name("valid");for(const x in d)(0,r.alwaysValidSchema)(u,d[x])||(m.if((0,n.propertyInData)(m,P,x,u.opts.ownProperties),()=>{const h=y.subschema({keyword:b,schemaProp:x},v);y.mergeValidEvaluated(h,v)},()=>m.var(v,!0)),y.ok(v))}e.validateSchemaDeps=c,e.default=o})(uo)),uo}var It={},po;function Es(){if(po)return It;po=1,Object.defineProperty(It,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,e._)`{propertyName: ${n.propertyName}}`},code(n){const{gen:o,schema:l,data:s,it:c}=n;if((0,t.alwaysValidSchema)(c,l))return;const y=o.name("valid");o.forIn("key",s,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},y),o.if((0,e.not)(y),()=>{n.error(!0),c.allErrors||o.break()})}),n.ok(y)}};return It.default=r,It}var Vt={},fo;function ho(){if(fo)return Vt;fo=1,Object.defineProperty(Vt,"__esModule",{value:!0});const e=Se(),t=X(),r=ke(),n=re(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:s,schema:c,parentSchema:y,data:d,errsCount:m,it:P}=l;if(!m)throw new Error("ajv implementation error");const{allErrors:b,opts:u}=P;if(P.props=!0,u.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(P,c))return;const v=(0,e.allSchemaProperties)(y.properties),x=(0,e.allSchemaProperties)(y.patternProperties);h(),l.ok((0,t._)`${m} === ${r.default.errors}`);function h(){s.forIn("key",d,g=>{!v.length&&!x.length?i(g):s.if(p(g),()=>i(g))})}function p(g){let _;if(v.length>8){const E=(0,n.schemaRefOrVal)(P,y.properties,"properties");_=(0,e.isOwnProperty)(s,E,g)}else v.length?_=(0,t.or)(...v.map(E=>(0,t._)`${g} === ${E}`)):_=t.nil;return x.length&&(_=(0,t.or)(_,...x.map(E=>(0,t._)`${(0,e.usePattern)(l,E)}.test(${g})`))),(0,t.not)(_)}function a(g){s.code((0,t._)`delete ${d}[${g}]`)}function i(g){if(u.removeAdditional==="all"||u.removeAdditional&&c===!1){a(g);return}if(c===!1){l.setParams({additionalProperty:g}),l.error(),b||s.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(P,c)){const _=s.name("valid");u.removeAdditional==="failing"?(w(g,_,!1),s.if((0,t.not)(_),()=>{l.reset(),a(g)})):(w(g,_),b||s.if((0,t.not)(_),()=>s.break()))}}function w(g,_,E){const I={keyword:"additionalProperties",dataProp:g,dataPropType:n.Type.Str};E===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(I,_)}}};return Vt.default=o,Vt}var Rt={},mo;function xs(){if(mo)return Rt;mo=1,Object.defineProperty(Rt,"__esModule",{value:!0});const e=Qe(),t=Se(),r=re(),n=ho(),o={keyword:"properties",type:"object",schemaType:"object",code(l){const{gen:s,schema:c,parentSchema:y,data:d,it:m}=l;m.opts.removeAdditional==="all"&&y.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const P=(0,t.allSchemaProperties)(c);for(const h of P)m.definedProperties.add(h);m.opts.unevaluated&&P.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(s,(0,r.toHash)(P),m.props));const b=P.filter(h=>!(0,r.alwaysValidSchema)(m,c[h]));if(b.length===0)return;const u=s.name("valid");for(const h of b)v(h)?x(h):(s.if((0,t.propertyInData)(s,d,h,m.opts.ownProperties)),x(h),m.allErrors||s.else().var(u,!0),s.endIf()),l.it.definedProperties.add(h),l.ok(u);function v(h){return m.opts.useDefaults&&!m.compositeRule&&c[h].default!==void 0}function x(h){l.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};return Rt.default=o,Rt}var Lt={},yo;function Ps(){if(yo)return Lt;yo=1,Object.defineProperty(Lt,"__esModule",{value:!0});const e=Se(),t=X(),r=re(),n=re(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(l){const{gen:s,schema:c,data:y,parentSchema:d,it:m}=l,{opts:P}=m,b=(0,e.allSchemaProperties)(c),u=b.filter(w=>(0,r.alwaysValidSchema)(m,c[w]));if(b.length===0||u.length===b.length&&(!m.opts.unevaluated||m.props===!0))return;const v=P.strictSchema&&!P.allowMatchingProperties&&d.properties,x=s.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(s,m.props));const{props:h}=m;p();function p(){for(const w of b)v&&a(w),m.allErrors?i(w):(s.var(x,!0),i(w),s.if(x))}function a(w){for(const g in v)new RegExp(w).test(g)&&(0,r.checkStrictMode)(m,`property ${g} matches pattern ${w} (use allowMatchingProperties)`)}function i(w){s.forIn("key",y,g=>{s.if((0,t._)`${(0,e.usePattern)(l,w)}.test(${g})`,()=>{const _=u.includes(w);_||l.subschema({keyword:"patternProperties",schemaProp:w,dataProp:g,dataPropType:n.Type.Str},x),m.opts.unevaluated&&h!==!0?s.assign((0,t._)`${h}[${g}]`,!0):!_&&!m.allErrors&&s.if((0,t.not)(x),()=>s.break())})})}}};return Lt.default=o,Lt}var Mt={},vo;function ks(){if(vo)return Mt;vo=1,Object.defineProperty(Mt,"__esModule",{value:!0});const e=re(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:o,it:l}=r;if((0,e.alwaysValidSchema)(l,o)){r.fail();return}const s=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Mt.default=t,Mt}var At={},go;function Ns(){if(go)return At;go=1,Object.defineProperty(At,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Se().validateUnion,error:{message:"must match a schema in anyOf"}};return At.default=e,At}var qt={},bo;function js(){if(bo)return qt;bo=1,Object.defineProperty(qt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,e._)`{passingSchemas: ${n.passing}}`},code(n){const{gen:o,schema:l,parentSchema:s,it:c}=n;if(!Array.isArray(l))throw new Error("ajv implementation error");if(c.opts.discriminator&&s.discriminator)return;const y=l,d=o.let("valid",!1),m=o.let("passing",null),P=o.name("_valid");n.setParams({passing:m}),o.block(b),n.result(d,()=>n.reset(),()=>n.error(!0));function b(){y.forEach((u,v)=>{let x;(0,t.alwaysValidSchema)(c,u)?o.var(P,!0):x=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},P),v>0&&o.if((0,e._)`${P} && ${d}`).assign(d,!1).assign(m,(0,e._)`[${m}, ${v}]`).else(),o.if(P,()=>{o.assign(d,!0),o.assign(m,v),x&&n.mergeEvaluated(x,e.Name)})})}}};return qt.default=r,qt}var Dt={},$o;function Os(){if($o)return Dt;$o=1,Object.defineProperty(Dt,"__esModule",{value:!0});const e=re(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:o,it:l}=r;if(!Array.isArray(o))throw new Error("ajv implementation error");const s=n.name("valid");o.forEach((c,y)=>{if((0,e.alwaysValidSchema)(l,c))return;const d=r.subschema({keyword:"allOf",schemaProp:y},s);r.ok(s),r.mergeEvaluated(d)})}};return Dt.default=t,Dt}var zt={},wo;function Cs(){if(wo)return zt;wo=1,Object.defineProperty(zt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:l,parentSchema:s,it:c}=o;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const y=n(c,"then"),d=n(c,"else");if(!y&&!d)return;const m=l.let("valid",!0),P=l.name("_valid");if(b(),o.reset(),y&&d){const v=l.let("ifClause");o.setParams({ifClause:v}),l.if(P,u("then",v),u("else",v))}else y?l.if(P,u("then")):l.if((0,e.not)(P),u("else"));o.pass(m,()=>o.error(!0));function b(){const v=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},P);o.mergeEvaluated(v)}function u(v,x){return()=>{const h=o.subschema({keyword:v},P);l.assign(m,P),o.mergeValidEvaluated(h,m),x?l.assign(x,(0,e._)`${v}`):o.setParams({ifClause:v})}}}};function n(o,l){const s=o.schema[l];return s!==void 0&&!(0,t.alwaysValidSchema)(o,s)}return zt.default=r,zt}var Ft={},_o;function Ts(){if(_o)return Ft;_o=1,Object.defineProperty(Ft,"__esModule",{value:!0});const e=re(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:o}){n.if===void 0&&(0,e.checkStrictMode)(o,`"${r}" without "if" is ignored`)}};return Ft.default=t,Ft}var So;function Is(){if(So)return jt;So=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=no(),t=$s(),r=ao(),n=ws(),o=_s(),l=Ss(),s=Es(),c=ho(),y=xs(),d=Ps(),m=ks(),P=Ns(),b=js(),u=Os(),v=Cs(),x=Ts();function h(p=!1){const a=[m.default,P.default,b.default,u.default,v.default,x.default,s.default,c.default,l.default,y.default,d.default];return p?a.push(t.default,n.default):a.push(e.default,r.default),a.push(o.default),a}return jt.default=h,jt}var Ut={},Kt={},Eo;function Vs(){if(Eo)return Kt;Eo=1,Object.defineProperty(Kt,"__esModule",{value:!0});const e=X(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,n){const{gen:o,data:l,$data:s,schema:c,schemaCode:y,it:d}=r,{opts:m,errSchemaPath:P,schemaEnv:b,self:u}=d;if(!m.validateFormats)return;s?v():x();function v(){const h=o.scopeValue("formats",{ref:u.formats,code:m.code.formats}),p=o.const("fDef",(0,e._)`${h}[${y}]`),a=o.let("fType"),i=o.let("format");o.if((0,e._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>o.assign(a,(0,e._)`${p}.type || "string"`).assign(i,(0,e._)`${p}.validate`),()=>o.assign(a,(0,e._)`"string"`).assign(i,p)),r.fail$data((0,e.or)(w(),g()));function w(){return m.strictSchema===!1?e.nil:(0,e._)`${y} && !${i}`}function g(){const _=b.$async?(0,e._)`(${p}.async ? await ${i}(${l}) : ${i}(${l}))`:(0,e._)`${i}(${l})`,E=(0,e._)`(typeof ${i} == "function" ? ${_} : ${i}.test(${l}))`;return(0,e._)`${i} && ${i} !== true && ${a} === ${n} && !${E}`}}function x(){const h=u.formats[c];if(!h){w();return}if(h===!0)return;const[p,a,i]=g(h);p===n&&r.pass(_());function w(){if(m.strictSchema===!1){u.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${P}"`}}function g(E){const I=E instanceof RegExp?(0,e.regexpCode)(E):m.code.formats?(0,e._)`${m.code.formats}${(0,e.getProperty)(c)}`:void 0,A=o.scopeValue("formats",{key:c,ref:E,code:I});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,e._)`${A}.validate`]:["string",E,A]}function _(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!b.$async)throw new Error("async format in sync schema");return(0,e._)`await ${i}(${l})`}return typeof a=="function"?(0,e._)`${i}(${l})`:(0,e._)`${i}.test(${l})`}}}};return Kt.default=t,Kt}var xo;function Rs(){if(xo)return Ut;xo=1,Object.defineProperty(Ut,"__esModule",{value:!0});const e=[Vs().default];return Ut.default=e,Ut}var Fe={},Po;function Ls(){return Po||(Po=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.contentVocabulary=Fe.metadataVocabulary=void 0,Fe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Fe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Fe}var ko;function Ms(){if(ko)return ft;ko=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=is(),t=bs(),r=Is(),n=Rs(),o=Ls(),l=[e.default,t.default,(0,r.default)(),n.default,o.metadataVocabulary,o.contentVocabulary];return ft.default=l,ft}var Bt={},Xe={},No;function As(){if(No)return Xe;No=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Xe.DiscrError=e={})),Xe}var jo;function qs(){if(jo)return Bt;jo=1,Object.defineProperty(Bt,"__esModule",{value:!0});const e=X(),t=As(),r=lr(),n=dt(),o=re(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:s,tagName:c}})=>s===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:s,tag:c,tagName:y}})=>(0,e._)`{error: ${s}, tag: ${y}, tagValue: ${c}}`},code(s){const{gen:c,data:y,schema:d,parentSchema:m,it:P}=s,{oneOf:b}=m;if(!P.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=d.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!b)throw new Error("discriminator: requires oneOf keyword");const v=c.let("valid",!1),x=c.const("tag",(0,e._)`${y}${(0,e.getProperty)(u)}`);c.if((0,e._)`typeof ${x} == "string"`,()=>h(),()=>s.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:u})),s.ok(v);function h(){const i=a();c.if(!1);for(const w in i)c.elseIf((0,e._)`${x} === ${w}`),c.assign(v,p(i[w]));c.else(),s.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:u}),c.endIf()}function p(i){const w=c.name("valid"),g=s.subschema({keyword:"oneOf",schemaProp:i},w);return s.mergeEvaluated(g,e.Name),w}function a(){var i;const w={},g=E(m);let _=!0;for(let z=0;z<b.length;z++){let R=b[z];if(R!=null&&R.$ref&&!(0,o.schemaHasRulesButRef)(R,P.self.RULES)){const B=R.$ref;if(R=r.resolveRef.call(P.self,P.schemaEnv.root,P.baseId,B),R instanceof r.SchemaEnv&&(R=R.schema),R===void 0)throw new n.default(P.opts.uriResolver,P.baseId,B)}const U=(i=R?.properties)===null||i===void 0?void 0:i[u];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);_=_&&(g||E(R)),I(U,z)}if(!_)throw new Error(`discriminator: "${u}" must be required`);return w;function E({required:z}){return Array.isArray(z)&&z.includes(u)}function I(z,R){if(z.const)A(z.const,R);else if(z.enum)for(const U of z.enum)A(U,R);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function A(z,R){if(typeof z!="string"||z in w)throw new Error(`discriminator: "${u}" values must be unique strings`);w[z]=R}}}};return Bt.default=l,Bt}const Ds="http://json-schema.org/draft-07/schema#",zs="http://json-schema.org/draft-07/schema#",Fs="Core schema meta-schema",Us={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ks=["object","boolean"],Bs={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Ws={$schema:Ds,$id:zs,title:Fs,definitions:Us,type:Ks,properties:Bs,default:!0};var Oo;function pr(){return Oo||(Oo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=os(),n=Ms(),o=qs(),l=Ws,s=["/properties"],c="http://json-schema.org/draft-07/schema";class y extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(l,s):l;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=y,e.exports=t=y,e.exports.Ajv=y,Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var d=Qe();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=X();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var P=ir();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return P.default}});var b=dt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return b.default}})})(ar,ar.exports)),ar.exports}var Gs=pr();const Hs=ot(Gs);var fr={exports:{}},Co={},To;function Js(){return To||(To=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(R,U){return{validate:R,compare:U}}e.fullFormats={date:t(l,s),time:t(y(!0),d),"date-time":t(b(!0),u),"iso-time":t(y(),m),"iso-date-time":t(b(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:i,int32:{type:"number",validate:_},int64:{type:"number",validate:E},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(R){return R%4===0&&(R%100!==0||R%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function l(R){const U=n.exec(R);if(!U)return!1;const B=+U[1],G=+U[2],ae=+U[3];return G>=1&&G<=12&&ae>=1&&ae<=(G===2&&r(B)?29:o[G])}function s(R,U){if(R&&U)return R>U?1:R<U?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function y(R){return function(U){const B=c.exec(U);if(!B)return!1;const G=+B[1],ae=+B[2],se=+B[3],de=B[4],ne=B[5]==="-"?-1:1,pe=+(B[6]||0),L=+(B[7]||0);if(pe>23||L>59||R&&!de)return!1;if(G<=23&&ae<=59&&se<60)return!0;const O=ae-L*ne,C=G-pe*ne-(O<0?1:0);return(C===23||C===-1)&&(O===59||O===-1)&&se<61}}function d(R,U){if(!(R&&U))return;const B=new Date("2020-01-01T"+R).valueOf(),G=new Date("2020-01-01T"+U).valueOf();if(B&&G)return B-G}function m(R,U){if(!(R&&U))return;const B=c.exec(R),G=c.exec(U);if(B&&G)return R=B[1]+B[2]+B[3],U=G[1]+G[2]+G[3],R>U?1:R<U?-1:0}const P=/t|\s/i;function b(R){const U=y(R);return function(B){const G=B.split(P);return G.length===2&&l(G[0])&&U(G[1])}}function u(R,U){if(!(R&&U))return;const B=new Date(R).valueOf(),G=new Date(U).valueOf();if(B&&G)return B-G}function v(R,U){if(!(R&&U))return;const[B,G]=R.split(P),[ae,se]=U.split(P),de=s(B,ae);if(de!==void 0)return de||d(G,se)}const x=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(R){return x.test(R)&&h.test(R)}const a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(R){return a.lastIndex=0,a.test(R)}const w=-2147483648,g=2**31-1;function _(R){return Number.isInteger(R)&&R<=g&&R>=w}function E(R){return Number.isInteger(R)}function I(){return!0}const A=/[^\\]\\Z/;function z(R){if(A.test(R))return!1;try{return new RegExp(R),!0}catch{return!1}}})(Co)),Co}var Io={},Vo;function Zs(){return Vo||(Vo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=pr(),r=X(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},l={message:({keyword:c,schemaCode:y})=>(0,r.str)`should be ${o[c].okStr} ${y}`,params:({keyword:c,schemaCode:y})=>(0,r._)`{comparison: ${o[c].okStr}, limit: ${y}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:l,code(c){const{gen:y,data:d,schemaCode:m,keyword:P,it:b}=c,{opts:u,self:v}=b;if(!u.validateFormats)return;const x=new t.KeywordCxt(b,v.RULES.all.format.definition,"format");x.$data?h():p();function h(){const i=y.scopeValue("formats",{ref:v.formats,code:u.code.formats}),w=y.const("fmt",(0,r._)`${i}[${x.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${w} != "object"`,(0,r._)`${w} instanceof RegExp`,(0,r._)`typeof ${w}.compare != "function"`,a(w)))}function p(){const i=x.schema,w=v.formats[i];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${P}": format "${i}" does not define "compare" function`);const g=y.scopeValue("formats",{key:i,ref:w,code:u.code.formats?(0,r._)`${u.code.formats}${(0,r.getProperty)(i)}`:void 0});c.fail$data(a(g))}function a(i){return(0,r._)`${i}.compare(${d}, ${m}) ${o[P].fail} 0`}},dependencies:["format"]};const s=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=s})(Io)),Io}var Ro;function Qs(){return Ro||(Ro=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Js(),n=Zs(),o=X(),l=new o.Name("fullFormats"),s=new o.Name("fastFormats"),c=(d,m={keywords:!0})=>{if(Array.isArray(m))return y(d,m,r.fullFormats,l),d;const[P,b]=m.mode==="fast"?[r.fastFormats,s]:[r.fullFormats,l],u=m.formats||r.formatNames;return y(d,u,P,b),m.keywords&&(0,n.default)(d),d};c.get=(d,m="full")=>{const P=(m==="fast"?r.fastFormats:r.fullFormats)[d];if(!P)throw new Error(`Unknown format "${d}"`);return P};function y(d,m,P,b){var u,v;(u=(v=d.opts.code).formats)!==null&&u!==void 0||(v.formats=(0,o._)`require("ajv-formats/dist/formats").${b}`);for(const x of m)d.addFormat(x,P[x])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fr,fr.exports)),fr.exports}var Ys=Qs();const Xs=ot(Ys);var hr={exports:{}},Lo;function ei(){return Lo||(Lo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=pr(),n=X(),o=He(),l=Qe(),s=Je(),c=ke(),y="errorMessage",d=new r.Name("emUsed"),m={required:"missingProperty",dependencies:"property",dependentRequired:"property"},P=/\$\{[^}]+\}/,b=/\$\{([^}]+)\}/g,u=/^""\s*\+\s*|\s*\+\s*""$/g;function v(h){return{keyword:y,schemaType:["string","object"],post:!0,code(p){const{gen:a,data:i,schema:w,schemaValue:g,it:_}=p;if(_.createErrors===!1)return;const E=w,I=n.strConcat(c.default.instancePath,_.errorPath);a.if(r._`${c.default.errors} > 0`,()=>{if(typeof E=="object"){const[k,f]=z(E);f&&R(f),k&&U(k),B(A(E))}const C=typeof E=="string"?E:E._;C&&G(C),h.keepErrors||ae()});function A({properties:C,items:k}){const f={};if(C){f.props={};for(const S in C)f.props[S]=[]}if(k){f.items={};for(let S=0;S<k.length;S++)f.items[S]=[]}return f}function z(C){let k,f;for(const S in C){if(S==="properties"||S==="items")continue;const T=C[S];if(typeof T=="object"){k||(k={});const F=k[S]={};for(const M in T)F[M]=[]}else f||(f={}),f[S]=[]}return[k,f]}function R(C){const k=a.const("emErrors",r.stringify(C)),f=a.const("templates",pe(C,w));a.forOf("err",c.default.vErrors,M=>a.if(se(M,k),()=>a.code(r._`${k}[${M}.keyword].push(${M})`).assign(r._`${M}.${d}`,!0)));const{singleError:S}=h;if(S){const M=a.let("message",r._`""`),W=a.let("paramsErrors",r._`[]`);T(Y=>{a.if(M,()=>a.code(r._`${M} += ${typeof S=="string"?S:";"}`)),a.code(r._`${M} += ${F(Y)}`),a.assign(W,r._`${W}.concat(${k}[${Y}])`)}),s.reportError(p,{message:M,params:r._`{errors: ${W}}`})}else T(M=>s.reportError(p,{message:F(M),params:r._`{errors: ${k}[${M}]}`}));function T(M){a.forIn("key",k,W=>a.if(r._`${k}[${W}].length`,()=>M(W)))}function F(M){return r._`${M} in ${f} ? ${f}[${M}]() : ${g}[${M}]`}}function U(C){const k=a.const("emErrors",r.stringify(C)),f=[];for(const W in C)f.push([W,pe(C[W],w[W])]);const S=a.const("templates",a.object(...f)),T=a.scopeValue("obj",{ref:m,code:r.stringify(m)}),F=a.let("emPropParams"),M=a.let("emParamsErrors");a.forOf("err",c.default.vErrors,W=>a.if(se(W,k),()=>{a.assign(F,r._`${T}[${W}.keyword]`),a.assign(M,r._`${k}[${W}.keyword][${W}.params[${F}]]`),a.if(M,()=>a.code(r._`${M}.push(${W})`).assign(r._`${W}.${d}`,!0))})),a.forIn("key",k,W=>a.forIn("keyProp",r._`${k}[${W}]`,Y=>{a.assign(M,r._`${k}[${W}][${Y}]`),a.if(r._`${M}.length`,()=>{const N=a.const("tmpl",r._`${S}[${W}] && ${S}[${W}][${Y}]`);s.reportError(p,{message:r._`${N} ? ${N}() : ${g}[${W}][${Y}]`,params:r._`{errors: ${M}}`})})}))}function B(C){const{props:k,items:f}=C;if(!k&&!f)return;const S=r._`typeof ${i} == "object"`,T=r._`Array.isArray(${i})`,F=a.let("emErrors");let M,W;const Y=a.let("templates");k&&f?(M=a.let("emChildKwd"),a.if(S),a.if(T,()=>{N(f,w.items),a.assign(M,r.str`items`)},()=>{N(k,w.properties),a.assign(M,r.str`properties`)}),W=r._`[${M}]`):f?(a.if(T),N(f,w.items),W=r._`.items`):k&&(a.if(n.and(S,n.not(T))),N(k,w.properties),W=r._`.properties`),a.forOf("err",c.default.vErrors,j=>de(j,F,V=>a.code(r._`${F}[${V}].push(${j})`).assign(r._`${j}.${d}`,!0))),a.forIn("key",F,j=>a.if(r._`${F}[${j}].length`,()=>{s.reportError(p,{message:r._`${j} in ${Y} ? ${Y}[${j}]() : ${g}${W}[${j}]`,params:r._`{errors: ${F}[${j}]}`}),a.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${I} + "/" + ${j}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),a.endIf();function N(j,V){a.assign(F,r.stringify(j)),a.assign(Y,pe(j,V))}}function G(C){const k=a.const("emErrs",r._`[]`);a.forOf("err",c.default.vErrors,f=>a.if(ne(f),()=>a.code(r._`${k}.push(${f})`).assign(r._`${f}.${d}`,!0))),a.if(r._`${k}.length`,()=>s.reportError(p,{message:L(C),params:r._`{errors: ${k}}`}))}function ae(){const C=a.const("emErrs",r._`[]`);a.forOf("err",c.default.vErrors,k=>a.if(r._`!${k}.${d}`,()=>a.code(r._`${C}.push(${k})`))),a.assign(c.default.vErrors,C).assign(c.default.errors,r._`${C}.length`)}function se(C,k){return n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,r._`${C}.instancePath === ${I}`,r._`${C}.keyword in ${k}`,r._`${C}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${C}.schemaPath.slice(${_.errSchemaPath.length}))`)}function de(C,k,f){a.if(n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,r._`${C}.instancePath.indexOf(${I}) === 0`),()=>{const S=a.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),T=a.const("emMatches",r._`${S}.exec(${C}.instancePath.slice(${I}.length))`),F=a.const("emChild",r._`${T} && ${T}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);a.if(r._`${F} !== undefined && ${F} in ${k}`,()=>f(F))})}function ne(C){return n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,n.or(r._`${C}.instancePath === ${I}`,n.and(r._`${C}.instancePath.indexOf(${I}) === 0`,r._`${C}.instancePath[${I}.length] === "/"`)),r._`${C}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`${C}.schemaPath[${_.errSchemaPath}.length] === "/"`)}function pe(C,k){const f=[];for(const S in C){const T=k[S];P.test(T)&&f.push([S,O(T)])}return a.object(...f)}function L(C){return P.test(C)?new o._Code(o.safeStringify(C).replace(b,(k,f)=>`" + JSON.stringify(${l.getData(f,_)}) + "`).replace(u,"")):r.stringify(C)}function O(C){return r._`function(){return ${L(C)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const x=(h,p={})=>{if(!h.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(h.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return h.addKeyword(v(p))};t.default=x,e.exports=x,e.exports.default=x})(hr,hr.exports)),hr.exports}var ti=ei();const ri=ot(ti);class ni{constructor(t){tt(this,"ajv"),tt(this,"pureAjv"),tt(this,"pureInlineCache",new WeakMap),tt(this,"mutateInlineCache",new WeakMap);const{customKeywords:r,customFormats:n,...o}=t||{};this.ajv=this.buildAjv(o,!0,r,n),this.pureAjv=this.buildAjv(o,!1,r,n)}buildAjv(t,r,n,o){const l=new Hs({allErrors:!0,code:{source:!1},coerceTypes:r,removeAdditional:!1,strict:!1,strictSchema:!1,useDefaults:r,validateFormats:!0,validateSchema:!1,verbose:!0,...t});return Xs(l),ri(l),this.addCustomKeywords(l,n||[]),this.addCustomFormats(l,o||{}),l}addCustomKeywords(t,r){r.forEach(n=>{t.addKeyword(n)})}addCustomFormats(t,r){Object.entries(r).forEach(([n,o])=>{o instanceof RegExp?t.addFormat(n,o):t.addFormat(n,{validate:o})})}createValidator(t,r=!0){const n=r?this.ajv:this.pureAjv;if(t.$id)return n.getSchema(t.$id)||n.compile(t);const o=r?this.mutateInlineCache:this.pureInlineCache,l=o.get(t);if(l)return l;const s=n.compile(t);return o.set(t,s),s}validate(t,r,n){const o=this.createValidator(r,n?.mutate??!0);if(!o(t)){const l=this.formatErrors(o.errors);if(n!=null&&n.throwOnError)throw new gr(l,o.errors||[]);return{valid:!1,errors:o.errors||void 0,errorMessage:l}}return{valid:!0,data:t}}formatErrors(t,r){return!t||t.length===0?"No errors":this.ajv.errorsText(t,{separator:"; ",dataVar:"data",...r})}getDetailedErrors(t){return!t||t.length===0?[]:t.map(r=>({field:r.instancePath||"/",message:r.message||"Validation failed",keyword:r.keyword,params:r.params,schemaPath:r.schemaPath}))}addSchema(t,r){return this.ajv.addSchema(t,r),this.pureAjv.addSchema(t,r),this}removeSchema(t){return this.ajv.removeSchema(t),this.pureAjv.removeSchema(t),this}}class gr extends Error{constructor(t,r){super(t),this.errors=r,this.name="ValidationError",Object.setPrototypeOf(this,gr.prototype)}}const Mo=new ni({customKeywords:[{keyword:"x-nrg-skip-validation",schemaType:"boolean",valid:!0},{keyword:"x-nrg-node-type",type:"string",validate:(e,t)=>{if(!t)return!0;const r=RED.nodes.node(t);return!!r&&r.type===e}}],customFormats:{"node-id":/^[a-zA-Z0-9-_]+$/}});function Ao(e){var t;if(!e)return e;let r=!1;const n={};for(const[o,l]of Object.entries(e)){if(!((t=l?.["x-nrg-form"])!=null&&t.required)||l!=null&&l["x-nrg-skip-validation"]){n[o]=l;continue}const s=Array.isArray(l.type)?l.type:[l.type];s.includes("string")&&l.minLength===void 0?(n[o]={...l,minLength:1},r=!0):s.includes("array")&&l.minItems===void 0?(n[o]={...l,minItems:1},r=!0):n[o]=l}return r?n:e}function oi(e,t){const r=Ao(e?.properties),n=Ao(t?.properties),o=e&&r!==e.properties?{...e,properties:r}:e;if(!n)return o;const l={type:"object",properties:n,...t!=null&&t.required?{required:t.required}:{}};return o?{...o,properties:{...o.properties,credentials:l}}:{type:"object",properties:{credentials:l},additionalProperties:!0}}function qo(e,t){const r=Mo.validate(en(e),t);return r.valid?[]:r.errors??[]}function ai(e,t){const r=qo(e,t).filter(n=>{var o;if(((o=n.parentSchema)==null?void 0:o.format)!=="password")return!0;if(!e.credentials)return!1;const l=n.instancePath.split("/").pop(),s=Ir.get(e,n.instancePath);return!(e.credentials[`has_${l}`]&&(!s||s==="__PWD__"))});return r.length===0?!0:r.map(n=>{var o;let l=n.instancePath;return n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`),`${l.slice(1)||"root"}: ${n.message??"invalid"}`})}function si(e,t){return qo(e,t).filter(r=>{var n;return((n=r.parentSchema)==null?void 0:n.format)!=="password"?!0:Ir.get(e,r.instancePath)!=="__PWD__"}).reduce((r,n)=>{var o;let l=n.instancePath;n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`);const s=`node${l.replaceAll("/",".")}`;return r[s]=n.message??"Invalid",r},{})}function Wt(e){const t=typeof e=="string"?e.trim():"";if(!t)return null;let r;try{r=JSON.parse(t)}catch(o){return`Invalid JSON: ${o.message}`}if(!r||typeof r!="object"||Array.isArray(r))return"Invalid JSON Schema: expected an object";const n={...r};delete n.$id;try{Mo.createValidator(n,!1)}catch(o){return`Invalid JSON Schema: ${o.message}`}return null}function ii(e){var t;const r=[];if(e!=null&&e.validateInput&&typeof e.inputSchema=="string"){const o=Wt(e.inputSchema);o&&r.push(`inputSchema: ${o}`)}const n=e?.outputSchemas;if(n&&typeof n=="object"){for(const[o,l]of Object.entries(n))if((t=e.validateOutputs)!=null&&t[o]&&typeof l=="string"){const s=Wt(l);s&&r.push(`outputSchemas.${o}: ${s}`)}}return r}const li=we({name:"NodeRedTray",props:{title:{type:String,default:""},width:{type:String,default:"Infinity"}},emits:["open","close","done","cancel"],data(){return{trayBody:null}},methods:{open(e){RED.tray.show({title:e??this.title,width:this.width,buttons:[{id:"node-dialog-cancel",text:RED._("common.label.cancel"),click:()=>{this.$emit("cancel"),RED.tray.close()}},{id:"node-dialog-ok",text:RED._("common.label.done"),class:"primary",click:()=>{this.$emit("done"),RED.tray.close()}}],open:t=>{this.trayBody=t.find(".red-ui-tray-body")[0]??null,this.$emit("open")},close:()=>{this.trayBody=null,this.$emit("close")}})},close(){RED.tray.close()}}}),Ee=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},ui={class:"nrg-tray-content"};function ci(e,t,r,n,o,l){return K(),J(Ae,null,[Q(` Renders nothing inline. While open, the default slot is TELEPORTED into the
9
+ deps: ${m}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(y){const[d,m]=l(y);a(y,d),c(y,m)}};function l({schema:y}){const d={},m={};for(const P in y){if(P==="__proto__")continue;const b=Array.isArray(y[P])?d:m;b[P]=y[P]}return[d,m]}function a(y,d=y.schema){const{gen:m,data:P,it:b}=y;if(Object.keys(d).length===0)return;const u=m.let("missing");for(const v in d){const x=d[v];if(x.length===0)continue;const h=(0,n.propertyInData)(m,P,v,b.opts.ownProperties);y.setParams({property:v,depsCount:x.length,deps:x.join(", ")}),b.allErrors?m.if(h,()=>{for(const p of x)(0,n.checkReportMissingProp)(y,p)}):(m.if((0,t._)`${h} && (${(0,n.checkMissingProp)(y,x,u)})`),(0,n.reportMissingProp)(y,u),m.else())}}e.validatePropertyDeps=a;function c(y,d=y.schema){const{gen:m,data:P,keyword:b,it:u}=y,v=m.name("valid");for(const x in d)(0,r.alwaysValidSchema)(u,d[x])||(m.if((0,n.propertyInData)(m,P,x,u.opts.ownProperties),()=>{const h=y.subschema({keyword:b,schemaProp:x},v);y.mergeValidEvaluated(h,v)},()=>m.var(v,!0)),y.ok(v))}e.validateSchemaDeps=c,e.default=o})(uo)),uo}var It={},po;function Ss(){if(po)return It;po=1,Object.defineProperty(It,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,e._)`{propertyName: ${n.propertyName}}`},code(n){const{gen:o,schema:l,data:a,it:c}=n;if((0,t.alwaysValidSchema)(c,l))return;const y=o.name("valid");o.forIn("key",a,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},y),o.if((0,e.not)(y),()=>{n.error(!0),c.allErrors||o.break()})}),n.ok(y)}};return It.default=r,It}var Vt={},fo;function ho(){if(fo)return Vt;fo=1,Object.defineProperty(Vt,"__esModule",{value:!0});const e=Se(),t=X(),r=ke(),n=re(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:a,schema:c,parentSchema:y,data:d,errsCount:m,it:P}=l;if(!m)throw new Error("ajv implementation error");const{allErrors:b,opts:u}=P;if(P.props=!0,u.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(P,c))return;const v=(0,e.allSchemaProperties)(y.properties),x=(0,e.allSchemaProperties)(y.patternProperties);h(),l.ok((0,t._)`${m} === ${r.default.errors}`);function h(){a.forIn("key",d,g=>{!v.length&&!x.length?i(g):a.if(p(g),()=>i(g))})}function p(g){let _;if(v.length>8){const E=(0,n.schemaRefOrVal)(P,y.properties,"properties");_=(0,e.isOwnProperty)(a,E,g)}else v.length?_=(0,t.or)(...v.map(E=>(0,t._)`${g} === ${E}`)):_=t.nil;return x.length&&(_=(0,t.or)(_,...x.map(E=>(0,t._)`${(0,e.usePattern)(l,E)}.test(${g})`))),(0,t.not)(_)}function s(g){a.code((0,t._)`delete ${d}[${g}]`)}function i(g){if(u.removeAdditional==="all"||u.removeAdditional&&c===!1){s(g);return}if(c===!1){l.setParams({additionalProperty:g}),l.error(),b||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(P,c)){const _=a.name("valid");u.removeAdditional==="failing"?(w(g,_,!1),a.if((0,t.not)(_),()=>{l.reset(),s(g)})):(w(g,_),b||a.if((0,t.not)(_),()=>a.break()))}}function w(g,_,E){const I={keyword:"additionalProperties",dataProp:g,dataPropType:n.Type.Str};E===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(I,_)}}};return Vt.default=o,Vt}var Rt={},mo;function Es(){if(mo)return Rt;mo=1,Object.defineProperty(Rt,"__esModule",{value:!0});const e=Qe(),t=Se(),r=re(),n=ho(),o={keyword:"properties",type:"object",schemaType:"object",code(l){const{gen:a,schema:c,parentSchema:y,data:d,it:m}=l;m.opts.removeAdditional==="all"&&y.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const P=(0,t.allSchemaProperties)(c);for(const h of P)m.definedProperties.add(h);m.opts.unevaluated&&P.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(a,(0,r.toHash)(P),m.props));const b=P.filter(h=>!(0,r.alwaysValidSchema)(m,c[h]));if(b.length===0)return;const u=a.name("valid");for(const h of b)v(h)?x(h):(a.if((0,t.propertyInData)(a,d,h,m.opts.ownProperties)),x(h),m.allErrors||a.else().var(u,!0),a.endIf()),l.it.definedProperties.add(h),l.ok(u);function v(h){return m.opts.useDefaults&&!m.compositeRule&&c[h].default!==void 0}function x(h){l.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};return Rt.default=o,Rt}var Lt={},yo;function xs(){if(yo)return Lt;yo=1,Object.defineProperty(Lt,"__esModule",{value:!0});const e=Se(),t=X(),r=re(),n=re(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(l){const{gen:a,schema:c,data:y,parentSchema:d,it:m}=l,{opts:P}=m,b=(0,e.allSchemaProperties)(c),u=b.filter(w=>(0,r.alwaysValidSchema)(m,c[w]));if(b.length===0||u.length===b.length&&(!m.opts.unevaluated||m.props===!0))return;const v=P.strictSchema&&!P.allowMatchingProperties&&d.properties,x=a.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(a,m.props));const{props:h}=m;p();function p(){for(const w of b)v&&s(w),m.allErrors?i(w):(a.var(x,!0),i(w),a.if(x))}function s(w){for(const g in v)new RegExp(w).test(g)&&(0,r.checkStrictMode)(m,`property ${g} matches pattern ${w} (use allowMatchingProperties)`)}function i(w){a.forIn("key",y,g=>{a.if((0,t._)`${(0,e.usePattern)(l,w)}.test(${g})`,()=>{const _=u.includes(w);_||l.subschema({keyword:"patternProperties",schemaProp:w,dataProp:g,dataPropType:n.Type.Str},x),m.opts.unevaluated&&h!==!0?a.assign((0,t._)`${h}[${g}]`,!0):!_&&!m.allErrors&&a.if((0,t.not)(x),()=>a.break())})})}}};return Lt.default=o,Lt}var Mt={},vo;function Ps(){if(vo)return Mt;vo=1,Object.defineProperty(Mt,"__esModule",{value:!0});const e=re(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:o,it:l}=r;if((0,e.alwaysValidSchema)(l,o)){r.fail();return}const a=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Mt.default=t,Mt}var At={},go;function ks(){if(go)return At;go=1,Object.defineProperty(At,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Se().validateUnion,error:{message:"must match a schema in anyOf"}};return At.default=e,At}var qt={},bo;function Ns(){if(bo)return qt;bo=1,Object.defineProperty(qt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,e._)`{passingSchemas: ${n.passing}}`},code(n){const{gen:o,schema:l,parentSchema:a,it:c}=n;if(!Array.isArray(l))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const y=l,d=o.let("valid",!1),m=o.let("passing",null),P=o.name("_valid");n.setParams({passing:m}),o.block(b),n.result(d,()=>n.reset(),()=>n.error(!0));function b(){y.forEach((u,v)=>{let x;(0,t.alwaysValidSchema)(c,u)?o.var(P,!0):x=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},P),v>0&&o.if((0,e._)`${P} && ${d}`).assign(d,!1).assign(m,(0,e._)`[${m}, ${v}]`).else(),o.if(P,()=>{o.assign(d,!0),o.assign(m,v),x&&n.mergeEvaluated(x,e.Name)})})}}};return qt.default=r,qt}var Dt={},$o;function js(){if($o)return Dt;$o=1,Object.defineProperty(Dt,"__esModule",{value:!0});const e=re(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:o,it:l}=r;if(!Array.isArray(o))throw new Error("ajv implementation error");const a=n.name("valid");o.forEach((c,y)=>{if((0,e.alwaysValidSchema)(l,c))return;const d=r.subschema({keyword:"allOf",schemaProp:y},a);r.ok(a),r.mergeEvaluated(d)})}};return Dt.default=t,Dt}var zt={},wo;function Os(){if(wo)return zt;wo=1,Object.defineProperty(zt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:l,parentSchema:a,it:c}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const y=n(c,"then"),d=n(c,"else");if(!y&&!d)return;const m=l.let("valid",!0),P=l.name("_valid");if(b(),o.reset(),y&&d){const v=l.let("ifClause");o.setParams({ifClause:v}),l.if(P,u("then",v),u("else",v))}else y?l.if(P,u("then")):l.if((0,e.not)(P),u("else"));o.pass(m,()=>o.error(!0));function b(){const v=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},P);o.mergeEvaluated(v)}function u(v,x){return()=>{const h=o.subschema({keyword:v},P);l.assign(m,P),o.mergeValidEvaluated(h,m),x?l.assign(x,(0,e._)`${v}`):o.setParams({ifClause:v})}}}};function n(o,l){const a=o.schema[l];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return zt.default=r,zt}var Ft={},_o;function Cs(){if(_o)return Ft;_o=1,Object.defineProperty(Ft,"__esModule",{value:!0});const e=re(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:o}){n.if===void 0&&(0,e.checkStrictMode)(o,`"${r}" without "if" is ignored`)}};return Ft.default=t,Ft}var So;function Ts(){if(So)return jt;So=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=no(),t=bs(),r=ao(),n=$s(),o=ws(),l=_s(),a=Ss(),c=ho(),y=Es(),d=xs(),m=Ps(),P=ks(),b=Ns(),u=js(),v=Os(),x=Cs();function h(p=!1){const s=[m.default,P.default,b.default,u.default,v.default,x.default,a.default,c.default,l.default,y.default,d.default];return p?s.push(t.default,n.default):s.push(e.default,r.default),s.push(o.default),s}return jt.default=h,jt}var Ut={},Kt={},Eo;function Is(){if(Eo)return Kt;Eo=1,Object.defineProperty(Kt,"__esModule",{value:!0});const e=X(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,n){const{gen:o,data:l,$data:a,schema:c,schemaCode:y,it:d}=r,{opts:m,errSchemaPath:P,schemaEnv:b,self:u}=d;if(!m.validateFormats)return;a?v():x();function v(){const h=o.scopeValue("formats",{ref:u.formats,code:m.code.formats}),p=o.const("fDef",(0,e._)`${h}[${y}]`),s=o.let("fType"),i=o.let("format");o.if((0,e._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>o.assign(s,(0,e._)`${p}.type || "string"`).assign(i,(0,e._)`${p}.validate`),()=>o.assign(s,(0,e._)`"string"`).assign(i,p)),r.fail$data((0,e.or)(w(),g()));function w(){return m.strictSchema===!1?e.nil:(0,e._)`${y} && !${i}`}function g(){const _=b.$async?(0,e._)`(${p}.async ? await ${i}(${l}) : ${i}(${l}))`:(0,e._)`${i}(${l})`,E=(0,e._)`(typeof ${i} == "function" ? ${_} : ${i}.test(${l}))`;return(0,e._)`${i} && ${i} !== true && ${s} === ${n} && !${E}`}}function x(){const h=u.formats[c];if(!h){w();return}if(h===!0)return;const[p,s,i]=g(h);p===n&&r.pass(_());function w(){if(m.strictSchema===!1){u.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${P}"`}}function g(E){const I=E instanceof RegExp?(0,e.regexpCode)(E):m.code.formats?(0,e._)`${m.code.formats}${(0,e.getProperty)(c)}`:void 0,A=o.scopeValue("formats",{key:c,ref:E,code:I});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,e._)`${A}.validate`]:["string",E,A]}function _(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!b.$async)throw new Error("async format in sync schema");return(0,e._)`await ${i}(${l})`}return typeof s=="function"?(0,e._)`${i}(${l})`:(0,e._)`${i}.test(${l})`}}}};return Kt.default=t,Kt}var xo;function Vs(){if(xo)return Ut;xo=1,Object.defineProperty(Ut,"__esModule",{value:!0});const e=[Is().default];return Ut.default=e,Ut}var Fe={},Po;function Rs(){return Po||(Po=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.contentVocabulary=Fe.metadataVocabulary=void 0,Fe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Fe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Fe}var ko;function Ls(){if(ko)return ft;ko=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=ss(),t=gs(),r=Ts(),n=Vs(),o=Rs(),l=[e.default,t.default,(0,r.default)(),n.default,o.metadataVocabulary,o.contentVocabulary];return ft.default=l,ft}var Bt={},Xe={},No;function Ms(){if(No)return Xe;No=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Xe.DiscrError=e={})),Xe}var jo;function As(){if(jo)return Bt;jo=1,Object.defineProperty(Bt,"__esModule",{value:!0});const e=X(),t=Ms(),r=lr(),n=dt(),o=re(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:y}})=>(0,e._)`{error: ${a}, tag: ${y}, tagValue: ${c}}`},code(a){const{gen:c,data:y,schema:d,parentSchema:m,it:P}=a,{oneOf:b}=m;if(!P.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=d.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!b)throw new Error("discriminator: requires oneOf keyword");const v=c.let("valid",!1),x=c.const("tag",(0,e._)`${y}${(0,e.getProperty)(u)}`);c.if((0,e._)`typeof ${x} == "string"`,()=>h(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:x,tagName:u})),a.ok(v);function h(){const i=s();c.if(!1);for(const w in i)c.elseIf((0,e._)`${x} === ${w}`),c.assign(v,p(i[w]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:x,tagName:u}),c.endIf()}function p(i){const w=c.name("valid"),g=a.subschema({keyword:"oneOf",schemaProp:i},w);return a.mergeEvaluated(g,e.Name),w}function s(){var i;const w={},g=E(m);let _=!0;for(let z=0;z<b.length;z++){let R=b[z];if(R!=null&&R.$ref&&!(0,o.schemaHasRulesButRef)(R,P.self.RULES)){const B=R.$ref;if(R=r.resolveRef.call(P.self,P.schemaEnv.root,P.baseId,B),R instanceof r.SchemaEnv&&(R=R.schema),R===void 0)throw new n.default(P.opts.uriResolver,P.baseId,B)}const U=(i=R?.properties)===null||i===void 0?void 0:i[u];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);_=_&&(g||E(R)),I(U,z)}if(!_)throw new Error(`discriminator: "${u}" must be required`);return w;function E({required:z}){return Array.isArray(z)&&z.includes(u)}function I(z,R){if(z.const)A(z.const,R);else if(z.enum)for(const U of z.enum)A(U,R);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function A(z,R){if(typeof z!="string"||z in w)throw new Error(`discriminator: "${u}" values must be unique strings`);w[z]=R}}}};return Bt.default=l,Bt}const qs="http://json-schema.org/draft-07/schema#",Ds="http://json-schema.org/draft-07/schema#",zs="Core schema meta-schema",Fs={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Us=["object","boolean"],Ks={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Bs={$schema:qs,$id:Ds,title:zs,definitions:Fs,type:Us,properties:Ks,default:!0};var Oo;function pr(){return Oo||(Oo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ns(),n=Ls(),o=As(),l=Bs,a=["/properties"],c="http://json-schema.org/draft-07/schema";class y extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(l,a):l;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=y,e.exports=t=y,e.exports.Ajv=y,Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var d=Qe();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=X();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var P=ir();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return P.default}});var b=dt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return b.default}})})(ar,ar.exports)),ar.exports}var Ws=pr();const Gs=ot(Ws);var fr={exports:{}},Co={},To;function Hs(){return To||(To=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(R,U){return{validate:R,compare:U}}e.fullFormats={date:t(l,a),time:t(y(!0),d),"date-time":t(b(!0),u),"iso-time":t(y(),m),"iso-date-time":t(b(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:i,int32:{type:"number",validate:_},int64:{type:"number",validate:E},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(R){return R%4===0&&(R%100!==0||R%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function l(R){const U=n.exec(R);if(!U)return!1;const B=+U[1],G=+U[2],ae=+U[3];return G>=1&&G<=12&&ae>=1&&ae<=(G===2&&r(B)?29:o[G])}function a(R,U){if(R&&U)return R>U?1:R<U?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function y(R){return function(U){const B=c.exec(U);if(!B)return!1;const G=+B[1],ae=+B[2],se=+B[3],de=B[4],ne=B[5]==="-"?-1:1,pe=+(B[6]||0),L=+(B[7]||0);if(pe>23||L>59||R&&!de)return!1;if(G<=23&&ae<=59&&se<60)return!0;const O=ae-L*ne,C=G-pe*ne-(O<0?1:0);return(C===23||C===-1)&&(O===59||O===-1)&&se<61}}function d(R,U){if(!(R&&U))return;const B=new Date("2020-01-01T"+R).valueOf(),G=new Date("2020-01-01T"+U).valueOf();if(B&&G)return B-G}function m(R,U){if(!(R&&U))return;const B=c.exec(R),G=c.exec(U);if(B&&G)return R=B[1]+B[2]+B[3],U=G[1]+G[2]+G[3],R>U?1:R<U?-1:0}const P=/t|\s/i;function b(R){const U=y(R);return function(B){const G=B.split(P);return G.length===2&&l(G[0])&&U(G[1])}}function u(R,U){if(!(R&&U))return;const B=new Date(R).valueOf(),G=new Date(U).valueOf();if(B&&G)return B-G}function v(R,U){if(!(R&&U))return;const[B,G]=R.split(P),[ae,se]=U.split(P),de=a(B,ae);if(de!==void 0)return de||d(G,se)}const x=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(R){return x.test(R)&&h.test(R)}const s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(R){return s.lastIndex=0,s.test(R)}const w=-2147483648,g=2**31-1;function _(R){return Number.isInteger(R)&&R<=g&&R>=w}function E(R){return Number.isInteger(R)}function I(){return!0}const A=/[^\\]\\Z/;function z(R){if(A.test(R))return!1;try{return new RegExp(R),!0}catch{return!1}}})(Co)),Co}var Io={},Vo;function Js(){return Vo||(Vo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=pr(),r=X(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},l={message:({keyword:c,schemaCode:y})=>(0,r.str)`should be ${o[c].okStr} ${y}`,params:({keyword:c,schemaCode:y})=>(0,r._)`{comparison: ${o[c].okStr}, limit: ${y}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:l,code(c){const{gen:y,data:d,schemaCode:m,keyword:P,it:b}=c,{opts:u,self:v}=b;if(!u.validateFormats)return;const x=new t.KeywordCxt(b,v.RULES.all.format.definition,"format");x.$data?h():p();function h(){const i=y.scopeValue("formats",{ref:v.formats,code:u.code.formats}),w=y.const("fmt",(0,r._)`${i}[${x.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${w} != "object"`,(0,r._)`${w} instanceof RegExp`,(0,r._)`typeof ${w}.compare != "function"`,s(w)))}function p(){const i=x.schema,w=v.formats[i];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${P}": format "${i}" does not define "compare" function`);const g=y.scopeValue("formats",{key:i,ref:w,code:u.code.formats?(0,r._)`${u.code.formats}${(0,r.getProperty)(i)}`:void 0});c.fail$data(s(g))}function s(i){return(0,r._)`${i}.compare(${d}, ${m}) ${o[P].fail} 0`}},dependencies:["format"]};const a=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=a})(Io)),Io}var Ro;function Zs(){return Ro||(Ro=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Hs(),n=Js(),o=X(),l=new o.Name("fullFormats"),a=new o.Name("fastFormats"),c=(d,m={keywords:!0})=>{if(Array.isArray(m))return y(d,m,r.fullFormats,l),d;const[P,b]=m.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,l],u=m.formats||r.formatNames;return y(d,u,P,b),m.keywords&&(0,n.default)(d),d};c.get=(d,m="full")=>{const P=(m==="fast"?r.fastFormats:r.fullFormats)[d];if(!P)throw new Error(`Unknown format "${d}"`);return P};function y(d,m,P,b){var u,v;(u=(v=d.opts.code).formats)!==null&&u!==void 0||(v.formats=(0,o._)`require("ajv-formats/dist/formats").${b}`);for(const x of m)d.addFormat(x,P[x])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(fr,fr.exports)),fr.exports}var Qs=Zs();const Ys=ot(Qs);var hr={exports:{}},Lo;function Xs(){return Lo||(Lo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=pr(),n=X(),o=He(),l=Qe(),a=Je(),c=ke(),y="errorMessage",d=new r.Name("emUsed"),m={required:"missingProperty",dependencies:"property",dependentRequired:"property"},P=/\$\{[^}]+\}/,b=/\$\{([^}]+)\}/g,u=/^""\s*\+\s*|\s*\+\s*""$/g;function v(h){return{keyword:y,schemaType:["string","object"],post:!0,code(p){const{gen:s,data:i,schema:w,schemaValue:g,it:_}=p;if(_.createErrors===!1)return;const E=w,I=n.strConcat(c.default.instancePath,_.errorPath);s.if(r._`${c.default.errors} > 0`,()=>{if(typeof E=="object"){const[k,f]=z(E);f&&R(f),k&&U(k),B(A(E))}const C=typeof E=="string"?E:E._;C&&G(C),h.keepErrors||ae()});function A({properties:C,items:k}){const f={};if(C){f.props={};for(const S in C)f.props[S]=[]}if(k){f.items={};for(let S=0;S<k.length;S++)f.items[S]=[]}return f}function z(C){let k,f;for(const S in C){if(S==="properties"||S==="items")continue;const T=C[S];if(typeof T=="object"){k||(k={});const F=k[S]={};for(const M in T)F[M]=[]}else f||(f={}),f[S]=[]}return[k,f]}function R(C){const k=s.const("emErrors",r.stringify(C)),f=s.const("templates",pe(C,w));s.forOf("err",c.default.vErrors,M=>s.if(se(M,k),()=>s.code(r._`${k}[${M}.keyword].push(${M})`).assign(r._`${M}.${d}`,!0)));const{singleError:S}=h;if(S){const M=s.let("message",r._`""`),W=s.let("paramsErrors",r._`[]`);T(Y=>{s.if(M,()=>s.code(r._`${M} += ${typeof S=="string"?S:";"}`)),s.code(r._`${M} += ${F(Y)}`),s.assign(W,r._`${W}.concat(${k}[${Y}])`)}),a.reportError(p,{message:M,params:r._`{errors: ${W}}`})}else T(M=>a.reportError(p,{message:F(M),params:r._`{errors: ${k}[${M}]}`}));function T(M){s.forIn("key",k,W=>s.if(r._`${k}[${W}].length`,()=>M(W)))}function F(M){return r._`${M} in ${f} ? ${f}[${M}]() : ${g}[${M}]`}}function U(C){const k=s.const("emErrors",r.stringify(C)),f=[];for(const W in C)f.push([W,pe(C[W],w[W])]);const S=s.const("templates",s.object(...f)),T=s.scopeValue("obj",{ref:m,code:r.stringify(m)}),F=s.let("emPropParams"),M=s.let("emParamsErrors");s.forOf("err",c.default.vErrors,W=>s.if(se(W,k),()=>{s.assign(F,r._`${T}[${W}.keyword]`),s.assign(M,r._`${k}[${W}.keyword][${W}.params[${F}]]`),s.if(M,()=>s.code(r._`${M}.push(${W})`).assign(r._`${W}.${d}`,!0))})),s.forIn("key",k,W=>s.forIn("keyProp",r._`${k}[${W}]`,Y=>{s.assign(M,r._`${k}[${W}][${Y}]`),s.if(r._`${M}.length`,()=>{const N=s.const("tmpl",r._`${S}[${W}] && ${S}[${W}][${Y}]`);a.reportError(p,{message:r._`${N} ? ${N}() : ${g}[${W}][${Y}]`,params:r._`{errors: ${M}}`})})}))}function B(C){const{props:k,items:f}=C;if(!k&&!f)return;const S=r._`typeof ${i} == "object"`,T=r._`Array.isArray(${i})`,F=s.let("emErrors");let M,W;const Y=s.let("templates");k&&f?(M=s.let("emChildKwd"),s.if(S),s.if(T,()=>{N(f,w.items),s.assign(M,r.str`items`)},()=>{N(k,w.properties),s.assign(M,r.str`properties`)}),W=r._`[${M}]`):f?(s.if(T),N(f,w.items),W=r._`.items`):k&&(s.if(n.and(S,n.not(T))),N(k,w.properties),W=r._`.properties`),s.forOf("err",c.default.vErrors,j=>de(j,F,V=>s.code(r._`${F}[${V}].push(${j})`).assign(r._`${j}.${d}`,!0))),s.forIn("key",F,j=>s.if(r._`${F}[${j}].length`,()=>{a.reportError(p,{message:r._`${j} in ${Y} ? ${Y}[${j}]() : ${g}${W}[${j}]`,params:r._`{errors: ${F}[${j}]}`}),s.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${I} + "/" + ${j}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),s.endIf();function N(j,V){s.assign(F,r.stringify(j)),s.assign(Y,pe(j,V))}}function G(C){const k=s.const("emErrs",r._`[]`);s.forOf("err",c.default.vErrors,f=>s.if(ne(f),()=>s.code(r._`${k}.push(${f})`).assign(r._`${f}.${d}`,!0))),s.if(r._`${k}.length`,()=>a.reportError(p,{message:L(C),params:r._`{errors: ${k}}`}))}function ae(){const C=s.const("emErrs",r._`[]`);s.forOf("err",c.default.vErrors,k=>s.if(r._`!${k}.${d}`,()=>s.code(r._`${C}.push(${k})`))),s.assign(c.default.vErrors,C).assign(c.default.errors,r._`${C}.length`)}function se(C,k){return n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,r._`${C}.instancePath === ${I}`,r._`${C}.keyword in ${k}`,r._`${C}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${C}.schemaPath.slice(${_.errSchemaPath.length}))`)}function de(C,k,f){s.if(n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,r._`${C}.instancePath.indexOf(${I}) === 0`),()=>{const S=s.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),T=s.const("emMatches",r._`${S}.exec(${C}.instancePath.slice(${I}.length))`),F=s.const("emChild",r._`${T} && ${T}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);s.if(r._`${F} !== undefined && ${F} in ${k}`,()=>f(F))})}function ne(C){return n.and(r._`${C}.keyword !== ${y}`,r._`!${C}.${d}`,n.or(r._`${C}.instancePath === ${I}`,n.and(r._`${C}.instancePath.indexOf(${I}) === 0`,r._`${C}.instancePath[${I}.length] === "/"`)),r._`${C}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`${C}.schemaPath[${_.errSchemaPath}.length] === "/"`)}function pe(C,k){const f=[];for(const S in C){const T=k[S];P.test(T)&&f.push([S,O(T)])}return s.object(...f)}function L(C){return P.test(C)?new o._Code(o.safeStringify(C).replace(b,(k,f)=>`" + JSON.stringify(${l.getData(f,_)}) + "`).replace(u,"")):r.stringify(C)}function O(C){return r._`function(){return ${L(C)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const x=(h,p={})=>{if(!h.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(h.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return h.addKeyword(v(p))};t.default=x,e.exports=x,e.exports.default=x})(hr,hr.exports)),hr.exports}var ei=Xs();const ti=ot(ei);class ri{constructor(t){tt(this,"ajv"),tt(this,"pureAjv"),tt(this,"pureInlineCache",new WeakMap),tt(this,"mutateInlineCache",new WeakMap);const{customKeywords:r,customFormats:n,...o}=t||{};this.ajv=this.buildAjv(o,!0,r,n),this.pureAjv=this.buildAjv(o,!1,r,n)}buildAjv(t,r,n,o){const l=new Gs({allErrors:!0,code:{source:!1},coerceTypes:r,removeAdditional:!1,strict:!1,strictSchema:!1,useDefaults:r,validateFormats:!0,validateSchema:!1,verbose:!0,...t});return Ys(l),ti(l),this.addCustomKeywords(l,n||[]),this.addCustomFormats(l,o||{}),l}addCustomKeywords(t,r){r.forEach(n=>{t.addKeyword(n)})}addCustomFormats(t,r){Object.entries(r).forEach(([n,o])=>{o instanceof RegExp?t.addFormat(n,o):t.addFormat(n,{validate:o})})}createValidator(t,r=!0){const n=r?this.ajv:this.pureAjv;if(t.$id)return n.getSchema(t.$id)||n.compile(t);const o=r?this.mutateInlineCache:this.pureInlineCache,l=o.get(t);if(l)return l;const a=n.compile(t);return o.set(t,a),a}validate(t,r,n){const o=this.createValidator(r,n?.mutate??!0);if(!o(t)){const l=this.formatErrors(o.errors);if(n!=null&&n.throwOnError)throw new gr(l,o.errors||[]);return{valid:!1,errors:o.errors||void 0,errorMessage:l}}return{valid:!0,data:t}}formatErrors(t,r){return!t||t.length===0?"No errors":this.ajv.errorsText(t,{separator:"; ",dataVar:"data",...r})}getDetailedErrors(t){return!t||t.length===0?[]:t.map(r=>({field:r.instancePath||"/",message:r.message||"Validation failed",keyword:r.keyword,params:r.params,schemaPath:r.schemaPath}))}addSchema(t,r){return this.ajv.addSchema(t,r),this.pureAjv.addSchema(t,r),this}removeSchema(t){return this.ajv.removeSchema(t),this.pureAjv.removeSchema(t),this}}class gr extends Error{constructor(t,r){super(t),this.errors=r,this.name="ValidationError",Object.setPrototypeOf(this,gr.prototype)}}const Mo=new ri({customKeywords:[{keyword:"x-nrg-skip-validation",schemaType:"boolean",valid:!0},{keyword:"x-nrg-node-type",type:"string",validate:(e,t)=>{if(!t)return!0;const r=RED.nodes.node(t);return!!r&&r.type===e}}],customFormats:{"node-id":/^[a-zA-Z0-9-_]+$/}});function Ao(e,t){if(!e)return e;const r=new Set(t??[]);let n=!1;const o={};for(const[l,a]of Object.entries(e)){if(!r.has(l)||a!=null&&a["x-nrg-skip-validation"]){o[l]=a;continue}const c=Array.isArray(a.type)?a.type:[a.type];c.includes("string")&&a.minLength===void 0?(o[l]={...a,minLength:1},n=!0):c.includes("array")&&a.minItems===void 0?(o[l]={...a,minItems:1},n=!0):o[l]=a}return n?o:e}function ni(e,t){const r=Ao(e?.properties,e?.required),n=Ao(t?.properties,t?.required),o=e&&r!==e.properties?{...e,properties:r}:e;if(!n)return o;const l={type:"object",properties:n,...t!=null&&t.required?{required:t.required}:{}};return o?{...o,properties:{...o.properties,credentials:l}}:{type:"object",properties:{credentials:l},additionalProperties:!0}}function qo(e,t){const r=Mo.validate(en(e),t);return r.valid?[]:r.errors??[]}function oi(e,t){const r=qo(e,t).filter(n=>{var o;if(((o=n.parentSchema)==null?void 0:o.format)!=="password")return!0;if(!e.credentials)return!1;const l=n.instancePath.split("/").pop(),a=Ir.get(e,n.instancePath);return!(e.credentials[`has_${l}`]&&(!a||a==="__PWD__"))});return r.length===0?!0:r.map(n=>{var o;let l=n.instancePath;return n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`),`${l.slice(1)||"root"}: ${n.message??"invalid"}`})}function ai(e,t){return qo(e,t).filter(r=>{var n;return((n=r.parentSchema)==null?void 0:n.format)!=="password"?!0:Ir.get(e,r.instancePath)!=="__PWD__"}).reduce((r,n)=>{var o;let l=n.instancePath;n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`);const a=`node${l.replaceAll("/",".")}`;return r[a]=n.message??"Invalid",r},{})}function Wt(e){const t=typeof e=="string"?e.trim():"";if(!t)return null;let r;try{r=JSON.parse(t)}catch(o){return`Invalid JSON: ${o.message}`}if(!r||typeof r!="object"||Array.isArray(r))return"Invalid JSON Schema: expected an object";const n={...r};delete n.$id;try{Mo.createValidator(n,!1)}catch(o){return`Invalid JSON Schema: ${o.message}`}return null}function si(e){var t;const r=[];if(e!=null&&e.validateInput&&typeof e.inputSchema=="string"){const o=Wt(e.inputSchema);o&&r.push(`inputSchema: ${o}`)}const n=e?.outputSchemas;if(n&&typeof n=="object"){for(const[o,l]of Object.entries(n))if((t=e.validateOutputs)!=null&&t[o]&&typeof l=="string"){const a=Wt(l);a&&r.push(`outputSchemas.${o}: ${a}`)}}return r}const ii=we({name:"NodeRedTray",props:{title:{type:String,default:""},width:{type:String,default:"Infinity"}},emits:["open","close","done","cancel"],data(){return{trayBody:null}},methods:{open(e){RED.tray.show({title:e??this.title,width:this.width,buttons:[{id:"node-dialog-cancel",text:RED._("common.label.cancel"),click:()=>{this.$emit("cancel"),RED.tray.close()}},{id:"node-dialog-ok",text:RED._("common.label.done"),class:"primary",click:()=>{this.$emit("done"),RED.tray.close()}}],open:t=>{this.trayBody=t.find(".red-ui-tray-body")[0]??null,this.$emit("open")},close:()=>{this.trayBody=null,this.$emit("close")}})},close(){RED.tray.close()}}}),Ee=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},li={class:"nrg-tray-content"};function ui(e,t,r,n,o,l){return K(),J(Ae,null,[Q(` Renders nothing inline. While open, the default slot is TELEPORTED into the
10
10
  Node-RED tray body, so the tray's content is a real Vue subtree the node
11
11
  author controls \u2014 no imperative DOM/jQuery. RED owns the tray shell (title
12
- + footer buttons) via RED.tray.show. `),e.trayBody?(K(),ve(na,{key:0,to:e.trayBody},[q("div",ui,[Te(e.$slots,"default",{close:e.close},void 0,!0)])],8,["to"])):Q("v-if",!0)],2112)}const mr=Ee(li,[["render",ci],["__scopeId","data-v-7094eb2b"]]),di=we({name:"NodeRedInputLabel",props:{label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},htmlFor:{type:String,default:""},labelId:{type:String,default:""}},computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),pi={key:1,class:"nrg-required"};function fi(e,t,r,n,o,l){return K(),ve(oa(e.htmlFor?"label":"span"),{id:e.labelId||void 0,class:"nrg-label",for:e.htmlFor||void 0},{default:Zt(()=>[e.icon?(K(),J("i",{key:0,class:Ke(e.iconClass)},null,2)):Q("v-if",!0),Te(e.$slots,"default",{},()=>[xe(Z(e.label),1)],!0),e.required?(K(),J("span",pi,"*")):Q("v-if",!0)]),_:3},8,["id","for"])}const Le=Ee(di,[["render",fi],["__scopeId","data-v-ec9d13ab"]]),hi=we({components:{NodeRedInputLabel:Le,NodeRedTray:mr},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},language:{type:String,default:"json",validator:function(e){const t=["abap","apex","azcli","bat","bicep","cameligo","clojure","coffee","cpp","csharp","csp","css","cypher","dart","dockerfile","ecl","elixir","flow9","freemarker2","fsharp","go","graphql","handlebars","hcl","html","ini","java","javascript","json","julia","kotlin","less","lexon","liquid","lua","m3","markdown","mdx","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","pla","postiats","powerquery","powershell","protobuf","pub","python","qsharp","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scala","scheme","scss","shell","solidity","sophia","sparql","sql","st","swift","systemverilog","tcl","twig","typescript","typespec","vb","wgsl","xml","yaml"],r=t.includes(e);return r||console.warn(`[WARN]: Invalid value for 'type' property: "${e}". Expected one of: ${t.join(", ")}`),r}},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""},expandable:{type:Boolean,default:!0},fill:{type:Boolean,default:!1},editorOptions:{type:Object,default:void 0}},emits:["update:modelValue","update:value","editor-ready"],setup(){return{editorInstance:Ie(null),expandedEditor:Ie(null)}},data(){const e=Math.random().toString(36).substring(2,9);return{editorId:"node-red-editor-"+e,expandedEditorId:"expanded-editor-"+e,stateId:e}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){if(this.expandable){const e=$(this.$refs["expand-button"]);RED.popover.tooltip(e,RED._("node-red:common.label.expand"))}this.mountEditor()},beforeUnmount(){if(this.editorInstance){try{this.editorInstance.destroy()}catch(e){console.error(`Error destroying editor for ID ${this.editorId}:`,e)}this.editorInstance=null}this.destroyExpandedEditor()},methods:{mountEditor(){this.$nextTick(()=>{const e=this.$refs.container,t=this.$refs.editor;if(e&&t)try{const r=e.style.height,n=e.style.width;this.fill?t.style.height="100%":r?t.style.height=r:t.style.height="200px",n?t.style.width=n:t.style.width="100%",this.createEditorInstance()}catch(r){console.error("[NodeRedEditorInput] Error setting initial editor style:",r),this.createEditorInstance()}else console.error("[NodeRedEditorInput] Container or Editor div refs not found on mount.")})},createEditorInstance(){this.editorInstance=RED.editor.createEditor({id:this.editorId,mode:this.language,value:this.effectiveValue,options:this.editorOptions}),this.editorInstance.getSession().on("change",()=>{const e=this.editorInstance.getValue();e!==this.effectiveValue&&(this.$emit("update:modelValue",e),this.$emit("update:value",e))}),this.$emit("editor-ready",this.editorInstance)},destroyExpandedEditor(){if(this.expandedEditor){try{this.expandedEditor.destroy()}catch{}this.expandedEditor=null}},onClickExpand(){this.$refs.expandTray.open()},onExpandOpen(){this.$nextTick(()=>{var e,t;this.expandedEditor=RED.editor.createEditor({id:this.expandedEditorId,stateId:this.stateId,mode:this.language,value:this.effectiveValue,options:this.editorOptions}),(t=(e=this.expandedEditor).focus)==null||t.call(e)})},onExpandDone(){var e;this.expandedEditor.saveView(),(e=this.editorInstance)==null||e.setValue(this.expandedEditor.getValue(),-1),setTimeout(()=>{var t,r;(t=this.editorInstance)==null||t.restoreView(),(r=this.editorInstance)==null||r.focus()},250)},onExpandCancel(){setTimeout(()=>{var e;(e=this.editorInstance)==null||e.focus()},250)},onExpandClose(){this.destroyExpandedEditor()}}}),mi={ref:"container",class:"container"},yi={class:"editor-wrapper"},vi=["id","aria-labelledby"],gi=["id"];function bi(e,t,r,n,o,l){const s=ie("NodeRedInputLabel"),c=ie("NodeRedTray");return K(),J("div",mi,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)],!0),q("div",yi,[e.expandable?(K(),J("button",{key:0,ref:"expand-button",class:"red-ui-button red-ui-button-small expand-button",onClick:t[0]||(t[0]=(...y)=>e.onClickExpand&&e.onClickExpand(...y))},[...t[1]||(t[1]=[q("i",{class:"fa fa-expand"},null,-1)])],512)):Q("v-if",!0),q("div",{id:e.editorId,ref:"editor",role:"textbox","aria-labelledby":e.labelId||void 0},null,8,vi)]),aa(q("div",{class:"node-red-vue-input-error-message"},Z(e.error),513),[[sa,e.error]]),Q(` "Expand" pops the field's editor into a full-width tray. Reuses the
12
+ + footer buttons) via RED.tray.show. `),e.trayBody?(K(),ve(ra,{key:0,to:e.trayBody},[q("div",li,[Te(e.$slots,"default",{close:e.close},void 0,!0)])],8,["to"])):Q("v-if",!0)],2112)}const mr=Ee(ii,[["render",ui],["__scopeId","data-v-7094eb2b"]]),ci=we({name:"NodeRedInputLabel",props:{label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},htmlFor:{type:String,default:""},labelId:{type:String,default:""}},computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),di={key:1,class:"nrg-required"};function pi(e,t,r,n,o,l){return K(),ve(na(e.htmlFor?"label":"span"),{id:e.labelId||void 0,class:"nrg-label",for:e.htmlFor||void 0},{default:Zt(()=>[e.icon?(K(),J("i",{key:0,class:Ke(e.iconClass)},null,2)):Q("v-if",!0),Te(e.$slots,"default",{},()=>[xe(Z(e.label),1)],!0),e.required?(K(),J("span",di,"*")):Q("v-if",!0)]),_:3},8,["id","for"])}const Le=Ee(ci,[["render",pi],["__scopeId","data-v-ec9d13ab"]]),fi=we({components:{NodeRedInputLabel:Le,NodeRedTray:mr},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},language:{type:String,default:"json",validator:function(e){const t=["abap","apex","azcli","bat","bicep","cameligo","clojure","coffee","cpp","csharp","csp","css","cypher","dart","dockerfile","ecl","elixir","flow9","freemarker2","fsharp","go","graphql","handlebars","hcl","html","ini","java","javascript","json","julia","kotlin","less","lexon","liquid","lua","m3","markdown","mdx","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","pla","postiats","powerquery","powershell","protobuf","pub","python","qsharp","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scala","scheme","scss","shell","solidity","sophia","sparql","sql","st","swift","systemverilog","tcl","twig","typescript","typespec","vb","wgsl","xml","yaml"],r=t.includes(e);return r||console.warn(`[WARN]: Invalid value for 'type' property: "${e}". Expected one of: ${t.join(", ")}`),r}},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""},expandable:{type:Boolean,default:!0},fill:{type:Boolean,default:!1},editorOptions:{type:Object,default:void 0}},emits:["update:modelValue","update:value","editor-ready"],setup(){return{editorInstance:Ie(null),expandedEditor:Ie(null)}},data(){const e=Math.random().toString(36).substring(2,9);return{editorId:"node-red-editor-"+e,expandedEditorId:"expanded-editor-"+e,stateId:e}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){if(this.expandable){const e=$(this.$refs["expand-button"]);RED.popover.tooltip(e,RED._("node-red:common.label.expand"))}this.mountEditor()},beforeUnmount(){if(this.editorInstance){try{this.editorInstance.destroy()}catch(e){console.error(`Error destroying editor for ID ${this.editorId}:`,e)}this.editorInstance=null}this.destroyExpandedEditor()},methods:{mountEditor(){this.$nextTick(()=>{const e=this.$refs.container,t=this.$refs.editor;if(e&&t)try{const r=e.style.height,n=e.style.width;this.fill?t.style.height="100%":r?t.style.height=r:t.style.height="200px",n?t.style.width=n:t.style.width="100%",this.createEditorInstance()}catch(r){console.error("[NodeRedEditorInput] Error setting initial editor style:",r),this.createEditorInstance()}else console.error("[NodeRedEditorInput] Container or Editor div refs not found on mount.")})},createEditorInstance(){this.editorInstance=RED.editor.createEditor({id:this.editorId,mode:this.language,value:this.effectiveValue,options:this.editorOptions}),this.editorInstance.getSession().on("change",()=>{const e=this.editorInstance.getValue();e!==this.effectiveValue&&(this.$emit("update:modelValue",e),this.$emit("update:value",e))}),this.$emit("editor-ready",this.editorInstance)},destroyExpandedEditor(){if(this.expandedEditor){try{this.expandedEditor.destroy()}catch{}this.expandedEditor=null}},onClickExpand(){this.$refs.expandTray.open()},onExpandOpen(){this.$nextTick(()=>{var e,t;this.expandedEditor=RED.editor.createEditor({id:this.expandedEditorId,stateId:this.stateId,mode:this.language,value:this.effectiveValue,options:this.editorOptions}),(t=(e=this.expandedEditor).focus)==null||t.call(e)})},onExpandDone(){var e;this.expandedEditor.saveView(),(e=this.editorInstance)==null||e.setValue(this.expandedEditor.getValue(),-1),setTimeout(()=>{var t,r;(t=this.editorInstance)==null||t.restoreView(),(r=this.editorInstance)==null||r.focus()},250)},onExpandCancel(){setTimeout(()=>{var e;(e=this.editorInstance)==null||e.focus()},250)},onExpandClose(){this.destroyExpandedEditor()}}}),hi={ref:"container",class:"container"},mi={class:"editor-wrapper"},yi=["id","aria-labelledby"],vi=["id"];function gi(e,t,r,n,o,l){const a=ie("NodeRedInputLabel"),c=ie("NodeRedTray");return K(),J("div",hi,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(a,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)],!0),q("div",mi,[e.expandable?(K(),J("button",{key:0,ref:"expand-button",class:"red-ui-button red-ui-button-small expand-button",onClick:t[0]||(t[0]=(...y)=>e.onClickExpand&&e.onClickExpand(...y))},[...t[1]||(t[1]=[q("i",{class:"fa fa-expand"},null,-1)])],512)):Q("v-if",!0),q("div",{id:e.editorId,ref:"editor",role:"textbox","aria-labelledby":e.labelId||void 0},null,8,yi)]),oa(q("div",{class:"node-red-vue-input-error-message"},Z(e.error),513),[[aa,e.error]]),Q(` "Expand" pops the field's editor into a full-width tray. Reuses the
13
13
  shared NodeRedTray shell; a second Monaco is mounted into the teleported
14
14
  host (sharing this field's stateId for scroll/cursor view state).
15
- Skipped when the editor is already inside a tray (\`expandable=false\`). `),e.expandable?(K(),ve(c,{key:0,ref:"expandTray",title:"Editor",onOpen:e.onExpandOpen,onDone:e.onExpandDone,onCancel:e.onExpandCancel,onClose:e.onExpandClose},{default:Zt(()=>[q("div",{id:e.expandedEditorId,class:"expanded-editor-host"},null,8,gi)]),_:1},8,["onOpen","onDone","onCancel","onClose"])):Q("v-if",!0)],512)}const yr=Ee(hi,[["render",bi],["__scopeId","data-v-a054dd53"]]),$i=we({name:"NodeRedSchemaTray",components:{NodeRedTray:mr,NodeRedEditorInput:yr},data(){return{title:"",draft:"",onSave:null,editorOptions:{lineNumbers:"on",minimap:{enabled:!0},automaticLayout:!0}}},methods:{open(e,t,r){this.title=e,this.draft=t,this.onSave=r,this.$refs.tray.open(e)},onDone(){var e;(e=this.onSave)==null||e.call(this,this.draft)}}}),wi={class:"nrg-schema-tray"};function _i(e,t,r,n,o,l){const s=ie("NodeRedEditorInput"),c=ie("NodeRedTray");return K(),J(Ae,null,[Q(` The per-port schema editor, built ON TOP of the reusable NodeRedTray: a
15
+ Skipped when the editor is already inside a tray (\`expandable=false\`). `),e.expandable?(K(),ve(c,{key:0,ref:"expandTray",title:"Editor",onOpen:e.onExpandOpen,onDone:e.onExpandDone,onCancel:e.onExpandCancel,onClose:e.onExpandClose},{default:Zt(()=>[q("div",{id:e.expandedEditorId,class:"expanded-editor-host"},null,8,vi)]),_:1},8,["onOpen","onDone","onCancel","onClose"])):Q("v-if",!0)],512)}const yr=Ee(fi,[["render",gi],["__scopeId","data-v-a054dd53"]]),bi=we({name:"NodeRedSchemaTray",components:{NodeRedTray:mr,NodeRedEditorInput:yr},data(){return{title:"",draft:"",onSave:null,editorOptions:{lineNumbers:"on",minimap:{enabled:!0},automaticLayout:!0}}},methods:{open(e,t,r){this.title=e,this.draft=t,this.onSave=r,this.$refs.tray.open(e)},onDone(){var e;(e=this.onSave)==null||e.call(this,this.draft)}}}),$i={class:"nrg-schema-tray"};function wi(e,t,r,n,o,l){const a=ie("NodeRedEditorInput"),c=ie("NodeRedTray");return K(),J(Ae,null,[Q(` The per-port schema editor, built ON TOP of the reusable NodeRedTray: a
16
16
  Monaco (JSON) editor as the tray's Vue content. This is how a node author
17
- composes NodeRedTray with their own content. `),fe(c,{ref:"tray",title:e.title,onDone:e.onDone},{default:Zt(()=>[q("div",wi,[Q(` Already inside a tray, so no expand button; fills the tray height.
17
+ composes NodeRedTray with their own content. `),fe(c,{ref:"tray",title:e.title,onDone:e.onDone},{default:Zt(()=>[q("div",$i,[Q(` Already inside a tray, so no expand button; fills the tray height.
18
18
  Monaco's own inline (intellisense) diagnostics surface JSON errors \u2014
19
- no separate error message is rendered here. `),fe(s,{class:"nrg-schema-editor","model-value":e.draft,language:"json",expandable:!1,fill:"","editor-options":e.editorOptions,"onUpdate:modelValue":t[0]||(t[0]=y=>e.draft=y)},null,8,["model-value","editor-options"])])]),_:1},8,["title","onDone"])],2112)}const Si=Ee($i,[["render",_i],["__scopeId","data-v-feefe431"]]),Ei=we({name:"NodeRedVueApp",components:{NodeRedSchemaTray:Si},provide(){return{__nrg_form_node:this.localNode,__nrg_form_schema:this.schema,__nrg_form_errors:this.errors}},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},features:{type:Object,required:!0}},setup(){return{debouncedValidate:Ie(null),typeCheckEnabled:nt}},data(){return{localNode:this.node,errors:{}}},computed:{hasOutputReturnProperties(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputReturnProperties)!==void 0},hasOutputContextModes(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)!==void 0},supportsInputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateInputTypes)!==void 0},supportsOutputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateOutputTypes)!==void 0},authorContextModeDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)==null?void 0:r.default)??{}},hasOutputSchemas(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)!==void 0},authorOutputSchemaDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)==null?void 0:r.default)??{}},acceptsInputSchema(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)!==void 0},hasErrorPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.errorPort)!==void 0},hasCompletePort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.completePort)!==void 0},hasStatusPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.statusPort)!==void 0},hasBuiltinPorts(){return this.hasErrorPort||this.hasCompletePort||this.hasStatusPort},hasOutputValidation(){return this.hasOutputSchemas},showOutputs(){return this.outputRows.length>0},showPortsSettings(){return this.features.hasInput||this.showOutputs||this.hasBuiltinPorts},outputRows(){const e=(this.localNode.errorPort?1:0)+(this.localNode.completePort?1:0)+(this.localNode.statusPort?1:0),t=typeof this.localNode.outputs=="number"?this.localNode.outputs:null,r=t!==null&&t>=e?t-e:this.features.outputPorts.length;return Array.from({length:r},(n,o)=>{var l;return{index:o,label:((l=this.features.outputPorts[o])==null?void 0:l.label)??`Output ${o}`}})},inputLabel(){return this.resolveLabel("inputLabels.0","")||this.resolveLabel("inputLabels","Input")},contextModeOptions(){return[{value:"carry",label:this.resolveLabel("contextModes.modes.carry","carry")},{value:"trace",label:this.resolveLabel("contextModes.modes.trace","trace")},{value:"reset",label:this.resolveLabel("contextModes.modes.reset","reset")}]}},created(){this.debouncedValidate=Ca(()=>this.validate(),150)},beforeMount(){var e;for(const t of["validateOutputs","validateOutputTypes","outputContextModes","outputReturnProperties","outputSchemas"]){const r=this.localNode[t];r&&typeof r=="object"&&(this.localNode[t]={...r})}if((e=this.schema)!=null&&e.properties){for(const[t,r]of Object.entries(this.schema.properties))if(r.type==="array"&&!Array.isArray(this.localNode[t])){const n=this.localNode[t];this.localNode[t]=n?String(n).split(",").filter(Boolean):[]}}this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.localNode._def.credentials[t].type==="password"&&this.localNode.credentials[`has_${t}`]&&!this.localNode.credentials[t]&&(this.localNode.credentials[t]="__PWD__")}),this.validate(),this.localNode._def.defaults&&Object.keys(this.localNode._def.defaults).forEach(t=>{this.$watch(()=>this.localNode[t],()=>{var r;(r=this.debouncedValidate)==null||r.call(this)},{deep:!0})}),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.$watch(()=>this.localNode.credentials[t],(r,n)=>{var o;(o=this.debouncedValidate)==null||o.call(this),this.localNode._def.credentials[t].type==="password"&&r!==n&&(this.localNode.credentials[`has_${t}`]=!!r)},{deep:!0})})},beforeUnmount(){var e,t;(t=(e=this.debouncedValidate)==null?void 0:e.cancel)==null||t.call(e),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(r=>{var n,o;this.localNode._def.credentials[r].type==="password"&&(n=this.localNode.credentials)!=null&&n[`has_${r}`]&&((o=this.localNode.credentials)==null?void 0:o[r])==="__PWD__"&&(this.localNode.credentials[r]=void 0)})},methods:{validate(){const e=si(this.localNode,this.schema);Object.assign(e,this.schemaStringErrors());const t=Object.keys(this.errors);for(let r=0;r<t.length;r++)delete this.errors[t[r]];Object.assign(this.errors,e)},schemaStringErrors(){const e={};if(this.acceptsInputSchema&&this.localNode.validateInput){const t=Wt(this.inputSchemaValue());t&&(e["node.inputSchema"]=t)}if(this.hasOutputSchemas)for(const{index:t}of this.outputRows){if(!this.validateOutputFor(t))continue;const r=Wt(this.outputSchemaFor(t));r&&(e[`node.outputSchemas.${t}`]=r)}return e},resolveLabel(e,t){const r=this.$i18n(e),n=`${this.localNode.type}.${e}`;return r&&r!==n&&r!==e?r:t},docsUrl(e){return`https://bonsaedev.github.io/nrg${e}`},recalculateOutputs(){var e;let t=((e=this.localNode._def)==null?void 0:e.outputs)??0;this.localNode.errorPort&&t++,this.localNode.completePort&&t++,this.localNode.statusPort&&t++,this.localNode.outputs=t},validateOutputFor(e){var t;return((t=this.localNode.validateOutputs)==null?void 0:t[e])??!1},setValidateOutput(e,t){this.localNode.validateOutputs={...this.localNode.validateOutputs??{},[e]:t}},validateOutputTypesFor(e){var t;return((t=this.localNode.validateOutputTypes)==null?void 0:t[e])??!1},setValidateOutputTypes(e,t){this.localNode.validateOutputTypes={...this.localNode.validateOutputTypes??{},[e]:t}},returnPropertyFor(e){var t;return((t=this.localNode.outputReturnProperties)==null?void 0:t[e])??""},setReturnProperty(e,t){const r={...this.localNode.outputReturnProperties??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputReturnProperties=r},contextModeFor(e){var t;return((t=this.localNode.outputContextModes)==null?void 0:t[e])??this.authorContextModeDefaults[e]??"carry"},setContextMode(e,t){this.localNode.outputContextModes={...this.localNode.outputContextModes??{},[e]:t}},outputSchemaFor(e){var t;return((t=this.localNode.outputSchemas)==null?void 0:t[e])??this.authorOutputSchemaDefaults[e]??""},setOutputSchema(e,t){const r={...this.localNode.outputSchemas??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputSchemas=r},schemaTrayRef(){return this.$refs.schemaTray},openOutputSchemaEditor(e){var t;const r=`${this.resolveLabel("outputs.schema","Data Schema")} \u2014 ${((t=this.outputRows[e])==null?void 0:t.label)??`Output ${e}`}`;this.schemaTrayRef().open(r,this.outputSchemaFor(e),n=>this.setOutputSchema(e,n))},inputSchemaValue(){var e,t,r;return this.localNode.inputSchema??((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)==null?void 0:r.default)??""},setInputSchema(e){this.localNode.inputSchema=e.trim()},openInputSchemaEditor(){const e=`${this.resolveLabel("outputs.schema","Data Schema")} \u2014 ${this.inputLabel}`;this.schemaTrayRef().open(e,this.inputSchemaValue(),t=>this.setInputSchema(t))}}}),xi={class:"nrg-form-app"},Pi={style:{width:"100%","padding-bottom":"12px"}},ki={key:0,class:"nrg-section"},Ni={class:"nrg-section-title"},ji={key:0,class:"nrg-subsection"},Oi={class:"nrg-subsection-title"},Ci={class:"nrg-input"},Ti={class:"nrg-outputs-label"},Ii={class:"nrg-outputs-flag"},Vi={key:0,class:"nrg-outputs-flag"},Ri={key:1,class:"nrg-outputs-flag"},Li={class:"nrg-outputs-label"},Mi={class:"nrg-outputs-flag"},Ai={key:0,class:"nrg-outputs-flag"},qi=["title","disabled","aria-label"],Di={key:1,class:"nrg-outputs-flag"},zi={class:"nrg-help-list"},Fi=["href"],Ui={key:0},Ki={key:1,class:"nrg-subsection"},Bi={class:"nrg-subsection-title"},Wi={class:"nrg-outputs"},Gi={class:"nrg-outputs-index"},Hi={class:"nrg-outputs-label"},Ji={key:0,class:"nrg-outputs-flag"},Zi={key:1,class:"nrg-outputs-flag"},Qi={key:2,class:"nrg-outputs-flag"},Yi={key:3,class:"nrg-outputs-return-col"},Xi={key:4,class:"nrg-outputs-context-col"},el={class:"nrg-outputs-index"},tl={class:"nrg-outputs-label"},rl={key:0,class:"nrg-outputs-flag"},nl={key:1,class:"nrg-outputs-flag"},ol=["title","disabled","aria-label","onClick"],al={key:2,class:"nrg-outputs-flag"},sl={key:3,class:"nrg-outputs-return-col"},il=["value","onInput"],ll={key:4,class:"nrg-outputs-context-col"},ul=["value","onChange"],cl=["value"],dl={class:"nrg-help-list"},pl=["href"],fl={key:0},hl=["href"],ml={key:1},yl=["href"],vl={key:2},gl=["href"],bl={key:2,class:"nrg-subsection"},$l={class:"nrg-subsection-title"},wl={class:"nrg-help"},_l=["href"],Sl={class:"nrg-lifecycle"},El={class:"nrg-lifecycle-port"},xl={class:"nrg-outputs-flag"},Pl={class:"nrg-lifecycle-desc"},kl={key:0},Nl={class:"nrg-lifecycle-port"},jl={class:"nrg-outputs-flag"},Ol={class:"nrg-lifecycle-desc"},Cl={key:1},Tl={class:"nrg-lifecycle-port"},Il={class:"nrg-outputs-flag"},Vl={class:"nrg-lifecycle-desc"},Rl={key:2},Ll={class:"nrg-lifecycle-port"},Ml={class:"nrg-outputs-flag"},Al={class:"nrg-lifecycle-desc"};function ql(e,t,r,n,o,l){const s=ie("NodeRedSchemaTray"),c=ie("NodeRedNodeForm"),y=ie("NodeRedToggle");return K(),J("div",xi,[Q(` Official JSON Schema logo, defined once as a symbol and referenced by
19
+ no separate error message is rendered here. `),fe(a,{class:"nrg-schema-editor","model-value":e.draft,language:"json",expandable:!1,fill:"","editor-options":e.editorOptions,"onUpdate:modelValue":t[0]||(t[0]=y=>e.draft=y)},null,8,["model-value","editor-options"])])]),_:1},8,["title","onDone"])],2112)}const _i=Ee(bi,[["render",wi],["__scopeId","data-v-feefe431"]]),Si=we({name:"NodeRedVueApp",components:{NodeRedSchemaTray:_i},provide(){return{__nrg_form_node:this.localNode,__nrg_form_schema:this.schema,__nrg_form_errors:this.errors}},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},features:{type:Object,required:!0}},setup(){return{debouncedValidate:Ie(null),typeCheckEnabled:nt}},data(){return{localNode:this.node,errors:{}}},computed:{hasOutputReturnProperties(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputReturnProperties)!==void 0},hasOutputContextModes(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)!==void 0},supportsInputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateInputTypes)!==void 0},supportsOutputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateOutputTypes)!==void 0},authorContextModeDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)==null?void 0:r.default)??{}},hasOutputSchemas(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)!==void 0},authorOutputSchemaDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)==null?void 0:r.default)??{}},acceptsInputSchema(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)!==void 0},hasErrorPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.errorPort)!==void 0},hasCompletePort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.completePort)!==void 0},hasStatusPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.statusPort)!==void 0},hasBuiltinPorts(){return this.hasErrorPort||this.hasCompletePort||this.hasStatusPort},hasOutputValidation(){return this.hasOutputSchemas},showOutputs(){return this.outputRows.length>0},showPortsSettings(){return this.features.hasInput||this.showOutputs||this.hasBuiltinPorts},outputRows(){const e=(this.localNode.errorPort?1:0)+(this.localNode.completePort?1:0)+(this.localNode.statusPort?1:0),t=typeof this.localNode.outputs=="number"?this.localNode.outputs:null,r=t!==null&&t>=e?t-e:this.features.outputPorts.length;return Array.from({length:r},(n,o)=>{var l;return{index:o,label:((l=this.features.outputPorts[o])==null?void 0:l.label)??`Output ${o}`}})},inputLabel(){return this.resolveLabel("inputLabels.0","")||this.resolveLabel("inputLabels","Input")},contextModeOptions(){return[{value:"carry",label:this.resolveLabel("contextModes.modes.carry","carry")},{value:"trace",label:this.resolveLabel("contextModes.modes.trace","trace")},{value:"reset",label:this.resolveLabel("contextModes.modes.reset","reset")}]}},created(){this.debouncedValidate=Oa(()=>this.validate(),150)},beforeMount(){var e;for(const t of["validateOutputs","validateOutputTypes","outputContextModes","outputReturnProperties","outputSchemas"]){const r=this.localNode[t];r&&typeof r=="object"&&(this.localNode[t]={...r})}if((e=this.schema)!=null&&e.properties){for(const[t,r]of Object.entries(this.schema.properties))if(r.type==="array"&&!Array.isArray(this.localNode[t])){const n=this.localNode[t];this.localNode[t]=n?String(n).split(",").filter(Boolean):[]}}this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.localNode._def.credentials[t].type==="password"&&this.localNode.credentials[`has_${t}`]&&!this.localNode.credentials[t]&&(this.localNode.credentials[t]="__PWD__")}),this.validate(),this.localNode._def.defaults&&Object.keys(this.localNode._def.defaults).forEach(t=>{this.$watch(()=>this.localNode[t],()=>{var r;(r=this.debouncedValidate)==null||r.call(this)},{deep:!0})}),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.$watch(()=>this.localNode.credentials[t],(r,n)=>{var o;(o=this.debouncedValidate)==null||o.call(this),this.localNode._def.credentials[t].type==="password"&&r!==n&&(this.localNode.credentials[`has_${t}`]=!!r)},{deep:!0})})},beforeUnmount(){var e,t;(t=(e=this.debouncedValidate)==null?void 0:e.cancel)==null||t.call(e),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(r=>{var n,o;this.localNode._def.credentials[r].type==="password"&&(n=this.localNode.credentials)!=null&&n[`has_${r}`]&&((o=this.localNode.credentials)==null?void 0:o[r])==="__PWD__"&&(this.localNode.credentials[r]=void 0)})},methods:{validate(){const e=ai(this.localNode,this.schema);Object.assign(e,this.schemaStringErrors());const t=Object.keys(this.errors);for(let r=0;r<t.length;r++)delete this.errors[t[r]];Object.assign(this.errors,e)},schemaStringErrors(){const e={};if(this.acceptsInputSchema&&this.localNode.validateInput){const t=Wt(this.inputSchemaValue());t&&(e["node.inputSchema"]=t)}if(this.hasOutputSchemas)for(const{index:t}of this.outputRows){if(!this.validateOutputFor(t))continue;const r=Wt(this.outputSchemaFor(t));r&&(e[`node.outputSchemas.${t}`]=r)}return e},resolveLabel(e,t){const r=this.$i18n(e),n=`${this.localNode.type}.${e}`;return r&&r!==n&&r!==e?r:t},docsUrl(e){return`https://bonsaedev.github.io/nrg${e}`},recalculateOutputs(){var e;let t=((e=this.localNode._def)==null?void 0:e.outputs)??0;this.localNode.errorPort&&t++,this.localNode.completePort&&t++,this.localNode.statusPort&&t++,this.localNode.outputs=t},validateOutputFor(e){var t;return((t=this.localNode.validateOutputs)==null?void 0:t[e])??!1},setValidateOutput(e,t){this.localNode.validateOutputs={...this.localNode.validateOutputs??{},[e]:t}},validateOutputTypesFor(e){var t;return((t=this.localNode.validateOutputTypes)==null?void 0:t[e])??!1},setValidateOutputTypes(e,t){this.localNode.validateOutputTypes={...this.localNode.validateOutputTypes??{},[e]:t}},returnPropertyFor(e){var t;return((t=this.localNode.outputReturnProperties)==null?void 0:t[e])??""},setReturnProperty(e,t){const r={...this.localNode.outputReturnProperties??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputReturnProperties=r},contextModeFor(e){var t;return((t=this.localNode.outputContextModes)==null?void 0:t[e])??this.authorContextModeDefaults[e]??"carry"},setContextMode(e,t){this.localNode.outputContextModes={...this.localNode.outputContextModes??{},[e]:t}},outputSchemaFor(e){var t;return((t=this.localNode.outputSchemas)==null?void 0:t[e])??this.authorOutputSchemaDefaults[e]??""},setOutputSchema(e,t){const r={...this.localNode.outputSchemas??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputSchemas=r},schemaTrayRef(){return this.$refs.schemaTray},openOutputSchemaEditor(e){var t;const r=`${this.resolveLabel("outputs.schema","Data Schema")} \u2014 ${((t=this.outputRows[e])==null?void 0:t.label)??`Output ${e}`}`;this.schemaTrayRef().open(r,this.outputSchemaFor(e),n=>this.setOutputSchema(e,n))},inputSchemaValue(){var e,t,r;return this.localNode.inputSchema??((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)==null?void 0:r.default)??""},setInputSchema(e){this.localNode.inputSchema=e.trim()},openInputSchemaEditor(){const e=`${this.resolveLabel("outputs.schema","Data Schema")} \u2014 ${this.inputLabel}`;this.schemaTrayRef().open(e,this.inputSchemaValue(),t=>this.setInputSchema(t))}}}),Ei={class:"nrg-form-app"},xi={style:{width:"100%","padding-bottom":"12px"}},Pi={key:0,class:"nrg-section"},ki={class:"nrg-section-title"},Ni={key:0,class:"nrg-subsection"},ji={class:"nrg-subsection-title"},Oi={class:"nrg-input"},Ci={class:"nrg-outputs-label"},Ti={class:"nrg-outputs-flag"},Ii={key:0,class:"nrg-outputs-flag"},Vi={key:1,class:"nrg-outputs-flag"},Ri={class:"nrg-outputs-label"},Li={class:"nrg-outputs-flag"},Mi={key:0,class:"nrg-outputs-flag"},Ai=["title","disabled","aria-label"],qi={key:1,class:"nrg-outputs-flag"},Di={class:"nrg-help-list"},zi=["href"],Fi={key:0},Ui={key:1,class:"nrg-subsection"},Ki={class:"nrg-subsection-title"},Bi={class:"nrg-outputs"},Wi={class:"nrg-outputs-index"},Gi={class:"nrg-outputs-label"},Hi={key:0,class:"nrg-outputs-flag"},Ji={key:1,class:"nrg-outputs-flag"},Zi={key:2,class:"nrg-outputs-flag"},Qi={key:3,class:"nrg-outputs-return-col"},Yi={key:4,class:"nrg-outputs-context-col"},Xi={class:"nrg-outputs-index"},el={class:"nrg-outputs-label"},tl={key:0,class:"nrg-outputs-flag"},rl={key:1,class:"nrg-outputs-flag"},nl=["title","disabled","aria-label","onClick"],ol={key:2,class:"nrg-outputs-flag"},al={key:3,class:"nrg-outputs-return-col"},sl=["value","onInput"],il={key:4,class:"nrg-outputs-context-col"},ll=["value","onChange"],ul=["value"],cl={class:"nrg-help-list"},dl=["href"],pl={key:0},fl=["href"],hl={key:1},ml=["href"],yl={key:2},vl=["href"],gl={key:2,class:"nrg-subsection"},bl={class:"nrg-subsection-title"},$l={class:"nrg-help"},wl=["href"],_l={class:"nrg-lifecycle"},Sl={class:"nrg-lifecycle-port"},El={class:"nrg-outputs-flag"},xl={class:"nrg-lifecycle-desc"},Pl={key:0},kl={class:"nrg-lifecycle-port"},Nl={class:"nrg-outputs-flag"},jl={class:"nrg-lifecycle-desc"},Ol={key:1},Cl={class:"nrg-lifecycle-port"},Tl={class:"nrg-outputs-flag"},Il={class:"nrg-lifecycle-desc"},Vl={key:2},Rl={class:"nrg-lifecycle-port"},Ll={class:"nrg-outputs-flag"},Ml={class:"nrg-lifecycle-desc"};function Al(e,t,r,n,o,l){const a=ie("NodeRedSchemaTray"),c=ie("NodeRedNodeForm"),y=ie("NodeRedToggle");return K(),J("div",Ei,[Q(` Official JSON Schema logo, defined once as a symbol and referenced by
20
20
  the per-port Schema buttons via <use>. \`fill="currentColor"\` lets the
21
- button's color (blue normally, red on an invalid schema) drive it. `),t[8]||(t[8]=q("svg",{class:"nrg-json-schema-logo-defs",width:"0",height:"0","aria-hidden":"true",focusable:"false"},[q("symbol",{id:"nrg-json-schema-logo",viewBox:"0 0 256 220"},[q("path",{fill:"currentColor",d:"M70.2063725,0 L70.2063725,16.7669464 C63.5900004,16.7669464 58.3734386,17.798983 54.5844902,19.8489231 C50.7955417,21.8988245 48.1094507,25.0797726 46.5405047,29.3916515 C44.9711727,33.7035691 44.1795558,39.2031822 44.1795558,45.8759328 L44.1795558,80.1166428 C44.1795558,84.5697771 43.5999379,88.6274891 42.4264142,92.2747188 C41.2528905,95.9223347 39.1039404,99.0606127 35.9655466,101.690325 C32.8129036,104.320038 28.3596149,106.341557 22.5632806,107.769556 C21.8281582,107.939078 20.9940644,108.080411 20.2023317,108.236031 L20.2023317,110.879645 L21.8004023,111.178071 C22.0622022,111.229887 22.3182398,111.28485 22.5632806,111.34612 C28.3596149,112.774119 32.8270369,114.795638 35.9655466,117.425351 C39.1039404,120.054677 41.2528905,123.193341 42.4264142,126.840957 C43.5999379,130.502475 44.1795558,134.545513 44.1795558,138.999033 L44.1795558,173.239743 C44.1795558,179.926781 44.9711727,185.397819 46.5405047,189.681432 C48.1094507,193.965044 50.7955417,197.146185 54.5844902,199.224469 C58.3734386,201.302367 63.5900004,202.348845 70.2063725,202.348845 L70.2063725,219.129577 C61.8086695,219.129577 54.7682997,218.210916 49.0566878,216.387108 C43.345462,214.5633 38.793086,211.764066 35.3576621,208.003693 C31.9222767,204.242933 29.4623564,199.478945 27.9496346,193.710568 C26.4369514,187.942578 25.6876571,181.128494 25.6876571,173.254031 L25.6876571,145.869881 C25.6876571,136.510653 23.7791268,129.837903 19.9902942,125.836955 C16.1873284,121.836008 9.5285952,119.842678 0,119.842678 L0,99.301187 C9.5285952,99.301187 16.2014617,97.3078572 19.9902942,93.3069099 C23.7932601,89.3059626 25.6876571,82.633212 25.6876571,73.2739842 L25.6876571,45.8759328 C25.6876571,38.0013534 26.4369514,31.1871157 27.9496346,25.419048 C29.4623564,19.6509802 31.9222767,14.8866826 35.3576621,11.1261166 C38.793086,7.3655891 43.345462,4.56639339 49.0566878,2.74265496 C54.7682997,0.918931981 61.8229572,0 70.2063725,0 Z M185.793628,0 C194.177043,0 201.2317,0.918931981 206.942926,2.74265496 C212.654538,4.56639339 217.206914,7.3655891 220.642145,11.1261166 C224.063474,14.8866826 226.537566,19.6509802 228.050134,25.419048 C229.563087,31.1871157 230.312227,38.0013534 230.312227,45.8759328 L230.312227,73.2739842 C230.312227,82.633212 232.206701,89.3059626 236.009551,93.3069099 C239.7985,97.3078572 246.47125,99.301187 256,99.301187 L256,119.828777 C246.47125,119.828777 239.812401,121.822106 236.009551,125.823054 C232.220603,129.823615 230.312227,136.496752 230.312227,145.855593 L230.312227,173.239743 C230.312227,181.114207 229.563087,187.928676 228.050134,193.696667 C226.537566,199.464657 224.077762,204.229032 220.642145,207.989405 C217.220816,211.750164 212.654538,214.549398 206.942926,216.37282 C201.2317,218.196628 194.190944,219.115676 185.793628,219.115676 L185.793628,202.334558 C192.41,202.334558 197.626561,201.288465 201.41551,199.210181 C205.204072,197.131897 207.890163,193.951142 209.459495,189.66753 C211.028827,185.383918 211.820444,179.912494 211.820444,173.225455 L211.820444,138.984745 C211.820444,134.531611 212.400062,130.488187 213.573586,126.826669 C214.746723,123.179054 216.895673,120.040776 220.034338,117.411063 C223.172616,114.781737 227.640038,112.759831 233.436604,111.332218 C234.171842,111.148409 235.005936,111.020978 235.797552,110.865357 L235.797552,108.221743 L234.199559,107.916967 C233.937746,107.865151 233.681683,107.811776 233.436604,107.755269 C227.640038,106.341557 223.186903,104.320038 220.034338,101.690325 C216.895673,99.0606127 214.746723,95.9223347 213.573586,92.2747188 C212.400062,88.6274891 211.820444,84.5697771 211.820444,80.1166428 L211.820444,45.8759328 C211.820444,39.2031822 211.028827,33.7035691 209.459495,29.3916515 C207.890163,25.0797726 205.204072,21.8988245 201.41551,19.8489231 C197.626561,17.798983 192.41,16.7669464 185.793628,16.7669464 L185.793628,0 Z M201.670372,109.282124 C201.670372,110.257936 199.804473,112.717741 197.54238,114.753547 C193.751288,118.158012 188.207849,123.460858 182.974135,128.606735 L179.139144,132.404595 L174.027319,137.56951 C170.693445,140.990614 168.447565,143.430555 168.447565,143.735219 C168.447565,144.27236 172.434225,151.157109 177.326031,159.04586 L185.582015,172.391748 C185.949634,172.985267 185.878968,173.748695 185.412493,174.257647 L183.447353,175.7706 C181.962974,177.410598 180.959359,178.696879 180.761261,180.308688 C181.01823,181.0282 180.303186,181.478717 179.377416,181.91024 L178.287169,182.400874 C175.142208,183.862677 172.755992,182.324703 164.223729,172.472139 L160.197164,167.787323 C156.16131,163.157181 152.753231,159.63798 152.246065,159.625478 C150.959784,159.597289 136.723424,175.162407 125.710297,188.635339 C115.997737,200.51075 107.4448,200.751324 104.970708,198.418564 C100.800239,194.460094 101.408046,187.688488 106.54004,181.04354 L107.206599,180.214619 C109.7226,177.180318 115.109092,171.505584 121.238899,165.346795 L123.285887,163.299693 L126.946872,159.684501 C130.63413,156.072631 134.354688,152.516872 137.698851,149.432543 L142.335795,145.162832 L132.874534,124.847927 C127.159513,112.345955 127.648567,111.24418 135.923327,110.243236 L143.650651,109.381365 L150.365878,119.531824 C154.055585,125.116005 157.618247,129.682668 158.25463,129.682668 C158.846764,129.682668 164.635224,125.074796 171.44336,119.202365 L177.818422,113.674994 C185.511074,107.076756 187.100569,106.282631 190.205449,106.588205 L191.09553,106.695274 C193.519196,107.031905 195.693016,106.870138 196.463229,106.328949 L196.63762,106.172035 C197.938188,104.61699 201.670372,106.921175 201.670372,109.282124 Z M163.215943,16.3851099 C169.379742,16.3851099 170.29879,18.5341054 170.29879,18.5341054 C149.361104,29.4623178 131.647037,48.9435445 113.353351,84.8242529 L110.406644,90.6984078 L99.0320373,112.816596 C98.1349705,114.447728 97.9565883,112.170901 93.9476115,106.701876 L93.2640467,105.790128 C71.8915229,73.8845169 56.3134099,67.8887357 56.4070411,67.3834557 C64.6642824,62.0631453 80.1305444,67.2658056 89.6874833,75.7623641 L90.0408147,76.101794 L90.9868899,76.9269196 C92.5445197,78.3256329 93.2759284,79.2291111 95.5968064,81.8130197 C95.8286801,81.8130197 98.2754368,77.9518231 100.816953,73.8376482 L106.736979,64.1271414 C128.027996,30.5508875 150.29444,16.3569275 163.215943,16.3851099 Z"})])],-1)),Q(" Vue-driven schema editor tray (renders into a RED tray on open()). "),fe(s,{ref:"schemaTray"},null,512),Q(" 1. Node fields (schema-driven, name first) "),q("div",Pi,[fe(c,{node:e.localNode,schema:e.schema,errors:e.errors,style:{width:"100%"}},null,8,["node","schema","errors"])]),Q(" 2. Ports Settings "),e.showPortsSettings?(K(),J("div",ki,[q("div",Ni,Z(e.resolveLabel("sections.portsSettings","Ports Settings")),1),Q(` Input \u2014 a single Validate Data row, rendered as a table so it matches
21
+ button's color (blue normally, red on an invalid schema) drive it. `),t[8]||(t[8]=q("svg",{class:"nrg-json-schema-logo-defs",width:"0",height:"0","aria-hidden":"true",focusable:"false"},[q("symbol",{id:"nrg-json-schema-logo",viewBox:"0 0 256 220"},[q("path",{fill:"currentColor",d:"M70.2063725,0 L70.2063725,16.7669464 C63.5900004,16.7669464 58.3734386,17.798983 54.5844902,19.8489231 C50.7955417,21.8988245 48.1094507,25.0797726 46.5405047,29.3916515 C44.9711727,33.7035691 44.1795558,39.2031822 44.1795558,45.8759328 L44.1795558,80.1166428 C44.1795558,84.5697771 43.5999379,88.6274891 42.4264142,92.2747188 C41.2528905,95.9223347 39.1039404,99.0606127 35.9655466,101.690325 C32.8129036,104.320038 28.3596149,106.341557 22.5632806,107.769556 C21.8281582,107.939078 20.9940644,108.080411 20.2023317,108.236031 L20.2023317,110.879645 L21.8004023,111.178071 C22.0622022,111.229887 22.3182398,111.28485 22.5632806,111.34612 C28.3596149,112.774119 32.8270369,114.795638 35.9655466,117.425351 C39.1039404,120.054677 41.2528905,123.193341 42.4264142,126.840957 C43.5999379,130.502475 44.1795558,134.545513 44.1795558,138.999033 L44.1795558,173.239743 C44.1795558,179.926781 44.9711727,185.397819 46.5405047,189.681432 C48.1094507,193.965044 50.7955417,197.146185 54.5844902,199.224469 C58.3734386,201.302367 63.5900004,202.348845 70.2063725,202.348845 L70.2063725,219.129577 C61.8086695,219.129577 54.7682997,218.210916 49.0566878,216.387108 C43.345462,214.5633 38.793086,211.764066 35.3576621,208.003693 C31.9222767,204.242933 29.4623564,199.478945 27.9496346,193.710568 C26.4369514,187.942578 25.6876571,181.128494 25.6876571,173.254031 L25.6876571,145.869881 C25.6876571,136.510653 23.7791268,129.837903 19.9902942,125.836955 C16.1873284,121.836008 9.5285952,119.842678 0,119.842678 L0,99.301187 C9.5285952,99.301187 16.2014617,97.3078572 19.9902942,93.3069099 C23.7932601,89.3059626 25.6876571,82.633212 25.6876571,73.2739842 L25.6876571,45.8759328 C25.6876571,38.0013534 26.4369514,31.1871157 27.9496346,25.419048 C29.4623564,19.6509802 31.9222767,14.8866826 35.3576621,11.1261166 C38.793086,7.3655891 43.345462,4.56639339 49.0566878,2.74265496 C54.7682997,0.918931981 61.8229572,0 70.2063725,0 Z M185.793628,0 C194.177043,0 201.2317,0.918931981 206.942926,2.74265496 C212.654538,4.56639339 217.206914,7.3655891 220.642145,11.1261166 C224.063474,14.8866826 226.537566,19.6509802 228.050134,25.419048 C229.563087,31.1871157 230.312227,38.0013534 230.312227,45.8759328 L230.312227,73.2739842 C230.312227,82.633212 232.206701,89.3059626 236.009551,93.3069099 C239.7985,97.3078572 246.47125,99.301187 256,99.301187 L256,119.828777 C246.47125,119.828777 239.812401,121.822106 236.009551,125.823054 C232.220603,129.823615 230.312227,136.496752 230.312227,145.855593 L230.312227,173.239743 C230.312227,181.114207 229.563087,187.928676 228.050134,193.696667 C226.537566,199.464657 224.077762,204.229032 220.642145,207.989405 C217.220816,211.750164 212.654538,214.549398 206.942926,216.37282 C201.2317,218.196628 194.190944,219.115676 185.793628,219.115676 L185.793628,202.334558 C192.41,202.334558 197.626561,201.288465 201.41551,199.210181 C205.204072,197.131897 207.890163,193.951142 209.459495,189.66753 C211.028827,185.383918 211.820444,179.912494 211.820444,173.225455 L211.820444,138.984745 C211.820444,134.531611 212.400062,130.488187 213.573586,126.826669 C214.746723,123.179054 216.895673,120.040776 220.034338,117.411063 C223.172616,114.781737 227.640038,112.759831 233.436604,111.332218 C234.171842,111.148409 235.005936,111.020978 235.797552,110.865357 L235.797552,108.221743 L234.199559,107.916967 C233.937746,107.865151 233.681683,107.811776 233.436604,107.755269 C227.640038,106.341557 223.186903,104.320038 220.034338,101.690325 C216.895673,99.0606127 214.746723,95.9223347 213.573586,92.2747188 C212.400062,88.6274891 211.820444,84.5697771 211.820444,80.1166428 L211.820444,45.8759328 C211.820444,39.2031822 211.028827,33.7035691 209.459495,29.3916515 C207.890163,25.0797726 205.204072,21.8988245 201.41551,19.8489231 C197.626561,17.798983 192.41,16.7669464 185.793628,16.7669464 L185.793628,0 Z M201.670372,109.282124 C201.670372,110.257936 199.804473,112.717741 197.54238,114.753547 C193.751288,118.158012 188.207849,123.460858 182.974135,128.606735 L179.139144,132.404595 L174.027319,137.56951 C170.693445,140.990614 168.447565,143.430555 168.447565,143.735219 C168.447565,144.27236 172.434225,151.157109 177.326031,159.04586 L185.582015,172.391748 C185.949634,172.985267 185.878968,173.748695 185.412493,174.257647 L183.447353,175.7706 C181.962974,177.410598 180.959359,178.696879 180.761261,180.308688 C181.01823,181.0282 180.303186,181.478717 179.377416,181.91024 L178.287169,182.400874 C175.142208,183.862677 172.755992,182.324703 164.223729,172.472139 L160.197164,167.787323 C156.16131,163.157181 152.753231,159.63798 152.246065,159.625478 C150.959784,159.597289 136.723424,175.162407 125.710297,188.635339 C115.997737,200.51075 107.4448,200.751324 104.970708,198.418564 C100.800239,194.460094 101.408046,187.688488 106.54004,181.04354 L107.206599,180.214619 C109.7226,177.180318 115.109092,171.505584 121.238899,165.346795 L123.285887,163.299693 L126.946872,159.684501 C130.63413,156.072631 134.354688,152.516872 137.698851,149.432543 L142.335795,145.162832 L132.874534,124.847927 C127.159513,112.345955 127.648567,111.24418 135.923327,110.243236 L143.650651,109.381365 L150.365878,119.531824 C154.055585,125.116005 157.618247,129.682668 158.25463,129.682668 C158.846764,129.682668 164.635224,125.074796 171.44336,119.202365 L177.818422,113.674994 C185.511074,107.076756 187.100569,106.282631 190.205449,106.588205 L191.09553,106.695274 C193.519196,107.031905 195.693016,106.870138 196.463229,106.328949 L196.63762,106.172035 C197.938188,104.61699 201.670372,106.921175 201.670372,109.282124 Z M163.215943,16.3851099 C169.379742,16.3851099 170.29879,18.5341054 170.29879,18.5341054 C149.361104,29.4623178 131.647037,48.9435445 113.353351,84.8242529 L110.406644,90.6984078 L99.0320373,112.816596 C98.1349705,114.447728 97.9565883,112.170901 93.9476115,106.701876 L93.2640467,105.790128 C71.8915229,73.8845169 56.3134099,67.8887357 56.4070411,67.3834557 C64.6642824,62.0631453 80.1305444,67.2658056 89.6874833,75.7623641 L90.0408147,76.101794 L90.9868899,76.9269196 C92.5445197,78.3256329 93.2759284,79.2291111 95.5968064,81.8130197 C95.8286801,81.8130197 98.2754368,77.9518231 100.816953,73.8376482 L106.736979,64.1271414 C128.027996,30.5508875 150.29444,16.3569275 163.215943,16.3851099 Z"})])],-1)),Q(" Vue-driven schema editor tray (renders into a RED tray on open()). "),fe(a,{ref:"schemaTray"},null,512),Q(" 1. Node fields (schema-driven, name first) "),q("div",xi,[fe(c,{node:e.localNode,schema:e.schema,errors:e.errors,style:{width:"100%"}},null,8,["node","schema","errors"])]),Q(" 2. Ports Settings "),e.showPortsSettings?(K(),J("div",Pi,[q("div",ki,Z(e.resolveLabel("sections.portsSettings","Ports Settings")),1),Q(` Input \u2014 a single Validate Data row, rendered as a table so it matches
22
22
  the Outputs / Lifecycle Output Ports sections (muted headers) instead
23
- of a bright toggle label that outweighs the section title. `),e.features.hasInput?(K(),J("div",ji,[q("div",Oi,Z(e.resolveLabel("sections.input","Input")),1),q("table",Ci,[q("thead",null,[q("tr",null,[q("th",Ti,Z(e.resolveLabel("outputs.label","Label")),1),q("th",Ii,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),e.acceptsInputSchema?(K(),J("th",Vi,Z(e.resolveLabel("outputs.schema","Data Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("th",Ri,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1)):Q("v-if",!0)])]),q("tbody",null,[q("tr",null,[q("td",Li,Z(e.inputLabel),1),q("td",Mi,[fe(y,{"model-value":e.localNode.validateInput,"aria-label":e.resolveLabel("toggles.validateInput","Validate Data"),"onUpdate:modelValue":t[0]||(t[0]=d=>{e.localNode.validateInput=d})},null,8,["model-value","aria-label"])]),e.acceptsInputSchema?(K(),J("td",Ai,[q("button",{type:"button",class:Ke(["red-ui-button red-ui-button-small nrg-outputs-schema-btn",{"nrg-schema-btn-error":!!e.errors["node.inputSchema"]}]),title:e.errors["node.inputSchema"]||void 0,disabled:!e.localNode.validateInput,"aria-label":`${e.resolveLabel("outputs.schema","Data Schema")} \u2014 ${e.inputLabel}`,onClick:t[1]||(t[1]=d=>e.openInputSchemaEditor())},[...t[6]||(t[6]=[q("span",{class:"nrg-schema-glyph","aria-hidden":"true"},[q("svg",{viewBox:"0 0 256 220"},[q("use",{href:"#nrg-json-schema-logo"})])],-1)])],10,qi)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("td",Di,[fe(y,{"model-value":e.localNode.validateInputTypes,"aria-label":e.resolveLabel("toggles.validateInputTypes","Validate Types"),"onUpdate:modelValue":t[2]||(t[2]=d=>{e.localNode.validateInputTypes=d})},null,8,["model-value","aria-label"])])):Q("v-if",!0)])])]),q("ul",zi,[q("li",null,[q("strong",null,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateInput","Validate incoming messages against the input schema before input() runs."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#input-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,Fi)]),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("li",Ui,[q("strong",null,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateInputTypes","Type-check wires connected to this input on deploy (TypeScript).")),1)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Outputs "),e.showOutputs?(K(),J("div",Ki,[q("div",Bi,Z(e.resolveLabel("sections.outputs","Outputs")),1),q("table",Wi,[q("thead",null,[q("tr",null,[q("th",Gi,Z(e.resolveLabel("outputs.port","Port")),1),q("th",Hi,Z(e.resolveLabel("outputs.label","Label")),1),e.hasOutputValidation?(K(),J("th",Ji,Z(e.resolveLabel("outputs.validate","Validate Data")),1)):Q("v-if",!0),e.hasOutputSchemas?(K(),J("th",Zi,Z(e.resolveLabel("outputs.schema","Data Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("th",Qi,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1)):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("th",Yi,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1)):Q("v-if",!0),e.hasOutputContextModes?(K(),J("th",Xi,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1)):Q("v-if",!0)])]),q("tbody",null,[(K(!0),J(Ae,null,rt(e.outputRows,d=>(K(),J("tr",{key:d.index},[q("td",el,Z(d.index),1),q("td",tl,Z(d.label),1),e.hasOutputValidation?(K(),J("td",rl,[fe(y,{"model-value":e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.validate","Validate Data")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutput(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputSchemas?(K(),J("td",nl,[q("button",{type:"button",class:Ke(["red-ui-button red-ui-button-small nrg-outputs-schema-btn",{"nrg-schema-btn-error":!!e.errors[`node.outputSchemas.${d.index}`]}]),title:e.errors[`node.outputSchemas.${d.index}`]||void 0,disabled:!e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.schema","Data Schema")} \u2014 ${d.label}`,onClick:m=>e.openOutputSchemaEditor(d.index)},[...t[7]||(t[7]=[q("span",{class:"nrg-schema-glyph","aria-hidden":"true"},[q("svg",{viewBox:"0 0 256 220"},[q("use",{href:"#nrg-json-schema-logo"})])],-1)])],10,ol)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("td",al,[fe(y,{"model-value":e.validateOutputTypesFor(d.index),"aria-label":`${e.resolveLabel("outputs.validateTypes","Validate Types")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutputTypes(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("td",sl,[q("input",{type:"text",class:"nrg-outputs-return",placeholder:"output",value:e.returnPropertyFor(d.index),onInput:m=>e.setReturnProperty(d.index,m.target.value)},null,40,il)])):Q("v-if",!0),e.hasOutputContextModes?(K(),J("td",ll,[q("select",{class:"nrg-outputs-context",value:e.contextModeFor(d.index),onChange:m=>e.setContextMode(d.index,m.target.value)},[(K(!0),J(Ae,null,rt(e.contextModeOptions,m=>(K(),J("option",{key:m.value,value:m.value},Z(m.label),9,cl))),128))],40,ul)])):Q("v-if",!0)]))),128))])]),q("ul",dl,[q("li",null,[q("strong",null,Z(e.resolveLabel("outputs.validate","Validate Data")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateData","Check the sent value against this port's schema before it is emitted."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,pl)]),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("li",fl,[q("strong",null,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateTypes","Type-check wires from this port on deploy (TypeScript)."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,hl)])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("li",ml,[q("strong",null,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1),xe(" \u2014 "+Z(e.resolveLabel("help.returnProperty","The message property the sent value is placed on (default: output)."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#overriding-the-return-key"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,yl)])):Q("v-if",!0),e.hasOutputContextModes?(K(),J("li",vl,[q("strong",null,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1),xe(" \u2014 "+Z(e.resolveLabel("help.contextMode","How the incoming message is carried to this port: carry, trace, or reset."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#context-modes"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,gl)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Lifecycle ports: extra output ports, a subsection of Ports Settings "),e.hasBuiltinPorts?(K(),J("div",bl,[q("div",$l,Z(e.resolveLabel("sections.lifecyclePorts","Lifecycle Output Ports")),1),q("div",wl,[xe(Z(e.resolveLabel("help.lifecyclePorts","Optional extra output ports that fire on error, on completion, and on every status change."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/creating-a-node#lifecycle-output-ports"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,_l)]),q("table",Sl,[q("thead",null,[q("tr",null,[q("th",El,Z(e.resolveLabel("lifecyclePorts.port","Port")),1),q("th",xl,Z(e.resolveLabel("lifecyclePorts.enable","Enable")),1),q("th",Pl,Z(e.resolveLabel("lifecyclePorts.description","Description")),1)])]),q("tbody",null,[e.hasErrorPort?(K(),J("tr",kl,[q("td",Nl,Z(e.resolveLabel("lifecyclePorts.error.name","Error")),1),q("td",jl,[fe(y,{"model-value":e.localNode.errorPort,"aria-label":e.resolveLabel("toggles.errorPort","Error Port"),"onUpdate:modelValue":t[3]||(t[3]=d=>{e.localNode.errorPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",Ol,Z(e.resolveLabel("lifecyclePorts.error.description","Routes the message to a separate output when this node fails, so you can handle errors on their own wire.")),1)])):Q("v-if",!0),e.hasCompletePort?(K(),J("tr",Cl,[q("td",Tl,Z(e.resolveLabel("lifecyclePorts.complete.name","Complete")),1),q("td",Il,[fe(y,{"model-value":e.localNode.completePort,"aria-label":e.resolveLabel("toggles.completePort","Complete Port"),"onUpdate:modelValue":t[4]||(t[4]=d=>{e.localNode.completePort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",Vl,Z(e.resolveLabel("lifecyclePorts.complete.description","Emits a message from a separate output once this node finishes, so you can trigger what comes next.")),1)])):Q("v-if",!0),e.hasStatusPort?(K(),J("tr",Rl,[q("td",Ll,Z(e.resolveLabel("lifecyclePorts.status.name","Status")),1),q("td",Ml,[fe(y,{"model-value":e.localNode.statusPort,"aria-label":e.resolveLabel("toggles.statusPort","Status Port"),"onUpdate:modelValue":t[5]||(t[5]=d=>{e.localNode.statusPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",Al,Z(e.resolveLabel("lifecyclePorts.status.description","Emits a message from a separate output whenever this node's status changes, so your flow can react.")),1)])):Q("v-if",!0)])])])):Q("v-if",!0)])):Q("v-if",!0)])}const Dl=Ee(Ei,[["render",ql],["__scopeId","data-v-90f2411f"]]),Do="*************",zl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:[String,Number],default:void 0},value:{type:[String,Number],default:""},type:{type:String,default:"text"},placeholder:{type:String,default:""},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},inputId:{type:String,default:""}},emits:["update:modelValue","update:value","input"],data(){return{internalValue:"",isFocused:!1}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},watch:{effectiveValue(e){this.isFocused||this.type==="password"||this.internalValue!==e&&(this.internalValue=e)}},beforeMount(){this.internalValue=this.effectiveValue,this.onBlur()},methods:{onInput(e){this.internalValue=e.target.value,this.$emit("update:modelValue",this.internalValue),this.$emit("update:value",this.internalValue),this.$emit("input",this.internalValue)},onFocus(){this.isFocused=!0,this.type==="password"&&this.internalValue===Do&&(this.internalValue="")},onBlur(){this.isFocused=!1,this.type==="password"&&this.effectiveValue==="__PWD__"&&(this.internalValue=Do)}}}),Fl={style:{display:"flex","flex-direction":"column",width:"100%"}},Ul=["id","type","value","placeholder"],Kl={key:0,class:"node-red-vue-input-error-message"};function Bl(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),J("div",Fl,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"html-for":e.inputId||void 0},null,8,["label","icon","required","html-for"])):Q("v-if",!0)]),q("input",{id:e.inputId||void 0,ref:"inputField",type:e.type,value:e.internalValue,placeholder:e.placeholder,style:{width:"100%"},onInput:t[0]||(t[0]=(...c)=>e.onInput&&e.onInput(...c)),onFocus:t[1]||(t[1]=(...c)=>e.onFocus&&e.onFocus(...c)),onBlur:t[2]||(t[2]=(...c)=>e.onBlur&&e.onBlur(...c))},null,40,Ul),e.error?(K(),J("div",Kl,Z(e.error),1)):Q("v-if",!0)])}const zo=Ee(zl,[["render",Bl]]),Wl=["msg","flow","global","str","num","bool","json","bin","re","jsonata","date","env","node","cred"],Gl=["errorPort","completePort","statusPort"],Hl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},value:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid value for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid value for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},types:{type:Array,default:()=>Wl},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{inputWidget:Ie(null),mutationObserver:Ie(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value},isProvidedValueTypeValid(){const e=this.effectiveValue.type;return this.types.includes(e)}},watch:{isProvidedValueTypeValid:{handler(e){e||console.warn(`Validation failed: type (${this.effectiveValue.type}) must be one of the provided types (${this.types}).`)},immediate:!0},error(e){this.$nextTick(()=>{const t=this.$el.querySelector(".red-ui-typedInput-container");t&&(e?t.classList.add("input-error"):t.classList.remove("input-error"))})},effectiveValue:{handler(e){this.inputWidget&&(this.$el.contains(document.activeElement)||(e.value!==this.inputWidget.typedInput("value")&&this.inputWidget.typedInput("value",e.value??""),e.type!==this.inputWidget.typedInput("type")&&this.inputWidget.typedInput("type",e.type??this.types[0])))},deep:!0}},mounted(){const e=this.$refs.typedInput;this.inputWidget=$(e),this.inputWidget.typedInput({default:this.effectiveValue.type||this.types[0],types:this.types}),this.inputWidget.typedInput("value",this.effectiveValue.value||""),this.inputWidget.typedInput("type",this.effectiveValue.type||this.types[0]),this.$nextTick(()=>{const t=new MutationObserver(r=>{for(const n of r)n.attributeName==="value"&&this.onChange()});t.observe(e,{attributes:!0,attributeFilter:["value"]}),this.mutationObserver=t}),this.inputWidget.on("change",()=>{this.onChange()})},beforeUnmount(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null)},methods:{onChange(){const e=this.inputWidget.typedInput("value"),t=this.inputWidget.typedInput("type");if(this.effectiveValue.value!==e||this.effectiveValue.type!==t){const r={value:e,type:t};this.$emit("update:modelValue",r),this.$emit("update:value",r)}}}}),Jl={style:{display:"flex","flex-direction":"column",width:"100%"}},Zl=["aria-labelledby"],Ql={key:0,class:"node-red-vue-input-error-message"};function Yl(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),J("div",Jl,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{ref:"typedInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-red-typed-input",style:{flex:"1",width:"100%"}},null,8,Zl),e.error?(K(),J("div",Ql,Z(e.error),1)):Q("v-if",!0)])}const Fo=Ee(Hl,[["render",Yl]]),Xl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},type:{type:String,required:!0},node:{type:Object,required:!0},propName:{type:String,required:!0},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{jqInput:Ie(null)}},computed:{inputId(){return"node-input-"+this.propName},effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){RED.editor.prepareConfigNodeSelect(this.node,this.propName,this.type,"node-input");const e=$("#"+this.inputId);this.jqInput=e,e.on("change",()=>{const t=e.val(),r=t==="_ADD_"?"":t;this.$emit("update:modelValue",r),this.$emit("update:value",r)}),e.val(this.effectiveValue||"_ADD_")},beforeUnmount(){this.jqInput&&(this.jqInput.off("change"),this.jqInput=null)}}),eu={style:{display:"flex","flex-direction":"column",width:"100%"}},tu=["id","aria-labelledby"],ru={key:0,class:"node-red-vue-input-error-message"};function nu(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),J("div",eu,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{id:e.inputId,"aria-labelledby":e.labelId||void 0,type:"text",style:{width:"100%"}},null,8,tu),e.error?(K(),J("div",ru,Z(e.error),1)):Q("v-if",!0)])}const Uo=Ee(Xl,[["render",nu]]),ou=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:[String,Array],default:void 0},value:{type:[String,Array],default:()=>""},options:{type:Array,required:!0,validator:function(e){if(!Array.isArray(e))return console.warn("[WARN] Invalid value for 'options' property. It must be an array."),!1;const t=e.every(r=>typeof r=="object"&&r!==null&&typeof r.value=="string"&&typeof r.label=="string"&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"label"));return t||console.warn("[WARN] Invalid value for 'options' property. Each item must be an object with 'value' and 'label' properties being strings.",e),t}},multiple:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{selectWidget:Ie(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){const e=this.$refs.selectInput,t=$(e);this.selectWidget=t,t.typedInput({types:[{multiple:this.multiple,options:this.options}]}),t.typedInput("value",Array.isArray(this.effectiveValue)?this.effectiveValue.join(","):this.effectiveValue),t.on("change",()=>{var r;const n=this.multiple?((r=t.typedInput("value"))==null?void 0:r.split(",").filter(Boolean))??[]:t.typedInput("value");this.$emit("update:modelValue",n),this.$emit("update:value",n)})},beforeUnmount(){this.selectWidget&&(this.selectWidget.off("change"),this.selectWidget=null)}}),au={style:{display:"flex","flex-direction":"column",width:"100%"}},su=["aria-labelledby"],iu={key:0,class:"node-red-vue-input-error-message"};function lu(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),J("div",au,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{ref:"selectInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-input-select",style:{width:"100%"}},null,8,su),e.error?(K(),J("div",iu,Z(e.error),1)):Q("v-if",!0)])}const Ko=Ee(ou,[["render",lu]]),uu=we({name:"NodeRedToggle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},ariaLabel:{type:String,default:""}},emits:["update:modelValue"],computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),cu={class:"nrg-toggle-wrapper"},du=["checked","aria-label"],pu={key:0,class:"nrg-toggle__label"};function fu(e,t,r,n,o,l){return K(),J("div",cu,[q("label",{class:Ke(["nrg-toggle",{"nrg-toggle--checked":e.modelValue}])},[q("input",{type:"checkbox",checked:e.modelValue,class:"nrg-toggle__input","aria-label":e.ariaLabel||void 0,onChange:t[0]||(t[0]=s=>e.$emit("update:modelValue",s.target.checked))},null,40,du),e.icon||e.label?(K(),J("span",pu,[e.icon?(K(),J("i",{key:0,class:Ke(e.iconClass)},null,2)):Q("v-if",!0),xe(" "+Z(e.label),1)])):Q("v-if",!0),t[1]||(t[1]=q("span",{class:"nrg-toggle__slider"},null,-1))],2)])}const Bo=Ee(uu,[["render",fu],["__scopeId","data-v-9d4b2ecb"]]),hu=new Set(["id","type","x","y","z","g","wires","credentials","_users","validateInput","validateOutputs","outputs","outputContextModes","outputReturnProperties","outputSchemas","inputSchema",...Gl]);function mu(e){return e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim()}function yu(e){var t,r;return e.type==="object"&&!!((t=e.properties)!=null&&t.value)&&!!((r=e.properties)!=null&&r.type)}function Wo(e){var t;return!!((t=e["x-nrg-form"])!=null&&t.required||typeof e.minLength=="number"&&e.minLength>=1||typeof e.minItems=="number"&&e.minItems>=1)}function Go(e,t,r,n,o){var l;const s=n||t.title||mu(e),c=t["x-nrg-form"]??{},y=c.icon||"",d=m=>o?.(String(m))??String(m);if(t["x-nrg-node-type"])return{key:e,label:s,icon:y,inputType:"config",required:r,configType:t["x-nrg-node-type"]};if(yu(t))return{key:e,label:s,icon:y,inputType:"typed",required:r,types:c.typedInputTypes};if(t.type==="array"&&(l=t.items)!=null&&l.enum)return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!0,options:t.items.enum.map(m=>({value:String(m),label:d(m)}))};if(t.enum)return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!1,options:t.enum.map(m=>({value:String(m),label:d(m)}))};if(t.anyOf&&t.anyOf.every(m=>m.const!==void 0))return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!1,options:t.anyOf.map(m=>({value:String(m.const),label:d(m.const)}))};switch(Array.isArray(t.type)?t.type[0]:t.type){case"boolean":return{key:e,label:s,icon:y,inputType:"boolean",required:r,toggle:c.toggle};case"number":case"integer":return{key:e,label:s,icon:y,inputType:"number",required:r,htmlType:"number"};case"array":return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"array-text",required:r};case"object":return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"object-json",required:r};default:return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"text",required:r,htmlType:t.format==="password"?"password":"text"}}}const vu=we({name:"NodeRedJsonSchemaForm",components:{NodeRedInputLabel:Le,NodeRedToggle:Bo,NodeRedInput:zo,NodeRedSelectInput:Ko,NodeRedTypedInput:Fo,NodeRedConfigInput:Uo,NodeRedEditorInput:yr},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},errors:{type:Object,default:()=>({})}},computed:{configFields(){var e;return(e=this.schema)!=null&&e.properties?Object.entries(this.schema.properties).filter(([t])=>!hu.has(t)).map(([t,r])=>Go(t,r,Wo(r),this.resolveI18n("configs",t),n=>this.resolveOptionLabel(t,n))):[]},credentialFields(){var e,t;const r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.credentials;return r!=null&&r.properties?Object.entries(r.properties).map(([n,o])=>{const l=Go(n,o,Wo(o),this.resolveI18n("credentials",n));return l.inputType!=="text"?{...l,inputType:"text",htmlType:o.format==="password"?"password":"text"}:l}):[]}},methods:{fieldId(e){var t;return`nrg-${((t=this.node)==null?void 0:t.id)??"node"}-${e}`},setObjectField(e,t){const r=this.node;try{r[e]=JSON.parse(t)}catch{r[e]=t}},resolveI18n(e,t){const r=this.$i18n(`${e}.${t}`),n=`${this.node.type}.${e}.${t}`;if(r&&r!==n&&r!==`${e}.${t}`)return r},resolveOptionLabel(e,t){const r=`options.${e}.${t}`,n=this.$i18n(r),o=`${this.node.type}.${r}`;if(n&&n!==o&&n!==r)return n}}}),gu={key:1},bu={key:2},$u=["id","checked","onChange"],wu={key:6},_u=["id","value","onInput"],Su={key:0,class:"node-red-vue-input-error-message"};function Eu(e,t,r,n,o,l){const s=ie("NodeRedInput"),c=ie("NodeRedToggle"),y=ie("NodeRedInputLabel"),d=ie("NodeRedSelectInput"),m=ie("NodeRedTypedInput"),P=ie("NodeRedConfigInput"),b=ie("NodeRedEditorInput");return K(),J("div",null,[(K(!0),J(Ae,null,rt(e.configFields,u=>(K(),J("div",{key:u.key,class:"form-row"},[u.inputType==="text"||u.inputType==="number"?(K(),ve(s,{key:0,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"input-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])):u.inputType==="boolean"&&u.toggle?(K(),J("div",gu,[fe(c,{"model-value":e.node[u.key],label:u.label,icon:u.icon,"onUpdate:modelValue":v=>e.node[u.key]=v},null,8,["model-value","label","icon","onUpdate:modelValue"])])):u.inputType==="boolean"?(K(),J("div",bu,[fe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),q("input",{id:e.fieldId(u.key),type:"checkbox",checked:e.node[u.key],style:{width:"auto",margin:"0"},onChange:v=>{e.node[u.key]=v.target.checked}},null,40,$u)])):u.inputType==="select"?(K(),ve(d,{key:3,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,options:u.options,multiple:u.multiple,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","options","multiple","label","icon","required","error","label-id"])):u.inputType==="typed"?(K(),ve(m,{key:4,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,types:u.types,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","types","label","icon","required","error","label-id"])):u.inputType==="config"?(K(),ve(P,{key:5,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.configType,node:e.node,"prop-name":u.key,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","node","prop-name","label","icon","required","error","label-id"])):u.inputType==="array-text"?(K(),J("div",wu,[fe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),t[0]||(t[0]=q("span",{style:{display:"block","font-size":"11px",color:"var(--red-ui-text-color-disabled, #999)","margin-bottom":"4px"}}," One entry per line ",-1)),q("textarea",{id:e.fieldId(u.key),value:Array.isArray(e.node[u.key])?e.node[u.key].join(`
23
+ of a bright toggle label that outweighs the section title. `),e.features.hasInput?(K(),J("div",Ni,[q("div",ji,Z(e.resolveLabel("sections.input","Input")),1),q("table",Oi,[q("thead",null,[q("tr",null,[q("th",Ci,Z(e.resolveLabel("outputs.label","Label")),1),q("th",Ti,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),e.acceptsInputSchema?(K(),J("th",Ii,Z(e.resolveLabel("outputs.schema","Data Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("th",Vi,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1)):Q("v-if",!0)])]),q("tbody",null,[q("tr",null,[q("td",Ri,Z(e.inputLabel),1),q("td",Li,[fe(y,{"model-value":e.localNode.validateInput,"aria-label":e.resolveLabel("toggles.validateInput","Validate Data"),"onUpdate:modelValue":t[0]||(t[0]=d=>{e.localNode.validateInput=d})},null,8,["model-value","aria-label"])]),e.acceptsInputSchema?(K(),J("td",Mi,[q("button",{type:"button",class:Ke(["red-ui-button red-ui-button-small nrg-outputs-schema-btn",{"nrg-schema-btn-error":!!e.errors["node.inputSchema"]}]),title:e.errors["node.inputSchema"]||void 0,disabled:!e.localNode.validateInput,"aria-label":`${e.resolveLabel("outputs.schema","Data Schema")} \u2014 ${e.inputLabel}`,onClick:t[1]||(t[1]=d=>e.openInputSchemaEditor())},[...t[6]||(t[6]=[q("span",{class:"nrg-schema-glyph","aria-hidden":"true"},[q("svg",{viewBox:"0 0 256 220"},[q("use",{href:"#nrg-json-schema-logo"})])],-1)])],10,Ai)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("td",qi,[fe(y,{"model-value":e.localNode.validateInputTypes,"aria-label":e.resolveLabel("toggles.validateInputTypes","Validate Types"),"onUpdate:modelValue":t[2]||(t[2]=d=>{e.localNode.validateInputTypes=d})},null,8,["model-value","aria-label"])])):Q("v-if",!0)])])]),q("ul",Di,[q("li",null,[q("strong",null,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateInput","Validate incoming messages against the input schema before input() runs."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#input-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,zi)]),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),J("li",Fi,[q("strong",null,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateInputTypes","Type-check wires connected to this input on deploy (TypeScript).")),1)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Outputs "),e.showOutputs?(K(),J("div",Ui,[q("div",Ki,Z(e.resolveLabel("sections.outputs","Outputs")),1),q("table",Bi,[q("thead",null,[q("tr",null,[q("th",Wi,Z(e.resolveLabel("outputs.port","Port")),1),q("th",Gi,Z(e.resolveLabel("outputs.label","Label")),1),e.hasOutputValidation?(K(),J("th",Hi,Z(e.resolveLabel("outputs.validate","Validate Data")),1)):Q("v-if",!0),e.hasOutputSchemas?(K(),J("th",Ji,Z(e.resolveLabel("outputs.schema","Data Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("th",Zi,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1)):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("th",Qi,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1)):Q("v-if",!0),e.hasOutputContextModes?(K(),J("th",Yi,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1)):Q("v-if",!0)])]),q("tbody",null,[(K(!0),J(Ae,null,rt(e.outputRows,d=>(K(),J("tr",{key:d.index},[q("td",Xi,Z(d.index),1),q("td",el,Z(d.label),1),e.hasOutputValidation?(K(),J("td",tl,[fe(y,{"model-value":e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.validate","Validate Data")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutput(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputSchemas?(K(),J("td",rl,[q("button",{type:"button",class:Ke(["red-ui-button red-ui-button-small nrg-outputs-schema-btn",{"nrg-schema-btn-error":!!e.errors[`node.outputSchemas.${d.index}`]}]),title:e.errors[`node.outputSchemas.${d.index}`]||void 0,disabled:!e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.schema","Data Schema")} \u2014 ${d.label}`,onClick:m=>e.openOutputSchemaEditor(d.index)},[...t[7]||(t[7]=[q("span",{class:"nrg-schema-glyph","aria-hidden":"true"},[q("svg",{viewBox:"0 0 256 220"},[q("use",{href:"#nrg-json-schema-logo"})])],-1)])],10,nl)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("td",ol,[fe(y,{"model-value":e.validateOutputTypesFor(d.index),"aria-label":`${e.resolveLabel("outputs.validateTypes","Validate Types")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutputTypes(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("td",al,[q("input",{type:"text",class:"nrg-outputs-return",placeholder:"output",value:e.returnPropertyFor(d.index),onInput:m=>e.setReturnProperty(d.index,m.target.value)},null,40,sl)])):Q("v-if",!0),e.hasOutputContextModes?(K(),J("td",il,[q("select",{class:"nrg-outputs-context",value:e.contextModeFor(d.index),onChange:m=>e.setContextMode(d.index,m.target.value)},[(K(!0),J(Ae,null,rt(e.contextModeOptions,m=>(K(),J("option",{key:m.value,value:m.value},Z(m.label),9,ul))),128))],40,ll)])):Q("v-if",!0)]))),128))])]),q("ul",cl,[q("li",null,[q("strong",null,Z(e.resolveLabel("outputs.validate","Validate Data")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateData","Check the sent value against this port's schema before it is emitted."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,dl)]),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),J("li",pl,[q("strong",null,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1),xe(" \u2014 "+Z(e.resolveLabel("help.validateTypes","Type-check wires from this port on deploy (TypeScript)."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,fl)])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),J("li",hl,[q("strong",null,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1),xe(" \u2014 "+Z(e.resolveLabel("help.returnProperty","The message property the sent value is placed on (default: output)."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#overriding-the-return-key"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,ml)])):Q("v-if",!0),e.hasOutputContextModes?(K(),J("li",yl,[q("strong",null,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1),xe(" \u2014 "+Z(e.resolveLabel("help.contextMode","How the incoming message is carried to this port: carry, trace, or reset."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#context-modes"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,vl)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Lifecycle ports: extra output ports, a subsection of Ports Settings "),e.hasBuiltinPorts?(K(),J("div",gl,[q("div",bl,Z(e.resolveLabel("sections.lifecyclePorts","Lifecycle Output Ports")),1),q("div",$l,[xe(Z(e.resolveLabel("help.lifecyclePorts","Optional extra output ports that fire on error, on completion, and on every status change."))+" ",1),q("a",{class:"nrg-help-link",href:e.docsUrl("/guide/creating-a-node#lifecycle-output-ports"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,wl)]),q("table",_l,[q("thead",null,[q("tr",null,[q("th",Sl,Z(e.resolveLabel("lifecyclePorts.port","Port")),1),q("th",El,Z(e.resolveLabel("lifecyclePorts.enable","Enable")),1),q("th",xl,Z(e.resolveLabel("lifecyclePorts.description","Description")),1)])]),q("tbody",null,[e.hasErrorPort?(K(),J("tr",Pl,[q("td",kl,Z(e.resolveLabel("lifecyclePorts.error.name","Error")),1),q("td",Nl,[fe(y,{"model-value":e.localNode.errorPort,"aria-label":e.resolveLabel("toggles.errorPort","Error Port"),"onUpdate:modelValue":t[3]||(t[3]=d=>{e.localNode.errorPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",jl,Z(e.resolveLabel("lifecyclePorts.error.description","Routes the message to a separate output when this node fails, so you can handle errors on their own wire.")),1)])):Q("v-if",!0),e.hasCompletePort?(K(),J("tr",Ol,[q("td",Cl,Z(e.resolveLabel("lifecyclePorts.complete.name","Complete")),1),q("td",Tl,[fe(y,{"model-value":e.localNode.completePort,"aria-label":e.resolveLabel("toggles.completePort","Complete Port"),"onUpdate:modelValue":t[4]||(t[4]=d=>{e.localNode.completePort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",Il,Z(e.resolveLabel("lifecyclePorts.complete.description","Emits a message from a separate output once this node finishes, so you can trigger what comes next.")),1)])):Q("v-if",!0),e.hasStatusPort?(K(),J("tr",Vl,[q("td",Rl,Z(e.resolveLabel("lifecyclePorts.status.name","Status")),1),q("td",Ll,[fe(y,{"model-value":e.localNode.statusPort,"aria-label":e.resolveLabel("toggles.statusPort","Status Port"),"onUpdate:modelValue":t[5]||(t[5]=d=>{e.localNode.statusPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),q("td",Ml,Z(e.resolveLabel("lifecyclePorts.status.description","Emits a message from a separate output whenever this node's status changes, so your flow can react.")),1)])):Q("v-if",!0)])])])):Q("v-if",!0)])):Q("v-if",!0)])}const ql=Ee(Si,[["render",Al],["__scopeId","data-v-90f2411f"]]),Do="*************",Dl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:[String,Number],default:void 0},value:{type:[String,Number],default:""},type:{type:String,default:"text"},placeholder:{type:String,default:""},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},inputId:{type:String,default:""}},emits:["update:modelValue","update:value","input"],data(){return{internalValue:"",isFocused:!1}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},watch:{effectiveValue(e){this.isFocused||this.type==="password"||this.internalValue!==e&&(this.internalValue=e)}},beforeMount(){this.internalValue=this.effectiveValue,this.onBlur()},methods:{onInput(e){this.internalValue=e.target.value,this.$emit("update:modelValue",this.internalValue),this.$emit("update:value",this.internalValue),this.$emit("input",this.internalValue)},onFocus(){this.isFocused=!0,this.type==="password"&&this.internalValue===Do&&(this.internalValue="")},onBlur(){this.isFocused=!1,this.type==="password"&&this.effectiveValue==="__PWD__"&&(this.internalValue=Do)}}}),zl={style:{display:"flex","flex-direction":"column",width:"100%"}},Fl=["id","type","value","placeholder"],Ul={key:0,class:"node-red-vue-input-error-message"};function Kl(e,t,r,n,o,l){const a=ie("NodeRedInputLabel");return K(),J("div",zl,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(a,{key:0,label:e.label,icon:e.icon,required:e.required,"html-for":e.inputId||void 0},null,8,["label","icon","required","html-for"])):Q("v-if",!0)]),q("input",{id:e.inputId||void 0,ref:"inputField",type:e.type,value:e.internalValue,placeholder:e.placeholder,style:{width:"100%"},onInput:t[0]||(t[0]=(...c)=>e.onInput&&e.onInput(...c)),onFocus:t[1]||(t[1]=(...c)=>e.onFocus&&e.onFocus(...c)),onBlur:t[2]||(t[2]=(...c)=>e.onBlur&&e.onBlur(...c))},null,40,Fl),e.error?(K(),J("div",Ul,Z(e.error),1)):Q("v-if",!0)])}const zo=Ee(Dl,[["render",Kl]]),Bl=["msg","flow","global","str","num","bool","json","bin","re","jsonata","date","env","node","cred"],Wl=["errorPort","completePort","statusPort"],Gl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},value:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid value for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid value for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},types:{type:Array,default:()=>Bl},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{inputWidget:Ie(null),mutationObserver:Ie(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value},isProvidedValueTypeValid(){const e=this.effectiveValue.type;return this.types.includes(e)}},watch:{isProvidedValueTypeValid:{handler(e){e||console.warn(`Validation failed: type (${this.effectiveValue.type}) must be one of the provided types (${this.types}).`)},immediate:!0},error(e){this.$nextTick(()=>{const t=this.$el.querySelector(".red-ui-typedInput-container");t&&(e?t.classList.add("input-error"):t.classList.remove("input-error"))})},effectiveValue:{handler(e){this.inputWidget&&(this.$el.contains(document.activeElement)||(e.value!==this.inputWidget.typedInput("value")&&this.inputWidget.typedInput("value",e.value??""),e.type!==this.inputWidget.typedInput("type")&&this.inputWidget.typedInput("type",e.type??this.types[0])))},deep:!0}},mounted(){const e=this.$refs.typedInput;this.inputWidget=$(e),this.inputWidget.typedInput({default:this.effectiveValue.type||this.types[0],types:this.types}),this.inputWidget.typedInput("value",this.effectiveValue.value||""),this.inputWidget.typedInput("type",this.effectiveValue.type||this.types[0]),this.$nextTick(()=>{const t=new MutationObserver(r=>{for(const n of r)n.attributeName==="value"&&this.onChange()});t.observe(e,{attributes:!0,attributeFilter:["value"]}),this.mutationObserver=t}),this.inputWidget.on("change",()=>{this.onChange()})},beforeUnmount(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null)},methods:{onChange(){const e=this.inputWidget.typedInput("value"),t=this.inputWidget.typedInput("type");if(this.effectiveValue.value!==e||this.effectiveValue.type!==t){const r={value:e,type:t};this.$emit("update:modelValue",r),this.$emit("update:value",r)}}}}),Hl={style:{display:"flex","flex-direction":"column",width:"100%"}},Jl=["aria-labelledby"],Zl={key:0,class:"node-red-vue-input-error-message"};function Ql(e,t,r,n,o,l){const a=ie("NodeRedInputLabel");return K(),J("div",Hl,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(a,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{ref:"typedInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-red-typed-input",style:{flex:"1",width:"100%"}},null,8,Jl),e.error?(K(),J("div",Zl,Z(e.error),1)):Q("v-if",!0)])}const Fo=Ee(Gl,[["render",Ql]]),Yl=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},type:{type:String,required:!0},node:{type:Object,required:!0},propName:{type:String,required:!0},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{jqInput:Ie(null)}},computed:{inputId(){return"node-input-"+this.propName},effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){RED.editor.prepareConfigNodeSelect(this.node,this.propName,this.type,"node-input");const e=$("#"+this.inputId);this.jqInput=e,e.on("change",()=>{const t=e.val(),r=t==="_ADD_"?"":t;this.$emit("update:modelValue",r),this.$emit("update:value",r)}),e.val(this.effectiveValue||"_ADD_")},beforeUnmount(){this.jqInput&&(this.jqInput.off("change"),this.jqInput=null)}}),Xl={style:{display:"flex","flex-direction":"column",width:"100%"}},eu=["id","aria-labelledby"],tu={key:0,class:"node-red-vue-input-error-message"};function ru(e,t,r,n,o,l){const a=ie("NodeRedInputLabel");return K(),J("div",Xl,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(a,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{id:e.inputId,"aria-labelledby":e.labelId||void 0,type:"text",style:{width:"100%"}},null,8,eu),e.error?(K(),J("div",tu,Z(e.error),1)):Q("v-if",!0)])}const Uo=Ee(Yl,[["render",ru]]),nu=we({components:{NodeRedInputLabel:Le},props:{modelValue:{type:[String,Array],default:void 0},value:{type:[String,Array],default:()=>""},options:{type:Array,required:!0,validator:function(e){if(!Array.isArray(e))return console.warn("[WARN] Invalid value for 'options' property. It must be an array."),!1;const t=e.every(r=>typeof r=="object"&&r!==null&&typeof r.value=="string"&&typeof r.label=="string"&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"label"));return t||console.warn("[WARN] Invalid value for 'options' property. Each item must be an object with 'value' and 'label' properties being strings.",e),t}},multiple:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{selectWidget:Ie(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){const e=this.$refs.selectInput,t=$(e);this.selectWidget=t,t.typedInput({types:[{multiple:this.multiple,options:this.options}]}),t.typedInput("value",Array.isArray(this.effectiveValue)?this.effectiveValue.join(","):this.effectiveValue),t.on("change",()=>{var r;const n=this.multiple?((r=t.typedInput("value"))==null?void 0:r.split(",").filter(Boolean))??[]:t.typedInput("value");this.$emit("update:modelValue",n),this.$emit("update:value",n)})},beforeUnmount(){this.selectWidget&&(this.selectWidget.off("change"),this.selectWidget=null)}}),ou={style:{display:"flex","flex-direction":"column",width:"100%"}},au=["aria-labelledby"],su={key:0,class:"node-red-vue-input-error-message"};function iu(e,t,r,n,o,l){const a=ie("NodeRedInputLabel");return K(),J("div",ou,[Te(e.$slots,"label",{},()=>[e.label?(K(),ve(a,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),q("input",{ref:"selectInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-input-select",style:{width:"100%"}},null,8,au),e.error?(K(),J("div",su,Z(e.error),1)):Q("v-if",!0)])}const Ko=Ee(nu,[["render",iu]]),lu=we({name:"NodeRedToggle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},ariaLabel:{type:String,default:""}},emits:["update:modelValue"],computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),uu={class:"nrg-toggle-wrapper"},cu=["checked","aria-label"],du={key:0,class:"nrg-toggle__label"};function pu(e,t,r,n,o,l){return K(),J("div",uu,[q("label",{class:Ke(["nrg-toggle",{"nrg-toggle--checked":e.modelValue}])},[q("input",{type:"checkbox",checked:e.modelValue,class:"nrg-toggle__input","aria-label":e.ariaLabel||void 0,onChange:t[0]||(t[0]=a=>e.$emit("update:modelValue",a.target.checked))},null,40,cu),e.icon||e.label?(K(),J("span",du,[e.icon?(K(),J("i",{key:0,class:Ke(e.iconClass)},null,2)):Q("v-if",!0),xe(" "+Z(e.label),1)])):Q("v-if",!0),t[1]||(t[1]=q("span",{class:"nrg-toggle__slider"},null,-1))],2)])}const Bo=Ee(lu,[["render",pu],["__scopeId","data-v-9d4b2ecb"]]),fu=new Set(["id","type","x","y","z","g","wires","credentials","_users","validateInput","validateOutputs","outputs","outputContextModes","outputReturnProperties","outputSchemas","inputSchema",...Wl]);function hu(e){return e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim()}function mu(e){var t,r;return e.type==="object"&&!!((t=e.properties)!=null&&t.value)&&!!((r=e.properties)!=null&&r.type)}function Wo(e,t,r,n,o){var l;const a=n||t.title||hu(e),c=t["x-nrg-form"]??{},y=c.icon||"",d=m=>o?.(String(m))??String(m);if(t["x-nrg-node-type"])return{key:e,label:a,icon:y,inputType:"config",required:r,configType:t["x-nrg-node-type"]};if(mu(t))return{key:e,label:a,icon:y,inputType:"typed",required:r,types:c.typedInputTypes};if(t.type==="array"&&(l=t.items)!=null&&l.enum)return{key:e,label:a,icon:y,inputType:"select",required:r,multiple:!0,options:t.items.enum.map(m=>({value:String(m),label:d(m)}))};if(t.enum)return{key:e,label:a,icon:y,inputType:"select",required:r,multiple:!1,options:t.enum.map(m=>({value:String(m),label:d(m)}))};if(t.anyOf&&t.anyOf.every(m=>m.const!==void 0))return{key:e,label:a,icon:y,inputType:"select",required:r,multiple:!1,options:t.anyOf.map(m=>({value:String(m.const),label:d(m.const)}))};switch(Array.isArray(t.type)?t.type[0]:t.type){case"boolean":return{key:e,label:a,icon:y,inputType:"boolean",required:r,toggle:c.toggle};case"number":case"integer":return{key:e,label:a,icon:y,inputType:"number",required:r,htmlType:"number"};case"array":return c.editorLanguage?{key:e,label:a,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:a,icon:y,inputType:"array-text",required:r};case"object":return c.editorLanguage?{key:e,label:a,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:a,icon:y,inputType:"object-json",required:r};default:return c.editorLanguage?{key:e,label:a,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:a,icon:y,inputType:"text",required:r,htmlType:t.format==="password"?"password":"text"}}}const yu=we({name:"NodeRedJsonSchemaForm",components:{NodeRedInputLabel:Le,NodeRedToggle:Bo,NodeRedInput:zo,NodeRedSelectInput:Ko,NodeRedTypedInput:Fo,NodeRedConfigInput:Uo,NodeRedEditorInput:yr},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},errors:{type:Object,default:()=>({})}},computed:{configFields(){var e;if(!((e=this.schema)!=null&&e.properties))return[];const t=new Set(this.schema.required??[]);return Object.entries(this.schema.properties).filter(([r])=>!fu.has(r)).map(([r,n])=>Wo(r,n,t.has(r),this.resolveI18n("configs",r),o=>this.resolveOptionLabel(r,o)))},credentialFields(){var e,t;const r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.credentials;if(!(r!=null&&r.properties))return[];const n=new Set(r.required??[]);return Object.entries(r.properties).map(([o,l])=>{const a=Wo(o,l,n.has(o),this.resolveI18n("credentials",o));return a.inputType!=="text"?{...a,inputType:"text",htmlType:l.format==="password"?"password":"text"}:a})}},methods:{fieldId(e){var t;return`nrg-${((t=this.node)==null?void 0:t.id)??"node"}-${e}`},setObjectField(e,t){const r=this.node;try{r[e]=JSON.parse(t)}catch{r[e]=t}},resolveI18n(e,t){const r=this.$i18n(`${e}.${t}`),n=`${this.node.type}.${e}.${t}`;if(r&&r!==n&&r!==`${e}.${t}`)return r},resolveOptionLabel(e,t){const r=`options.${e}.${t}`,n=this.$i18n(r),o=`${this.node.type}.${r}`;if(n&&n!==o&&n!==r)return n}}}),vu={key:1},gu={key:2},bu=["id","checked","onChange"],$u={key:6},wu=["id","value","onInput"],_u={key:0,class:"node-red-vue-input-error-message"};function Su(e,t,r,n,o,l){const a=ie("NodeRedInput"),c=ie("NodeRedToggle"),y=ie("NodeRedInputLabel"),d=ie("NodeRedSelectInput"),m=ie("NodeRedTypedInput"),P=ie("NodeRedConfigInput"),b=ie("NodeRedEditorInput");return K(),J("div",null,[(K(!0),J(Ae,null,rt(e.configFields,u=>(K(),J("div",{key:u.key,class:"form-row"},[u.inputType==="text"||u.inputType==="number"?(K(),ve(a,{key:0,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"input-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])):u.inputType==="boolean"&&u.toggle?(K(),J("div",vu,[fe(c,{"model-value":e.node[u.key],label:u.label,icon:u.icon,"onUpdate:modelValue":v=>e.node[u.key]=v},null,8,["model-value","label","icon","onUpdate:modelValue"])])):u.inputType==="boolean"?(K(),J("div",gu,[fe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),q("input",{id:e.fieldId(u.key),type:"checkbox",checked:e.node[u.key],style:{width:"auto",margin:"0"},onChange:v=>{e.node[u.key]=v.target.checked}},null,40,bu)])):u.inputType==="select"?(K(),ve(d,{key:3,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,options:u.options,multiple:u.multiple,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","options","multiple","label","icon","required","error","label-id"])):u.inputType==="typed"?(K(),ve(m,{key:4,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,types:u.types,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","types","label","icon","required","error","label-id"])):u.inputType==="config"?(K(),ve(P,{key:5,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.configType,node:e.node,"prop-name":u.key,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","node","prop-name","label","icon","required","error","label-id"])):u.inputType==="array-text"?(K(),J("div",$u,[fe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),t[0]||(t[0]=q("span",{style:{display:"block","font-size":"11px",color:"var(--red-ui-text-color-disabled, #999)","margin-bottom":"4px"}}," One entry per line ",-1)),q("textarea",{id:e.fieldId(u.key),value:Array.isArray(e.node[u.key])?e.node[u.key].join(`
24
24
  `):e.node[u.key]??"",rows:"4",style:{width:"100%",resize:"vertical","font-family":"monospace","font-size":"13px"},onInput:v=>e.node[u.key]=v.target.value.split(`
25
- `).filter(Boolean)},null,40,_u),e.errors[`node.${u.key}`]?(K(),J("span",Su,Z(e.errors[`node.${u.key}`]),1)):Q("v-if",!0)])):u.inputType==="object-json"?(K(),ve(b,{key:7,value:typeof e.node[u.key]=="string"?e.node[u.key]:JSON.stringify(e.node[u.key]??{},null,2),language:"json",label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key),"onUpdate:value":v=>e.setObjectField(u.key,v)},null,8,["value","label","icon","required","error","label-id","onUpdate:value"])):u.inputType==="editor"?(K(),ve(b,{key:8,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,language:u.language,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","language","label","icon","required","error","label-id"])):Q("v-if",!0)]))),128)),(K(!0),J(Ae,null,rt(e.credentialFields,u=>(K(),J("div",{key:`cred-${u.key}`,class:"form-row"},[fe(s,{value:e.node.credentials[u.key],"onUpdate:value":v=>e.node.credentials[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.credentials.${u.key}`],"input-id":e.fieldId(`credentials.${u.key}`)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])]))),128))])}const Ho=Ee(vu,[["render",Eu]]);function xu(e,t,r,n){const o=ia(Dl,{node:e,schema:r,features:n});return o.component("NodeRedInputLabel",Le),o.component("NodeRedToggle",Bo),o.component("NodeRedInput",zo),o.component("NodeRedTypedInput",Fo),o.component("NodeRedConfigInput",Uo),o.component("NodeRedSelectInput",Ko),o.component("NodeRedEditorInput",yr),o.component("NodeRedTray",mr),o.component("NodeRedJsonSchemaForm",Ho),o.component("NodeRedNodeForm",t?.component??Ho),o.config.globalProperties.$i18n=l=>e._(`${e.type}.${l}`),o}function Pu(e,t,r,n,o){$(`#${o}`).empty();const{_newState:l,_app:s,...c}=e,y=en(c);e._newState=y,e._app=xu(y,t,r,n),e._app.mount(`#${o}`)}function vr(e){e._app&&(e._app.unmount(),e._app=null)}function Jo(e){const t={credentials:{}};return Object.keys(e._def.defaults??{}).forEach(r=>{t[r]=e[r]}),e._def.credentials&&Object.keys(e._def.credentials).forEach(r=>{var n,o;t.credentials[r]=(n=e.credentials)==null?void 0:n[r],e._def.credentials[r].type==="password"&&(t.credentials[`has_${r}`]=((o=e.credentials)==null?void 0:o[`has_${r}`])||!1)}),t}function Zo(e,t){const r={};return new Set([...Object.keys(e),...Object.keys(t??{})]).forEach(n=>{const o=e[n],l=(t??{})[n];if(!Array.isArray(o)&&typeof o=="object"&&o!==null){const s=Zo(o,l);Object.keys(s).length&&(r[n]=s)}else Fa(o,l)||(r[n]=o)}),r}function Qo(e,t){for(const r of Object.keys(t)){const n=t[r];if(Array.isArray(n))e[r]=[...n];else if(n!==null&&typeof n=="object"){(!e[r]||typeof e[r]!="object"||Array.isArray(e[r]))&&(e[r]={}),Qo(e[r],n);for(const o of Object.keys(e[r]))o in n||delete e[r][o]}else e[r]=n}}function et(e,...t){for(const r of t){const n=e._(r);if(n&&n!==r)return n}}function ku(e){return function(){return this.name?this.name:et(this,`${e}.label`)??e}}function Nu(e){return function(){return et(this,`${e}.paletteLabel`,`${e}.label`)??e}}function ju(e){return function(t){return et(this,`${e}.inputLabels.${t}`,`${e}.inputLabels`)}}function Ou(e,t,r,n){return function(o){if(t&&o<t.length)return t[o];if(r){let l=n;if(this.errorPort){if(o===l)return"Error";l++}if(this.completePort){if(o===l)return"Complete";l++}if(this.statusPort){if(o===l)return"Status";l++}}return et(this,`${e}.outputLabels.${o}`,`${e}.outputLabels`)}}function Cu(e){Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e[t],l=e._newState[t];if(o===l)return;const s=RED.nodes.node(o);if(s&&s._def.category==="config"){const c=s.users.findIndex(y=>y.id===e.id);c!==-1&&s.users.splice(c,1)}}),Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e._newState[t];if(!o)return;const l=RED.nodes.node(o);l&&l._def.category==="config"&&l.users.findIndex(s=>s.id===e.id)===-1&&l.users.push(e)})}function Tu(e,t,r){Object.keys(e._def.defaults??{}).forEach(n=>{if(e._def.defaults[n].type)return;const o=`node-config-input-${n}`;let l=$(`#${o}`);l.length||(l=$("<input>",{type:"hidden",id:o}),$(`#${r}`).append(l)),l.val(t[n]??"")})}function Iu(e,t){var r,n,o;const l="errorPort"in e||"completePort"in e||"statusPort"in e;if(l&&!("outputs"in e)){let s=t;(r=e.errorPort)!=null&&r.value&&s++,(n=e.completePort)!=null&&n.value&&s++,(o=e.statusPort)!=null&&o.value&&s++,e.outputs={value:s}}return{hasBuiltinPorts:l,baseOutputs:t}}function Vu(e,t,r,n){const o=r??[],l=[];for(let s=0;s<n;s++){const c=o[s]??et(e,`${t}.outputLabels.${s}`,`${t}.outputLabels`)??`Output ${s}`;l.push({index:s,label:c})}return l}async function Yo(e){const{type:t}=e;try{let r=function(){const u=s.form,v=Vu(this,t,s.outputPortNames,b),x={hasInput:(s.inputs??0)>0,outputPorts:v};Pu(this,u,m,x,d)},n=function(){const u=this;vr(u);const v=Jo(u._newState),x=Jo(u),h=Zo(x,v),p=Object.keys(h).length>0;if(!p)return!1;if(Cu(u),Qo(u,v),e.category==="config"){Tu(u,v,d);return}return{changed:p,history:[{t:"edit",node:u,changes:h,links:[],dirty:RED.nodes.dirty(),changed:p}]}},o=function(){vr(this)},l=function(){vr(this)};const s=e,c=s.defaults?{...s.defaults}:void 0,y=s.credentials??void 0,d=`nrg-app-${t}`;$("<script>",{type:"text/html","data-template-name":t,html:`<div id="${d}"></div>`}).appendTo("body");const m=oi(s.configSchema,s.credentialsSchema);let P=!1,b=s.outputs||0;if(c&&({hasBuiltinPorts:P,baseOutputs:b}=Iu(c,b)),m&&c){const u=Object.keys(c)[0];if(u){const{required:v,...x}=c[u];c[u]={...x,validate:function(h,p){const a=ai(this,m),i=ii(this);return a===!0&&i.length===0?!0:[...a===!0?[]:a,...i]}}}}RED.nodes.registerType(t,{type:t,defaults:c,credentials:y,category:s.category,color:s.color||"#FFFFFF",icon:s.icon,inputs:s.inputs||0,outputs:s.outputs||0,label:s.label||ku(t),paletteLabel:s.paletteLabel||Nu(t),labelStyle:s.labelStyle,inputLabels:s.inputLabels||ju(t),outputLabels:s.outputLabels||Ou(t,s.outputPortNames,P,b),align:s.align||"left",button:s.button?{...s.button,onclick:s.button.onClick}:void 0,oneditprepare:r,oneditsave:n,oneditcancel:o,oneditdelete:l,oneditresize:s.onEditResize,onpaletteadd:s.onPaletteAdd,onpaletteremove:s.onPaletteRemove}),ma(t)}catch(r){throw console.error(`Error while registering node type ${t}:`,r),r}}async function Ru(e){try{await Promise.all(e.map(t=>Yo(t)))}catch(t){throw console.error("Error registering node types:",t),t}}function Lu(){const e=Qt("__nrg_form_node"),t=Qt("__nrg_form_schema"),r=Qt("__nrg_form_errors");if(!e)throw new Error("useFormNode() must be called inside a form component mounted by NRG.");return{node:e,schema:t,errors:r}}export{Na as defineNode,Yo as registerType,Ru as registerTypes,Lu as useFormNode};
25
+ `).filter(Boolean)},null,40,wu),e.errors[`node.${u.key}`]?(K(),J("span",_u,Z(e.errors[`node.${u.key}`]),1)):Q("v-if",!0)])):u.inputType==="object-json"?(K(),ve(b,{key:7,value:typeof e.node[u.key]=="string"?e.node[u.key]:JSON.stringify(e.node[u.key]??{},null,2),language:"json",label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key),"onUpdate:value":v=>e.setObjectField(u.key,v)},null,8,["value","label","icon","required","error","label-id","onUpdate:value"])):u.inputType==="editor"?(K(),ve(b,{key:8,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,language:u.language,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","language","label","icon","required","error","label-id"])):Q("v-if",!0)]))),128)),(K(!0),J(Ae,null,rt(e.credentialFields,u=>(K(),J("div",{key:`cred-${u.key}`,class:"form-row"},[fe(a,{value:e.node.credentials[u.key],"onUpdate:value":v=>e.node.credentials[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.credentials.${u.key}`],"input-id":e.fieldId(`credentials.${u.key}`)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])]))),128))])}const Go=Ee(yu,[["render",Su]]);function Eu(e,t,r,n){const o=sa(ql,{node:e,schema:r,features:n});return o.component("NodeRedInputLabel",Le),o.component("NodeRedToggle",Bo),o.component("NodeRedInput",zo),o.component("NodeRedTypedInput",Fo),o.component("NodeRedConfigInput",Uo),o.component("NodeRedSelectInput",Ko),o.component("NodeRedEditorInput",yr),o.component("NodeRedTray",mr),o.component("NodeRedJsonSchemaForm",Go),o.component("NodeRedNodeForm",t?.component??Go),o.config.globalProperties.$i18n=l=>e._(`${e.type}.${l}`),o}function xu(e,t,r,n,o){$(`#${o}`).empty();const{_newState:l,_app:a,...c}=e,y=en(c);e._newState=y,e._app=Eu(y,t,r,n),e._app.mount(`#${o}`)}function vr(e){e._app&&(e._app.unmount(),e._app=null)}function Ho(e){const t={credentials:{}};return Object.keys(e._def.defaults??{}).forEach(r=>{t[r]=e[r]}),e._def.credentials&&Object.keys(e._def.credentials).forEach(r=>{var n,o;t.credentials[r]=(n=e.credentials)==null?void 0:n[r],e._def.credentials[r].type==="password"&&(t.credentials[`has_${r}`]=((o=e.credentials)==null?void 0:o[`has_${r}`])||!1)}),t}function Jo(e,t){const r={};return new Set([...Object.keys(e),...Object.keys(t??{})]).forEach(n=>{const o=e[n],l=(t??{})[n];if(!Array.isArray(o)&&typeof o=="object"&&o!==null){const a=Jo(o,l);Object.keys(a).length&&(r[n]=a)}else za(o,l)||(r[n]=o)}),r}function Zo(e,t){for(const r of Object.keys(t)){const n=t[r];if(Array.isArray(n))e[r]=[...n];else if(n!==null&&typeof n=="object"){(!e[r]||typeof e[r]!="object"||Array.isArray(e[r]))&&(e[r]={}),Zo(e[r],n);for(const o of Object.keys(e[r]))o in n||delete e[r][o]}else e[r]=n}}function et(e,...t){for(const r of t){const n=e._(r);if(n&&n!==r)return n}}function Pu(e){return function(){return this.name?this.name:et(this,`${e}.label`)??e}}function ku(e){return function(){return et(this,`${e}.paletteLabel`,`${e}.label`)??e}}function Nu(e){return function(t){return et(this,`${e}.inputLabels.${t}`,`${e}.inputLabels`)}}function ju(e,t,r,n){return function(o){if(t&&o<t.length)return t[o];if(r){let l=n;if(this.errorPort){if(o===l)return"Error";l++}if(this.completePort){if(o===l)return"Complete";l++}if(this.statusPort){if(o===l)return"Status";l++}}return et(this,`${e}.outputLabels.${o}`,`${e}.outputLabels`)}}function Ou(e){Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e[t],l=e._newState[t];if(o===l)return;const a=RED.nodes.node(o);if(a&&a._def.category==="config"){const c=a.users.findIndex(y=>y.id===e.id);c!==-1&&a.users.splice(c,1)}}),Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e._newState[t];if(!o)return;const l=RED.nodes.node(o);l&&l._def.category==="config"&&l.users.findIndex(a=>a.id===e.id)===-1&&l.users.push(e)})}function Cu(e,t,r){Object.keys(e._def.defaults??{}).forEach(n=>{if(e._def.defaults[n].type)return;const o=`node-config-input-${n}`;let l=$(`#${o}`);l.length||(l=$("<input>",{type:"hidden",id:o}),$(`#${r}`).append(l)),l.val(t[n]??"")})}function Tu(e,t){var r,n,o;const l="errorPort"in e||"completePort"in e||"statusPort"in e;if(l&&!("outputs"in e)){let a=t;(r=e.errorPort)!=null&&r.value&&a++,(n=e.completePort)!=null&&n.value&&a++,(o=e.statusPort)!=null&&o.value&&a++,e.outputs={value:a}}return{hasBuiltinPorts:l,baseOutputs:t}}function Iu(e,t,r,n){const o=r??[],l=[];for(let a=0;a<n;a++){const c=o[a]??et(e,`${t}.outputLabels.${a}`,`${t}.outputLabels`)??`Output ${a}`;l.push({index:a,label:c})}return l}async function Qo(e){const{type:t}=e;try{let r=function(){const u=a.form,v=Iu(this,t,a.outputPortNames,b),x={hasInput:(a.inputs??0)>0,outputPorts:v};xu(this,u,m,x,d)},n=function(){const u=this;vr(u);const v=Ho(u._newState),x=Ho(u),h=Jo(x,v),p=Object.keys(h).length>0;if(!p)return!1;if(Ou(u),Zo(u,v),e.category==="config"){Cu(u,v,d);return}return{changed:p,history:[{t:"edit",node:u,changes:h,links:[],dirty:RED.nodes.dirty(),changed:p}]}},o=function(){vr(this)},l=function(){vr(this)};const a=e,c=a.defaults?{...a.defaults}:void 0,y=a.credentials??void 0,d=`nrg-app-${t}`;$("<script>",{type:"text/html","data-template-name":t,html:`<div id="${d}"></div>`}).appendTo("body");const m=ni(a.configSchema,a.credentialsSchema);let P=!1,b=a.outputs||0;if(c&&({hasBuiltinPorts:P,baseOutputs:b}=Tu(c,b)),m&&c){const u=Object.keys(c)[0];if(u){const{required:v,...x}=c[u];c[u]={...x,validate:function(h,p){const s=oi(this,m),i=si(this);return s===!0&&i.length===0?!0:[...s===!0?[]:s,...i]}}}}RED.nodes.registerType(t,{type:t,defaults:c,credentials:y,category:a.category,color:a.color||"#FFFFFF",icon:a.icon,inputs:a.inputs||0,outputs:a.outputs||0,label:a.label||Pu(t),paletteLabel:a.paletteLabel||ku(t),labelStyle:a.labelStyle,inputLabels:a.inputLabels||Nu(t),outputLabels:a.outputLabels||ju(t,a.outputPortNames,P,b),align:a.align||"left",button:a.button?{...a.button,onclick:a.button.onClick}:void 0,oneditprepare:r,oneditsave:n,oneditcancel:o,oneditdelete:l,oneditresize:a.onEditResize,onpaletteadd:a.onPaletteAdd,onpaletteremove:a.onPaletteRemove}),ha(t)}catch(r){throw console.error(`Error while registering node type ${t}:`,r),r}}async function Vu(e){try{await Promise.all(e.map(t=>Qo(t)))}catch(t){throw console.error("Error registering node types:",t),t}}function Ru(){const e=Qt("__nrg_form_node"),t=Qt("__nrg_form_schema"),r=Qt("__nrg_form_errors");if(!e)throw new Error("useFormNode() must be called inside a form component mounted by NRG.");return{node:e,schema:t,errors:r}}export{ka as defineNode,Qo as registerType,Vu as registerTypes,Ru as useFormNode};