@decaf-ts/decorator-validation
Advanced tools
Comparing version 1.3.7 to 1.4.0
/*! For license information please see decorator-validation.bundle.min.js.LICENSE.txt */ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("decorator-validation",[],t):"object"==typeof exports?exports["decorator-validation"]=t():e["decorator-validation"]=t()}(this,(()=>(()=>{var e={729:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(935),t),o(r(965),t),o(r(847),t),t.VERSION="1.3.6"},6:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const n=r(735),o=r(38),a=r(936),i=r(32),s=r(192),c=r(523),u=r(710),l=r(154);let d,f;class p{constructor(e){}hasErrors(...e){return(0,s.validate)(this,...e)}equals(e,...t){return(0,i.isEqual)(this,e,...t)}serialize(){return p.serialize(this)}toString(){return this.constructor.name+": "+JSON.stringify(this,void 0,2)}hash(){return p.hash(this)}static deserialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),this.constructor);return t&&t.serializer?n.Serialization.deserialize(e,t.serializer,...t.args||[]):n.Serialization.deserialize(e)}static fromObject(e,t){return(0,o.constructFromObject)(e,t)}static fromModel(e,t){return(0,o.constructFromModel)(e,t)}static setBuilder(e){d=e}static getBuilder(){return d}static getRegistry(){return f||(f=new a.ModelRegistryManager),f}static setRegistry(e){f=e}static register(e,t){return p.getRegistry().register(e,t)}static get(e){return p.getRegistry().get(e)}static build(e={},t){return p.getRegistry().build(e,t)}static getMetadata(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.MODEL),e.constructor);if(!t)throw new Error("could not find metadata for provided "+e.constructor.name);return t}static equals(e,t,...r){return(0,i.isEqual)(e,t,...r)}static hasErrors(e,...t){return(0,s.validate)(e,...t)}static serialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),e.constructor);return t&&t.serializer?n.Serialization.serialize(this,t.serializer,...t.args||[]):n.Serialization.serialize(e)}static hash(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.HASHING),e.constructor);return t&&t.algorithm?c.Hashing.hash(e,t.algorithm,...t.args||[]):c.Hashing.hash(e)}}t.Model=p},19:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelErrorDefinition=void 0,t.ModelErrorDefinition=class{constructor(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t]&&Object.defineProperty(this,t,{enumerable:!0,configurable:!1,value:e[t],writable:!1})}toString(){const e=this;return Object.keys(e).filter((t=>Object.prototype.hasOwnProperty.call(e,t)&&"function"!=typeof e[t])).reduce(((t,r)=>{let n=Object.keys(e[r]).reduce(((t,n)=>(t?t+=`\n${e[r][n]}`:t=e[r][n],t)),void 0);return n&&(n=`${r} - ${n}`,t?t+=`\n${n}`:t=n),t}),"")}}},936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelRegistryManager=void 0,t.bulkModelRegister=function(...e){e.forEach((e=>{const t=e.constructor?e.constructor:e;n.Model.register(t,e.name)}))};const n=r(6),o=r(593),a=r(710);t.ModelRegistryManager=class{constructor(e=a.isModel){this.cache={},this.testFunction=e}register(e,t){if("function"!=typeof e)throw new Error("Model registering failed. Missing Class name or constructor");t=t||e.name,this.cache[t]=e}get(e){try{return this.cache[e]}catch(e){return}}build(e={},t){if(!t&&!this.testFunction(e))throw new Error("Provided obj is not a Model object");const r=t||n.Model.getMetadata(e);if(!(r in this.cache))throw new Error((0,o.sf)("Provided class {0} is not a registered Model object",r));return new this.cache[r](e)}}},402:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.jsTypes=t.ReservedModels=t.Primitives=void 0,function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint"}(r||(t.Primitives=r={})),function(e){e.STRING="string",e.OBJECT="object",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint",e.DATE="date"}(n||(t.ReservedModels=n={})),t.jsTypes=["string","array","number","boolean","symbol","function","object","undefined","null","bigint"]},38:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constructFromObject=function(e,t){if(!t)return e;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(Object.prototype.hasOwnProperty.call(e,r)||e.prototype&&Object.prototype.hasOwnProperty.call(e.prototype,r))&&(e[r]=t[r]||void 0);return e},t.constructFromModel=function(e,t){if(!t)return e;let r,l;for(const d in t)if(Object.prototype.hasOwnProperty.call(t,d)&&(Object.prototype.hasOwnProperty.call(e,d)||e.prototype&&Object.prototype.hasOwnProperty.call(e.prototype,d))){if(e[d]=t[d],"object"!=typeof e[d])continue;if((0,u.isModel)(e[d])){try{e[d]=n.Model.build(e[d])}catch(e){console.log(e)}continue}const f=(0,c.getPropertyDecorators)(o.ValidationKeys.REFLECT,e,d).decorators;if(r=f.filter((e=>-1!==[i.ModelKeys.TYPE,o.ValidationKeys.TYPE].indexOf(e.key))),!r||!r.length)throw new Error((0,s.sf)("failed to find decorators for property {0}",d));l=r.pop();const p=l.props.name?[l.props.name]:Array.isArray(l.props.customTypes)?l.props.customTypes:[l.props.customTypes],y=Object.values(a.ReservedModels).map((e=>e.toLowerCase()));p.forEach((t=>{if(-1===y.indexOf(t.toLowerCase()))try{switch(t){case"Array":case"Set":if(f.length){const r=f.find((e=>e.key===o.ValidationKeys.LIST));if(r){const o=r.props.class.find((e=>!a.jsTypes.includes(e.toLowerCase())));if("Array"===t&&(e[d]=e[d].map((e=>["object","function"].includes(typeof e)&&o?n.Model.build(e,o):e))),"Set"===t){const t=new Set;for(const r of e[d])["object","function"].includes(typeof r)&&o?t.add(n.Model.build(r,o)):t.add(r);e[d]=t}}}break;default:e[d]&&(e[d]=n.Model.build(e[d],t))}}catch(e){console.log(e)}}))}return e},t.construct=function(e,...t){const r=(...t)=>new e(...t);return r.prototype=e.prototype,r(...t)},t.findLastProtoBeforeObject=function(e){let t=Object.getPrototypeOf(e);if(t===Object.prototype)return e;for(;t!==Object.prototype;){if(t=Object.getPrototypeOf(t),t===Object.prototype)return t;if(Object.getPrototypeOf(t)===Object.prototype)return t}throw new Error("Could not find proper prototype")},t.bindModelPrototype=function(e){if(e instanceof n.Model)return;function t(e,t){Object.setPrototypeOf(e,t)}const r=Object.getPrototypeOf(e);if(r===Object.prototype)return t(e,n.Model.prototype);for(;r!==Object.prototype;){const e=Object.getPrototypeOf(r);if(e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return t(r,n.Model.prototype)}throw new Error("Could not find proper prototype to bind")};const n=r(6),o=r(772),a=r(402),i=r(154),s=r(593),c=r(32),u=r(710)},893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.model=function(e,t){return r=>{const c=function(...c){const u=(0,n.construct)(r,...c);(0,n.bindModelPrototype)(u);const l=a.Model.getBuilder();return l&&l(u,c.length?c[0]:void 0),(0,s.metadata)((0,i.getModelKey)(o.ModelKeys.MODEL),e||r.name)(u.constructor),t&&t(u,...c),u};return c.prototype=r.prototype,Object.defineProperty(c,"name",{writable:!1,enumerable:!0,configurable:!1,value:r.prototype.constructor.name}),(0,s.metadata)((0,i.getModelKey)(o.ModelKeys.MODEL),e||r.name)(r),a.Model.register(c,e),c}};const n=r(38),o=r(154),a=r(6),i=r(710),s=r(32)},847:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(402),t),o(r(38),t),o(r(893),t),o(r(6),t),o(r(19),t),o(r(936),t),o(r(282),t),o(r(710),t),o(r(192),t)},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getModelKey=void 0,t.isModel=function(e){try{return e instanceof o.Model||!o.Model.getMetadata(e)}catch(e){return!1}};const n=r(154),o=r(6);t.getModelKey=e=>n.ModelKeys.REFLECT+e},192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(e,...t){const r=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&r.push((0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,n));let d;for(const t of r){const{prop:r,decorators:n}=t;if(!n||!n.length)continue;const o=n[0];let i;n.find((e=>e.key===u.ValidationKeys.TYPE||!!e.props.types?.find((e=>e===o.props.name))))&&n.shift();for(const t of n){const n=c.Validation.get(t.key);if(!n)throw new Error(`Missing validator for ${t.key}`);const o=n.hasErrors(e[r.toString()],...t.key===a.ModelKeys.TYPE?[t.props]:Object.values(t.props));o&&(i=i||{},i[t.key]=o)}i&&(d=d||{},d[t.prop.toString()]=i)}for(const t of Object.keys(e).filter((e=>!d||!d[e]))){let r;const n=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators,c=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators.filter((e=>-1!==[a.ModelKeys.TYPE,u.ValidationKeys.TYPE].indexOf(e.key)));if(!c||!c.length)continue;const f=c.pop(),p=f.props.name?[f.props.name]:Array.isArray(f.props.customTypes)?f.props.customTypes:[f.props.customTypes],y=Object.values(s.ReservedModels).map((e=>e.toLowerCase()));for(const o of p){if(-1===y.indexOf(o.toLowerCase())){const a=Array.isArray(e[t])?u.ValidationKeys.LIST:u.ValidationKeys.TYPE,s=n.find((e=>e.key===a))||{};let c=[];if(s&&s.props){const r=Array.isArray(e[t])?s.props.class:s.props.customTypes;r&&(c=Array.isArray(r)?r.map((e=>`${e}`.toLowerCase())):[r.toLowerCase()])}const d=(e,t)=>{if("object"==typeof t||"function"==typeof t)return(0,l.isModel)(t)?t.hasErrors():c.includes(typeof t)?void 0:"Value has no validatable type"};switch(o){case Array.name:case Set.name:n.length&&n.find((e=>e.key===u.ValidationKeys.LIST))&&(r=(o===Array.name?e[t]:e[t].values()).map((e=>d(t,e))).filter((e=>!!e)),r?.length||(r=void 0));break;default:try{e[t]&&(r=d(t,e[t]))}catch(e){console.warn((0,i.sf)("Model should be validatable but its not: "+e))}}}r&&(d=d||{},d[t]=r)}}return d?new n.ModelErrorDefinition(d):void 0};const n=r(19),o=r(32),a=r(154),i=r(593),s=r(402),c=r(770),u=r(772),l=r(710)},154:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModelKeys=void 0,function(e){e.REFLECT="model.definition.",e.TYPE="design:type",e.PARAMS="design:paramtypes",e.RETURN="design:returntype",e.MODEL="model",e.ANCHOR="__model",e.HASHING="hashing",e.SERIALIZATION="serialization"}(r||(t.ModelKeys=r={}))},46:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromFormat=a,t.bindDateToString=i,t.isValidDate=s,t.twoDigitPad=c,t.formatDate=u,t.parseDate=function(e,t){let r;if(t){if(t instanceof Date)try{r=a(u(t,e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t.toString(),e))}else if("string"==typeof t)r=a(t,e);else if("number"==typeof t)r=a(u(new Date(t),e),e);else{if(!s(t))throw new Error(`Invalid value provided ${t}`);try{r=a(u(new Date(t),e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t,e))}}return i(r,e)}},r(630);const n=r(772),o=r(593);function a(e,t){let r=t;r.match(/hh/)?r=r.replace("hh","(?<hour>\\d{2})"):r.match(/h/)?r=r.replace("h","(?<hour>\\d{1,2})"):r.match(/HH/)?r=r.replace("HH","(?<hour>\\d{2})"):r.match(/H/)&&(r=r.replace("H","(?<hour>\\d{1,2})")),r.match(/mm/)?r=r.replace("mm","(?<minutes>\\d{2})"):r.match(/m/)&&(r=r.replace("m","(?<minutes>\\d{1,2})")),r.match(/ss/)?r=r.replace("ss","(?<seconds>\\d{2})"):r.match(/s/)&&(r=r.replace("s","(?<seconds>\\d{1,2})")),r.match(/dd/)?r=r.replace("dd","(?<day>\\d{2})"):r.match(/d/)&&(r=r.replace("d","(?<day>\\d{1,2})")),r.match(/EEEE/)?r=r.replace("EEEE","(?<dayofweek>\\w+)"):r.match(/EEEE/)&&(r=r.replace("EEE","(?<dayofweek>\\w+)")),r.match(/yyyy/)?r=r.replace("yyyy","(?<year>\\d{4})"):r.match(/yy/)&&(r=r.replace("yy","(?<year>\\d{2})")),r.match(/MMMM/)?r=r.replace("MMMM","(?<monthname>\\w+)"):r.match(/MMM/)&&(r=r.replace("MMM","(?<monthnamesmall>\\w+)")),r.match(/MM/)?r=r.replace("MM","(?<month>\\d{2})"):r.match(/M/)&&(r=r.replace("M","(?<month>\\d{1,2})")),r=r.replace("S","(?<milis>\\d{1,3})").replace("aaa","(?<ampm>\\w{2})");const o=new RegExp(r,"g").exec(e);if(!o||!o.groups)return new Date(e);const a=function(e){if(!e)return 0;const t=parseInt(e);return isNaN(t)?0:t},i=a(o.groups.year),s=a(o.groups.day),c=o.groups.ampm;let u=a(o.groups.hour);c&&(u="PM"===c?u+12:u);const l=a(o.groups.minutes),d=a(o.groups.seconds),f=a(o.groups.milis),p=o.groups.monthname,y=o.groups.monthnamesmall;let h=o.groups.month;if(p)h=n.MONTH_NAMES.indexOf(p);else if(y){const t=n.MONTH_NAMES.find((e=>e.toLowerCase().startsWith(y.toLowerCase())));if(!t)return new Date(e);h=n.MONTH_NAMES.indexOf(t)}else h=a(`${h}`);return new Date(i,h-1,s,u,l,d,f)}function i(e,t){if(!e)return;const r=()=>u(e,t);return Object.defineProperty(e,"toISOString",{enumerable:!1,configurable:!1,value:r}),Object.defineProperty(e,"toString",{enumerable:!1,configurable:!1,value:r}),e}function s(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function c(e){return e<10?"0"+e:e.toString()}function u(e,t="yyyy/MM/dd"){const r=e.getDate(),o=e.getMonth(),a=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),d=i%12,f=c(d),p=c(i),y=c(s),h=c(u),g=i<12?"AM":"PM",v=n.DAYS_OF_WEEK_NAMES[e.getDay()],E=v.substr(0,3),_=c(r),O=o+1,m=c(O),M=n.MONTH_NAMES[o],b=M.substr(0,3),R=a+"",S=R.substr(2,2);return(t=t.replace("hh",f).replace("h",d.toString()).replace("HH",p).replace("H",i.toString()).replace("mm",y).replace("m",s.toString()).replace("ss",h).replace("s",u.toString()).replace("S",l.toString()).replace("dd",_).replace("d",r.toString()).replace("EEEE",v).replace("EEE",E).replace("yyyy",R).replace("yy",S).replace("aaa",g)).indexOf("MMM")>-1?t.replace("MMMM",M).replace("MMM",b):t.replace("MM",m).replace("M",O.toString())}},253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.HASHING),{algorithm:e,args:t})},t.serializedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.SERIALIZATION),{serializer:e,args:t})};const n=r(32),o=r(154),a=r(710)},523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hashing=t.DefaultHashingMethod=void 0,t.hashCode=o,t.hashSerialization=function(e){return o(n.Serialization.serialize(e))},t.hashObj=a;const n=r(735);function o(e){e=String(e);let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t.toString()}function a(e){const t=function(e,t){const r=n(t);return"string"==typeof r?n((e||"")+n(t)):0|(e=((e=e||0)<<5)-e+r)},r=o,n=function(e){return void 0===e?"":-1!==["string","number","symbol"].indexOf(typeof e)?r(e.toString()):e instanceof Date?r(e.getTime()):Array.isArray(e)?e.reduce(t,void 0):Object.values(e).reduce(t,void 0)},a=Object.values(e).reduce(t,0);return("number"==typeof a?Math.abs(a):a).toString()}t.DefaultHashingMethod="default";class i{static{this.current=t.DefaultHashingMethod}static{this.cache={default:a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No hashing method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Hashing method ${e} already registered`);this.cache[e]=t,r&&(this.current=e)}static hash(e,t,...r){return t?this.get(t)(e,...r):this.get(this.current)(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Hashing=i},935:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(154),t),o(r(46),t),o(r(253),t),o(r(523),t),o(r(904),t),o(r(735),t),o(r(593),t)},904:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serialization=t.DefaultSerializationMethod=t.JSONSerializer=void 0;const n=r(6),o=r(154);class a{preSerialize(e){const t=Object.assign({},e),r=n.Model.getMetadata(e);return t[o.ModelKeys.ANCHOR]=r||e.constructor.name,t}deserialize(e){const t=JSON.parse(e),r=t[o.ModelKeys.ANCHOR];if(!r)throw new Error("Could not find class reference in serialized model");return n.Model.build(t,r)}serialize(e){return JSON.stringify(this.preSerialize(e))}}t.JSONSerializer=a,t.DefaultSerializationMethod="json";class i{static{this.current=t.DefaultSerializationMethod}static{this.cache={json:new a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No serialization method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Serialization method ${e} already registered`);this.cache[e]=new t,r&&(this.current=e)}static serialize(e,t,...r){return t?this.get(t).serialize(e,...r):this.get(this.current).serialize(e,...r)}static deserialize(e,t,...r){return t?this.get(t).deserialize(e,...r):this.get(this.current).deserialize(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Serialization=i},593:(e,t)=>{"use strict";function r(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r].toString():"undefined"}))}Object.defineProperty(t,"__esModule",{value:!0}),t.sf=void 0,t.stringFormat=r,t.sf=r},770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validation=void 0;const n=r(436);class o{static{this.actingValidatorRegistry=void 0}constructor(){}static setRegistry(e,t){t&&o.actingValidatorRegistry&&o.actingValidatorRegistry.getKeys().forEach((r=>{const n=e.get(r);n&&e.register(t(n))})),o.actingValidatorRegistry=e}static getRegistry(){return o.actingValidatorRegistry||(o.actingValidatorRegistry=new n.ValidatorRegistry),o.actingValidatorRegistry}static get(e){return o.getRegistry().get(e)}static register(...e){return o.getRegistry().register(...e)}}t.Validation=o},395:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.DATE){super(e,Number.name,Date.name,String.name)}hasErrors(e,t,r){if(void 0!==e)return"string"==typeof e&&(e=new Date(e)),isNaN(e.getDate())?this.getMessage(r||this.message):void 0}};t.DateValidator=c,t.DateValidator=c=n([(0,s.validator)(i.ValidationKeys.DATE),o("design:paramtypes",[String])],c)},335:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.EMAIL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.EMAIL,r)}};t.EmailValidator=c,t.EmailValidator=c=n([(0,s.validator)(a.ValidationKeys.EMAIL),o("design:paramtypes",[String])],c)},407:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ListValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.LIST){super(e,Array.name,Set.name)}hasErrors(e,t,r){if(!e||(Array.isArray(e)?!e.length:!e.size))return;t=Array.isArray(t)?t:[t];let n,o=!0;for(let r=0;r<(Array.isArray(e)?e.length:e.size);r++)switch(n=e[r],typeof n){case"object":case"function":o=t.includes(n.constructor?.name);break;default:o=t.some((e=>typeof n===e.toLowerCase()))}return o?void 0:this.getMessage(r||this.message,t)}};t.ListValidator=c,t.ListValidator=c=n([(0,s.validator)(i.ValidationKeys.LIST),o("design:paramtypes",[String])],c)},169:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length>t?this.getMessage(r||this.message,t):void 0}};t.MaxLengthValidator=c,t.MaxLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX_LENGTH),o("design:paramtypes",[String])],c)},909:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Max param defined");return e>t?this.getMessage(r||this.message,t):void 0}}};t.MaxValidator=c,t.MaxValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX),o("design:paramtypes",[String])],c)},519:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length<t?this.getMessage(r||this.message,t):void 0}};t.MinLengthValidator=c,t.MinLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN_LENGTH),o("design:paramtypes",[String])],c)},889:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Min param defined");return e<t?this.getMessage(r||this.message,t):void 0}}};t.MinValidator=c,t.MinValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN),o("design:paramtypes",[String])],c)},354:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordValidator=void 0;const a=r(273),i=r(772),s=r(787);let c=class extends a.PatternValidator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PASSWORD){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||i.DEFAULT_ERROR_MESSAGES.PASSWORD,r||this.message)}};t.PasswordValidator=c,t.PasswordValidator=c=n([(0,s.validator)(i.ValidationKeys.PASSWORD),o("design:paramtypes",[Object])],c)},273:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PatternValidator=t.regexpParser=void 0;const a=r(116),i=r(772),s=r(787);t.regexpParser=new RegExp("^/(.+)/([gimus]*)$");let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PATTERN){super(e,"string")}getPattern(e){if(!t.regexpParser.test(e))return new RegExp(e);const r=e.match(t.regexpParser);return new RegExp(r[1],r[2])}hasErrors(e,t,r){if(e){if(!t)throw new Error("Missing Pattern");return(t="string"==typeof t?this.getPattern(t):t).lastIndex=0,t.test(e)?void 0:this.getMessage(r||this.message)}}};t.PatternValidator=c,t.PatternValidator=c=n([(0,s.validator)(i.ValidationKeys.PATTERN),o("design:paramtypes",[String])],c)},812:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.REQUIRED){super(e)}hasErrors(e,t){switch(typeof e){case"boolean":case"number":return void 0===e?this.getMessage(t||this.message):void 0;default:return e?void 0:this.getMessage(t||this.message)}}};t.RequiredValidator=c,t.RequiredValidator=c=n([(0,s.validator)(i.ValidationKeys.REQUIRED),o("design:paramtypes",[String])],c)},553:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.STEP){super(e,"number","string")}hasErrors(e,t,r){if(void 0!==e)return Number(e)%Number(t)!=0?this.getMessage(r||this.message,t):void 0}};t.StepValidator=c,t.StepValidator=c=n([(0,s.validator)(i.ValidationKeys.STEP),o("design:paramtypes",[String])],c)},375:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeValidator=void 0;const a=r(116),i=r(772),s=r(787),c=r(770),u=r(32),l=r(154);let d=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.TYPE){super(e)}hasErrors(e,t,r){if(void 0!==e)return(0,u.evaluateDesignTypes)(e,t)?void 0:this.getMessage(r||this.message,"string"==typeof t?t:Array.isArray(t)?t.join(", "):t.name,typeof e)}};t.TypeValidator=d,t.TypeValidator=d=n([(0,s.validator)(i.ValidationKeys.TYPE),o("design:paramtypes",[String])],d),c.Validation.register({validator:d,validationKey:l.ModelKeys.TYPE,save:!1})},964:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URLValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.URL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.URL,r)}};t.URLValidator=c,t.URLValidator=c=n([(0,s.validator)(a.ValidationKeys.URL),o("design:paramtypes",[String])],c)},116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const n=r(772),o=r(593),a=r(32);t.Validator=class{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){this.message=e,t.length&&(this.acceptedTypes=t),this.acceptedTypes&&(this.hasErrors=this.checkTypeAndHasErrors(this.hasErrors.bind(this)))}getMessage(e,...t){return(0,o.sf)(e,...t)}checkTypeAndHasErrors(e){return function(t,...r){return void 0!==t&&this.acceptedTypes?(0,a.checkTypes)(t,this.acceptedTypes)?e(t,...r):this.getMessage(n.DEFAULT_ERROR_MESSAGES.TYPE,this.acceptedTypes.join(", "),typeof t):e(t,...r)}.bind(this)}}},436:(e,t)=>{"use strict";function r(e){return e.constructor&&e.hasErrors}Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorRegistry=void 0,t.isValidator=r,t.ValidatorRegistry=class{constructor(...e){this.cache={},this.customKeyCache={},this.register(...e)}getCustomKeys(){return Object.assign({},this.customKeyCache)}getKeys(){return Object.keys(this.cache)}get(e){if(!(e in this.cache))return;const t=this.cache[e];if(r(t))return t;const n=new(t.default||t);return this.cache[e]=n,n}register(...e){e.forEach((e=>{if(r(e)){if(e.validationKey in this.cache)return;this.cache[e.validationKey]=e}else{const{validationKey:t,validator:r,save:n}=e;if(t in this.cache)return;if(this.cache[t]=r,!n)return;const o={};o[t.toUpperCase()]=t,this.customKeyCache=Object.assign({},this.customKeyCache,o)}}))}}},772:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PATTERNS=t.DEFAULT_ERROR_MESSAGES=t.DAYS_OF_WEEK_NAMES=t.MONTH_NAMES=t.ValidationKeys=void 0,t.ValidationKeys={REFLECT:"model.validation.",VALIDATOR:"validator",REQUIRED:"required",MIN:"min",MAX:"max",STEP:"step",MIN_LENGTH:"minlength",MAX_LENGTH:"maxlength",PATTERN:"pattern",EMAIL:"email",URL:"url",DATE:"date",TYPE:"type",PASSWORD:"password",LIST:"list"},t.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"],t.DAYS_OF_WEEK_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.DEFAULT_ERROR_MESSAGES={REQUIRED:"This field is required",MIN:"The minimum value is {0}",MAX:"The maximum value is {0}",MIN_LENGTH:"The minimum length is {0}",MAX_LENGTH:"The maximum length is {0}",PATTERN:"The value does not match the pattern",EMAIL:"The value is not a valid email",URL:"The value is not a valid URL",TYPE:"Invalid type. Expected {0}, received {1}",STEP:"Invalid value. Not a step of {0}",DATE:"Invalid value. not a valid Date",DEFAULT:"There is an Error",PASSWORD:"Must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",LIST:"Invalid list of {0}",MODEL_NOT_FOUND:"No model registered under {0}"},t.DEFAULT_PATTERNS={EMAIL:/[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/,URL:/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,PASSWORD:{CHAR8_ONE_OF_EACH:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&_\-.,])[A-Za-z\d@$!%*?&_\-.,]{8,}$/g}}},787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validator=function(...e){return(0,i.apply)((t=>(e.forEach((e=>{n.Validation.register({validator:t,validationKey:e,save:!0})})),t)),(0,i.metadata)((0,a.getValidationKey)(o.ValidationKeys.VALIDATOR),e))};const n=r(770),o=r(772),a=r(844),i=r(32)},493:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Validators=void 0;const a=r(395),i=r(375),s=r(354),c=r(553),u=r(964),l=r(273),d=r(889),f=r(519),p=r(909),y=r(169),h=r(812),g=r(335),v=r(407);o(r(772),t),o(r(395),t),o(r(787),t),o(r(335),t),o(r(407),t),o(r(169),t),o(r(909),t),o(r(519),t),o(r(889),t),o(r(354),t),o(r(273),t),o(r(812),t),o(r(553),t),o(r(168),t),o(r(375),t),o(r(964),t),o(r(116),t),o(r(436),t),t.Validators={DateValidator:a.DateValidator,EmailValidator:g.EmailValidator,ListValidator:v.ListValidator,MaxLengthValidator:y.MaxLengthValidator,MaxValidator:p.MaxValidator,MinLengthValidator:f.MinLengthValidator,MinValidator:d.MinValidator,PasswordValidator:s.PasswordValidator,PatternValidator:l.PatternValidator,RequiredValidator:h.RequiredValidator,StepValidator:c.StepValidator,TypeValidator:i.TypeValidator,URLValidator:u.URLValidator}},168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.required=function(e=n.DEFAULT_ERROR_MESSAGES.REQUIRED){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.REQUIRED),{message:e})},t.min=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN),{value:e,message:t,types:[Number.name,Date.name]})},t.max=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX),{value:e,message:t,types:[Number.name,Date.name]})},t.step=function(e,t=n.DEFAULT_ERROR_MESSAGES.STEP){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.STEP),{value:e,message:t,types:[Number.name]})},t.minlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.maxlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.pattern=function(e,t=n.DEFAULT_ERROR_MESSAGES.PATTERN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PATTERN),{value:"string"==typeof e?e:e.toString(),message:t,types:[String.name]})},t.email=function(e=n.DEFAULT_ERROR_MESSAGES.EMAIL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.EMAIL),{pattern:n.DEFAULT_PATTERNS.EMAIL,message:e,types:[String.name]})},t.url=function(e=n.DEFAULT_ERROR_MESSAGES.URL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.URL),{pattern:n.DEFAULT_PATTERNS.URL,message:e,types:[String.name]})},t.type=function(e,t=n.DEFAULT_ERROR_MESSAGES.TYPE){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.TYPE),{customTypes:e,message:t})},t.date=function(e="dd/MM/yyyy",t=n.DEFAULT_ERROR_MESSAGES.DATE){return(r,c)=>{(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.DATE),{format:e,message:t,types:[Date.name]})(r,c);const u=new WeakMap;Object.defineProperty(r,c,{configurable:!1,set(t){const r=Object.getOwnPropertyDescriptor(this,c);r&&!r.configurable||Object.defineProperty(this,c,{enumerable:!0,configurable:!1,get:()=>u.get(this),set:t=>{let r;try{r=(0,s.parseDate)(e,t),u.set(this,r)}catch(e){console.error((0,o.sf)("Failed to parse date: {0}",e.message||e))}}}),this[c]=t},get(){console.log("here")}})}},t.password=function(e=n.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,t=n.DEFAULT_ERROR_MESSAGES.PASSWORD){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PASSWORD),{pattern:e,message:t,types:[String.name]})},t.list=c,t.set=function(e,t=n.DEFAULT_ERROR_MESSAGES.LIST){return c(e,"Set",t)},r(630);const n=r(772),o=r(593),a=r(844),i=r(32),s=r(46);function c(e,t="Array",r=n.DEFAULT_ERROR_MESSAGES.LIST){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.LIST),{class:Array.isArray(e)?e.map((e=>e.name)):[e.name],type:t,message:r})}},965:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(493),t),o(r(475),t),o(r(792),t),o(r(844),t),o(r(770),t)},792:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValidationKey=function(e){return n.ValidationKeys.REFLECT+e};const n=r(772)},267:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReflectionKeys=void 0,function(e){e.TYPE="design:type"}(r||(t.ReflectionKeys=r={}))},530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metadata=function(e,t){return(r,n,o)=>{o?Reflect.defineMetadata(e,t,o.value):n?Reflect.defineMetadata(e,t,r,n):Reflect.defineMetadata(e,t,r)}},t.apply=function(...e){return(t,r,n)=>{for(const o of e)t instanceof Function&&!n?o(t):o(t,r,n)}},r(630)},651:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEqual=function e(t,r,...n){if(t===r)return!0;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(typeof t!=typeof r)return!1;if(t.prototype!==r.prototype)return!1;const o=Object.keys(t).filter((e=>-1===n.indexOf(e)));return o.length===Object.keys(r).filter((e=>-1===n.indexOf(e))).length&&o.every((o=>-1!==n.indexOf(o)||e(t[o],r[o],...n)))}},32:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(267),t),o(r(530),t),o(r(651),t),o(r(199),t),o(r(115),t),t.VERSION="0.3.0"},199:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyDecorators=a,t.getTypeFromDecorator=function(e,t){const r=a(n.ReflectionKeys.TYPE,e,t,!1);if(!r||!r.decorators)return;const o=r.decorators.shift(),i=o.props?o.props.name:void 0;return"Function"!==i?i:void 0},t.getAllPropertyDecorators=function(e,...t){if(t&&t.length)return Object.getOwnPropertyNames(e).reduce(((r,n)=>(t.forEach(((t,o)=>{const i=a(t,e,n,0!==o);r||(r={}),function(e,t,r){r&&r.length&&(e[t]||(e[t]=[]),e[t].push(...r))}(r,n,i.decorators)})),r)),void 0)},t.getAllProperties=function(e,t=!0,r="Object"){const n=[];let o=e;const a=function(){if(!t)return;const e=Object.getPrototypeOf(o);return e&&e.constructor.name!==r?(o=e,o):void 0};do{Object.getOwnPropertyNames(o).forEach((function(e){-1===n.indexOf(e)&&n.push(e)}))}while(a());return n},t.getClassDecorators=function(e,t){return Reflect.getOwnMetadataKeys(t.constructor).filter((t=>t.toString().startsWith(e))).reduce(((r,n)=>{const o={key:n.substring(e.length),props:Reflect.getMetadata(n,t.constructor)};return r.concat(o)}),[])},t.checkType=i,t.checkTypes=s,t.evaluateDesignTypes=function(e,t){switch(typeof t){case"string":return i(e,t);case"object":return!Array.isArray(t)||s(e,t);case"function":return!t.name||"Object"===t.name||i(e,t.name);default:return!0}},r(630);const n=r(267),o=r(651);function a(e,t,r,i=!1,s=!0,c){const u=function(e,t,r,o=!1,a){const i=Reflect.getMetadataKeys(t,r).filter((t=>o?t.toString().startsWith(e):t===n.ReflectionKeys.TYPE||t.toString().startsWith(e))).reduce(((o,a)=>{const i={key:a!==n.ReflectionKeys.TYPE?a.substring(e.length):a,props:Reflect.getMetadata(a,t,r)};return o.concat(i)}),a||[]);return{prop:r.toString(),decorators:i}}(e,t,r,i,c);return s&&Object.getPrototypeOf(t)!==Object.prototype?a(e,Object.getPrototypeOf(t.constructor),r,!0,s,u.decorators):{prop:u.prop,decorators:function(e){const r={};return e.filter((e=>e.key in r?((0,o.isEqual)(e.props,r[e.key])||console.log(`Found a similar decorator for the ${e.key} propertyof a ${t.constructor.name} model but with different attributes.The original one will be kept`),!1):(r[e.key.toString()]=e.props,!0)))}(u.decorators)}}function i(e,t){return typeof e===t||e.constructor&&e.constructor.name.toLowerCase()===t.toLowerCase()}function s(e,t){return!t.every((t=>!i(e,t)))}},630:(e,t,r)=>{var n;!function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==t.Reflect&&(n=o(t.Reflect,n)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!i&&!s,u={create:i?function(){return G(Object.create(null))}:s?function(){return G({__proto__:null})}:function(){return G({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,K(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!K(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(K(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=u.create(),t=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+i()}while(u.has(e,t));return e[t]=!0,t}function o(e,n){if(!r.call(e,t)){if(!n)return;Object.defineProperty(e,t,{value:u.create()})}return e[t]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function i(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):a(t,e),t}return a(new Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var n=e[r];4!==r&&6!==r&&8!==r||(t+="-"),n<16&&(t+="0"),t+=n.toString(16).toLowerCase()}return t}}(),y=n?Symbol.for("@reflect-metadata:registry"):void 0,h=function(){var e;return!S(y)&&j(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[y]),S(e)&&(e=function(){var e,r,n,o;S(y)||void 0===t.Reflect||y in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,a=e.deleteMetadata,i=new p;return{isProviderFor:function(e,t){var r=i.get(e);return!(S(r)||!r.has(t))||!!o(e,t).length&&(S(r)&&(r=new f,i.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:a}}(t.Reflect));var a=new p,i={registerProvider:s,getProvider:u,setProvider:h};return i;function s(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case S(r):r=t;break;case r===t:break;case S(n):n=t;break;case n===t:break;default:void 0===o&&(o=new f),o.add(t)}}function c(t,a){if(!S(r)){if(r.isProviderFor(t,a))return r;if(!S(n)){if(n.isProviderFor(t,a))return r;if(!S(o))for(var i=x(o);;){var s=F(i);if(!s)return;var c=I(s);if(c.isProviderFor(t,a))return k(i),c}}}if(!S(e)&&e.isProviderFor(t,a))return e}function u(e,t){var r,n=a.get(e);return S(n)||(r=n.get(t)),S(r)?(S(r=c(e,t))||(S(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function l(e){if(S(e))throw new TypeError;return r===e||n===e||!S(o)&&o.has(e)}function h(e,t,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(e,t);if(n!==r){if(!S(n))return!1;var o=a.get(e);S(o)&&(o=new d,a.set(e,o)),o.set(t,r)}return!0}}()),!S(y)&&j(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),g=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,o){n(r,o,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var o=n(t,r,!1);return!S(o)&&A(o.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var o=n(t,r,!1);if(!S(o))return o.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],o=n(e,t,!1);if(S(o))return r;for(var a=x(o.keys()),i=0;;){var s=F(a);if(!s)return r.length=i,r;var c=I(s);try{r[i]=c}catch(e){try{k(a)}finally{throw e}}i++}},OrdinaryDeleteMetadata:function(e,r,o){var a=n(r,o,!1);if(S(a))return!1;if(!a.delete(e))return!1;if(0===a.size){var i=t.get(r);S(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}};return h.registerProvider(r),r;function n(n,o,a){var i=t.get(n),s=!1;if(S(i)){if(!a)return;i=new d,t.set(n,i),s=!0}var c=i.get(o);if(S(c)){if(!a)return;if(c=new d,i.set(o,c),!e.setProvider(n,o,r))throw i.delete(o),s&&t.delete(n),new Error("Wrong provider for target.")}return c}}(h);function v(e,t,r){if(E(e,t,r))return!0;var n=U(t);return!w(n)&&v(e,n,r)}function E(e,t,r){var n=z(t,r,!1);return!S(n)&&A(n.OrdinaryHasOwnMetadata(e,t,r))}function _(e,t,r){if(E(e,t,r))return O(e,t,r);var n=U(t);return w(n)?void 0:_(e,n,r)}function O(e,t,r){var n=z(t,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function m(e,t,r,n){z(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function M(e,t){var r=b(e,t),n=U(e);if(null===n)return r;var o=M(n,t);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new f,i=[],s=0,c=r;s<c.length;s++){var u=c[s];a.has(u)||(a.add(u),i.push(u))}for(var l=0,d=o;l<d.length;l++)u=d[l],a.has(u)||(a.add(u),i.push(u));return i}function b(e,t){var r=z(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function S(e){return void 0===e}function w(e){return null===e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function P(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=N(e,o);if(void 0!==n){var a=n.call(e,r);if(j(a))throw new TypeError;return a}return function(e,t){if("string"===t){var r=e.toString;if(D(r)&&!j(o=r.call(e)))return o;if(D(n=e.valueOf)&&!j(o=n.call(e)))return o}else{var n;if(D(n=e.valueOf)&&!j(o=n.call(e)))return o;var o,a=e.toString;if(D(a)&&!j(o=a.call(e)))return o}throw new TypeError}(e,"default"===r?"number":r)}function A(e){return!!e}function T(e){var t=P(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function D(e){return"function"==typeof e}function L(e){return"function"==typeof e}function K(e,t){return e===t||e!=e&&t!=t}function N(e,t){var r=e[t];if(null!=r){if(!D(r))throw new TypeError;return r}}function x(e){var t=N(e,a);if(!D(t))throw new TypeError;var r=t.call(e);if(!j(r))throw new TypeError;return r}function I(e){return e.value}function F(e){var t=e.next();return!t.done&&t}function k(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var o=n.constructor;return"function"!=typeof o||o===e?t:o}function z(e,t,r){var n=h.getProvider(e,t);if(!S(n))return n;if(r){if(h.setProvider(e,t,g))return g;throw new Error("Illegal state.")}}function G(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(S(r)){if(!V(e))throw new TypeError;if(!L(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!S(n)&&!w(n)){if(!L(n))throw new TypeError;t=n}}return t}(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(n)&&!S(n)&&!w(n))throw new TypeError;return w(n)&&(n=void 0),function(e,t,r,n){for(var o=e.length-1;o>=0;--o){var a=(0,e[o])(t,r,n);if(!S(a)&&!w(a)){if(!j(a))throw new TypeError;n=a}}return n}(e,t,r=T(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!j(r))throw new TypeError;if(!S(n)&&!function(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;m(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!j(r))throw new TypeError;return S(n)||(n=T(n)),m(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),v(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),E(e,t,r)})),e("getMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),_(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),O(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return S(t)||(t=T(t)),M(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return S(t)||(t=T(t)),b(e,t)})),e("deleteMetadata",(function(e,t,r){if(!j(t))throw new TypeError;if(S(r)||(r=T(r)),!j(t))throw new TypeError;S(r)||(r=T(r));var n=z(t,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(729)})())); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("decorator-validation",[],t):"object"==typeof exports?exports["decorator-validation"]=t():e["decorator-validation"]=t()}(this,(()=>(()=>{var e={729:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(935),t),o(r(965),t),o(r(847),t),t.VERSION="1.3.7"},6:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const n=r(735),o=r(936),a=r(32),i=r(192),s=r(523),c=r(710),u=r(154),l=r(772),d=r(593),f=r(402);let p,y;class h{constructor(e){}hasErrors(...e){return(0,i.validate)(this,...e)}equals(e,...t){return(0,a.isEqual)(this,e,...t)}serialize(){return h.serialize(this)}toString(){return this.constructor.name+": "+JSON.stringify(this,void 0,2)}hash(){return h.hash(this)}static deserialize(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.SERIALIZATION),this.constructor);return t&&t.serializer?n.Serialization.deserialize(e,t.serializer,...t.args||[]):n.Serialization.deserialize(e)}static fromObject(e,t){t||(t={});for(const r of h.getAttributes(e))e[r]=t[r]||void 0;return e}static fromModel(e,t){let r,n;t||(t={});const o=h.getAttributes(e);for(const i of o){if(e[i]=t[i]||void 0,"object"!=typeof e[i])continue;const o=(0,c.isPropertyModel)(e,i);if(o){try{e[i]=h.build(e[i],"string"==typeof o?o:void 0)}catch(e){console.log(e)}continue}const s=(0,a.getPropertyDecorators)(l.ValidationKeys.REFLECT,e,i).decorators;if(r=s.filter((e=>-1!==[u.ModelKeys.TYPE,l.ValidationKeys.TYPE].indexOf(e.key))),!r||!r.length)throw new Error((0,d.sf)("failed to find decorators for property {0}",i));n=r.pop();const p=n.props.name?[n.props.name]:Array.isArray(n.props.customTypes)?n.props.customTypes:[n.props.customTypes],y=Object.values(f.ReservedModels).map((e=>e.toLowerCase()));p.forEach((t=>{if(-1===y.indexOf(t.toLowerCase()))try{switch(t){case"Array":case"Set":if(s.length){const r=s.find((e=>e.key===l.ValidationKeys.LIST));if(r){const n=r.props.class.find((e=>!f.jsTypes.includes(e.toLowerCase())));if("Array"===t&&(e[i]=e[i].map((e=>["object","function"].includes(typeof e)&&n?h.build(e,n):e))),"Set"===t){const t=new Set;for(const r of e[i])["object","function"].includes(typeof r)&&n?t.add(h.build(r,n)):t.add(r);e[i]=t}}}break;default:e[i]&&(e[i]=h.build(e[i],t))}}catch(e){console.log(e)}}))}return e}static setBuilder(e){p=e}static getBuilder(){return p}static getRegistry(){return y||(y=new o.ModelRegistryManager),y}static setRegistry(e){y=e}static register(e,t){return h.getRegistry().register(e,t)}static get(e){return h.getRegistry().get(e)}static build(e={},t){return h.getRegistry().build(e,t)}static getMetadata(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.MODEL),e.constructor);if(!t)throw new Error("could not find metadata for provided "+e.constructor.name);return t}static getAttributes(e){const t=[];let r=e instanceof h?Object.getPrototypeOf(e):e.prototype;for(;null!=r;){const e=r[u.ModelKeys.ATTRIBUTE];e&&t.push(...e),r=Object.getPrototypeOf(r)}return t}static equals(e,t,...r){return(0,a.isEqual)(e,t,...r)}static hasErrors(e,...t){return(0,i.validate)(e,...t)}static serialize(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.SERIALIZATION),e.constructor);return t&&t.serializer?n.Serialization.serialize(this,t.serializer,...t.args||[]):n.Serialization.serialize(e)}static hash(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.HASHING),e.constructor);return t&&t.algorithm?s.Hashing.hash(e,t.algorithm,...t.args||[]):s.Hashing.hash(e)}static key(e){return u.ModelKeys.REFLECT+e}}t.Model=h},19:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelErrorDefinition=void 0,t.ModelErrorDefinition=class{constructor(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t]&&Object.defineProperty(this,t,{enumerable:!0,configurable:!1,value:e[t],writable:!1})}toString(){const e=this;return Object.keys(e).filter((t=>Object.prototype.hasOwnProperty.call(e,t)&&"function"!=typeof e[t])).reduce(((t,r)=>{let n=Object.keys(e[r]).reduce(((t,n)=>(t?t+=`\n${e[r][n]}`:t=e[r][n],t)),void 0);return n&&(n=`${r} - ${n}`,t?t+=`\n${n}`:t=n),t}),"")}}},936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelRegistryManager=void 0,t.bulkModelRegister=function(...e){e.forEach((e=>{const t=e.constructor?e.constructor:e;n.Model.register(t,e.name)}))};const n=r(6),o=r(593),a=r(710);t.ModelRegistryManager=class{constructor(e=a.isModel){this.cache={},this.testFunction=e}register(e,t){if("function"!=typeof e)throw new Error("Model registering failed. Missing Class name or constructor");t=t||e.name,this.cache[t]=e}get(e){try{return this.cache[e]}catch(e){return}}build(e={},t){if(!t&&!this.testFunction(e))throw new Error("Provided obj is not a Model object");const r=t||n.Model.getMetadata(e);if(!(r in this.cache))throw new Error((0,o.sf)("Provided class {0} is not a registered Model object",r));return new this.cache[r](e)}}},402:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.jsTypes=t.ReservedModels=t.Primitives=void 0,function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint"}(r||(t.Primitives=r={})),function(e){e.STRING="string",e.OBJECT="object",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint",e.DATE="date"}(n||(t.ReservedModels=n={})),t.jsTypes=["string","array","number","boolean","symbol","function","object","undefined","null","bigint"]},38:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.construct=function(e,...t){const r=(...t)=>new e(...t);return r.prototype=e.prototype,r(...t)},t.findLastProtoBeforeObject=function(e){let t=Object.getPrototypeOf(e);if(t===Object.prototype)return e;for(;t!==Object.prototype;){if(t=Object.getPrototypeOf(t),t===Object.prototype)return t;if(Object.getPrototypeOf(t)===Object.prototype)return t}throw new Error("Could not find proper prototype")},t.bindModelPrototype=function(e){if(e instanceof n.Model)return;function t(e,t){Object.setPrototypeOf(e,t)}const r=Object.getPrototypeOf(e);if(r===Object.prototype)return t(e,n.Model.prototype);for(;r!==Object.prototype;){const e=Object.getPrototypeOf(r);if(e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return t(r,n.Model.prototype)}throw new Error("Could not find proper prototype to bind")};const n=r(6)},893:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.model=function(e){return t=>{const r=function(...r){const s=(0,n.construct)(t,...r);(0,n.bindModelPrototype)(s);const c=a.Model.getBuilder();return c&&c(s,r.length?r[0]:void 0),(0,i.metadata)(a.Model.key(o.ModelKeys.MODEL),t.name)(s.constructor),e&&e(s,...r),s};return r.prototype=t.prototype,Object.defineProperty(r,"name",{writable:!1,enumerable:!0,configurable:!1,value:t.prototype.constructor.name}),(0,i.metadata)(a.Model.key(o.ModelKeys.MODEL),t.name)(t),a.Model.register(r,t.name),r}},t.hashedBy=function(e,...t){return(0,i.metadata)(a.Model.key(o.ModelKeys.HASHING),{algorithm:e,args:t})},t.serializedBy=function(e,...t){return(0,i.metadata)(a.Model.key(o.ModelKeys.SERIALIZATION),{serializer:e,args:t})};const n=r(38),o=r(154),a=r(6),i=r(32)},847:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(402),t),o(r(38),t),o(r(893),t),o(r(6),t),o(r(19),t),o(r(936),t),o(r(282),t),o(r(710),t),o(r(192),t)},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPropertyModel=function(e,t){if(a(e[t]))return!0;const r=Reflect.getMetadata(n.ModelKeys.TYPE,e,t);return o.Model.get(r.name)?r.name:void 0},t.isModel=a;const n=r(154),o=r(6);function a(e){try{return e instanceof o.Model||!!o.Model.getMetadata(e)}catch(e){return!1}}},192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(e,...t){const r=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&r.push((0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,n));let d;for(const t of r){const{prop:r,decorators:n}=t;if(!n||!n.length)continue;const o=n[0];let i;n.find((e=>e.key===u.ValidationKeys.TYPE||!!e.props.types?.find((e=>e===o.props.name))))&&n.shift();for(const t of n){const n=c.Validation.get(t.key);if(!n)throw new Error(`Missing validator for ${t.key}`);const o=n.hasErrors(e[r.toString()],...t.key===a.ModelKeys.TYPE?[t.props]:Object.values(t.props));o&&(i=i||{},i[t.key]=o)}i&&(d=d||{},d[t.prop.toString()]=i)}for(const t of Object.keys(e).filter((e=>!d||!d[e]))){let r;const n=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators,c=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators.filter((e=>-1!==[a.ModelKeys.TYPE,u.ValidationKeys.TYPE].indexOf(e.key)));if(!c||!c.length)continue;const f=c.pop(),p=f.props.name?[f.props.name]:Array.isArray(f.props.customTypes)?f.props.customTypes:[f.props.customTypes],y=Object.values(s.ReservedModels).map((e=>e.toLowerCase()));for(const o of p){if(-1===y.indexOf(o.toLowerCase())){const a=Array.isArray(e[t])?u.ValidationKeys.LIST:u.ValidationKeys.TYPE,s=n.find((e=>e.key===a))||{};let c=[];if(s&&s.props){const r=Array.isArray(e[t])?s.props.class:s.props.customTypes;r&&(c=Array.isArray(r)?r.map((e=>`${e}`.toLowerCase())):[r.toLowerCase()])}const d=(e,t)=>{if("object"==typeof t||"function"==typeof t)return(0,l.isModel)(t)?t.hasErrors():c.includes(typeof t)?void 0:"Value has no validatable type"};switch(o){case Array.name:case Set.name:n.length&&n.find((e=>e.key===u.ValidationKeys.LIST))&&(r=(o===Array.name?e[t]:e[t].values()).map((e=>d(t,e))).filter((e=>!!e)),r?.length||(r=void 0));break;default:try{e[t]&&(r=d(t,e[t]))}catch(e){console.warn((0,i.sf)("Model should be validatable but its not: "+e))}}}r&&(d=d||{},d[t]=r)}}return d?new n.ModelErrorDefinition(d):void 0};const n=r(19),o=r(32),a=r(154),i=r(593),s=r(402),c=r(770),u=r(772),l=r(710)},154:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModelKeys=void 0,function(e){e.REFLECT="decaf.model.",e.TYPE="design:type",e.PARAMS="design:paramtypes",e.RETURN="design:returntype",e.MODEL="model",e.ANCHOR="__model",e.CONSTRUCTION="constructed-by",e.ATTRIBUTE="__attributes",e.HASHING="hashing",e.SERIALIZATION="serialization"}(r||(t.ModelKeys=r={}))},46:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromFormat=a,t.bindDateToString=i,t.isValidDate=s,t.twoDigitPad=c,t.formatDate=u,t.parseDate=function(e,t){let r;if(t){if(t instanceof Date)try{r=a(u(t,e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t.toString(),e))}else if("string"==typeof t)r=a(t,e);else if("number"==typeof t)r=a(u(new Date(t),e),e);else{if(!s(t))throw new Error(`Invalid value provided ${t}`);try{r=a(u(new Date(t),e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t,e))}}return i(r,e)}},r(630);const n=r(772),o=r(593);function a(e,t){let r=t;r.match(/hh/)?r=r.replace("hh","(?<hour>\\d{2})"):r.match(/h/)?r=r.replace("h","(?<hour>\\d{1,2})"):r.match(/HH/)?r=r.replace("HH","(?<hour>\\d{2})"):r.match(/H/)&&(r=r.replace("H","(?<hour>\\d{1,2})")),r.match(/mm/)?r=r.replace("mm","(?<minutes>\\d{2})"):r.match(/m/)&&(r=r.replace("m","(?<minutes>\\d{1,2})")),r.match(/ss/)?r=r.replace("ss","(?<seconds>\\d{2})"):r.match(/s/)&&(r=r.replace("s","(?<seconds>\\d{1,2})")),r.match(/dd/)?r=r.replace("dd","(?<day>\\d{2})"):r.match(/d/)&&(r=r.replace("d","(?<day>\\d{1,2})")),r.match(/EEEE/)?r=r.replace("EEEE","(?<dayofweek>\\w+)"):r.match(/EEEE/)&&(r=r.replace("EEE","(?<dayofweek>\\w+)")),r.match(/yyyy/)?r=r.replace("yyyy","(?<year>\\d{4})"):r.match(/yy/)&&(r=r.replace("yy","(?<year>\\d{2})")),r.match(/MMMM/)?r=r.replace("MMMM","(?<monthname>\\w+)"):r.match(/MMM/)&&(r=r.replace("MMM","(?<monthnamesmall>\\w+)")),r.match(/MM/)?r=r.replace("MM","(?<month>\\d{2})"):r.match(/M/)&&(r=r.replace("M","(?<month>\\d{1,2})")),r=r.replace("S","(?<milis>\\d{1,3})").replace("aaa","(?<ampm>\\w{2})");const o=new RegExp(r,"g").exec(e);if(!o||!o.groups)return new Date(e);const a=function(e){if(!e)return 0;const t=parseInt(e);return isNaN(t)?0:t},i=a(o.groups.year),s=a(o.groups.day),c=o.groups.ampm;let u=a(o.groups.hour);c&&(u="PM"===c?u+12:u);const l=a(o.groups.minutes),d=a(o.groups.seconds),f=a(o.groups.milis),p=o.groups.monthname,y=o.groups.monthnamesmall;let h=o.groups.month;if(p)h=n.MONTH_NAMES.indexOf(p);else if(y){const t=n.MONTH_NAMES.find((e=>e.toLowerCase().startsWith(y.toLowerCase())));if(!t)return new Date(e);h=n.MONTH_NAMES.indexOf(t)}else h=a(`${h}`);return new Date(i,h-1,s,u,l,d,f)}function i(e,t){if(!e)return;const r=()=>u(e,t);return Object.defineProperty(e,"toISOString",{enumerable:!1,configurable:!1,value:r}),Object.defineProperty(e,"toString",{enumerable:!1,configurable:!1,value:r}),e}function s(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function c(e){return e<10?"0"+e:e.toString()}function u(e,t="yyyy/MM/dd"){const r=e.getDate(),o=e.getMonth(),a=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),d=i%12,f=c(d),p=c(i),y=c(s),h=c(u),g=i<12?"AM":"PM",v=n.DAYS_OF_WEEK_NAMES[e.getDay()],E=v.substr(0,3),_=c(r),M=o+1,b=c(M),O=n.MONTH_NAMES[o],m=O.substr(0,3),R=a+"",S=R.substr(2,2);return(t=t.replace("hh",f).replace("h",d.toString()).replace("HH",p).replace("H",i.toString()).replace("mm",y).replace("m",s.toString()).replace("ss",h).replace("s",u.toString()).replace("S",l.toString()).replace("dd",_).replace("d",r.toString()).replace("EEEE",v).replace("EEE",E).replace("yyyy",R).replace("yy",S).replace("aaa",g)).indexOf("MMM")>-1?t.replace("MMMM",O).replace("MMM",m):t.replace("MM",b).replace("M",M.toString())}},253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prop=a,t.propMetadata=function(e,t){return(0,n.apply)(a(),(0,n.metadata)(e,t))};const n=r(32),o=r(154);function a(){return(e,t)=>{let r;r=Object.prototype.hasOwnProperty.call(e,o.ModelKeys.ATTRIBUTE)?e[o.ModelKeys.ATTRIBUTE]:e[o.ModelKeys.ATTRIBUTE]=[],r.includes(t)||r.push(t)}}},523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hashing=t.DefaultHashingMethod=void 0,t.hashCode=o,t.hashSerialization=function(e){return o(n.Serialization.serialize(e))},t.hashObj=a;const n=r(735);function o(e){e=String(e);let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t.toString()}function a(e){const t=function(e,t){const r=n(t);return"string"==typeof r?n((e||"")+n(t)):0|(e=((e=e||0)<<5)-e+r)},r=o,n=function(e){return void 0===e?"":-1!==["string","number","symbol"].indexOf(typeof e)?r(e.toString()):e instanceof Date?r(e.getTime()):Array.isArray(e)?e.reduce(t,void 0):Object.values(e).reduce(t,void 0)},a=Object.values(e).reduce(t,0);return("number"==typeof a?Math.abs(a):a).toString()}t.DefaultHashingMethod="default";class i{static{this.current=t.DefaultHashingMethod}static{this.cache={default:a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No hashing method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Hashing method ${e} already registered`);this.cache[e]=t,r&&(this.current=e)}static hash(e,t,...r){return t?this.get(t)(e,...r):this.get(this.current)(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Hashing=i},935:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(154),t),o(r(46),t),o(r(253),t),o(r(523),t),o(r(904),t),o(r(735),t),o(r(593),t)},904:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},735:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serialization=t.DefaultSerializationMethod=t.JSONSerializer=void 0;const n=r(6),o=r(154);class a{preSerialize(e){const t=Object.assign({},e),r=n.Model.getMetadata(e);return t[o.ModelKeys.ANCHOR]=r||e.constructor.name,t}deserialize(e){const t=JSON.parse(e),r=t[o.ModelKeys.ANCHOR];if(!r)throw new Error("Could not find class reference in serialized model");return n.Model.build(t,r)}serialize(e){return JSON.stringify(this.preSerialize(e))}}t.JSONSerializer=a,t.DefaultSerializationMethod="json";class i{static{this.current=t.DefaultSerializationMethod}static{this.cache={json:new a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No serialization method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Serialization method ${e} already registered`);this.cache[e]=new t,r&&(this.current=e)}static serialize(e,t,...r){return t?this.get(t).serialize(e,...r):this.get(this.current).serialize(e,...r)}static deserialize(e,t,...r){return t?this.get(t).deserialize(e,...r):this.get(this.current).deserialize(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Serialization=i},593:(e,t)=>{"use strict";function r(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r].toString():"undefined"}))}Object.defineProperty(t,"__esModule",{value:!0}),t.sf=void 0,t.stringFormat=r,t.sf=r},770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validation=void 0;const n=r(436),o=r(772);class a{static{this.actingValidatorRegistry=void 0}constructor(){}static setRegistry(e,t){t&&a.actingValidatorRegistry&&a.actingValidatorRegistry.getKeys().forEach((r=>{const n=e.get(r);n&&e.register(t(n))})),a.actingValidatorRegistry=e}static getRegistry(){return a.actingValidatorRegistry||(a.actingValidatorRegistry=new n.ValidatorRegistry),a.actingValidatorRegistry}static get(e){return a.getRegistry().get(e)}static register(...e){return a.getRegistry().register(...e)}static key(e){return o.ValidationKeys.REFLECT+e}}t.Validation=a},395:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.DATE){super(e,Number.name,Date.name,String.name)}hasErrors(e,t,r){if(void 0!==e)return"string"==typeof e&&(e=new Date(e)),isNaN(e.getDate())?this.getMessage(r||this.message):void 0}};t.DateValidator=c,t.DateValidator=c=n([(0,s.validator)(i.ValidationKeys.DATE),o("design:paramtypes",[String])],c)},335:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.EMAIL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.EMAIL,r)}};t.EmailValidator=c,t.EmailValidator=c=n([(0,s.validator)(a.ValidationKeys.EMAIL),o("design:paramtypes",[String])],c)},407:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ListValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.LIST){super(e,Array.name,Set.name)}hasErrors(e,t,r){if(!e||(Array.isArray(e)?!e.length:!e.size))return;t=Array.isArray(t)?t:[t];let n,o=!0;for(let r=0;r<(Array.isArray(e)?e.length:e.size);r++)switch(n=e[r],typeof n){case"object":case"function":o=t.includes(n.constructor?.name);break;default:o=t.some((e=>typeof n===e.toLowerCase()))}return o?void 0:this.getMessage(r||this.message,t)}};t.ListValidator=c,t.ListValidator=c=n([(0,s.validator)(i.ValidationKeys.LIST),o("design:paramtypes",[String])],c)},169:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length>t?this.getMessage(r||this.message,t):void 0}};t.MaxLengthValidator=c,t.MaxLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX_LENGTH),o("design:paramtypes",[String])],c)},909:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Max param defined");return e>t?this.getMessage(r||this.message,t):void 0}}};t.MaxValidator=c,t.MaxValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX),o("design:paramtypes",[String])],c)},519:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length<t?this.getMessage(r||this.message,t):void 0}};t.MinLengthValidator=c,t.MinLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN_LENGTH),o("design:paramtypes",[String])],c)},889:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Min param defined");return e<t?this.getMessage(r||this.message,t):void 0}}};t.MinValidator=c,t.MinValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN),o("design:paramtypes",[String])],c)},354:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordValidator=void 0;const a=r(273),i=r(772),s=r(787);let c=class extends a.PatternValidator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PASSWORD){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||i.DEFAULT_ERROR_MESSAGES.PASSWORD,r||this.message)}};t.PasswordValidator=c,t.PasswordValidator=c=n([(0,s.validator)(i.ValidationKeys.PASSWORD),o("design:paramtypes",[Object])],c)},273:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PatternValidator=t.regexpParser=void 0;const a=r(116),i=r(772),s=r(787);t.regexpParser=new RegExp("^/(.+)/([gimus]*)$");let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PATTERN){super(e,"string")}getPattern(e){if(!t.regexpParser.test(e))return new RegExp(e);const r=e.match(t.regexpParser);return new RegExp(r[1],r[2])}hasErrors(e,t,r){if(e){if(!t)throw new Error("Missing Pattern");return(t="string"==typeof t?this.getPattern(t):t).lastIndex=0,t.test(e)?void 0:this.getMessage(r||this.message)}}};t.PatternValidator=c,t.PatternValidator=c=n([(0,s.validator)(i.ValidationKeys.PATTERN),o("design:paramtypes",[String])],c)},812:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.REQUIRED){super(e)}hasErrors(e,t){switch(typeof e){case"boolean":case"number":return void 0===e?this.getMessage(t||this.message):void 0;default:return e?void 0:this.getMessage(t||this.message)}}};t.RequiredValidator=c,t.RequiredValidator=c=n([(0,s.validator)(i.ValidationKeys.REQUIRED),o("design:paramtypes",[String])],c)},553:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.STEP){super(e,"number","string")}hasErrors(e,t,r){if(void 0!==e)return Number(e)%Number(t)!=0?this.getMessage(r||this.message,t):void 0}};t.StepValidator=c,t.StepValidator=c=n([(0,s.validator)(i.ValidationKeys.STEP),o("design:paramtypes",[String])],c)},375:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeValidator=void 0;const a=r(116),i=r(772),s=r(787),c=r(770),u=r(32),l=r(154);let d=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.TYPE){super(e)}hasErrors(e,t,r){if(void 0!==e)return(0,u.evaluateDesignTypes)(e,t)?void 0:this.getMessage(r||this.message,"string"==typeof t?t:Array.isArray(t)?t.join(", "):t.name,typeof e)}};t.TypeValidator=d,t.TypeValidator=d=n([(0,s.validator)(i.ValidationKeys.TYPE),o("design:paramtypes",[String])],d),c.Validation.register({validator:d,validationKey:l.ModelKeys.TYPE,save:!1})},964:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URLValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.URL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.URL,r)}};t.URLValidator=c,t.URLValidator=c=n([(0,s.validator)(a.ValidationKeys.URL),o("design:paramtypes",[String])],c)},116:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const n=r(772),o=r(593),a=r(32);t.Validator=class{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){this.message=e,t.length&&(this.acceptedTypes=t),this.acceptedTypes&&(this.hasErrors=this.checkTypeAndHasErrors(this.hasErrors.bind(this)))}getMessage(e,...t){return(0,o.sf)(e,...t)}checkTypeAndHasErrors(e){return function(t,...r){return void 0!==t&&this.acceptedTypes?(0,a.checkTypes)(t,this.acceptedTypes)?e(t,...r):this.getMessage(n.DEFAULT_ERROR_MESSAGES.TYPE,this.acceptedTypes.join(", "),typeof t):e(t,...r)}.bind(this)}}},436:(e,t)=>{"use strict";function r(e){return e.constructor&&e.hasErrors}Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorRegistry=void 0,t.isValidator=r,t.ValidatorRegistry=class{constructor(...e){this.cache={},this.customKeyCache={},this.register(...e)}getCustomKeys(){return Object.assign({},this.customKeyCache)}getKeys(){return Object.keys(this.cache)}get(e){if(!(e in this.cache))return;const t=this.cache[e];if(r(t))return t;const n=new(t.default||t);return this.cache[e]=n,n}register(...e){e.forEach((e=>{if(r(e)){if(e.validationKey in this.cache)return;this.cache[e.validationKey]=e}else{const{validationKey:t,validator:r,save:n}=e;if(t in this.cache)return;if(this.cache[t]=r,!n)return;const o={};o[t.toUpperCase()]=t,this.customKeyCache=Object.assign({},this.customKeyCache,o)}}))}}},772:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PATTERNS=t.DEFAULT_ERROR_MESSAGES=t.DAYS_OF_WEEK_NAMES=t.MONTH_NAMES=t.ValidationKeys=void 0;const n=r(154);t.ValidationKeys={REFLECT:`${n.ModelKeys.REFLECT}validation.`,VALIDATOR:"validator",REQUIRED:"required",MIN:"min",MAX:"max",STEP:"step",MIN_LENGTH:"minlength",MAX_LENGTH:"maxlength",PATTERN:"pattern",EMAIL:"email",URL:"url",DATE:"date",TYPE:"type",PASSWORD:"password",LIST:"list"},t.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"],t.DAYS_OF_WEEK_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.DEFAULT_ERROR_MESSAGES={REQUIRED:"This field is required",MIN:"The minimum value is {0}",MAX:"The maximum value is {0}",MIN_LENGTH:"The minimum length is {0}",MAX_LENGTH:"The maximum length is {0}",PATTERN:"The value does not match the pattern",EMAIL:"The value is not a valid email",URL:"The value is not a valid URL",TYPE:"Invalid type. Expected {0}, received {1}",STEP:"Invalid value. Not a step of {0}",DATE:"Invalid value. not a valid Date",DEFAULT:"There is an Error",PASSWORD:"Must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",LIST:"Invalid list of {0}",MODEL_NOT_FOUND:"No model registered under {0}"},t.DEFAULT_PATTERNS={EMAIL:/[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/,URL:/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,PASSWORD:{CHAR8_ONE_OF_EACH:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&_\-.,])[A-Za-z\d@$!%*?&_\-.,]{8,}$/g}}},787:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validator=function(...e){return(0,a.apply)((t=>(e.forEach((e=>{n.Validation.register({validator:t,validationKey:e,save:!0})})),t)),(0,a.metadata)(n.Validation.key(o.ValidationKeys.VALIDATOR),e))};const n=r(770),o=r(772),a=r(32)},493:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Validators=void 0;const a=r(395),i=r(375),s=r(354),c=r(553),u=r(964),l=r(273),d=r(889),f=r(519),p=r(909),y=r(169),h=r(812),g=r(335),v=r(407);o(r(772),t),o(r(395),t),o(r(787),t),o(r(335),t),o(r(407),t),o(r(169),t),o(r(909),t),o(r(519),t),o(r(889),t),o(r(354),t),o(r(273),t),o(r(812),t),o(r(553),t),o(r(168),t),o(r(375),t),o(r(964),t),o(r(116),t),o(r(436),t),t.Validators={DateValidator:a.DateValidator,EmailValidator:g.EmailValidator,ListValidator:v.ListValidator,MaxLengthValidator:y.MaxLengthValidator,MaxValidator:p.MaxValidator,MinLengthValidator:f.MinLengthValidator,MinValidator:d.MinValidator,PasswordValidator:s.PasswordValidator,PatternValidator:l.PatternValidator,RequiredValidator:h.RequiredValidator,StepValidator:c.StepValidator,TypeValidator:i.TypeValidator,URLValidator:u.URLValidator}},168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.required=function(e=n.DEFAULT_ERROR_MESSAGES.REQUIRED){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.REQUIRED),{message:e})},t.min=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MIN),{value:e,message:t,types:[Number.name,Date.name]})},t.max=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MAX),{value:e,message:t,types:[Number.name,Date.name]})},t.step=function(e,t=n.DEFAULT_ERROR_MESSAGES.STEP){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.STEP),{value:e,message:t,types:[Number.name]})},t.minlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MIN_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.maxlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MAX_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.pattern=function(e,t=n.DEFAULT_ERROR_MESSAGES.PATTERN){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.PATTERN),{value:"string"==typeof e?e:e.toString(),message:t,types:[String.name]})},t.email=function(e=n.DEFAULT_ERROR_MESSAGES.EMAIL){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.EMAIL),{pattern:n.DEFAULT_PATTERNS.EMAIL,message:e,types:[String.name]})},t.url=function(e=n.DEFAULT_ERROR_MESSAGES.URL){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.URL),{pattern:n.DEFAULT_PATTERNS.URL,message:e,types:[String.name]})},t.type=function(e,t=n.DEFAULT_ERROR_MESSAGES.TYPE){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.TYPE),{customTypes:e,message:t})},t.date=function(e="dd/MM/yyyy",t=n.DEFAULT_ERROR_MESSAGES.DATE){return(r,c)=>{(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.DATE),{format:e,message:t,types:[Date.name]})(r,c);const u=new WeakMap;Object.defineProperty(r,c,{configurable:!1,set(t){const r=Object.getOwnPropertyDescriptor(this,c);r&&!r.configurable||Object.defineProperty(this,c,{enumerable:!0,configurable:!1,get:()=>u.get(this),set:t=>{let r;try{r=(0,a.parseDate)(e,t),u.set(this,r)}catch(e){console.error((0,o.sf)("Failed to parse date: {0}",e.message||e))}}}),this[c]=t},get(){console.log("here")}})}},t.password=function(e=n.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,t=n.DEFAULT_ERROR_MESSAGES.PASSWORD){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.PASSWORD),{pattern:e,message:t,types:[String.name]})},t.list=c,t.set=function(e,t=n.DEFAULT_ERROR_MESSAGES.LIST){return c(e,"Set",t)},r(630);const n=r(772),o=r(593),a=r(46),i=r(253),s=r(770);function c(e,t="Array",r=n.DEFAULT_ERROR_MESSAGES.LIST){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.LIST),{class:Array.isArray(e)?e.map((e=>e.name)):[e.name],type:t,message:r})}},965:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(493),t),o(r(475),t),o(r(792),t),o(r(770),t)},792:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},267:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReflectionKeys=void 0,function(e){e.TYPE="design:type"}(r||(t.ReflectionKeys=r={}))},530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metadata=function(e,t){return(r,n,o)=>{o?Reflect.defineMetadata(e,t,o.value):n?Reflect.defineMetadata(e,t,r,n):Reflect.defineMetadata(e,t,r)}},t.apply=function(...e){return(t,r,n)=>{for(const o of e)t instanceof Function&&!n?o(t):o(t,r,n)}},r(630)},651:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEqual=function e(t,r,...n){if(t===r)return!0;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(typeof t!=typeof r)return!1;if(t.prototype!==r.prototype)return!1;const o=Object.keys(t).filter((e=>-1===n.indexOf(e)));return o.length===Object.keys(r).filter((e=>-1===n.indexOf(e))).length&&o.every((o=>-1!==n.indexOf(o)||e(t[o],r[o],...n)))}},32:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(267),t),o(r(530),t),o(r(651),t),o(r(199),t),o(r(115),t),t.VERSION="0.3.0"},199:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyDecorators=a,t.getTypeFromDecorator=function(e,t){const r=a(n.ReflectionKeys.TYPE,e,t,!1);if(!r||!r.decorators)return;const o=r.decorators.shift(),i=o.props?o.props.name:void 0;return"Function"!==i?i:void 0},t.getAllPropertyDecorators=function(e,...t){if(t&&t.length)return Object.getOwnPropertyNames(e).reduce(((r,n)=>(t.forEach(((t,o)=>{const i=a(t,e,n,0!==o);r||(r={}),function(e,t,r){r&&r.length&&(e[t]||(e[t]=[]),e[t].push(...r))}(r,n,i.decorators)})),r)),void 0)},t.getAllProperties=function(e,t=!0,r="Object"){const n=[];let o=e;const a=function(){if(!t)return;const e=Object.getPrototypeOf(o);return e&&e.constructor.name!==r?(o=e,o):void 0};do{Object.getOwnPropertyNames(o).forEach((function(e){-1===n.indexOf(e)&&n.push(e)}))}while(a());return n},t.getClassDecorators=function(e,t){return Reflect.getOwnMetadataKeys(t.constructor).filter((t=>t.toString().startsWith(e))).reduce(((r,n)=>{const o={key:n.substring(e.length),props:Reflect.getMetadata(n,t.constructor)};return r.concat(o)}),[])},t.checkType=i,t.checkTypes=s,t.evaluateDesignTypes=function(e,t){switch(typeof t){case"string":return i(e,t);case"object":return!Array.isArray(t)||s(e,t);case"function":return!t.name||"Object"===t.name||i(e,t.name);default:return!0}},r(630);const n=r(267),o=r(651);function a(e,t,r,i=!1,s=!0,c){const u=function(e,t,r,o=!1,a){const i=Reflect.getMetadataKeys(t,r).filter((t=>o?t.toString().startsWith(e):t===n.ReflectionKeys.TYPE||t.toString().startsWith(e))).reduce(((o,a)=>{const i={key:a!==n.ReflectionKeys.TYPE?a.substring(e.length):a,props:Reflect.getMetadata(a,t,r)};return o.concat(i)}),a||[]);return{prop:r.toString(),decorators:i}}(e,t,r,i,c);return s&&Object.getPrototypeOf(t)!==Object.prototype?a(e,Object.getPrototypeOf(t.constructor),r,!0,s,u.decorators):{prop:u.prop,decorators:function(e){const r={};return e.filter((e=>e.key in r?((0,o.isEqual)(e.props,r[e.key])||console.log(`Found a similar decorator for the ${e.key} propertyof a ${t.constructor.name} model but with different attributes.The original one will be kept`),!1):(r[e.key.toString()]=e.props,!0)))}(u.decorators)}}function i(e,t){return typeof e===t||e.constructor&&e.constructor.name.toLowerCase()===t.toLowerCase()}function s(e,t){return!t.every((t=>!i(e,t)))}},630:(e,t,r)=>{var n;!function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==t.Reflect&&(n=o(t.Reflect,n)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!i&&!s,u={create:i?function(){return G(Object.create(null))}:s?function(){return G({__proto__:null})}:function(){return G({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,N(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!N(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(N(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=u.create(),t=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+i()}while(u.has(e,t));return e[t]=!0,t}function o(e,n){if(!r.call(e,t)){if(!n)return;Object.defineProperty(e,t,{value:u.create()})}return e[t]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function i(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):a(t,e),t}return a(new Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var n=e[r];4!==r&&6!==r&&8!==r||(t+="-"),n<16&&(t+="0"),t+=n.toString(16).toLowerCase()}return t}}(),y=n?Symbol.for("@reflect-metadata:registry"):void 0,h=function(){var e;return!S(y)&&T(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[y]),S(e)&&(e=function(){var e,r,n,o;S(y)||void 0===t.Reflect||y in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,a=e.deleteMetadata,i=new p;return{isProviderFor:function(e,t){var r=i.get(e);return!(S(r)||!r.has(t))||!!o(e,t).length&&(S(r)&&(r=new f,i.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:a}}(t.Reflect));var a=new p,i={registerProvider:s,getProvider:u,setProvider:h};return i;function s(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case S(r):r=t;break;case r===t:break;case S(n):n=t;break;case n===t:break;default:void 0===o&&(o=new f),o.add(t)}}function c(t,a){if(!S(r)){if(r.isProviderFor(t,a))return r;if(!S(n)){if(n.isProviderFor(t,a))return r;if(!S(o))for(var i=K(o);;){var s=I(i);if(!s)return;var c=x(s);if(c.isProviderFor(t,a))return F(i),c}}}if(!S(e)&&e.isProviderFor(t,a))return e}function u(e,t){var r,n=a.get(e);return S(n)||(r=n.get(t)),S(r)?(S(r=c(e,t))||(S(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function l(e){if(S(e))throw new TypeError;return r===e||n===e||!S(o)&&o.has(e)}function h(e,t,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(e,t);if(n!==r){if(!S(n))return!1;var o=a.get(e);S(o)&&(o=new d,a.set(e,o)),o.set(t,r)}return!0}}()),!S(y)&&T(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),g=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,o){n(r,o,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var o=n(t,r,!1);return!S(o)&&A(o.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var o=n(t,r,!1);if(!S(o))return o.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],o=n(e,t,!1);if(S(o))return r;for(var a=K(o.keys()),i=0;;){var s=I(a);if(!s)return r.length=i,r;var c=x(s);try{r[i]=c}catch(e){try{F(a)}finally{throw e}}i++}},OrdinaryDeleteMetadata:function(e,r,o){var a=n(r,o,!1);if(S(a))return!1;if(!a.delete(e))return!1;if(0===a.size){var i=t.get(r);S(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}};return h.registerProvider(r),r;function n(n,o,a){var i=t.get(n),s=!1;if(S(i)){if(!a)return;i=new d,t.set(n,i),s=!0}var c=i.get(o);if(S(c)){if(!a)return;if(c=new d,i.set(o,c),!e.setProvider(n,o,r))throw i.delete(o),s&&t.delete(n),new Error("Wrong provider for target.")}return c}}(h);function v(e,t,r){if(E(e,t,r))return!0;var n=U(t);return!w(n)&&v(e,n,r)}function E(e,t,r){var n=z(t,r,!1);return!S(n)&&A(n.OrdinaryHasOwnMetadata(e,t,r))}function _(e,t,r){if(E(e,t,r))return M(e,t,r);var n=U(t);return w(n)?void 0:_(e,n,r)}function M(e,t,r){var n=z(t,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function b(e,t,r,n){z(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function O(e,t){var r=m(e,t),n=U(e);if(null===n)return r;var o=O(n,t);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new f,i=[],s=0,c=r;s<c.length;s++){var u=c[s];a.has(u)||(a.add(u),i.push(u))}for(var l=0,d=o;l<d.length;l++)u=d[l],a.has(u)||(a.add(u),i.push(u));return i}function m(e,t){var r=z(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function S(e){return void 0===e}function w(e){return null===e}function T(e){return"object"==typeof e?null!==e:"function"==typeof e}function P(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=k(e,o);if(void 0!==n){var a=n.call(e,r);if(T(a))throw new TypeError;return a}return function(e,t){if("string"===t){var r=e.toString;if(D(r)&&!T(o=r.call(e)))return o;if(D(n=e.valueOf)&&!T(o=n.call(e)))return o}else{var n;if(D(n=e.valueOf)&&!T(o=n.call(e)))return o;var o,a=e.toString;if(D(a)&&!T(o=a.call(e)))return o}throw new TypeError}(e,"default"===r?"number":r)}function A(e){return!!e}function j(e){var t=P(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function D(e){return"function"==typeof e}function L(e){return"function"==typeof e}function N(e,t){return e===t||e!=e&&t!=t}function k(e,t){var r=e[t];if(null!=r){if(!D(r))throw new TypeError;return r}}function K(e){var t=k(e,a);if(!D(t))throw new TypeError;var r=t.call(e);if(!T(r))throw new TypeError;return r}function x(e){return e.value}function I(e){var t=e.next();return!t.done&&t}function F(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var o=n.constructor;return"function"!=typeof o||o===e?t:o}function z(e,t,r){var n=h.getProvider(e,t);if(!S(n))return n;if(r){if(h.setProvider(e,t,g))return g;throw new Error("Illegal state.")}}function G(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(S(r)){if(!V(e))throw new TypeError;if(!L(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!S(n)&&!w(n)){if(!L(n))throw new TypeError;t=n}}return t}(e,t)}if(!V(e))throw new TypeError;if(!T(t))throw new TypeError;if(!T(n)&&!S(n)&&!w(n))throw new TypeError;return w(n)&&(n=void 0),function(e,t,r,n){for(var o=e.length-1;o>=0;--o){var a=(0,e[o])(t,r,n);if(!S(a)&&!w(a)){if(!T(a))throw new TypeError;n=a}}return n}(e,t,r=j(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!T(r))throw new TypeError;if(!S(n)&&!function(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;b(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!T(r))throw new TypeError;return S(n)||(n=j(n)),b(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),v(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),E(e,t,r)})),e("getMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),_(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),M(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return S(t)||(t=j(t)),O(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return S(t)||(t=j(t)),m(e,t)})),e("deleteMetadata",(function(e,t,r){if(!T(t))throw new TypeError;if(S(r)||(r=j(r)),!T(t))throw new TypeError;S(r)||(r=j(r));var n=z(t,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(729)})())); |
/*! For license information please see decorator-validation.bundle.min.esm.js.LICENSE.txt */ | ||
var e={729:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(935),t),o(r(965),t),o(r(847),t),t.VERSION="1.3.6"},6:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const n=r(735),o=r(38),a=r(936),i=r(32),s=r(192),c=r(523),u=r(710),l=r(154);let d,f;class p{constructor(e){}hasErrors(...e){return(0,s.validate)(this,...e)}equals(e,...t){return(0,i.isEqual)(this,e,...t)}serialize(){return p.serialize(this)}toString(){return this.constructor.name+": "+JSON.stringify(this,void 0,2)}hash(){return p.hash(this)}static deserialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),this.constructor);return t&&t.serializer?n.Serialization.deserialize(e,t.serializer,...t.args||[]):n.Serialization.deserialize(e)}static fromObject(e,t){return(0,o.constructFromObject)(e,t)}static fromModel(e,t){return(0,o.constructFromModel)(e,t)}static setBuilder(e){d=e}static getBuilder(){return d}static getRegistry(){return f||(f=new a.ModelRegistryManager),f}static setRegistry(e){f=e}static register(e,t){return p.getRegistry().register(e,t)}static get(e){return p.getRegistry().get(e)}static build(e={},t){return p.getRegistry().build(e,t)}static getMetadata(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.MODEL),e.constructor);if(!t)throw new Error("could not find metadata for provided "+e.constructor.name);return t}static equals(e,t,...r){return(0,i.isEqual)(e,t,...r)}static hasErrors(e,...t){return(0,s.validate)(e,...t)}static serialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),e.constructor);return t&&t.serializer?n.Serialization.serialize(this,t.serializer,...t.args||[]):n.Serialization.serialize(e)}static hash(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.HASHING),e.constructor);return t&&t.algorithm?c.Hashing.hash(e,t.algorithm,...t.args||[]):c.Hashing.hash(e)}}t.Model=p},19:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModelErrorDefinition=void 0,t.ModelErrorDefinition=class{constructor(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t]&&Object.defineProperty(this,t,{enumerable:!0,configurable:!1,value:e[t],writable:!1})}toString(){const e=this;return Object.keys(e).filter((t=>Object.prototype.hasOwnProperty.call(e,t)&&"function"!=typeof e[t])).reduce(((t,r)=>{let n=Object.keys(e[r]).reduce(((t,n)=>(t?t+=`\n${e[r][n]}`:t=e[r][n],t)),void 0);return n&&(n=`${r} - ${n}`,t?t+=`\n${n}`:t=n),t}),"")}}},936:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModelRegistryManager=void 0,t.bulkModelRegister=function(...e){e.forEach((e=>{const t=e.constructor?e.constructor:e;n.Model.register(t,e.name)}))};const n=r(6),o=r(593),a=r(710);t.ModelRegistryManager=class{constructor(e=a.isModel){this.cache={},this.testFunction=e}register(e,t){if("function"!=typeof e)throw new Error("Model registering failed. Missing Class name or constructor");t=t||e.name,this.cache[t]=e}get(e){try{return this.cache[e]}catch(e){return}}build(e={},t){if(!t&&!this.testFunction(e))throw new Error("Provided obj is not a Model object");const r=t||n.Model.getMetadata(e);if(!(r in this.cache))throw new Error((0,o.sf)("Provided class {0} is not a registered Model object",r));return new this.cache[r](e)}}},402:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.jsTypes=t.ReservedModels=t.Primitives=void 0,function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint"}(r||(t.Primitives=r={})),function(e){e.STRING="string",e.OBJECT="object",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint",e.DATE="date"}(n||(t.ReservedModels=n={})),t.jsTypes=["string","array","number","boolean","symbol","function","object","undefined","null","bigint"]},38:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.constructFromObject=function(e,t){if(!t)return e;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(Object.prototype.hasOwnProperty.call(e,r)||e.prototype&&Object.prototype.hasOwnProperty.call(e.prototype,r))&&(e[r]=t[r]||void 0);return e},t.constructFromModel=function(e,t){if(!t)return e;let r,l;for(const d in t)if(Object.prototype.hasOwnProperty.call(t,d)&&(Object.prototype.hasOwnProperty.call(e,d)||e.prototype&&Object.prototype.hasOwnProperty.call(e.prototype,d))){if(e[d]=t[d],"object"!=typeof e[d])continue;if((0,u.isModel)(e[d])){try{e[d]=n.Model.build(e[d])}catch(e){console.log(e)}continue}const f=(0,c.getPropertyDecorators)(o.ValidationKeys.REFLECT,e,d).decorators;if(r=f.filter((e=>-1!==[i.ModelKeys.TYPE,o.ValidationKeys.TYPE].indexOf(e.key))),!r||!r.length)throw new Error((0,s.sf)("failed to find decorators for property {0}",d));l=r.pop();const p=l.props.name?[l.props.name]:Array.isArray(l.props.customTypes)?l.props.customTypes:[l.props.customTypes],y=Object.values(a.ReservedModels).map((e=>e.toLowerCase()));p.forEach((t=>{if(-1===y.indexOf(t.toLowerCase()))try{switch(t){case"Array":case"Set":if(f.length){const r=f.find((e=>e.key===o.ValidationKeys.LIST));if(r){const o=r.props.class.find((e=>!a.jsTypes.includes(e.toLowerCase())));if("Array"===t&&(e[d]=e[d].map((e=>["object","function"].includes(typeof e)&&o?n.Model.build(e,o):e))),"Set"===t){const t=new Set;for(const r of e[d])["object","function"].includes(typeof r)&&o?t.add(n.Model.build(r,o)):t.add(r);e[d]=t}}}break;default:e[d]&&(e[d]=n.Model.build(e[d],t))}}catch(e){console.log(e)}}))}return e},t.construct=function(e,...t){const r=(...t)=>new e(...t);return r.prototype=e.prototype,r(...t)},t.findLastProtoBeforeObject=function(e){let t=Object.getPrototypeOf(e);if(t===Object.prototype)return e;for(;t!==Object.prototype;){if(t=Object.getPrototypeOf(t),t===Object.prototype)return t;if(Object.getPrototypeOf(t)===Object.prototype)return t}throw new Error("Could not find proper prototype")},t.bindModelPrototype=function(e){if(e instanceof n.Model)return;function t(e,t){Object.setPrototypeOf(e,t)}const r=Object.getPrototypeOf(e);if(r===Object.prototype)return t(e,n.Model.prototype);for(;r!==Object.prototype;){const e=Object.getPrototypeOf(r);if(e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return t(r,n.Model.prototype)}throw new Error("Could not find proper prototype to bind")};const n=r(6),o=r(772),a=r(402),i=r(154),s=r(593),c=r(32),u=r(710)},893:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.model=function(e,t){return r=>{const c=function(...c){const u=(0,n.construct)(r,...c);(0,n.bindModelPrototype)(u);const l=a.Model.getBuilder();return l&&l(u,c.length?c[0]:void 0),(0,s.metadata)((0,i.getModelKey)(o.ModelKeys.MODEL),e||r.name)(u.constructor),t&&t(u,...c),u};return c.prototype=r.prototype,Object.defineProperty(c,"name",{writable:!1,enumerable:!0,configurable:!1,value:r.prototype.constructor.name}),(0,s.metadata)((0,i.getModelKey)(o.ModelKeys.MODEL),e||r.name)(r),a.Model.register(c,e),c}};const n=r(38),o=r(154),a=r(6),i=r(710),s=r(32)},847:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(402),t),o(r(38),t),o(r(893),t),o(r(6),t),o(r(19),t),o(r(936),t),o(r(282),t),o(r(710),t),o(r(192),t)},282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},710:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getModelKey=void 0,t.isModel=function(e){try{return e instanceof o.Model||!o.Model.getMetadata(e)}catch(e){return!1}};const n=r(154),o=r(6);t.getModelKey=e=>n.ModelKeys.REFLECT+e},192:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(e,...t){const r=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&r.push((0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,n));let d;for(const t of r){const{prop:r,decorators:n}=t;if(!n||!n.length)continue;const o=n[0];let i;n.find((e=>e.key===u.ValidationKeys.TYPE||!!e.props.types?.find((e=>e===o.props.name))))&&n.shift();for(const t of n){const n=c.Validation.get(t.key);if(!n)throw new Error(`Missing validator for ${t.key}`);const o=n.hasErrors(e[r.toString()],...t.key===a.ModelKeys.TYPE?[t.props]:Object.values(t.props));o&&(i=i||{},i[t.key]=o)}i&&(d=d||{},d[t.prop.toString()]=i)}for(const t of Object.keys(e).filter((e=>!d||!d[e]))){let r;const n=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators,c=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators.filter((e=>-1!==[a.ModelKeys.TYPE,u.ValidationKeys.TYPE].indexOf(e.key)));if(!c||!c.length)continue;const f=c.pop(),p=f.props.name?[f.props.name]:Array.isArray(f.props.customTypes)?f.props.customTypes:[f.props.customTypes],y=Object.values(s.ReservedModels).map((e=>e.toLowerCase()));for(const o of p){if(-1===y.indexOf(o.toLowerCase())){const a=Array.isArray(e[t])?u.ValidationKeys.LIST:u.ValidationKeys.TYPE,s=n.find((e=>e.key===a))||{};let c=[];if(s&&s.props){const r=Array.isArray(e[t])?s.props.class:s.props.customTypes;r&&(c=Array.isArray(r)?r.map((e=>`${e}`.toLowerCase())):[r.toLowerCase()])}const d=(e,t)=>{if("object"==typeof t||"function"==typeof t)return(0,l.isModel)(t)?t.hasErrors():c.includes(typeof t)?void 0:"Value has no validatable type"};switch(o){case Array.name:case Set.name:n.length&&n.find((e=>e.key===u.ValidationKeys.LIST))&&(r=(o===Array.name?e[t]:e[t].values()).map((e=>d(t,e))).filter((e=>!!e)),r?.length||(r=void 0));break;default:try{e[t]&&(r=d(t,e[t]))}catch(e){console.warn((0,i.sf)("Model should be validatable but its not: "+e))}}}r&&(d=d||{},d[t]=r)}}return d?new n.ModelErrorDefinition(d):void 0};const n=r(19),o=r(32),a=r(154),i=r(593),s=r(402),c=r(770),u=r(772),l=r(710)},154:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModelKeys=void 0,function(e){e.REFLECT="model.definition.",e.TYPE="design:type",e.PARAMS="design:paramtypes",e.RETURN="design:returntype",e.MODEL="model",e.ANCHOR="__model",e.HASHING="hashing",e.SERIALIZATION="serialization"}(r||(t.ModelKeys=r={}))},46:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromFormat=a,t.bindDateToString=i,t.isValidDate=s,t.twoDigitPad=c,t.formatDate=u,t.parseDate=function(e,t){let r;if(t){if(t instanceof Date)try{r=a(u(t,e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t.toString(),e))}else if("string"==typeof t)r=a(t,e);else if("number"==typeof t)r=a(u(new Date(t),e),e);else{if(!s(t))throw new Error(`Invalid value provided ${t}`);try{r=a(u(new Date(t),e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t,e))}}return i(r,e)}},r(630);const n=r(772),o=r(593);function a(e,t){let r=t;r.match(/hh/)?r=r.replace("hh","(?<hour>\\d{2})"):r.match(/h/)?r=r.replace("h","(?<hour>\\d{1,2})"):r.match(/HH/)?r=r.replace("HH","(?<hour>\\d{2})"):r.match(/H/)&&(r=r.replace("H","(?<hour>\\d{1,2})")),r.match(/mm/)?r=r.replace("mm","(?<minutes>\\d{2})"):r.match(/m/)&&(r=r.replace("m","(?<minutes>\\d{1,2})")),r.match(/ss/)?r=r.replace("ss","(?<seconds>\\d{2})"):r.match(/s/)&&(r=r.replace("s","(?<seconds>\\d{1,2})")),r.match(/dd/)?r=r.replace("dd","(?<day>\\d{2})"):r.match(/d/)&&(r=r.replace("d","(?<day>\\d{1,2})")),r.match(/EEEE/)?r=r.replace("EEEE","(?<dayofweek>\\w+)"):r.match(/EEEE/)&&(r=r.replace("EEE","(?<dayofweek>\\w+)")),r.match(/yyyy/)?r=r.replace("yyyy","(?<year>\\d{4})"):r.match(/yy/)&&(r=r.replace("yy","(?<year>\\d{2})")),r.match(/MMMM/)?r=r.replace("MMMM","(?<monthname>\\w+)"):r.match(/MMM/)&&(r=r.replace("MMM","(?<monthnamesmall>\\w+)")),r.match(/MM/)?r=r.replace("MM","(?<month>\\d{2})"):r.match(/M/)&&(r=r.replace("M","(?<month>\\d{1,2})")),r=r.replace("S","(?<milis>\\d{1,3})").replace("aaa","(?<ampm>\\w{2})");const o=new RegExp(r,"g").exec(e);if(!o||!o.groups)return new Date(e);const a=function(e){if(!e)return 0;const t=parseInt(e);return isNaN(t)?0:t},i=a(o.groups.year),s=a(o.groups.day),c=o.groups.ampm;let u=a(o.groups.hour);c&&(u="PM"===c?u+12:u);const l=a(o.groups.minutes),d=a(o.groups.seconds),f=a(o.groups.milis),p=o.groups.monthname,y=o.groups.monthnamesmall;let h=o.groups.month;if(p)h=n.MONTH_NAMES.indexOf(p);else if(y){const t=n.MONTH_NAMES.find((e=>e.toLowerCase().startsWith(y.toLowerCase())));if(!t)return new Date(e);h=n.MONTH_NAMES.indexOf(t)}else h=a(`${h}`);return new Date(i,h-1,s,u,l,d,f)}function i(e,t){if(!e)return;const r=()=>u(e,t);return Object.defineProperty(e,"toISOString",{enumerable:!1,configurable:!1,value:r}),Object.defineProperty(e,"toString",{enumerable:!1,configurable:!1,value:r}),e}function s(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function c(e){return e<10?"0"+e:e.toString()}function u(e,t="yyyy/MM/dd"){const r=e.getDate(),o=e.getMonth(),a=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),d=i%12,f=c(d),p=c(i),y=c(s),h=c(u),g=i<12?"AM":"PM",v=n.DAYS_OF_WEEK_NAMES[e.getDay()],E=v.substr(0,3),_=c(r),O=o+1,m=c(O),M=n.MONTH_NAMES[o],b=M.substr(0,3),R=a+"",S=R.substr(2,2);return(t=t.replace("hh",f).replace("h",d.toString()).replace("HH",p).replace("H",i.toString()).replace("mm",y).replace("m",s.toString()).replace("ss",h).replace("s",u.toString()).replace("S",l.toString()).replace("dd",_).replace("d",r.toString()).replace("EEEE",v).replace("EEE",E).replace("yyyy",R).replace("yy",S).replace("aaa",g)).indexOf("MMM")>-1?t.replace("MMMM",M).replace("MMM",b):t.replace("MM",m).replace("M",O.toString())}},253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hashedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.HASHING),{algorithm:e,args:t})},t.serializedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.SERIALIZATION),{serializer:e,args:t})};const n=r(32),o=r(154),a=r(710)},523:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Hashing=t.DefaultHashingMethod=void 0,t.hashCode=o,t.hashSerialization=function(e){return o(n.Serialization.serialize(e))},t.hashObj=a;const n=r(735);function o(e){e=String(e);let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t.toString()}function a(e){const t=function(e,t){const r=n(t);return"string"==typeof r?n((e||"")+n(t)):0|(e=((e=e||0)<<5)-e+r)},r=o,n=function(e){return void 0===e?"":-1!==["string","number","symbol"].indexOf(typeof e)?r(e.toString()):e instanceof Date?r(e.getTime()):Array.isArray(e)?e.reduce(t,void 0):Object.values(e).reduce(t,void 0)},a=Object.values(e).reduce(t,0);return("number"==typeof a?Math.abs(a):a).toString()}t.DefaultHashingMethod="default";class i{static{this.current=t.DefaultHashingMethod}static{this.cache={default:a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No hashing method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Hashing method ${e} already registered`);this.cache[e]=t,r&&(this.current=e)}static hash(e,t,...r){return t?this.get(t)(e,...r):this.get(this.current)(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Hashing=i},935:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(154),t),o(r(46),t),o(r(253),t),o(r(523),t),o(r(904),t),o(r(735),t),o(r(593),t)},904:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},735:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Serialization=t.DefaultSerializationMethod=t.JSONSerializer=void 0;const n=r(6),o=r(154);class a{preSerialize(e){const t=Object.assign({},e),r=n.Model.getMetadata(e);return t[o.ModelKeys.ANCHOR]=r||e.constructor.name,t}deserialize(e){const t=JSON.parse(e),r=t[o.ModelKeys.ANCHOR];if(!r)throw new Error("Could not find class reference in serialized model");return n.Model.build(t,r)}serialize(e){return JSON.stringify(this.preSerialize(e))}}t.JSONSerializer=a,t.DefaultSerializationMethod="json";class i{static{this.current=t.DefaultSerializationMethod}static{this.cache={json:new a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No serialization method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Serialization method ${e} already registered`);this.cache[e]=new t,r&&(this.current=e)}static serialize(e,t,...r){return t?this.get(t).serialize(e,...r):this.get(this.current).serialize(e,...r)}static deserialize(e,t,...r){return t?this.get(t).deserialize(e,...r):this.get(this.current).deserialize(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Serialization=i},593:(e,t)=>{function r(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r].toString():"undefined"}))}Object.defineProperty(t,"__esModule",{value:!0}),t.sf=void 0,t.stringFormat=r,t.sf=r},770:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validation=void 0;const n=r(436);class o{static{this.actingValidatorRegistry=void 0}constructor(){}static setRegistry(e,t){t&&o.actingValidatorRegistry&&o.actingValidatorRegistry.getKeys().forEach((r=>{const n=e.get(r);n&&e.register(t(n))})),o.actingValidatorRegistry=e}static getRegistry(){return o.actingValidatorRegistry||(o.actingValidatorRegistry=new n.ValidatorRegistry),o.actingValidatorRegistry}static get(e){return o.getRegistry().get(e)}static register(...e){return o.getRegistry().register(...e)}}t.Validation=o},395:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.DATE){super(e,Number.name,Date.name,String.name)}hasErrors(e,t,r){if(void 0!==e)return"string"==typeof e&&(e=new Date(e)),isNaN(e.getDate())?this.getMessage(r||this.message):void 0}};t.DateValidator=c,t.DateValidator=c=n([(0,s.validator)(i.ValidationKeys.DATE),o("design:paramtypes",[String])],c)},335:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.EMAIL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.EMAIL,r)}};t.EmailValidator=c,t.EmailValidator=c=n([(0,s.validator)(a.ValidationKeys.EMAIL),o("design:paramtypes",[String])],c)},407:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ListValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.LIST){super(e,Array.name,Set.name)}hasErrors(e,t,r){if(!e||(Array.isArray(e)?!e.length:!e.size))return;t=Array.isArray(t)?t:[t];let n,o=!0;for(let r=0;r<(Array.isArray(e)?e.length:e.size);r++)switch(n=e[r],typeof n){case"object":case"function":o=t.includes(n.constructor?.name);break;default:o=t.some((e=>typeof n===e.toLowerCase()))}return o?void 0:this.getMessage(r||this.message,t)}};t.ListValidator=c,t.ListValidator=c=n([(0,s.validator)(i.ValidationKeys.LIST),o("design:paramtypes",[String])],c)},169:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length>t?this.getMessage(r||this.message,t):void 0}};t.MaxLengthValidator=c,t.MaxLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX_LENGTH),o("design:paramtypes",[String])],c)},909:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Max param defined");return e>t?this.getMessage(r||this.message,t):void 0}}};t.MaxValidator=c,t.MaxValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX),o("design:paramtypes",[String])],c)},519:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length<t?this.getMessage(r||this.message,t):void 0}};t.MinLengthValidator=c,t.MinLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN_LENGTH),o("design:paramtypes",[String])],c)},889:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Min param defined");return e<t?this.getMessage(r||this.message,t):void 0}}};t.MinValidator=c,t.MinValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN),o("design:paramtypes",[String])],c)},354:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordValidator=void 0;const a=r(273),i=r(772),s=r(787);let c=class extends a.PatternValidator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PASSWORD){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||i.DEFAULT_ERROR_MESSAGES.PASSWORD,r||this.message)}};t.PasswordValidator=c,t.PasswordValidator=c=n([(0,s.validator)(i.ValidationKeys.PASSWORD),o("design:paramtypes",[Object])],c)},273:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PatternValidator=t.regexpParser=void 0;const a=r(116),i=r(772),s=r(787);t.regexpParser=new RegExp("^/(.+)/([gimus]*)$");let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PATTERN){super(e,"string")}getPattern(e){if(!t.regexpParser.test(e))return new RegExp(e);const r=e.match(t.regexpParser);return new RegExp(r[1],r[2])}hasErrors(e,t,r){if(e){if(!t)throw new Error("Missing Pattern");return(t="string"==typeof t?this.getPattern(t):t).lastIndex=0,t.test(e)?void 0:this.getMessage(r||this.message)}}};t.PatternValidator=c,t.PatternValidator=c=n([(0,s.validator)(i.ValidationKeys.PATTERN),o("design:paramtypes",[String])],c)},812:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.REQUIRED){super(e)}hasErrors(e,t){switch(typeof e){case"boolean":case"number":return void 0===e?this.getMessage(t||this.message):void 0;default:return e?void 0:this.getMessage(t||this.message)}}};t.RequiredValidator=c,t.RequiredValidator=c=n([(0,s.validator)(i.ValidationKeys.REQUIRED),o("design:paramtypes",[String])],c)},553:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.STEP){super(e,"number","string")}hasErrors(e,t,r){if(void 0!==e)return Number(e)%Number(t)!=0?this.getMessage(r||this.message,t):void 0}};t.StepValidator=c,t.StepValidator=c=n([(0,s.validator)(i.ValidationKeys.STEP),o("design:paramtypes",[String])],c)},375:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeValidator=void 0;const a=r(116),i=r(772),s=r(787),c=r(770),u=r(32),l=r(154);let d=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.TYPE){super(e)}hasErrors(e,t,r){if(void 0!==e)return(0,u.evaluateDesignTypes)(e,t)?void 0:this.getMessage(r||this.message,"string"==typeof t?t:Array.isArray(t)?t.join(", "):t.name,typeof e)}};t.TypeValidator=d,t.TypeValidator=d=n([(0,s.validator)(i.ValidationKeys.TYPE),o("design:paramtypes",[String])],d),c.Validation.register({validator:d,validationKey:l.ModelKeys.TYPE,save:!1})},964:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URLValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.URL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.URL,r)}};t.URLValidator=c,t.URLValidator=c=n([(0,s.validator)(a.ValidationKeys.URL),o("design:paramtypes",[String])],c)},116:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const n=r(772),o=r(593),a=r(32);t.Validator=class{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){this.message=e,t.length&&(this.acceptedTypes=t),this.acceptedTypes&&(this.hasErrors=this.checkTypeAndHasErrors(this.hasErrors.bind(this)))}getMessage(e,...t){return(0,o.sf)(e,...t)}checkTypeAndHasErrors(e){return function(t,...r){return void 0!==t&&this.acceptedTypes?(0,a.checkTypes)(t,this.acceptedTypes)?e(t,...r):this.getMessage(n.DEFAULT_ERROR_MESSAGES.TYPE,this.acceptedTypes.join(", "),typeof t):e(t,...r)}.bind(this)}}},436:(e,t)=>{function r(e){return e.constructor&&e.hasErrors}Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorRegistry=void 0,t.isValidator=r,t.ValidatorRegistry=class{constructor(...e){this.cache={},this.customKeyCache={},this.register(...e)}getCustomKeys(){return Object.assign({},this.customKeyCache)}getKeys(){return Object.keys(this.cache)}get(e){if(!(e in this.cache))return;const t=this.cache[e];if(r(t))return t;const n=new(t.default||t);return this.cache[e]=n,n}register(...e){e.forEach((e=>{if(r(e)){if(e.validationKey in this.cache)return;this.cache[e.validationKey]=e}else{const{validationKey:t,validator:r,save:n}=e;if(t in this.cache)return;if(this.cache[t]=r,!n)return;const o={};o[t.toUpperCase()]=t,this.customKeyCache=Object.assign({},this.customKeyCache,o)}}))}}},772:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PATTERNS=t.DEFAULT_ERROR_MESSAGES=t.DAYS_OF_WEEK_NAMES=t.MONTH_NAMES=t.ValidationKeys=void 0,t.ValidationKeys={REFLECT:"model.validation.",VALIDATOR:"validator",REQUIRED:"required",MIN:"min",MAX:"max",STEP:"step",MIN_LENGTH:"minlength",MAX_LENGTH:"maxlength",PATTERN:"pattern",EMAIL:"email",URL:"url",DATE:"date",TYPE:"type",PASSWORD:"password",LIST:"list"},t.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"],t.DAYS_OF_WEEK_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.DEFAULT_ERROR_MESSAGES={REQUIRED:"This field is required",MIN:"The minimum value is {0}",MAX:"The maximum value is {0}",MIN_LENGTH:"The minimum length is {0}",MAX_LENGTH:"The maximum length is {0}",PATTERN:"The value does not match the pattern",EMAIL:"The value is not a valid email",URL:"The value is not a valid URL",TYPE:"Invalid type. Expected {0}, received {1}",STEP:"Invalid value. Not a step of {0}",DATE:"Invalid value. not a valid Date",DEFAULT:"There is an Error",PASSWORD:"Must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",LIST:"Invalid list of {0}",MODEL_NOT_FOUND:"No model registered under {0}"},t.DEFAULT_PATTERNS={EMAIL:/[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/,URL:/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,PASSWORD:{CHAR8_ONE_OF_EACH:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&_\-.,])[A-Za-z\d@$!%*?&_\-.,]{8,}$/g}}},787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validator=function(...e){return(0,i.apply)((t=>(e.forEach((e=>{n.Validation.register({validator:t,validationKey:e,save:!0})})),t)),(0,i.metadata)((0,a.getValidationKey)(o.ValidationKeys.VALIDATOR),e))};const n=r(770),o=r(772),a=r(844),i=r(32)},493:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Validators=void 0;const a=r(395),i=r(375),s=r(354),c=r(553),u=r(964),l=r(273),d=r(889),f=r(519),p=r(909),y=r(169),h=r(812),g=r(335),v=r(407);o(r(772),t),o(r(395),t),o(r(787),t),o(r(335),t),o(r(407),t),o(r(169),t),o(r(909),t),o(r(519),t),o(r(889),t),o(r(354),t),o(r(273),t),o(r(812),t),o(r(553),t),o(r(168),t),o(r(375),t),o(r(964),t),o(r(116),t),o(r(436),t),t.Validators={DateValidator:a.DateValidator,EmailValidator:g.EmailValidator,ListValidator:v.ListValidator,MaxLengthValidator:y.MaxLengthValidator,MaxValidator:p.MaxValidator,MinLengthValidator:f.MinLengthValidator,MinValidator:d.MinValidator,PasswordValidator:s.PasswordValidator,PatternValidator:l.PatternValidator,RequiredValidator:h.RequiredValidator,StepValidator:c.StepValidator,TypeValidator:i.TypeValidator,URLValidator:u.URLValidator}},168:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},475:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.required=function(e=n.DEFAULT_ERROR_MESSAGES.REQUIRED){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.REQUIRED),{message:e})},t.min=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN),{value:e,message:t,types:[Number.name,Date.name]})},t.max=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX),{value:e,message:t,types:[Number.name,Date.name]})},t.step=function(e,t=n.DEFAULT_ERROR_MESSAGES.STEP){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.STEP),{value:e,message:t,types:[Number.name]})},t.minlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.maxlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.pattern=function(e,t=n.DEFAULT_ERROR_MESSAGES.PATTERN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PATTERN),{value:"string"==typeof e?e:e.toString(),message:t,types:[String.name]})},t.email=function(e=n.DEFAULT_ERROR_MESSAGES.EMAIL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.EMAIL),{pattern:n.DEFAULT_PATTERNS.EMAIL,message:e,types:[String.name]})},t.url=function(e=n.DEFAULT_ERROR_MESSAGES.URL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.URL),{pattern:n.DEFAULT_PATTERNS.URL,message:e,types:[String.name]})},t.type=function(e,t=n.DEFAULT_ERROR_MESSAGES.TYPE){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.TYPE),{customTypes:e,message:t})},t.date=function(e="dd/MM/yyyy",t=n.DEFAULT_ERROR_MESSAGES.DATE){return(r,c)=>{(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.DATE),{format:e,message:t,types:[Date.name]})(r,c);const u=new WeakMap;Object.defineProperty(r,c,{configurable:!1,set(t){const r=Object.getOwnPropertyDescriptor(this,c);r&&!r.configurable||Object.defineProperty(this,c,{enumerable:!0,configurable:!1,get:()=>u.get(this),set:t=>{let r;try{r=(0,s.parseDate)(e,t),u.set(this,r)}catch(e){console.error((0,o.sf)("Failed to parse date: {0}",e.message||e))}}}),this[c]=t},get(){console.log("here")}})}},t.password=function(e=n.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,t=n.DEFAULT_ERROR_MESSAGES.PASSWORD){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PASSWORD),{pattern:e,message:t,types:[String.name]})},t.list=c,t.set=function(e,t=n.DEFAULT_ERROR_MESSAGES.LIST){return c(e,"Set",t)},r(630);const n=r(772),o=r(593),a=r(844),i=r(32),s=r(46);function c(e,t="Array",r=n.DEFAULT_ERROR_MESSAGES.LIST){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.LIST),{class:Array.isArray(e)?e.map((e=>e.name)):[e.name],type:t,message:r})}},965:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(493),t),o(r(475),t),o(r(792),t),o(r(844),t),o(r(770),t)},792:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},844:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getValidationKey=function(e){return n.ValidationKeys.REFLECT+e};const n=r(772)},267:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReflectionKeys=void 0,function(e){e.TYPE="design:type"}(r||(t.ReflectionKeys=r={}))},530:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metadata=function(e,t){return(r,n,o)=>{o?Reflect.defineMetadata(e,t,o.value):n?Reflect.defineMetadata(e,t,r,n):Reflect.defineMetadata(e,t,r)}},t.apply=function(...e){return(t,r,n)=>{for(const o of e)t instanceof Function&&!n?o(t):o(t,r,n)}},r(630)},651:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEqual=function e(t,r,...n){if(t===r)return!0;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(typeof t!=typeof r)return!1;if(t.prototype!==r.prototype)return!1;const o=Object.keys(t).filter((e=>-1===n.indexOf(e)));return o.length===Object.keys(r).filter((e=>-1===n.indexOf(e))).length&&o.every((o=>-1!==n.indexOf(o)||e(t[o],r[o],...n)))}},32:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(267),t),o(r(530),t),o(r(651),t),o(r(199),t),o(r(115),t),t.VERSION="0.3.0"},199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},115:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyDecorators=a,t.getTypeFromDecorator=function(e,t){const r=a(n.ReflectionKeys.TYPE,e,t,!1);if(!r||!r.decorators)return;const o=r.decorators.shift(),i=o.props?o.props.name:void 0;return"Function"!==i?i:void 0},t.getAllPropertyDecorators=function(e,...t){if(t&&t.length)return Object.getOwnPropertyNames(e).reduce(((r,n)=>(t.forEach(((t,o)=>{const i=a(t,e,n,0!==o);r||(r={}),function(e,t,r){r&&r.length&&(e[t]||(e[t]=[]),e[t].push(...r))}(r,n,i.decorators)})),r)),void 0)},t.getAllProperties=function(e,t=!0,r="Object"){const n=[];let o=e;const a=function(){if(!t)return;const e=Object.getPrototypeOf(o);return e&&e.constructor.name!==r?(o=e,o):void 0};do{Object.getOwnPropertyNames(o).forEach((function(e){-1===n.indexOf(e)&&n.push(e)}))}while(a());return n},t.getClassDecorators=function(e,t){return Reflect.getOwnMetadataKeys(t.constructor).filter((t=>t.toString().startsWith(e))).reduce(((r,n)=>{const o={key:n.substring(e.length),props:Reflect.getMetadata(n,t.constructor)};return r.concat(o)}),[])},t.checkType=i,t.checkTypes=s,t.evaluateDesignTypes=function(e,t){switch(typeof t){case"string":return i(e,t);case"object":return!Array.isArray(t)||s(e,t);case"function":return!t.name||"Object"===t.name||i(e,t.name);default:return!0}},r(630);const n=r(267),o=r(651);function a(e,t,r,i=!1,s=!0,c){const u=function(e,t,r,o=!1,a){const i=Reflect.getMetadataKeys(t,r).filter((t=>o?t.toString().startsWith(e):t===n.ReflectionKeys.TYPE||t.toString().startsWith(e))).reduce(((o,a)=>{const i={key:a!==n.ReflectionKeys.TYPE?a.substring(e.length):a,props:Reflect.getMetadata(a,t,r)};return o.concat(i)}),a||[]);return{prop:r.toString(),decorators:i}}(e,t,r,i,c);return s&&Object.getPrototypeOf(t)!==Object.prototype?a(e,Object.getPrototypeOf(t.constructor),r,!0,s,u.decorators):{prop:u.prop,decorators:function(e){const r={};return e.filter((e=>e.key in r?((0,o.isEqual)(e.props,r[e.key])||console.log(`Found a similar decorator for the ${e.key} propertyof a ${t.constructor.name} model but with different attributes.The original one will be kept`),!1):(r[e.key.toString()]=e.props,!0)))}(u.decorators)}}function i(e,t){return typeof e===t||e.constructor&&e.constructor.name.toLowerCase()===t.toLowerCase()}function s(e,t){return!t.every((t=>!i(e,t)))}},630:(e,t,r)=>{var n;!function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==t.Reflect&&(n=o(t.Reflect,n)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!i&&!s,u={create:i?function(){return G(Object.create(null))}:s?function(){return G({__proto__:null})}:function(){return G({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,K(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!K(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(K(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=u.create(),t=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+i()}while(u.has(e,t));return e[t]=!0,t}function o(e,n){if(!r.call(e,t)){if(!n)return;Object.defineProperty(e,t,{value:u.create()})}return e[t]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function i(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):a(t,e),t}return a(new Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var n=e[r];4!==r&&6!==r&&8!==r||(t+="-"),n<16&&(t+="0"),t+=n.toString(16).toLowerCase()}return t}}(),y=n?Symbol.for("@reflect-metadata:registry"):void 0,h=function(){var e;return!S(y)&&j(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[y]),S(e)&&(e=function(){var e,r,n,o;S(y)||void 0===t.Reflect||y in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,a=e.deleteMetadata,i=new p;return{isProviderFor:function(e,t){var r=i.get(e);return!(S(r)||!r.has(t))||!!o(e,t).length&&(S(r)&&(r=new f,i.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:a}}(t.Reflect));var a=new p,i={registerProvider:s,getProvider:u,setProvider:h};return i;function s(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case S(r):r=t;break;case r===t:break;case S(n):n=t;break;case n===t:break;default:void 0===o&&(o=new f),o.add(t)}}function c(t,a){if(!S(r)){if(r.isProviderFor(t,a))return r;if(!S(n)){if(n.isProviderFor(t,a))return r;if(!S(o))for(var i=x(o);;){var s=F(i);if(!s)return;var c=I(s);if(c.isProviderFor(t,a))return k(i),c}}}if(!S(e)&&e.isProviderFor(t,a))return e}function u(e,t){var r,n=a.get(e);return S(n)||(r=n.get(t)),S(r)?(S(r=c(e,t))||(S(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function l(e){if(S(e))throw new TypeError;return r===e||n===e||!S(o)&&o.has(e)}function h(e,t,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(e,t);if(n!==r){if(!S(n))return!1;var o=a.get(e);S(o)&&(o=new d,a.set(e,o)),o.set(t,r)}return!0}}()),!S(y)&&j(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),g=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,o){n(r,o,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var o=n(t,r,!1);return!S(o)&&A(o.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var o=n(t,r,!1);if(!S(o))return o.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],o=n(e,t,!1);if(S(o))return r;for(var a=x(o.keys()),i=0;;){var s=F(a);if(!s)return r.length=i,r;var c=I(s);try{r[i]=c}catch(e){try{k(a)}finally{throw e}}i++}},OrdinaryDeleteMetadata:function(e,r,o){var a=n(r,o,!1);if(S(a))return!1;if(!a.delete(e))return!1;if(0===a.size){var i=t.get(r);S(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}};return h.registerProvider(r),r;function n(n,o,a){var i=t.get(n),s=!1;if(S(i)){if(!a)return;i=new d,t.set(n,i),s=!0}var c=i.get(o);if(S(c)){if(!a)return;if(c=new d,i.set(o,c),!e.setProvider(n,o,r))throw i.delete(o),s&&t.delete(n),new Error("Wrong provider for target.")}return c}}(h);function v(e,t,r){if(E(e,t,r))return!0;var n=U(t);return!w(n)&&v(e,n,r)}function E(e,t,r){var n=z(t,r,!1);return!S(n)&&A(n.OrdinaryHasOwnMetadata(e,t,r))}function _(e,t,r){if(E(e,t,r))return O(e,t,r);var n=U(t);return w(n)?void 0:_(e,n,r)}function O(e,t,r){var n=z(t,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function m(e,t,r,n){z(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function M(e,t){var r=b(e,t),n=U(e);if(null===n)return r;var o=M(n,t);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new f,i=[],s=0,c=r;s<c.length;s++){var u=c[s];a.has(u)||(a.add(u),i.push(u))}for(var l=0,d=o;l<d.length;l++)u=d[l],a.has(u)||(a.add(u),i.push(u));return i}function b(e,t){var r=z(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function S(e){return void 0===e}function w(e){return null===e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function P(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=N(e,o);if(void 0!==n){var a=n.call(e,r);if(j(a))throw new TypeError;return a}return function(e,t){if("string"===t){var r=e.toString;if(D(r)&&!j(o=r.call(e)))return o;if(D(n=e.valueOf)&&!j(o=n.call(e)))return o}else{var n;if(D(n=e.valueOf)&&!j(o=n.call(e)))return o;var o,a=e.toString;if(D(a)&&!j(o=a.call(e)))return o}throw new TypeError}(e,"default"===r?"number":r)}function A(e){return!!e}function T(e){var t=P(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function D(e){return"function"==typeof e}function L(e){return"function"==typeof e}function K(e,t){return e===t||e!=e&&t!=t}function N(e,t){var r=e[t];if(null!=r){if(!D(r))throw new TypeError;return r}}function x(e){var t=N(e,a);if(!D(t))throw new TypeError;var r=t.call(e);if(!j(r))throw new TypeError;return r}function I(e){return e.value}function F(e){var t=e.next();return!t.done&&t}function k(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var o=n.constructor;return"function"!=typeof o||o===e?t:o}function z(e,t,r){var n=h.getProvider(e,t);if(!S(n))return n;if(r){if(h.setProvider(e,t,g))return g;throw new Error("Illegal state.")}}function G(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(S(r)){if(!V(e))throw new TypeError;if(!L(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!S(n)&&!w(n)){if(!L(n))throw new TypeError;t=n}}return t}(e,t)}if(!V(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(n)&&!S(n)&&!w(n))throw new TypeError;return w(n)&&(n=void 0),function(e,t,r,n){for(var o=e.length-1;o>=0;--o){var a=(0,e[o])(t,r,n);if(!S(a)&&!w(a)){if(!j(a))throw new TypeError;n=a}}return n}(e,t,r=T(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!j(r))throw new TypeError;if(!S(n)&&!function(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;m(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!j(r))throw new TypeError;return S(n)||(n=T(n)),m(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),v(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),E(e,t,r)})),e("getMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),_(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!j(t))throw new TypeError;return S(r)||(r=T(r)),O(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return S(t)||(t=T(t)),M(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return S(t)||(t=T(t)),b(e,t)})),e("deleteMetadata",(function(e,t,r){if(!j(t))throw new TypeError;if(S(r)||(r=T(r)),!j(t))throw new TypeError;S(r)||(r=T(r));var n=z(t,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(729); | ||
var e={729:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(935),t),o(r(965),t),o(r(847),t),t.VERSION="1.3.7"},6:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const n=r(735),o=r(936),a=r(32),i=r(192),s=r(523),c=r(710),u=r(154),l=r(772),d=r(593),f=r(402);let p,y;class h{constructor(e){}hasErrors(...e){return(0,i.validate)(this,...e)}equals(e,...t){return(0,a.isEqual)(this,e,...t)}serialize(){return h.serialize(this)}toString(){return this.constructor.name+": "+JSON.stringify(this,void 0,2)}hash(){return h.hash(this)}static deserialize(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.SERIALIZATION),this.constructor);return t&&t.serializer?n.Serialization.deserialize(e,t.serializer,...t.args||[]):n.Serialization.deserialize(e)}static fromObject(e,t){t||(t={});for(const r of h.getAttributes(e))e[r]=t[r]||void 0;return e}static fromModel(e,t){let r,n;t||(t={});const o=h.getAttributes(e);for(const i of o){if(e[i]=t[i]||void 0,"object"!=typeof e[i])continue;const o=(0,c.isPropertyModel)(e,i);if(o){try{e[i]=h.build(e[i],"string"==typeof o?o:void 0)}catch(e){console.log(e)}continue}const s=(0,a.getPropertyDecorators)(l.ValidationKeys.REFLECT,e,i).decorators;if(r=s.filter((e=>-1!==[u.ModelKeys.TYPE,l.ValidationKeys.TYPE].indexOf(e.key))),!r||!r.length)throw new Error((0,d.sf)("failed to find decorators for property {0}",i));n=r.pop();const p=n.props.name?[n.props.name]:Array.isArray(n.props.customTypes)?n.props.customTypes:[n.props.customTypes],y=Object.values(f.ReservedModels).map((e=>e.toLowerCase()));p.forEach((t=>{if(-1===y.indexOf(t.toLowerCase()))try{switch(t){case"Array":case"Set":if(s.length){const r=s.find((e=>e.key===l.ValidationKeys.LIST));if(r){const n=r.props.class.find((e=>!f.jsTypes.includes(e.toLowerCase())));if("Array"===t&&(e[i]=e[i].map((e=>["object","function"].includes(typeof e)&&n?h.build(e,n):e))),"Set"===t){const t=new Set;for(const r of e[i])["object","function"].includes(typeof r)&&n?t.add(h.build(r,n)):t.add(r);e[i]=t}}}break;default:e[i]&&(e[i]=h.build(e[i],t))}}catch(e){console.log(e)}}))}return e}static setBuilder(e){p=e}static getBuilder(){return p}static getRegistry(){return y||(y=new o.ModelRegistryManager),y}static setRegistry(e){y=e}static register(e,t){return h.getRegistry().register(e,t)}static get(e){return h.getRegistry().get(e)}static build(e={},t){return h.getRegistry().build(e,t)}static getMetadata(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.MODEL),e.constructor);if(!t)throw new Error("could not find metadata for provided "+e.constructor.name);return t}static getAttributes(e){const t=[];let r=e instanceof h?Object.getPrototypeOf(e):e.prototype;for(;null!=r;){const e=r[u.ModelKeys.ATTRIBUTE];e&&t.push(...e),r=Object.getPrototypeOf(r)}return t}static equals(e,t,...r){return(0,a.isEqual)(e,t,...r)}static hasErrors(e,...t){return(0,i.validate)(e,...t)}static serialize(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.SERIALIZATION),e.constructor);return t&&t.serializer?n.Serialization.serialize(this,t.serializer,...t.args||[]):n.Serialization.serialize(e)}static hash(e){const t=Reflect.getMetadata(this.key(u.ModelKeys.HASHING),e.constructor);return t&&t.algorithm?s.Hashing.hash(e,t.algorithm,...t.args||[]):s.Hashing.hash(e)}static key(e){return u.ModelKeys.REFLECT+e}}t.Model=h},19:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModelErrorDefinition=void 0,t.ModelErrorDefinition=class{constructor(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&e[t]&&Object.defineProperty(this,t,{enumerable:!0,configurable:!1,value:e[t],writable:!1})}toString(){const e=this;return Object.keys(e).filter((t=>Object.prototype.hasOwnProperty.call(e,t)&&"function"!=typeof e[t])).reduce(((t,r)=>{let n=Object.keys(e[r]).reduce(((t,n)=>(t?t+=`\n${e[r][n]}`:t=e[r][n],t)),void 0);return n&&(n=`${r} - ${n}`,t?t+=`\n${n}`:t=n),t}),"")}}},936:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ModelRegistryManager=void 0,t.bulkModelRegister=function(...e){e.forEach((e=>{const t=e.constructor?e.constructor:e;n.Model.register(t,e.name)}))};const n=r(6),o=r(593),a=r(710);t.ModelRegistryManager=class{constructor(e=a.isModel){this.cache={},this.testFunction=e}register(e,t){if("function"!=typeof e)throw new Error("Model registering failed. Missing Class name or constructor");t=t||e.name,this.cache[t]=e}get(e){try{return this.cache[e]}catch(e){return}}build(e={},t){if(!t&&!this.testFunction(e))throw new Error("Provided obj is not a Model object");const r=t||n.Model.getMetadata(e);if(!(r in this.cache))throw new Error((0,o.sf)("Provided class {0} is not a registered Model object",r));return new this.cache[r](e)}}},402:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.jsTypes=t.ReservedModels=t.Primitives=void 0,function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint"}(r||(t.Primitives=r={})),function(e){e.STRING="string",e.OBJECT="object",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint",e.DATE="date"}(n||(t.ReservedModels=n={})),t.jsTypes=["string","array","number","boolean","symbol","function","object","undefined","null","bigint"]},38:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.construct=function(e,...t){const r=(...t)=>new e(...t);return r.prototype=e.prototype,r(...t)},t.findLastProtoBeforeObject=function(e){let t=Object.getPrototypeOf(e);if(t===Object.prototype)return e;for(;t!==Object.prototype;){if(t=Object.getPrototypeOf(t),t===Object.prototype)return t;if(Object.getPrototypeOf(t)===Object.prototype)return t}throw new Error("Could not find proper prototype")},t.bindModelPrototype=function(e){if(e instanceof n.Model)return;function t(e,t){Object.setPrototypeOf(e,t)}const r=Object.getPrototypeOf(e);if(r===Object.prototype)return t(e,n.Model.prototype);for(;r!==Object.prototype;){const e=Object.getPrototypeOf(r);if(e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return t(r,n.Model.prototype)}throw new Error("Could not find proper prototype to bind")};const n=r(6)},893:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.model=function(e){return t=>{const r=function(...r){const s=(0,n.construct)(t,...r);(0,n.bindModelPrototype)(s);const c=a.Model.getBuilder();return c&&c(s,r.length?r[0]:void 0),(0,i.metadata)(a.Model.key(o.ModelKeys.MODEL),t.name)(s.constructor),e&&e(s,...r),s};return r.prototype=t.prototype,Object.defineProperty(r,"name",{writable:!1,enumerable:!0,configurable:!1,value:t.prototype.constructor.name}),(0,i.metadata)(a.Model.key(o.ModelKeys.MODEL),t.name)(t),a.Model.register(r,t.name),r}},t.hashedBy=function(e,...t){return(0,i.metadata)(a.Model.key(o.ModelKeys.HASHING),{algorithm:e,args:t})},t.serializedBy=function(e,...t){return(0,i.metadata)(a.Model.key(o.ModelKeys.SERIALIZATION),{serializer:e,args:t})};const n=r(38),o=r(154),a=r(6),i=r(32)},847:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(402),t),o(r(38),t),o(r(893),t),o(r(6),t),o(r(19),t),o(r(936),t),o(r(282),t),o(r(710),t),o(r(192),t)},282:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},710:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isPropertyModel=function(e,t){if(a(e[t]))return!0;const r=Reflect.getMetadata(n.ModelKeys.TYPE,e,t);return o.Model.get(r.name)?r.name:void 0},t.isModel=a;const n=r(154),o=r(6);function a(e){try{return e instanceof o.Model||!!o.Model.getMetadata(e)}catch(e){return!1}}},192:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(e,...t){const r=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&r.push((0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,n));let d;for(const t of r){const{prop:r,decorators:n}=t;if(!n||!n.length)continue;const o=n[0];let i;n.find((e=>e.key===u.ValidationKeys.TYPE||!!e.props.types?.find((e=>e===o.props.name))))&&n.shift();for(const t of n){const n=c.Validation.get(t.key);if(!n)throw new Error(`Missing validator for ${t.key}`);const o=n.hasErrors(e[r.toString()],...t.key===a.ModelKeys.TYPE?[t.props]:Object.values(t.props));o&&(i=i||{},i[t.key]=o)}i&&(d=d||{},d[t.prop.toString()]=i)}for(const t of Object.keys(e).filter((e=>!d||!d[e]))){let r;const n=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators,c=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators.filter((e=>-1!==[a.ModelKeys.TYPE,u.ValidationKeys.TYPE].indexOf(e.key)));if(!c||!c.length)continue;const f=c.pop(),p=f.props.name?[f.props.name]:Array.isArray(f.props.customTypes)?f.props.customTypes:[f.props.customTypes],y=Object.values(s.ReservedModels).map((e=>e.toLowerCase()));for(const o of p){if(-1===y.indexOf(o.toLowerCase())){const a=Array.isArray(e[t])?u.ValidationKeys.LIST:u.ValidationKeys.TYPE,s=n.find((e=>e.key===a))||{};let c=[];if(s&&s.props){const r=Array.isArray(e[t])?s.props.class:s.props.customTypes;r&&(c=Array.isArray(r)?r.map((e=>`${e}`.toLowerCase())):[r.toLowerCase()])}const d=(e,t)=>{if("object"==typeof t||"function"==typeof t)return(0,l.isModel)(t)?t.hasErrors():c.includes(typeof t)?void 0:"Value has no validatable type"};switch(o){case Array.name:case Set.name:n.length&&n.find((e=>e.key===u.ValidationKeys.LIST))&&(r=(o===Array.name?e[t]:e[t].values()).map((e=>d(t,e))).filter((e=>!!e)),r?.length||(r=void 0));break;default:try{e[t]&&(r=d(t,e[t]))}catch(e){console.warn((0,i.sf)("Model should be validatable but its not: "+e))}}}r&&(d=d||{},d[t]=r)}}return d?new n.ModelErrorDefinition(d):void 0};const n=r(19),o=r(32),a=r(154),i=r(593),s=r(402),c=r(770),u=r(772),l=r(710)},154:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModelKeys=void 0,function(e){e.REFLECT="decaf.model.",e.TYPE="design:type",e.PARAMS="design:paramtypes",e.RETURN="design:returntype",e.MODEL="model",e.ANCHOR="__model",e.CONSTRUCTION="constructed-by",e.ATTRIBUTE="__attributes",e.HASHING="hashing",e.SERIALIZATION="serialization"}(r||(t.ModelKeys=r={}))},46:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromFormat=a,t.bindDateToString=i,t.isValidDate=s,t.twoDigitPad=c,t.formatDate=u,t.parseDate=function(e,t){let r;if(t){if(t instanceof Date)try{r=a(u(t,e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t.toString(),e))}else if("string"==typeof t)r=a(t,e);else if("number"==typeof t)r=a(u(new Date(t),e),e);else{if(!s(t))throw new Error(`Invalid value provided ${t}`);try{r=a(u(new Date(t),e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t,e))}}return i(r,e)}},r(630);const n=r(772),o=r(593);function a(e,t){let r=t;r.match(/hh/)?r=r.replace("hh","(?<hour>\\d{2})"):r.match(/h/)?r=r.replace("h","(?<hour>\\d{1,2})"):r.match(/HH/)?r=r.replace("HH","(?<hour>\\d{2})"):r.match(/H/)&&(r=r.replace("H","(?<hour>\\d{1,2})")),r.match(/mm/)?r=r.replace("mm","(?<minutes>\\d{2})"):r.match(/m/)&&(r=r.replace("m","(?<minutes>\\d{1,2})")),r.match(/ss/)?r=r.replace("ss","(?<seconds>\\d{2})"):r.match(/s/)&&(r=r.replace("s","(?<seconds>\\d{1,2})")),r.match(/dd/)?r=r.replace("dd","(?<day>\\d{2})"):r.match(/d/)&&(r=r.replace("d","(?<day>\\d{1,2})")),r.match(/EEEE/)?r=r.replace("EEEE","(?<dayofweek>\\w+)"):r.match(/EEEE/)&&(r=r.replace("EEE","(?<dayofweek>\\w+)")),r.match(/yyyy/)?r=r.replace("yyyy","(?<year>\\d{4})"):r.match(/yy/)&&(r=r.replace("yy","(?<year>\\d{2})")),r.match(/MMMM/)?r=r.replace("MMMM","(?<monthname>\\w+)"):r.match(/MMM/)&&(r=r.replace("MMM","(?<monthnamesmall>\\w+)")),r.match(/MM/)?r=r.replace("MM","(?<month>\\d{2})"):r.match(/M/)&&(r=r.replace("M","(?<month>\\d{1,2})")),r=r.replace("S","(?<milis>\\d{1,3})").replace("aaa","(?<ampm>\\w{2})");const o=new RegExp(r,"g").exec(e);if(!o||!o.groups)return new Date(e);const a=function(e){if(!e)return 0;const t=parseInt(e);return isNaN(t)?0:t},i=a(o.groups.year),s=a(o.groups.day),c=o.groups.ampm;let u=a(o.groups.hour);c&&(u="PM"===c?u+12:u);const l=a(o.groups.minutes),d=a(o.groups.seconds),f=a(o.groups.milis),p=o.groups.monthname,y=o.groups.monthnamesmall;let h=o.groups.month;if(p)h=n.MONTH_NAMES.indexOf(p);else if(y){const t=n.MONTH_NAMES.find((e=>e.toLowerCase().startsWith(y.toLowerCase())));if(!t)return new Date(e);h=n.MONTH_NAMES.indexOf(t)}else h=a(`${h}`);return new Date(i,h-1,s,u,l,d,f)}function i(e,t){if(!e)return;const r=()=>u(e,t);return Object.defineProperty(e,"toISOString",{enumerable:!1,configurable:!1,value:r}),Object.defineProperty(e,"toString",{enumerable:!1,configurable:!1,value:r}),e}function s(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function c(e){return e<10?"0"+e:e.toString()}function u(e,t="yyyy/MM/dd"){const r=e.getDate(),o=e.getMonth(),a=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),d=i%12,f=c(d),p=c(i),y=c(s),h=c(u),g=i<12?"AM":"PM",v=n.DAYS_OF_WEEK_NAMES[e.getDay()],E=v.substr(0,3),_=c(r),M=o+1,O=c(M),b=n.MONTH_NAMES[o],m=b.substr(0,3),R=a+"",S=R.substr(2,2);return(t=t.replace("hh",f).replace("h",d.toString()).replace("HH",p).replace("H",i.toString()).replace("mm",y).replace("m",s.toString()).replace("ss",h).replace("s",u.toString()).replace("S",l.toString()).replace("dd",_).replace("d",r.toString()).replace("EEEE",v).replace("EEE",E).replace("yyyy",R).replace("yy",S).replace("aaa",g)).indexOf("MMM")>-1?t.replace("MMMM",b).replace("MMM",m):t.replace("MM",O).replace("M",M.toString())}},253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.prop=a,t.propMetadata=function(e,t){return(0,n.apply)(a(),(0,n.metadata)(e,t))};const n=r(32),o=r(154);function a(){return(e,t)=>{let r;r=Object.prototype.hasOwnProperty.call(e,o.ModelKeys.ATTRIBUTE)?e[o.ModelKeys.ATTRIBUTE]:e[o.ModelKeys.ATTRIBUTE]=[],r.includes(t)||r.push(t)}}},523:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Hashing=t.DefaultHashingMethod=void 0,t.hashCode=o,t.hashSerialization=function(e){return o(n.Serialization.serialize(e))},t.hashObj=a;const n=r(735);function o(e){e=String(e);let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t.toString()}function a(e){const t=function(e,t){const r=n(t);return"string"==typeof r?n((e||"")+n(t)):0|(e=((e=e||0)<<5)-e+r)},r=o,n=function(e){return void 0===e?"":-1!==["string","number","symbol"].indexOf(typeof e)?r(e.toString()):e instanceof Date?r(e.getTime()):Array.isArray(e)?e.reduce(t,void 0):Object.values(e).reduce(t,void 0)},a=Object.values(e).reduce(t,0);return("number"==typeof a?Math.abs(a):a).toString()}t.DefaultHashingMethod="default";class i{static{this.current=t.DefaultHashingMethod}static{this.cache={default:a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No hashing method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Hashing method ${e} already registered`);this.cache[e]=t,r&&(this.current=e)}static hash(e,t,...r){return t?this.get(t)(e,...r):this.get(this.current)(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Hashing=i},935:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(154),t),o(r(46),t),o(r(253),t),o(r(523),t),o(r(904),t),o(r(735),t),o(r(593),t)},904:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},735:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Serialization=t.DefaultSerializationMethod=t.JSONSerializer=void 0;const n=r(6),o=r(154);class a{preSerialize(e){const t=Object.assign({},e),r=n.Model.getMetadata(e);return t[o.ModelKeys.ANCHOR]=r||e.constructor.name,t}deserialize(e){const t=JSON.parse(e),r=t[o.ModelKeys.ANCHOR];if(!r)throw new Error("Could not find class reference in serialized model");return n.Model.build(t,r)}serialize(e){return JSON.stringify(this.preSerialize(e))}}t.JSONSerializer=a,t.DefaultSerializationMethod="json";class i{static{this.current=t.DefaultSerializationMethod}static{this.cache={json:new a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No serialization method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Serialization method ${e} already registered`);this.cache[e]=new t,r&&(this.current=e)}static serialize(e,t,...r){return t?this.get(t).serialize(e,...r):this.get(this.current).serialize(e,...r)}static deserialize(e,t,...r){return t?this.get(t).deserialize(e,...r):this.get(this.current).deserialize(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Serialization=i},593:(e,t)=>{function r(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r].toString():"undefined"}))}Object.defineProperty(t,"__esModule",{value:!0}),t.sf=void 0,t.stringFormat=r,t.sf=r},770:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validation=void 0;const n=r(436),o=r(772);class a{static{this.actingValidatorRegistry=void 0}constructor(){}static setRegistry(e,t){t&&a.actingValidatorRegistry&&a.actingValidatorRegistry.getKeys().forEach((r=>{const n=e.get(r);n&&e.register(t(n))})),a.actingValidatorRegistry=e}static getRegistry(){return a.actingValidatorRegistry||(a.actingValidatorRegistry=new n.ValidatorRegistry),a.actingValidatorRegistry}static get(e){return a.getRegistry().get(e)}static register(...e){return a.getRegistry().register(...e)}static key(e){return o.ValidationKeys.REFLECT+e}}t.Validation=a},395:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.DATE){super(e,Number.name,Date.name,String.name)}hasErrors(e,t,r){if(void 0!==e)return"string"==typeof e&&(e=new Date(e)),isNaN(e.getDate())?this.getMessage(r||this.message):void 0}};t.DateValidator=c,t.DateValidator=c=n([(0,s.validator)(i.ValidationKeys.DATE),o("design:paramtypes",[String])],c)},335:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.EMAIL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.EMAIL,r)}};t.EmailValidator=c,t.EmailValidator=c=n([(0,s.validator)(a.ValidationKeys.EMAIL),o("design:paramtypes",[String])],c)},407:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ListValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.LIST){super(e,Array.name,Set.name)}hasErrors(e,t,r){if(!e||(Array.isArray(e)?!e.length:!e.size))return;t=Array.isArray(t)?t:[t];let n,o=!0;for(let r=0;r<(Array.isArray(e)?e.length:e.size);r++)switch(n=e[r],typeof n){case"object":case"function":o=t.includes(n.constructor?.name);break;default:o=t.some((e=>typeof n===e.toLowerCase()))}return o?void 0:this.getMessage(r||this.message,t)}};t.ListValidator=c,t.ListValidator=c=n([(0,s.validator)(i.ValidationKeys.LIST),o("design:paramtypes",[String])],c)},169:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length>t?this.getMessage(r||this.message,t):void 0}};t.MaxLengthValidator=c,t.MaxLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX_LENGTH),o("design:paramtypes",[String])],c)},909:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Max param defined");return e>t?this.getMessage(r||this.message,t):void 0}}};t.MaxValidator=c,t.MaxValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX),o("design:paramtypes",[String])],c)},519:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinLengthValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length<t?this.getMessage(r||this.message,t):void 0}};t.MinLengthValidator=c,t.MinLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN_LENGTH),o("design:paramtypes",[String])],c)},889:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Min param defined");return e<t?this.getMessage(r||this.message,t):void 0}}};t.MinValidator=c,t.MinValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN),o("design:paramtypes",[String])],c)},354:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordValidator=void 0;const a=r(273),i=r(772),s=r(787);let c=class extends a.PatternValidator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PASSWORD){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||i.DEFAULT_ERROR_MESSAGES.PASSWORD,r||this.message)}};t.PasswordValidator=c,t.PasswordValidator=c=n([(0,s.validator)(i.ValidationKeys.PASSWORD),o("design:paramtypes",[Object])],c)},273:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PatternValidator=t.regexpParser=void 0;const a=r(116),i=r(772),s=r(787);t.regexpParser=new RegExp("^/(.+)/([gimus]*)$");let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PATTERN){super(e,"string")}getPattern(e){if(!t.regexpParser.test(e))return new RegExp(e);const r=e.match(t.regexpParser);return new RegExp(r[1],r[2])}hasErrors(e,t,r){if(e){if(!t)throw new Error("Missing Pattern");return(t="string"==typeof t?this.getPattern(t):t).lastIndex=0,t.test(e)?void 0:this.getMessage(r||this.message)}}};t.PatternValidator=c,t.PatternValidator=c=n([(0,s.validator)(i.ValidationKeys.PATTERN),o("design:paramtypes",[String])],c)},812:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.REQUIRED){super(e)}hasErrors(e,t){switch(typeof e){case"boolean":case"number":return void 0===e?this.getMessage(t||this.message):void 0;default:return e?void 0:this.getMessage(t||this.message)}}};t.RequiredValidator=c,t.RequiredValidator=c=n([(0,s.validator)(i.ValidationKeys.REQUIRED),o("design:paramtypes",[String])],c)},553:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepValidator=void 0;const a=r(116),i=r(772),s=r(787);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.STEP){super(e,"number","string")}hasErrors(e,t,r){if(void 0!==e)return Number(e)%Number(t)!=0?this.getMessage(r||this.message,t):void 0}};t.StepValidator=c,t.StepValidator=c=n([(0,s.validator)(i.ValidationKeys.STEP),o("design:paramtypes",[String])],c)},375:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeValidator=void 0;const a=r(116),i=r(772),s=r(787),c=r(770),u=r(32),l=r(154);let d=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.TYPE){super(e)}hasErrors(e,t,r){if(void 0!==e)return(0,u.evaluateDesignTypes)(e,t)?void 0:this.getMessage(r||this.message,"string"==typeof t?t:Array.isArray(t)?t.join(", "):t.name,typeof e)}};t.TypeValidator=d,t.TypeValidator=d=n([(0,s.validator)(i.ValidationKeys.TYPE),o("design:paramtypes",[String])],d),c.Validation.register({validator:d,validationKey:l.ModelKeys.TYPE,save:!1})},964:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URLValidator=void 0;const a=r(772),i=r(273),s=r(787);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.URL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.URL,r)}};t.URLValidator=c,t.URLValidator=c=n([(0,s.validator)(a.ValidationKeys.URL),o("design:paramtypes",[String])],c)},116:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const n=r(772),o=r(593),a=r(32);t.Validator=class{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){this.message=e,t.length&&(this.acceptedTypes=t),this.acceptedTypes&&(this.hasErrors=this.checkTypeAndHasErrors(this.hasErrors.bind(this)))}getMessage(e,...t){return(0,o.sf)(e,...t)}checkTypeAndHasErrors(e){return function(t,...r){return void 0!==t&&this.acceptedTypes?(0,a.checkTypes)(t,this.acceptedTypes)?e(t,...r):this.getMessage(n.DEFAULT_ERROR_MESSAGES.TYPE,this.acceptedTypes.join(", "),typeof t):e(t,...r)}.bind(this)}}},436:(e,t)=>{function r(e){return e.constructor&&e.hasErrors}Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorRegistry=void 0,t.isValidator=r,t.ValidatorRegistry=class{constructor(...e){this.cache={},this.customKeyCache={},this.register(...e)}getCustomKeys(){return Object.assign({},this.customKeyCache)}getKeys(){return Object.keys(this.cache)}get(e){if(!(e in this.cache))return;const t=this.cache[e];if(r(t))return t;const n=new(t.default||t);return this.cache[e]=n,n}register(...e){e.forEach((e=>{if(r(e)){if(e.validationKey in this.cache)return;this.cache[e.validationKey]=e}else{const{validationKey:t,validator:r,save:n}=e;if(t in this.cache)return;if(this.cache[t]=r,!n)return;const o={};o[t.toUpperCase()]=t,this.customKeyCache=Object.assign({},this.customKeyCache,o)}}))}}},772:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PATTERNS=t.DEFAULT_ERROR_MESSAGES=t.DAYS_OF_WEEK_NAMES=t.MONTH_NAMES=t.ValidationKeys=void 0;const n=r(154);t.ValidationKeys={REFLECT:`${n.ModelKeys.REFLECT}validation.`,VALIDATOR:"validator",REQUIRED:"required",MIN:"min",MAX:"max",STEP:"step",MIN_LENGTH:"minlength",MAX_LENGTH:"maxlength",PATTERN:"pattern",EMAIL:"email",URL:"url",DATE:"date",TYPE:"type",PASSWORD:"password",LIST:"list"},t.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"],t.DAYS_OF_WEEK_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.DEFAULT_ERROR_MESSAGES={REQUIRED:"This field is required",MIN:"The minimum value is {0}",MAX:"The maximum value is {0}",MIN_LENGTH:"The minimum length is {0}",MAX_LENGTH:"The maximum length is {0}",PATTERN:"The value does not match the pattern",EMAIL:"The value is not a valid email",URL:"The value is not a valid URL",TYPE:"Invalid type. Expected {0}, received {1}",STEP:"Invalid value. Not a step of {0}",DATE:"Invalid value. not a valid Date",DEFAULT:"There is an Error",PASSWORD:"Must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",LIST:"Invalid list of {0}",MODEL_NOT_FOUND:"No model registered under {0}"},t.DEFAULT_PATTERNS={EMAIL:/[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/,URL:/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,PASSWORD:{CHAR8_ONE_OF_EACH:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&_\-.,])[A-Za-z\d@$!%*?&_\-.,]{8,}$/g}}},787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validator=function(...e){return(0,a.apply)((t=>(e.forEach((e=>{n.Validation.register({validator:t,validationKey:e,save:!0})})),t)),(0,a.metadata)(n.Validation.key(o.ValidationKeys.VALIDATOR),e))};const n=r(770),o=r(772),a=r(32)},493:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Validators=void 0;const a=r(395),i=r(375),s=r(354),c=r(553),u=r(964),l=r(273),d=r(889),f=r(519),p=r(909),y=r(169),h=r(812),g=r(335),v=r(407);o(r(772),t),o(r(395),t),o(r(787),t),o(r(335),t),o(r(407),t),o(r(169),t),o(r(909),t),o(r(519),t),o(r(889),t),o(r(354),t),o(r(273),t),o(r(812),t),o(r(553),t),o(r(168),t),o(r(375),t),o(r(964),t),o(r(116),t),o(r(436),t),t.Validators={DateValidator:a.DateValidator,EmailValidator:g.EmailValidator,ListValidator:v.ListValidator,MaxLengthValidator:y.MaxLengthValidator,MaxValidator:p.MaxValidator,MinLengthValidator:f.MinLengthValidator,MinValidator:d.MinValidator,PasswordValidator:s.PasswordValidator,PatternValidator:l.PatternValidator,RequiredValidator:h.RequiredValidator,StepValidator:c.StepValidator,TypeValidator:i.TypeValidator,URLValidator:u.URLValidator}},168:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},475:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.required=function(e=n.DEFAULT_ERROR_MESSAGES.REQUIRED){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.REQUIRED),{message:e})},t.min=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MIN),{value:e,message:t,types:[Number.name,Date.name]})},t.max=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MAX),{value:e,message:t,types:[Number.name,Date.name]})},t.step=function(e,t=n.DEFAULT_ERROR_MESSAGES.STEP){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.STEP),{value:e,message:t,types:[Number.name]})},t.minlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MIN_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.maxlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.MAX_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.pattern=function(e,t=n.DEFAULT_ERROR_MESSAGES.PATTERN){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.PATTERN),{value:"string"==typeof e?e:e.toString(),message:t,types:[String.name]})},t.email=function(e=n.DEFAULT_ERROR_MESSAGES.EMAIL){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.EMAIL),{pattern:n.DEFAULT_PATTERNS.EMAIL,message:e,types:[String.name]})},t.url=function(e=n.DEFAULT_ERROR_MESSAGES.URL){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.URL),{pattern:n.DEFAULT_PATTERNS.URL,message:e,types:[String.name]})},t.type=function(e,t=n.DEFAULT_ERROR_MESSAGES.TYPE){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.TYPE),{customTypes:e,message:t})},t.date=function(e="dd/MM/yyyy",t=n.DEFAULT_ERROR_MESSAGES.DATE){return(r,c)=>{(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.DATE),{format:e,message:t,types:[Date.name]})(r,c);const u=new WeakMap;Object.defineProperty(r,c,{configurable:!1,set(t){const r=Object.getOwnPropertyDescriptor(this,c);r&&!r.configurable||Object.defineProperty(this,c,{enumerable:!0,configurable:!1,get:()=>u.get(this),set:t=>{let r;try{r=(0,a.parseDate)(e,t),u.set(this,r)}catch(e){console.error((0,o.sf)("Failed to parse date: {0}",e.message||e))}}}),this[c]=t},get(){console.log("here")}})}},t.password=function(e=n.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,t=n.DEFAULT_ERROR_MESSAGES.PASSWORD){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.PASSWORD),{pattern:e,message:t,types:[String.name]})},t.list=c,t.set=function(e,t=n.DEFAULT_ERROR_MESSAGES.LIST){return c(e,"Set",t)},r(630);const n=r(772),o=r(593),a=r(46),i=r(253),s=r(770);function c(e,t="Array",r=n.DEFAULT_ERROR_MESSAGES.LIST){return(0,i.propMetadata)(s.Validation.key(n.ValidationKeys.LIST),{class:Array.isArray(e)?e.map((e=>e.name)):[e.name],type:t,message:r})}},965:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(493),t),o(r(475),t),o(r(792),t),o(r(770),t)},792:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},267:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReflectionKeys=void 0,function(e){e.TYPE="design:type"}(r||(t.ReflectionKeys=r={}))},530:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metadata=function(e,t){return(r,n,o)=>{o?Reflect.defineMetadata(e,t,o.value):n?Reflect.defineMetadata(e,t,r,n):Reflect.defineMetadata(e,t,r)}},t.apply=function(...e){return(t,r,n)=>{for(const o of e)t instanceof Function&&!n?o(t):o(t,r,n)}},r(630)},651:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isEqual=function e(t,r,...n){if(t===r)return!0;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(typeof t!=typeof r)return!1;if(t.prototype!==r.prototype)return!1;const o=Object.keys(t).filter((e=>-1===n.indexOf(e)));return o.length===Object.keys(r).filter((e=>-1===n.indexOf(e))).length&&o.every((o=>-1!==n.indexOf(o)||e(t[o],r[o],...n)))}},32:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(267),t),o(r(530),t),o(r(651),t),o(r(199),t),o(r(115),t),t.VERSION="0.3.0"},199:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},115:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyDecorators=a,t.getTypeFromDecorator=function(e,t){const r=a(n.ReflectionKeys.TYPE,e,t,!1);if(!r||!r.decorators)return;const o=r.decorators.shift(),i=o.props?o.props.name:void 0;return"Function"!==i?i:void 0},t.getAllPropertyDecorators=function(e,...t){if(t&&t.length)return Object.getOwnPropertyNames(e).reduce(((r,n)=>(t.forEach(((t,o)=>{const i=a(t,e,n,0!==o);r||(r={}),function(e,t,r){r&&r.length&&(e[t]||(e[t]=[]),e[t].push(...r))}(r,n,i.decorators)})),r)),void 0)},t.getAllProperties=function(e,t=!0,r="Object"){const n=[];let o=e;const a=function(){if(!t)return;const e=Object.getPrototypeOf(o);return e&&e.constructor.name!==r?(o=e,o):void 0};do{Object.getOwnPropertyNames(o).forEach((function(e){-1===n.indexOf(e)&&n.push(e)}))}while(a());return n},t.getClassDecorators=function(e,t){return Reflect.getOwnMetadataKeys(t.constructor).filter((t=>t.toString().startsWith(e))).reduce(((r,n)=>{const o={key:n.substring(e.length),props:Reflect.getMetadata(n,t.constructor)};return r.concat(o)}),[])},t.checkType=i,t.checkTypes=s,t.evaluateDesignTypes=function(e,t){switch(typeof t){case"string":return i(e,t);case"object":return!Array.isArray(t)||s(e,t);case"function":return!t.name||"Object"===t.name||i(e,t.name);default:return!0}},r(630);const n=r(267),o=r(651);function a(e,t,r,i=!1,s=!0,c){const u=function(e,t,r,o=!1,a){const i=Reflect.getMetadataKeys(t,r).filter((t=>o?t.toString().startsWith(e):t===n.ReflectionKeys.TYPE||t.toString().startsWith(e))).reduce(((o,a)=>{const i={key:a!==n.ReflectionKeys.TYPE?a.substring(e.length):a,props:Reflect.getMetadata(a,t,r)};return o.concat(i)}),a||[]);return{prop:r.toString(),decorators:i}}(e,t,r,i,c);return s&&Object.getPrototypeOf(t)!==Object.prototype?a(e,Object.getPrototypeOf(t.constructor),r,!0,s,u.decorators):{prop:u.prop,decorators:function(e){const r={};return e.filter((e=>e.key in r?((0,o.isEqual)(e.props,r[e.key])||console.log(`Found a similar decorator for the ${e.key} propertyof a ${t.constructor.name} model but with different attributes.The original one will be kept`),!1):(r[e.key.toString()]=e.props,!0)))}(u.decorators)}}function i(e,t){return typeof e===t||e.constructor&&e.constructor.name.toLowerCase()===t.toLowerCase()}function s(e,t){return!t.every((t=>!i(e,t)))}},630:(e,t,r)=>{var n;!function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==t.Reflect&&(n=o(t.Reflect,n)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!i&&!s,u={create:i?function(){return G(Object.create(null))}:s?function(){return G({__proto__:null})}:function(){return G({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,N(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!N(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(N(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=u.create(),t=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+i()}while(u.has(e,t));return e[t]=!0,t}function o(e,n){if(!r.call(e,t)){if(!n)return;Object.defineProperty(e,t,{value:u.create()})}return e[t]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function i(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):a(t,e),t}return a(new Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var n=e[r];4!==r&&6!==r&&8!==r||(t+="-"),n<16&&(t+="0"),t+=n.toString(16).toLowerCase()}return t}}(),y=n?Symbol.for("@reflect-metadata:registry"):void 0,h=function(){var e;return!S(y)&&T(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[y]),S(e)&&(e=function(){var e,r,n,o;S(y)||void 0===t.Reflect||y in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,a=e.deleteMetadata,i=new p;return{isProviderFor:function(e,t){var r=i.get(e);return!(S(r)||!r.has(t))||!!o(e,t).length&&(S(r)&&(r=new f,i.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:a}}(t.Reflect));var a=new p,i={registerProvider:s,getProvider:u,setProvider:h};return i;function s(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case S(r):r=t;break;case r===t:break;case S(n):n=t;break;case n===t:break;default:void 0===o&&(o=new f),o.add(t)}}function c(t,a){if(!S(r)){if(r.isProviderFor(t,a))return r;if(!S(n)){if(n.isProviderFor(t,a))return r;if(!S(o))for(var i=K(o);;){var s=x(i);if(!s)return;var c=I(s);if(c.isProviderFor(t,a))return F(i),c}}}if(!S(e)&&e.isProviderFor(t,a))return e}function u(e,t){var r,n=a.get(e);return S(n)||(r=n.get(t)),S(r)?(S(r=c(e,t))||(S(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function l(e){if(S(e))throw new TypeError;return r===e||n===e||!S(o)&&o.has(e)}function h(e,t,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(e,t);if(n!==r){if(!S(n))return!1;var o=a.get(e);S(o)&&(o=new d,a.set(e,o)),o.set(t,r)}return!0}}()),!S(y)&&T(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),g=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!S(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,o){n(r,o,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var o=n(t,r,!1);return!S(o)&&A(o.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var o=n(t,r,!1);if(!S(o))return o.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],o=n(e,t,!1);if(S(o))return r;for(var a=K(o.keys()),i=0;;){var s=x(a);if(!s)return r.length=i,r;var c=I(s);try{r[i]=c}catch(e){try{F(a)}finally{throw e}}i++}},OrdinaryDeleteMetadata:function(e,r,o){var a=n(r,o,!1);if(S(a))return!1;if(!a.delete(e))return!1;if(0===a.size){var i=t.get(r);S(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}};return h.registerProvider(r),r;function n(n,o,a){var i=t.get(n),s=!1;if(S(i)){if(!a)return;i=new d,t.set(n,i),s=!0}var c=i.get(o);if(S(c)){if(!a)return;if(c=new d,i.set(o,c),!e.setProvider(n,o,r))throw i.delete(o),s&&t.delete(n),new Error("Wrong provider for target.")}return c}}(h);function v(e,t,r){if(E(e,t,r))return!0;var n=U(t);return!w(n)&&v(e,n,r)}function E(e,t,r){var n=z(t,r,!1);return!S(n)&&A(n.OrdinaryHasOwnMetadata(e,t,r))}function _(e,t,r){if(E(e,t,r))return M(e,t,r);var n=U(t);return w(n)?void 0:_(e,n,r)}function M(e,t,r){var n=z(t,r,!1);if(!S(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function O(e,t,r,n){z(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function b(e,t){var r=m(e,t),n=U(e);if(null===n)return r;var o=b(n,t);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new f,i=[],s=0,c=r;s<c.length;s++){var u=c[s];a.has(u)||(a.add(u),i.push(u))}for(var l=0,d=o;l<d.length;l++)u=d[l],a.has(u)||(a.add(u),i.push(u));return i}function m(e,t){var r=z(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function S(e){return void 0===e}function w(e){return null===e}function T(e){return"object"==typeof e?null!==e:"function"==typeof e}function P(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=k(e,o);if(void 0!==n){var a=n.call(e,r);if(T(a))throw new TypeError;return a}return function(e,t){if("string"===t){var r=e.toString;if(D(r)&&!T(o=r.call(e)))return o;if(D(n=e.valueOf)&&!T(o=n.call(e)))return o}else{var n;if(D(n=e.valueOf)&&!T(o=n.call(e)))return o;var o,a=e.toString;if(D(a)&&!T(o=a.call(e)))return o}throw new TypeError}(e,"default"===r?"number":r)}function A(e){return!!e}function j(e){var t=P(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function V(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function D(e){return"function"==typeof e}function L(e){return"function"==typeof e}function N(e,t){return e===t||e!=e&&t!=t}function k(e,t){var r=e[t];if(null!=r){if(!D(r))throw new TypeError;return r}}function K(e){var t=k(e,a);if(!D(t))throw new TypeError;var r=t.call(e);if(!T(r))throw new TypeError;return r}function I(e){return e.value}function x(e){var t=e.next();return!t.done&&t}function F(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var o=n.constructor;return"function"!=typeof o||o===e?t:o}function z(e,t,r){var n=h.getProvider(e,t);if(!S(n))return n;if(r){if(h.setProvider(e,t,g))return g;throw new Error("Illegal state.")}}function G(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(S(r)){if(!V(e))throw new TypeError;if(!L(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!S(n)&&!w(n)){if(!L(n))throw new TypeError;t=n}}return t}(e,t)}if(!V(e))throw new TypeError;if(!T(t))throw new TypeError;if(!T(n)&&!S(n)&&!w(n))throw new TypeError;return w(n)&&(n=void 0),function(e,t,r,n){for(var o=e.length-1;o>=0;--o){var a=(0,e[o])(t,r,n);if(!S(a)&&!w(a)){if(!T(a))throw new TypeError;n=a}}return n}(e,t,r=j(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!T(r))throw new TypeError;if(!S(n)&&!function(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;O(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!T(r))throw new TypeError;return S(n)||(n=j(n)),O(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),v(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),E(e,t,r)})),e("getMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),_(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!T(t))throw new TypeError;return S(r)||(r=j(r)),M(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return S(t)||(t=j(t)),b(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!T(e))throw new TypeError;return S(t)||(t=j(t)),m(e,t)})),e("deleteMetadata",(function(e,t,r){if(!T(t))throw new TypeError;if(S(r)||(r=j(r)),!T(t))throw new TypeError;S(r)||(r=j(r));var n=z(t,r,!1);return!S(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(729); |
@@ -65,2 +65,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.3.6"; | ||
export declare const VERSION = "1.3.7"; |
@@ -65,4 +65,4 @@ /** | ||
export * from "./model"; | ||
export const VERSION = "1.3.6"; | ||
export const VERSION = "1.3.7"; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVIOzs7O0dBSUc7QUFFSDs7OztHQUlHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQUdHO0FBRUg7OztHQ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VXRpbHNcbiAqL1xuXG4vKipcbiAqIEBuYW1lc3BhY2UgU2VyaWFsaXphdGlvblxuICogQG1lbWJlck9mIG1vZHVsZTpkZWNvcmF0b3ItdmFsaWRhdGlvbi5VdGlsc1xuICovXG5cbi8qKlxuICogQG5hbWVzcGFjZSBGb3JtYXRcbiAqIEBtZW1iZXJPZiBtb2R1bGU6ZGVjb3JhdG9yLXZhbGlkYXRpb24uVXRpbHNcbiAqL1xuXG5leHBvcnQgKiBmcm9tIFwiLi91dGlsc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vdmFsaWRhdGlvblwiO1xuZXhwb3J0ICogZnJvbSBcIi4vbW9kZWxcIjtcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBcIjEuMy43XCI7XG4iXX0= |
import { Model } from "./Model"; | ||
import { ModelArg } from "./types"; | ||
/** | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromObject | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export declare function constructFromObject<T extends Model>(self: T, obj?: ModelArg<T>): T; | ||
/** | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromModel | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export declare function constructFromModel<T extends Model>(self: T, obj?: ModelArg<T>): T; | ||
/** | ||
* @summary Helper Function to override constructors | ||
@@ -31,0 +4,0 @@ * |
import { Model } from "./Model"; | ||
import { ValidationKeys } from "../validation/Validators/constants"; | ||
import { jsTypes, ReservedModels } from "./constants"; | ||
import { ModelKeys } from "../utils/constants"; | ||
import { sf } from "../utils/strings"; | ||
import { getPropertyDecorators } from "@decaf-ts/reflection"; | ||
import { isModel } from "./utils"; | ||
/** | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromObject | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export function constructFromObject(self, obj) { | ||
if (!obj) | ||
return self; | ||
for (const prop in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, prop) && | ||
(Object.prototype.hasOwnProperty.call(self, prop) || | ||
(self.prototype && | ||
Object.prototype.hasOwnProperty.call(self.prototype, prop)))) | ||
self[prop] = obj[prop] || undefined; | ||
} | ||
return self; | ||
} | ||
/** | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromModel | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export function constructFromModel(self, obj) { | ||
if (!obj) | ||
return self; | ||
let decorators, dec; | ||
for (const prop in obj) { | ||
if (Object.prototype.hasOwnProperty.call(obj, prop) && | ||
(Object.prototype.hasOwnProperty.call(self, prop) || | ||
(self.prototype && | ||
Object.prototype.hasOwnProperty.call(self.prototype, prop)))) { | ||
self[prop] = obj[prop]; | ||
if (typeof self[prop] !== "object") | ||
continue; | ||
if (isModel(self[prop])) { | ||
try { | ||
self[prop] = Model.build(self[prop]); | ||
} | ||
catch (e) { | ||
console.log(e); | ||
} | ||
continue; | ||
} | ||
const allDecorators = getPropertyDecorators(ValidationKeys.REFLECT, self, prop).decorators; | ||
decorators = allDecorators.filter((d) => [ModelKeys.TYPE, ValidationKeys.TYPE].indexOf(d.key) !== -1); | ||
if (!decorators || !decorators.length) | ||
throw new Error(sf("failed to find decorators for property {0}", prop)); | ||
dec = decorators.pop(); | ||
const clazz = dec.props.name | ||
? [dec.props.name] | ||
: Array.isArray(dec.props.customTypes) | ||
? dec.props.customTypes | ||
: [dec.props.customTypes]; | ||
const reserved = Object.values(ReservedModels).map((v) => v.toLowerCase()); | ||
clazz.forEach((c) => { | ||
if (reserved.indexOf(c.toLowerCase()) === -1) | ||
try { | ||
switch (c) { | ||
case "Array": | ||
case "Set": | ||
if (allDecorators.length) { | ||
const listDec = allDecorators.find((d) => d.key === ValidationKeys.LIST); | ||
if (listDec) { | ||
const clazzName = listDec.props.class.find((t) => !jsTypes.includes(t.toLowerCase())); | ||
if (c === "Array") | ||
self[prop] = self[prop].map((el) => { | ||
return ["object", "function"].includes(typeof el) && | ||
clazzName | ||
? Model.build(el, clazzName) | ||
: el; | ||
}); | ||
if (c === "Set") { | ||
const s = new Set(); | ||
for (const v of self[prop]) { | ||
if (["object", "function"].includes(typeof v) && | ||
clazzName) { | ||
s.add(Model.build(v, clazzName)); | ||
} | ||
else { | ||
s.add(v); | ||
} | ||
} | ||
self[prop] = s; | ||
} | ||
} | ||
} | ||
break; | ||
default: | ||
if (self[prop]) | ||
self[prop] = Model.build(self[prop], c); | ||
} | ||
} | ||
catch (e) { | ||
console.log(e); | ||
// do nothing. we have no registry of this class | ||
} | ||
}); | ||
} | ||
} | ||
return self; | ||
} | ||
/** | ||
* @summary Helper Function to override constructors | ||
@@ -172,2 +51,2 @@ * | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC9jb25zdHJ1Y3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUNoQyxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU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BzLmN1c3RvbVR5cGVzKVxuICAgICAgICAgID8gZGVjLnByb3BzLmN1c3RvbVR5cGVzXG4gICAgICAgICAgOiBbZGVjLnByb3BzLmN1c3RvbVR5cGVzXTtcbiAgICAgIGNvbnN0IHJlc2VydmVkID0gT2JqZWN0LnZhbHVlcyhSZXNlcnZlZE1vZGVscykubWFwKCh2KSA9PlxuICAgICAgICB2LnRvTG93ZXJDYXNlKClcbiAgICAgICkgYXMgc3RyaW5nW107XG5cbiAgICAgIGNsYXp6LmZvckVhY2goKGMpID0+IHtcbiAgICAgICAgaWYgKHJlc2VydmVkLmluZGV4T2YoYy50b0xvd2VyQ2FzZSgpKSA9PT0gLTEpXG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHN3aXRjaCAoYykge1xuICAgICAgICAgICAgICBjYXNlIFwiQXJyYXlcIjpcbiAgICAgICAgICAgICAgY2FzZSBcIlNldFwiOlxuICAgICAgICAgICAgICAgIGlmIChhbGxEZWNvcmF0b3JzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgbGlzdERlYyA9IGFsbERlY29yYXRvcnMuZmluZChcbiAgICAgICAgICAgICAgICAgICAgKGQpID0+IGQua2V5ID09PSBWYWxpZGF0aW9uS2V5cy5MSVNUXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgaWYgKGxpc3REZWMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2xhenpOYW1lID0gbGlzdERlYy5wcm9wcy5jbGFzcy5maW5kKFxuICAgICAgICAgICAgICAgICAgICAgICh0OiBzdHJpbmcpID0+ICFqc1R5cGVzLmluY2x1ZGVzKHQudG9Mb3dlckNhc2UoKSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT09IFwiQXJyYXlcIilcbiAgICAgICAgICAgICAgICAgICAgICAoc2VsZiBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSA9IChcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYgYXMgUmVjb3JkPHN0cmluZywgYW55PlxuICAgICAgICAgICAgICAgICAgICAgIClbcHJvcF0ubWFwKChlbDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW1wib2JqZWN0XCIsIFwiZnVuY3Rpb25cIl0uaW5jbHVkZXModHlwZW9mIGVsKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGF6ek5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNb2RlbC5idWlsZChlbCwgY2xhenpOYW1lKVxuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGVsO1xuICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PT0gXCJTZXRcIikge1xuICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHMgPSBuZXcgU2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCB2IG9mIChzZWxmIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtcIm9iamVjdFwiLCBcImZ1bmN0aW9uXCJdLmluY2x1ZGVzKHR5cGVvZiB2KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGF6ek5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzLmFkZChNb2RlbC5idWlsZCh2LCBjbGF6ek5hbWUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHMuYWRkKHYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAoc2VsZiBhcyBSZWNvcmQ8c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XBlICE9PSBPYmplY3QucHJvdG90eXBlKSB7XG4gICAgY29uc3QgcHJvdCA9IE9iamVjdC5nZXRQcm90b3R5cGVPZihwcm90b3R5cGUpO1xuICAgIGlmIChcbiAgICAgIHByb3QgPT09IE9iamVjdC5wcm90b3R5cGUgfHxcbiAgICAgIE9iamVjdC5nZXRQcm90b3R5cGVPZihwcm90KSA9PT0gT2JqZWN0LnByb3RvdHlwZVxuICAgICkge1xuICAgICAgcmV0dXJuIGJpbmRQcm90b3R5cGUocHJvdG90eXBlLCBNb2RlbC5wcm90b3R5cGUpO1xuICAgIH1cbiAgfVxuICB0aHJvdyBuZXcgRXJyb3IoXCJDb3VsZCBub3QgZmluZCBwcm9wZXIgcHJvdG90eXBlIHRvIGJpbmRcIik7XG59XG4iXX0= |
@@ -15,5 +15,3 @@ /** | ||
* - Runs the optional {@link InstanceCallback} if provided; | ||
* - Defines an {@link ModelKeys#ANCHOR} property for serialization and model rebuilding purposes; | ||
* | ||
* @param {string} [nameOverride] | ||
* @param {InstanceCallback} [instanceCallback] optional callback that will be called with the instance upon instantiation. defaults to undefined | ||
@@ -24,2 +22,4 @@ * | ||
*/ | ||
export declare function model(nameOverride?: string, instanceCallback?: InstanceCallback): any; | ||
export declare function model(instanceCallback?: InstanceCallback): any; | ||
export declare function hashedBy(algorithm: string, ...args: any[]): ClassDecorator; | ||
export declare function serializedBy(serializer: string, ...args: any[]): ClassDecorator; |
import { bindModelPrototype, construct } from "./construction"; | ||
import { ModelKeys } from "../utils/constants"; | ||
import { Model } from "./Model"; | ||
import { getModelKey } from "./utils"; | ||
import { metadata } from "@decaf-ts/reflection"; | ||
@@ -14,5 +13,3 @@ /** | ||
* - Runs the optional {@link InstanceCallback} if provided; | ||
* - Defines an {@link ModelKeys#ANCHOR} property for serialization and model rebuilding purposes; | ||
* | ||
* @param {string} [nameOverride] | ||
* @param {InstanceCallback} [instanceCallback] optional callback that will be called with the instance upon instantiation. defaults to undefined | ||
@@ -23,3 +20,3 @@ * | ||
*/ | ||
export function model(nameOverride, instanceCallback) { | ||
export function model(instanceCallback) { | ||
return ((original) => { | ||
@@ -34,3 +31,3 @@ // the new constructor behaviour | ||
builder(instance, args.length ? args[0] : undefined); | ||
metadata(getModelKey(ModelKeys.MODEL), nameOverride || original.name)(instance.constructor); | ||
metadata(Model.key(ModelKeys.MODEL), original.name)(instance.constructor); | ||
if (instanceCallback) | ||
@@ -49,4 +46,4 @@ instanceCallback(instance, ...args); | ||
}); | ||
metadata(getModelKey(ModelKeys.MODEL), nameOverride || original.name)(original); | ||
Model.register(newConstructor, nameOverride); | ||
metadata(Model.key(ModelKeys.MODEL), original.name)(original); | ||
Model.register(newConstructor, original.name); | ||
// return new constructor (will override original) | ||
@@ -56,3 +53,15 @@ return newConstructor; | ||
} | ||
export function hashedBy(algorithm, ...args) { | ||
return metadata(Model.key(ModelKeys.HASHING), { | ||
algorithm: algorithm, | ||
args: args, | ||
}); | ||
} | ||
export function serializedBy(serializer, ...args) { | ||
return metadata(Model.key(ModelKeys.SERIALIZATION), { | ||
serializer: serializer, | ||
args: args, | ||
}); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUMvRCxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDL0MsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUNoQyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQ3RDLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQVNoRDs7Ozs7Ozs7Ozs7Ozs7O0dB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biAgICBhcmdzOiBhcmdzLFxuICB9KTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHNlcmlhbGl6ZWRCeShcbiAgc2VyaWFsaXplcjogc3RyaW5nLFxuICAuLi5hcmdzOiBhbnlbXVxuKTogQ2xhc3NEZWNvcmF0b3Ige1xuICByZXR1cm4gbWV0YWRhdGEoTW9kZWwua2V5KE1vZGVsS2V5cy5TRVJJQUxJWkFUSU9OKSwge1xuICAgIHNlcmlhbGl6ZXI6IHNlcmlhbGl6ZXIsXG4gICAgYXJnczogYXJncyxcbiAgfSk7XG59XG4iXX0= |
import { BuilderRegistry } from "../utils/registry"; | ||
import { ModelErrorDefinition } from "./ModelErrorDefinition"; | ||
import { Comparable, Hashable, ModelArg, ModelConstructor, Serializable, Validatable } from "./types"; | ||
import { Comparable, Constructor, Hashable, ModelArg, ModelConstructor, Serializable, Validatable } from "./types"; | ||
import { ModelBuilderFunction } from "./construction"; | ||
@@ -10,11 +10,5 @@ /** | ||
* Model objects must: | ||
* - Have all their properties defined as optional; | ||
* - Have all their properties initialized eg: | ||
* - Have all their required properties marked with '!'; | ||
* - Have all their optional properties marked as '?': | ||
* | ||
* <pre> | ||
* class ClassName { | ||
* propertyName?: PropertyType = undefined; | ||
* } | ||
* </pre> | ||
* | ||
* @param {Model | {}} model base object from which to populate properties from | ||
@@ -27,3 +21,9 @@ * | ||
* | ||
* @category Model | ||
* @example | ||
* class ClassName { | ||
* @required() | ||
* requiredPropertyName!: PropertyType; | ||
* | ||
* optionalPropertyName?: PropertyType; | ||
* } | ||
*/ | ||
@@ -35,3 +35,3 @@ export declare abstract class Model implements Validatable, Serializable, Hashable, Comparable<Model> { | ||
* | ||
* @param {any[]} [exceptions] properties in the object to be ignored for he validation. Marked as 'any' to allow for extension but expects strings | ||
* @param {any[]} [exceptions] properties in the object to be ignored for the validation. Marked as 'any' to allow for extension but expects strings | ||
*/ | ||
@@ -67,11 +67,19 @@ hasErrors(...exceptions: any[]): ModelErrorDefinition | undefined; | ||
/** | ||
* @summary Wrapper around {@link constructFromObject} | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
static fromObject<T extends Model>(self: T, obj?: T | Record<string, any>): T; | ||
/** | ||
* @summary Wrapper around {@link constructFromModel} | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
@@ -125,2 +133,3 @@ static fromModel<T extends Model>(self: T, obj?: T | Record<string, any>): T; | ||
static getMetadata<V extends Model>(model: V): any; | ||
static getAttributes<V extends Model>(model: Constructor<V> | V): string[]; | ||
static equals<V extends Model>(obj1: V, obj2: V, ...exceptions: any[]): boolean; | ||
@@ -130,2 +139,8 @@ static hasErrors<V extends Model>(model: V, ...exceptions: any[]): ModelErrorDefinition | undefined; | ||
static hash<V extends Model>(model: V): any; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
*/ | ||
static key(str: string): string; | ||
} |
import { Serialization } from "../utils/serialization"; | ||
import { constructFromModel, constructFromObject, } from "./construction"; | ||
import { ModelRegistryManager } from "./Registry"; | ||
import { isEqual } from "@decaf-ts/reflection"; | ||
import { getPropertyDecorators, isEqual, } from "@decaf-ts/reflection"; | ||
import { validate } from "./validation"; | ||
import { Hashing } from "../utils/hashing"; | ||
import { getModelKey } from "./utils"; | ||
import { isPropertyModel } from "./utils"; | ||
import { ModelKeys } from "../utils/constants"; | ||
import { ValidationKeys } from "../validation/Validators/constants"; | ||
import { sf } from "../utils/strings"; | ||
import { jsTypes, ReservedModels } from "./constants"; | ||
let modelBuilderFunction; | ||
@@ -16,11 +18,5 @@ let actingModelRegistry; | ||
* Model objects must: | ||
* - Have all their properties defined as optional; | ||
* - Have all their properties initialized eg: | ||
* - Have all their required properties marked with '!'; | ||
* - Have all their optional properties marked as '?': | ||
* | ||
* <pre> | ||
* class ClassName { | ||
* propertyName?: PropertyType = undefined; | ||
* } | ||
* </pre> | ||
* | ||
* @param {Model | {}} model base object from which to populate properties from | ||
@@ -33,3 +29,9 @@ * | ||
* | ||
* @category Model | ||
* @example | ||
* class ClassName { | ||
* @required() | ||
* requiredPropertyName!: PropertyType; | ||
* | ||
* optionalPropertyName?: PropertyType; | ||
* } | ||
*/ | ||
@@ -42,3 +44,3 @@ export class Model { | ||
* | ||
* @param {any[]} [exceptions] properties in the object to be ignored for he validation. Marked as 'any' to allow for extension but expects strings | ||
* @param {any[]} [exceptions] properties in the object to be ignored for the validation. Marked as 'any' to allow for extension but expects strings | ||
*/ | ||
@@ -83,3 +85,3 @@ hasErrors(...exceptions) { | ||
static deserialize(str) { | ||
const metadata = Reflect.getMetadata(getModelKey(ModelKeys.SERIALIZATION), this.constructor); | ||
const metadata = Reflect.getMetadata(this.key(ModelKeys.SERIALIZATION), this.constructor); | ||
if (metadata && metadata.serializer) | ||
@@ -90,16 +92,103 @@ return Serialization.deserialize(str, metadata.serializer, ...(metadata.args || [])); | ||
/** | ||
* @summary Wrapper around {@link constructFromObject} | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
static fromObject(self, obj) { | ||
return constructFromObject(self, obj); | ||
if (!obj) | ||
obj = {}; | ||
for (const prop of Model.getAttributes(self)) { | ||
self[prop] = obj[prop] || undefined; | ||
} | ||
return self; | ||
} | ||
/** | ||
* @summary Wrapper around {@link constructFromModel} | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
static fromModel(self, obj) { | ||
return constructFromModel(self, obj); | ||
if (!obj) | ||
obj = {}; | ||
let decorators, dec; | ||
const props = Model.getAttributes(self); | ||
for (const prop of props) { | ||
self[prop] = | ||
obj[prop] || undefined; | ||
if (typeof self[prop] !== "object") | ||
continue; | ||
const propM = isPropertyModel(self, prop); | ||
if (propM) { | ||
try { | ||
self[prop] = Model.build(self[prop], typeof propM === "string" ? propM : undefined); | ||
} | ||
catch (e) { | ||
console.log(e); | ||
} | ||
continue; | ||
} | ||
const allDecorators = getPropertyDecorators(ValidationKeys.REFLECT, self, prop).decorators; | ||
decorators = allDecorators.filter((d) => [ModelKeys.TYPE, ValidationKeys.TYPE].indexOf(d.key) !== -1); | ||
if (!decorators || !decorators.length) | ||
throw new Error(sf("failed to find decorators for property {0}", prop)); | ||
dec = decorators.pop(); | ||
const clazz = dec.props.name | ||
? [dec.props.name] | ||
: Array.isArray(dec.props.customTypes) | ||
? dec.props.customTypes | ||
: [dec.props.customTypes]; | ||
const reserved = Object.values(ReservedModels).map((v) => v.toLowerCase()); | ||
clazz.forEach((c) => { | ||
if (reserved.indexOf(c.toLowerCase()) === -1) | ||
try { | ||
switch (c) { | ||
case "Array": | ||
case "Set": | ||
if (allDecorators.length) { | ||
const listDec = allDecorators.find((d) => d.key === ValidationKeys.LIST); | ||
if (listDec) { | ||
const clazzName = listDec.props.class.find((t) => !jsTypes.includes(t.toLowerCase())); | ||
if (c === "Array") | ||
self[prop] = self[prop].map((el) => { | ||
return ["object", "function"].includes(typeof el) && | ||
clazzName | ||
? Model.build(el, clazzName) | ||
: el; | ||
}); | ||
if (c === "Set") { | ||
const s = new Set(); | ||
for (const v of self[prop]) { | ||
if (["object", "function"].includes(typeof v) && | ||
clazzName) { | ||
s.add(Model.build(v, clazzName)); | ||
} | ||
else { | ||
s.add(v); | ||
} | ||
} | ||
self[prop] = s; | ||
} | ||
} | ||
} | ||
break; | ||
default: | ||
if (self[prop]) | ||
self[prop] = Model.build(self[prop], c); | ||
} | ||
} | ||
catch (e) { | ||
console.log(e); | ||
// do nothing. we have no registry of this class | ||
} | ||
}); | ||
} | ||
return self; | ||
} | ||
@@ -168,3 +257,3 @@ /** | ||
static getMetadata(model) { | ||
const metadata = Reflect.getMetadata(getModelKey(ModelKeys.MODEL), model.constructor); | ||
const metadata = Reflect.getMetadata(this.key(ModelKeys.MODEL), model.constructor); | ||
if (!metadata) | ||
@@ -174,2 +263,16 @@ throw new Error("could not find metadata for provided " + model.constructor.name); | ||
} | ||
static getAttributes(model) { | ||
const result = []; | ||
let prototype = model instanceof Model | ||
? Object.getPrototypeOf(model) | ||
: model.prototype; | ||
while (prototype != null) { | ||
const props = prototype[ModelKeys.ATTRIBUTE]; | ||
if (props) { | ||
result.push(...props); | ||
} | ||
prototype = Object.getPrototypeOf(prototype); | ||
} | ||
return result; | ||
} | ||
static equals(obj1, obj2, ...exceptions) { | ||
@@ -182,3 +285,3 @@ return isEqual(obj1, obj2, ...exceptions); | ||
static serialize(model) { | ||
const metadata = Reflect.getMetadata(getModelKey(ModelKeys.SERIALIZATION), model.constructor); | ||
const metadata = Reflect.getMetadata(this.key(ModelKeys.SERIALIZATION), model.constructor); | ||
if (metadata && metadata.serializer) | ||
@@ -189,3 +292,3 @@ return Serialization.serialize(this, metadata.serializer, ...(metadata.args || [])); | ||
static hash(model) { | ||
const metadata = Reflect.getMetadata(getModelKey(ModelKeys.HASHING), model.constructor); | ||
const metadata = Reflect.getMetadata(this.key(ModelKeys.HASHING), model.constructor); | ||
if (metadata && metadata.algorithm) | ||
@@ -195,4 +298,12 @@ return Hashing.hash(model, metadata.algorithm, ...(metadata.args || [])); | ||
} | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
*/ | ||
static key(str) { | ||
return ModelKeys.REFLECT + str; | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC9Nb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFXdkQsT0FBTyxFQUNMLGtCQUFrQixFQUNsQixtQkFBbUIsR0FFcEIsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFDbEQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzNDLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFDdEMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRS9DLElBQUksb0JBQXNELENBQUM7QUFDM0QsSUFBSSxtQkFBeUMsQ0FBQztBQUU5Qzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQXNCRztBQUNILE1BQU0sT0FBZ0IsS0FBSztJQUd6Qiw2REFBNkQ7SUFDN0QsWUFBc0IsR0FBcUIsSUFBRyxDQUFDO0lBRS9DOzs7O09BSUc7SUFDSSxTQUFTLENBQUMsR0FBRyxVQUFpQjtRQUNuQyxPQUFPLFFBQVEsQ0FBQyxJQUFJLEVBQUUsR0FBRyxV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ob2JqIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdIHx8IHVuZGVmaW5lZDtcbiAgICAgIGlmICh0eXBlb2YgKHNlbGYgYXMgYW55KVtwcm9wXSAhPT0gXCJvYmplY3RcIikgY29udGludWU7XG4gICAgICBjb25zdCBwcm9wTSA9IGlzUHJvcGVydHlNb2RlbChzZWxmLCBwcm9wKTtcbiAgICAgIGlmIChwcm9wTSkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIChzZWxmIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdID0gTW9kZWwuYnVpbGQoXG4gICAgICAgICAgICAoc2VsZiBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSxcbiAgICAgICAgICAgIHR5cGVvZiBwcm9wTSA9PT0gXCJzdHJpbmdcIiA/IHByb3BNIDogdW5kZWZpbmVkXG4gICAgICAgICAgKTtcbiAgICAgICAgfSBjYXRjaCAoZTogYW55KSB7XG4gICAgICAgICAgY29uc29sZS5sb2coZSk7XG4gICAgICAgIH1cbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG5cbiAgICAgIGNvbnN0IGFsbERlY29yYXRvcnM6IERlY29yYXRvck1ldGFkYXRhW10gPSBnZXRQcm9wZXJ0eURlY29yYXRvcnMoXG4gICAgICAgIFZhbGlkYXRpb25LZXlzLlJFRkxFQ1QsXG4gICAgICAgIHNlbGYsXG4gICAgICAgIHByb3BcbiAgICAgICkuZGVjb3JhdG9ycztcbiAgICAgIGRlY29yYXRvcnMgPSBhbGxEZWNvcmF0b3JzLmZpbHRlcihcbiAgICAgICAgKGQ6IERlY29yYXRvck1ldGFkYXRhKSA9PlxuICAgICAgICAgIFtNb2RlbEtleXMuVFlQRSwgVmFsaWRhdGlvbktleXMuVFlQRV0uaW5kZXhPZihkLmtleSkgIT09IC0xXG4gICAgICApO1xuICAgICAgaWYgKCFkZWNvcmF0b3JzIHx8ICFkZWNvcmF0b3JzLmxlbmd0aClcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKHNmKFwiZmFpbGVkIHRvIGZpbmQgZGVjb3JhdG9ycyBmb3IgcHJvcGVydHkgezB9XCIsIHByb3ApKTtcbiAgICAgIGRlYyA9IGRlY29yYXRvcnMucG9wKCkgYXMgRGVjb3JhdG9yTWV0YWRhdGE7XG4gICAgICBjb25zdCBjbGF6eiA9IGRlYy5wcm9wcy5uYW1lXG4gICAgICAgID8gW2RlYy5wcm9wcy5uYW1lXVxuICAgICAgICA6IEFycmF5LmlzQXJyYXkoZGVjLnByb3BzLmN1c3RvbVR5cGVzKVxuICAgICAgICAgID8gZGVjLnByb3BzLmN1c3RvbVR5cGVzXG4gICAgICAgICAgOiBbZGVjLnByb3BzLmN1c3RvbVR5cGVzXTtcbiAgICAgIGNvbnN0IHJlc2VydmVkID0gT2JqZWN0LnZhbHVlcyhSZXNlcnZlZE1vZGVscykubWFwKCh2KSA9PlxuICAgICAgICB2LnRvTG93ZXJDYXNlKClcbiAgICAgICkgYXMgc3RyaW5nW107XG5cbiAgICAgIGNsYXp6LmZvckVhY2goKGMpID0+IHtcbiAgICAgICAgaWYgKHJlc2VydmVkLmluZGV4T2YoYy50b0xvd2VyQ2FzZSgpKSA9PT0gLTEpXG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHN3aXRjaCAoYykge1xuICAgICAgICAgICAgICBjYXNlIFwiQXJyYXlcIjpcbiAgICAgICAgICAgICAgY2FzZSBcIlNldFwiOlxuICAgICAgICAgICAgICAgIGlmIChhbGxEZWNvcmF0b3JzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgbGlzdERlYyA9IGFsbERlY29yYXRvcnMuZmluZChcbiAgICAgICAgICAgICAgICAgICAgKGQpID0+IGQua2V5ID09PSBWYWxpZGF0aW9uS2V5cy5MSVNUXG4gICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgaWYgKGxpc3REZWMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY2xhenpOYW1lID0gbGlzdERlYy5wcm9wcy5jbGFzcy5maW5kKFxuICAgICAgICAgICAgICAgICAgICAgICh0OiBzdHJpbmcpID0+ICFqc1R5cGVzLmluY2x1ZGVzKHQudG9Mb3dlckNhc2UoKSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT09IFwiQXJyYXlcIilcbiAgICAgICAgICAgICAgICAgICAgICAoc2VsZiBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSA9IChcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYgYXMgUmVjb3JkPHN0cmluZywgYW55PlxuICAgICAgICAgICAgICAgICAgICAgIClbcHJvcF0ubWFwKChlbDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gW1wib2JqZWN0XCIsIFwiZnVuY3Rpb25cIl0uaW5jbHVkZXModHlwZW9mIGVsKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGF6ek5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNb2RlbC5idWlsZChlbCwgY2xhenpOYW1lKVxuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGVsO1xuICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PT0gXCJTZXRcIikge1xuICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHMgPSBuZXcgU2V0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCB2IG9mIChzZWxmIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgIFtcIm9iamVjdFwiLCBcImZ1bmN0aW9uXCJdLmluY2x1ZGVzKHR5cGVvZiB2KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGF6ek5hbWVcbiAgICAgICAgICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBzLmFkZChNb2RlbC5idWlsZCh2LCBjbGF6ek5hbWUpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHMuYWRkKHYpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAoc2VsZiBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+KVtwcm9wXSA9IHM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaWYgKChzZWxmIGFzIFJlY29yZDxzdHJpbmcsIGFueT4pW3Byb3BdKVxuICAgICAgICAgICAgICAgICAgKHNlbGYgYXMgUmVjb3JkPHN0cmluZywgYW55PilbcHJvcF0gPSBNb2RlbC5idWlsZChcbiAgICAgICAgICAgICAgICAgICAgKHNlbGYgYXMgYW55KVtwcm9wXSxcbiAgICAgICAgICAgICAgICAgICAgY1xuICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGNhdGNoIChlOiBhbnkpIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKGUpO1xuICAgICAgICAgICAgLy8gZG8gbm90aGluZy4gd2UgaGF2ZSBubyByZWdpc3RyeSBvZiB0aGlzIGNsYXNzXG4gICAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfVxuICAgIHJldHVybiBzZWxmO1xuICB9XG5cbiAgLyoqXG4gICAqIEBzdW1tYXJ5IFNldHMgdGhlIEdsb2JhbCB7QGxpbmsgTW9kZWxCdWlsZGVyRnVuY3Rpb259XG4gICAqIEBwYXJhbSB7TW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HJldHVybiBTZXJpYWxpemF0aW9uLnNlcmlhbGl6ZShcbiAgICAgICAgdGhpcyxcbiAgICAgICAgbWV0YWRhdGEuc2VyaWFsaXplcixcbiAgICAgICAgLi4uKG1ldGFkYXRhLmFyZ3MgfHwgW10pXG4gICAgICApO1xuICAgIHJldHVybiBTZXJpYWxpemF0aW9uLnNlcmlhbGl6ZShtb2RlbCk7XG4gIH1cblxuICBzdGF0aWMgaGFzaDxWIGV4dGVuZHMgTW9kZWw+KG1vZGVsOiBWKSB7XG4gICAgY29uc3QgbWV0YWRhdGEgPSBSZWZsZWN0LmdldE1ldGFkYXRhKFxuICAgICAgdGhpcy5rZXkoTW9kZWxLZXlzLkhBU0hJTkcpLFxuICAgICAgbW9kZWwuY29uc3RydWN0b3JcbiAgICApO1xuXG4gICAgaWYgKG1ldGFkYXRhICYmIG1ldGFkYXRhLmFsZ29yaXRobSlcbiAgICAgIHJldHVybiBIYXNoaW5nLmhhc2gobW9kZWwsIG1ldGFkYXRhLmFsZ29yaXRobSwgLi4uKG1ldGFkYXRhLmFyZ3MgfHwgW10pKTtcbiAgICByZXR1cm4gSGFzaGluZy5oYXNoKG1vZGVsKTtcbiAgfVxuICAvKipcbiAgICogQHN1bW1hcnkgQnVpbGRzIHRoZSBrZXkgdG8gc3RvcmUgYXMgTWV0YWRhdGEgdW5kZXIgUmVmbGVjdGlvbnNcbiAgICogQGRlc2NyaXB0aW9uIGNvbmNhdGVuYXRlcyB7QGxpbmsgTW9kZWxLZXlzI1JFRkxFQ1R9IHdpdGggdGhlIHByb3ZpZGVkIGtleVxuICAgKiBAcGFyYW0ge3N0cmluZ30gc3RyXG4gICAqL1xuICBzdGF0aWMga2V5KHN0cjogc3RyaW5nKSB7XG4gICAgcmV0dXJuIE1vZGVsS2V5cy5SRUZMRUNUICsgc3RyO1xuICB9XG59XG4iXX0= |
@@ -0,12 +1,4 @@ | ||
import { Model } from "./Model"; | ||
export declare function isPropertyModel<M extends Model>(target: M, attribute: string): boolean | string | undefined; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
* | ||
* @function getModelKey | ||
* @memberOf module:decorator-validation.Model | ||
* @category Utilities | ||
*/ | ||
export declare const getModelKey: (str: string) => string; | ||
/** | ||
* @summary For Serialization/deserialization purposes. | ||
@@ -13,0 +5,0 @@ * @description Reads the {@link ModelKeys.ANCHOR} property of a {@link Model} to discover the class to instantiate |
import { ModelKeys } from "../utils/constants"; | ||
import { Model } from "./Model"; | ||
export function isPropertyModel(target, attribute) { | ||
if (isModel(target[attribute])) | ||
return true; | ||
const metadata = Reflect.getMetadata(ModelKeys.TYPE, target, attribute); | ||
return Model.get(metadata.name) ? metadata.name : undefined; | ||
} | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
* | ||
* @function getModelKey | ||
* @memberOf module:decorator-validation.Model | ||
* @category Utilities | ||
*/ | ||
export const getModelKey = (str) => ModelKeys.REFLECT + str; | ||
/** | ||
* @summary For Serialization/deserialization purposes. | ||
@@ -23,3 +19,3 @@ * @description Reads the {@link ModelKeys.ANCHOR} property of a {@link Model} to discover the class to instantiate | ||
try { | ||
return target instanceof Model || !Model.getMetadata(target); | ||
return target instanceof Model || !!Model.getMetadata(target); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
@@ -32,2 +28,2 @@ } | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tb2RlbC91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDL0MsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUVoQzs7Ozs7Ozs7R0FRRztBQUNILE1BQ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tZXRhZGF0YSA9IFJlZmxlY3QuZ2V0TWV0YWRhdGEoTW9kZWxLZXlzLlRZUEUsIHRhcmdldCwgYXR0cmlidXRlKTtcbiAgcmV0dXJuIE1vZGVsLmdldChtZXRhZGF0YS5uYW1lKSA/IG1ldGFkYXRhLm5hbWUgOiB1bmRlZmluZWQ7XG59XG5cbi8qKlxuICogQHN1bW1hcnkgRm9yIFNlcmlhbGl6YXRpb24vZGVzZXJpYWxpemF0aW9uIHB1cnBvc2VzLlxuICogQGRlc2NyaXB0aW9uIFJlYWRzIHRoZSB7QGxpbmsgTW9kZWxLZXlzLkFOQ0hPUn0gcHJvcGVydHkgb2YgYSB7QGxpbmsgTW9kZWx9IHRvIGRpc2NvdmVyIHRoZSBjbGFzcyB0byBpbnN0YW50aWF0ZVxuICpcbiAqIEBmdW5jdGlvbiBpc01vZGVsXG4gKiBAbWVtYmVyT2YgbW9kdWxlOmRlY29yYXRvci12YWxpZGF0aW9uLlZhbGlkYXRpb25cbiAqIEBjYXRlZ29yeSBWYWxpZGF0aW9uXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBpc01vZGVsKHRhcmdldDogUmVjb3JkPHN0cmluZywgYW55Pikge1xuICB0cnkge1xuICAgIHJldHVybiB0YXJnZXQgaW5zdGFuY2VvZiBNb2RlbCB8fCAhIU1vZGVsLmdldE1ldGFkYXRhKHRhcmdldCBhcyBhbnkpO1xuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbiAgfSBjYXRjaCAoZTogYW55KSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG59XG4iXX0= |
@@ -16,3 +16,3 @@ /** | ||
export declare enum ModelKeys { | ||
REFLECT = "model.definition.", | ||
REFLECT = "decaf.model.", | ||
TYPE = "design:type", | ||
@@ -23,4 +23,6 @@ PARAMS = "design:paramtypes", | ||
ANCHOR = "__model", | ||
CONSTRUCTION = "constructed-by", | ||
ATTRIBUTE = "__attributes", | ||
HASHING = "hashing", | ||
SERIALIZATION = "serialization" | ||
} |
@@ -17,3 +17,3 @@ /** | ||
(function (ModelKeys) { | ||
ModelKeys["REFLECT"] = "model.definition."; | ||
ModelKeys["REFLECT"] = "decaf.model."; | ||
ModelKeys["TYPE"] = "design:type"; | ||
@@ -24,2 +24,4 @@ ModelKeys["PARAMS"] = "design:paramtypes"; | ||
ModelKeys["ANCHOR"] = "__model"; | ||
ModelKeys["CONSTRUCTION"] = "constructed-by"; | ||
ModelKeys["ATTRIBUTE"] = "__attributes"; | ||
ModelKeys["HASHING"] = "hashing"; | ||
@@ -29,2 +31,2 @@ ModelKeys["SERIALIZATION"] = "serialization"; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy91dGlscy9jb25zdGFudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUNILE1BQU0sQ0FBTixJQUFZLFNBU1g7QUFURCxXQUFZLFNBQVM7SUFDbkIsMENBQTZCLENBQUE7SUFDN0IsaUNBQW9CLENBQUE7SUFDcEIseUNBQTRCLENBQUE7SUFDNUIseUNBQTRCLENBQUE7SUFDNUIsNEJBQWUsQ0FBQTtJQUNmLCtCQUFrQixDQUFBO0lBQ2xCLGdDQUFtQixDQUFBO0lBQ25CLDRDQUErQixDQUFBO0FBQ2pDLENBQUMsRUFUVyxTQUFTLEtBQVQsU0FBUyxRQVNwQiIsImZpbGUiOiJ1dGlscy9jb25zdGFudHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBzdW1tYXJ5IERlZmluZXMgdGhlIHZhcmlvdXMgTW9kZWwga2V5cyB1c2VkIGZvciByZWZsZWN0aW9uXG4gKlxuICogQHByb3BlcnR5IHtzdHJpbmd9IFJFRkxFQ1QgcHJlZml4IHRvIGFsbCBvdGhlciBrZXlz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HlwZVwiLFxuICBQQVJBTVMgPSBcImRlc2lnbjpwYXJhbXR5cGVzXCIsXG4gIFJFVFVSTiA9IFwiZGVzaWduOnJldHVybnR5cGVcIixcbiAgTU9ERUwgPSBcIm1vZGVsXCIsXG4gIEFOQ0hPUiA9IFwiX19tb2RlbFwiLFxuICBDT05TVFJVQ1RJT04gPSBcImNvbnN0cnVjdGVkLWJ5XCIsXG4gIEFUVFJJQlVURSA9IFwiX19hdHRyaWJ1dGVzXCIsXG4gIEhBU0hJTkcgPSBcImhhc2hpbmdcIixcbiAgU0VSSUFMSVpBVElPTiA9IFwic2VyaWFsaXphdGlvblwiLFxufVxuIl19 |
@@ -1,2 +0,2 @@ | ||
export declare function hashedBy(algorithm: string, ...args: any[]): any; | ||
export declare function serializedBy(serializer: string, ...args: any[]): any; | ||
export declare function prop(): PropertyDecorator; | ||
export declare function propMetadata<V>(key: string, value: any): PropertyDecorator; |
@@ -1,17 +0,20 @@ | ||
import { metadata } from "@decaf-ts/reflection"; | ||
import { apply, metadata } from "@decaf-ts/reflection"; | ||
import { ModelKeys } from "./constants"; | ||
import { getModelKey } from "../model/utils"; | ||
export function hashedBy(algorithm, ...args) { | ||
return metadata(getModelKey(ModelKeys.HASHING), { | ||
algorithm: algorithm, | ||
args: args, | ||
}); | ||
export function prop() { | ||
return (model, propertyKey) => { | ||
let props; | ||
if (Object.prototype.hasOwnProperty.call(model, ModelKeys.ATTRIBUTE)) { | ||
props = model[ModelKeys.ATTRIBUTE]; | ||
} | ||
else { | ||
props = model[ModelKeys.ATTRIBUTE] = []; | ||
} | ||
if (!props.includes(propertyKey)) | ||
props.push(propertyKey); | ||
}; | ||
} | ||
export function serializedBy(serializer, ...args) { | ||
return metadata(getModelKey(ModelKeys.SERIALIZATION), { | ||
serializer: serializer, | ||
args: args, | ||
}); | ||
export function propMetadata(key, value) { | ||
return apply(prop(), metadata(key, value)); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIj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2V5IGFzIHN0cmluZykpXG4gICAgICBwcm9wcy5wdXNoKHByb3BlcnR5S2V5IGFzIHN0cmluZyk7XG4gIH07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBwcm9wTWV0YWRhdGE8Vj4oa2V5OiBzdHJpbmcsIHZhbHVlOiBhbnkpOiBQcm9wZXJ0eURlY29yYXRvciB7XG4gIHJldHVybiBhcHBseShwcm9wKCksIG1ldGFkYXRhPFY+KGtleSwgdmFsdWUpKTtcbn1cbiJdfQ== |
@@ -25,3 +25,3 @@ import "reflect-metadata"; | ||
*/ | ||
export declare function min(value: number | Date | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function min(value: number | Date | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -38,3 +38,3 @@ * @summary Defines a maximum value for the property | ||
*/ | ||
export declare function max(value: number | Date | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function max(value: number | Date | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -51,3 +51,3 @@ * @summary Defines a step value for the property | ||
*/ | ||
export declare function step(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function step(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -64,3 +64,3 @@ * @summary Defines a minimum length for the property | ||
*/ | ||
export declare function minlength(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function minlength(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -77,3 +77,3 @@ * @summary Defines a maximum length for the property | ||
*/ | ||
export declare function maxlength(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function maxlength(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -90,3 +90,3 @@ * @summary Defines a RegExp pattern the property must respect | ||
*/ | ||
export declare function pattern(value: RegExp | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function pattern(value: RegExp | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -102,3 +102,3 @@ * @summary Defines the property as an email | ||
*/ | ||
export declare function email(message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function email(message?: string): PropertyDecorator; | ||
/** | ||
@@ -114,3 +114,3 @@ * @summary Defines the property as an URL | ||
*/ | ||
export declare function url(message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function url(message?: string): PropertyDecorator; | ||
/** | ||
@@ -127,3 +127,3 @@ * @summary Enforces type verification | ||
*/ | ||
export declare function type(types: string[] | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function type(types: string[] | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -158,3 +158,3 @@ * @summary Date Handler Decorator | ||
*/ | ||
export declare function password(pattern?: RegExp, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function password(pattern?: RegExp, message?: string): PropertyDecorator; | ||
/** | ||
@@ -174,3 +174,3 @@ * @summary List Decorator | ||
*/ | ||
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): PropertyDecorator; | ||
/** | ||
@@ -189,2 +189,2 @@ * @summary Set Decorator | ||
*/ | ||
export declare function set(clazz: ModelConstructor<any>, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function set(clazz: ModelConstructor<any>, message?: string): PropertyDecorator; |
import "reflect-metadata"; | ||
import { DEFAULT_ERROR_MESSAGES, DEFAULT_PATTERNS, ValidationKeys, } from "./Validators/constants"; | ||
import { sf } from "../utils/strings"; | ||
import { getValidationKey } from "./utils"; | ||
import { metadata } from "@decaf-ts/reflection"; | ||
import { parseDate } from "../utils/dates"; | ||
import { propMetadata } from "../utils/decorators"; | ||
import { Validation } from "./Validation"; | ||
/** | ||
@@ -18,3 +18,3 @@ * @summary Marks the property as required. | ||
export function required(message = DEFAULT_ERROR_MESSAGES.REQUIRED) { | ||
return metadata(getValidationKey(ValidationKeys.REQUIRED), { | ||
return propMetadata(Validation.key(ValidationKeys.REQUIRED), { | ||
message: message, | ||
@@ -35,3 +35,3 @@ }); | ||
export function min(value, message = DEFAULT_ERROR_MESSAGES.MIN) { | ||
return metadata(getValidationKey(ValidationKeys.MIN), { | ||
return propMetadata(Validation.key(ValidationKeys.MIN), { | ||
value: value, | ||
@@ -54,3 +54,3 @@ message: message, | ||
export function max(value, message = DEFAULT_ERROR_MESSAGES.MAX) { | ||
return metadata(getValidationKey(ValidationKeys.MAX), { | ||
return propMetadata(Validation.key(ValidationKeys.MAX), { | ||
value: value, | ||
@@ -73,3 +73,3 @@ message: message, | ||
export function step(value, message = DEFAULT_ERROR_MESSAGES.STEP) { | ||
return metadata(getValidationKey(ValidationKeys.STEP), { | ||
return propMetadata(Validation.key(ValidationKeys.STEP), { | ||
value: value, | ||
@@ -92,3 +92,3 @@ message: message, | ||
export function minlength(value, message = DEFAULT_ERROR_MESSAGES.MIN_LENGTH) { | ||
return metadata(getValidationKey(ValidationKeys.MIN_LENGTH), { | ||
return propMetadata(Validation.key(ValidationKeys.MIN_LENGTH), { | ||
value: value, | ||
@@ -111,3 +111,3 @@ message: message, | ||
export function maxlength(value, message = DEFAULT_ERROR_MESSAGES.MAX_LENGTH) { | ||
return metadata(getValidationKey(ValidationKeys.MAX_LENGTH), { | ||
return propMetadata(Validation.key(ValidationKeys.MAX_LENGTH), { | ||
value: value, | ||
@@ -130,3 +130,3 @@ message: message, | ||
export function pattern(value, message = DEFAULT_ERROR_MESSAGES.PATTERN) { | ||
return metadata(getValidationKey(ValidationKeys.PATTERN), { | ||
return propMetadata(Validation.key(ValidationKeys.PATTERN), { | ||
value: typeof value === "string" ? value : value.toString(), | ||
@@ -148,3 +148,3 @@ message: message, | ||
export function email(message = DEFAULT_ERROR_MESSAGES.EMAIL) { | ||
return metadata(getValidationKey(ValidationKeys.EMAIL), { | ||
return propMetadata(Validation.key(ValidationKeys.EMAIL), { | ||
pattern: DEFAULT_PATTERNS.EMAIL, | ||
@@ -166,3 +166,3 @@ message: message, | ||
export function url(message = DEFAULT_ERROR_MESSAGES.URL) { | ||
return metadata(getValidationKey(ValidationKeys.URL), { | ||
return propMetadata(Validation.key(ValidationKeys.URL), { | ||
pattern: DEFAULT_PATTERNS.URL, | ||
@@ -185,3 +185,3 @@ message: message, | ||
export function type(types, message = DEFAULT_ERROR_MESSAGES.TYPE) { | ||
return metadata(getValidationKey(ValidationKeys.TYPE), { | ||
return propMetadata(Validation.key(ValidationKeys.TYPE), { | ||
customTypes: types, | ||
@@ -208,3 +208,3 @@ message: message, | ||
return (target, propertyKey) => { | ||
metadata(getValidationKey(ValidationKeys.DATE), { | ||
propMetadata(Validation.key(ValidationKeys.DATE), { | ||
format: format, | ||
@@ -257,3 +257,3 @@ message: message, | ||
export function password(pattern = DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH, message = DEFAULT_ERROR_MESSAGES.PASSWORD) { | ||
return metadata(getValidationKey(ValidationKeys.PASSWORD), { | ||
return propMetadata(Validation.key(ValidationKeys.PASSWORD), { | ||
pattern: pattern, | ||
@@ -279,3 +279,3 @@ message: message, | ||
export function list(clazz, collection = "Array", message = DEFAULT_ERROR_MESSAGES.LIST) { | ||
return metadata(getValidationKey(ValidationKeys.LIST), { | ||
return propMetadata(Validation.key(ValidationKeys.LIST), { | ||
class: Array.isArray(clazz) ? clazz.map((c) => c.name) : [clazz.name], | ||
@@ -303,2 +303,2 @@ type: collection, | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL2RlY29yYXRvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxrQkFBa0IsQ0FBQztBQUUxQixPQUFPLEVBQ0wsc0JBQXNCLEVBQ3RCLGdCQUFnQixFQUN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0b3JzXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBzZXQoXG4gIGNsYXp6OiBNb2RlbENvbnN0cnVjdG9yPGFueT4sXG4gIG1lc3NhZ2U6IHN0cmluZyA9IERFRkFVTFRfRVJST1JfTUVTU0FHRVMuTElTVFxuKSB7XG4gIHJldHVybiBsaXN0KGNsYXp6LCBcIlNldFwiLCBtZXNzYWdlKTtcbn1cbiJdfQ== |
export * from "./Validators"; | ||
export * from "./decorators"; | ||
export * from "./types"; | ||
export * from "./utils"; | ||
export * from "./Validation"; |
export * from "./Validators"; | ||
export * from "./decorators"; | ||
export * from "./types"; | ||
export * from "./utils"; | ||
export * from "./Validation"; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsU0FBUyxDQUFDO0FBQ3hCLGNBQWMsU0FBUyxDQUFDO0FBQ3hCLGNBQWMsY0FBYyxDQUFDIiwiZmlsZSI6InZhbGlkYXRpb24vaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi9WYWxpZGF0b3JzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi9kZWNvcmF0b3JzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi90eXBlc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vdXRpbHNcIjtcbmV4cG9ydCAqIGZyb20gXCIuL1ZhbGlkYXRpb25cIjtcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsU0FBUyxDQUFDO0FBQ3hCLGNBQWMsY0FBYyxDQUFDIiwiZmlsZSI6InZhbGlkYXRpb24vaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi9WYWxpZGF0b3JzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi9kZWNvcmF0b3JzXCI7XG5leHBvcnQgKiBmcm9tIFwiLi90eXBlc1wiO1xuZXhwb3J0ICogZnJvbSBcIi4vVmFsaWRhdGlvblwiO1xuIl19 |
@@ -40,2 +40,9 @@ import { Validator } from "./Validators/Validator"; | ||
static register<T extends Validator>(...validator: (ValidatorDefinition | T)[]): void; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ValidationKeys#REFLECT} with the provided key | ||
* | ||
* @param {string} key | ||
*/ | ||
static key(key: string): string; | ||
} |
import { ValidatorRegistry } from "./Validators/ValidatorRegistry"; | ||
import { ValidationKeys } from "./Validators/constants"; | ||
/** | ||
@@ -55,4 +56,13 @@ * @summary Static class acting as a namespace for the Validation | ||
} | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ValidationKeys#REFLECT} with the provided key | ||
* | ||
* @param {string} key | ||
*/ | ||
static key(key) { | ||
return ValidationKeys.REFLECT + key; | ||
} | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL1ZhbGlkYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFFbkU7Ozs7Ozs7R0FPRztBQUNILE1BQU0sT0FBTyxVQUFVO2FBQ04sNEJBQXVCLEdBQ3BDLFNBQVMsQ0FBQztJQUVaLGdCQU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YyBnZXQ8VCBleHRlbmRzIFZhbGlkYXRvcj4odmFsaWRhdG9yS2V5OiBzdHJpbmcpOiBUIHwgdW5kZWZpbmVkIHtcbiAgICByZXR1cm4gVmFsaWRhdGlvbi5nZXRSZWdpc3RyeSgpLmdldCh2YWxpZGF0b3JLZXkpO1xuICB9XG5cbiAgLyoqXG4gICAqIEBzdW1tYXJ5IFJlZ2lzdGVycyB0aGUgcHJvdmlkZWQgdmFsaWRhdG9ycyBvbnRvIHRoZSByZWdpc3RyeVxuICAgKlxuICAgKiBAcGFyYW0ge1RbXSB8IFZhbGlkYXRvckRlZmluaXRpb25bXX0gdmFsaWRhdG9yXG4gICAqL1xuICBzdGF0aWMgcmVnaXN0ZXI8VCBleHRlbmRzIFZhbGlkYXRvcj4oXG4gICAgLi4udmFsaWRhdG9yOiAoVmFsaWRhdG9yRGVmaW5pdGlvbiB8IFQpW11cbiAgKTogdm9pZCB7XG4gICAgcmV0dXJuIFZhbGlkYXRpb24uZ2V0UmVnaXN0cnkoKS5yZWdpc3RlciguLi52YWxpZGF0b3IpO1xuICB9XG5cbiAgLyoqXG4gICAqIEBzdW1tYXJ5IEJ1aWxkcyB0aGUga2V5IHRvIHN0b3JlIGFzIE1ldGFkYXRhIHVuZGVyIFJlZmxlY3Rpb25zXG4gICAqIEBkZXNjcmlwdGlvbiBjb25jYXRlbmF0ZXMge0BsaW5rIFZhbGlkYXRpb25LZXlzI1JFRkxFQ1R9IHdpdGggdGhlIHByb3ZpZGVkIGtleVxuICAgKlxuICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5XG4gICAqL1xuICBzdGF0aWMga2V5KGtleTogc3RyaW5nKSB7XG4gICAgcmV0dXJuIFZhbGlkYXRpb25LZXlzLlJFRkxFQ1QgKyBrZXk7XG4gIH1cbn1cbiJdfQ== |
@@ -0,1 +1,2 @@ | ||
import { ModelKeys } from "../../utils/constants"; | ||
/** | ||
@@ -24,3 +25,3 @@ * @summary The keys used for validation | ||
export const ValidationKeys = { | ||
REFLECT: "model.validation.", | ||
REFLECT: `${ModelKeys.REFLECT}validation.`, | ||
VALIDATOR: "validator", | ||
@@ -136,2 +137,2 @@ REQUIRED: "required", | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL1ZhbGlkYXRvcnMvY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FxQkc7QUFDSCxNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUc7SUFDNUIsT0FBTyxFQUFFLG1CQUFtQjtJQUM1QixTQUFTLEVBQUUsV0FBVztJQUN0QixRQUFRLEVBQUUsVUFBVTtJQUNwQixHQUFHLEVBQUUsS0FBSztJQUNWLEdBQUcsRUFBRSxLQUFLO0lBQ1YsSUFBSSxFQUFFLE1BQU07SUFDWixVQUFVLEVBQUUsV0FBVztJQUN2QixVQUFVLEVBQUUsV0FBVztJQUN2QixPQUFPLEVBQUUsU0FBUztJQUNsQixLQUFLLEVBQUUsT0FBTztJQUNkLEdBQUcsRUFBRSxLQUFLO0lBQ1YsSUFBSSxFQUFFLE1BQU07SUFDWixJQUFJLEVBQUUsTUFBTTtJQUNaLFFBQVEsRUFBRSxVQUFVO0lBQ3BCLElBQUksRUFBRSxNQUFNO0NBQ2IsQ0FBQztBQUVGOzs7Ozs7O0dBT0c7QUFDSCxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUc7SUFDekIsU0FBUztJQUNULFVBQVU7SUFDVixPQUFPO0lBQ1AsT0FBTztJQUNQLEtBQUs7SUFDTCxNQUFNO0lBQ04sTUFBTTtJQUNOLFFBQVE7SUFDUixXQUFXO0lBQ1gsU0FBUztJQUNULFVBQVU7SUFDVixVQUFVO0NBQ1gsQ0FBQztBQUVGOzs7Ozs7O0dBT0c7QUFDSCxNQUFNLENBQUMsTUFBTSxrQkFBa0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mZdezIsfVxcLj8pKSg/OjpcXGR7Miw1fSk/KD86Wy8/I11cXFMqKT8kL2ksXG4gIFBBU1NXT1JEOiB7XG4gICAgQ0hBUjhfT05FX09GX0VBQ0g6XG4gICAgICAvXig/PS4qW2Etel0pKD89LipbQS1aXSkoPz0uKlxcZCkoPz0uKltAJCElKj8mX1xcLS4sXSlbQS1aYS16XFxkQCQhJSo/Jl9cXC0uLF17OCx9JC9nLFxuICB9LFxufTtcbiJdfQ== |
import { Validation } from "../Validation"; | ||
import { ValidationKeys } from "./constants"; | ||
import { getValidationKey } from "../utils"; | ||
import { apply, metadata } from "@decaf-ts/reflection"; | ||
@@ -25,5 +24,5 @@ /** | ||
return original; | ||
}), metadata(getValidationKey(ValidationKeys.VALIDATOR), keys)); | ||
}), metadata(Validation.key(ValidationKeys.VALIDATOR), keys)); | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy92YWxpZGF0aW9uL1ZhbGlkYXRvcnMvZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRzNDLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDN0MsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sVUFBVSxDQUFDO0FBQzVDLE9BQU8sRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFdkQ7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBTSxVQUFVLFNBQVMsQ0FBc0IsR0FBRyxJQUFjO0lBQzlELE9BQU8sS0FBSyxDQUNWLENBQUMsQ0FBQyxRQUF3QixFQUFFLEVBQUU7UUFDNUIsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQVMsRUFBRSxFQUFFO1lBQ3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cy9yZWZsZWN0aW9uXCI7XG5cbi8qKlxuICogQHN1bW1hcnkgTWFya3MgdGhlIGNsYXNzIGFzIGEgdmFsaWRhdG9yIGZvciBhIGNlcnRhaW4ga2V5LlxuICogQGRlc2NyaXB0aW9uIFJlZ2lzdGVycyB0aGUgY2xhc3MgaW4gdGhlIHtAbGluayBWYWxpZGF0aW9ufSB3aXRoIHRoZSBwcm92aWRlZCBrZXlcbiAqXG4gKiBAcGFyYW0ge3N0cmluZ30ga2V5cyB0aGUgdmFsaWRhdGlvbiBrZXlcbiAqXG4gKiBAZnVuY3Rpb24gdmFsaWRhdG9yXG4gKlxuICogQGNhdGVnb3J5IERlY29yYXRvcnNcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHZhbGlkYXRvcjxUIGV4dGVuZHMgVmFsaWRhdG9yPiguLi5rZXlzOiBzdHJpbmdbXSkge1xuICByZXR1cm4gYXBwbHkoXG4gICAgKChvcmlnaW5hbDogQ29uc3RydWN0b3I8VD4pID0+IHtcbiAgICAgIGtleXMuZm9yRWFjaCgoazogc3RyaW5nKSA9PiB7XG4gICAgICAgIFZhbGlkYXRpb24ucmVnaXN0ZXIoe1xuICAgICAgICAgIHZhbGlkYXRvcjogb3JpZ2luYWwsXG4gICAgICAgICAgdmFsaWRhdGlvbktleTogayxcbiAgICAgICAgICBzYXZlOiB0cnVlLFxuICAgICAgICB9IGFzIFZhbGlkYXRvckRlZmluaXRpb24pO1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gb3JpZ2luYWw7XG4gICAgfSkgYXMgQ2xhc3NEZWNvcmF0b3IsXG4gICAgbWV0YWRhdGEoVmFsaWRhdGlvbi5rZXkoVmFsaWRhdGlvbktleXMuVkFMSURBVE9SKSwga2V5cylcbiAgKTtcbn1cbiJdfQ== |
@@ -65,2 +65,2 @@ /** | ||
export * from "./model"; | ||
export declare const VERSION = "1.3.6"; | ||
export declare const VERSION = "1.3.7"; |
import { Model } from "./Model"; | ||
import { ModelArg } from "./types"; | ||
/** | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromObject | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export declare function constructFromObject<T extends Model>(self: T, obj?: ModelArg<T>): T; | ||
/** | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
* @function constructFromModel | ||
* @memberOf module:decorator-validation.Construction | ||
* @category Construction | ||
*/ | ||
export declare function constructFromModel<T extends Model>(self: T, obj?: ModelArg<T>): T; | ||
/** | ||
* @summary Helper Function to override constructors | ||
@@ -31,0 +4,0 @@ * |
@@ -15,5 +15,3 @@ /** | ||
* - Runs the optional {@link InstanceCallback} if provided; | ||
* - Defines an {@link ModelKeys#ANCHOR} property for serialization and model rebuilding purposes; | ||
* | ||
* @param {string} [nameOverride] | ||
* @param {InstanceCallback} [instanceCallback] optional callback that will be called with the instance upon instantiation. defaults to undefined | ||
@@ -24,2 +22,4 @@ * | ||
*/ | ||
export declare function model(nameOverride?: string, instanceCallback?: InstanceCallback): any; | ||
export declare function model(instanceCallback?: InstanceCallback): any; | ||
export declare function hashedBy(algorithm: string, ...args: any[]): ClassDecorator; | ||
export declare function serializedBy(serializer: string, ...args: any[]): ClassDecorator; |
import { BuilderRegistry } from "../utils/registry"; | ||
import { ModelErrorDefinition } from "./ModelErrorDefinition"; | ||
import { Comparable, Hashable, ModelArg, ModelConstructor, Serializable, Validatable } from "./types"; | ||
import { Comparable, Constructor, Hashable, ModelArg, ModelConstructor, Serializable, Validatable } from "./types"; | ||
import { ModelBuilderFunction } from "./construction"; | ||
@@ -10,11 +10,5 @@ /** | ||
* Model objects must: | ||
* - Have all their properties defined as optional; | ||
* - Have all their properties initialized eg: | ||
* - Have all their required properties marked with '!'; | ||
* - Have all their optional properties marked as '?': | ||
* | ||
* <pre> | ||
* class ClassName { | ||
* propertyName?: PropertyType = undefined; | ||
* } | ||
* </pre> | ||
* | ||
* @param {Model | {}} model base object from which to populate properties from | ||
@@ -27,3 +21,9 @@ * | ||
* | ||
* @category Model | ||
* @example | ||
* class ClassName { | ||
* @required() | ||
* requiredPropertyName!: PropertyType; | ||
* | ||
* optionalPropertyName?: PropertyType; | ||
* } | ||
*/ | ||
@@ -35,3 +35,3 @@ export declare abstract class Model implements Validatable, Serializable, Hashable, Comparable<Model> { | ||
* | ||
* @param {any[]} [exceptions] properties in the object to be ignored for he validation. Marked as 'any' to allow for extension but expects strings | ||
* @param {any[]} [exceptions] properties in the object to be ignored for the validation. Marked as 'any' to allow for extension but expects strings | ||
*/ | ||
@@ -67,11 +67,19 @@ hasErrors(...exceptions: any[]): ModelErrorDefinition | undefined; | ||
/** | ||
* @summary Wrapper around {@link constructFromObject} | ||
* @summary Repopulates the Object properties with the ones from the new object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
static fromObject<T extends Model>(self: T, obj?: T | Record<string, any>): T; | ||
/** | ||
* @summary Wrapper around {@link constructFromModel} | ||
* @summary Repopulates the instance with the ones from the new Model Object | ||
* @description Iterates all common properties of obj (if existing) and self, and copies them onto self. | ||
* Is aware of nested Model Objects and rebuilds them also. | ||
* When List properties are decorated with {@link list}, they list items will also be rebuilt | ||
* | ||
* @param {T} self | ||
* @param {T | Record<string, any>} obj | ||
* @param {T | Record<string, any>} [obj] | ||
* | ||
*/ | ||
@@ -125,2 +133,3 @@ static fromModel<T extends Model>(self: T, obj?: T | Record<string, any>): T; | ||
static getMetadata<V extends Model>(model: V): any; | ||
static getAttributes<V extends Model>(model: Constructor<V> | V): string[]; | ||
static equals<V extends Model>(obj1: V, obj2: V, ...exceptions: any[]): boolean; | ||
@@ -130,2 +139,8 @@ static hasErrors<V extends Model>(model: V, ...exceptions: any[]): ModelErrorDefinition | undefined; | ||
static hash<V extends Model>(model: V): any; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
*/ | ||
static key(str: string): string; | ||
} |
@@ -0,12 +1,4 @@ | ||
import { Model } from "./Model"; | ||
export declare function isPropertyModel<M extends Model>(target: M, attribute: string): boolean | string | undefined; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ModelKeys#REFLECT} with the provided key | ||
* @param {string} str | ||
* | ||
* @function getModelKey | ||
* @memberOf module:decorator-validation.Model | ||
* @category Utilities | ||
*/ | ||
export declare const getModelKey: (str: string) => string; | ||
/** | ||
* @summary For Serialization/deserialization purposes. | ||
@@ -13,0 +5,0 @@ * @description Reads the {@link ModelKeys.ANCHOR} property of a {@link Model} to discover the class to instantiate |
@@ -16,3 +16,3 @@ /** | ||
export declare enum ModelKeys { | ||
REFLECT = "model.definition.", | ||
REFLECT = "decaf.model.", | ||
TYPE = "design:type", | ||
@@ -23,4 +23,6 @@ PARAMS = "design:paramtypes", | ||
ANCHOR = "__model", | ||
CONSTRUCTION = "constructed-by", | ||
ATTRIBUTE = "__attributes", | ||
HASHING = "hashing", | ||
SERIALIZATION = "serialization" | ||
} |
@@ -1,2 +0,2 @@ | ||
export declare function hashedBy(algorithm: string, ...args: any[]): any; | ||
export declare function serializedBy(serializer: string, ...args: any[]): any; | ||
export declare function prop(): PropertyDecorator; | ||
export declare function propMetadata<V>(key: string, value: any): PropertyDecorator; |
@@ -25,3 +25,3 @@ import "reflect-metadata"; | ||
*/ | ||
export declare function min(value: number | Date | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function min(value: number | Date | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -38,3 +38,3 @@ * @summary Defines a maximum value for the property | ||
*/ | ||
export declare function max(value: number | Date | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function max(value: number | Date | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -51,3 +51,3 @@ * @summary Defines a step value for the property | ||
*/ | ||
export declare function step(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function step(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -64,3 +64,3 @@ * @summary Defines a minimum length for the property | ||
*/ | ||
export declare function minlength(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function minlength(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -77,3 +77,3 @@ * @summary Defines a maximum length for the property | ||
*/ | ||
export declare function maxlength(value: number, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function maxlength(value: number, message?: string): PropertyDecorator; | ||
/** | ||
@@ -90,3 +90,3 @@ * @summary Defines a RegExp pattern the property must respect | ||
*/ | ||
export declare function pattern(value: RegExp | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function pattern(value: RegExp | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -102,3 +102,3 @@ * @summary Defines the property as an email | ||
*/ | ||
export declare function email(message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function email(message?: string): PropertyDecorator; | ||
/** | ||
@@ -114,3 +114,3 @@ * @summary Defines the property as an URL | ||
*/ | ||
export declare function url(message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function url(message?: string): PropertyDecorator; | ||
/** | ||
@@ -127,3 +127,3 @@ * @summary Enforces type verification | ||
*/ | ||
export declare function type(types: string[] | string, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function type(types: string[] | string, message?: string): PropertyDecorator; | ||
/** | ||
@@ -158,3 +158,3 @@ * @summary Date Handler Decorator | ||
*/ | ||
export declare function password(pattern?: RegExp, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function password(pattern?: RegExp, message?: string): PropertyDecorator; | ||
/** | ||
@@ -174,3 +174,3 @@ * @summary List Decorator | ||
*/ | ||
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function list(clazz: ModelConstructor<any> | ModelConstructor<any>[], collection?: "Array" | "Set", message?: string): PropertyDecorator; | ||
/** | ||
@@ -189,2 +189,2 @@ * @summary Set Decorator | ||
*/ | ||
export declare function set(clazz: ModelConstructor<any>, message?: string): import("@decaf-ts/reflection").CustomDecorator<V>; | ||
export declare function set(clazz: ModelConstructor<any>, message?: string): PropertyDecorator; |
export * from "./Validators"; | ||
export * from "./decorators"; | ||
export * from "./types"; | ||
export * from "./utils"; | ||
export * from "./Validation"; |
@@ -40,2 +40,9 @@ import { Validator } from "./Validators/Validator"; | ||
static register<T extends Validator>(...validator: (ValidatorDefinition | T)[]): void; | ||
/** | ||
* @summary Builds the key to store as Metadata under Reflections | ||
* @description concatenates {@link ValidationKeys#REFLECT} with the provided key | ||
* | ||
* @param {string} key | ||
*/ | ||
static key(key: string): string; | ||
} |
{ | ||
"name": "@decaf-ts/decorator-validation", | ||
"version": "1.3.7", | ||
"version": "1.4.0", | ||
"description": "simple decorator based validation engine", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
898400
175
11010