@stacksjs/whois 0.68.0 → 0.68.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -158,4 +158,4 @@ function moveProperties(source, destination, ignoreKeys) {
|
|
|
158
158
|
}
|
|
159
159
|
};`}function Sw(D){return`const REQUIRED = '${D.required}';
|
|
160
160
|
const NOT_AN_OBJECT = '${D.object}';
|
|
161
|
-
const NOT_AN_ARRAY = '${D.array}';`}var hw=Object.getPrototypeOf(async function(){}).constructor,kF=class{variablesCounter=0;#D;#u;#F=new ww;constructor(D,u){this.#D=D,this.#u=u||{convertEmptyStringsToNull:!1}}#C(){this.#F.writeStatement(Sw({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#u.messages})),this.#F.writeStatement(xw(this.#u)),this.#F.writeStatement("let out;")}#$(){this.#F.writeStatement(Tw()),this.#F.writeStatement("return out;")}#E(){this.compileNode(this.#D.schema,this.#F,{type:"root",variableName:"root",outputExpression:"out",fieldPathExpression:"out",wildCardPath:""})}#w(){return new hw("root","meta","refs","messagesProvider","errorReporter",this.#F.toString())}createFieldFor(D,u){switch(u.type){case"array":return Vw(u);case"root":return Hw(u);case"object":return Nw(D,this.variablesCounter,u);case"tuple":return Lw(D,u);case"record":return Iw(u)}}compileNode(D,u,F,$){switch(D.type){case"literal":return new Ow(D,u,this,F,$).compile();case"array":return new Mw(D,u,this,F,$).compile();case"record":return new Aw(D,u,this,F,$).compile();case"object":return new qw(D,u,this,F,$).compile();case"tuple":return new Zw(D,u,this,F,$).compile();case"union":return new Ww(D,u,this,F,$).compile()}}compile(){this.#C(),this.#E(),this.#$();let D=this.#w();return this.variablesCounter=0,this.#F.flush(),D}};function gF(){let D=0,u={};return{toJSON(){return u},track(F){D++;let $=`ref://${D}`;return u[$]=F,$},trackValidation(F){return this.track(F)},trackParser(F){return this.track(F)},trackTransformer(F){return this.track(F)},trackConditional(F){return this.track(F)}}}function x(D,u){let F={validator:D,isAsync:u?.isAsync||D.constructor.name==="AsyncFunction",implicit:u?.implicit??!1};return function(...$){return{rule:F,options:$[0]}}}var o6={};y0(o6,{COTYPE:()=>Rw,IS_OF_TYPE:()=>pD,ITYPE:()=>yw,OTYPE:()=>jw,PARSE:()=>r,UNIQUE_NAME:()=>mD,VALIDATION:()=>xu});var mD=Symbol.for("schema_name"),pD=Symbol.for("is_of_type"),r=Symbol.for("parse"),yw=Symbol.for("opaque_input_type"),jw=Symbol.for("opaque_type"),Rw=Symbol.for("camelcase_opaque_type"),xu=Symbol.for("to_validation"),cu=x((D,u,F)=>{let $=u(F);if(!F.isDefined&&$)F.report(V.required,"required",F)},{implicit:!0}),X8=class extends mu{optional(D){return new gw(this,D)}nullable(){return new kw(this)}transform(D){return new bw(D,this)}},kw=class D extends X8{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.allowNull=!0,E}},gw=class D extends X8{#D;validations;constructor(u,F){super();this.#D=u,this.validations=F||[]}cloneValidations(){return this.validations.map((u)=>{return{options:u.options,rule:u.rule}})}compileValidations(u){return this.validations.map((F)=>{return{ruleFnId:u.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}use(u){return this.validations.push(xu in u?u[xu]():u),this}requiredWhen(u,F,$){if(typeof u==="function")return this.use(cu(u));let E;switch(F){case"=":E=(w)=>w===$;break;case"!=":E=(w)=>w!==$;break;case"in":E=(w)=>$.includes(w);break;case"notIn":E=(w)=>!$.includes(w);break;case">":E=(w)=>w>$;break;case"<":E=(w)=>w<$;break;case">=":E=(w)=>w>=$;break;case"<=":E=(w)=>w<=$}return this.use(cu((w)=>{let C=k.getNestedValue(u,w);return E(C)}))}requiredIfExists(u){let F=Array.isArray(u)?u:[u];return this.use(cu(($)=>{return F.every((E)=>k.exists(k.getNestedValue(E,$)))}))}requiredIfAnyExists(u){return this.use(cu((F)=>{return u.some(($)=>k.exists(k.getNestedValue($,F)))}))}requiredIfMissing(u){let F=Array.isArray(u)?u:[u];return this.use(cu(($)=>{return F.every((E)=>k.isMissing(k.getNestedValue(E,$)))}))}requiredIfAnyMissing(u){return this.use(cu((F)=>{return u.some(($)=>k.isMissing(k.getNestedValue($,F)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.isOptional=!0,E.validations=E.validations.concat(this.compileValidations(F)),E}},bw=class D extends X8{#D;#u;constructor(u,F){super();this.#u=u,this.#D=F}clone(){return new D(this.#u,this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.transformFnId=F.trackTransformer(this.#u),E}},Bu=class extends X8{options;validations;constructor(D,u){super();this.options={bail:!0,allowNull:!1,isOptional:!1,...D},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(xu in D?D[xu]():D),this}bail(D){return this.options.bail=D,this}[r](D,u,F){return{type:"literal",fieldName:D,propertyName:F.toCamelCase?OD(D):D,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?u.trackParser(this.options.parse):void 0,validations:this.compileValidations(u)}}},e6=class D extends Bu{constructor(u,F){super(u,F)}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},M8=x((D,u,F)=>{let $=typeof u.choices==="function"?u.choices(F):u.choices;if(!$.includes(D))F.report(V.enum,"enum",F,{choices:$})}),fu=class D extends Bu{static rules={enum:M8};#D;getChoices(){return this.#D}constructor(u,F,$){super(F,$||[M8({choices:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},Su=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];e.default.extend(CC.default);e.default.extend(uC.default);e.default.extend(FC.default);var _w=x((D,u,F)=>{if(typeof D!=="string"&&typeof D!=="number"){F.report(V.date,"date",F);return}let $=!1,E=u.formats||Su;if(Array.isArray(E))E=[...E],$=E.includes("x");else if(typeof E!=="string")E={...E},$=E.format==="x";let w=$?k.asNumber(D):D,C=$&&!Number.isNaN(w)?e.default(w):e.default(D,E,!0);if(!C.isValid()){F.report(V.date,"date",F);return}F.meta.$value=C,F.meta.$formats=E,F.mutate(C.toDate(),F)}),bF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the equals rule`);if(!w.isSame(Z,$))F.report(V["date.equals"],"date.equals",F,{expectedValue:C,compare:$})}),_F=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="tomorrow"?e.default().add(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the after rule`);if(!w.isAfter(Z,$))F.report(V["date.after"],"date.after",F,{expectedValue:C,compare:$})}),PF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="tomorrow"?e.default().add(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the afterOrEqual rule`);if(!w.isSameOrAfter(Z,$))F.report(V["date.afterOrEqual"],"date.afterOrEqual",F,{expectedValue:C,compare:$})}),mF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="yesterday"?e.default().subtract(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the before rule`);if(!w.isBefore(Z,$))F.report(V["date.before"],"date.before",F,{expectedValue:C,compare:$})}),vF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="yesterday"?e.default().subtract(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the beforeOrEqual rule`);if(!w.isSameOrBefore(Z,$))F.report(V["date.beforeOrEqual"],"date.beforeOrEqual",F,{expectedValue:C,compare:$})}),cF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSame(Z,$))F.report(V["date.sameAs"],"date.sameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),fF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(E.isSame(Z,$))F.report(V["date.notSameAs"],"date.notSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),nF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isAfter(Z,$))F.report(V["date.afterField"],"date.afterField",F,{otherField:u.otherField,expectedValue:C,compare:$})}),rF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSameOrAfter(Z,$))F.report(V["date.afterOrSameAs"],"date.afterOrSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),dF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isBefore(Z,$))F.report(V["date.beforeField"],"date.beforeField",F,{otherField:u.otherField,expectedValue:C,compare:$})}),lF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSameOrBefore(Z,$))F.report(V["date.beforeOrSameAs"],"date.beforeOrSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),pF=x((D,u,F)=>{if(!F.meta.$value)return;let E=F.meta.$value.day();if(E!==0&&E!==6)F.report(V["date.weekend"],"date.weekend",F)}),iF=x((D,u,F)=>{if(!F.meta.$value)return;let E=F.meta.$value.day();if(E===0||E===6)F.report(V["date.weekday"],"date.weekday",F)}),c2=class D extends Bu{static rules={equals:bF,after:_F,afterOrEqual:PF,before:mF,beforeOrEqual:vF,sameAs:cF,notSameAs:fF,afterField:nF,afterOrSameAs:rF,beforeField:dF,beforeOrSameAs:lF,weekend:pF,weekday:iF};[mD]="vine.date";[pD]=(u)=>{if(typeof u!=="string")return!1;return DC.default(u,this.options.formats||Su,!0).isValid()};constructor(u,F){super(u,F||[_w(u||{})])}equals(u,F){return this.use(bF({expectedValue:u,...F}))}after(u,F){return this.use(_F({expectedValue:u,...F}))}afterOrEqual(u,F){return this.use(PF({expectedValue:u,...F}))}before(u,F){return this.use(mF({expectedValue:u,...F}))}beforeOrEqual(u,F){return this.use(vF({expectedValue:u,...F}))}sameAs(u,F){return this.use(cF({otherField:u,...F}))}notSameAs(u,F){return this.use(fF({otherField:u,...F}))}afterField(u,F){return this.use(nF({otherField:u,...F}))}afterOrSameAs(u,F){return this.use(rF({otherField:u,...F}))}beforeField(u,F){return this.use(dF({otherField:u,...F}))}beforeOrSameAs(u,F){return this.use(lF({otherField:u,...F}))}weekend(){return this.use(pF())}weekday(){return this.use(iF())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},$C=class D{#D;#u=(u,F)=>{F.report(V.union,"union",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[r](u,F,$){return{type:"union",fieldName:u,propertyName:$.toCamelCase?OD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map((E)=>E[r](u,F,$))}}},EC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[r](D,u,F){return{conditionalFnRefId:u.trackConditional(this.#u),schema:this.#D[r](D,u,F)}}};function f2(D){return new $C(D)}f2.if=function D(u,F){return new EC(u,F)};f2.else=function D(u){return new EC(()=>!0,u)};var W0=class extends mu{optional(){return new mw(this)}nullable(){return new Pw(this)}},Pw=class D extends W0{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);if(E.type!=="union")E.allowNull=!0;return E}},mw=class D extends W0{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);if(E.type!=="union")E.isOptional=!0;return E}},Q0=class extends W0{options;validations;constructor(D,u){super();this.options=D||{bail:!0,allowNull:!1,isOptional:!1},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(xu in D?D[xu]():D),this}bail(D){return this.options.bail=D,this}},wC=class D extends Q0{#D;#u=!1;[mD]="vine.array";[pD]=(u)=>{return Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}allowUnknownProperties(){return this.#u=!0,this}clone(){let u=new D(this.#D.map((F)=>F.clone()),this.cloneOptions(),this.cloneValidations());if(this.#u)u.allowUnknownProperties();return u}[r](u,F,$){return{type:"tuple",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,allowUnknownProperties:this.#u,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F),properties:this.#D.map((E,w)=>E[r](String(w),F,$))}}},tF=x((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(V["array.minLength"],"array.minLength",F,u)}),sF=x((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(V["array.maxLength"],"array.maxLength",F,u)}),aF=x((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(V["array.fixedLength"],"array.fixedLength",F,u)}),oF=x((D,u,F)=>{if(!F.isValid)return;if(D.length<=0)F.report(V.notEmpty,"notEmpty",F)}),eF=x((D,u,F)=>{if(!F.isValid)return;if(!k.isDistinct(D,u.fields))F.report(V.distinct,"distinct",F,u)}),D6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.filter(($)=>k.exists($)&&$!==""),F)}),BC=class D extends Q0{static rules={compact:D6,notEmpty:oF,distinct:eF,minLength:tF,maxLength:sF,fixedLength:aF};#D;[mD]="vine.array";[pD]=(u)=>{return Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}minLength(u){return this.use(tF({min:u}))}maxLength(u){return this.use(sF({max:u}))}fixedLength(u){return this.use(aF({size:u}))}notEmpty(){return this.use(oF())}distinct(u){return this.use(eF({fields:u}))}compact(){return this.use(D6())}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[r](u,F,$){return{type:"array",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[r]("*",F,$),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},vw=class D extends W0{#D;[mD]="types.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){return $.toCamelCase=!0,this.#D[r](u,F,$)}},YC=class D extends Q0{#D;#u=[];#F=!1;[mD]="vine.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}getProperties(){return Object.keys(this.#D).reduce((u,F)=>{return u[F]=this.#D[F].clone(),u},{})}allowUnknownProperties(){return this.#F=!0,this}merge(u){return this.#u.push(u),this}clone(){let u=new D(this.getProperties(),this.cloneOptions(),this.cloneValidations());if(this.#u.forEach((F)=>u.merge(F)),this.#F)u.allowUnknownProperties();return u}toCamelCase(){return new vw(this)}[r](u,F,$){return{type:"object",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,allowUnknownProperties:this.#F,validations:this.compileValidations(F),properties:Object.keys(this.#D).map((E)=>{return this.#D[E][r](E,F,$)}),groups:this.#u.map((E)=>{return E[r](F,$)})}}},u6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length<u.min)F.report(V["record.minLength"],"record.minLength",F,u)}),F6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length>u.max)F.report(V["record.maxLength"],"record.maxLength",F,u)}),C6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length!==u.size)F.report(V["record.fixedLength"],"record.fixedLength",F,u)}),$6=x((D,u,F)=>{if(!F.isValid)return;u(Object.keys(D),F)}),JC=class D extends Q0{static rules={maxLength:F6,minLength:u6,fixedLength:C6,validateKeys:$6};#D;[mD]="vine.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}minLength(u){return this.use(u6({min:u}))}maxLength(u){return this.use(F6({max:u}))}fixedLength(u){return this.use(C6({size:u}))}validateKeys(...u){return this.use($6(...u))}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[r](u,F,$){return{type:"record",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[r]("*",F,$),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},E6=x((D,u,F)=>{if(typeof D!=="string")F.report(V.string,"string",F)}),w6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isEmail(D,u))F.report(V.email,"email",F)}),B6=x((D,u,F)=>{if(!F.isValid)return;let $=u&&typeof u==="function"?u(F):u,E=$?.locale||"any";if(!k.isMobilePhone(D,E,$))F.report(V.mobile,"mobile",F)}),Y6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isIP(D,u?.version))F.report(V.ipAddress,"ipAddress",F)}),J6=x((D,u,F)=>{if(!F.isValid)return;if(!u.test(D))F.report(V.regex,"regex",F)}),Z6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isHexColor(D))F.report(V.hexCode,"hexCode",F)}),K6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isURL(D,u))F.report(V.url,"url",F)}),M6=x(async(D,u,F)=>{if(!F.isValid)return;if(!await k.isActiveURL(D))F.report(V.activeUrl,"activeUrl",F)}),X6=x((D,u,F)=>{if(!F.isValid)return;let $="a-zA-Z";if(u){if(u.allowSpaces)$+="\\s";if(u.allowDashes)$+="-";if(u.allowUnderscores)$+="_"}if(!new RegExp(`^[${$}]+\$`).test(D))F.report(V.alpha,"alpha",F)}),W6=x((D,u,F)=>{if(!F.isValid)return;let $="a-zA-Z0-9";if(u){if(u.allowSpaces)$+="\\s";if(u.allowDashes)$+="-";if(u.allowUnderscores)$+="_"}if(!new RegExp(`^[${$}]+\$`).test(D))F.report(V.alphaNumeric,"alphaNumeric",F)}),Q6=x((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(V.minLength,"minLength",F,u)}),A6=x((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(V.maxLength,"maxLength",F,u)}),z6=x((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(V.fixedLength,"fixedLength",F,u)}),G6=x((D,u,F)=>{if(!F.isValid)return;if(!D.endsWith(u.substring))F.report(V.endsWith,"endsWith",F,u)}),q6=x((D,u,F)=>{if(!F.isValid)return;if(!D.startsWith(u.substring))F.report(V.startsWith,"startsWith",F,u)}),H6=x((D,u,F)=>{if(!F.isValid)return;if(k.getNestedValue(u.otherField,F)!==D){F.report(V.sameAs,"sameAs",F,u);return}}),U6=x((D,u,F)=>{if(!F.isValid)return;if(k.getNestedValue(u.otherField,F)===D){F.report(V.notSameAs,"notSameAs",F,u);return}}),O6=x((D,u,F)=>{if(!F.isValid)return;let $=u?.confirmationField||`${F.name}_confirmation`;if(F.parent[$]!==D){F.report(V.confirmed,"confirmed",F,{otherField:$});return}}),V6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.trim(),F)}),L6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(KC.default.default(D,u),F)}),T6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleUpperCase(u),F)}),N6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleLowerCase(u),F)}),I6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(OD(D),F)}),x6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(ZC.default.default(D),F)}),S6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(_2(D,u),F)}),h6=x((D,u,F)=>{if(!F.isValid)return;if(!(typeof u.choices==="function"?u.choices(F):u.choices).includes(D)){F.report(V.in,"in",F,u);return}}),y6=x((D,u,F)=>{if(!F.isValid)return;if((typeof u.list==="function"?u.list(F):u.list).includes(D)){F.report(V.notIn,"notIn",F,u);return}}),j6=x((D,u,F)=>{if(!F.isValid)return;let $=u?typeof u==="function"?u(F)?.provider||[]:u.provider:[];if(!$.length){if(!k.isCreditCard(D))F.report(V.creditCard,"creditCard",F,{providersList:"credit"})}else if(!$.find((w)=>k.isCreditCard(D,{provider:w})))F.report(V.creditCard,"creditCard",F,{providers:$,providersList:$.join("/")})}),R6=x((D,u,F)=>{if(!F.isValid)return;let $=typeof u==="function"?u(F).countryCode:u.countryCode;if(!$.find((w)=>k.isPassportNumber(D,w)))F.report(V.passport,"passport",F,{countryCodes:$})}),k6=x((D,u,F)=>{if(!F.isValid)return;let $=u?typeof u==="function"?u(F)?.countryCode||[]:u.countryCode:[];if(!$.length){if(!k.isPostalCode(D,"any"))F.report(V.postalCode,"postalCode",F)}else if(!$.find((w)=>k.isPostalCode(D,w)))F.report(V.postalCode,"postalCode",F,{countryCodes:$})}),g6=x((D,u,F)=>{if(!F.isValid)return;if(!u||!u.version){if(!k.isUUID(D))F.report(V.uuid,"uuid",F)}else if(!u.version.find((E)=>k.isUUID(D,E)))F.report(V.uuid,"uuid",F,u)}),b6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isAscii(D))F.report(V.ascii,"ascii",F)}),_6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isIBAN(D))F.report(V.iban,"iban",F)}),P6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isJWT(D))F.report(V.jwt,"jwt",F)}),m6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isLatLong(D))F.report(V.coordinates,"coordinates",F)}),W8=class D extends Bu{static rules={in:h6,jwt:P6,url:K6,iban:_6,uuid:g6,trim:V6,email:w6,alpha:X6,ascii:b6,notIn:y6,regex:J6,escape:x6,sameAs:H6,mobile:B6,string:E6,hexCode:Z6,passport:R6,endsWith:G6,confirmed:O6,activeUrl:M6,minLength:Q6,notSameAs:U6,maxLength:A6,ipAddress:Y6,creditCard:j6,postalCode:k6,startsWith:q6,toUpperCase:T6,toLowerCase:N6,toCamelCase:I6,fixedLength:z6,coordinates:m6,normalizeUrl:S6,alphaNumeric:W6,normalizeEmail:L6};[mD]="vine.string";[pD]=(u)=>{return typeof u==="string"};constructor(u,F){super(u,F||[E6()])}url(...u){return this.use(K6(...u))}activeUrl(){return this.use(M6())}email(...u){return this.use(w6(...u))}mobile(...u){return this.use(B6(...u))}ipAddress(u){return this.use(Y6(u?{version:u}:void 0))}hexCode(){return this.use(Z6())}regex(u){return this.use(J6(u))}alpha(u){return this.use(X6(u))}alphaNumeric(u){return this.use(W6(u))}minLength(u){return this.use(Q6({min:u}))}maxLength(u){return this.use(A6({max:u}))}fixedLength(u){return this.use(z6({size:u}))}confirmed(u){return this.use(O6(u))}trim(){return this.use(V6())}normalizeEmail(u){return this.use(L6(u))}toUpperCase(){return this.use(T6())}toLowerCase(){return this.use(N6())}toCamelCase(){return this.use(I6())}escape(){return this.use(x6())}normalizeUrl(...u){return this.use(S6(...u))}startsWith(u){return this.use(q6({substring:u}))}endsWith(u){return this.use(G6({substring:u}))}sameAs(u){return this.use(H6({otherField:u}))}notSameAs(u){return this.use(U6({otherField:u}))}in(u){return this.use(h6({choices:u}))}notIn(u){return this.use(y6({list:u}))}creditCard(...u){return this.use(j6(...u))}passport(...u){return this.use(R6(...u))}postalCode(...u){return this.use(k6(...u))}uuid(...u){return this.use(g6(...u))}ascii(){return this.use(b6())}iban(){return this.use(_6())}jwt(){return this.use(P6())}coordinates(){return this.use(m6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},v6=x((D,u,F)=>{let $=u.strict?D:k.asNumber(D);if(typeof $!=="number"||Number.isNaN($)||$===Number.POSITIVE_INFINITY||$===Number.NEGATIVE_INFINITY){F.report(V.number,"number",F);return}F.mutate($,F)}),c6=x((D,u,F)=>{if(!F.isValid)return;if(D<u.min)F.report(V.min,"min",F,u)}),f6=x((D,u,F)=>{if(!F.isValid)return;if(D>u.max)F.report(V.max,"max",F,u)}),n6=x((D,u,F)=>{if(!F.isValid)return;if(D<u.min||D>u.max)F.report(V.range,"range",F,u)}),r6=x((D,u,F)=>{if(!F.isValid)return;if(D<0)F.report(V.positive,"positive",F)}),d6=x((D,u,F)=>{if(!F.isValid)return;if(D>=0)F.report(V.negative,"negative",F)}),l6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isDecimal(String(D),{force_decimal:u.range[0]!==0,decimal_digits:u.range.join(",")}))F.report(V.decimal,"decimal",F,{digits:u.range.join("-")})}),p6=x((D,u,F)=>{if(!F.isValid)return;if(!Number.isInteger(D))F.report(V.withoutDecimals,"withoutDecimals",F)}),i6=x((D,u,F)=>{if(!F.isValid)return;if(!u.values.includes(D))F.report(V["number.in"],"in",F,u)}),nu=class D extends Bu{static rules={in:i6,max:f6,min:c6,range:n6,number:v6,decimal:l6,negative:d6,positive:r6,withoutDecimals:p6};[mD]="vine.number";[pD]=(u)=>{let F=k.asNumber(u);return!Number.isNaN(F)};constructor(u,F){super(u,F||[v6(u||{})])}min(u){return this.use(c6({min:u}))}max(u){return this.use(f6({max:u}))}range(u){return this.use(n6({min:u[0],max:u[1]}))}positive(){return this.use(r6())}negative(){return this.use(d6())}decimal(u){return this.use(l6({range:Array.isArray(u)?u:[u]}))}withoutDecimals(){return this.use(p6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}in(u){return this.use(i6({values:u}))}},t6=x((D,u,F)=>{let $=u.strict===!0?D:k.asBoolean(D);if(typeof $!=="boolean"){F.report(V.boolean,"boolean",F);return}F.mutate($,F)}),ru=class D extends Bu{static rules={boolean:t6};[mD]="vine.boolean";[pD]=(u)=>{return typeof(this.options.strict===!0?u:k.asBoolean(u))==="boolean"};constructor(u,F){super(u,F||[t6(u||{})])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},s6=x((D,u,F)=>{let $=D;if(typeof u.expectedValue==="boolean")$=k.asBoolean(D);else if(typeof u.expectedValue==="number")$=k.asNumber(D);if($!==u.expectedValue){F.report(V.literal,"literal",F,u);return}F.mutate($,F)}),MC=class D extends Bu{static rules={equals:s6};#D;constructor(u,F,$){super(F,$||[s6({expectedValue:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},cw=["on","1","yes","true",!0,1],a6=x((D,u,F)=>{if(!cw.includes(D))F.report(V.accepted,"accepted",F)}),XC=class D extends Bu{static rules={accepted:a6};constructor(u,F){super(u,F||[a6()])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},fw=class D{#D;#u=(u,F)=>{F.report(V.unionGroup,"unionGroup",F)};constructor(u){this.#D=u}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}otherwise(u){return this.#u=u,this}[r](u,F){return{type:"group",elseConditionalFnRefId:u.trackConditional(this.#u),conditions:this.#D.map(($)=>$[r](u,F))}}},WC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[r](D,u){return{schema:{type:"sub_object",properties:Object.keys(this.#D).map((F)=>{return this.#D[F][r](F,D,u)}),groups:[]},conditionalFnRefId:D.trackConditional(this.#u)}}};function n2(D){return new fw(D)}n2.if=function D(u,F){return new WC(u,F)};n2.else=function D(u){return new WC(()=>!0,u)};var nw=class D extends Bu{static rules={enum:M8};#D;constructor(u,F,$){super(F,$||[M8({choices:Object.values(u)})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},rw=class D{#D;#u=(u,F)=>{F.report(V.unionOfTypes,"unionOfTypes",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[r](u,F,$){return{type:"union",fieldName:u,propertyName:$.toCamelCase?OD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map((E)=>{return{conditionalFnRefId:F.trackConditional((w,C)=>{return E[pD](w,C)}),schema:E[r](u,F,$)}})}}},dw=class extends mu{group=n2;union=f2;string(){return new W8}boolean(D){return new ru(D)}accepted(){return new XC}number(D){return new nu(D)}date(D){return new c2(D)}literal(D){return new MC(D)}object(D){return new YC(D)}array(D){return new BC(D)}tuple(D){return new wC(D)}record(D){return new JC(D)}enum(D){if(Array.isArray(D)||typeof D==="function")return new fu(D);return new nw(D)}any(){return new e6}unionOfTypes(D){let u=new Set;return D.forEach((F)=>{if(!F[pD]||!F[mD])throw new Error(`Cannot use "${F.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if(u.has(F[mD]))throw new Error(`Cannot use duplicate schema "${F[mD]}". "vine.unionOfTypes" needs distinct schema types only`);u.add(F[mD])}),u.clear(),new rw(D)}},lw={required:V.required,array:V.array,object:V.object},v2=class{#D;messagesProvider;errorReporter;#u(D){let u=gF();return{compilerNode:{type:"root",schema:D[r]("",u,{toCamelCase:!1})},refs:u.toJSON()}}constructor(D,u){let{compilerNode:F,refs:$}=this.#u(D);this.#D={schema:F,refs:$};let E=u.metaDataValidator,w=new kF(F,{convertEmptyStringsToNull:u.convertEmptyStringsToNull,messages:lw}).compile();if(this.errorReporter=u.errorReporter,this.messagesProvider=u.messagesProvider,E)this.validate=(C,Z)=>{let M=Z??{},W=M.meta??{},X=M.errorReporter??this.errorReporter,q=M.messagesProvider??this.messagesProvider;return E(W),w(C,W,$,q,X())};else this.validate=(C,Z)=>{let M=Z??{},W=M.meta??{},X=M.errorReporter??this.errorReporter,q=M.messagesProvider??this.messagesProvider;return w(C,W,$,q,X())}}async tryValidate(D,...[u]){try{return[null,await this.validate(D,u)]}catch(F){if(F instanceof L2)return[F,null];throw F}}toJSON(){let{schema:D,refs:u}=this.#D;return{schema:structuredClone(D),refs:u}}},QC=class extends dw{messagesProvider=new Z0(V,F3);errorReporter=()=>new T2;convertEmptyStringsToNull=!1;helpers=k;createRule=x;compile(D){return new v2(D,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(D){return{compile:(u)=>{return new v2(u,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter,metaDataValidator:D})}}}validate(D){return this.compile(D.schema).validate(D.data,D)}tryValidate(D){return this.compile(D.schema).tryValidate(D.data,D)}},pw=new QC,y=pw;var AC={APP_NAME:y.string(),APP_ENV:y.enum(["local","dev","stage","prod"]),APP_KEY:y.string(),APP_URL:y.string(),PORT:y.number(),PORT_BACKEND:y.number(),PORT_ADMIN:y.number(),PORT_LIBRARY:y.number(),PORT_DESKTOP:y.number(),PORT_EMAIL:y.number(),PORT_DOCS:y.number(),PORT_INSPECT:y.number(),PORT_API:y.number(),PORT_SYSTEM_TRAY:y.number(),APP_MAINTENANCE:y.boolean(),DEBUG:y.boolean(),API_PREFIX:y.string(),DOCS_PREFIX:y.string(),DB_CONNECTION:y.enum(["mysql","sqlite","postgres"]),DB_HOST:y.string(),DB_PORT:y.number(),DB_DATABASE:y.string(),DB_USERNAME:y.string(),DB_PASSWORD:y.string(),AWS_ACCOUNT_ID:y.string(),AWS_ACCESS_KEY_ID:y.string(),AWS_SECRET_ACCESS_KEY:y.string(),AWS_DEFAULT_REGION:y.string(),AWS_DEFAULT_PASSWORD:y.string(),MAIL_MAILER:y.enum(["ses","sendmail","log","smtp"]),MAIL_HOST:y.string(),MAIL_PORT:y.number(),MAIL_USERNAME:y.string(),MAIL_PASSWORD:y.string(),MAIL_ENCRYPTION:y.string(),MAIL_FROM_NAME:y.string(),MAIL_FROM_ADDRESS:y.string(),SEARCH_ENGINE_DRIVER:y.enum(["meilisearch","algolia","typesense"]),MEILISEARCH_HOST:y.string(),MEILISEARCH_KEY:y.string(),FRONTEND_APP_ENV:y.enum(["development","staging","production"]),FRONTEND_APP_URL:y.string()};var iw={APP_ENV:["local","dev","development","staging","prod","production"],DB_CONNECTION:["mysql","sqlite","postgres","dynamodb"],MAIL_MAILER:["smtp","mailgun","ses","postmark","sendmail","log"],SEARCH_ENGINE_DRIVER:["opensearch"],FRONTEND_APP_ENV:["development","staging","production"]},tw=Object.entries(AC).reduce((D,[u,F])=>{let $;switch(typeof F){case"string":$=y.string();break;case"number":$=y.number();break;case"boolean":$=y.boolean();break;default:if(Array.isArray(F)){$=y.enum(F);break}if(typeof F==="object"){let w=Symbol.for("schema_name"),C=F[w];if(C==="vine.string"){$=y.string();break}if(C==="vine.number"){$=y.number();break}if(C==="vine.boolean"){$=y.boolean();break}if(!C){$=y.enum(iw.APP_ENV);break}console.error("Unknown env value type",typeof F)}throw new Error(`Invalid env value for ${u}`)}let E=u;return D[E]=$,D},{}),PQ=y.object(tw);var aw={get:(D,u)=>{let F=D[u];if(typeof F==="string"&&/^\d+$/.test(F)&&u!=="AWS_ACCOUNT_ID")return Number(F);if(typeof F==="string"&&/^true|false$/.test(F))return F==="true";if(F instanceof fu)return D[u];if(F instanceof ru)return!!D[u];if(F instanceof nu)return Number(D[u]);return F}};function ow(){return typeof Bun!=="undefined"?Bun.env:sw.env}var j=new Proxy(ow(),aw);var zC={name:j.APP_NAME??"Stacks",description:"Stacks is a full-stack framework for building modern web applications.",env:j.APP_ENV??"local",url:j.APP_URL??"stacks.localhost",redirectUrls:["stacksjs.com"],debug:j.DEBUG??!1,key:j.APP_KEY,maintenanceMode:j.APP_MAINTENANCE??!1,docMode:!1,timezone:"America/Los_Angeles",locale:"en",fallbackLocale:"en",cipher:"aes-256-cbc"};var GC={driver:"dynamodb",prefix:"stacks",ttl:3600,drivers:{dynamodb:{key:j.AWS_ACCESS_KEY_ID||"",secret:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1",table:"cache",endpoint:""},memcached:{persistent_id:"",sasl:["",""],options:{},servers:[{host:"127.0.0.1",port:11211,weight:100}]},redis:{connection:"cache",host:"127.0.0.1",port:6379,password:"",username:"stacks"}}};var qC={name:"My Custom CLI",command:"custom-cli",description:"This is an example command to illustrate how to create your own commands. Check out `../app/commands` for more.",deploy:!0};var Q8={firewall:{enabled:!0,countryCodes:["RU","IR"],ipAddresses:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0,queryString:[],httpHeaders:[]}};var HC={sites:{root:"stacksjs.org",path:"dist",modals:{domain:"modals.stacksjs.org",path:"dist"},stepper:{domain:"stepper.stacksjs.org",path:"dist"},notification:{domain:"notification.stacksjs.org",path:"dist"},docs:{domain:"docs.stacksjs.org",path:"dist"},tlsx:{domain:"tlsx.stacksjs.org",path:"dist"},dtsx:{domain:"dtsx.stacksjs.org",path:"dist"},spreadsheet:{domain:"spreadsheet.stacksjs.org",path:"dist"}},infrastructure:{type:"serverless",driver:"aws",firewall:Q8.firewall,environments:["production","staging","development"],storage:{},api:{prefix:j.API_PREFIX||"api",description:"My awesome Stacks API",deploy:!0,memorySize:512,prewarm:10,timeout:30},cdn:{compress:!0,allowedMethods:"ALL",cachedMethods:"GET_HEAD",originShieldRegion:"us-east-1",minTtl:0,defaultTtl:86400,maxTtl:31536000,cookieBehavior:"none",allowList:{cookies:[],headers:[],queryStrings:[]},realtimeLogs:{enabled:!0,samplingRate:1}},fileSystem:!0}};var UC={default:j.DB_CONNECTION||"sqlite",connections:{sqlite:{database:j.DB_DATABASE||"database/stacks.sqlite",prefix:""},dynamodb:{key:j.AWS_ACCESS_KEY_ID||"",secret:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1",prefix:j.DB_DATABASE||"stacks",endpoint:"http://localhost",port:j.DB_PORT||8000},mysql:{name:j.DB_DATABASE||"stacks",host:j.DB_HOST||"127.0.0.1",port:j.DB_PORT||3306,username:j.DB_USERNAME||"root",password:j.DB_PASSWORD||"",prefix:""},postgres:{name:j.DB_DATABASE||"stacks",host:j.DB_HOST||"127.0.0.1",port:j.DB_PORT||3306,username:j.DB_USERNAME||"",password:j.DB_PASSWORD||"",prefix:""}},migrations:"migrations",migrationLocks:"migration_locks"};var OC={a:[{name:j.APP_URL||"",address:"10.0.0.1",ttl:300},{name:"www",address:"@",ttl:300}],aaaa:[],cname:[],mx:[],txt:[],nameservers:[]};var VC={from:{name:j.MAIL_FROM_NAME||"Stacks",address:j.MAIL_FROM_ADDRESS||"no-reply@stacksjs.org"},mailboxes:["chris@stacksjs.org","blake@stacksjs.org","glenn@stacksjs.org"],url:j.APP_URL||"http://localhost:3000",charset:"UTF-8",server:{scan:!0}};var LC={messages:{string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",regex:"The {{ field }} field format is invalid",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ascii:"The {{ field }} field must only contain ASCII characters",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",hexCode:"The {{ field }} field must be a valid hex color code",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",mobile:"The {{ field }} field must be a valid mobile phone number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must not have decimal places",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field"}};var TC={hooks:{"pre-commit":"lint-staged"},scopes:["","ci","deps","dx","release","docs","test","core","actions","arrays","auth","build","cache","cli","cloud","collections","config","database","datetime","docs","errors","git","lint","x-ray","modules","notifications","objects","path","realtime","router","buddy","security","server","storage","strings","tests","types","ui","utils"],messages:{type:"Select the type of change that you\u2019re committing:",scope:"Select the SCOPE of this change (optional):",customScope:"Select the SCOPE of this change:",subject:"Write a SHORT, IMPERATIVE tense description of the change:\n",body:'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',breaking:'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',footerPrefixesSelect:"Select the ISSUES type of the change list by this change (optional):",customFooterPrefixes:"Input ISSUES prefix:",footer:"List any ISSUES by this change. E.g.: #31, #34:\n",confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don\u2019t modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]};var NC={driver:"argon2",bcrypt:{rounds:10,cost:4},argon2:{memory:65536,threads:1,time:1}};var IC={name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"Chris Breuer",contributors:["Chris Breuer <chris@stacksjs.org>"],defaultLanguage:"en",releaseable:!0,vueComponents:{name:"hello-world-vue",description:"Your Vue component library description",keywords:["component","library","vue","vite","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}};var xC={logsPath:S0("logs/stacks.log"),deploymentsPath:S0("logs/deployments.log")};var SC={default:"email"};var hC={driver:"stripe",stripe:{publishableKey:j.STRIPE_PUBLISHABLE_KEY||"",secretKey:j.STRIPE_SECRET_KEY||""}};var yC={frontend:j.PORT??3000,backend:j.PORT_BACKEND??3001,admin:j.PORT_ADMIN??3002,library:j.PORT_LIBRARY??3003,desktop:j.PORT_DESKTOP??3004,email:j.PORT_EMAIL??3005,docs:j.PORT_DOCS??3006,inspect:j.PORT_INSPECT??3007,api:j.PORT_API??3008,systemTray:j.PORT_SYSTEM_TRAY??3009,database:3010};var jC={default:"sync",connections:{sync:{driver:"sync"},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:"us-east-1"}}};var RC={plans:[{productName:"Stacks Hobby",description:"All the Stacks features.",pricing:[{key:"stacks_hobby_monthly",price:3900,interval:"month",currency:"usd"},{key:"stacks_hobby_yearly",price:37900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}},{productName:"Stacks Pro",description:"All the Stacks features, including being able to invite team members.",pricing:[{key:"stacks_pro_monthly",price:5900,interval:"month",currency:"usd"},{key:"stacks_pro_yearly",price:57900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}}],webhook:{endpoint:"/webhooks/stripe",secret:""},currencies:["usd"],coupons:[{code:"SUMMER2024",amountOff:500,duration:"once"}],products:[{name:"Stacks Pro",description:"All the Stacks features.",images:["url_to_image"]}]};var kC={driver:"opensearch"};var gC={aws:{accountId:j.AWS_ACCOUNT_ID||"",appId:j.AWS_ACCESS_KEY_ID||"",apiKey:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1"},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},lemonSqueezy:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}};var bC={driver:"s3"};var _C={name:"Stacks",members:{chris:"chris@stacksjs.org",blake:"blake@stacksjs.org",zoltan:"zoltan@stacksjs.org",freddy:"freddy@stacksjs.org",glenn:"glenn@stacksjs.org",dorell:"dorell@stacksjs.org",avery:"avery@stacksjs.org",adelino:"adelino@stacksjs.org"}};var PC={shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["heroicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}},theme:{colors:{veryCool:"#0000ff",brand:{primary:"hsl(var(--hue, 217) 78% 51%)"}}}};var ew={ai:p1,analytics:i1,app:zC,cache:GC,cli:qC,cloud:HC,database:UC,dns:OC,email:VC,errors:LC,git:TC,hashing:NC,library:IC,logging:xC,notification:SC,queue:jC,payment:hC,ports:yC,saas:RC,searchEngine:kC,security:Q8,services:gC,storage:bC,team:_C,ui:PC},r2=ew;async function mC(D){if(!D?.port)D={port:3000};return console.log("Creating local tunnel",D.port),"localTunnel"}async function Au(D){return await mC({port:D})}async function DB({domain:D=BD.app.url||"stacks",type:u="frontend",localhost:F=!1,https:$=void 0,network:E=void 0}={}){let w=D.replace(/\.[^.]+$/,".localhost");switch(u){case"frontend":if(E)return await Au(BD.ports?.frontend||3000);if(F)return`http://localhost:${BD.ports?.frontend}`;break;case"backend":if(E)return await Au(BD.ports?.backend||3001);if(F)return`http://localhost:${BD.ports?.backend}`;w=`api.${w}`;break;case"admin":if(E)return await Au(BD.ports?.admin||3002);if(F)return`http://localhost:${BD.ports?.admin}`;w=`admin.${w}`;break;case"library":if(E)return await Au(BD.ports?.library||3003);if(F)return`http://localhost:${BD.ports?.library}`;w=`libs.${w}`;break;case"email":if(E)return await Au(BD.ports?.email||3005);if(F)return`http://localhost:${BD.ports?.email}`;w=`email.${w}`;break;case"desktop":if(E)return await Au(BD.ports?.desktop||3004);if(F)return`http://localhost:${BD.ports?.desktop}`;w=`desktop.${w}`;break;case"docs":if(E)return await Au(BD.ports?.docs||3006);if(F)return`http://localhost:${BD.ports?.docs}`;w=`docs.${w}`;break;case"inspect":if(E)return await Au(BD.ports?.inspect||3007);if(F)return`http://localhost:${BD.ports?.inspect}`;w=`inspect.${w}`;break;default:if(F)return`http://localhost:${BD.ports?.frontend}`}if($)return`https://${w}`;return`http://${w}`}function uB(D){return D}function FB(D){return D}function CB(D){return D}function $B(D){return D}function EB(D){return D}function wB(D){return D}function BB(D){return D}function YB(D){return D}function JB(D){return D}function ZB(D){return D}function KB(D){return D}function MB(D){return D}function XB(D){return D}function WB(D){return D}function QB(D){return D}function AB(D){return D}function zB(D){return D}function GB(D){return D}function qB(D){return D}function HB(D){return D}function UB(D){return D}function OB(D){return D}function VB(D){return D}function LB(D){return D}function TB(D){return D}function NB(D){return D}function IB(D){return D}var t={...r8,...r2},xB=t.ai,SB=t.analytics,hu=t.app,hB=t.cache,yB=t.cloud,jB=t.cli,RB=t.database,kB=t.dns,gB=t.docs,bB=t.email,_B=t.errors,PB=t.git,mB=t.hashing,vB=t.library,cB=t.logging,fB=t.notification,nB=t.payment,rB=t.ports,dB=t.queue,lB=t.security,pB=t.saas,iB=t.searchEngine,tB=t.services,sB=t.storage,aB=t.team,oB=t.ui;function eB(){if(hu.env==="local")return"dev";if(hu.env==="development")return"dev";if(hu.env==="staging")return"stage";if(hu.env==="production")return"prod";if(!hu.env)throw new Error("Couldn\'t determine app environment");return hu.env}class d2{static isTestEnvironment=!1;static shouldExitProcess=!0;static handle(D,u){if(this.shouldExitProcess=u?.shouldExit!==!1,u?.silent!==!0)this.writeErrorToConsole(D);let F;if(u?.message)F=u.message;else if(D instanceof Error)F=D.message;else if(typeof D==="string")F=D;else F=JSON.stringify(D);let $=new Error(F);if(D instanceof Error)Object.assign($,D);return this.writeErrorToFile($).catch((E)=>console.error(E)),$}static handleError(D,u){return this.handle(D,u),D}static async writeErrorToFile(D){if(!(D instanceof Error)){console.error("Error is not an instance of Error:",D);return}let u=`[${new Date().toISOString()}] ${D.name}: ${D.message}\n`,F=n8("stacks.log")??n8("errors.log");try{await fC(r1(F),{recursive:!0}),await cC(F,u)}catch($){console.error("Failed to write to error file:",$)}}static writeErrorToConsole(D){console.error(D);let u=typeof D==="string"?D:D instanceof Error?D.message:JSON.stringify(D);if(u.includes("bunx --bun cdk destroy")||u===`Failed to execute command: ${vC("bunx --bun eslint . --fix")}`||u===`Failed to execute command: ${vC("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)CY.exit(1)}}function nC(D,u){let F;if(u3(D))F=D;else if(D instanceof Error)F=D.message;else if(u instanceof Error)F=u.message;else F=String(D);return Ou(`ERROR: ${$Y(F)}`),d2.handle(D,u)}async function Ou(D,u){let F=`[${new Date().toISOString()}] ${D}\n`;try{let $=u?.logFile??BD.logging.logsPath??"storage/logs/stacks.log";try{await uY($)}catch{console.log("Creating log file directory...",$),await fC(FY($),{recursive:!0})}await cC($,F)}catch($){console.error("Failed to write to log file:",$)}}var EY={withStackTrace:!1},lC=(D,u,F=EY)=>{let $=u.isOk()?{type:"Ok",value:u.value}:{type:"Err",value:u.error},E=F.withStackTrace?new Error().stack:void 0;return{data:$,message:D,stack:E}};function du(D,u,F,$){function E(w){return w instanceof F?w:new F(function(C){C(w)})}return new(F||(F=Promise))(function(w,C){function Z(X){try{W($.next(X))}catch(q){C(q)}}function M(X){try{W($.throw(X))}catch(q){C(q)}}function W(X){X.done?w(X.value):E(X.value).then(Z,M)}W(($=$.apply(D,u||[])).next())})}function rC(D){var u=typeof Symbol==="function"&&Symbol.iterator,F=u&&D[u],$=0;if(F)return F.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&$>=D.length)D=void 0;return{value:D&&D[$++],done:!D}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yu(D){return this instanceof Yu?(this.v=D,this):new Yu(D)}function dC(D,u,F){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var $=F.apply(D,u||[]),E,w=[];return E=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),Z("next"),Z("throw"),Z("return",C),E[Symbol.asyncIterator]=function(){return this},E;function C(U){return function(A){return Promise.resolve(A).then(U,q)}}function Z(U,A){if($[U]){if(E[U]=function(P){return new Promise(function(n,d){w.push([U,P,n,d])>1||M(U,P)})},A)E[U]=A(E[U])}}function M(U,A){try{W($[U](A))}catch(P){L(w[0][3],P)}}function W(U){U.value instanceof Yu?Promise.resolve(U.value.v).then(X,q):L(w[0][2],U)}function X(U){M("next",U)}function q(U){M("throw",U)}function L(U,A){if(U(A),w.shift(),w.length)M(w[0][0],w[0][1])}}function wY(D){var u,F;return u={},$("next"),$("throw",function(E){throw E}),$("return"),u[Symbol.iterator]=function(){return this},u;function $(E,w){u[E]=D[E]?function(C){return(F=!F)?{value:Yu(D[E](C)),done:!1}:w?w(C):C}:w}}function BY(D){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=D[Symbol.asyncIterator],F;return u?u.call(D):(D=typeof rC==="function"?rC(D):D[Symbol.iterator](),F={},$("next"),$("throw"),$("return"),F[Symbol.asyncIterator]=function(){return this},F);function $(w){F[w]=D[w]&&function(C){return new Promise(function(Z,M){C=D[w](C),E(Z,M,C.done,C.value)})}}function E(w,C,Z,M){Promise.resolve(M).then(function(W){w({value:W,done:Z})},C)}}class MD{constructor(D){this._promise=D}static fromSafePromise(D){let u=D.then((F)=>new uu(F));return new MD(u)}static fromPromise(D,u){let F=D.then(($)=>new uu($)).catch(($)=>new iD(u($)));return new MD(F)}static fromThrowable(D,u){return(...F)=>{return new MD((()=>du(this,void 0,void 0,function*(){try{return new uu(yield D(...F))}catch($){return new iD(u?u($):$)}}))())}}static combine(D){return ZY(D)}static combineWithAllErrors(D){return KY(D)}map(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);return new uu(yield D(u.value))})))}andThrough(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);let F=yield D(u.value);if(F.isErr())return new iD(F.error);return new uu(u.value)})))}andTee(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);try{yield D(u.value)}catch(F){}return new uu(u.value)})))}mapErr(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isOk())return new uu(u.value);return new iD(yield D(u.error))})))}andThen(D){return new MD(this._promise.then((u)=>{if(u.isErr())return new iD(u.error);let F=D(u.value);return F instanceof MD?F._promise:F}))}orElse(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return D(u.error);return new uu(u.value)})))}match(D,u){return this._promise.then((F)=>F.match(D,u))}unwrapOr(D){return this._promise.then((u)=>u.unwrapOr(D))}safeUnwrap(){return dC(this,arguments,function*D(){return yield Yu(yield Yu(yield*wY(BY(yield Yu(this._promise.then((u)=>u.safeUnwrap()))))))})}then(D,u){return this._promise.then(D,u)}[Symbol.asyncIterator](){return dC(this,arguments,function*D(){let u=yield Yu(this._promise);if(u.isErr())yield yield Yu(A0(u.error));return yield Yu(u.value)})}}var A0=(D)=>new MD(Promise.resolve(new iD(D))),YY=MD.fromPromise,JY=MD.fromSafePromise,qz=MD.fromThrowable,pC=(D)=>{let u=Vu([]);for(let F of D)if(F.isErr()){u=Ju(F.error);break}else u.map(($)=>$.push(F.value));return u},ZY=(D)=>MD.fromSafePromise(Promise.all(D)).andThen(pC),iC=(D)=>{let u=Vu([]);for(let F of D)if(F.isErr()&&u.isErr())u.error.push(F.error);else if(F.isErr()&&u.isOk())u=Ju([F.error]);else if(F.isOk()&&u.isOk())u.value.push(F.value);return u},KY=(D)=>MD.fromSafePromise(Promise.all(D)).andThen(iC),A8;(function(D){function u(E,w){return(...C)=>{try{let Z=E(...C);return Vu(Z)}catch(Z){return Ju(w?w(Z):Z)}}}D.fromThrowable=u;function F(E){return pC(E)}D.combine=F;function $(E){return iC(E)}D.combineWithAllErrors=$})(A8||(A8={}));var Vu=(D)=>new uu(D);function Ju(D){return new iD(D)}class uu{constructor(D){this.value=D}isOk(){return!0}isErr(){return!this.isOk()}map(D){return Vu(D(this.value))}mapErr(D){return Vu(this.value)}andThen(D){return D(this.value)}andThrough(D){return D(this.value).map((u)=>this.value)}andTee(D){try{D(this.value)}catch(u){}return Vu(this.value)}orElse(D){return Vu(this.value)}asyncAndThen(D){return D(this.value)}asyncAndThrough(D){return D(this.value).map(()=>this.value)}asyncMap(D){return MD.fromSafePromise(D(this.value))}unwrapOr(D){return this.value}match(D,u){return D(this.value)}safeUnwrap(){let D=this.value;return function*(){return D}()}_unsafeUnwrap(D){return this.value}_unsafeUnwrapErr(D){throw lC("Called `_unsafeUnwrapErr` on an Ok",this,D)}*[Symbol.iterator](){return this.value}}class iD{constructor(D){this.error=D}isOk(){return!1}isErr(){return!this.isOk()}map(D){return Ju(this.error)}mapErr(D){return Ju(D(this.error))}andThrough(D){return Ju(this.error)}andTee(D){return Ju(this.error)}andThen(D){return Ju(this.error)}orElse(D){return D(this.error)}asyncAndThen(D){return A0(this.error)}asyncAndThrough(D){return A0(this.error)}asyncMap(D){return A0(this.error)}unwrapOr(D){return D}match(D,u){return u(this.error)}safeUnwrap(){let D=this.error;return function*(){throw yield Ju(D),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(D){throw lC("Called `_unsafeUnwrap` on an Err",this,D)}_unsafeUnwrapErr(D){return this.error}*[Symbol.iterator](){let D=this;return yield D,D}}var MY=A8.fromThrowable;M1();z8();q8();U8();function bJ(){let D=/--verbose(?!\s*=\s*false|\s+false)(?:\s+|=true)?(?:$|\s)/,u=gJ();if(D.test(u))return 4;return 3}var O0={...I8({level:bJ()}),warning:(D)=>console.warn(D),dump:(...D)=>console.log(...D),dd:(...D)=>{console.log(...D),x8.exit(1)},echo:(D)=>console.log(D)};var Qu={info:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.info(D);await Ou(`INFO: ${U0(D)}`)},success:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.success(D);await Ou(`SUCCESS: ${U0(D)}`)},warn:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.warn(D);await Ou(`WARN: ${U0(D)}`)},warning:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.warn(D);await Ou(`WARN: ${U0(D)}`)},error:async(D,u)=>{nC(D,u)},debug:async(...D)=>{let F=`DEBUG: ${D.map(($)=>typeof $==="object"?JSON.stringify($,null,2):$).join(" ")}`;if(x8.env.APP_ENV==="production"||x8.env.APP_ENV==="prod")return Ou(F);O0.debug(F),await Ou(U0(F))},dump:(...D)=>D.forEach((u)=>console.log(u)),dd:(...D)=>{D.forEach((u)=>console.log(u)),x8.exit(1)},echo:(...D)=>console.log(...D)};var g4=p(h1(),1);import qK from"node-fetch";var y4="https://www.iana.org/whois?q=",j4={"whois.denic.de":"-T dn,ace","whois.nic.fr":"-V Md5.2"},y1={"br.com":"whois.centralnic.net","cn.com":"whois.centralnic.net","de.com":"whois.centralnic.net","eu.com":"whois.centralnic.net","gb.com":"whois.centralnic.net","gb.net":"whois.centralnic.net","gr.com":"whois.centralnic.net","hu.com":"whois.centralnic.net","in.net":"whois.centralnic.net","no.com":"whois.centralnic.net","qc.com":"whois.centralnic.net","ru.com":"whois.centralnic.net","sa.com":"whois.centralnic.net","se.com":"whois.centralnic.net","se.net":"whois.centralnic.net","uk.com":"whois.centralnic.net","uk.net":"whois.centralnic.net","us.com":"whois.centralnic.net","uy.com":"whois.centralnic.net","za.com":"whois.centralnic.net","jpn.com":"whois.centralnic.ne","web.com":"whois.centralnic.ne",com:"whois.verisign-grs.com","za.net":"whois.za.net",net:"whois.verisign-grs.com","eu.org":"whois.eu.org","za.org":"whois.za.org",org:"whois.pir.org","llyw.cymru":"whois.nic.llyw.cymru","gov.scot":"whois.nic.gov.scot","gov.wales":"whois.nic.gov.wales",edu:"whois.educause.edu",gov:"whois.dotgov.gov",int:"whois.iana.org","e164.arpa":"whois.ripe.net",arpa:"whois.iana.org",aero:"whois.aero",asia:"whois.nic.asia",biz:"whois.nic.biz",cat:"whois.nic.cat",coop:"whois.nic.coop",info:"whois.afilias.net",jobs:"whois.nic.jobs",mobi:"whois.afilias.net",museum:"whois.nic.museum",name:"whois.nic.name",post:"whois.dotpostregistry.net",pro:"whois.nic.pro",tel:"whois.nic.tel",travel:"whois.nic.travel",xxx:"whois.nic.xxx",ac:"whois.nic.ac",ae:"whois.aeda.net.ae",af:"whois.nic.af",ag:"whois.nic.ag",ai:"whois.nic.ai",am:"whois.amnic.net",ar:"whois.nic.ar",as:"whois.nic.as","priv.at":"whois.nic.priv.at",at:"whois.nic.at",au:"whois.auda.org.au",aw:"whois.nic.aw",ax:"whois.ax",be:"whois.dns.be",bf:"whois.registre.bf",bg:"whois.register.bg",bh:"whois.nic.bh",bi:"whois1.nic.bi",bj:"whois.nic.bj",bm:"whois.afilias-srs.net",bn:"whois.bnnic.bn",bo:"whois.nic.bo",br:"whois.registro.br",by:"whois.cctld.by",bw:"whois.nic.net.bw",bz:"whois.afilias-grs.info","co.ca":"whois.co.ca",ca:"whois.cira.ca",cc:"ccwhois.verisign-grs.com",cd:"whois.nic.cd",ch:"whois.nic.ch",ci:"whois.nic.ci",cl:"whois.nic.cl",cm:"whois.netcom.cm","edu.cn":"whois.edu.cn",cn:"whois.cnnic.cn","uk.co":"whois.uk.co",co:"whois.nic.co",cr:"whois.nic.cr",cx:"whois.nic.cx",cz:"whois.nic.cz",de:"whois.denic.de",dk:"whois.dk-hostmaster.dk",dm:"whois.dmdomains.dm",do:"whois.nic.do",dz:"whois.nic.dz",ec:"whois.nic.ec",ee:"whois.tld.ee",eu:"whois.eu",fi:"whois.fi",fj:"www.whois.fj",fm:"whois.nic.fm",fo:"whois.nic.fo",fr:"whois.nic.fr",gd:"whois.nic.gd",ge:"whois.nic.ge",gf:"whois.mediaserv.net",gg:"whois.gg",gh:"whois.nic.gh",gi:"whois2.afilias-grs.net",gl:"whois.nic.gl",gp:"whois.nic.gp",gq:"whois.dominio.gq",gs:"whois.nic.gs",gy:"whois.registry.gy",hk:"whois.hkirc.hk",hm:"whois.registry.hm",hn:"whois.nic.hn",hr:"whois.dns.hr",ht:"whois.nic.ht",hu:"whois.nic.hu",id:"whois.id",ie:"whois.weare.ie",il:"whois.isoc.org.il",im:"whois.nic.im",in:"whois.registry.in",io:"whois.nic.io",iq:"whois.cmc.iq",ir:"whois.nic.ir",is:"whois.isnic.is",it:"whois.nic.it",je:"whois.je",jp:"whois.jprs.jp",ke:"whois.kenic.or.ke",kg:"whois.kg",ki:"whois.nic.ki",kn:"whois.nic.kn",kr:"whois.kr",kw:"whois.nic.kw",ky:"whois.kyregistry.ky",kz:"whois.nic.kz",la:"whois.nic.la",lb:"whois.lbdr.org.lb",lc:"whois2.afilias-grs.net",li:"whois.nic.li",lk:"whois.nic.lk",ls:"whois.nic.ls",lt:"whois.domreg.lt",lu:"whois.dns.lu",lv:"whois.nic.lv",ly:"whois.nic.ly",ma:"whois.registre.ma",md:"whois.nic.md",me:"whois.nic.me",mg:"whois.nic.mg",mk:"whois.marnet.mk",ml:"whois.dot.ml",mm:"whois.registry.gov.mm",mn:"whois.nic.mn",mq:"whois.mediaserv.net",mr:"whois.nic.mr",ms:"whois.nic.ms",mt:"whois.nic.org.mt",mu:"whois.nic.mu",mw:"whois.nic.mw",mx:"whois.mx",my:"whois.mynic.my",mz:"whois.nic.mz",na:"whois.na-nic.com.na",nc:"whois.nc",nf:"whois.nic.nf",ng:"whois.nic.net.ng",nl:"whois.domain-registry.nl",no:"whois.norid.no",nu:"whois.iis.nu",nz:"whois.irs.net.nz",om:"whois.registry.om",pe:"kero.yachay.pe",pf:"whois.registry.pf",pk:"whois.pknic.net.pk","co.pl":"whois.co.pl",pl:"whois.dns.pl",pm:"whois.nic.pm",pr:"whois.afilias-srs.net",ps:"whois.pnina.ps",pt:"whois.dns.pt",pw:"whois.nic.pw",qa:"whois.registry.qa",re:"whois.nic.re",ro:"whois.rotld.ro",rs:"whois.rnids.rs","ac.ru":"whois.free.net","edu.ru":"whois.informika.ru","com.ru":"whois.flexireg.net","msk.ru":"whois.flexireg.net","net.ru":"whois.nic.net.ru","nov.ru":"whois.flexireg.net","org.ru":"whois.nic.net.ru","pp.ru":"whois.nic.net.ru","spb.ru":"whois.flexireg.net",ru:"whois.tcinet.ru",rw:"whois.ricta.org.rw",sa:"whois.nic.net.sa",sb:"whois.nic.net.sb",sc:"whois2.afilias-grs.net",sd:"whois.sdnic.sd",se:"whois.iis.se",sg:"whois.sgnic.sg",sh:"whois.nic.sh",si:"whois.register.si",sk:"whois.sk-nic.sk",sl:"whois.nic.sl",sm:"whois.nic.sm",sn:"whois.nic.sn",so:"whois.nic.so",ss:"whois.nic.ss",st:"whois.nic.st","msk.su":"whois.flexireg.net","nov.su":"whois.flexireg.net","spb.su":"whois.flexireg.net",su:"whois.tcinet.ru",sx:"whois.sx",sy:"whois.tld.sy",tc:"whois.nic.tc",td:"whois.nic.td",tf:"whois.nic.tf",tg:"whois.nic.tg",th:"whois.thnic.co.th",tk:"whois.dot.tk",tl:"whois.nic.tl",tm:"whois.nic.tm",tn:"whois.ati.tn",to:"whois.tonic.to",tr:"whois.trabis.gov.tr",tv:"whois.nic.tv",tw:"whois.twnic.net.tw",tz:"whois.tznic.or.tz","biz.ua":"whois.biz.ua","co.ua":"whois.co.ua","pp.ua":"whois.pp.ua",ua:"whois.ua",ug:"whois.co.ug","ac.uk":"whois.nic.ac.uk","gov.uk":"whois.gov.uk",uk:"whois.nic.uk","fed.us":"whois.nic.gov",us:"whois.nic.us",uy:"whois.nic.org.uy",uz:"whois.cctld.uz",vc:"whois2.afilias-grs.net",ve:"whois.nic.ve",vg:"whois.nic.vg",vu:"whois.dnrs.vu",wf:"whois.nic.wf",ws:"whois.website.ws",yt:"whois.nic.yt","ac.za":"whois.ac.za","co.za":"whois.registry.net.za","gov.za":"whois.gov.za","net.za":"net-whois.registry.net.za","org.za":"org-whois.registry.net.za","web.za":"web-whois.registry.net.za",zm:"whois.zicta.zm","xn--2scrj9c":"whois.registry.in","xn--3e0b707e":"whois.kr","xn--3hcrj9c":"whois.registry.in","xn--45br5cyl":"whois.registry.in","xn--45brj9c":"whois.registry.in","xn--4dbrk0ce":"whois.isoc.org.il","xn--80ao21a":"whois.nic.kz","xn--90a3ac":"whois.rnids.rs","xn--90ae":"whois.imena.bg","xn--90ais":"whois.cctld.by","xn--clchc0ea0b2g2a9gcd":"whois.sgnic.sg","xn--d1alf":"whois.marnet.mk","xn--e1a4c":"whois.eu","xn--fiqs8s":"cwhois.cnnic.cn","xn--fiqz9s":"cwhois.cnnic.cn","xn--fpcrj9c3d":"whois.registry.in","xn--fzc2c9e2c":"whois.nic.lk","xn--gecrj9c":"whois.registry.in","xn--h2breg3eve":"whois.registry.in","xn--h2brj9c8c":"whois.registry.in","xn--h2brj9c":"whois.registry.in","xn--j1amh":"whois.dotukr.com","xn--j6w193g":"whois.hkirc.hk","xn--kprw13d":"whois.twnic.net.tw","xn--kpry57d":"whois.twnic.net.tw","xn--lgbbat1ad8j":"whois.nic.dz","xn--mgb9awbf":"whois.registry.om","xn--mgba3a4f16a":"whois.nic.ir","xn--mgbaam7a8h":"whois.aeda.net.ae","xn--mgbah1a3hjkrd":"whois.nic.mr","xn--mgbbh1a71e":"whois.registry.in","xn--mgbbh1a":"whois.registry.in","xn--mgberp4a5d4ar":"whois.nic.net.sa","xn--mgbgu82a":"whois.registry.in","xn--mgbtx2b":"whois.cmc.iq","xn--mgbx4cd0ab":"whois.mynic.my","xn--node":"whois.itdc.ge","xn--o3cw4h":"whois.thnic.co.th","xn--ogbpf8fl":"whois.tld.sy","xn--p1ai":"whois.tcinet.ru","xn--pgbs0dh":"whois.ati.tn","xn--q7ce6a":"whois.nic.la","xn--qxa6a":"whois.eu","xn--rvc1e0am3e":"whois.registry.in","xn--s9brj9c":"whois.registry.in","xn--wgbh1c":"whois.dotmasr.eg","xn--wgbl6a":"whois.registry.qa","xn--xkc2al3hye2a":"whois.nic.lk","xn--xkc2dl3a5ee0h":"whois.registry.in","xn--y9a3aq":"whois.amnic.net","xn--yfro4i67o":"whois.sgnic.sg","xn--ygbi2ammx":"whois.pnina.ps"};var R4;((F)=>{F[F.SOCKS4=0]="SOCKS4";F[F.SOCKS5=1]="SOCKS5"})(R4||={});function j1(D){if(Array.isArray(D))return D.slice();if(typeof D==="object"&&D!==null){let u={};for(let F in D)if(Object.prototype.hasOwnProperty.call(D,F))u[F]=j1(D[F]);return u}return D}var LK=p(h1(),1);async function HK(D){let u=y4+D;try{let F=await qK(u);if(F.ok){let E=(await F.text()).match(/whois:\s+(\S+)/);if(E?.[1])return E[1]}}catch(F){console.error("Error in getting WhoIs server data from IANA",F)}return""}function UK(D){if(D==="com")return"whois.verisign-grs.com";return y1[D]}function k4(D){let u=D.split(".");for(let F=u.length-1;F>0;F--){let $=u.slice(F).join(".");if(y1[$])return $}return u[u.length-1]}function OK(D){return j4[D]}class b8{static iterParse(D,u){let F="",$=null,E="";for(let w=0;w<D.length;w++){let C=D[w];if(C==="\n"||E===":"&&C===" "){if(F.trim()in u)$=F.trim();else if($!==null){let Z=F.trim();if(Z!==""){let M=u[$];if(Array.isArray(M))M.push(Z);else u[$]=Z;$=null}}F=""}else if(C!==":")F=F+C;if(E=C,F==="Record maintained by"||F===">>>")break}return u}static parseData(D,u){if(!u)u={"Domain Name":"","Creation Date":"","Updated Date":"","Registry Expiry Date":"","Domain Status":[],Registrar:""};return u=b8.iterParse(D,u),u}}async function VK(D,u,F,$,E,w){let C=new TextDecoder(E),Z=new TextEncoder;if(!w){let W=new GK.Socket;return new Promise((X,q)=>{try{W.connect({port:$,host:F},()=>{if(u!=="")W.write(Z.encode(`${u} ${D}\r\n`));else W.write(Z.encode(`${D}\r\n`))}),W.on("data",(L)=>{X(C.decode(L))}),W.on("error",(L)=>{q(L)})}catch(L){q(L)}})}let M={proxy:{host:w.ip,port:w.port,type:w.type===1?5:4},command:"connect",destination:{host:F,port:$}};if(w.username&&w.password)M.proxy.userId=w.username,M.proxy.password=w.password;return new Promise((W,X)=>{g4.SocksClient.createConnection(M,(q,L)=>{if(q)X(q);else{if(!L)X(new Error("No socket info received!"));if(u!=="")L?.socket.write(Z.encode(`${u} ${D}\r\n`));else L?.socket.write(Z.encode(`${D}\r\n`));L?.socket.on("data",(U)=>{W(C.decode(U))}),L?.socket.resume()}})})}async function R1(D,u=!1,F=null){let $,E=43,w="",C,Z="utf-8";if(!F)$=k4(D),C=null;else $=F.tld?F.tld:k4(D),Z=F.encoding?F.encoding:"utf-8",C=F.proxy?F.proxy:null,w=F.server?F.server:"",E=F.serverPort?F.serverPort:43;if(w===""){let X=UK($);if(!X){if(Qu.debug(`No WhoIs server found for TLD: ${$}! Attempting IANA WhoIs database for server!`),X=await HK($),!X)return Qu.debug("WhoIs server could not be found!"),{_raw:"",parsedData:null};Qu.debug(`WhoIs sever found for ${$}: ${w}`)}w=X}let W=OK(w)||"";try{Qu.debug(`Attempting WHOIS lookup for ${D} on server ${w}`);let X=await VK(D,W,w,E,Z,C);if(Qu.debug("Raw WHOIS data received:",X),!u){let L=b8.parseData(X,null);return{_raw:X,parsedData:L}}let q=null;if(F?.parseData)q=j1(F.parseData);try{let L=b8.parseData(X,q);return{_raw:X,parsedData:L}}catch(L){return console.error("Error in parsing WhoIs data!",L),{_raw:X,parsedData:null}}}catch(X){return Qu.debug(`Error in WHOIS lookup for ${D} on server ${w}`,X),{_raw:"",parsedData:null}}}function yG(D,u=null){return Qu.debug(`Lookup called for ${D}`),R1(D,!0,u)}async function jG(D,u=!1,F=1,$=!1,E=null){let w=[];if(u){if(F>D.length)F=D.length;for(let C=0;C<D.length;C+=F){let Z=D.slice(C,C+F);w=await Promise.all(Z.map(async(M)=>{return await R1(M,$,E)}))}}else for(let C=0;C<D.length;C++){let Z=await R1(D[C],$,E);w.push(Z)}return w}var export_SocksClient=LK.SocksClient;export{R1 as whois,VK as tcpWhois,yG as lookup,UK as getWhoIsServer,k4 as getTLD,OK as getParameters,HK as findWhoIsServer,jG as batchWhois,b8 as WhoIsParser,export_SocksClient as SocksClient,y1 as SERVERS,R4 as ProxyType,j4 as PARAMETERS,y4 as IANA_CHK_URL};
|
|
161
|
+
const NOT_AN_ARRAY = '${D.array}';`}var hw=Object.getPrototypeOf(async function(){}).constructor,kF=class{variablesCounter=0;#D;#u;#F=new ww;constructor(D,u){this.#D=D,this.#u=u||{convertEmptyStringsToNull:!1}}#C(){this.#F.writeStatement(Sw({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#u.messages})),this.#F.writeStatement(xw(this.#u)),this.#F.writeStatement("let out;")}#$(){this.#F.writeStatement(Tw()),this.#F.writeStatement("return out;")}#E(){this.compileNode(this.#D.schema,this.#F,{type:"root",variableName:"root",outputExpression:"out",fieldPathExpression:"out",wildCardPath:""})}#w(){return new hw("root","meta","refs","messagesProvider","errorReporter",this.#F.toString())}createFieldFor(D,u){switch(u.type){case"array":return Vw(u);case"root":return Hw(u);case"object":return Nw(D,this.variablesCounter,u);case"tuple":return Lw(D,u);case"record":return Iw(u)}}compileNode(D,u,F,$){switch(D.type){case"literal":return new Ow(D,u,this,F,$).compile();case"array":return new Mw(D,u,this,F,$).compile();case"record":return new Aw(D,u,this,F,$).compile();case"object":return new qw(D,u,this,F,$).compile();case"tuple":return new Zw(D,u,this,F,$).compile();case"union":return new Ww(D,u,this,F,$).compile()}}compile(){this.#C(),this.#E(),this.#$();let D=this.#w();return this.variablesCounter=0,this.#F.flush(),D}};function gF(){let D=0,u={};return{toJSON(){return u},track(F){D++;let $=`ref://${D}`;return u[$]=F,$},trackValidation(F){return this.track(F)},trackParser(F){return this.track(F)},trackTransformer(F){return this.track(F)},trackConditional(F){return this.track(F)}}}function x(D,u){let F={validator:D,isAsync:u?.isAsync||D.constructor.name==="AsyncFunction",implicit:u?.implicit??!1};return function(...$){return{rule:F,options:$[0]}}}var o6={};y0(o6,{COTYPE:()=>Rw,IS_OF_TYPE:()=>pD,ITYPE:()=>yw,OTYPE:()=>jw,PARSE:()=>r,UNIQUE_NAME:()=>mD,VALIDATION:()=>xu});var mD=Symbol.for("schema_name"),pD=Symbol.for("is_of_type"),r=Symbol.for("parse"),yw=Symbol.for("opaque_input_type"),jw=Symbol.for("opaque_type"),Rw=Symbol.for("camelcase_opaque_type"),xu=Symbol.for("to_validation"),cu=x((D,u,F)=>{let $=u(F);if(!F.isDefined&&$)F.report(V.required,"required",F)},{implicit:!0}),X8=class extends mu{optional(D){return new gw(this,D)}nullable(){return new kw(this)}transform(D){return new bw(D,this)}},kw=class D extends X8{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.allowNull=!0,E}},gw=class D extends X8{#D;validations;constructor(u,F){super();this.#D=u,this.validations=F||[]}cloneValidations(){return this.validations.map((u)=>{return{options:u.options,rule:u.rule}})}compileValidations(u){return this.validations.map((F)=>{return{ruleFnId:u.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}use(u){return this.validations.push(xu in u?u[xu]():u),this}requiredWhen(u,F,$){if(typeof u==="function")return this.use(cu(u));let E;switch(F){case"=":E=(w)=>w===$;break;case"!=":E=(w)=>w!==$;break;case"in":E=(w)=>$.includes(w);break;case"notIn":E=(w)=>!$.includes(w);break;case">":E=(w)=>w>$;break;case"<":E=(w)=>w<$;break;case">=":E=(w)=>w>=$;break;case"<=":E=(w)=>w<=$}return this.use(cu((w)=>{let C=k.getNestedValue(u,w);return E(C)}))}requiredIfExists(u){let F=Array.isArray(u)?u:[u];return this.use(cu(($)=>{return F.every((E)=>k.exists(k.getNestedValue(E,$)))}))}requiredIfAnyExists(u){return this.use(cu((F)=>{return u.some(($)=>k.exists(k.getNestedValue($,F)))}))}requiredIfMissing(u){let F=Array.isArray(u)?u:[u];return this.use(cu(($)=>{return F.every((E)=>k.isMissing(k.getNestedValue(E,$)))}))}requiredIfAnyMissing(u){return this.use(cu((F)=>{return u.some(($)=>k.isMissing(k.getNestedValue($,F)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.isOptional=!0,E.validations=E.validations.concat(this.compileValidations(F)),E}},bw=class D extends X8{#D;#u;constructor(u,F){super();this.#u=u,this.#D=F}clone(){return new D(this.#u,this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);return E.transformFnId=F.trackTransformer(this.#u),E}},Bu=class extends X8{options;validations;constructor(D,u){super();this.options={bail:!0,allowNull:!1,isOptional:!1,...D},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(xu in D?D[xu]():D),this}bail(D){return this.options.bail=D,this}[r](D,u,F){return{type:"literal",fieldName:D,propertyName:F.toCamelCase?OD(D):D,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?u.trackParser(this.options.parse):void 0,validations:this.compileValidations(u)}}},e6=class D extends Bu{constructor(u,F){super(u,F)}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},M8=x((D,u,F)=>{let $=typeof u.choices==="function"?u.choices(F):u.choices;if(!$.includes(D))F.report(V.enum,"enum",F,{choices:$})}),fu=class D extends Bu{static rules={enum:M8};#D;getChoices(){return this.#D}constructor(u,F,$){super(F,$||[M8({choices:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},Su=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];e.default.extend(CC.default);e.default.extend(uC.default);e.default.extend(FC.default);var _w=x((D,u,F)=>{if(typeof D!=="string"&&typeof D!=="number"){F.report(V.date,"date",F);return}let $=!1,E=u.formats||Su;if(Array.isArray(E))E=[...E],$=E.includes("x");else if(typeof E!=="string")E={...E},$=E.format==="x";let w=$?k.asNumber(D):D,C=$&&!Number.isNaN(w)?e.default(w):e.default(D,E,!0);if(!C.isValid()){F.report(V.date,"date",F);return}F.meta.$value=C,F.meta.$formats=E,F.mutate(C.toDate(),F)}),bF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the equals rule`);if(!w.isSame(Z,$))F.report(V["date.equals"],"date.equals",F,{expectedValue:C,compare:$})}),_F=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="tomorrow"?e.default().add(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the after rule`);if(!w.isAfter(Z,$))F.report(V["date.after"],"date.after",F,{expectedValue:C,compare:$})}),PF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="tomorrow"?e.default().add(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the afterOrEqual rule`);if(!w.isSameOrAfter(Z,$))F.report(V["date.afterOrEqual"],"date.afterOrEqual",F,{expectedValue:C,compare:$})}),mF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="yesterday"?e.default().subtract(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the before rule`);if(!w.isBefore(Z,$))F.report(V["date.before"],"date.before",F,{expectedValue:C,compare:$})}),vF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=u.format||Su,w=F.meta.$value,C=typeof u.expectedValue==="function"?u.expectedValue(F):u.expectedValue,Z=C==="today"?e.default():C==="yesterday"?e.default().subtract(1,"day"):e.default(C,E,!0);if(!Z.isValid())throw new Error(`Invalid datetime value "${C}" value provided to the beforeOrEqual rule`);if(!w.isSameOrBefore(Z,$))F.report(V["date.beforeOrEqual"],"date.beforeOrEqual",F,{expectedValue:C,compare:$})}),cF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSame(Z,$))F.report(V["date.sameAs"],"date.sameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),fF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(E.isSame(Z,$))F.report(V["date.notSameAs"],"date.notSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),nF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isAfter(Z,$))F.report(V["date.afterField"],"date.afterField",F,{otherField:u.otherField,expectedValue:C,compare:$})}),rF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSameOrAfter(Z,$))F.report(V["date.afterOrSameAs"],"date.afterOrSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),dF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isBefore(Z,$))F.report(V["date.beforeField"],"date.beforeField",F,{otherField:u.otherField,expectedValue:C,compare:$})}),lF=x((D,u,F)=>{if(!F.meta.$value)return;let $=u.compare||"day",E=F.meta.$value,w=u.format||F.meta.$formats,C=k.getNestedValue(u.otherField,F),Z=e.default(C,w,!0);if(!Z.isValid())return;if(!E.isSameOrBefore(Z,$))F.report(V["date.beforeOrSameAs"],"date.beforeOrSameAs",F,{otherField:u.otherField,expectedValue:C,compare:$})}),pF=x((D,u,F)=>{if(!F.meta.$value)return;let E=F.meta.$value.day();if(E!==0&&E!==6)F.report(V["date.weekend"],"date.weekend",F)}),iF=x((D,u,F)=>{if(!F.meta.$value)return;let E=F.meta.$value.day();if(E===0||E===6)F.report(V["date.weekday"],"date.weekday",F)}),c2=class D extends Bu{static rules={equals:bF,after:_F,afterOrEqual:PF,before:mF,beforeOrEqual:vF,sameAs:cF,notSameAs:fF,afterField:nF,afterOrSameAs:rF,beforeField:dF,beforeOrSameAs:lF,weekend:pF,weekday:iF};[mD]="vine.date";[pD]=(u)=>{if(typeof u!=="string")return!1;return DC.default(u,this.options.formats||Su,!0).isValid()};constructor(u,F){super(u,F||[_w(u||{})])}equals(u,F){return this.use(bF({expectedValue:u,...F}))}after(u,F){return this.use(_F({expectedValue:u,...F}))}afterOrEqual(u,F){return this.use(PF({expectedValue:u,...F}))}before(u,F){return this.use(mF({expectedValue:u,...F}))}beforeOrEqual(u,F){return this.use(vF({expectedValue:u,...F}))}sameAs(u,F){return this.use(cF({otherField:u,...F}))}notSameAs(u,F){return this.use(fF({otherField:u,...F}))}afterField(u,F){return this.use(nF({otherField:u,...F}))}afterOrSameAs(u,F){return this.use(rF({otherField:u,...F}))}beforeField(u,F){return this.use(dF({otherField:u,...F}))}beforeOrSameAs(u,F){return this.use(lF({otherField:u,...F}))}weekend(){return this.use(pF())}weekday(){return this.use(iF())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},$C=class D{#D;#u=(u,F)=>{F.report(V.union,"union",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[r](u,F,$){return{type:"union",fieldName:u,propertyName:$.toCamelCase?OD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map((E)=>E[r](u,F,$))}}},EC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[r](D,u,F){return{conditionalFnRefId:u.trackConditional(this.#u),schema:this.#D[r](D,u,F)}}};function f2(D){return new $C(D)}f2.if=function D(u,F){return new EC(u,F)};f2.else=function D(u){return new EC(()=>!0,u)};var W0=class extends mu{optional(){return new mw(this)}nullable(){return new Pw(this)}},Pw=class D extends W0{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);if(E.type!=="union")E.allowNull=!0;return E}},mw=class D extends W0{#D;constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){let E=this.#D[r](u,F,$);if(E.type!=="union")E.isOptional=!0;return E}},Q0=class extends W0{options;validations;constructor(D,u){super();this.options=D||{bail:!0,allowNull:!1,isOptional:!1},this.validations=u||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((u)=>{return{ruleFnId:D.track({validator:u.rule.validator,options:u.options}),implicit:u.rule.implicit,isAsync:u.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(xu in D?D[xu]():D),this}bail(D){return this.options.bail=D,this}},wC=class D extends Q0{#D;#u=!1;[mD]="vine.array";[pD]=(u)=>{return Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}allowUnknownProperties(){return this.#u=!0,this}clone(){let u=new D(this.#D.map((F)=>F.clone()),this.cloneOptions(),this.cloneValidations());if(this.#u)u.allowUnknownProperties();return u}[r](u,F,$){return{type:"tuple",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,allowUnknownProperties:this.#u,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F),properties:this.#D.map((E,w)=>E[r](String(w),F,$))}}},tF=x((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(V["array.minLength"],"array.minLength",F,u)}),sF=x((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(V["array.maxLength"],"array.maxLength",F,u)}),aF=x((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(V["array.fixedLength"],"array.fixedLength",F,u)}),oF=x((D,u,F)=>{if(!F.isValid)return;if(D.length<=0)F.report(V.notEmpty,"notEmpty",F)}),eF=x((D,u,F)=>{if(!F.isValid)return;if(!k.isDistinct(D,u.fields))F.report(V.distinct,"distinct",F,u)}),D6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.filter(($)=>k.exists($)&&$!==""),F)}),BC=class D extends Q0{static rules={compact:D6,notEmpty:oF,distinct:eF,minLength:tF,maxLength:sF,fixedLength:aF};#D;[mD]="vine.array";[pD]=(u)=>{return Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}minLength(u){return this.use(tF({min:u}))}maxLength(u){return this.use(sF({max:u}))}fixedLength(u){return this.use(aF({size:u}))}notEmpty(){return this.use(oF())}distinct(u){return this.use(eF({fields:u}))}compact(){return this.use(D6())}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[r](u,F,$){return{type:"array",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[r]("*",F,$),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},vw=class D extends W0{#D;[mD]="types.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u){super();this.#D=u}clone(){return new D(this.#D.clone())}[r](u,F,$){return $.toCamelCase=!0,this.#D[r](u,F,$)}},YC=class D extends Q0{#D;#u=[];#F=!1;[mD]="vine.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}getProperties(){return Object.keys(this.#D).reduce((u,F)=>{return u[F]=this.#D[F].clone(),u},{})}allowUnknownProperties(){return this.#F=!0,this}merge(u){return this.#u.push(u),this}clone(){let u=new D(this.getProperties(),this.cloneOptions(),this.cloneValidations());if(this.#u.forEach((F)=>u.merge(F)),this.#F)u.allowUnknownProperties();return u}toCamelCase(){return new vw(this)}[r](u,F,$){return{type:"object",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,allowUnknownProperties:this.#F,validations:this.compileValidations(F),properties:Object.keys(this.#D).map((E)=>{return this.#D[E][r](E,F,$)}),groups:this.#u.map((E)=>{return E[r](F,$)})}}},u6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length<u.min)F.report(V["record.minLength"],"record.minLength",F,u)}),F6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length>u.max)F.report(V["record.maxLength"],"record.maxLength",F,u)}),C6=x((D,u,F)=>{if(!F.isValid)return;if(Object.keys(D).length!==u.size)F.report(V["record.fixedLength"],"record.fixedLength",F,u)}),$6=x((D,u,F)=>{if(!F.isValid)return;u(Object.keys(D),F)}),JC=class D extends Q0{static rules={maxLength:F6,minLength:u6,fixedLength:C6,validateKeys:$6};#D;[mD]="vine.object";[pD]=(u)=>{return u!==null&&typeof u==="object"&&!Array.isArray(u)};constructor(u,F,$){super(F,$);this.#D=u}minLength(u){return this.use(u6({min:u}))}maxLength(u){return this.use(F6({max:u}))}fixedLength(u){return this.use(C6({size:u}))}validateKeys(...u){return this.use($6(...u))}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[r](u,F,$){return{type:"record",fieldName:u,propertyName:$.toCamelCase?OD(u):u,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[r]("*",F,$),parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},E6=x((D,u,F)=>{if(typeof D!=="string")F.report(V.string,"string",F)}),w6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isEmail(D,u))F.report(V.email,"email",F)}),B6=x((D,u,F)=>{if(!F.isValid)return;let $=u&&typeof u==="function"?u(F):u,E=$?.locale||"any";if(!k.isMobilePhone(D,E,$))F.report(V.mobile,"mobile",F)}),Y6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isIP(D,u?.version))F.report(V.ipAddress,"ipAddress",F)}),J6=x((D,u,F)=>{if(!F.isValid)return;if(!u.test(D))F.report(V.regex,"regex",F)}),Z6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isHexColor(D))F.report(V.hexCode,"hexCode",F)}),K6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isURL(D,u))F.report(V.url,"url",F)}),M6=x(async(D,u,F)=>{if(!F.isValid)return;if(!await k.isActiveURL(D))F.report(V.activeUrl,"activeUrl",F)}),X6=x((D,u,F)=>{if(!F.isValid)return;let $="a-zA-Z";if(u){if(u.allowSpaces)$+="\\s";if(u.allowDashes)$+="-";if(u.allowUnderscores)$+="_"}if(!new RegExp(`^[${$}]+\$`).test(D))F.report(V.alpha,"alpha",F)}),W6=x((D,u,F)=>{if(!F.isValid)return;let $="a-zA-Z0-9";if(u){if(u.allowSpaces)$+="\\s";if(u.allowDashes)$+="-";if(u.allowUnderscores)$+="_"}if(!new RegExp(`^[${$}]+\$`).test(D))F.report(V.alphaNumeric,"alphaNumeric",F)}),Q6=x((D,u,F)=>{if(!F.isValid)return;if(D.length<u.min)F.report(V.minLength,"minLength",F,u)}),A6=x((D,u,F)=>{if(!F.isValid)return;if(D.length>u.max)F.report(V.maxLength,"maxLength",F,u)}),z6=x((D,u,F)=>{if(!F.isValid)return;if(D.length!==u.size)F.report(V.fixedLength,"fixedLength",F,u)}),G6=x((D,u,F)=>{if(!F.isValid)return;if(!D.endsWith(u.substring))F.report(V.endsWith,"endsWith",F,u)}),q6=x((D,u,F)=>{if(!F.isValid)return;if(!D.startsWith(u.substring))F.report(V.startsWith,"startsWith",F,u)}),H6=x((D,u,F)=>{if(!F.isValid)return;if(k.getNestedValue(u.otherField,F)!==D){F.report(V.sameAs,"sameAs",F,u);return}}),U6=x((D,u,F)=>{if(!F.isValid)return;if(k.getNestedValue(u.otherField,F)===D){F.report(V.notSameAs,"notSameAs",F,u);return}}),O6=x((D,u,F)=>{if(!F.isValid)return;let $=u?.confirmationField||`${F.name}_confirmation`;if(F.parent[$]!==D){F.report(V.confirmed,"confirmed",F,{otherField:$});return}}),V6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.trim(),F)}),L6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(KC.default.default(D,u),F)}),T6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleUpperCase(u),F)}),N6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(D.toLocaleLowerCase(u),F)}),I6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(OD(D),F)}),x6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(ZC.default.default(D),F)}),S6=x((D,u,F)=>{if(!F.isValid)return;F.mutate(_2(D,u),F)}),h6=x((D,u,F)=>{if(!F.isValid)return;if(!(typeof u.choices==="function"?u.choices(F):u.choices).includes(D)){F.report(V.in,"in",F,u);return}}),y6=x((D,u,F)=>{if(!F.isValid)return;if((typeof u.list==="function"?u.list(F):u.list).includes(D)){F.report(V.notIn,"notIn",F,u);return}}),j6=x((D,u,F)=>{if(!F.isValid)return;let $=u?typeof u==="function"?u(F)?.provider||[]:u.provider:[];if(!$.length){if(!k.isCreditCard(D))F.report(V.creditCard,"creditCard",F,{providersList:"credit"})}else if(!$.find((w)=>k.isCreditCard(D,{provider:w})))F.report(V.creditCard,"creditCard",F,{providers:$,providersList:$.join("/")})}),R6=x((D,u,F)=>{if(!F.isValid)return;let $=typeof u==="function"?u(F).countryCode:u.countryCode;if(!$.find((w)=>k.isPassportNumber(D,w)))F.report(V.passport,"passport",F,{countryCodes:$})}),k6=x((D,u,F)=>{if(!F.isValid)return;let $=u?typeof u==="function"?u(F)?.countryCode||[]:u.countryCode:[];if(!$.length){if(!k.isPostalCode(D,"any"))F.report(V.postalCode,"postalCode",F)}else if(!$.find((w)=>k.isPostalCode(D,w)))F.report(V.postalCode,"postalCode",F,{countryCodes:$})}),g6=x((D,u,F)=>{if(!F.isValid)return;if(!u||!u.version){if(!k.isUUID(D))F.report(V.uuid,"uuid",F)}else if(!u.version.find((E)=>k.isUUID(D,E)))F.report(V.uuid,"uuid",F,u)}),b6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isAscii(D))F.report(V.ascii,"ascii",F)}),_6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isIBAN(D))F.report(V.iban,"iban",F)}),P6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isJWT(D))F.report(V.jwt,"jwt",F)}),m6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isLatLong(D))F.report(V.coordinates,"coordinates",F)}),W8=class D extends Bu{static rules={in:h6,jwt:P6,url:K6,iban:_6,uuid:g6,trim:V6,email:w6,alpha:X6,ascii:b6,notIn:y6,regex:J6,escape:x6,sameAs:H6,mobile:B6,string:E6,hexCode:Z6,passport:R6,endsWith:G6,confirmed:O6,activeUrl:M6,minLength:Q6,notSameAs:U6,maxLength:A6,ipAddress:Y6,creditCard:j6,postalCode:k6,startsWith:q6,toUpperCase:T6,toLowerCase:N6,toCamelCase:I6,fixedLength:z6,coordinates:m6,normalizeUrl:S6,alphaNumeric:W6,normalizeEmail:L6};[mD]="vine.string";[pD]=(u)=>{return typeof u==="string"};constructor(u,F){super(u,F||[E6()])}url(...u){return this.use(K6(...u))}activeUrl(){return this.use(M6())}email(...u){return this.use(w6(...u))}mobile(...u){return this.use(B6(...u))}ipAddress(u){return this.use(Y6(u?{version:u}:void 0))}hexCode(){return this.use(Z6())}regex(u){return this.use(J6(u))}alpha(u){return this.use(X6(u))}alphaNumeric(u){return this.use(W6(u))}minLength(u){return this.use(Q6({min:u}))}maxLength(u){return this.use(A6({max:u}))}fixedLength(u){return this.use(z6({size:u}))}confirmed(u){return this.use(O6(u))}trim(){return this.use(V6())}normalizeEmail(u){return this.use(L6(u))}toUpperCase(){return this.use(T6())}toLowerCase(){return this.use(N6())}toCamelCase(){return this.use(I6())}escape(){return this.use(x6())}normalizeUrl(...u){return this.use(S6(...u))}startsWith(u){return this.use(q6({substring:u}))}endsWith(u){return this.use(G6({substring:u}))}sameAs(u){return this.use(H6({otherField:u}))}notSameAs(u){return this.use(U6({otherField:u}))}in(u){return this.use(h6({choices:u}))}notIn(u){return this.use(y6({list:u}))}creditCard(...u){return this.use(j6(...u))}passport(...u){return this.use(R6(...u))}postalCode(...u){return this.use(k6(...u))}uuid(...u){return this.use(g6(...u))}ascii(){return this.use(b6())}iban(){return this.use(_6())}jwt(){return this.use(P6())}coordinates(){return this.use(m6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},v6=x((D,u,F)=>{let $=u.strict?D:k.asNumber(D);if(typeof $!=="number"||Number.isNaN($)||$===Number.POSITIVE_INFINITY||$===Number.NEGATIVE_INFINITY){F.report(V.number,"number",F);return}F.mutate($,F)}),c6=x((D,u,F)=>{if(!F.isValid)return;if(D<u.min)F.report(V.min,"min",F,u)}),f6=x((D,u,F)=>{if(!F.isValid)return;if(D>u.max)F.report(V.max,"max",F,u)}),n6=x((D,u,F)=>{if(!F.isValid)return;if(D<u.min||D>u.max)F.report(V.range,"range",F,u)}),r6=x((D,u,F)=>{if(!F.isValid)return;if(D<0)F.report(V.positive,"positive",F)}),d6=x((D,u,F)=>{if(!F.isValid)return;if(D>=0)F.report(V.negative,"negative",F)}),l6=x((D,u,F)=>{if(!F.isValid)return;if(!k.isDecimal(String(D),{force_decimal:u.range[0]!==0,decimal_digits:u.range.join(",")}))F.report(V.decimal,"decimal",F,{digits:u.range.join("-")})}),p6=x((D,u,F)=>{if(!F.isValid)return;if(!Number.isInteger(D))F.report(V.withoutDecimals,"withoutDecimals",F)}),i6=x((D,u,F)=>{if(!F.isValid)return;if(!u.values.includes(D))F.report(V["number.in"],"in",F,u)}),nu=class D extends Bu{static rules={in:i6,max:f6,min:c6,range:n6,number:v6,decimal:l6,negative:d6,positive:r6,withoutDecimals:p6};[mD]="vine.number";[pD]=(u)=>{let F=k.asNumber(u);return!Number.isNaN(F)};constructor(u,F){super(u,F||[v6(u||{})])}min(u){return this.use(c6({min:u}))}max(u){return this.use(f6({max:u}))}range(u){return this.use(n6({min:u[0],max:u[1]}))}positive(){return this.use(r6())}negative(){return this.use(d6())}decimal(u){return this.use(l6({range:Array.isArray(u)?u:[u]}))}withoutDecimals(){return this.use(p6())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}in(u){return this.use(i6({values:u}))}},t6=x((D,u,F)=>{let $=u.strict===!0?D:k.asBoolean(D);if(typeof $!=="boolean"){F.report(V.boolean,"boolean",F);return}F.mutate($,F)}),ru=class D extends Bu{static rules={boolean:t6};[mD]="vine.boolean";[pD]=(u)=>{return typeof(this.options.strict===!0?u:k.asBoolean(u))==="boolean"};constructor(u,F){super(u,F||[t6(u||{})])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},s6=x((D,u,F)=>{let $=D;if(typeof u.expectedValue==="boolean")$=k.asBoolean(D);else if(typeof u.expectedValue==="number")$=k.asNumber(D);if($!==u.expectedValue){F.report(V.literal,"literal",F,u);return}F.mutate($,F)}),MC=class D extends Bu{static rules={equals:s6};#D;constructor(u,F,$){super(F,$||[s6({expectedValue:u})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},cw=["on","1","yes","true",!0,1],a6=x((D,u,F)=>{if(!cw.includes(D))F.report(V.accepted,"accepted",F)}),XC=class D extends Bu{static rules={accepted:a6};constructor(u,F){super(u,F||[a6()])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},fw=class D{#D;#u=(u,F)=>{F.report(V.unionGroup,"unionGroup",F)};constructor(u){this.#D=u}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}otherwise(u){return this.#u=u,this}[r](u,F){return{type:"group",elseConditionalFnRefId:u.trackConditional(this.#u),conditions:this.#D.map(($)=>$[r](u,F))}}},WC=class{#D;#u;constructor(D,u){this.#D=u,this.#u=D}[r](D,u){return{schema:{type:"sub_object",properties:Object.keys(this.#D).map((F)=>{return this.#D[F][r](F,D,u)}),groups:[]},conditionalFnRefId:D.trackConditional(this.#u)}}};function n2(D){return new fw(D)}n2.if=function D(u,F){return new WC(u,F)};n2.else=function D(u){return new WC(()=>!0,u)};var nw=class D extends Bu{static rules={enum:M8};#D;constructor(u,F,$){super(F,$||[M8({choices:Object.values(u)})]);this.#D=u}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},rw=class D{#D;#u=(u,F)=>{F.report(V.unionOfTypes,"unionOfTypes",F)};constructor(u){this.#D=u}otherwise(u){return this.#u=u,this}clone(){let u=new D(this.#D);return u.otherwise(this.#u),u}[r](u,F,$){return{type:"union",fieldName:u,propertyName:$.toCamelCase?OD(u):u,elseConditionalFnRefId:F.trackConditional(this.#u),conditions:this.#D.map((E)=>{return{conditionalFnRefId:F.trackConditional((w,C)=>{return E[pD](w,C)}),schema:E[r](u,F,$)}})}}},dw=class extends mu{group=n2;union=f2;string(){return new W8}boolean(D){return new ru(D)}accepted(){return new XC}number(D){return new nu(D)}date(D){return new c2(D)}literal(D){return new MC(D)}object(D){return new YC(D)}array(D){return new BC(D)}tuple(D){return new wC(D)}record(D){return new JC(D)}enum(D){if(Array.isArray(D)||typeof D==="function")return new fu(D);return new nw(D)}any(){return new e6}unionOfTypes(D){let u=new Set;return D.forEach((F)=>{if(!F[pD]||!F[mD])throw new Error(`Cannot use "${F.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if(u.has(F[mD]))throw new Error(`Cannot use duplicate schema "${F[mD]}". "vine.unionOfTypes" needs distinct schema types only`);u.add(F[mD])}),u.clear(),new rw(D)}},lw={required:V.required,array:V.array,object:V.object},v2=class{#D;messagesProvider;errorReporter;#u(D){let u=gF();return{compilerNode:{type:"root",schema:D[r]("",u,{toCamelCase:!1})},refs:u.toJSON()}}constructor(D,u){let{compilerNode:F,refs:$}=this.#u(D);this.#D={schema:F,refs:$};let E=u.metaDataValidator,w=new kF(F,{convertEmptyStringsToNull:u.convertEmptyStringsToNull,messages:lw}).compile();if(this.errorReporter=u.errorReporter,this.messagesProvider=u.messagesProvider,E)this.validate=(C,Z)=>{let M=Z??{},W=M.meta??{},X=M.errorReporter??this.errorReporter,q=M.messagesProvider??this.messagesProvider;return E(W),w(C,W,$,q,X())};else this.validate=(C,Z)=>{let M=Z??{},W=M.meta??{},X=M.errorReporter??this.errorReporter,q=M.messagesProvider??this.messagesProvider;return w(C,W,$,q,X())}}async tryValidate(D,...[u]){try{return[null,await this.validate(D,u)]}catch(F){if(F instanceof L2)return[F,null];throw F}}toJSON(){let{schema:D,refs:u}=this.#D;return{schema:structuredClone(D),refs:u}}},QC=class extends dw{messagesProvider=new Z0(V,F3);errorReporter=()=>new T2;convertEmptyStringsToNull=!1;helpers=k;createRule=x;compile(D){return new v2(D,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(D){return{compile:(u)=>{return new v2(u,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter,metaDataValidator:D})}}}validate(D){return this.compile(D.schema).validate(D.data,D)}tryValidate(D){return this.compile(D.schema).tryValidate(D.data,D)}},pw=new QC,y=pw;var AC={APP_NAME:y.string(),APP_ENV:y.enum(["local","dev","stage","prod"]),APP_KEY:y.string(),APP_URL:y.string(),PORT:y.number(),PORT_BACKEND:y.number(),PORT_ADMIN:y.number(),PORT_LIBRARY:y.number(),PORT_DESKTOP:y.number(),PORT_EMAIL:y.number(),PORT_DOCS:y.number(),PORT_INSPECT:y.number(),PORT_API:y.number(),PORT_SYSTEM_TRAY:y.number(),APP_MAINTENANCE:y.boolean(),DEBUG:y.boolean(),API_PREFIX:y.string(),DOCS_PREFIX:y.string(),DB_CONNECTION:y.enum(["mysql","sqlite","postgres"]),DB_HOST:y.string(),DB_PORT:y.number(),DB_DATABASE:y.string(),DB_USERNAME:y.string(),DB_PASSWORD:y.string(),AWS_ACCOUNT_ID:y.string(),AWS_ACCESS_KEY_ID:y.string(),AWS_SECRET_ACCESS_KEY:y.string(),AWS_DEFAULT_REGION:y.string(),AWS_DEFAULT_PASSWORD:y.string(),MAIL_MAILER:y.enum(["ses","sendmail","log","smtp"]),MAIL_HOST:y.string(),MAIL_PORT:y.number(),MAIL_USERNAME:y.string(),MAIL_PASSWORD:y.string(),MAIL_ENCRYPTION:y.string(),MAIL_FROM_NAME:y.string(),MAIL_FROM_ADDRESS:y.string(),SEARCH_ENGINE_DRIVER:y.enum(["meilisearch","algolia","typesense"]),MEILISEARCH_HOST:y.string(),MEILISEARCH_KEY:y.string(),FRONTEND_APP_ENV:y.enum(["development","staging","production"]),FRONTEND_APP_URL:y.string()};var iw={APP_ENV:["local","dev","development","staging","prod","production"],DB_CONNECTION:["mysql","sqlite","postgres","dynamodb"],MAIL_MAILER:["smtp","mailgun","ses","postmark","sendmail","log"],SEARCH_ENGINE_DRIVER:["opensearch"],FRONTEND_APP_ENV:["development","staging","production"]},tw=Object.entries(AC).reduce((D,[u,F])=>{let $;switch(typeof F){case"string":$=y.string();break;case"number":$=y.number();break;case"boolean":$=y.boolean();break;default:if(Array.isArray(F)){$=y.enum(F);break}if(typeof F==="object"){let w=Symbol.for("schema_name"),C=F[w];if(C==="vine.string"){$=y.string();break}if(C==="vine.number"){$=y.number();break}if(C==="vine.boolean"){$=y.boolean();break}if(!C){$=y.enum(iw.APP_ENV);break}console.error("Unknown env value type",typeof F)}throw new Error(`Invalid env value for ${u}`)}let E=u;return D[E]=$,D},{}),PQ=y.object(tw);var aw={get:(D,u)=>{let F=D[u];if(typeof F==="string"&&/^\d+$/.test(F)&&u!=="AWS_ACCOUNT_ID")return Number(F);if(typeof F==="string"&&/^true|false$/.test(F))return F==="true";if(F instanceof fu)return D[u];if(F instanceof ru)return!!D[u];if(F instanceof nu)return Number(D[u]);return F}};function ow(){return typeof Bun!=="undefined"?Bun.env:sw.env}var j=new Proxy(ow(),aw);var zC={name:j.APP_NAME??"Stacks",description:"Stacks is a full-stack framework for building modern web applications.",env:j.APP_ENV??"local",url:j.APP_URL??"stacks.localhost",redirectUrls:["stacksjs.com"],debug:j.DEBUG??!1,key:j.APP_KEY,maintenanceMode:j.APP_MAINTENANCE??!1,docMode:!1,timezone:"America/Los_Angeles",locale:"en",fallbackLocale:"en",cipher:"aes-256-cbc"};var GC={driver:"dynamodb",prefix:"stacks",ttl:3600,drivers:{dynamodb:{key:j.AWS_ACCESS_KEY_ID||"",secret:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1",table:"cache",endpoint:""},memcached:{persistent_id:"",sasl:["",""],options:{},servers:[{host:"127.0.0.1",port:11211,weight:100}]},redis:{connection:"cache",host:"127.0.0.1",port:6379,password:"",username:"stacks"}}};var qC={name:"My Custom CLI",command:"custom-cli",description:"This is an example command to illustrate how to create your own commands. Check out `../app/commands` for more.",deploy:!0};var Q8={firewall:{enabled:!0,countryCodes:["RU","IR"],ipAddresses:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0,queryString:[],httpHeaders:[]}};var HC={sites:{root:"stacksjs.org",path:"dist",modals:{domain:"modals.stacksjs.org",path:"dist"},stepper:{domain:"stepper.stacksjs.org",path:"dist"},notification:{domain:"notification.stacksjs.org",path:"dist"},docs:{domain:"docs.stacksjs.org",path:"dist"},tlsx:{domain:"tlsx.stacksjs.org",path:"dist"},dtsx:{domain:"dtsx.stacksjs.org",path:"dist"},spreadsheet:{domain:"spreadsheet.stacksjs.org",path:"dist"}},infrastructure:{type:"serverless",driver:"aws",firewall:Q8.firewall,environments:["production","staging","development"],storage:{},api:{prefix:j.API_PREFIX||"api",description:"My awesome Stacks API",deploy:!0,memorySize:512,prewarm:10,timeout:30},cdn:{compress:!0,allowedMethods:"ALL",cachedMethods:"GET_HEAD",originShieldRegion:"us-east-1",minTtl:0,defaultTtl:86400,maxTtl:31536000,cookieBehavior:"none",allowList:{cookies:[],headers:[],queryStrings:[]},realtimeLogs:{enabled:!0,samplingRate:1}},fileSystem:!0}};var UC={default:j.DB_CONNECTION||"sqlite",connections:{sqlite:{database:j.DB_DATABASE||"database/stacks.sqlite",prefix:""},dynamodb:{key:j.AWS_ACCESS_KEY_ID||"",secret:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1",prefix:j.DB_DATABASE||"stacks",endpoint:"http://localhost",port:j.DB_PORT||8000},mysql:{name:j.DB_DATABASE||"stacks",host:j.DB_HOST||"127.0.0.1",port:j.DB_PORT||3306,username:j.DB_USERNAME||"root",password:j.DB_PASSWORD||"",prefix:""},postgres:{name:j.DB_DATABASE||"stacks",host:j.DB_HOST||"127.0.0.1",port:j.DB_PORT||3306,username:j.DB_USERNAME||"",password:j.DB_PASSWORD||"",prefix:""}},migrations:"migrations",migrationLocks:"migration_locks"};var OC={a:[{name:j.APP_URL||"",address:"10.0.0.1",ttl:300},{name:"www",address:"@",ttl:300}],aaaa:[],cname:[],mx:[],txt:[],nameservers:[]};var VC={from:{name:j.MAIL_FROM_NAME||"Stacks",address:j.MAIL_FROM_ADDRESS||"no-reply@stacksjs.org"},mailboxes:["chris@stacksjs.org","blake@stacksjs.org","glenn@stacksjs.org"],url:j.APP_URL||"http://localhost:3000",charset:"UTF-8",server:{scan:!0}};var LC={messages:{string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",regex:"The {{ field }} field format is invalid",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ascii:"The {{ field }} field must only contain ASCII characters",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",hexCode:"The {{ field }} field must be a valid hex color code",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",mobile:"The {{ field }} field must be a valid mobile phone number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must not have decimal places",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field"}};var TC={hooks:{"pre-commit":"lint-staged"},scopes:["","ci","deps","dx","release","docs","test","core","actions","arrays","auth","build","cache","cli","cloud","collections","config","database","datetime","docs","errors","git","lint","x-ray","modules","notifications","objects","path","realtime","router","buddy","security","server","storage","strings","tests","types","ui","utils"],messages:{type:"Select the type of change that you\u2019re committing:",scope:"Select the SCOPE of this change (optional):",customScope:"Select the SCOPE of this change:",subject:"Write a SHORT, IMPERATIVE tense description of the change:\n",body:'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',breaking:'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',footerPrefixesSelect:"Select the ISSUES type of the change list by this change (optional):",customFooterPrefixes:"Input ISSUES prefix:",footer:"List any ISSUES by this change. E.g.: #31, #34:\n",confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don\u2019t modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]};var NC={driver:"argon2",bcrypt:{rounds:10,cost:4},argon2:{memory:65536,threads:1,time:1}};var IC={name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"Chris Breuer",contributors:["Chris Breuer <chris@stacksjs.org>"],defaultLanguage:"en",releaseable:!0,vueComponents:{name:"hello-world-vue",description:"Your Vue component library description",keywords:["component","library","vue","vite","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}};var xC={logsPath:S0("logs/stacks.log"),deploymentsPath:S0("logs/deployments.log")};var SC={default:"email"};var hC={driver:"stripe",stripe:{publishableKey:j.STRIPE_PUBLISHABLE_KEY||"",secretKey:j.STRIPE_SECRET_KEY||""}};var yC={frontend:j.PORT??3000,backend:j.PORT_BACKEND??3001,admin:j.PORT_ADMIN??3002,library:j.PORT_LIBRARY??3003,desktop:j.PORT_DESKTOP??3004,email:j.PORT_EMAIL??3005,docs:j.PORT_DOCS??3006,inspect:j.PORT_INSPECT??3007,api:j.PORT_API??3008,systemTray:j.PORT_SYSTEM_TRAY??3009,database:3010};var jC={default:"sync",connections:{sync:{driver:"sync"},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:"us-east-1"}}};var RC={plans:[{productName:"Stacks Hobby",description:"All the Stacks features.",pricing:[{key:"stacks_hobby_monthly",price:3900,interval:"month",currency:"usd"},{key:"stacks_hobby_yearly",price:37900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}},{productName:"Stacks Pro",description:"All the Stacks features, including being able to invite team members.",pricing:[{key:"stacks_pro_monthly",price:5900,interval:"month",currency:"usd"},{key:"stacks_pro_yearly",price:57900,interval:"year",currency:"usd"}],metadata:{createdBy:"admin",version:"1.0.0"}}],webhook:{endpoint:"/webhooks/stripe",secret:""},currencies:["usd"],coupons:[{code:"SUMMER2024",amountOff:500,duration:"once"}],products:[{name:"Stacks Pro",description:"All the Stacks features.",images:["url_to_image"]}]};var kC={driver:"opensearch"};var gC={aws:{accountId:j.AWS_ACCOUNT_ID||"",appId:j.AWS_ACCESS_KEY_ID||"",apiKey:j.AWS_SECRET_ACCESS_KEY||"",region:j.AWS_DEFAULT_REGION||"us-east-1"},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},lemonSqueezy:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}};var bC={driver:"s3"};var _C={name:"Stacks",members:{chris:"chris@stacksjs.org",blake:"blake@stacksjs.org",zoltan:"zoltan@stacksjs.org",freddy:"freddy@stacksjs.org",glenn:"glenn@stacksjs.org",dorell:"dorell@stacksjs.org",avery:"avery@stacksjs.org",adelino:"adelino@stacksjs.org"}};var PC={shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["heroicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}},theme:{colors:{veryCool:"#0000ff",brand:{primary:"hsl(var(--hue, 217) 78% 51%)"}}}};var ew={ai:p1,analytics:i1,app:zC,cache:GC,cli:qC,cloud:HC,database:UC,dns:OC,email:VC,errors:LC,git:TC,hashing:NC,library:IC,logging:xC,notification:SC,queue:jC,payment:hC,ports:yC,saas:RC,searchEngine:kC,security:Q8,services:gC,storage:bC,team:_C,ui:PC},r2=ew;async function mC(D){if(!D?.port)D={port:3000};return console.log("Creating local tunnel",D.port),"localTunnel"}async function Au(D){return await mC({port:D})}async function DB({domain:D=BD.app.url||"stacks",type:u="frontend",localhost:F=!1,https:$=void 0,network:E=void 0}={}){let w=D.replace(/\.[^.]+$/,".localhost");switch(u){case"frontend":if(E)return await Au(BD.ports?.frontend||3000);if(F)return`http://localhost:${BD.ports?.frontend}`;break;case"backend":if(E)return await Au(BD.ports?.backend||3001);if(F)return`http://localhost:${BD.ports?.backend}`;w=`api.${w}`;break;case"admin":if(E)return await Au(BD.ports?.admin||3002);if(F)return`http://localhost:${BD.ports?.admin}`;w=`admin.${w}`;break;case"library":if(E)return await Au(BD.ports?.library||3003);if(F)return`http://localhost:${BD.ports?.library}`;w=`libs.${w}`;break;case"email":if(E)return await Au(BD.ports?.email||3005);if(F)return`http://localhost:${BD.ports?.email}`;w=`email.${w}`;break;case"desktop":if(E)return await Au(BD.ports?.desktop||3004);if(F)return`http://localhost:${BD.ports?.desktop}`;w=`desktop.${w}`;break;case"docs":if(E)return await Au(BD.ports?.docs||3006);if(F)return`http://localhost:${BD.ports?.docs}`;w=`docs.${w}`;break;case"inspect":if(E)return await Au(BD.ports?.inspect||3007);if(F)return`http://localhost:${BD.ports?.inspect}`;w=`inspect.${w}`;break;default:if(F)return`http://localhost:${BD.ports?.frontend}`}if($)return`https://${w}`;return`http://${w}`}function uB(D){return D}function FB(D){return D}function CB(D){return D}function $B(D){return D}function EB(D){return D}function wB(D){return D}function BB(D){return D}function YB(D){return D}function JB(D){return D}function ZB(D){return D}function KB(D){return D}function MB(D){return D}function XB(D){return D}function WB(D){return D}function QB(D){return D}function AB(D){return D}function zB(D){return D}function GB(D){return D}function qB(D){return D}function HB(D){return D}function UB(D){return D}function OB(D){return D}function VB(D){return D}function LB(D){return D}function TB(D){return D}function NB(D){return D}function IB(D){return D}var t={...r8,...r2},xB=t.ai,SB=t.analytics,hu=t.app,hB=t.cache,yB=t.cloud,jB=t.cli,RB=t.database,kB=t.dns,gB=t.docs,bB=t.email,_B=t.errors,PB=t.git,mB=t.hashing,vB=t.library,cB=t.logging,fB=t.notification,nB=t.payment,rB=t.ports,dB=t.queue,lB=t.security,pB=t.saas,iB=t.searchEngine,tB=t.services,sB=t.storage,aB=t.team,oB=t.ui;function eB(){if(hu.env==="local")return"dev";if(hu.env==="development")return"dev";if(hu.env==="staging")return"stage";if(hu.env==="production")return"prod";if(!hu.env)throw new Error("Couldn\'t determine app environment");return hu.env}class d2{static isTestEnvironment=!1;static shouldExitProcess=!0;static handle(D,u){if(this.shouldExitProcess=u?.shouldExit!==!1,u?.silent!==!0)this.writeErrorToConsole(D);let F;if(u?.message)F=u.message;else if(D instanceof Error)F=D.message;else if(typeof D==="string")F=D;else F=JSON.stringify(D);let $=new Error(F);if(D instanceof Error)Object.assign($,D);return this.writeErrorToFile($).catch((E)=>console.error(E)),$}static handleError(D,u){return this.handle(D,u),D}static async writeErrorToFile(D){if(!(D instanceof Error)){console.error("Error is not an instance of Error:",D);return}let u=`[${new Date().toISOString()}] ${D.name}: ${D.message}\n`,F=n8("stacks.log")??n8("errors.log");try{await fC(r1(F),{recursive:!0}),await cC(F,u)}catch($){console.error("Failed to write to error file:",$)}}static writeErrorToConsole(D){console.error(D);let u=typeof D==="string"?D:D instanceof Error?D.message:JSON.stringify(D);if(u.includes("bunx --bun cdk destroy")||u===`Failed to execute command: ${vC("bunx --bun eslint . --fix")}`||u===`Failed to execute command: ${vC("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)CY.exit(1)}}function nC(D,u){let F;if(u3(D))F=D;else if(D instanceof Error)F=D.message;else if(u instanceof Error)F=u.message;else F=String(D);return Ou(`ERROR: ${$Y(F)}`),d2.handle(D,u)}async function Ou(D,u){let F=`[${new Date().toISOString()}] ${D}\n`;try{let $=u?.logFile??BD.logging.logsPath??"storage/logs/stacks.log";try{await uY($)}catch{await fC(FY($),{recursive:!0})}await cC($,F)}catch($){console.error("Failed to write to log file:",$)}}var EY={withStackTrace:!1},lC=(D,u,F=EY)=>{let $=u.isOk()?{type:"Ok",value:u.value}:{type:"Err",value:u.error},E=F.withStackTrace?new Error().stack:void 0;return{data:$,message:D,stack:E}};function du(D,u,F,$){function E(w){return w instanceof F?w:new F(function(C){C(w)})}return new(F||(F=Promise))(function(w,C){function Z(X){try{W($.next(X))}catch(q){C(q)}}function M(X){try{W($.throw(X))}catch(q){C(q)}}function W(X){X.done?w(X.value):E(X.value).then(Z,M)}W(($=$.apply(D,u||[])).next())})}function rC(D){var u=typeof Symbol==="function"&&Symbol.iterator,F=u&&D[u],$=0;if(F)return F.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&$>=D.length)D=void 0;return{value:D&&D[$++],done:!D}}};throw new TypeError(u?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yu(D){return this instanceof Yu?(this.v=D,this):new Yu(D)}function dC(D,u,F){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var $=F.apply(D,u||[]),E,w=[];return E=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),Z("next"),Z("throw"),Z("return",C),E[Symbol.asyncIterator]=function(){return this},E;function C(U){return function(A){return Promise.resolve(A).then(U,q)}}function Z(U,A){if($[U]){if(E[U]=function(P){return new Promise(function(n,d){w.push([U,P,n,d])>1||M(U,P)})},A)E[U]=A(E[U])}}function M(U,A){try{W($[U](A))}catch(P){L(w[0][3],P)}}function W(U){U.value instanceof Yu?Promise.resolve(U.value.v).then(X,q):L(w[0][2],U)}function X(U){M("next",U)}function q(U){M("throw",U)}function L(U,A){if(U(A),w.shift(),w.length)M(w[0][0],w[0][1])}}function wY(D){var u,F;return u={},$("next"),$("throw",function(E){throw E}),$("return"),u[Symbol.iterator]=function(){return this},u;function $(E,w){u[E]=D[E]?function(C){return(F=!F)?{value:Yu(D[E](C)),done:!1}:w?w(C):C}:w}}function BY(D){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=D[Symbol.asyncIterator],F;return u?u.call(D):(D=typeof rC==="function"?rC(D):D[Symbol.iterator](),F={},$("next"),$("throw"),$("return"),F[Symbol.asyncIterator]=function(){return this},F);function $(w){F[w]=D[w]&&function(C){return new Promise(function(Z,M){C=D[w](C),E(Z,M,C.done,C.value)})}}function E(w,C,Z,M){Promise.resolve(M).then(function(W){w({value:W,done:Z})},C)}}class MD{constructor(D){this._promise=D}static fromSafePromise(D){let u=D.then((F)=>new uu(F));return new MD(u)}static fromPromise(D,u){let F=D.then(($)=>new uu($)).catch(($)=>new iD(u($)));return new MD(F)}static fromThrowable(D,u){return(...F)=>{return new MD((()=>du(this,void 0,void 0,function*(){try{return new uu(yield D(...F))}catch($){return new iD(u?u($):$)}}))())}}static combine(D){return ZY(D)}static combineWithAllErrors(D){return KY(D)}map(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);return new uu(yield D(u.value))})))}andThrough(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);let F=yield D(u.value);if(F.isErr())return new iD(F.error);return new uu(u.value)})))}andTee(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return new iD(u.error);try{yield D(u.value)}catch(F){}return new uu(u.value)})))}mapErr(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isOk())return new uu(u.value);return new iD(yield D(u.error))})))}andThen(D){return new MD(this._promise.then((u)=>{if(u.isErr())return new iD(u.error);let F=D(u.value);return F instanceof MD?F._promise:F}))}orElse(D){return new MD(this._promise.then((u)=>du(this,void 0,void 0,function*(){if(u.isErr())return D(u.error);return new uu(u.value)})))}match(D,u){return this._promise.then((F)=>F.match(D,u))}unwrapOr(D){return this._promise.then((u)=>u.unwrapOr(D))}safeUnwrap(){return dC(this,arguments,function*D(){return yield Yu(yield Yu(yield*wY(BY(yield Yu(this._promise.then((u)=>u.safeUnwrap()))))))})}then(D,u){return this._promise.then(D,u)}[Symbol.asyncIterator](){return dC(this,arguments,function*D(){let u=yield Yu(this._promise);if(u.isErr())yield yield Yu(A0(u.error));return yield Yu(u.value)})}}var A0=(D)=>new MD(Promise.resolve(new iD(D))),YY=MD.fromPromise,JY=MD.fromSafePromise,qz=MD.fromThrowable,pC=(D)=>{let u=Vu([]);for(let F of D)if(F.isErr()){u=Ju(F.error);break}else u.map(($)=>$.push(F.value));return u},ZY=(D)=>MD.fromSafePromise(Promise.all(D)).andThen(pC),iC=(D)=>{let u=Vu([]);for(let F of D)if(F.isErr()&&u.isErr())u.error.push(F.error);else if(F.isErr()&&u.isOk())u=Ju([F.error]);else if(F.isOk()&&u.isOk())u.value.push(F.value);return u},KY=(D)=>MD.fromSafePromise(Promise.all(D)).andThen(iC),A8;(function(D){function u(E,w){return(...C)=>{try{let Z=E(...C);return Vu(Z)}catch(Z){return Ju(w?w(Z):Z)}}}D.fromThrowable=u;function F(E){return pC(E)}D.combine=F;function $(E){return iC(E)}D.combineWithAllErrors=$})(A8||(A8={}));var Vu=(D)=>new uu(D);function Ju(D){return new iD(D)}class uu{constructor(D){this.value=D}isOk(){return!0}isErr(){return!this.isOk()}map(D){return Vu(D(this.value))}mapErr(D){return Vu(this.value)}andThen(D){return D(this.value)}andThrough(D){return D(this.value).map((u)=>this.value)}andTee(D){try{D(this.value)}catch(u){}return Vu(this.value)}orElse(D){return Vu(this.value)}asyncAndThen(D){return D(this.value)}asyncAndThrough(D){return D(this.value).map(()=>this.value)}asyncMap(D){return MD.fromSafePromise(D(this.value))}unwrapOr(D){return this.value}match(D,u){return D(this.value)}safeUnwrap(){let D=this.value;return function*(){return D}()}_unsafeUnwrap(D){return this.value}_unsafeUnwrapErr(D){throw lC("Called `_unsafeUnwrapErr` on an Ok",this,D)}*[Symbol.iterator](){return this.value}}class iD{constructor(D){this.error=D}isOk(){return!1}isErr(){return!this.isOk()}map(D){return Ju(this.error)}mapErr(D){return Ju(D(this.error))}andThrough(D){return Ju(this.error)}andTee(D){return Ju(this.error)}andThen(D){return Ju(this.error)}orElse(D){return D(this.error)}asyncAndThen(D){return A0(this.error)}asyncAndThrough(D){return A0(this.error)}asyncMap(D){return A0(this.error)}unwrapOr(D){return D}match(D,u){return u(this.error)}safeUnwrap(){let D=this.error;return function*(){throw yield Ju(D),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(D){throw lC("Called `_unsafeUnwrap` on an Err",this,D)}_unsafeUnwrapErr(D){return this.error}*[Symbol.iterator](){let D=this;return yield D,D}}var MY=A8.fromThrowable;M1();z8();q8();U8();function bJ(){let D=/--verbose(?!\s*=\s*false|\s+false)(?:\s+|=true)?(?:$|\s)/,u=gJ();if(D.test(u))return 4;return 3}var O0={...I8({level:bJ()}),warning:(D)=>console.warn(D),dump:(...D)=>console.log(...D),dd:(...D)=>{console.log(...D),x8.exit(1)},echo:(D)=>console.log(D)};var Qu={info:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.info(D);await Ou(`INFO: ${U0(D)}`)},success:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.success(D);await Ou(`SUCCESS: ${U0(D)}`)},warn:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.warn(D);await Ou(`WARN: ${U0(D)}`)},warning:async(D,u)=>{if(u?.styled===!1)console.log(D);else O0.warn(D);await Ou(`WARN: ${U0(D)}`)},error:async(D,u)=>{nC(D,u)},debug:async(...D)=>{let F=`DEBUG: ${D.map(($)=>typeof $==="object"?JSON.stringify($,null,2):$).join(" ")}`;if(x8.env.APP_ENV==="production"||x8.env.APP_ENV==="prod")return Ou(F);O0.debug(F),await Ou(U0(F))},dump:(...D)=>D.forEach((u)=>console.log(u)),dd:(...D)=>{D.forEach((u)=>console.log(u)),x8.exit(1)},echo:(...D)=>console.log(...D)};var g4=p(h1(),1);import qK from"node-fetch";var y4="https://www.iana.org/whois?q=",j4={"whois.denic.de":"-T dn,ace","whois.nic.fr":"-V Md5.2"},y1={"br.com":"whois.centralnic.net","cn.com":"whois.centralnic.net","de.com":"whois.centralnic.net","eu.com":"whois.centralnic.net","gb.com":"whois.centralnic.net","gb.net":"whois.centralnic.net","gr.com":"whois.centralnic.net","hu.com":"whois.centralnic.net","in.net":"whois.centralnic.net","no.com":"whois.centralnic.net","qc.com":"whois.centralnic.net","ru.com":"whois.centralnic.net","sa.com":"whois.centralnic.net","se.com":"whois.centralnic.net","se.net":"whois.centralnic.net","uk.com":"whois.centralnic.net","uk.net":"whois.centralnic.net","us.com":"whois.centralnic.net","uy.com":"whois.centralnic.net","za.com":"whois.centralnic.net","jpn.com":"whois.centralnic.ne","web.com":"whois.centralnic.ne",com:"whois.verisign-grs.com","za.net":"whois.za.net",net:"whois.verisign-grs.com","eu.org":"whois.eu.org","za.org":"whois.za.org",org:"whois.pir.org","llyw.cymru":"whois.nic.llyw.cymru","gov.scot":"whois.nic.gov.scot","gov.wales":"whois.nic.gov.wales",edu:"whois.educause.edu",gov:"whois.dotgov.gov",int:"whois.iana.org","e164.arpa":"whois.ripe.net",arpa:"whois.iana.org",aero:"whois.aero",asia:"whois.nic.asia",biz:"whois.nic.biz",cat:"whois.nic.cat",coop:"whois.nic.coop",info:"whois.afilias.net",jobs:"whois.nic.jobs",mobi:"whois.afilias.net",museum:"whois.nic.museum",name:"whois.nic.name",post:"whois.dotpostregistry.net",pro:"whois.nic.pro",tel:"whois.nic.tel",travel:"whois.nic.travel",xxx:"whois.nic.xxx",ac:"whois.nic.ac",ae:"whois.aeda.net.ae",af:"whois.nic.af",ag:"whois.nic.ag",ai:"whois.nic.ai",am:"whois.amnic.net",ar:"whois.nic.ar",as:"whois.nic.as","priv.at":"whois.nic.priv.at",at:"whois.nic.at",au:"whois.auda.org.au",aw:"whois.nic.aw",ax:"whois.ax",be:"whois.dns.be",bf:"whois.registre.bf",bg:"whois.register.bg",bh:"whois.nic.bh",bi:"whois1.nic.bi",bj:"whois.nic.bj",bm:"whois.afilias-srs.net",bn:"whois.bnnic.bn",bo:"whois.nic.bo",br:"whois.registro.br",by:"whois.cctld.by",bw:"whois.nic.net.bw",bz:"whois.afilias-grs.info","co.ca":"whois.co.ca",ca:"whois.cira.ca",cc:"ccwhois.verisign-grs.com",cd:"whois.nic.cd",ch:"whois.nic.ch",ci:"whois.nic.ci",cl:"whois.nic.cl",cm:"whois.netcom.cm","edu.cn":"whois.edu.cn",cn:"whois.cnnic.cn","uk.co":"whois.uk.co",co:"whois.nic.co",cr:"whois.nic.cr",cx:"whois.nic.cx",cz:"whois.nic.cz",de:"whois.denic.de",dk:"whois.dk-hostmaster.dk",dm:"whois.dmdomains.dm",do:"whois.nic.do",dz:"whois.nic.dz",ec:"whois.nic.ec",ee:"whois.tld.ee",eu:"whois.eu",fi:"whois.fi",fj:"www.whois.fj",fm:"whois.nic.fm",fo:"whois.nic.fo",fr:"whois.nic.fr",gd:"whois.nic.gd",ge:"whois.nic.ge",gf:"whois.mediaserv.net",gg:"whois.gg",gh:"whois.nic.gh",gi:"whois2.afilias-grs.net",gl:"whois.nic.gl",gp:"whois.nic.gp",gq:"whois.dominio.gq",gs:"whois.nic.gs",gy:"whois.registry.gy",hk:"whois.hkirc.hk",hm:"whois.registry.hm",hn:"whois.nic.hn",hr:"whois.dns.hr",ht:"whois.nic.ht",hu:"whois.nic.hu",id:"whois.id",ie:"whois.weare.ie",il:"whois.isoc.org.il",im:"whois.nic.im",in:"whois.registry.in",io:"whois.nic.io",iq:"whois.cmc.iq",ir:"whois.nic.ir",is:"whois.isnic.is",it:"whois.nic.it",je:"whois.je",jp:"whois.jprs.jp",ke:"whois.kenic.or.ke",kg:"whois.kg",ki:"whois.nic.ki",kn:"whois.nic.kn",kr:"whois.kr",kw:"whois.nic.kw",ky:"whois.kyregistry.ky",kz:"whois.nic.kz",la:"whois.nic.la",lb:"whois.lbdr.org.lb",lc:"whois2.afilias-grs.net",li:"whois.nic.li",lk:"whois.nic.lk",ls:"whois.nic.ls",lt:"whois.domreg.lt",lu:"whois.dns.lu",lv:"whois.nic.lv",ly:"whois.nic.ly",ma:"whois.registre.ma",md:"whois.nic.md",me:"whois.nic.me",mg:"whois.nic.mg",mk:"whois.marnet.mk",ml:"whois.dot.ml",mm:"whois.registry.gov.mm",mn:"whois.nic.mn",mq:"whois.mediaserv.net",mr:"whois.nic.mr",ms:"whois.nic.ms",mt:"whois.nic.org.mt",mu:"whois.nic.mu",mw:"whois.nic.mw",mx:"whois.mx",my:"whois.mynic.my",mz:"whois.nic.mz",na:"whois.na-nic.com.na",nc:"whois.nc",nf:"whois.nic.nf",ng:"whois.nic.net.ng",nl:"whois.domain-registry.nl",no:"whois.norid.no",nu:"whois.iis.nu",nz:"whois.irs.net.nz",om:"whois.registry.om",pe:"kero.yachay.pe",pf:"whois.registry.pf",pk:"whois.pknic.net.pk","co.pl":"whois.co.pl",pl:"whois.dns.pl",pm:"whois.nic.pm",pr:"whois.afilias-srs.net",ps:"whois.pnina.ps",pt:"whois.dns.pt",pw:"whois.nic.pw",qa:"whois.registry.qa",re:"whois.nic.re",ro:"whois.rotld.ro",rs:"whois.rnids.rs","ac.ru":"whois.free.net","edu.ru":"whois.informika.ru","com.ru":"whois.flexireg.net","msk.ru":"whois.flexireg.net","net.ru":"whois.nic.net.ru","nov.ru":"whois.flexireg.net","org.ru":"whois.nic.net.ru","pp.ru":"whois.nic.net.ru","spb.ru":"whois.flexireg.net",ru:"whois.tcinet.ru",rw:"whois.ricta.org.rw",sa:"whois.nic.net.sa",sb:"whois.nic.net.sb",sc:"whois2.afilias-grs.net",sd:"whois.sdnic.sd",se:"whois.iis.se",sg:"whois.sgnic.sg",sh:"whois.nic.sh",si:"whois.register.si",sk:"whois.sk-nic.sk",sl:"whois.nic.sl",sm:"whois.nic.sm",sn:"whois.nic.sn",so:"whois.nic.so",ss:"whois.nic.ss",st:"whois.nic.st","msk.su":"whois.flexireg.net","nov.su":"whois.flexireg.net","spb.su":"whois.flexireg.net",su:"whois.tcinet.ru",sx:"whois.sx",sy:"whois.tld.sy",tc:"whois.nic.tc",td:"whois.nic.td",tf:"whois.nic.tf",tg:"whois.nic.tg",th:"whois.thnic.co.th",tk:"whois.dot.tk",tl:"whois.nic.tl",tm:"whois.nic.tm",tn:"whois.ati.tn",to:"whois.tonic.to",tr:"whois.trabis.gov.tr",tv:"whois.nic.tv",tw:"whois.twnic.net.tw",tz:"whois.tznic.or.tz","biz.ua":"whois.biz.ua","co.ua":"whois.co.ua","pp.ua":"whois.pp.ua",ua:"whois.ua",ug:"whois.co.ug","ac.uk":"whois.nic.ac.uk","gov.uk":"whois.gov.uk",uk:"whois.nic.uk","fed.us":"whois.nic.gov",us:"whois.nic.us",uy:"whois.nic.org.uy",uz:"whois.cctld.uz",vc:"whois2.afilias-grs.net",ve:"whois.nic.ve",vg:"whois.nic.vg",vu:"whois.dnrs.vu",wf:"whois.nic.wf",ws:"whois.website.ws",yt:"whois.nic.yt","ac.za":"whois.ac.za","co.za":"whois.registry.net.za","gov.za":"whois.gov.za","net.za":"net-whois.registry.net.za","org.za":"org-whois.registry.net.za","web.za":"web-whois.registry.net.za",zm:"whois.zicta.zm","xn--2scrj9c":"whois.registry.in","xn--3e0b707e":"whois.kr","xn--3hcrj9c":"whois.registry.in","xn--45br5cyl":"whois.registry.in","xn--45brj9c":"whois.registry.in","xn--4dbrk0ce":"whois.isoc.org.il","xn--80ao21a":"whois.nic.kz","xn--90a3ac":"whois.rnids.rs","xn--90ae":"whois.imena.bg","xn--90ais":"whois.cctld.by","xn--clchc0ea0b2g2a9gcd":"whois.sgnic.sg","xn--d1alf":"whois.marnet.mk","xn--e1a4c":"whois.eu","xn--fiqs8s":"cwhois.cnnic.cn","xn--fiqz9s":"cwhois.cnnic.cn","xn--fpcrj9c3d":"whois.registry.in","xn--fzc2c9e2c":"whois.nic.lk","xn--gecrj9c":"whois.registry.in","xn--h2breg3eve":"whois.registry.in","xn--h2brj9c8c":"whois.registry.in","xn--h2brj9c":"whois.registry.in","xn--j1amh":"whois.dotukr.com","xn--j6w193g":"whois.hkirc.hk","xn--kprw13d":"whois.twnic.net.tw","xn--kpry57d":"whois.twnic.net.tw","xn--lgbbat1ad8j":"whois.nic.dz","xn--mgb9awbf":"whois.registry.om","xn--mgba3a4f16a":"whois.nic.ir","xn--mgbaam7a8h":"whois.aeda.net.ae","xn--mgbah1a3hjkrd":"whois.nic.mr","xn--mgbbh1a71e":"whois.registry.in","xn--mgbbh1a":"whois.registry.in","xn--mgberp4a5d4ar":"whois.nic.net.sa","xn--mgbgu82a":"whois.registry.in","xn--mgbtx2b":"whois.cmc.iq","xn--mgbx4cd0ab":"whois.mynic.my","xn--node":"whois.itdc.ge","xn--o3cw4h":"whois.thnic.co.th","xn--ogbpf8fl":"whois.tld.sy","xn--p1ai":"whois.tcinet.ru","xn--pgbs0dh":"whois.ati.tn","xn--q7ce6a":"whois.nic.la","xn--qxa6a":"whois.eu","xn--rvc1e0am3e":"whois.registry.in","xn--s9brj9c":"whois.registry.in","xn--wgbh1c":"whois.dotmasr.eg","xn--wgbl6a":"whois.registry.qa","xn--xkc2al3hye2a":"whois.nic.lk","xn--xkc2dl3a5ee0h":"whois.registry.in","xn--y9a3aq":"whois.amnic.net","xn--yfro4i67o":"whois.sgnic.sg","xn--ygbi2ammx":"whois.pnina.ps"};var R4;((F)=>{F[F.SOCKS4=0]="SOCKS4";F[F.SOCKS5=1]="SOCKS5"})(R4||={});function j1(D){if(Array.isArray(D))return D.slice();if(typeof D==="object"&&D!==null){let u={};for(let F in D)if(Object.prototype.hasOwnProperty.call(D,F))u[F]=j1(D[F]);return u}return D}var LK=p(h1(),1);async function HK(D){let u=y4+D;try{let F=await qK(u);if(F.ok){let E=(await F.text()).match(/whois:\s+(\S+)/);if(E?.[1])return E[1]}}catch(F){console.error("Error in getting WhoIs server data from IANA",F)}return""}function UK(D){if(D==="com")return"whois.verisign-grs.com";return y1[D]}function k4(D){let u=D.split(".");for(let F=u.length-1;F>0;F--){let $=u.slice(F).join(".");if(y1[$])return $}return u[u.length-1]}function OK(D){return j4[D]}class b8{static iterParse(D,u){let F="",$=null,E="";for(let w=0;w<D.length;w++){let C=D[w];if(C==="\n"||E===":"&&C===" "){if(F.trim()in u)$=F.trim();else if($!==null){let Z=F.trim();if(Z!==""){let M=u[$];if(Array.isArray(M))M.push(Z);else u[$]=Z;$=null}}F=""}else if(C!==":")F=F+C;if(E=C,F==="Record maintained by"||F===">>>")break}return u}static parseData(D,u){if(!u)u={"Domain Name":"","Creation Date":"","Updated Date":"","Registry Expiry Date":"","Domain Status":[],Registrar:""};return u=b8.iterParse(D,u),u}}async function VK(D,u,F,$,E,w){let C=new TextDecoder(E),Z=new TextEncoder;if(!w){let W=new GK.Socket;return new Promise((X,q)=>{try{W.connect({port:$,host:F},()=>{if(u!=="")W.write(Z.encode(`${u} ${D}\r\n`));else W.write(Z.encode(`${D}\r\n`))}),W.on("data",(L)=>{X(C.decode(L))}),W.on("error",(L)=>{q(L)})}catch(L){q(L)}})}let M={proxy:{host:w.ip,port:w.port,type:w.type===1?5:4},command:"connect",destination:{host:F,port:$}};if(w.username&&w.password)M.proxy.userId=w.username,M.proxy.password=w.password;return new Promise((W,X)=>{g4.SocksClient.createConnection(M,(q,L)=>{if(q)X(q);else{if(!L)X(new Error("No socket info received!"));if(u!=="")L?.socket.write(Z.encode(`${u} ${D}\r\n`));else L?.socket.write(Z.encode(`${D}\r\n`));L?.socket.on("data",(U)=>{W(C.decode(U))}),L?.socket.resume()}})})}async function R1(D,u=!1,F=null){let $,E=43,w="",C,Z="utf-8";if(!F)$=k4(D),C=null;else $=F.tld?F.tld:k4(D),Z=F.encoding?F.encoding:"utf-8",C=F.proxy?F.proxy:null,w=F.server?F.server:"",E=F.serverPort?F.serverPort:43;if(w===""){let X=UK($);if(!X){if(Qu.debug(`No WhoIs server found for TLD: ${$}! Attempting IANA WhoIs database for server!`),X=await HK($),!X)return Qu.debug("WhoIs server could not be found!"),{_raw:"",parsedData:null};Qu.debug(`WhoIs sever found for ${$}: ${w}`)}w=X}let W=OK(w)||"";try{Qu.debug(`Attempting WHOIS lookup for ${D} on server ${w}`);let X=await VK(D,W,w,E,Z,C);if(Qu.debug("Raw WHOIS data received:",X),!u){let L=b8.parseData(X,null);return{_raw:X,parsedData:L}}let q=null;if(F?.parseData)q=j1(F.parseData);try{let L=b8.parseData(X,q);return{_raw:X,parsedData:L}}catch(L){return console.error("Error in parsing WhoIs data!",L),{_raw:X,parsedData:null}}}catch(X){return Qu.debug(`Error in WHOIS lookup for ${D} on server ${w}`,X),{_raw:"",parsedData:null}}}function yG(D,u=null){return Qu.debug(`Lookup called for ${D}`),R1(D,!0,u)}async function jG(D,u=!1,F=1,$=!1,E=null){let w=[];if(u){if(F>D.length)F=D.length;for(let C=0;C<D.length;C+=F){let Z=D.slice(C,C+F);w=await Promise.all(Z.map(async(M)=>{return await R1(M,$,E)}))}}else for(let C=0;C<D.length;C++){let Z=await R1(D[C],$,E);w.push(Z)}return w}var export_SocksClient=LK.SocksClient;export{R1 as whois,VK as tcpWhois,yG as lookup,UK as getWhoIsServer,k4 as getTLD,OK as getParameters,HK as findWhoIsServer,jG as batchWhois,b8 as WhoIsParser,export_SocksClient as SocksClient,y1 as SERVERS,R4 as ProxyType,j4 as PARAMETERS,y4 as IANA_CHK_URL};
|