@valbuild/ui 0.96.2 → 0.96.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/valbuild-ui.cjs.js +1 -1
- package/dist/valbuild-ui.esm.js +1 -1
- package/package.json +3 -3
- package/server/.tmp/assets/{index-BKqzxajW.js → index-BedkjC1d.js} +66 -66
- package/server/.tmp/assets/index-rc87KVPE.css +1 -0
- package/server/.tmp/assets/patchsets.worker-CH772rLL.js +4 -0
- package/server/.tmp/assets/search.worker-D5-aGKFO.js +4 -0
- package/server/.tmp/index.html +2 -2
- package/server/dist/valbuild-ui-server.cjs.js +2 -2
- package/server/dist/valbuild-ui-server.esm.js +2 -2
- package/server/.tmp/assets/index-CSMCTXvr.css +0 -1
- package/server/.tmp/assets/patchsets.worker-BNtrPoSm.js +0 -4
- package/server/.tmp/assets/search.worker-DDAgDxbb.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
(function(){"use strict";function he(t,n){(n==null||n>t.length)&&(n=t.length);for(var r=0,e=Array(n);r<n;r++)e[r]=t[r];return e}function de(t,n){if(t){if(typeof t=="string")return he(t,n);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?he(t,n):void 0}}function ot(t,n){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=de(t))||n){r&&(t=r);var e=0,i=function(){};return{s:i,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw a}}}}function Bi(t){if(Array.isArray(t))return he(t)}function Ni(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Wi(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V(t){return Bi(t)||Ni(t)||de(t)||Wi()}function j(t){"@babel/helpers - typeof";return j=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j(t)}function Li(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var e=r.call(t,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ge(t){var n=Li(t,"string");return typeof n=="symbol"?n:n+""}function h(t,n,r){return(n=Ge(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function Ue(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,e)}return r}function z(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Ue(Object(r),!0).forEach(function(e){h(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Hi(t){if(Array.isArray(t))return t}function Ji(t,n){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var e,i,a,s,o=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,n!==0)for(;!(l=(e=a.call(r)).done)&&(o.push(e.value),o.length!==n);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Gi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function st(t,n){return Hi(t)||Ji(t,n)||de(t,n)||Gi()}function D(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Ui(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,Ge(e.key),e)}}function K(t,n,r){return n&&Ui(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var X=(function(){function t(){D(this,t)}return K(t,[{key:"executeCustomValidateFunctions",value:function(r,e,i){var a=[],s=ot(e),o;try{for(s.s();!(o=s.n()).done;){var l=o.value;try{var u=l(r,i);u&&a.push({message:u,value:r})}catch(c){a.push({message:"Error in custom validate function: ".concat(c instanceof Error?c.message:String(c)),value:r,schemaError:!0})}}}catch(c){s.e(c)}finally{s.f()}return a}},{key:"appendValidationError",value:function(r,e,i,a,s){return r?(r[e]?r[e].push({message:i,value:a,schemaError:s}):r[e]=[{message:i,value:a,schemaError:s}],r):h({},e,[{message:i,value:a,schemaError:s}])}}])})();function Ut(t){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ut(t)}function De(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(De=function(){return!!t})()}function Di(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ki(t,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Di(t)}function Z(t,n,r){return n=Ut(n),Ki(t,De()?Reflect.construct(n,[],Ut(t).constructor):n.apply(t,r))}function me(t,n){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r},me(t,n)}function Q(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&me(t,n)}var Ke=Symbol("GetSchema"),Ye=Symbol("Path"),Yi=Symbol("GetSource");function Xe(t){return t[Ke]}var Y="_type",C="_ref";function Xi(t){return j(t)==="object"&&t!==null&&Y in t&&t[Y]==="file"&&C in t&&typeof t[C]=="string"}function Zi(t){return j(t)==="object"&&t!==null&&t!==void 0&&Ye in t&&"val"in t}function Dt(t){return t[Ye]}var Ze=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.isRemote=a,e.customValidateFunctions=s,e.moduleMetadata=o,e}return Q(n,t),K(n,[{key:"remote",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.moduleMetadata)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRemote,[].concat(V(this.customValidateFunctions),[e]),this.moduleMetadata)}},{key:"executeValidate",value:function(e,i){var a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return a.length>0?h({},e,a):!1;if(i==null)return h({},e,[].concat(V(a),[{message:"Non-optional file was null or undefined.",value:i}]));if(typeof i[C]!="string")return h({},e,[].concat(V(a),[{message:"File did not have a file reference string. Got: ".concat(j(i[C])),value:i}]));if(this.isRemote&&i[Y]!=="remote")return h({},e,[].concat(V(a),[{message:"Expected a remote file, but got a local file.",value:i,fixes:["file:upload-remote"]}]));if(this.isRemote&&i[Y]==="remote")return h({},e,[].concat(V(a),[{message:"Remote file was not checked.",value:i,fixes:["file:check-remote"]}]));if(!this.isRemote&&i[Y]==="remote")return h({},e,[].concat(V(a),[{message:"Expected locale file, but found remote.",value:i,fixes:["file:download-remote"]}]));if(i[Y]!=="file")return h({},e,[].concat(V(a),[{message:"File did not have the valid file extension type. Got: ".concat(i[Y]),value:i}]));var s=this.options||{},o=s.accept,l=i.metadata||{},u=l.mimeType;if(o&&u&&!u.includes("/"))return h({},e,[].concat(V(a),[{message:"Invalid mime type format. Got: ".concat(u),value:i}]));if(o&&u&&u.includes("/")){var c=o.split(",").map(function(f){return f.trim()}),p=c.some(function(f){if(f==="*/*")return!0;if(f.endsWith("/*")){var v=f.slice(0,-2);return u.startsWith(v)}return f===u});if(!p)return h({},e,[].concat(V(a),[{message:"Mime type mismatch. Found '".concat(u,"' but schema accepts '").concat(o,"'"),value:i}]))}var g=et.filenameToMimeType(i[C]);return g?g!==u?h({},e,[].concat(V(a),[{message:"Mime type and file extension not matching. Mime type is '".concat(u,"' but file extension is '").concat(g,"'"),value:i}])):i.metadata?h({},e,[].concat(V(a),[{message:"Found metadata, but it could not be validated. File metadata must be an object with the mimeType.",value:i,fixes:["file:check-metadata"]}])):h({},e,[].concat(V(a),[{message:"Missing File metadata.",value:i,fixes:["file:add-metadata"]}])):h({},e,[].concat(V(a),[{message:"Could not determine mime type from file extension. Got: ".concat(i[C]),value:i}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:j(i)!=="object"?{success:!1,errors:h({},e,[{message:"Expected object, got '".concat(j(i),"'"),typeError:!0}])}:C in i?Y in i&&i[Y]==="file"?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Value of this schema must use: 'c.file' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:h({},e,[{message:"Value of this schema must use: 'c.file' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRemote,this.customValidateFunctions,this.moduleMetadata)}},{key:"executeSerialize",value:function(){var e,i=this.moduleMetadata?Object.keys(this.moduleMetadata):[];return{type:"file",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,referencedModule:i.length>0?i[0]:void 0}}},{key:"executeRender",value:function(){return{}}}])})(X),Qi=function(n){var r=!!n&&!!et.getValPath(n);if(r){for(var e={},i=0,a=[n];i<a.length;i++){var s=a[i],o=Dt(s);if(o===void 0)throw new Error("Invalid argument passed to s.file(). Expected a ValModule constructed through c.define, but got an object without a valid module path.");e[o]=ve(s)}return new Ze({},!1,!1,[],e)}return new Ze(n)};function qi(t){return t[C].startsWith("/public")?t.patch_id?{url:"/api/val/files"+t[C]+"?patch_id=".concat(t.patch_id),metadata:t.metadata}:{url:t[C].slice(7),metadata:t.metadata}:{url:t[C]+(t.patch_id?"?patch_id=".concat(t.patch_id):""),metadata:t.metadata}}function ht(t,n){if(j(n)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(n.toString()));if(t)return t.includes(et.ModuleFilePathSep)?"".concat(t,".").concat(JSON.stringify(n)):"".concat(t).concat(et.ModuleFilePathSep).concat(JSON.stringify(n))}function q(t,n){if(j(n)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(n.toString()));if(!t)throw Error("Cannot create val path of array item of empty or missing path: ".concat(t,". Item: ").concat(n));return t.includes(et.ModuleFilePathSep)?"".concat(t,".").concat(JSON.stringify(n)):"".concat(t).concat(et.ModuleFilePathSep).concat(JSON.stringify(n))}var Tt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.isRaw=a,e.customValidateFunctions=s,e.renderInput=o,e}return Q(n,t),K(n,[{key:"min",value:function(e){return this.minLength(e)}},{key:"minLength",value:function(e){return new n(z(z({},this.options),{},{minLength:e}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput)}},{key:"max",value:function(e){return this.maxLength(e)}},{key:"maxLength",value:function(e){return new n(z(z({},this.options),{},{maxLength:e}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput)}},{key:"regexp",value:function(e,i){return new n(z(z({},this.options),{},{regexp:e,regExpMessage:i}),this.opt,this.isRaw,this.customValidateFunctions,this.renderInput)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions.concat(e),this.renderInput)}},{key:"executeValidate",value:function(e,i){var a,s,o,l=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?l.length>0?h({},e,l):!1:!this.opt&&i==null?h({},e,[{message:"Expected 'string', got '".concat(i===null?"null":"undefined","'"),value:i}]):typeof i!="string"?h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),value:i}]):((a=this.options)!==null&&a!==void 0&&a.maxLength&&i.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(i.length),value:i}),(s=this.options)!==null&&s!==void 0&&s.minLength&&i.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(i.length),value:i}),(o=this.options)!==null&&o!==void 0&&o.regexp&&!this.options.regexp.test(i)&&l.push({message:this.options.regExpMessage||"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(i,"'"),value:i}),l.length>0?h({},e,l):!1)}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:typeof i=="string"?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRaw,this.customValidateFunctions,this.renderInput)}},{key:"raw",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.renderInput)}},{key:"executeSerialize",value:function(){var e,i,a,s,o;return{type:"string",options:{maxLength:(e=this.options)===null||e===void 0?void 0:e.maxLength,minLength:(i=this.options)===null||i===void 0?void 0:i.minLength,regexp:((a=this.options)===null||a===void 0?void 0:a.regexp)&&{message:this.options.regExpMessage,source:this.options.regexp.source,flags:this.options.regexp.flags},customValidate:this.customValidateFunctions&&((s=this.customValidateFunctions)===null||s===void 0?void 0:s.length)>0},opt:this.opt,raw:this.isRaw,customValidate:this.customValidateFunctions&&((o=this.customValidateFunctions)===null||o===void 0?void 0:o.length)>0}}},{key:"render",value:function(e){return new n(this.options,this.opt,this.isRaw,this.customValidateFunctions,e)}},{key:"executeRender",value:function(e,i){return this.renderInput?this.renderInput.as==="code"?h({},e,{status:"success",data:{layout:this.renderInput.as,language:this.renderInput.language}}):h({},e,{status:"success",data:{layout:this.renderInput.as}}):{}}}])})(X),Kt=function(n){return new Tt(n)},lt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.items=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.items,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a=!1,s=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return s.length>0?h({},e,s):!1;if(i===null)return h({},e,[{message:"Expected 'object', got 'null'"}]);if(j(i)!=="object")return h({},e,[{message:"Expected 'object', got '".concat(j(i),"'")}]);if(Array.isArray(i))return h({},e,[{message:"Expected 'object', got 'array'"}]);var o=ot(s),l;try{for(o.s();!(l=o.n()).done;){var u=l.value;a=this.appendValidationError(a,e,u.message,i,u.schemaError)}}catch(y){o.e(y)}finally{o.f()}for(var c=0,p=Object.entries(this.items);c<p.length;c++){var g=st(p[c],2),f=g[0],v=g[1],m=ht(e,f);if(!m)a=this.appendValidationError(a,e,"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(f),i);else{var d=v.executeValidate(m,i[f]);d&&a?a=z(z({},d),a):d&&(a=d)}}return a}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:h({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(j(i)!=="object")return{success:!1,errors:h({},e,[{message:"Expected 'object', got '".concat(j(i),"'"),typeError:!0}])};if(Array.isArray(i))return{success:!1,errors:h({},e,[{message:"Expected 'object', got 'array'",typeError:!0}])};for(var a=[],s=0,o=Object.keys(this.items);s<o.length;s++){var l=o[s],u=ht(e,l);u?l in i||a.push({message:"Expected key '".concat(l,"' not found in object"),typeError:!0}):a.push({message:"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(l),internalError:!0})}return a.length>0?{success:!1,errors:h({},e,a)}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.items,!0)}},{key:"executeSerialize",value:function(){var e;return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(i){var a=st(i,2),s=a[0],o=a[1];return[s,o.executeSerialize()]})),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(e,i){var a={};if(i===null)return a;for(var s in this.items){var o=i[s];if(o!=null){var l=q(e,s),u=this.items[s].executeRender(l,o);for(var c in u){var p=c;a[p]=u[p]}}}return a}}])})(X),Qe=function(n){return new lt(n)};Qe({get test(){return Kt()}});var Yt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),h(e,"renderInput",null),e.item=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.item,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a=this.executeAssert(e,i);if(!a.success)return a.errors;if(a.data===null)return!1;for(var s={},o=0,l=Object.entries(a.data);o<l.length;o++){var u=st(l[o],2),c=u[0],p=u[1],g=q(e,Number(c)),f=this.item.executeValidate(g,p);f&&(s=z(z({},f),s))}return Object.keys(s).length===0?!1:s}},{key:"executeAssert",value:function(e,i){return i===null&&this.opt?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'array', got 'null'",typeError:!0}])}:j(i)!=="object"?{success:!1,errors:h({},e,[{message:"Expected 'object', got '".concat(j(i),"'"),typeError:!0}])}:Array.isArray(i)?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Expected object of type 'array'",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.item,!0)}},{key:"executeSerialize",value:function(){var e;return{type:"array",item:this.item.executeSerialize(),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(e,i){var a={};if(i===null)return a;for(var s=0;s<i.length;s++){var o=s,l=i[o];if(l!=null){var u=q(e,o),c=this.item.executeRender(u,l);for(var p in c){var g=p;a[g]=c[g]}}}if(this.renderInput){var f=this.renderInput,v=f.select,m=f.as;m!=="list"&&(a[e]={status:"error",message:"Unknown layout type: "+m});try{a[e]={status:"success",data:{layout:"list",parent:"array",items:i.map(function(d){var y=v({val:d}),x=y.title,k=y.subtitle,b=y.image;return{title:x,subtitle:k,image:b}})}}}catch(d){a[e]={status:"error",message:d instanceof Error?d.message:"Unknown error"}}}return a}},{key:"render",value:function(e){return this.renderInput=e,this}}])})(X),$i=function(n){return new Yt(n)},yt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.value=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.value,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?a.length>0?h({},e,a):!1:typeof i!="string"?h({},e,[].concat(V(a),[{message:"Expected 'string', got '".concat(j(i),"'"),value:i}])):i!==this.value?h({},e,[].concat(V(a),[{message:"Expected literal '".concat(this.value,"', got '").concat(i,"'"),value:i}])):a.length>0?h({},e,a):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof i=="string"&&i===this.value?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Expected literal '".concat(this.value,"', got '").concat(i,"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.value,!0)}},{key:"executeSerialize",value:function(){var e;return{type:"literal",value:this.value,opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),tn=function(n){return new yt(n)},qe=(function(t){function n(r,e){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return D(this,n),i=Z(this,n),i.key=r,i.items=e,i.opt=a,i.customValidateFunctions=s,i}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.key,this.items,this.opt,this.customValidateFunctions.concat(e))}},{key:"executeValidate",value:function(e,i){var a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e}),s=i;if(this.opt&&s===null)return a.length>0?h({},e,a):!1;if(!this.key)return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Missing required first argument in union",schemaError:!0}]));var o=this.key;if(!Array.isArray(this.items))return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"A union schema must take more than 1 schema arguments",schemaError:!0}]));if(typeof o=="string"){if(this.items.some(function(w){return!(w instanceof lt)}))return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Key is a string, so all schema items must be objects",schemaError:!0}]));var l=this.items,u=l.map(function(w){return w.executeSerialize()}),c=u.filter(function(w){return w.type!=="object"||w.items[o].type!=="literal"});if(c.length>0)return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"All schema items must be objects with a key: ".concat(o," that is a literal schema. Found: ").concat(JSON.stringify(c,null,2)),schemaError:!0}]));var p=u,g=p.filter(function(w){return w.items[o].opt});if(g.length>1)return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Schema cannot have an optional keys: ".concat(o),schemaError:!0}]));if(j(s)!=="object")return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Expected an object",typeError:!0}]));var f=s;if(f[o]===void 0)return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Missing required key: ".concat(o),typeError:!0}]));var v=[],m=ot(p),d;try{for(m.s();!(d=m.n()).done;){var y=d.value,x=y.items[o];if(x.type==="literal")if(!v.includes(x.value))v.push(x.value);else return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Found duplicate key in schema: ".concat(x.value),schemaError:!0}]))}}catch(w){m.e(w)}finally{m.f()}var k=l.find(function(w){return!w.items[o].executeValidate(e,f[o])});if(!k){var b=ht(e,o);if(!b)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(o));return h({},b,[{message:'Invalid key: "'.concat(o,'". Value was: "').concat(f[o],'". Valid values: ').concat(p.map(function(w){var F=w.items[o];if(F.type==="literal"&&F.value)return'"'.concat(F.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(F,null,2)))}).join(", "))}])}var E=k.executeValidate(e,f);if(E)return E}else if(o instanceof yt){if(this.items.some(function(w){return!(w instanceof yt)}))return h({},e,[{message:"Key is a literal schema, so all schema items must be literals",typeError:!0}]);var M=[o].concat(V(this.items));if(typeof s=="string"){var A=M.some(function(w){return!w.executeValidate(e,s)});if(!A)return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Union must match one of the following: ".concat(M.map(function(w){return'"'.concat(w.value,'"')}).join(", "))}]))}}else return a.length>0?h({},e,a):h({},e,[].concat(V(a),[{message:"Expected a string or literal"}]));return a.length>0?h({},e,a):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:h({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])};if(!this.key)return{success:!1,errors:h({},e,[{message:"Missing required first argument in union schema",schemaError:!0}])};if(!Array.isArray(this.items))return{success:!1,errors:h({},e,[{message:"The schema of this value is wrong. Schema is neither a union of literals nor a tagged union (of objects)",schemaError:!0}])};if(this.key instanceof yt){var a,s=!1,o={},l=ot((a=[this.key]).concat.apply(a,V(this.items))),u;try{for(l.s();!(u=l.n()).done;){var c=u.value;if(!(c instanceof yt))return{success:!1,errors:h({},e,[{message:"Schema of value is a union of string, so all schema items must be literals",schemaError:!0}])};if(typeof i!="string"){o[e]=[{message:"Expected 'string', got '".concat(j(i),"'"),typeError:!0}];continue}var p=c.executeAssert(e,i);if(p.success){s=!0;break}else for(var g=0,f=Object.entries(p.errors);g<f.length;g++){var v,m=st(f[g],2),d=m[0],y=m[1];o[d]||(o[d]=[]),(v=o[d]).push.apply(v,V(y))}}}catch(G){l.e(G)}finally{l.f()}return s?{success:!0,data:i}:{success:!1,errors:o}}else if(typeof this.key=="string"){var x=!1,k={},b=ot(this.items),E;try{for(b.s();!(E=b.n()).done;){var M=E.value,A=M.executeAssert(e,i);if(A.success){x=!0;break}else for(var w=0,F=Object.entries(A.errors);w<F.length;w++){var T,I=st(F[w],2),N=I[0],J=I[1];k[N]||(k[N]=[]),(T=k[N]).push.apply(T,V(J))}}}catch(G){b.e(G)}finally{b.f()}return x?{success:!0,data:i}:{success:!1,errors:k}}else return{success:!1,errors:h({},e,[{message:"The schema of this value is wrong. Schema is neither a union of literals nor a tagged union (of objects)",schemaError:!0}])}}},{key:"nullable",value:function(){return new n(this.key,this.items,!0)}},{key:"executeSerialize",value:function(){var e;if(typeof this.key=="string"){var i;return{type:"union",key:this.key,items:this.items.map(function(a){return a.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((i=this.customValidateFunctions)===null||i===void 0?void 0:i.length)>0}}return{type:"union",key:this.key.executeSerialize(),items:this.items.map(function(a){return a.executeSerialize()}),opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(e,i){var a={};if(i===null||this.key instanceof yt)return a;var s=this.key;if(typeof s=="string"){var o=this.items.find(function(p){if(p instanceof lt){var g=p.items[s];if(g instanceof yt)return j(i)==="object"&&s in i&&g.value===i[s]}return!1});if(o){var l=o.executeRender(e,i);for(var u in l){var c=u;a[c]=l[c]}return a}a[e]={status:"error",message:"Could not find a matching (object) schema for the union key: ".concat(s)}}return a[e]={status:"error",message:"The schema of this value is wrong. Expected a object union schema, but union key is not a string. Got: '".concat(JSON.stringify(s,null,2),"'")},a}}])})(X),en=function(n){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];return new qe(n,e)},Xt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.isRemote=a,e.customValidateFunctions=s,e.moduleMetadata=o,e}return Q(n,t),K(n,[{key:"remote",value:function(){return new n(this.options,this.opt,!0,this.customValidateFunctions,this.moduleMetadata)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.isRemote,[].concat(V(this.customValidateFunctions),[e]),this.moduleMetadata)}},{key:"executeValidate",value:function(e,i){var a,s,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return o.length>0?h({},e,o):!1;if(i==null)return h({},e,[].concat(V(o),[{message:"Non-optional image was null or undefined.",value:i}]));if(this.isRemote&&i[Y]!=="remote")return h({},e,[].concat(V(o),[{message:"Expected a remote image, but got a local image.",value:i,fixes:["image:upload-remote"]}]));if(this.isRemote&&i[Y]==="remote")return h({},e,[].concat(V(o),[{message:"Remote image was not checked.",value:i,fixes:["image:check-remote"]}]));if(!this.isRemote&&i[Y]==="remote")return h({},e,[].concat(V(o),[{message:"Expected locale image, but found remote.",value:i,fixes:["image:download-remote"]}]));if(typeof i[C]!="string")return h({},e,[].concat(V(o),[{message:"Image did not have a file reference string. Got: ".concat(j(i[C])),value:i}]));if(i[Y]!=="file")return h({},e,[].concat(V(o),[{message:"Image did not have the valid file extension type. Got: ".concat(i[Y]),value:i}]));var l=this.options||{},u=l.accept,c=(a=(s=i.metadata)===null||s===void 0?void 0:s.mimeType)!==null&&a!==void 0?a:"";if(u&&c&&!c.includes("/"))return h({},e,[].concat(V(o),[{message:"Invalid mime type format. Got: '".concat(c,"'"),value:i,fixes:["image:check-metadata"]}]));if(u&&c&&c.includes("/")){var p=u.split(",").map(function(m){return m.trim()}),g=p.some(function(m){if(m==="*/*")return!0;if(m.endsWith("/*")){var d=m.slice(0,-2);return c.startsWith(d)}return m===c});if(!g)return h({},e,[].concat(V(o),[{message:"Mime type mismatch. Found '".concat(c,"' but schema accepts '").concat(u,"'"),value:i,fixes:["image:check-metadata"]}]))}var f=et.filenameToMimeType(i[C]);if(!f)return h({},e,[].concat(V(o),[{message:"Could not determine mime type from file extension. Got: ".concat(i[C]),value:i,fixes:["image:check-metadata"]}]));if(f&&c&&f!==c)return h({},e,[].concat(V(o),[{message:"Mime type and file extension not matching. Mime type is '".concat(c,"' but file extension is '").concat(f,"'"),value:i,fixes:["image:check-metadata"]}]));if(i.metadata)return i.metadata.hotspot&&(j(i.metadata.hotspot)!=="object"||typeof i.metadata.hotspot.x!="number"||typeof i.metadata.hotspot.y!="number")?h({},e,[].concat(V(o),[{message:"Hotspot must be an object with x and y as numbers.",value:i}])):h({},e,[].concat(V(o),[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and the mime type.",value:i,fixes:["image:check-metadata"]}]));var v=Object.keys(this.moduleMetadata).length>0;return i.metadata===void 0&&v?o.length===0?!1:h({},e,V(o)):h({},e,[].concat(V(o),[{message:"Could not validate Image metadata.",value:i,fixes:["image:add-metadata"]}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:j(i)!=="object"?{success:!1,errors:h({},e,[{message:"Expected 'object', got '".concat(j(i),"'"),typeError:!0}])}:C in i?Y in i&&i[Y]==="file"?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Value of this schema must use: 'c.image' (error type: missing_file_extension)",typeError:!0}])}:{success:!1,errors:h({},e,[{message:"Value of this schema must use: 'c.image' (error type: missing_ref_prop)",typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.isRemote,this.customValidateFunctions,this.moduleMetadata)}},{key:"executeSerialize",value:function(){var e,i=this.moduleMetadata?Object.keys(this.moduleMetadata):[];return{type:"image",options:this.options,opt:this.opt,remote:this.isRemote,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0,referencedModule:i.length>0?i[0]:void 0}}},{key:"executeRender",value:function(){return{}}}])})(X),nn=function(n){var r=!!n&&!!et.getValPath(n);if(r){for(var e={},i=0,a=[n];i<a.length;i++){var s=a[i],o=Dt(s);if(o===void 0)throw new Error("Invalid argument passed to s.image(). Expected a ValModule constructed through c.define, but got an object without a valid module path.");e[o]=ve(s)}return new Xt({},!1,!1,[],e)}return new Xt(n)},Zt=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"include",value:function(e){return new n(z(z({},this.options),{},{include:e}),this.opt,this.customValidateFunctions)}},{key:"exclude",value:function(e){return new n(z(z({},this.options),{},{exclude:e}),this.opt,this.customValidateFunctions)}},{key:"validate",value:function(e){return new n(this.options,this.opt,this.customValidateFunctions.concat(e))}},{key:"executeValidate",value:function(e,i){var a,s,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?o.length>0?h({},e,o):!1:typeof i!="string"?h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),value:i}]):h({},e,[].concat(V(o),[{fixes:["router:check-route"],message:"Did not validate route (router). This error (router:check-route) should typically be processed by Val internally. Seeing this error most likely means you have a Val version mismatch.",value:{route:i,sourcePath:e,include:(a=this.options)===null||a===void 0?void 0:a.include,exclude:(s=this.options)===null||s===void 0?void 0:s.exclude}}]))}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:typeof i=="string"?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0,this.customValidateFunctions)}},{key:"executeSerialize",value:function(){var e,i,a,s;return{type:"route",options:{include:((e=this.options)===null||e===void 0?void 0:e.include)&&{source:this.options.include.source,flags:this.options.include.flags},exclude:((i=this.options)===null||i===void 0?void 0:i.exclude)&&{source:this.options.exclude.source,flags:this.options.exclude.flags},customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0},opt:this.opt,customValidate:this.customValidateFunctions&&((s=this.customValidateFunctions)===null||s===void 0?void 0:s.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),rn=function(n){return new Zt(n)},St=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"maxLength",value:function(e){return new n(z(z({},this.options),{},{maxLength:e}),this.opt)}},{key:"minLength",value:function(e){return new n(z(z({},this.options),{},{minLength:e}),this.opt)}},{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e}),s=this.executeAssert(e,i);if(!s.success)return a.length>0?h({},e,a):s.errors;var o=s.data;if(o===null&&this.opt)return a.length>0?h({},e,a):!1;if(o===null)return h({},e,[].concat(V(a),[{message:"Expected 'array', got 'null'",typeError:!0}]));var l={},u=this.internalValidate(e,o,l);return u?a.length>0?z(h({},e,a),u):u:Object.keys(l).length>0?a.length>0?z(h({},e,a),l):l:a.length>0?h({},e,a):!1}},{key:"internalValidate",value:function(e,i,a){var s=this,o=0,l=function(v,m,d){var y=function(A,w,F){d[A]||(d[A]=[]),d[A].push({message:w,typeError:F})},x=ot(m),k;try{var b=function(){var A,w,F,T,I,N,J,G,W,$,R=k.value,_=q(v,m.indexOf(R));if(typeof R=="string")return o+=R.length,0;if(j(R)!=="object")return{v:h({},_,[{message:"Expected nodes of type 'object' or 'string', got '".concat(j(R),"'"),typeError:!0}])};if(R===null)return{v:h({},_,[{message:"Expected nodes of type 'object' or 'string', got 'null'",typeError:!0}])};if(!("tag"in R))return{v:h({},_,[{message:"Expected node to either have 'tag' or be of type 'string'",typeError:!0}])};if(typeof R.tag!="string")return{v:h({},_,[{message:"Expected 'string', got '".concat(j(R.tag),"'"),typeError:!0}])};var Jt=["p","span","h1","h2","h3","h4","h5","h6","ol","ul","li","a","img","br"];if(Jt.includes(R.tag)||y(_,"Tag '".concat(R.tag,"' is not supported. Supported tags: ").concat(Jt.join(", ")),!0),R.tag==="h1"&&!((A=s.options.block)!==null&&A!==void 0&&A.h1)&&y(_,"'h' block is not valid",!1),R.tag==="h2"&&!((w=s.options.block)!==null&&w!==void 0&&w.h2)&&y(_,"'h2' block is not valid",!1),R.tag==="h3"&&!((F=s.options.block)!==null&&F!==void 0&&F.h3)&&y(_,"'h3' block is not valid",!1),R.tag==="h4"&&!((T=s.options.block)!==null&&T!==void 0&&T.h4)&&y(_,"'h4' block is not valid",!1),R.tag==="h5"&&!((I=s.options.block)!==null&&I!==void 0&&I.h5)&&y(_,"'h5' block is not valid",!1),R.tag==="h6"&&!((N=s.options.block)!==null&&N!==void 0&&N.h6)&&y(_,"'h6' block is not valid",!1),R.tag==="ol"&&!((J=s.options.block)!==null&&J!==void 0&&J.ol)&&y(_,"'ol' block is not valid",!1),R.tag==="ul"&&!((G=s.options.block)!==null&&G!==void 0&&G.ul)&&y(_,"'ul' block is not valid",!1),R.tag==="li"&&!((W=s.options.block)!==null&&W!==void 0&&W.ul)&&!(($=s.options.block)!==null&&$!==void 0&&$.ol)&&y(_,"'li' tag is invalid since neither 'ul' nor 'ol' block is not valid",!1),R.tag==="a"){var pt,ft;if(!((pt=s.options.inline)!==null&&pt!==void 0&&pt.a))y(_,"'a' inline is not valid",!1);else if((ft=s.options.inline)!==null&&ft!==void 0&&ft.a){var xt;if(!("href"in R))return{v:h({},_,[{message:"Expected 'href' in 'a'",typeError:!0}])};var Vt=q(_,"href"),O=typeof((xt=s.options.inline)===null||xt===void 0?void 0:xt.a)=="boolean"?new Zt:s.options.inline.a,L=function(){if(O instanceof Zt)return O.executeValidate(Vt,R.href);if(O instanceof Tt)return O.executeValidate(Vt,R.href);var jr=O;return console.error("Exhaustive check failed in RichText (anchor href validation)",jr),!1},Et=L();if(Et)for(var yr in Et){var Ii,ue=yr;d[ue]||(d[ue]=[]),(Ii=d[ue]).push.apply(Ii,V(Et[ue]))}}}if(R.tag==="img"){var Ce,Be;if(!((Ce=s.options.inline)!==null&&Ce!==void 0&&Ce.img))y(_,"'img' inline is not valid",!1);else if((Be=s.options.inline)!==null&&Be!==void 0&&Be.img){var Ne;if(!("src"in R))return{v:h({},_,[{message:"Expected 'src' in 'img'",typeError:!0}])};var _i=q(_,"src"),Ti=(Ne=s.options.inline)===null||Ne===void 0?void 0:Ne.img,We=j(Ti)==="object"?Ti.executeValidate(_i,R.src):new Xt({},!1,!1).executeValidate(_i,R.src);if(We)for(var br in We){var Pi,ce=br;d[ce]||(d[ce]=[]),(Pi=d[ce]).push.apply(Pi,V(We[ce]))}}}if("styles"in R&&R.tag!=="span")return{v:h({},_,[{message:"Cannot have styles on '".concat(R.tag,"'. This is only allowed on 'span'"),typeError:!0}])};if("styles"in R){if(!Array.isArray(R.styles))return{v:h({},_,[{message:"Expected 'array', got '".concat(j(R.styles),"'"),typeError:!0}])};for(var wr=q(_,"styles"),pe=0;pe<R.styles.length;pe++){var Le,He,Je,Gt=R.styles[pe],fe=q(wr,pe);if(typeof Gt!="string")return{v:h({},fe,[{message:"Expected 'string', got '".concat(j(Gt),"'"),typeError:!0}])};Gt==="bold"&&!((Le=s.options.style)!==null&&Le!==void 0&&Le.bold)&&y(fe,"Style 'bold' is not valid",!1),Gt==="italic"&&!((He=s.options.style)!==null&&He!==void 0&&He.italic)&&y(fe,"Style 'italic' is not valid",!1),Gt==="lineThrough"&&!((Je=s.options.style)!==null&&Je!==void 0&&Je.lineThrough)&&y(fe,"Style 'lineThrough' is not valid",!1)}}if("children"in R){if(!Array.isArray(R.children))return{v:h({},_,[{message:"Expected 'array', got '".concat(j(R.children),"'"),typeError:!0}])};var kr=q(_,"children"),Ci=l(kr,R.children,d);if(Ci)return{v:Ci}}},E;for(x.s();!(k=x.n()).done;)if(E=b(),E!==0&&E)return E.v}catch(M){x.e(M)}finally{x.f()}return!1},u=l(e,i,a),c=[];if(this.options.maxLength&&o>this.options.maxLength&&c.push({message:"Maximum length of ".concat(this.options.maxLength," exceeded (current length: ").concat(o,")"),typeError:!1}),this.options.minLength&&o<this.options.minLength&&c.push({message:"Minimum length of ".concat(this.options.minLength," not met (current length: ").concat(o,")"),typeError:!1}),u){if(c.length>0){var p;u[e]||(u[e]=[]),(p=u[e]).push.apply(p,c)}return u}if(Object.keys(a).length>0){if(c.length>0){var g;a[e]||(a[e]=[]),(g=a[e]).push.apply(g,c)}return a}return c.length>0?h({},e,c):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null&&!this.opt)return{success:!1,errors:h({},e,[{message:"Expected 'array', got 'null'",typeError:!0}])};if(!Array.isArray(i))return{success:!1,errors:h({},e,[{message:"Expected 'array', got '".concat(j(i),"'"),typeError:!0}])};for(var a={},s=0;s<i.length;s++)this.recursiveAssert(q(e,s),i[s],a);return Object.keys(a).length>0?{success:!1,errors:a}:{success:!0,data:i}}},{key:"recursiveAssert",value:function(e,i,a){if(j(i)!=="object"){a[e]||(a[e]=[]),a[e].push({message:"Expected 'object', got '".concat(j(i),"'"),typeError:!0});return}if(Array.isArray(i)){a[e]||(a[e]=[]),a[e].push({message:"Expected 'object', got 'array'",typeError:!0});return}if(i===null){a[e]||(a[e]=[]),a[e].push({message:"Expected 'object', got 'null'",typeError:!0});return}if("tag"in i&&typeof i.tag!="string"){a[e]||(a[e]=[]),a[e].push({message:"Expected 'string', got '".concat(j(i.tag),"'"),typeError:!0});return}if("children"in i)if(Array.isArray(i.children))for(var s=0;s<i.children.length;s++){var o=i.children[s],l=q(q(e,"children"),s);if(j(o)==="object")this.recursiveAssert(l,o,a);else{if(typeof o=="string")continue;a[l]||(a[l]=[]),a[l].push({message:"Expected 'object' or 'string', got '".concat(j(o),"'"),typeError:!0})}}else{a[e]||(a[e]=[]),a[e].push({message:"Expected 'array', got '".concat(j(i.children),"'"),typeError:!0});return}if("styles"in i)if(!Array.isArray(i.styles))a[e]||(a[e]=[]),a[e].push({message:"Expected 'array', got '".concat(j(i.styles),"'"),typeError:!0});else for(var u=0;u<i.styles.length;u++){var c=i.styles[u];if(typeof c!="string"){var p=q(e,u);a[p]||(a[p]=[]),a[p].push({message:"Expected 'string', got '".concat(j(c),"'"),typeError:!0})}}}},{key:"nullable",value:function(){return new n(this.options,!0)}},{key:"executeSerialize",value:function(){var e=this,i,a=function(){var l,u;if(((l=e.options.inline)===null||l===void 0?void 0:l.a)instanceof Zt){var c;return(c=e.options.inline)===null||c===void 0?void 0:c.a.executeSerialize()}else if(((u=e.options.inline)===null||u===void 0?void 0:u.a)instanceof Tt){var p;return(p=e.options.inline)===null||p===void 0?void 0:p.a.executeSerialize()}else{var g;return(g=e.options.inline)===null||g===void 0?void 0:g.a}},s={maxLength:this.options.maxLength,minLength:this.options.minLength,style:this.options.style,block:this.options.block,inline:this.options.inline&&{a:a(),img:this.options.inline.img&&j(this.options.inline.img)==="object"?this.options.inline.img.executeSerialize():this.options.inline.img}};return{type:"richtext",opt:this.opt,options:s,customValidate:this.customValidateFunctions&&((i=this.customValidateFunctions)===null||i===void 0?void 0:i.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),an=function(n){return new St(n??{})},sn=/^(https?:\/\/[^/]+)\/file\/p\/([^/]+)\/b\/([^/]+)\/v\/([^/]+)\/h\/([^/]+)\/f\/([^/]+)\/p\/(.+)$/;function ge(t){if(t[0]==="/")return{status:"error",error:"Not a remote ref: "+t};var n=t.match(sn);return n?n[7].indexOf("public/val/")!==0?{status:"error",error:"Invalid remote ref: "+t}:{status:"success",remoteHost:n[1],projectId:n[2],bucket:n[3],version:n[4],validationHash:n[5],fileHash:n[6],filePath:n[7]}:{status:"error",error:"Invalid remote ref: "+t}}var ut=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,l=arguments.length>5?arguments[5]:void 0;return D(this,n),e=Z(this,n),h(e,"renderInput",null),e.item=r,e.opt=i,e.customValidateFunctions=a,e.currentRouter=s,e.keySchema=o,e.mediaOptions=l,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.item,this.opt,[].concat(V(this.customValidateFunctions),[e]),this.currentRouter,this.keySchema,this.mediaOptions)}},{key:"executeValidate",value:function(e,i){var a=this,s=!1,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return o.length>0?h({},e,o):!1;if(i===null)return h({},e,[].concat(V(o),[{message:"Expected 'object', got 'null'"}]));if(j(i)!=="object")return h({},e,[].concat(V(o),[{message:"Expected 'object', got '".concat(j(i),"'")}]));if(Array.isArray(i))return h({},e,[].concat(V(o),[{message:"Expected 'object', got 'array'"}]));var l=this.getRouterValidations(e,i);if(l)return l;var u=ot(o),c;try{for(u.s();!(c=u.n()).done;){var p=c.value;s=this.appendValidationError(s,e,p.message,i,p.schemaError)}}catch(d){u.e(d)}finally{u.f()}if(this.mediaOptions){var g=this.mediaOptions.type==="images"?"images:check-unique-folder":"files:check-unique-folder",f={message:"Gallery directory '".concat(this.mediaOptions.directory,"' must be unique across all galleries"),value:{directory:this.mediaOptions.directory,type:this.mediaOptions.type},fixes:[g]};s?s[e]?s[e]=[].concat(V(s[e]),[f]):s=z(z({},s),{},h({},e,[f])):s=h({},e,[f]);var v=this.mediaOptions.type==="images"?"images:check-all-files":"files:check-all-files",m={message:"Directory '".concat(this.mediaOptions.directory,"' may have files not tracked by this gallery"),value:{directory:this.mediaOptions.directory,type:this.mediaOptions.type},fixes:[v]};s[e]?s[e]=[].concat(V(s[e]),[m]):s=z(z({},s),{},h({},e,[m]))}return Object.entries(i).forEach(function(d){var y=st(d,2),x=y[0],k=y[1];if(a.keySchema){var b=ht(e,x);if(!b)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," for key validation"));var E=a.keySchema.executeValidate(b,x);E&&(E[b]=E[b].map(function(T){return z(z({},T),{},{keyError:!0})}),s?s[b]?s[b]=[].concat(V(s[b]),V(E[b])):s[b]=E[b]:s=E)}var M=ht(e,x);if(!M)s=a.appendValidationError(s,e,"Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," at key ").concat(k),i);else if(a.mediaOptions){var A=a.validateMediaKey(M,x);A&&(s=s?z(z({},s),A):A);var w=a.validateMediaEntry(M,k);w&&(s=s?z(z({},s),w):w)}else{var F=a.item.executeValidate(M,k);F&&s?s=z(z({},F),s):F&&(s=F)}}),s}},{key:"isRemoteUrl",value:function(e){return e.startsWith("https://")||e.startsWith("http://")}},{key:"validateMediaKey",value:function(e,i){if(!this.mediaOptions)return!1;var a=this.mediaOptions,s=a.directory,o=a.remote,l=a.type,u=l==="images"?"images":"files",c=l==="images"?"images:check-remote":"files:check-remote",p=this.isRemoteUrl(i),g=i===s||i.startsWith(s+"/");if(o){if(p){var f=ge(i);if(f.status==="error")return h({},e,[{message:"Invalid remote URL format. Use Val tooling (CLI, VS Code extension, or Val Studio) to upload ".concat(u,". Got: ").concat(i),value:i,fixes:[c]}]);var v="/"+f.filePath;return v!==s&&!v.startsWith(s+"/")?h({},e,[{message:"Remote file path '".concat(v,"' is not in expected directory '").concat(s,"'. Use Val tooling to upload ").concat(u," to the correct directory."),value:i,fixes:[c]}]):!1}if(!g)return h({},e,[{message:"Expected a remote URL (https://...) or a local path starting with ".concat(s,"/. Got: ").concat(i),value:i}])}else{if(p)return h({},e,[{message:"Remote URLs are not allowed. Use .remote() to enable remote ".concat(u,". Got: ").concat(i),value:i,fixes:[c]}]);if(!g)return h({},e,[{message:"File path must be within the ".concat(s,"/ directory. Got: ").concat(i),value:i}])}return!1}},{key:"validateMediaEntry",value:function(e,i){if(!this.mediaOptions)return!1;var a=this.mediaOptions,s=a.type,o=a.accept,l=a.altSchema;if(j(i)!=="object"||i===null)return h({},e,[{message:"Expected 'object', got '".concat(j(i),"'"),value:i}]);var u=i,c=[];if(s==="images"&&((typeof u.width!="number"||u.width<=0)&&c.push({message:"Expected 'width' to be a positive number, got '".concat(u.width,"'"),value:i}),(typeof u.height!="number"||u.height<=0)&&c.push({message:"Expected 'height' to be a positive number, got '".concat(u.height,"'"),value:i})),typeof u.mimeType!="string")c.push({message:"Expected 'mimeType' to be a string, got '".concat(j(u.mimeType),"'"),value:i});else{var p=this.validateMediaMimeType(u.mimeType,o);p&&c.push({message:p,value:i})}if(s==="images"){if(u.hotspot!==void 0){var g=u.hotspot;(j(u.hotspot)!=="object"||typeof g.x!="number"||typeof g.y!="number")&&c.push({message:"Hotspot must be an object with x and y as numbers.",value:i})}var f=ht(e,"alt");if(f&&l){var v=l.executeValidate(f,u.alt);if(v)return c.length>0?z(z({},v),{},h({},e,c)):v}}return c.length>0?h({},e,c):!1}},{key:"validateMediaMimeType",value:function(e,i){if(!e.includes("/"))return"Invalid mime type format. Got: '".concat(e,"'");var a=i.split(",").map(function(o){return o.trim()}),s=a.some(function(o){if(o==="*/*")return!0;if(o==="image/*")return e.startsWith("image/");if(o.endsWith("/*")){var l=o.slice(0,-2);return e.startsWith(l)}return o===e});return s?null:"Mime type mismatch. Found '".concat(e,"' but schema accepts '").concat(i,"'")}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'object', got 'null'",typeError:!0}])}:j(i)!=="object"?{success:!1,errors:h({},e,[{message:"Expected 'object', got '".concat(j(i),"'"),typeError:!0}])}:Array.isArray(i)?{success:!1,errors:h({},e,[{message:"Expected 'object', got 'array'",typeError:!0}])}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.item,!0,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions)}},{key:"router",value:function(e){return new n(this.item,this.opt,this.customValidateFunctions,e,this.keySchema,this.mediaOptions)}},{key:"remote",value:function(){return new n(this.item,this.opt,this.customValidateFunctions,this.currentRouter,this.keySchema,this.mediaOptions?z(z({},this.mediaOptions),{},{remote:!0}):void 0)}},{key:"getRouterValidations",value:function(e,i){if(!this.currentRouter||i===null)return!1;var a=xe(e),s=st(a,2),o=s[0],l=s[1];if(l)return h({},e,[{message:"This field was configured as a router, but it is not defined at the root of the module",schemaError:!0}]);var u=this.currentRouter.validate(o,Object.keys(i));return u.length>0?Object.fromEntries(u.map(function(c){if(!c.error.urlPath)return[e,[{message:"Router validation error: ".concat(c.error.message," has no url path"),schemaError:!0}]];var p=ht(e,c.error.urlPath);if(!p)throw new Error("Internal error: could not create path at ".concat(!e&&typeof e=="string"?"<empty string>":e," for router validation"));return[p,[{message:c.error.message,value:c.error.urlPath,keyError:!0}]]})):!1}},{key:"executeSerialize",value:function(){var e,i,a,s={type:"record",item:this.item.executeSerialize(),key:(e=this.keySchema)===null||e===void 0?void 0:e.executeSerialize(),opt:this.opt,router:(i=this.currentRouter)===null||i===void 0?void 0:i.getRouterId(),customValidate:this.customValidateFunctions&&((a=this.customValidateFunctions)===null||a===void 0?void 0:a.length)>0};return this.mediaOptions&&(s.mediaType=this.mediaOptions.type,s.accept=this.mediaOptions.accept,s.directory=this.mediaOptions.directory,s.remote=this.mediaOptions.remote,this.mediaOptions.altSchema&&(s.alt=this.mediaOptions.altSchema.executeSerialize())),s}},{key:"executeRender",value:function(e,i){var a={};if(i===null)return a;for(var s in i){var o=i[s];if(o!=null){var l=q(e,s),u=this.item.executeRender(l,o);for(var c in u){var p=c;a[p]=u[p]}}}if(this.renderInput){var g=this.renderInput,f=g.select,v=g.layout;v!=="list"&&(a[e]={status:"error",message:"Unknown layout type: "+v});try{a[e]={status:"success",data:{layout:"list",parent:"record",items:Object.entries(i).map(function(m){var d=st(m,2),y=d[0],x=d[1],k=f({key:y,val:x}),b=k.title,E=k.subtitle,M=k.image;return[y,{title:b,subtitle:E,image:M}]})}}}catch(m){a[e]={status:"error",message:m instanceof Error?m.message:"Unknown error"}}}return a}},{key:"render",value:function(e){return this.renderInput={layout:e.as,select:e.select},this}}])})(X);function on(t,n){return n?new ut(n,!1,[],null,t):new ut(t,!1,[],null,null)}function ve(t){return t[Yi]}function xe(t){var n=t.indexOf(Ft);return n===-1?[t,""]:[t.slice(0,n),t.slice(n+Ft.length)]}function $e(t,n){return n===""?t:"".concat(t).concat(Ft).concat(n)}function ti(t){return t instanceof lt||j(t)==="object"&&"type"in t&&t.type==="object"}function ei(t){return t instanceof ut||j(t)==="object"&&"type"in t&&t.type==="record"}function ii(t){return t instanceof Yt||j(t)==="object"&&"type"in t&&t.type==="array"}function ni(t){return t instanceof qe||j(t)==="object"&&"type"in t&&t.type==="union"}function ri(t){return t instanceof St||j(t)==="object"&&"type"in t&&t.type==="richtext"}function ai(t){return t instanceof Xt||j(t)==="object"&&"type"in t&&t.type==="image"}function ln(t,n,r){for(var e=Pt(t),i=V(e),a=r,s=n,o=function(){var c=e.shift();if(c===void 0)throw Error("Unexpected undefined part");if(ii(a)){var p;if(Number.isNaN(Number(c)))throw Error("Invalid path: array schema ".concat(JSON.stringify(a)," must have a number as path, but got ").concat(c,". Path: ").concat(t));if(j(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(j(s)));s=s[c],a=a instanceof Yt?(p=a)===null||p===void 0?void 0:p.item:a.item}else if(ei(a)){var g;if(typeof c!="string")throw Error("Invalid path: record schema ".concat(a," must have path: ").concat(c," as string"));if(j(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(j(s)));if(!s[c])throw Error("Invalid path: record source did not have key ".concat(c," from path: ").concat(t));s=s[c],a=a instanceof ut?(g=a)===null||g===void 0?void 0:g.item:a.item}else if(ti(a)){if(j(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(j(s)));if(s!==null&&s[c]===void 0)throw Error("Invalid path: object source did not have key ".concat(c," from path: ").concat(t));s=s===null?s:s[c],a=(a instanceof lt,a.items[c])}else{if(ai(a))return{v:{path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join("."),schema:a,source:s}};if(ni(a)){var f=a.key;if(typeof f!="string")return{v:{path:i.map(function(b){return Number.isNaN(Number(b))?JSON.stringify(b):b}).join("."),schema:a,source:s}};var v=s[f];if(!v)throw Error("Invalid path: union source ".concat(a," did not have required key ").concat(f," in path: ").concat(t));var m=a.items.find(function(b){var E;return(b==null||(E=b.items)===null||E===void 0||(E=E[f])===null||E===void 0?void 0:E.value)===v});if(!m)throw Error("Invalid path: union schema ".concat(a," did not have a child object with ").concat(f," of value ").concat(v," in path: ").concat(t));a=m.items[c],s=s[c]}else if(ri(a)){if("src"in s&&"tag"in s&&s.tag==="img"&&e.length===0){var d,y;a=a instanceof St&&(d=a.options)!==null&&d!==void 0&&(d=d.inline)!==null&&d!==void 0&&d.img&&typeof((y=a.options)===null||y===void 0||(y=y.inline)===null||y===void 0?void 0:y.img)!="boolean"?a.options.inline.img:a}if("href"in s&&"tag"in s&&s.tag==="a"&&e.length===0){var x,k;a=a instanceof St&&(x=a.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.a&&typeof((k=a.options)===null||k===void 0||(k=k.inline)===null||k===void 0?void 0:k.a)!="boolean"?a.options.inline.a:a}s=s[c]}else throw Error("Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(a)))}},l;e.length>0;)if(l=o(),l)return l.v;if(e.length>0)throw Error("Invalid path: ".concat(e.join(".")," is not a valid path"));return{path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:a,source:s}}function un(t,n,r){for(var e=Pt(t),i=V(e),a=r,s=n,o=function(){var c=e.shift();if(c===void 0)return{v:{status:"error",message:"Unexpected undefined part"}};if(ii(a)){var p;if(Number.isNaN(Number(c)))return{v:{status:"error",message:"Invalid path: array schema ".concat(JSON.stringify(a)," must have a number as path, but got ").concat(c,". Path: ").concat(t)}};if(s===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(j(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of array, but got ".concat(j(s))}};if(s[c]===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};s=s[c],a=a instanceof Yt?(p=a)===null||p===void 0?void 0:p.item:a.item}else if(ei(a)){var g;if(typeof c!="string")return{v:{status:"error",message:"Invalid path: record schema ".concat(a," must have path: ").concat(c," as string")}};if(s===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(j(s)!=="object"&&!Array.isArray(s))return{v:{status:"error",message:"Schema type error: expected source to be type of record, but got ".concat(j(s))}};if(s[c]===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};s=s[c],a=a instanceof ut?(g=a)===null||g===void 0?void 0:g.item:a.item}else if(ti(a)){if(s===void 0)return{v:{status:"source-undefined",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join(".")}};if(j(s)!=="object")return{v:{status:"error",message:"Schema type error: expected source to be type of object, but got ".concat(j(s))}};if(s!==null&&s[c]===void 0)return{v:{status:"error",message:"Invalid path: object source did not have key ".concat(c," from path: ").concat(t)}};s=s===null?s:s[c],a=(a instanceof lt,a.items[c])}else{if(ai(a))return{v:{status:"ok",path:i.slice(0,i.length-e.length-1).map(function(b){return JSON.stringify(b)}).join("."),schema:a,source:s}};if(ni(a)){var f=a.key;if(typeof f!="string")return{v:{status:"ok",path:i.map(function(b){return Number.isNaN(Number(b))?JSON.stringify(b):b}).join("."),schema:a,source:s}};var v=s[f];if(!v)return{v:{status:"error",message:"Invalid path: union source ".concat(a," did not have required key ").concat(f," in path: ").concat(t)}};var m=a.items.find(function(b){var E;return(b==null||(E=b.items)===null||E===void 0||(E=E[f])===null||E===void 0?void 0:E.value)===v});if(!m)return{v:{status:"error",message:"Invalid path: union schema ".concat(a," did not have a child object with ").concat(f," of value ").concat(v," in path: ").concat(t)}};a=m.items[c],s=s[c]}else if(ri(a)){if("src"in s&&"tag"in s&&s.tag==="img"&&e.length===0){var d,y;a=a instanceof St&&(d=a.options)!==null&&d!==void 0&&(d=d.inline)!==null&&d!==void 0&&d.img&&typeof((y=a.options)===null||y===void 0||(y=y.inline)===null||y===void 0?void 0:y.img)!="boolean"?a.options.inline.img:a}if("href"in s&&"tag"in s&&s.tag==="a"&&e.length===0){var x,k;a=a instanceof St&&(x=a.options)!==null&&x!==void 0&&(x=x.inline)!==null&&x!==void 0&&x.a&&typeof((k=a.options)===null||k===void 0||(k=k.inline)===null||k===void 0?void 0:k.a)!="boolean"?a.options.inline.a:a}s=s[c]}else return{v:{status:"error",message:"Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(a))}}}},l;e.length>0;)if(l=o(),l)return l.v;return e.length>0?{status:"error",message:"Invalid path: ".concat(e.join(".")," is not a valid path")}:{status:"ok",path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:a,source:s}}function cn(t){var n=t.split("/").slice(1);return n}function Pt(t){for(var n=[],r=0;r<t.length;){var e="";if(t[r]==='"'){for(r++;r<t.length&&t[r]!=='"';)t[r]==="\\"&&t[r+1]==='"'?(e+='"',r++):e+=t[r],r++;if(t[r]!=='"'){var i;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((i=t[r])!==null&&i!==void 0?i:"at end of string"," (char: ").concat(r,"; length: ").concat(t.length,")"))}}else for(;r<t.length&&t[r]!==".";)e+=t[r],r++;e!==""&&n.push(e),r++}return n}function pn(t){return t.split(",")}function fn(t){var n=xe(t),r=st(n,2),e=r[0],i=r[1],a=Pt(i).slice(0,-1);return a.length>0?$e(e,si(a)):e}function si(t){return t.map(function(n){return Number.isInteger(Number(n))?n:JSON.stringify(n)}).join(".")}var ye=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a,s,o=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});return this.opt&&i==null?o.length>0?h({},e,o):!1:typeof i!="number"?h({},e,[].concat(V(o),[{message:"Expected 'number', got '".concat(j(i),"'"),value:i}])):(a=this.options)!==null&&a!==void 0&&a.max&&i>this.options.max?h({},e,[].concat(V(o),[{message:"Expected 'number' less than ".concat(this.options.max),value:i}])):(s=this.options)!==null&&s!==void 0&&s.min&&i<this.options.min?h({},e,[].concat(V(o),[{message:"Expected 'number' greater than ".concat(this.options.min),value:i}])):o.length>0?h({},e,o):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'number', got 'null'",typeError:!0}])}:typeof i=="number"?{success:!0,data:i}:{success:!1,errors:h({},e,[{message:"Expected 'number', got '".concat(j(i),"'"),typeError:!0}])}}},{key:"nullable",value:function(){return new n(this.options,!0)}},{key:"max",value:function(e){return new n(z(z({},this.options),{},{max:e}),this.opt)}},{key:"min",value:function(e){return new n(z(z({},this.options),{},{min:e}),this.opt)}},{key:"executeSerialize",value:function(){var e;return{type:"number",options:this.options,opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),hn=function(n){return new ye(n)},dn=(function(t){function n(){var r,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return D(this,n),r=Z(this,n),r.opt=e,r.customValidateFunctions=i,r}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){return this.opt&&i==null?!1:typeof i!="boolean"?h({},e,[{message:"Expected 'boolean', got '".concat(j(i),"'"),value:i}]):!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'boolean', got 'null'",typeError:!0}])}:typeof i!="boolean"?{success:!1,errors:h({},e,[{message:"Expected 'boolean', got '".concat(j(i),"'"),typeError:!0}])}:{success:!0,data:i}}},{key:"nullable",value:function(){return new n(!0)}},{key:"executeSerialize",value:function(){var e;return{type:"boolean",opt:this.opt,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),mn=function(){return new dn},gn=(function(t){function n(r,e){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];return D(this,n),i=Z(this,n),i.schema=r,i.sourcePath=e,i.opt=a,i.customValidateFunctions=s,i}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.schema,this.sourcePath,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a=this.executeCustomValidateFunctions(i,this.customValidateFunctions,{path:e});if(this.opt&&i==null)return a.length>0?h({},e,a):!1;if(!this.schema)return h({},e,[].concat(V(a),[{message:"Schema not found for module. keyOf must be used with a Val Module"}]));var s=this.schema;if(!(s.type==="object"||s.type==="record"))return h({},e,[].concat(V(a),[{message:"Schema in keyOf must be an 'object' or 'record'. Found '".concat(s.type||"unknown","'")}]));if(s.opt&&i==null)return!1;if(s.type==="record"&&typeof i!="string")return h({},e,[].concat(V(a),[{message:"Type of value in keyof (record) must be 'string'"}]));if(s.type==="object"){var o=s.keys;if(!o.includes(i))return h({},e,[].concat(V(a),[{message:"Value of keyOf (object) must be: ".concat(o.join(", "),". Found: ").concat(i)}]))}return s.type==="record"?typeof i!="string"?h({},e,[].concat(V(a),[{message:"Value of keyOf (record) must be 'string'. Found: ".concat(j(i))}])):h({},e,[].concat(V(a),[{fixes:["keyof:check-keys"],message:"Did not validate keyOf (record). This error (keyof:check-keys) should typically be processed by Val internally. Seeing this error most likely means you have a Val version mismatch.",value:{key:i,sourcePath:this.sourcePath}}])):a.length>0?h({},e,a):!1}},{key:"executeAssert",value:function(e,i){if(this.opt&&i===null)return{success:!0,data:i};if(i===null)return{success:!1,errors:h({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])};var a=this.schema;if(!a)return{success:!1,errors:h({},e,[{message:"Neither key nor schema was found. keyOf is missing an argument.",typeError:!0}])};var s=a;if(!(s.type==="object"||s.type==="record"))return{success:!1,errors:h({},e,[{message:"Schema of first argument must be either: 'array', 'object' or 'record'. Found '".concat(s.type||"unknown","'"),typeError:!0}])};if(s.type==="record"&&typeof i!="string")return{success:!1,errors:h({},e,[{message:"Value of keyOf (record) must be 'string', got '".concat(j(i),"'"),typeError:!0}])};if(s.type==="object"){var o=s.keys;if(!o.includes(i))return{success:!1,errors:h({},e,[{message:"Value of keyOf (object) must be: ".concat(o.join(", "),". Found: ").concat(i),typeError:!0}])}}return{success:!0,data:i}}},{key:"nullable",value:function(){return new n(this.schema,this.sourcePath,!0)}},{key:"executeSerialize",value:function(){var e,i=this.sourcePath;if(!i)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module of record schema.");var a=this.schema;if(!a)throw new Error("Cannot serialize keyOf schema with empty selector.");var s;switch(a.type){case"record":s="string";break;case"object":s=a.keys;break;default:throw new Error("Cannot serialize keyOf schema with selector of type '".concat(a.type||"unknown","'"))}return{type:"keyOf",path:i,schema:a,opt:this.opt,values:s,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),vn=function(n){var r=n?.[Ke],e=void 0;if(r instanceof lt){var i=[];try{i=Object.keys(r?.items||{})}catch{}e={type:"object",keys:i,opt:r?.opt}}else r instanceof ut&&(e={type:"record",opt:r?.opt});return new gn(e,Dt(n))},xn=function(n){var r,e,i=(r=n.directory)!==null&&r!==void 0?r:"/public/val",a=new lt({mimeType:new Tt({},!1)},!1);return new ut(a,!1,[],null,null,{type:"files",accept:n.accept,directory:i,remote:(e=n.remote)!==null&&e!==void 0?e:!1})},yn=(function(t){function n(r){var e,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return D(this,n),e=Z(this,n),e.options=r,e.opt=i,e.customValidateFunctions=a,e}return Q(n,t),K(n,[{key:"validate",value:function(e){return new n(this.options,this.opt,[].concat(V(this.customValidateFunctions),[e]))}},{key:"executeValidate",value:function(e,i){var a,s,o,l;if(this.opt&&i==null)return!1;if(typeof i!="string")return h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),value:i}]);if((a=this.options)!==null&&a!==void 0&&a.from&&(s=this.options)!==null&&s!==void 0&&s.to){if(this.options.from>this.options.to)return h({},e,[{message:"From date ".concat(this.options.from," is after to date ").concat(this.options.to),value:i,typeError:!0}]);if(i<this.options.from||i>this.options.to)return h({},e,[{message:"Date is not between ".concat(this.options.from," and ").concat(this.options.to),value:i}])}else if((o=this.options)!==null&&o!==void 0&&o.from){if(i<this.options.from)return h({},e,[{message:"Date is before the minimum date ".concat(this.options.from),value:i}])}else if((l=this.options)!==null&&l!==void 0&&l.to&&i>this.options.to)return h({},e,[{message:"Date is after the maximum date ".concat(this.options.to),value:i}]);return!1}},{key:"executeAssert",value:function(e,i){return this.opt&&i===null?{success:!0,data:i}:i===null?{success:!1,errors:h({},e,[{message:"Expected 'string', got 'null'",typeError:!0}])}:typeof i!="string"?{success:!1,errors:h({},e,[{message:"Expected 'string', got '".concat(j(i),"'"),typeError:!0}])}:{success:!0,data:i}}},{key:"from",value:function(e){return new n(z(z({},this.options),{},{from:e}),this.opt)}},{key:"to",value:function(e){return new n(z(z({},this.options),{},{to:e}),this.opt)}},{key:"nullable",value:function(){return new n(this.options,!0)}},{key:"executeSerialize",value:function(){var e;return{type:"date",opt:this.opt,options:this.options,customValidate:this.customValidateFunctions&&((e=this.customValidateFunctions)===null||e===void 0?void 0:e.length)>0}}},{key:"executeRender",value:function(){return{}}}])})(X),bn=function(n){return new yn(n)};function wn(t,n){var r=Kt(),e=new ut(n,!1,[],t,r);return e}var kn=function(n){var r,e,i,a=(r=n.directory)!==null&&r!==void 0?r:"/public/val",s=(e=n.alt)!==null&&e!==void 0?e:Kt().nullable(),o=new lt({width:new ye(void 0,!1),height:new ye(void 0,!1),mimeType:new Tt({},!1),alt:s},!1);return new ut(o,!1,[],null,null,{type:"images",accept:n.accept,directory:a,remote:(i=n.remote)!==null&&i!==void 0?i:!1,altSchema:s})};function jn(){return{string:Kt,boolean:mn,array:$i,object:Qe,number:hn,union:en,richtext:an,image:nn,literal:tn,keyOf:vn,record:on,file:Qi,files:xn,date:bn,route:rn,router:wn,images:kn}}function Vn(t,n){var r=n.publicProjectId,e=n.coreVersion,i=n.validationHash,a=n.fileHash,s=n.filePath,o=n.bucket;return"".concat(t,"/file/p/").concat(r,"/b/").concat(o,"/v/").concat(e,"/h/").concat(i,"/f/").concat(a,"/p/").concat(s)}function En(t){if(t!=null&&t.patch_id){var n=ge(t[C]);if(n.status==="success")return{url:"/api/val/files/"+n.filePath+"?patch_id=".concat(t.patch_id,"&remote=true&ref=").concat(encodeURIComponent(t[C])),metadata:t.metadata};console.warn("Internal Val error: failed to split remote ref: ".concat(t[C],". The data format is different than what is expected. Check Val versions for mismatches."),n.error)}return{url:t[C],metadata:t.metadata}}var Sn=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],P=(function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t})(P||{});function Fn(t){return new On}var On=(function(){function t(){D(this,t),h(this,"A",1779033703),h(this,"B",-1150833019),h(this,"C",1013904242),h(this,"D",-1521486534),h(this,"E",1359893119),h(this,"F",-1694144372),h(this,"G",528734635),h(this,"H",1541459225),h(this,"_size",0),h(this,"_sp",0),(!Qt||Ct>=P.allocTotal)&&(Qt=new ArrayBuffer(P.allocTotal),Ct=0),this._byte=new Uint8Array(Qt,Ct,P.allocBytes),this._word=new Int32Array(Qt,Ct,P.allocWords),Ct+=P.allocBytes}return K(t,[{key:"update",value:function(r){if(typeof r=="string")return this._utf8(r);if(r==null)throw new TypeError("Invalid type: "+j(r));var e=r.byteOffset,i=r.byteLength,a=i/P.inputBytes|0,s=0;if(a&&!(e&3)&&!(this._size%P.inputBytes)){for(var o=new Int32Array(r.buffer,e,a*P.inputWords);a--;)this._int32(o,s>>2),s+=P.inputBytes;this._size+=s}var l=r.BYTES_PER_ELEMENT;if(l!==1&&r.buffer){var u=new Uint8Array(r.buffer,e+s,i-s);return this._uint8(u)}return s===i?this:this._uint8(r,s)}},{key:"_uint8",value:function(r,e){var i=this._byte,a=this._word,s=r.length;for(e=e|0;e<s;){for(var o=this._size%P.inputBytes,l=o;e<s&&l<P.inputBytes;)i[l++]=r[e++];l>=P.inputBytes&&this._int32(a),this._size+=l-o}return this}},{key:"_utf8",value:function(r){for(var e=this._byte,i=this._word,a=r.length,s=this._sp,o=0;o<a;){for(var l=this._size%P.inputBytes,u=l;o<a&&u<P.inputBytes;){var c=r.charCodeAt(o++)|0;c<128?e[u++]=c:c<2048?(e[u++]=192|c>>>6,e[u++]=128|c&63):c<55296||c>57343?(e[u++]=224|c>>>12,e[u++]=128|c>>>6&63,e[u++]=128|c&63):s?(c=((s&1023)<<10)+(c&1023)+65536,e[u++]=240|c>>>18,e[u++]=128|c>>>12&63,e[u++]=128|c>>>6&63,e[u++]=128|c&63,s=0):s=c}u>=P.inputBytes&&(this._int32(i),i[0]=i[P.inputWords]),this._size+=u-l}return this._sp=s,this}},{key:"_int32",value:function(r,e){var i=this.A,a=this.B,s=this.C,o=this.D,l=this.E,u=this.F,c=this.G,p=this.H,g=0;for(e=e|0;g<P.inputWords;)bt[g++]=tt(r[e++]);for(g=P.inputWords;g<P.workWords;g++)bt[g]=Pn(bt[g-2])+bt[g-7]+Tn(bt[g-15])+bt[g-16]|0;for(g=0;g<P.workWords;g++){var f=p+_n(l)+zn(l,u,c)+Sn[g]+bt[g]|0,v=In(i)+Rn(i,a,s)|0;p=c,c=u,u=l,l=o+f|0,o=s,s=a,a=i,i=f+v|0}this.A=i+this.A|0,this.B=a+this.B|0,this.C=s+this.C|0,this.D=o+this.D|0,this.E=l+this.E|0,this.F=u+this.F|0,this.G=c+this.G|0,this.H=p+this.H|0}},{key:"digest",value:function(r){var e=this._byte,i=this._word,a=this._size%P.inputBytes|0;for(e[a++]=128;a&3;)e[a++]=0;if(a>>=2,a>P.highIndex){for(;a<P.inputWords;)i[a++]=0;a=0,this._int32(i)}for(;a<P.inputWords;)i[a++]=0;var s=this._size*8,o=(s&4294967295)>>>0,l=(s-o)/4294967296;return l&&(i[P.highIndex]=tt(l)),o&&(i[P.lowIndex]=tt(o)),this._int32(i),r==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var r=this.A,e=this.B,i=this.C,a=this.D,s=this.E,o=this.F,l=this.G,u=this.H;return dt(r)+dt(e)+dt(i)+dt(a)+dt(s)+dt(o)+dt(l)+dt(u)}},{key:"_bin",value:function(){var r=this.A,e=this.B,i=this.C,a=this.D,s=this.E,o=this.F,l=this.G,u=this.H,c=this._byte,p=this._word;return p[0]=tt(r),p[1]=tt(e),p[2]=tt(i),p[3]=tt(a),p[4]=tt(s),p[5]=tt(o),p[6]=tt(l),p[7]=tt(u),c.slice(0,32)}}])})(),bt=new Int32Array(P.workWords),Qt,Ct=0,dt=function(n){return(n+4294967296).toString(16).substr(-8)},An=function(n){return n<<24&4278190080|n<<8&16711680|n>>8&65280|n>>24&255},Mn=function(n){return n},tt=Cn()?Mn:An,zn=function(n,r,e){return e^n&(r^e)},Rn=function(n,r,e){return n&r|e&(n|r)},In=function(n){return(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10)},_n=function(n){return(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7)},Tn=function(n){return(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3},Pn=function(n){return(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10};function Cn(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var be=function(n){return Fn().update(n).digest("hex")},we={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",avif:"image/avif",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",mov:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},oi=Object.fromEntries(Object.entries(we).map(function(t){var n=st(t,2),r=n[0],e=n[1];return[e,r]})),Bn=/^data:(.*?);base64,/;function Nn(t){var n=Bn.exec(t);if(n&&n[1])return n[1]}function Wn(t){var n=oi[t];return n||t.split("/")[1]}function Ln(t){var n=t.split(".").pop(),r=n&&we[n];if(r)return r}function li(t,n,r,e,i){var a="".concat(e?.width||"").concat(e?.height||"").concat(e?.mimeType),s={type:n.type,opt:n.opt,options:z({},n.options)};return t+JSON.stringify(s)+r+a+i}function Hn(t,n,r,e,i,a){return be(a.encode(li(t,n,r,e,i))).slice(0,4)}function ui(t){return t.slice(0,12)}function Jn(t){return ui(be(new Uint8Array(t)))}var Gn={getRouterId:function(){return"external-url-router"},validate:function(n,r){var e=[],i=ot(r),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.startsWith("https://")||s.startsWith("http://")||e.push({error:{message:'URL path "'.concat(s,'" does not start with "https://" or "http://"'),expectedPath:null,urlPath:s}})}}catch(o){i.e(o)}finally{i.f()}return[]}};function Un(t,n){var r=t.startsWith("/")?t.slice(1).split("/"):t.split("/");if(n.length===0)return{isValid:r.length===0||r.length===1&&r[0]==="",expectedPath:"/"};for(var e=0,i=0,a=!1,s=-1,o=0;o<n.length;o++){var l=n[o];l.startsWith("[[")&&l.endsWith("]]")?(a=!0,s=o,i=1/0):l.startsWith("[...")&&l.endsWith("]")?(a=!0,s=o,e++,i=1/0):l.startsWith("[[")&&l.endsWith("]")?i++:(l.startsWith("[")&&l.endsWith("]"),e++,i++)}if(r.length<e||!a&&r.length>i){var u=n.map(function(v){return v.startsWith("[[")&&v.endsWith("]]")?"[optional:".concat(v.slice(2,-2),"]"):v.startsWith("[...")&&v.endsWith("]")?"[...".concat(v.slice(4,-1),"]"):v.startsWith("[[")&&v.endsWith("]")?"[optional:".concat(v.slice(2,-1),"]"):v.startsWith("[")&&v.endsWith("]")?"[".concat(v.slice(1,-1),"]"):v}).join("/");return{isValid:!1,expectedPath:"/".concat(u)}}for(var c=a?s:n.length,p=0;p<c;p++){var g=n[p],f=r[p];if(g.startsWith("[[")&&g.endsWith("]]")){if(f!==""&&f!==void 0&&f==="")return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}else if(g.startsWith("[")&&g.endsWith("]")){if(f===""||f===void 0)return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}else if(g!==f)return{isValid:!1,expectedPath:"/".concat(n.join("/"))}}return{isValid:!0}}var Dn={getRouterId:function(){return"next-app-router"},validate:function(n,r){var e=Kn(n),i=[],a=ot(r),s;try{for(a.s();!(s=a.n()).done;){var o=s.value,l=Un(o,e);l.isValid||i.push({error:{message:'URL path "'.concat(o,'" does not match the route pattern for "').concat(n,'"'),urlPath:o,expectedPath:l.expectedPath||null}})}}catch(u){a.e(u)}finally{a.f()}return i}};function Kn(t){if(!t||typeof t!="string")return[];for(var n=[/\/app\/(.+)\/page\.val\.ts$/,/\/src\/app\/(.+)\/page\.val\.ts$/,/\/app\/(.+)\/page\.tsx?$/,/\/src\/app\/(.+)\/page\.tsx?$/],r=0,e=n;r<e.length;r++){var i=e[r],a=t.match(i);if(a){var s=a[1];return s.split("/").flatMap(function(o){if(o.startsWith("(")&&o.endsWith(")")&&!o.includes("."))return[];var l=o.match(/^(\([.]+\)(\(.+\))?)(.*)$/);if(l){var u=l[3]||l[4];return u?[u]:[]}return[o]})}}return[]}var Ft="?p=",et={VERSION:{core:(function(){try{return require("../package.json").version}catch{return null}})()},convertFileSource:qi,convertRemoteSource:En,getSchema:Xe,getValPath:Dt,getSource:ve,resolvePath:ln,safeResolvePath:un,splitModuleFilePathAndModulePath:xe,joinModuleFilePathAndModulePath:$e,nextAppRouter:Dn,externalPageRouter:Gn,remote:{createRemoteRef:Vn,getValidationBasis:li,getValidationHash:Hn,getFileHash:Jn,hashToRemoteFileHash:ui,splitRemoteRef:ge},validate:function(n,r,e){var i;return n&&((i=Xe(n))===null||i===void 0?void 0:i.executeValidate(r,e))},isVal:Zi,isFile:Xi,createValPathOfItem:ht,getSHA256Hash:be,initSchema:jn,getMimeType:Nn,mimeTypeToFileExt:Wn,filenameToMimeType:Ln,EXT_TO_MIME_TYPES:we,MIME_TYPES_TO_EXT:oi,ModuleFilePathSep:Ft,notFileOp:function(n){return n.op!=="file"},isFileOp:function(n){return n.op==="file"&&typeof n.filePath=="string"},createPatchJSONPath:function(n){return"/".concat(n.split(".").map(function(r){return r&&Yn(r)}).join("/"))},createPatchPath:function(n){return Pt(n)},splitModulePath:Pt,splitModuleFilePath:cn,splitJoinedSourcePaths:pn,parentOfSourcePath:fn,patchPathToModulePath:si,VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session",createFilename:function(n,r,e,i){var a,s;if(!e||!n)return r;var o=i.slice(0,5),l=(a=et.getMimeType(n))!==null&&a!==void 0?a:"unknown",u=(s=et.mimeTypeToFileExt(l))!==null&&s!==void 0?s:"unknown";if(r){var c=r.split(".").slice(0,-1).join(".")||r,p=c.lastIndexOf("_"),g=c.slice(p+1,c.length);g===o&&(c=c.slice(0,p));var f=encodeURIComponent(c).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase();return"".concat(f,"_").concat(o,".").concat(u)}return"".concat(i,".").concat(u)}};function Yn(t){try{return JSON.parse(t)}catch{return t}}var S;function U(t,n,r){const e=typeof r,i=typeof t;if(e!=="undefined"){if(i!=="undefined"){if(r){if(i==="function"&&e===i)return function(o){return t(r(o))};if(n=t.constructor,n===r.constructor){if(n===Array)return r.concat(t);if(n===Map){var a=new Map(r);for(var s of t)a.set(s[0],s[1]);return a}if(n===Set){s=new Set(r);for(a of t.values())s.add(a);return s}}}return t}return r}return i==="undefined"?n:t}function Ot(t,n){return typeof t>"u"?n:t}function H(){return Object.create(null)}function it(t){return typeof t=="string"}function Bt(t){return typeof t=="object"}function Nt(t,n){if(it(n))t=t[n];else for(let r=0;t&&r<n.length;r++)t=t[n[r]];return t}const Xn=/[^\p{L}\p{N}]+/u,Zn=/(\d{3})/g,Qn=/(\D)(\d{3})/g,qn=/(\d{3})(\D)/g,ci=/[\u0300-\u036f]/g;function Wt(t={}){if(!this||this.constructor!==Wt)return new Wt(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}S=Wt.prototype,S.assign=function(t){this.normalize=U(t.normalize,!0,this.normalize);let n=t.include,r=n||t.exclude||t.split,e;if(r||r===""){if(typeof r=="object"&&r.constructor!==RegExp){let i="";e=!n,n||(i+="\\p{Z}"),r.letter&&(i+="\\p{L}"),r.number&&(i+="\\p{N}",e=!!n),r.symbol&&(i+="\\p{S}"),r.punctuation&&(i+="\\p{P}"),r.control&&(i+="\\p{C}"),(r=r.char)&&(i+=typeof r=="object"?r.join(""):r);try{this.split=new RegExp("["+(n?"^":"")+i+"]+","u")}catch{this.split=/\s+/}}else this.split=r,e=r===!1||"a1a".split(r).length<2;this.numeric=U(t.numeric,e)}else{try{this.split=U(this.split,Xn)}catch{this.split=/\s+/}this.numeric=U(t.numeric,U(this.numeric,!0))}if(this.prepare=U(t.prepare,null,this.prepare),this.finalize=U(t.finalize,null,this.finalize),r=t.filter,this.filter=typeof r=="function"?r:U(r&&new Set(r),null,this.filter),this.dedupe=U(t.dedupe,!0,this.dedupe),this.matcher=U((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=U((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=U((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=U(t.replacer,null,this.replacer),this.minlength=U(t.minlength,1,this.minlength),this.maxlength=U(t.maxlength,1024,this.maxlength),this.rtl=U(t.rtl,!1,this.rtl),(this.cache=r=U(t.cache,!0,this.cache))&&(this.F=null,this.L=typeof r=="number"?r:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(const i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this},S.addStemmer=function(t,n){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,n),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&wt(this),this},S.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&wt(this),this},S.addMapper=function(t,n){return typeof t=="object"?this.addReplacer(t,n):t.length>1?this.addMatcher(t,n):(this.mapper||(this.mapper=new Map),this.mapper.set(t,n),this.cache&&wt(this),this)},S.addMatcher=function(t,n){return typeof t=="object"?this.addReplacer(t,n):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,n):(this.matcher||(this.matcher=new Map),this.matcher.set(t,n),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&wt(this),this)},S.addReplacer=function(t,n){return typeof t=="string"?this.addMatcher(t,n):(this.replacer||(this.replacer=[]),this.replacer.push(t,n),this.cache&&wt(this),this)},S.encode=function(t,n){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(wt,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=ci?t.normalize("NFKD").replace(ci,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(Qn,"$1 $2").replace(qn,"$1 $2").replace(Zn,"$1 "));const r=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let e=[],i=H(),a,s,o=this.split||this.split===""?t.split(this.split):[t];for(let u=0,c,p;u<o.length;u++)if((c=p=o[u])&&!(c.length<this.minlength||c.length>this.maxlength)){if(n){if(i[c])continue;i[c]=1}else{if(a===c)continue;a=c}if(r)e.push(c);else if(!this.filter||(typeof this.filter=="function"?this.filter(c):!this.filter.has(c))){if(this.cache&&c.length<=this.I)if(this.F){var l=this.D.get(c);if(l||l===""){l&&e.push(l);continue}}else this.F=setTimeout(wt,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let g;for(;g!==c&&c.length>2;)g=c,c=c.replace(this.K,f=>this.stemmer.get(f))}if(c&&(this.mapper||this.dedupe&&c.length>1)){l="";for(let g=0,f="",v,m;g<c.length;g++)v=c.charAt(g),v===f&&this.dedupe||((m=this.mapper&&this.mapper.get(v))||m===""?m===f&&this.dedupe||!(f=m)||(l+=m):l+=f=v);c=l}if(this.matcher&&c.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),c=c.replace(this.J,g=>this.matcher.get(g))),c&&this.replacer)for(l=0;c&&l<this.replacer.length;l+=2)c=c.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&p.length<=this.I&&(this.D.set(p,c),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),c){if(c!==p)if(n){if(i[c])continue;i[c]=1}else{if(s===c)continue;s=c}e.push(c)}}}return this.finalize&&(e=this.finalize(e)||e),this.cache&&t.length<=this.H&&(this.B.set(t,e),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),e};function wt(t){t.F=null,t.B.clear(),t.D.clear()}function ke(t,n,r){r||(n||typeof t!="object"?typeof n=="object"&&(r=n,n=0):r=t),r&&(t=r.query||t,n=r.limit||n);let e=""+(n||0);r&&(e+=(r.offset||0)+!!r.context+!!r.suggest+(r.resolve!==!1)+(r.resolution||this.resolution)+(r.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new kt);let i=this.cache.get(t+e);if(!i){const a=r&&r.cache;a&&(r.cache=!1),i=this.search(t,n,r),a&&(r.cache=a),this.cache.set(t+e,i)}return i}function kt(t){this.limit=t&&t!==!0?t:1e3,this.cache=new Map,this.h=""}kt.prototype.set=function(t,n){this.cache.set(this.h=t,n),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},kt.prototype.get=function(t){const n=this.cache.get(t);return n&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,n)),n},kt.prototype.remove=function(t){for(const n of this.cache){const r=n[0];n[1].includes(t)&&this.cache.delete(r)}},kt.prototype.clear=function(){this.cache.clear(),this.h=""};const pi={normalize:!1,numeric:!1,dedupe:!1},qt={},je=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),fi=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),hi=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],di={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,ß:2,d:3,t:3,l:4,m:5,n:5,r:6};var mi={Exact:pi,Default:qt,Normalize:qt,LatinBalance:{mapper:je},LatinAdvanced:{mapper:je,matcher:fi,replacer:hi},LatinExtra:{mapper:je,replacer:hi.concat([/(?!^)[aeo]/g,""]),matcher:fi},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let r=0;r<t.length;r++){var n=t[r];let e=n.charAt(0),i=di[e];for(let a=1,s;a<n.length&&(s=n.charAt(a),s==="h"||s==="w"||!(s=di[s])||s===i||(e+=s,i=s,e.length!==4));a++);t[r]=e}}},CJK:{split:""},LatinExact:pi,LatinDefault:qt,LatinSimple:qt};function gi(t,n,r,e){let i=[];for(let a=0,s;a<t.index.length;a++)if(s=t.index[a],n>=s.length)n-=s.length;else{n=s[e?"splice":"slice"](n,r);const o=n.length;if(o&&(i=i.length?i.concat(n):n,r-=o,e&&(t.length-=o),!r))break;n=0}return i}function At(t){if(!this||this.constructor!==At)return new At(t);this.index=t?[t]:[],this.length=t?t.length:0;const n=this;return new Proxy([],{get(r,e){if(e==="length")return n.length;if(e==="push")return function(i){n.index[n.index.length-1].push(i),n.length++};if(e==="pop")return function(){if(n.length)return n.length--,n.index[n.index.length-1].pop()};if(e==="indexOf")return function(i){let a=0;for(let s=0,o,l;s<n.index.length;s++){if(o=n.index[s],l=o.indexOf(i),l>=0)return a+l;a+=o.length}return-1};if(e==="includes")return function(i){for(let a=0;a<n.index.length;a++)if(n.index[a].includes(i))return!0;return!1};if(e==="slice")return function(i,a){return gi(n,i||0,a||n.length,!1)};if(e==="splice")return function(i,a){return gi(n,i||0,a||n.length,!0)};if(e==="constructor")return Array;if(typeof e!="symbol")return(r=n.index[e/2**31|0])&&r[e]},set(r,e,i){return r=e/2**31|0,(n.index[r]||(n.index[r]=[]))[e]=i,n.length++,!0}})}At.prototype.clear=function(){this.index.length=0},At.prototype.push=function(){};function nt(t=8){if(!this||this.constructor!==nt)return new nt(t);this.index=H(),this.h=[],this.size=0,t>32?(this.B=xi,this.A=BigInt(t)):(this.B=vi,this.A=t)}nt.prototype.get=function(t){const n=this.index[this.B(t)];return n&&n.get(t)},nt.prototype.set=function(t,n){var r=this.B(t);let e=this.index[r];e?(r=e.size,e.set(t,n),(r-=e.size)&&this.size++):(this.index[r]=e=new Map([[t,n]]),this.h.push(e),this.size++)};function rt(t=8){if(!this||this.constructor!==rt)return new rt(t);this.index=H(),this.h=[],this.size=0,t>32?(this.B=xi,this.A=BigInt(t)):(this.B=vi,this.A=t)}rt.prototype.add=function(t){var n=this.B(t);let r=this.index[n];r?(n=r.size,r.add(t),(n-=r.size)&&this.size++):(this.index[n]=r=new Set([t]),this.h.push(r),this.size++)},S=nt.prototype,S.has=rt.prototype.has=function(t){const n=this.index[this.B(t)];return n&&n.has(t)},S.delete=rt.prototype.delete=function(t){const n=this.index[this.B(t)];n&&n.delete(t)&&this.size--},S.clear=rt.prototype.clear=function(){this.index=H(),this.h=[],this.size=0},S.values=rt.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].values())yield n},S.keys=rt.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].keys())yield n},S.entries=rt.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let n of this.h[t].entries())yield n};function vi(t){let n=2**this.A-1;if(typeof t=="number")return t&n;let r=0,e=this.A+1;for(let i=0;i<t.length;i++)r=(r*e^t.charCodeAt(i))&n;return this.A===32?r+2**31:r}function xi(t){let n=BigInt(2)**this.A-BigInt(1);var r=typeof t;if(r==="bigint")return t&n;if(r==="number")return BigInt(t)&n;r=BigInt(0);let e=this.A+BigInt(1);for(let i=0;i<t.length;i++)r=(r*e^BigInt(t.charCodeAt(i)))&n;return r}let Mt,Lt;async function $n(t){t=t.data;var n=t.task;const r=t.id;let e=t.args;if(n==="init")Lt=t.options||{},(n=t.factory)?(Function("return "+n)()(self),Mt=new self.FlexSearch.Index(Lt),delete self.FlexSearch):Mt=new at(Lt),postMessage({id:r});else{let i;n==="export"&&(e[1]?(e[0]=Lt.export,e[2]=0,e[3]=1):e=null),n==="import"?e[0]&&(t=await Lt.import.call(Mt,e[0]),Mt.import(e[0],t)):((i=e&&Mt[n].apply(Mt,e))&&i.then&&(i=await i),i&&i.await&&(i=await i.await),n==="search"&&i.result&&(i=i.result)),postMessage(n==="search"?{id:r,msg:i}:{id:r})}}function Ve(t){zt.call(t,"add"),zt.call(t,"append"),zt.call(t,"search"),zt.call(t,"update"),zt.call(t,"remove"),zt.call(t,"searchCache")}let Ee,yi,$t;function tr(){Ee=$t=0}function zt(t){this[t+"Async"]=function(){const n=arguments;var r=n[n.length-1];let e;if(typeof r=="function"&&(e=r,delete n[n.length-1]),Ee?$t||($t=Date.now()-yi>=this.priority*this.priority*3):(Ee=setTimeout(tr,0),yi=Date.now()),$t){const a=this;return new Promise(s=>{setTimeout(function(){s(a[t+"Async"].apply(a,n))},0)})}const i=this[t].apply(this,n);return r=i.then?i:new Promise(a=>a(i)),e&&r.then(e),r}}let mt=0;function Rt(t={},n){function r(o){function l(u){u=u.data||u;const c=u.id,p=c&&a.h[c];p&&(p(u.msg),delete a.h[c])}if(this.worker=o,this.h=H(),this.worker)return i?this.worker.on("message",l):this.worker.onmessage=l,t.config?new Promise(function(u){mt>1e9&&(mt=0),a.h[++mt]=function(){u(a)},a.worker.postMessage({id:mt,task:"init",factory:e,options:t})}):(this.priority=t.priority||4,this.encoder=n||null,this.worker.postMessage({task:"init",factory:e,options:t}),this)}if(!this||this.constructor!==Rt)return new Rt(t);let e=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;e&&(e=e.toString());const i=typeof window>"u",a=this,s=er(e,i,t.worker);return s.then?s.then(function(o){return r.call(a,o)}):r.call(this,s)}gt("add"),gt("append"),gt("search"),gt("update"),gt("remove"),gt("clear"),gt("export"),gt("import"),Rt.prototype.searchCache=ke,Ve(Rt.prototype);function gt(t){Rt.prototype[t]=function(){const n=this,r=[].slice.call(arguments);var e=r[r.length-1];let i;return typeof e=="function"&&(i=e,r.pop()),e=new Promise(function(a){t==="export"&&typeof r[0]=="function"&&(r[0]=null),mt>1e9&&(mt=0),n.h[++mt]=a,n.worker.postMessage({task:t,id:mt,args:r})}),i?(e.then(i),this):e}}function er(t,n,r){return n?typeof module<"u"?new(require("worker_threads")).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(function(){return xr}).then(function(e){return new e.Worker("undefined/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+$n.toString()],{type:"text/javascript"}))):new window.Worker(typeof r=="string"?r:self.location.href.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}_t.prototype.add=function(t,n,r){if(Bt(t)&&(n=t,t=Nt(n,this.key)),n&&(t||t===0)){if(!r&&this.reg.has(t))return this.update(t,n);for(let o=0,l;o<this.field.length;o++){l=this.B[o];var e=this.index.get(this.field[o]);if(typeof l=="function"){var i=l(n);i&&e.add(t,i,r,!0)}else i=l.G,(!i||i(n))&&(l.constructor===String?l=[""+l]:it(l)&&(l=[l]),Fe(n,l,this.D,0,e,t,l[0],r))}if(this.tag)for(e=0;e<this.A.length;e++){var a=this.A[e];i=this.tag.get(this.F[e]);let o=H();if(typeof a=="function"){if(a=a(n),!a)continue}else{var s=a.G;if(s&&!s(n))continue;a.constructor===String&&(a=""+a),a=Nt(n,a)}if(i&&a){it(a)&&(a=[a]);for(let l=0,u,c;l<a.length;l++)if(u=a[l],!o[u]&&(o[u]=1,(s=i.get(u))?c=s:i.set(u,c=[]),!r||!c.includes(t))){if(c.length===2**31-1){if(s=new At(c),this.fastupdate)for(let p of this.reg.values())p.includes(c)&&(p[p.indexOf(c)]=s);i.set(u,c=s)}c.push(t),this.fastupdate&&((s=this.reg.get(t))?s.push(c):this.reg.set(t,[c]))}}}if(this.store&&(!r||!this.store.has(t))){let o;if(this.h){o=H();for(let l=0,u;l<this.h.length;l++){if(u=this.h[l],(r=u.G)&&!r(n))continue;let c;if(typeof u=="function"){if(c=u(n),!c)continue;u=[u.O]}else if(it(u)||u.constructor===String){o[u]=n[u];continue}Se(n,o,u,0,u[0],c)}}this.store.set(t,o||n)}this.worker&&(this.fastupdate||this.reg.add(t))}return this};function Se(t,n,r,e,i,a){if(t=t[i],e===r.length-1)n[i]=a||t;else if(t)if(t.constructor===Array)for(n=n[i]=Array(t.length),i=0;i<t.length;i++)Se(t,n,r,e,i);else n=n[i]||(n[i]=H()),i=r[++e],Se(t,n,r,e,i)}function Fe(t,n,r,e,i,a,s,o){if(t=t[s])if(e===n.length-1){if(t.constructor===Array){if(r[e]){for(n=0;n<t.length;n++)i.add(a,t[n],!0,!0);return}t=t.join(" ")}i.add(a,t,o,!0)}else if(t.constructor===Array)for(s=0;s<t.length;s++)Fe(t,n,r,e,i,a,s,o);else s=n[++e],Fe(t,n,r,e,i,a,s,o)}function Oe(t,n,r,e){if(!t.length)return t;if(t.length===1)return t=t[0],t=r||t.length>n?t.slice(r,r+n):t,e?It.call(this,t):t;let i=[];for(let a=0,s,o;a<t.length;a++)if((s=t[a])&&(o=s.length)){if(r){if(r>=o){r-=o;continue}s=s.slice(r,r+n),o=s.length,r=0}if(o>n&&(s=s.slice(0,n),o=n),!i.length&&o>=n)return e?It.call(this,s):s;if(i.push(s),n-=o,!n)break}return i=i.length>1?[].concat.apply([],i):i[0],e?It.call(this,i):i}function te(t,n,r,e){var i=e[0];if(i[0]&&i[0].query)return t[n].apply(t,i);if(!(n!=="and"&&n!=="not"||t.result.length||t.await||i.suggest))return e.length>1&&(i=e[e.length-1]),(e=i.resolve)?t.await||t.result:t;let a=[],s=0,o=0,l,u,c,p,g;for(n=0;n<e.length;n++)if(i=e[n]){var f=void 0;if(i.constructor===B)f=i.await||i.result;else if(i.then||i.constructor===Array)f=i;else{s=i.limit||0,o=i.offset||0,c=i.suggest,u=i.resolve,l=((p=i.highlight||t.highlight)||i.enrich)&&u,f=i.queue;let v=i.async||f,m=i.index,d=i.query;if(m?t.index||(t.index=m):m=t.index,d||i.tag){const y=i.field||i.pluck;if(y&&(!d||t.query&&!p||(t.query=d,t.field=y,t.highlight=p),m=m.index.get(y)),f&&(g||t.await)){g=1;let x;const k=t.C.length,b=new Promise(function(E){x=E});(function(E,M){b.h=function(){M.index=null,M.resolve=!1;let A=v?E.searchAsync(M):E.search(M);return A.then?A.then(function(w){return t.C[k]=w=w.result||w,x(w),w}):(A=A.result||A,x(A),A)}})(m,Object.assign({},i)),t.C.push(b),a[n]=b;continue}else i.resolve=!1,i.index=null,f=v?m.searchAsync(i):m.search(i),i.resolve=u,i.index=m}else if(i.and)f=ee(i,"and",m);else if(i.or)f=ee(i,"or",m);else if(i.not)f=ee(i,"not",m);else if(i.xor)f=ee(i,"xor",m);else continue}f.await?(g=1,f=f.await):f.then?(g=1,f=f.then(function(v){return v.result||v})):f=f.result||f,a[n]=f}if(g&&!t.await&&(t.await=new Promise(function(v){t.return=v})),g){const v=Promise.all(a).then(function(m){for(let d=0;d<t.C.length;d++)if(t.C[d]===v){t.C[d]=function(){return r.call(t,m,s,o,l,u,c,p)};break}Ae(t)});t.C.push(v)}else if(t.await)t.C.push(function(){return r.call(t,a,s,o,l,u,c,p)});else return r.call(t,a,s,o,l,u,c,p);return u?t.await||t.result:t}function ee(t,n,r){t=t[n];const e=t[0]||t;return e.index||(e.index=r),r=new B(e),t.length>1&&(r=r[n].apply(r,t.slice(1))),r}B.prototype.or=function(){return te(this,"or",ir,arguments)};function ir(t,n,r,e,i,a,s){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=bi(t,n,r,!1,this.h),r=0)),i&&(this.await=null),i?this.resolve(n,r,e,s):this}B.prototype.and=function(){return te(this,"and",nr,arguments)};function nr(t,n,r,e,i,a,s){if(!a&&!this.result.length)return i?this.result:this;let o;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let l=0;for(let u=0,c,p;u<t.length;u++)if((c=t[u])&&(p=c.length))l<p&&(l=p);else if(!a){l=0;break}l?(this.result=ne(t,l,n,r,a,this.h,i),o=!0):this.result=[]}else a||(this.result=t);return i&&(this.await=null),i?this.resolve(n,r,e,s,o):this}B.prototype.xor=function(){return te(this,"xor",rr,arguments)};function rr(t,n,r,e,i,a,s){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{a=r;var o=this.h;const l=[],u=H();let c=0;for(let p=0,g;p<t.length;p++)if(g=t[p]){c<g.length&&(c=g.length);for(let f=0,v;f<g.length;f++)if(v=g[f])for(let m=0,d;m<v.length;m++)d=v[m],u[d]=u[d]?2:1}for(let p=0,g,f=0;p<c;p++)for(let v=0,m;v<t.length;v++)if((m=t[v])&&(g=m[p])){for(let d=0,y;d<g.length;d++)if(y=g[d],u[y]===1)if(a)a--;else if(i){if(l.push(y),l.length===n){t=l;break t}}else{const x=p+(v?o:0);if(l[x]||(l[x]=[]),l[x].push(y),++f===n){t=l;break t}}}t=l}this.result=t,o=!0}else a||(this.result=t);return i&&(this.await=null),i?this.resolve(n,r,e,s,o):this}B.prototype.not=function(){return te(this,"not",ar,arguments)};function ar(t,n,r,e,i,a,s){if(!a&&!this.result.length)return i?this.result:this;if(t.length&&this.result.length){t:{a=r;var o=[];t=new Set(t.flat().flat());for(let l=0,u,c=0;l<this.result.length;l++)if(u=this.result[l]){for(let p=0,g;p<u.length;p++)if(g=u[p],!t.has(g)){if(a)a--;else if(i){if(o.push(g),o.length===n){t=o;break t}}else if(o[l]||(o[l]=[]),o[l].push(g),++c===n){t=o;break t}}}t=o}this.result=t,o=!0}return i&&(this.await=null),i?this.resolve(n,r,e,s,o):this}function ie(t,n,r,e,i){let a,s,o;typeof i=="string"?(a=i,i=""):a=i.template,s=a.indexOf("$1"),o=a.substring(s+2),s=a.substring(0,s);let l=i&&i.boundary,u=!i||i.clip!==!1,c=i&&i.merge&&o&&s&&new RegExp(o+" "+s,"g");i=i&&i.ellipsis;var p=0;if(typeof i=="object"){var g=i.template;p=g.length-2,i=i.pattern}typeof i!="string"&&(i=i===!1?"":"..."),p&&(i=g.replace("$1",i)),g=i.length-p;let f,v;typeof l=="object"&&(f=l.before,f===0&&(f=-1),v=l.after,v===0&&(v=-1),l=l.total||9e5),p=new Map;for(let R=0,_,Jt,pt;R<n.length;R++){let ft;if(e)ft=n,pt=e;else{var m=n[R];if(pt=m.field,!pt)continue;ft=m.result}Jt=r.get(pt),_=Jt.encoder,m=p.get(_),typeof m!="string"&&(m=_.encode(t),p.set(_,m));for(let xt=0;xt<ft.length;xt++){var d=ft[xt].doc;if(!d||(d=Nt(d,pt),!d))continue;var y=d.trim().split(/\s+/);if(!y.length)continue;d="";var x=[];let Vt=[];for(var k=-1,b=-1,E=0,M=0;M<y.length;M++){var A=y[M],w=_.encode(A);w=w.length>1?w.join(" "):w[0];let O;if(w&&A){for(var F=A.length,T=(_.split?A.replace(_.split,""):A).length-w.length,I="",N=0,J=0;J<m.length;J++){var G=m[J];if(G){var W=G.length;W+=T<0?0:T,N&&W<=N||(G=w.indexOf(G),G>-1&&(I=(G?A.substring(0,G):"")+s+A.substring(G,G+W)+o+(G+W<F?A.substring(G+W):""),N=W,O=!0))}}I&&(l&&(k<0&&(k=d.length+(d?1:0)),b=d.length+(d?1:0)+I.length,E+=F,Vt.push(x.length),x.push({match:I})),d+=(d?" ":"")+I)}if(!O)A=y[M],d+=(d?" ":"")+A,l&&x.push({text:A});else if(l&&E>=l)break}if(E=Vt.length*(a.length-2),f||v||l&&d.length-E>l)if(E=l+E-g*2,M=b-k,f>0&&(M+=f),v>0&&(M+=v),M<=E)y=f?k-(f>0?f:0):k-((E-M)/2|0),x=v?b+(v>0?v:0):y+E,u||(y>0&&d.charAt(y)!==" "&&d.charAt(y-1)!==" "&&(y=d.indexOf(" ",y),y<0&&(y=0)),x<d.length&&d.charAt(x-1)!==" "&&d.charAt(x)!==" "&&(x=d.lastIndexOf(" ",x),x<b?x=b:++x)),d=(y?i:"")+d.substring(y,x)+(x<d.length?i:"");else{for(b=[],k={},E={},M={},A={},w={},I=T=F=0,J=N=1;;){var $=void 0;for(let O=0,L;O<Vt.length;O++){if(L=Vt[O],I)if(T!==I){if(M[O+1])continue;if(L+=I,k[L]){F-=g,E[O+1]=1,M[O+1]=1;continue}if(L>=x.length-1){if(L>=x.length){M[O+1]=1,L>=y.length&&(E[O+1]=1);continue}F-=g}if(d=x[L].text,W=v&&w[O])if(W>0){if(d.length>W)if(M[O+1]=1,u)d=d.substring(0,W);else continue;(W-=d.length)||(W=-1),w[O]=W}else{M[O+1]=1;continue}if(F+d.length+1<=l)d=" "+d,b[O]+=d;else if(u)$=l-F-1,$>0&&(d=" "+d.substring(0,$),b[O]+=d),M[O+1]=1;else{M[O+1]=1;continue}}else{if(M[O])continue;if(L-=T,k[L]){F-=g,M[O]=1,E[O]=1;continue}if(L<=0){if(L<0){M[O]=1,E[O]=1;continue}F-=g}if(d=x[L].text,W=f&&A[O])if(W>0){if(d.length>W)if(M[O]=1,u)d=d.substring(d.length-W);else continue;(W-=d.length)||(W=-1),A[O]=W}else{M[O]=1;continue}if(F+d.length+1<=l)d+=" ",b[O]=d+b[O];else if(u)$=d.length+1-(l-F),$>=0&&$<d.length&&(d=d.substring($)+" ",b[O]=d+b[O]),M[O]=1;else{M[O]=1;continue}}else{d=x[L].match,f&&(A[O]=f),v&&(w[O]=v),O&&F++;let Et;if(L?!O&&g&&(F+=g):(E[O]=1,M[O]=1),L>=y.length-1||L<x.length-1&&x[L+1].match?Et=1:g&&(F+=g),F-=a.length-2,!O||F+d.length<=l)b[O]=d;else{$=N=J=E[O]=0;break}Et&&(E[O+1]=1,M[O+1]=1)}F+=d.length,$=k[L]=1}if($)T===I?I++:T++;else{if(T===I?N=0:J=0,!N&&!J)break;N?(T++,I=T):I++}}d="";for(let O=0,L;O<b.length;O++)L=(E[O]?O?" ":"":(O&&!i?" ":"")+i)+b[O],d+=L;i&&!E[b.length]&&(d+=i)}c&&(d=d.replace(c," ")),ft[xt].highlight=d}if(e)break}return n}function B(t,n){if(!this||this.constructor!==B)return new B(t,n);let r=0,e,i,a,s,o,l;if(t&&t.index){const u=t;if(n=u.index,r=u.boost||0,i=u.query){a=u.field||u.pluck,s=u.highlight;const c=u.resolve;t=u.async||u.queue,u.resolve=!1,u.index=null,t=t?n.searchAsync(u):n.search(u),u.resolve=c,u.index=n,t=t.result||t}else t=[]}if(t&&t.then){const u=this;t=t.then(function(c){u.C[0]=u.result=c.result||c,Ae(u)}),e=[t],t=[],o=new Promise(function(c){l=c})}this.index=n||null,this.result=t||[],this.h=r,this.C=e||[],this.await=o||null,this.return=l||null,this.highlight=s||null,this.query=i||"",this.field=a||""}S=B.prototype,S.limit=function(t){if(this.await){const n=this;this.C.push(function(){return n.limit(t).result})}else if(this.result.length){const n=[];for(let r=0,e;r<this.result.length;r++)if(e=this.result[r])if(e.length<=t){if(n[r]=e,t-=e.length,!t)break}else{n[r]=e.slice(0,t);break}this.result=n}return this},S.offset=function(t){if(this.await){const n=this;this.C.push(function(){return n.offset(t).result})}else if(this.result.length){const n=[];for(let r=0,e;r<this.result.length;r++)(e=this.result[r])&&(e.length<=t?t-=e.length:(n[r]=e.slice(t),t=0));this.result=n}return this},S.boost=function(t){if(this.await){const n=this;this.C.push(function(){return n.boost(t).result})}else this.h+=t;return this};function Ae(t,n){let r=t.result;var e=t.await;t.await=null;for(let i=0,a;i<t.C.length;i++)if(a=t.C[i]){if(typeof a=="function")r=a(),t.C[i]=r=r.result||r,i--;else if(a.h)r=a.h(),t.C[i]=r=r.result||r,i--;else if(a.then)return t.await=e}return e=t.return,t.C=[],t.return=null,n||e(r),r}S.resolve=function(t,n,r,e,i){let a=this.await?Ae(this,!0):this.result;if(a.then){const s=this;return a.then(function(){return s.resolve(t,n,r,e,i)})}return a.length&&(typeof t=="object"?(e=t.highlight||this.highlight,r=!!e||t.enrich,n=t.offset,t=t.limit):(e=e||this.highlight,r=!!e||r),a=i?r?It.call(this.index,a):a:Oe.call(this.index,a,t||100,n,r)),this.finalize(a,e)},S.finalize=function(t,n){if(t.then){const e=this;return t.then(function(i){return e.finalize(i,n)})}n&&t.length&&this.query&&(t=ie(this.query,t,this.index.index,this.field,n));const r=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",r&&r(t),t};function ne(t,n,r,e,i,a,s){const o=t.length;let l=[],u,c;u=H();for(let p=0,g,f,v,m;p<n;p++)for(let d=0;d<o;d++)if(v=t[d],p<v.length&&(g=v[p]))for(let y=0;y<g.length;y++){if(f=g[y],(c=u[f])?u[f]++:(c=0,u[f]=1),m=l[c]||(l[c]=[]),!s){let x=p+(d||!i?0:a||0);m=m[x]||(m[x]=[])}if(m.push(f),s&&r&&c===o-1&&m.length-e===r)return e?m.slice(e):m}if(t=l.length)if(i)l=l.length>1?bi(l,r,e,s,a):(l=l[0])&&r&&l.length>r||e?l.slice(e,r+e):l;else{if(t<o)return[];if(l=l[t-1],r||e)if(s)(l.length>r||e)&&(l=l.slice(e,r+e));else{i=[];for(let p=0,g;p<l.length;p++)if(g=l[p]){if(e&&g.length>e)e-=g.length;else if((r&&g.length>r||e)&&(g=g.slice(e,r+e),r-=g.length,e&&(e-=g.length)),i.push(g),!r)break}l=i}}return l}function bi(t,n,r,e,i){const a=[],s=H();let o;var l=t.length;let u;if(e){for(i=l-1;i>=0;i--)if(u=(e=t[i])&&e.length){for(l=0;l<u;l++)if(o=e[l],!s[o]){if(s[o]=1,r)r--;else if(a.push(o),a.length===n)return a}}}else for(let c=l-1,p,g=0;c>=0;c--){p=t[c];for(let f=0;f<p.length;f++)if(u=(e=p[f])&&e.length){for(let v=0;v<u;v++)if(o=e[v],!s[o])if(s[o]=1,r)r--;else{let m=(f+(c<l-1&&i||0))/(c+1)|0;if((a[m]||(a[m]=[])).push(o),++g===n)return a}}}return a}function sr(t,n,r,e,i){const a=H(),s=[];for(let o=0,l;o<n.length;o++){l=n[o];for(let u=0;u<l.length;u++)a[l[u]]=1}if(i){for(let o=0,l;o<t.length;o++)if(l=t[o],a[l]){if(e)e--;else if(s.push(l),a[l]=0,r&&--r===0)break}}else for(let o=0,l,u;o<t.result.length;o++)for(l=t.result[o],n=0;n<l.length;n++)u=l[n],a[u]&&((s[o]||(s[o]=[])).push(u),a[u]=0);return s}_t.prototype.search=function(t,n,r,e){r||(!n&&Bt(t)?(r=t,t=""):Bt(n)&&(r=n,n=0));let i=[];var a=[];let s,o,l,u,c,p,g=0,f=!0,v;if(r){r.constructor===Array&&(r={index:r}),t=r.query||t,s=r.pluck,o=r.merge,u=r.boost,p=s||r.field||(p=r.index)&&(p.index?null:p);var m=this.tag&&r.tag;l=r.suggest,f=r.resolve!==!1,c=r.cache,v=f&&this.store&&r.highlight;var d=!!v||f&&this.store&&r.enrich;n=r.limit||n;var y=r.offset||0;if(n||(n=f?100:0),m&&(!this.db||!e)){m.constructor!==Array&&(m=[m]);var x=[];for(let A=0,w;A<m.length;A++)if(w=m[A],w.field&&w.tag){var k=w.tag;if(k.constructor===Array)for(var b=0;b<k.length;b++)x.push(w.field,k[b]);else x.push(w.field,k)}else{k=Object.keys(w);for(let F=0,T,I;F<k.length;F++)if(T=k[F],I=w[T],I.constructor===Array)for(b=0;b<I.length;b++)x.push(T,I[b]);else x.push(T,I)}if(m=x,!t){if(a=[],x.length)for(m=0;m<x.length;m+=2){if(this.db){if(e=this.index.get(x[m]),!e)continue;a.push(e=e.db.tag(x[m+1],n,y,d))}else e=or.call(this,x[m],x[m+1],n,y,d);i.push(f?{field:x[m],tag:x[m+1],result:e}:[e])}if(a.length){const A=this;return Promise.all(a).then(function(w){for(let F=0;F<w.length;F++)f?i[F].result=w[F]:i[F]=w[F];return f?i:new B(i.length>1?ne(i,1,0,0,l,u):i[0],A)})}return f?i:new B(i.length>1?ne(i,1,0,0,l,u):i[0],this)}}f||s||!(p=p||this.field)||(it(p)?s=p:(p.constructor===Array&&p.length===1&&(p=p[0]),s=p.field||p.index)),p&&p.constructor!==Array&&(p=[p])}p||(p=this.field);let E;x=(this.worker||this.db)&&!e&&[];for(let A=0,w,F,T;A<p.length;A++){if(F=p[A],this.db&&this.tag&&!this.B[A])continue;let I;if(it(F)||(I=F,F=I.field,t=I.query||t,n=Ot(I.limit,n),y=Ot(I.offset,y),l=Ot(I.suggest,l),v=f&&this.store&&Ot(I.highlight,v),d=!!v||f&&this.store&&Ot(I.enrich,d),c=Ot(I.cache,c)),e)w=e[A];else{k=I||r||{},b=k.enrich;var M=this.index.get(F);if(m&&(this.db&&(k.tag=m,k.field=p,E=M.db.support_tag_search),!E&&b&&(k.enrich=!1),E||(k.limit=0,k.offset=0)),w=c?M.searchCache(t,m&&!E?0:n,k):M.search(t,m&&!E?0:n,k),m&&!E&&(k.limit=n,k.offset=y),b&&(k.enrich=b),x){x[A]=w;continue}}if(T=(w=w.result||w)&&w.length,m&&T){if(k=[],b=0,this.db&&e){if(!E)for(M=p.length;M<e.length;M++){let N=e[M];if(N&&N.length)b++,k.push(N);else if(!l)return f?i:new B(i,this)}}else for(let N=0,J,G;N<m.length;N+=2){if(J=this.tag.get(m[N]),!J){if(l)continue;return f?i:new B(i,this)}if(G=(J=J&&J.get(m[N+1]))&&J.length)b++,k.push(J);else if(!l)return f?i:new B(i,this)}if(b){if(w=sr(w,k,n,y,f),T=w.length,!T&&!l)return f?w:new B(w,this);b--}}if(T)a[g]=F,i.push(w),g++;else if(p.length===1)return f?i:new B(i,this)}if(x){if(this.db&&m&&m.length&&!E)for(d=0;d<m.length;d+=2){if(a=this.index.get(m[d]),!a){if(l)continue;return f?i:new B(i,this)}x.push(a.db.tag(m[d+1],n,y,!1))}const A=this;return Promise.all(x).then(function(w){return r&&(r.resolve=f),w.length&&(w=A.search(t,n,r,w)),w})}if(!g)return f?i:new B(i,this);if(s&&(!d||!this.store))return i=i[0],f?i:new B(i,this);for(x=[],y=0;y<a.length;y++){if(m=i[y],d&&m.length&&typeof m[0].doc>"u"&&(this.db?x.push(m=this.index.get(this.field[0]).db.enrich(m)):m=It.call(this,m)),s)return f?v?ie(t,m,this.index,s,v):m:new B(m,this);i[y]={field:a[y],result:m}}if(d&&this.db&&x.length){const A=this;return Promise.all(x).then(function(w){for(let F=0;F<w.length;F++)i[F].result=w[F];return v&&(i=ie(t,i,A.index,s,v)),o?wi(i):i})}return v&&(i=ie(t,i,this.index,s,v)),o?wi(i):i};function wi(t){const n=[],r=H(),e=H();for(let i=0,a,s,o,l,u,c,p;i<t.length;i++){a=t[i],s=a.field,o=a.result;for(let g=0;g<o.length;g++)u=o[g],typeof u!="object"?u={id:l=u}:l=u.id,(c=r[l])?c.push(s):(u.field=r[l]=[s],n.push(u)),(p=u.highlight)&&(c=e[l],c||(e[l]=c={},u.highlight=c),c[s]=p)}return n}function or(t,n,r,e,i){return t=this.tag.get(t),t?(t=t.get(n),t?(n=t.length-e,n>0&&((r&&n>r||e)&&(t=t.slice(e,e+r)),i&&(t=It.call(this,t))),t):[]):[]}function It(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const n=Array(t.length);for(let r=0,e;r<t.length;r++)e=t[r],n[r]={id:e,doc:this.store.get(e)};return n}function _t(t){if(!this||this.constructor!==_t)return new _t(t);const n=t.document||t.doc||t;let r,e;if(this.B=[],this.field=[],this.D=[],this.key=(r=n.key||n.id)&&re(r,this.D)||"id",(e=t.keystore||0)&&(this.keystore=e),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?e?new rt(e):new Set:e?new nt(e):new Map,this.h=(r=n.store||null)&&r&&r!==!0&&[],this.store=r?e?new nt(e):new Map:null,this.cache=(r=t.cache||null)&&new kt(r),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=lr.call(this,t,n),this.tag=null,(r=n.tag)&&(typeof r=="string"&&(r=[r]),r.length)){this.tag=new Map,this.A=[],this.F=[];for(let i=0,a,s;i<r.length;i++){if(a=r[i],s=a.field||a,!s)throw Error("The tag field from the document descriptor is undefined.");a.custom?this.A[i]=a.custom:(this.A[i]=re(s,this.D),a.filter&&(typeof this.A[i]=="string"&&(this.A[i]=new String(this.A[i])),this.A[i].G=a.filter)),this.F[i]=s,this.tag.set(s,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const i of this.index.values())i.then&&t.push(i);if(t.length){const i=this;return Promise.all(t).then(function(a){let s=0;for(const o of i.index.entries()){const l=o[0];let u=o[1];u.then&&(u=a[s],i.index.set(l,u),s++)}return i})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}S=_t.prototype,S.mount=function(t){let n=this.field;if(this.tag)for(let a=0,s;a<this.F.length;a++){s=this.F[a];var r=void 0;this.index.set(s,r=new at({},this.reg)),n===this.field&&(n=n.slice(0)),n.push(s),r.tag=this.tag.get(s)}r=[];const e={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let a=0,s,o;a<n.length;a++){e.field=o=n[a],s=this.index.get(o);const l=new t.constructor(t.id,e);l.id=t.id,r[a]=l.mount(s),s.document=!0,a?s.bypass=!0:s.store=this.store}const i=this;return this.db=Promise.all(r).then(function(){i.db=!0})},S.commit=async function(){const t=[];for(const n of this.index.values())t.push(n.commit());await Promise.all(t),this.reg.clear()},S.destroy=function(){const t=[];for(const n of this.index.values())t.push(n.destroy());return Promise.all(t)};function lr(t,n){const r=new Map;let e=n.index||n.field||n;it(e)&&(e=[e]);for(let a=0,s,o;a<e.length;a++){if(s=e[a],it(s)||(o=s,s=s.field),o=Bt(o)?Object.assign({},t,o):t,this.worker){var i=void 0;i=(i=o.encoder)&&i.encode?i:new Wt(typeof i=="string"?mi[i]:i||{}),i=new Rt(o,i),r.set(s,i)}this.worker||r.set(s,new at(o,this.reg)),o.custom?this.B[a]=o.custom:(this.B[a]=re(s,this.D),o.filter&&(typeof this.B[a]=="string"&&(this.B[a]=new String(this.B[a])),this.B[a].G=o.filter)),this.field[a]=s}if(this.h){t=n.store,it(t)&&(t=[t]);for(let a=0,s,o;a<t.length;a++)s=t[a],o=s.field||s,s.custom?(this.h[a]=s.custom,s.custom.O=o):(this.h[a]=re(o,this.D),s.filter&&(typeof this.h[a]=="string"&&(this.h[a]=new String(this.h[a])),this.h[a].G=s.filter))}return r}function re(t,n){const r=t.split(":");let e=0;for(let i=0;i<r.length;i++)t=r[i],t[t.length-1]==="]"&&(t=t.substring(0,t.length-2))&&(n[e]=!0),t&&(r[e++]=t);return e<r.length&&(r.length=e),e>1?r:r[0]}S.append=function(t,n){return this.add(t,n,!0)},S.update=function(t,n){return this.remove(t).add(t,n)},S.remove=function(t){Bt(t)&&(t=Nt(t,this.key));for(var n of this.index.values())n.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let r of this.tag.values())for(let e of r){n=e[0];const i=e[1],a=i.indexOf(t);a>-1&&(i.length>1?i.splice(a,1):r.delete(n))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},S.clear=function(){const t=[];for(const n of this.index.values()){const r=n.clear();r.then&&t.push(r)}if(this.tag)for(const n of this.tag.values())n.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},S.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},S.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},S.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(n){return n[0]&&n[0].doc||null}):this.store.get(t)||null},S.set=function(t,n){return typeof t=="object"&&(n=t,t=Nt(n,this.key)),this.store.set(t,n),this},S.searchCache=ke,S.export=ur,S.import=cr,Ve(_t.prototype);function Me(t,n=0){let r=[],e=[];n&&(n=25e4/n*5e3|0);for(const i of t.entries())e.push(i),e.length===n&&(r.push(e),e=[]);return e.length&&r.push(e),r}function ze(t,n){n||(n=new Map);for(let r=0,e;r<t.length;r++)e=t[r],n.set(e[0],e[1]);return n}function ki(t,n=0){let r=[],e=[];n&&(n=25e4/n*1e3|0);for(const i of t.entries())e.push([i[0],Me(i[1])[0]||[]]),e.length===n&&(r.push(e),e=[]);return e.length&&r.push(e),r}function ji(t,n){n||(n=new Map);for(let r=0,e,i;r<t.length;r++)e=t[r],i=n.get(e[0]),n.set(e[0],ze(e[1],i));return n}function Vi(t){let n=[],r=[];for(const e of t.keys())r.push(e),r.length===25e4&&(n.push(r),r=[]);return r.length&&n.push(r),n}function Ei(t,n){n||(n=new Set);for(let r=0;r<t.length;r++)n.add(t[r]);return n}function ae(t,n,r,e,i,a,s=0){const o=e&&e.constructor===Array;var l=o?e.shift():e;if(!l)return this.export(t,n,i,a+1);if((l=t((n?n+".":"")+(s+1)+"."+r,JSON.stringify(l)))&&l.then){const u=this;return l.then(function(){return ae.call(u,t,n,r,o?e:null,i,a,s+1)})}return ae.call(this,t,n,r,o?e:null,i,a,s+1)}function ur(t,n,r=0,e=0){if(r<this.field.length){const s=this.field[r];if((n=this.index.get(s).export(t,s,r,e=1))&&n.then){const o=this;return n.then(function(){return o.export(t,s,r+1)})}return this.export(t,s,r+1)}let i,a;switch(e){case 0:i="reg",a=Vi(this.reg),n=null;break;case 1:i="tag",a=this.tag&&ki(this.tag,this.reg.size),n=null;break;case 2:i="doc",a=this.store&&Me(this.store),n=null;break;default:return}return ae.call(this,t,n,i,a||null,r,e)}function cr(t,n){var r=t.split(".");r[r.length-1]==="json"&&r.pop();const e=r.length>2?r[0]:"";if(r=r.length>2?r[2]:r[1],this.worker&&e)return this.index.get(e).import(t);if(n){if(typeof n=="string"&&(n=JSON.parse(n)),e)return this.index.get(e).import(r,n);switch(r){case"reg":this.fastupdate=!1,this.reg=Ei(n,this.reg);for(let i=0,a;i<this.field.length;i++)a=this.index.get(this.field[i]),a.fastupdate=!1,a.reg=this.reg;if(this.worker){n=[];for(const i of this.index.values())n.push(i.import(t));return Promise.all(n)}break;case"tag":this.tag=ji(n,this.tag);break;case"doc":this.store=ze(n,this.store)}}}function Si(t,n){let r="";for(const e of t.entries()){t=e[0];const i=e[1];let a="";for(let s=0,o;s<i.length;s++){o=i[s]||[""];let l="";for(let u=0;u<o.length;u++)l+=(l?",":"")+(n==="string"?'"'+o[u]+'"':o[u]);l="["+l+"]",a+=(a?",":"")+l}a='["'+t+'",['+a+"]]",r+=(r?",":"")+a}return r}at.prototype.remove=function(t,n){const r=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(r){if(this.fastupdate){for(let e=0,i,a;e<r.length;e++)if((i=r[e])&&(a=i.length))if(i[a-1]===t)i.pop();else{const s=i.indexOf(t);s>=0&&i.splice(s,1)}}else Ht(this.map,t),this.depth&&Ht(this.ctx,t);n||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&Mi(this)),this.cache&&this.cache.remove(t),this};function Ht(t,n){let r=0;var e=typeof n>"u";if(t.constructor===Array){for(let i=0,a,s,o;i<t.length;i++)if((a=t[i])&&a.length){if(e)return 1;if(s=a.indexOf(n),s>=0){if(a.length>1)return a.splice(s,1),1;if(delete t[i],r)return 1;o=1}else{if(o)return 1;r++}}}else for(let i of t.entries())e=i[0],Ht(i[1],n)?r++:t.delete(e);return r}const pr={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};at.prototype.add=function(t,n,r,e){if(n&&(t||t===0)){if(!e&&!r&&this.reg.has(t))return this.update(t,n);e=this.depth,n=this.encoder.encode(n,!e);const u=n.length;if(u){const c=H(),p=H(),g=this.resolution;for(let f=0;f<u;f++){let v=n[this.rtl?u-1-f:f];var i=v.length;if(i&&(e||!p[v])){var a=this.score?this.score(n,v,f,null,0):se(g,u,f),s="";switch(this.tokenize){case"tolerant":if(ct(this,p,v,a,t,r),i>2){for(let m=1,d,y,x,k;m<i-1;m++)d=v.charAt(m),y=v.charAt(m+1),x=v.substring(0,m)+y,k=v.substring(m+2),s=x+d+k,ct(this,p,s,a,t,r),s=x+k,ct(this,p,s,a,t,r);ct(this,p,v.substring(0,v.length-1),a,t,r)}break;case"full":if(i>2){for(let m=0,d;m<i;m++)for(a=i;a>m;a--){s=v.substring(m,a),d=this.rtl?i-1-m:m;var o=this.score?this.score(n,v,f,s,d):se(g,u,f,i,d);ct(this,p,s,o,t,r)}break}case"bidirectional":case"reverse":if(i>1){for(o=i-1;o>0;o--){s=v[this.rtl?i-1-o:o]+s;var l=this.score?this.score(n,v,f,s,o):se(g,u,f,i,o);ct(this,p,s,l,t,r)}s=""}case"forward":if(i>1){for(o=0;o<i;o++)s+=v[this.rtl?i-1-o:o],ct(this,p,s,a,t,r);break}default:if(ct(this,p,v,a,t,r),e&&u>1&&f<u-1)for(i=this.N,s=v,a=Math.min(e+1,this.rtl?f+1:u-f),o=1;o<a;o++){v=n[this.rtl?u-1-f-o:f+o],l=this.bidirectional&&v>s;const m=this.score?this.score(n,s,f,v,o-1):se(i+(u/2>i?0:1),u,f,a-1,o-1);ct(this,c,l?s:v,m,t,r,l?v:s)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(r?{ins:t}:{del:t}),this.M&&Mi(this)),this};function ct(t,n,r,e,i,a,s){let o,l;if(!(o=n[r])||s&&!o[s]){if(s?(n=o||(n[r]=H()),n[s]=1,l=t.ctx,(o=l.get(s))?l=o:l.set(s,l=t.keystore?new nt(t.keystore):new Map)):(l=t.map,n[r]=1),(o=l.get(r))?l=o:l.set(r,l=o=[]),a){for(let u=0,c;u<o.length;u++)if((c=o[u])&&c.includes(i)){if(u<=e)return;c.splice(c.indexOf(i),1),t.fastupdate&&(n=t.reg.get(i))&&n.splice(n.indexOf(c),1);break}}if(l=l[e]||(l[e]=[]),l.push(i),l.length===2**31-1){if(n=new At(l),t.fastupdate)for(let u of t.reg.values())u.includes(l)&&(u[u.indexOf(l)]=n);o[e]=l=n}t.fastupdate&&((e=t.reg.get(i))?e.push(l):t.reg.set(i,[l]))}}function se(t,n,r,e,i){return r&&t>1?n+(e||0)<=t?r+(i||0):(t-1)/(n+(e||0))*(r+(i||0))+1|0:0}at.prototype.search=function(t,n,r){if(r||(n||typeof t!="object"?typeof n=="object"&&(r=n,n=0):(r=t,t="")),r&&r.cache)return r.cache=!1,t=this.searchCache(t,n,r),r.cache=!0,t;let e=[],i,a,s,o=0,l,u,c,p,g;r&&(t=r.query||t,n=r.limit||n,o=r.offset||0,a=r.context,s=r.suggest,g=(l=r.resolve)&&r.enrich,c=r.boost,p=r.resolution,u=this.db&&r.tag),typeof l>"u"&&(l=this.resolve),a=this.depth&&a!==!1;let f=this.encoder.encode(t,!a);if(i=f.length,n=n||(l?100:0),i===1)return Oi.call(this,f[0],"",n,o,l,g,u);if(i===2&&a&&!s)return Oi.call(this,f[1],f[0],n,o,l,g,u);let v=H(),m=0,d;if(a&&(d=f[0],m=1),p||p===0||(p=d?this.N:this.resolution),this.db){if(this.db.search&&(r=this.db.search(this,f,n,o,s,l,g,u),r!==!1))return r;const y=this;return(async function(){for(let x,k;m<i;m++){if((k=f[m])&&!v[k]){if(v[k]=1,x=await Re(y,k,d,0,0,!1,!1),x=Ai(x,e,s,p)){e=x;break}d&&(s&&x&&e.length||(d=k))}s&&d&&m===i-1&&!e.length&&(p=y.resolution,d="",m=-1,v=H())}return Fi(e,p,n,o,s,c,l)})()}for(let y,x;m<i;m++){if((x=f[m])&&!v[x]){if(v[x]=1,y=Re(this,x,d,0,0,!1,!1),y=Ai(y,e,s,p)){e=y;break}d&&(s&&y&&e.length||(d=x))}s&&d&&m===i-1&&!e.length&&(p=this.resolution,d="",m=-1,v=H())}return Fi(e,p,n,o,s,c,l)};function Fi(t,n,r,e,i,a,s){let o=t.length,l=t;if(o>1)l=ne(t,n,r,e,i,a,s);else if(o===1)return s?Oe.call(null,t[0],r,e):new B(t[0],this);return s?l:new B(l,this)}function Oi(t,n,r,e,i,a,s){return t=Re(this,t,n,r,e,i,a,s),this.db?t.then(function(o){return i?o||[]:new B(o,this)}):t&&t.length?i?Oe.call(this,t,r,e):new B(t,this):i?[]:new B([],this)}function Ai(t,n,r,e){let i=[];if(t&&t.length){if(t.length<=e){n.push(t);return}for(let a=0,s;a<e;a++)(s=t[a])&&(i[a]=s);if(i.length){n.push(i);return}}if(!r)return i}function Re(t,n,r,e,i,a,s,o){let l;return r&&(l=t.bidirectional&&n>r)&&(l=r,r=n,n=l),t.db?t.db.get(n,r,e,i,a,s,o):(t=r?(t=t.ctx.get(r))&&t.get(n):t.map.get(n),t)}function at(t,n){if(!this||this.constructor!==at)return new at(t);if(t){var r=it(t)?t:t.preset;r&&(t=Object.assign({},pr[r],t))}else t={};r=t.context;const e=r===!0?{depth:1}:r||{},i=it(t.encoder)?mi[t.encoder]:t.encode||t.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new Wt(i):{encode:i},this.resolution=t.resolution||9,this.tokenize=r=(r=t.tokenize)&&r!=="default"&&r!=="exact"&&r||"strict",this.depth=r==="strict"&&e.depth||0,this.bidirectional=e.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(r=t.keystore||0)&&(this.keystore=r),this.map=r?new nt(r):new Map,this.ctx=r?new nt(r):new Map,this.reg=n||(this.fastupdate?r?new nt(r):new Map:r?new rt(r):new Set),this.N=e.resolution||3,this.rtl=i.rtl||t.rtl||!1,this.cache=(r=t.cache||null)&&new kt(r),this.resolve=t.resolve!==!1,(r=t.db)&&(this.db=this.mount(r)),this.M=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}S=at.prototype,S.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},S.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},S.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function Mi(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}S.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},S.append=function(t,n){return this.add(t,n,!0)},S.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},S.update=function(t,n){const r=this,e=this.remove(t);return e&&e.then?e.then(()=>r.add(t,n)):this.add(t,n)},S.cleanup=function(){return this.fastupdate?(Ht(this.map),this.depth&&Ht(this.ctx),this):this},S.searchCache=ke,S.export=function(t,n,r=0,e=0){let i,a;switch(e){case 0:i="reg",a=Vi(this.reg);break;case 1:i="cfg",a=null;break;case 2:i="map",a=Me(this.map,this.reg.size);break;case 3:i="ctx",a=ki(this.ctx,this.reg.size);break;default:return}return ae.call(this,t,n,i,a,r,e)},S.import=function(t,n){if(n)switch(typeof n=="string"&&(n=JSON.parse(n)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=Ei(n,this.reg);break;case"map":this.map=ze(n,this.map);break;case"ctx":this.ctx=ji(n,this.ctx)}},S.serialize=function(t=!0){let n="",r="",e="";if(this.reg.size){let a;for(var i of this.reg.keys())a||(a=typeof i),n+=(n?",":"")+(a==="string"?'"'+i+'"':i);n="index.reg=new Set(["+n+"]);",r=Si(this.map,a),r="index.map=new Map(["+r+"]);";for(const s of this.ctx.entries()){i=s[0];let o=Si(s[1],a);o="new Map(["+o+"])",o='["'+i+'",'+o+"]",e+=(e?",":"")+o}e="index.ctx=new Map(["+e+"]);"}return t?"function inject(index){"+n+r+e+"}":n+r+e},Ve(at.prototype);const zi=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),oe=["map","ctx","tag","reg","cfg"],jt=H();function Ie(t,n={}){if(!this||this.constructor!==Ie)return new Ie(t,n);typeof t=="object"&&(n=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=n.field?n.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=n.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}S=Ie.prototype,S.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},S.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),jt[t.id]||(jt[t.id]=[]),jt[t.id].push(t.field);const n=zi.open(t.id,1);return n.onupgradeneeded=function(){const r=t.db=this.result;for(let e=0,i;e<oe.length;e++){i=oe[e];for(let a=0,s;a<jt[t.id].length;a++)s=jt[t.id][a],r.objectStoreNames.contains(i+(i!=="reg"&&s?":"+s:""))||r.createObjectStore(i+(i!=="reg"&&s?":"+s:""))}},t.db=vt(n,function(r){t.db=r,t.db.onversionchange=function(){t.close()}})},S.close=function(){this.db&&this.db.close(),this.db=null},S.destroy=function(){const t=zi.deleteDatabase(this.id);return vt(t)},S.clear=function(){const t=[];for(let r=0,e;r<oe.length;r++){e=oe[r];for(let i=0,a;i<jt[this.id].length;i++)a=jt[this.id][i],t.push(e+(e!=="reg"&&a?":"+a:""))}const n=this.db.transaction(t,"readwrite");for(let r=0;r<t.length;r++)n.objectStore(t[r]).clear();return vt(n)},S.get=function(t,n,r=0,e=0,i=!0,a=!1){t=this.db.transaction((n?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((n?"ctx":"map")+(this.field?":"+this.field:"")).get(n?n+":"+t:t);const s=this;return vt(t).then(function(o){let l=[];if(!o||!o.length)return l;if(i){if(!r&&!e&&o.length===1)return o[0];for(let u=0,c;u<o.length;u++)if((c=o[u])&&c.length){if(e>=c.length){e-=c.length;continue}const p=r?e+Math.min(c.length-e,r):c.length;for(let g=e;g<p;g++)l.push(c[g]);if(e=0,l.length===r)break}return a?s.enrich(l):l}return o})},S.tag=function(t,n=0,r=0,e=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const i=this;return vt(t).then(function(a){return!a||!a.length||r>=a.length?[]:!n&&!r?a:(a=a.slice(r,r+n),e?i.enrich(a):a)})},S.enrich=function(t){typeof t!="object"&&(t=[t]);const n=this.db.transaction("reg","readonly").objectStore("reg"),r=[];for(let e=0;e<t.length;e++)r[e]=vt(n.get(t[e]));return Promise.all(r).then(function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e})},S.has=function(t){return t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t),vt(t).then(function(n){return!!n})},S.search=null,S.info=function(){},S.transaction=function(t,n,r){t+=t!=="reg"&&this.field?":"+this.field:"";let e=this.h[t+":"+n];if(e)return r.call(this,e);let i=this.db.transaction(t,n);this.h[t+":"+n]=e=i.objectStore(t);const a=r.call(this,e);return this.h[t+":"+n]=null,vt(i).finally(function(){return a})},S.commit=async function(t){let n=t.commit_task,r=[];t.commit_task=[];for(let e=0,i;e<n.length;e++)i=n[e],i.del&&r.push(i.del);r.length&&await this.remove(r),t.reg.size&&(await this.transaction("map","readwrite",function(e){for(const i of t.map){const a=i[0],s=i[1];s.length&&(e.get(a).onsuccess=function(){let o=this.result;var l;if(o&&o.length){const u=Math.max(o.length,s.length);for(let c=0,p,g;c<u;c++)if((g=s[c])&&g.length){if((p=o[c])&&p.length)for(l=0;l<g.length;l++)p.push(g[l]);else o[c]=g;l=1}}else o=s,l=1;l&&e.put(o,a)})}}),await this.transaction("ctx","readwrite",function(e){for(const i of t.ctx){const a=i[0],s=i[1];for(const o of s){const l=o[0],u=o[1];u.length&&(e.get(a+":"+l).onsuccess=function(){let c=this.result;var p;if(c&&c.length){const g=Math.max(c.length,u.length);for(let f=0,v,m;f<g;f++)if((m=u[f])&&m.length){if((v=c[f])&&v.length)for(p=0;p<m.length;p++)v.push(m[p]);else c[f]=m;p=1}}else c=u,p=1;p&&e.put(c,a+":"+l)})}}}),t.store?await this.transaction("reg","readwrite",function(e){for(const i of t.store){const a=i[0],s=i[1];e.put(typeof s=="object"?JSON.stringify(s):1,a)}}):t.bypass||await this.transaction("reg","readwrite",function(e){for(const i of t.reg.keys())e.put(1,i)}),t.tag&&await this.transaction("tag","readwrite",function(e){for(const i of t.tag){const a=i[0],s=i[1];s.length&&(e.get(a).onsuccess=function(){let o=this.result;o=o&&o.length?o.concat(s):s,e.put(o,a)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())};function _e(t,n,r){const e=t.value;let i,a=0;for(let s=0,o;s<e.length;s++){if(o=r?e:e[s]){for(let l=0,u,c;l<n.length;l++)if(c=n[l],u=o.indexOf(c),u>=0)if(i=1,o.length>1)o.splice(u,1);else{e[s]=[];break}a+=o.length}if(r)break}a?i&&t.update(e):t.delete(),t.continue()}S.remove=function(t){return typeof t!="object"&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(n){n.openCursor().onsuccess=function(){const r=this.result;r&&_e(r,t)}}),this.transaction("ctx","readwrite",function(n){n.openCursor().onsuccess=function(){const r=this.result;r&&_e(r,t)}}),this.transaction("tag","readwrite",function(n){n.openCursor().onsuccess=function(){const r=this.result;r&&_e(r,t,!0)}}),this.transaction("reg","readwrite",function(n){for(let r=0;r<t.length;r++)n.delete(t[r])})])};function vt(t,n){return new Promise((r,e)=>{t.onsuccess=t.oncomplete=function(){n&&n(this.result),n=null,r(this.result)},t.onerror=t.onblocked=e,t=null})}var fr={Index:at};function le(t,n,r,e){if(!n?.type)throw new Error("Schema not found for "+r);if(t===null)return;if(n.type==="string"){typeof t=="string"&&e({source:t,schema:n,path:r});return}if(n.type==="number"){typeof t=="number"&&e({source:t,schema:n,path:r});return}if(n.type==="boolean"){typeof t=="boolean"&&e({source:t,schema:n,path:r});return}if(n.type==="richtext"){e({source:t,schema:n,path:r});return}if(n.type==="file"||n.type==="image"){t&&typeof t=="object"&&C in t&&typeof t[C]=="string"&&e({source:t,schema:n,path:r});return}if(n.type==="date"){typeof t=="string"&&e({source:t,schema:n,path:r});return}if(n.type==="keyOf"){(typeof t=="string"||typeof t=="number")&&e({source:t,schema:n,path:r});return}if(n.type==="literal"){e({source:t,schema:n,path:r});return}if(n.type==="route"){typeof t=="string"&&e({source:t,schema:n,path:r});return}if(n.type==="array"){if(!Array.isArray(t))return;if(!n.item)throw new Error("Schema ("+n.type+") item not found for "+r);for(let a=0;a<t.length;a++){const s=Ri(r,a);le(t[a],n.item,s,e)}return}if(n.type==="object"||n.type==="record"){if(typeof t!="object"||t===null||Array.isArray(t))return;for(const a in t){const s=n.type==="object"?n.items?.[a]:n.item;if(!s)continue;const o=Ri(r,a);le(t[a],s,o,e)}return}if(n.type==="union"){const a=n.key;if(typeof a=="string"){if(t&&typeof t=="object"&&!Array.isArray(t)&&a in t){const s=t[a];if(typeof s=="string"){const o=n.items.filter(l=>l.type==="object").find(l=>{const u=l.items[a];return u?.type==="literal"?u.value===s:!1});o&&le(t,o,r,e)}}}else typeof t=="string"&&e({source:t,schema:n,path:r});return}const i=n;throw new Error("Unsupported schema type: "+JSON.stringify(i))}function Ri(t,n){const r=t.endsWith("?p=");return t.includes(Ft)?`${t}${r?"":"."}${JSON.stringify(n)}`:`${t}${Ft}${JSON.stringify(n)}`}function hr(t){let n="";function r(e){if(typeof e=="string")n+=e;else if(e&&typeof e=="object"&&"children"in e&&Array.isArray(e.children))for(const i of e.children)r(i)}return r({children:t}),n}let Te=null,Pe=new Map;function dr(t){const n=new fr.Index({tokenize:"forward"}),r=new Map;for(const e in t){const i=e,{source:a,schema:s}=t[i],o=i+"?p=";le(a,s,o,({source:l,schema:u,path:c})=>{if(l===null)return;let p="",g="";if(u.type==="string"||u.type==="number"||u.type==="boolean"||u.type==="date"||u.type==="keyOf"||u.type==="route")p=l?.toString()??"",g=l?.toString()??"";else if(u.type==="literal")p=u.value.toString(),g=u.value.toString();else if(u.type==="richtext")p=hr(l),g=p.substring(0,50)||"richtext";else if((u.type==="file"||u.type==="image")&&l!==null&&typeof l=="object"&&C in l&&typeof l[C]=="string"){const v=l[C].replace("/public/val/",""),m=l?.metadata,d=m&&typeof m=="object"&&"alt"in m?m.alt:"";p=v+" "+d,g=v}if(p){const[,f]=et.splitModuleFilePathAndModulePath(c),v=gr(f)+" ";n.add(c,v+" "+c+" "+p),r.set(c,g)}})}return{index:n,pathToLabel:r}}const mr=new Set(["/","-","_",".",":","?","&","=","@",'"',"'"]);function gr(t){let n="";for(let r=0;r<t.length;r++){const e=t[r];mr.has(e)?n+=" ":n+=e}return console.log("Original path:",t,"Cleaned path:",n),n}function vr(t,n=50,r=0){if(!Te||!t.trim())return{results:[],total:0};const e=Te.search(t,{limit:r+n}),i=e.length;return{results:e.slice(r,r+n).map(s=>({path:s,label:Pe.get(s)||s})),total:i}}self.onmessage=t=>{const n=t.data;try{if(n.type==="build-index"){const r=dr(n.modules);Te=r.index,Pe=r.pathToLabel;const e={type:"index-ready",id:n.id,pathToLabel:Array.from(Pe.entries())};self.postMessage(e)}else if(n.type==="search"){const{results:r,total:e}=vr(n.query,n.limit,n.offset),i={type:"search-results",id:n.id,results:r,total:e};self.postMessage(i)}}catch(r){const e={type:"error",id:n.id,error:r instanceof Error?r.message:String(r)};self.postMessage(e)}};var xr=Object.freeze({__proto__:null})})();
|
package/server/.tmp/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Val</title>
|
|
7
|
-
<script type="module" crossorigin src="/api/val/static/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/api/val/static/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/api/val/static/assets/index-BedkjC1d.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/api/val/static/assets/index-rc87KVPE.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="val-app-static"></div>
|