@lostgradient/cinder 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/components.json +1 -1
- package/dist/_internal/code-highlighter-context.d.ts +28 -0
- package/dist/cli/index.js +12 -8
- package/dist/components/approval-card/index.js +4 -4
- package/dist/components/button/button.css +25 -0
- package/dist/components/calendar/calendar.css +14 -0
- package/dist/components/capability-gate/capability-gate.css +5 -0
- package/dist/components/checkbox/checkbox.css +19 -0
- package/dist/components/chip/chip.css +14 -0
- package/dist/components/code-block/code-block.d.svelte.ts +1 -1
- package/dist/components/code-block/code-block.examples.json +1 -1
- package/dist/components/code-block/code-block.schema.js +3 -3
- package/dist/components/code-block/code-block.svelte.d.ts +1 -1
- package/dist/components/code-block/code-block.types.d.ts +14 -12
- package/dist/components/code-block/index.js +2 -2
- package/dist/components/color-picker/color-picker.css +2 -0
- package/dist/components/combobox/combobox.css +9 -1
- package/dist/components/command-palette/command-palette.css +7 -5
- package/dist/components/file-upload/file-upload.css +2 -1
- package/dist/components/guidance-region/index.css +1 -1
- package/dist/components/image/image.examples.json +1 -1
- package/dist/components/input/input.css +20 -6
- package/dist/components/json-schema-editor/index.js +5 -5
- package/dist/components/json-schema-editor/json-view-highlighter.d.ts +14 -0
- package/dist/components/key-value-editor/index.css +1 -1
- package/dist/components/modal-region/index.css +1 -1
- package/dist/components/multi-select/multi-select.css +9 -0
- package/dist/components/pagination/pagination.css +12 -0
- package/dist/components/pin-input/pin-input.css +9 -1
- package/dist/components/radio-group/radio-group.css +16 -0
- package/dist/components/run-step-timeline/index.js +2 -2
- package/dist/components/schema-form/index.js +2 -2
- package/dist/components/schema-form/schema-form.css +9 -0
- package/dist/components/segmented-control/segmented-control.css +3 -3
- package/dist/components/selection-popover/selection-popover.css +7 -1
- package/dist/components/tag-input/tag-input.css +10 -1
- package/dist/components/terminal-frame/index.js +2 -2
- package/dist/components/terminal-frame/terminal-frame.schema.js +2 -2
- package/dist/components/terminal-frame/terminal-frame.types.d.ts +8 -0
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/toggle/toggle.css +16 -0
- package/dist/components/tree/tree.examples.json +1 -1
- package/dist/components/virtual-list/index.js +2 -2
- package/dist/components/virtual-list/virtual-list.css +42 -9
- package/dist/highlighters/shiki/default.d.ts +13 -1
- package/dist/highlighters/shiki/default.js +2 -2
- package/dist/highlighters/shiki/index.d.ts +20 -12
- package/dist/highlighters/shiki/index.js +2 -2
- package/dist/index.browser.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -23
- package/dist/scripts/knowledge/index.d.ts +5 -1
- package/dist/server/components/approval-card/index.js +1 -1
- package/dist/server/components/code-block/index.js +1 -1
- package/dist/server/components/color-field/index.js +2 -2
- package/dist/server/components/color-picker/index.js +2 -2
- package/dist/server/components/json-schema-editor/index.js +2 -2
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/terminal-frame/index.js +1 -1
- package/dist/server/components/virtual-list/index.js +1 -1
- package/dist/server/github-dark-e7nywpbe.js +3 -0
- package/dist/server/github-light-bqtmm1zq.js +3 -0
- package/dist/server/highlighters/shiki/default.js +2 -2
- package/dist/server/highlighters/shiki/index.js +2 -2
- package/dist/server/index.js +6 -6
- package/dist/server/{index.server-4qyyw4y5.js → index.server-043cfznf.js} +1 -1
- package/dist/server/{index.server-p46tn4eb.js → index.server-09tjs48p.js} +2 -2
- package/dist/server/index.server-0hyvdf74.js +8 -0
- package/dist/server/{index.server-dxgkh9tk.js → index.server-17thvpd3.js} +1 -1
- package/dist/server/index.server-19z6hqd6.js +4 -0
- package/dist/server/index.server-31020qgk.js +3 -0
- package/dist/server/{index.server-w3nqzde5.js → index.server-45wmvjrn.js} +3 -3
- package/dist/server/{index.server-3tkgm2gn.js → index.server-6mb7w5g4.js} +2 -2
- package/dist/server/{index.server-2vxmn7x1.js → index.server-c5yajkkc.js} +4 -4
- package/dist/server/index.server-e6fknxd9.js +4 -0
- package/dist/server/index.server-fev4kwm0.js +4 -0
- package/dist/server/index.server-k4vjk75r.js +4 -0
- package/dist/server/index.server-mjbtd1gs.js +7 -0
- package/dist/server/{index.server-2bfkhzzq.js → index.server-rkp4py5n.js} +2 -2
- package/dist/server/index.server-wdz9tsq4.js +3 -0
- package/dist/server/index.server-zj9909hd.js +4 -0
- package/dist/server/json-68twtta3.js +3 -0
- package/dist/server/tokens/registry.generated.js +1 -1
- package/dist/server/tokens/runtime/index.js +92 -0
- package/dist/styles/check-token-contrast-test-values.d.ts +1 -3
- package/dist/styles/token-contrast-test-readers.d.ts +1 -1
- package/dist/tokens/registry.generated.js +2 -2
- package/dist/tokens/resolved/dark-reduced-motion.json +104 -43
- package/dist/tokens/resolved/dark.json +104 -43
- package/dist/tokens/resolved/light-reduced-motion.json +104 -43
- package/dist/tokens/resolved/light.json +104 -43
- package/dist/tokens/runtime/authoring-catalogue.d.ts +19 -0
- package/dist/tokens/runtime/authoring-catalogue.generated.d.ts +8 -0
- package/dist/tokens/runtime/authoring-palette.d.ts +25 -0
- package/dist/tokens/runtime/authoring-profiles.d.ts +48 -0
- package/dist/tokens/runtime/authoring-provenance.d.ts +31 -0
- package/dist/tokens/runtime/authoring-types.d.ts +182 -0
- package/dist/tokens/runtime/base-corpus.d.ts +29 -0
- package/dist/tokens/runtime/base-corpus.generated.d.ts +8 -0
- package/dist/tokens/runtime/context-order.d.ts +60 -0
- package/dist/tokens/runtime/context-stack.d.ts +11 -0
- package/dist/tokens/runtime/contrast/color-difference.d.ts +16 -0
- package/dist/{styles/color-contrast-utilities.d.ts → tokens/runtime/contrast/color-math.d.ts} +2 -17
- package/dist/tokens/runtime/contrast/color-mix.d.ts +3 -0
- package/dist/tokens/runtime/contrast/css-color.d.ts +29 -0
- package/dist/tokens/runtime/contrast/index.d.ts +7 -0
- package/dist/tokens/runtime/contrast/measure.d.ts +45 -0
- package/dist/tokens/runtime/contrast/pairings.d.ts +36 -0
- package/dist/tokens/runtime/contrast/thresholds.d.ts +47 -0
- package/dist/tokens/runtime/corpus-documents.d.ts +36 -0
- package/dist/tokens/runtime/corpus-validation.d.ts +10 -0
- package/dist/tokens/runtime/corpus.d.ts +35 -0
- package/dist/tokens/runtime/css-configuration.d.ts +1 -0
- package/dist/tokens/runtime/css-stylelint.d.ts +2 -0
- package/dist/tokens/runtime/css-support.d.ts +110 -0
- package/dist/tokens/runtime/evaluate.d.ts +95 -0
- package/dist/tokens/runtime/evaluated-provenance.d.ts +36 -0
- package/dist/tokens/runtime/index.d.ts +38 -0
- package/dist/tokens/runtime/index.js +95 -0
- package/dist/tokens/runtime/package-version.generated.d.ts +9 -0
- package/dist/tokens/runtime/projection.d.ts +32 -0
- package/dist/tokens/runtime/registry.d.ts +125 -0
- package/dist/tokens/runtime/resolve-extends.d.ts +30 -0
- package/dist/tokens/runtime/resolve-references.d.ts +49 -0
- package/dist/tokens/runtime/resolve-shared.d.ts +34 -0
- package/dist/tokens/runtime/resolve.d.ts +44 -0
- package/dist/tokens/runtime/resolver-order.d.ts +89 -0
- package/dist/tokens/runtime/source-digest.d.ts +20 -0
- package/dist/tokens/runtime/stylesheet-skeleton.d.ts +31 -0
- package/dist/tokens/runtime/theme-runtime.test-support.d.ts +24 -0
- package/dist/tokens/runtime/theme-sources.d.ts +46 -0
- package/dist/tokens/runtime/theme-stylesheet.d.ts +31 -0
- package/dist/tokens/runtime/types.d.ts +115 -0
- package/dist/tokens/runtime/validate-resolver.d.ts +31 -0
- package/dist/tokens/runtime/validate-schema.d.ts +22 -0
- package/dist/tokens/runtime/validate-tokens.d.ts +25 -0
- package/dist/tokens/runtime/validate-values.d.ts +33 -0
- package/dist/tokens/runtime/validate.d.ts +3 -0
- package/dist/tokens/runtime/value-color-parse.d.ts +128 -0
- package/dist/tokens/runtime/value-color.d.ts +85 -0
- package/dist/tokens/runtime/value-entry.d.ts +3 -0
- package/dist/tokens/runtime/value-formatters.d.ts +59 -0
- package/dist/tokens/sets/colors.tokens.json +65 -13
- package/dist/tokens/sets/foundation.tokens.json +23 -0
- package/dist/tokens/sets/semantic.tokens.json +136 -30
- package/dist/utilities/highlighter.d.ts +5 -5
- package/dist/utilities/retrying-loader-cache.d.ts +3 -6
- package/package.json +15 -3
- package/src/_internal/code-highlighter-context.ts +41 -0
- package/src/components/button/button.css +25 -0
- package/src/components/calendar/calendar.css +14 -0
- package/src/components/capability-gate/capability-gate.css +5 -0
- package/src/components/checkbox/checkbox.css +19 -0
- package/src/components/chip/chip.css +14 -0
- package/src/components/code-block/code-block.examples.json +1 -1
- package/src/components/code-block/code-block.schema.json +2 -2
- package/src/components/code-block/code-block.schema.ts +2 -2
- package/src/components/code-block/code-block.svelte +15 -19
- package/src/components/code-block/code-block.types.ts +14 -12
- package/src/components/color-picker/color-picker.css +2 -0
- package/src/components/combobox/combobox.css +9 -1
- package/src/components/command-palette/command-palette.css +7 -5
- package/src/components/file-upload/file-upload.css +2 -1
- package/src/components/image/image.examples.json +1 -1
- package/src/components/input/input.css +20 -6
- package/src/components/json-schema-editor/json-view-highlighter.ts +23 -0
- package/src/components/json-schema-editor/json-view.svelte +2 -0
- package/src/components/multi-select/multi-select.css +9 -0
- package/src/components/pagination/pagination.css +12 -0
- package/src/components/pin-input/pin-input.css +9 -1
- package/src/components/radio-group/radio-group.css +16 -0
- package/src/components/schema-form/schema-form.css +9 -0
- package/src/components/segmented-control/segmented-control.css +3 -3
- package/src/components/selection-popover/selection-popover.css +7 -1
- package/src/components/tag-input/tag-input.css +10 -1
- package/src/components/terminal-frame/terminal-frame.schema.json +5 -0
- package/src/components/terminal-frame/terminal-frame.schema.ts +6 -0
- package/src/components/terminal-frame/terminal-frame.svelte +6 -2
- package/src/components/terminal-frame/terminal-frame.types.ts +8 -0
- package/src/components/textarea/textarea.css +1 -1
- package/src/components/toggle/toggle.css +16 -0
- package/src/components/tree/tree.examples.json +1 -1
- package/src/components/virtual-list/virtual-list.css +42 -9
- package/src/components/virtual-list/virtual-list.svelte +54 -20
- package/src/highlighters/shiki/default.ts +13 -1
- package/src/highlighters/shiki/index.ts +20 -12
- package/src/index.ts +5 -0
- package/src/styles/foundation.css +33 -1
- package/src/styles/tokens-base.css +4 -4
- package/src/tokens/registry.generated.json +3 -3
- package/src/tokens/resolved/dark-reduced-motion.json +104 -43
- package/src/tokens/resolved/dark.json +104 -43
- package/src/tokens/resolved/light-reduced-motion.json +104 -43
- package/src/tokens/resolved/light.json +104 -43
- package/src/tokens/runtime/authoring-catalogue.generated.ts +19300 -0
- package/src/tokens/runtime/authoring-catalogue.ts +256 -0
- package/src/tokens/runtime/authoring-palette.ts +100 -0
- package/src/tokens/runtime/authoring-profiles.ts +288 -0
- package/src/tokens/runtime/authoring-provenance.ts +290 -0
- package/src/tokens/runtime/authoring-types.ts +199 -0
- package/src/tokens/runtime/base-corpus.generated.ts +10 -0
- package/src/tokens/runtime/base-corpus.ts +78 -0
- package/src/tokens/runtime/context-order.ts +182 -0
- package/src/tokens/runtime/context-stack.ts +52 -0
- package/src/tokens/runtime/contrast/color-difference.ts +114 -0
- package/src/tokens/runtime/contrast/color-math.ts +89 -0
- package/src/tokens/runtime/contrast/color-mix.ts +20 -0
- package/src/tokens/runtime/contrast/css-color.ts +312 -0
- package/src/tokens/runtime/contrast/index.ts +7 -0
- package/src/tokens/runtime/contrast/measure.ts +185 -0
- package/src/tokens/runtime/contrast/pairings.ts +324 -0
- package/src/tokens/runtime/contrast/thresholds.ts +81 -0
- package/src/tokens/runtime/corpus-documents.ts +289 -0
- package/src/tokens/runtime/corpus-validation.ts +336 -0
- package/src/tokens/runtime/corpus.ts +179 -0
- package/src/tokens/runtime/css-configuration.ts +1 -0
- package/src/tokens/runtime/css-stylelint.ts +15 -0
- package/src/tokens/runtime/css-support.ts +407 -0
- package/src/tokens/runtime/evaluate.ts +262 -0
- package/src/tokens/runtime/evaluated-provenance.ts +116 -0
- package/src/tokens/runtime/format-validator.generated.d.ts +18 -0
- package/src/tokens/runtime/format-validator.generated.js +13029 -0
- package/src/tokens/runtime/index.ts +78 -0
- package/src/tokens/runtime/package-version.generated.ts +9 -0
- package/src/tokens/runtime/projection.ts +65 -0
- package/src/tokens/runtime/registry.ts +365 -0
- package/src/tokens/runtime/resolve-extends.ts +211 -0
- package/src/tokens/runtime/resolve-references.ts +313 -0
- package/src/tokens/runtime/resolve-shared.ts +186 -0
- package/src/tokens/runtime/resolve.ts +246 -0
- package/src/tokens/runtime/resolver-order.ts +326 -0
- package/src/tokens/runtime/resolver-validator.generated.d.ts +18 -0
- package/src/tokens/runtime/resolver-validator.generated.js +15492 -0
- package/src/tokens/runtime/source-digest.ts +49 -0
- package/src/tokens/runtime/stylesheet-skeleton.ts +123 -0
- package/src/tokens/runtime/theme-sources.ts +121 -0
- package/src/tokens/runtime/theme-stylesheet.ts +177 -0
- package/src/tokens/runtime/types.ts +140 -0
- package/src/tokens/runtime/validate-resolver.ts +338 -0
- package/src/tokens/runtime/validate-schema.ts +269 -0
- package/src/tokens/runtime/validate-tokens.ts +181 -0
- package/src/tokens/runtime/validate-values.ts +396 -0
- package/src/tokens/runtime/validate.ts +57 -0
- package/src/tokens/runtime/value-color-parse.ts +309 -0
- package/src/tokens/runtime/value-color.ts +217 -0
- package/src/tokens/runtime/value-entry.ts +52 -0
- package/src/tokens/runtime/value-formatters.ts +414 -0
- package/src/tokens/sets/colors.tokens.json +65 -13
- package/src/tokens/sets/foundation.tokens.json +23 -0
- package/src/tokens/sets/semantic.tokens.json +136 -30
- package/src/utilities/highlighter.ts +5 -5
- package/src/utilities/retrying-loader-cache.ts +3 -6
- package/dist/components/code-block/code-block-default-highlighter.d.ts +0 -40
- package/dist/server/index.server-298z43yn.js +0 -4
- package/dist/server/index.server-3h11wjyh.js +0 -8
- package/dist/server/index.server-a3aerbfr.js +0 -4
- package/dist/server/index.server-kge3zp6n.js +0 -4
- package/dist/server/index.server-syf81nwz.js +0 -6
- package/dist/server/index.server-zs08f5te.js +0 -3
- package/src/components/code-block/code-block-default-highlighter.ts +0 -63
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var __create=Object.create;var __getProtoOf=Object.getPrototypeOf;var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node;var __toESMCache_esm;var __toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap;var cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};const to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:true}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:true})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name2,newValue){this[name2]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name2 in all)__defProp(target,name2,{get:all[name2],enumerable:true,configurable:true,set:__exportSetter.bind(all,name2)})};var __esm=(fn,res,err)=>()=>{if(fn)try{res=fn(fn=0)}catch(e){err=[e]}if(err)throw err[0];return res};var __exportCjs=(target,getters,setters)=>{for(var name2 in getters)__defProp(target,name2,{get:getters[name2],set:setters[name2],enumerable:true,configurable:true})};function createRetryingLoaderCache(loader){let cached;return()=>{if(cached===undefined){const pending=loader();pending.catch(()=>{if(cached===pending){cached=undefined}});cached=pending}return cached}}function getCleanClone(prototype){if(!prototype){return Object.create(null)}const Constructor=prototype.constructor;if(Constructor===Object){return prototype===Object.prototype?{}:Object.create(prototype)}if(Constructor&&~toStringFunction.call(Constructor).indexOf("[native code]")){try{return new Constructor}catch(_a){}}return Object.create(prototype)}function getTag(value){const stringTag=value[Symbol.toStringTag];if(stringTag){return stringTag}const type=toStringObject.call(value);return type.substring(8,type.length-1)}function copyOwnDescriptor(original,clone,property,state){const ownDescriptor=Object.getOwnPropertyDescriptor(original,property)||{configurable:true,enumerable:true,value:original[property],writable:true};const descriptor=ownDescriptor.get||ownDescriptor.set?ownDescriptor:{configurable:ownDescriptor.configurable,enumerable:ownDescriptor.enumerable,value:state.copier(ownDescriptor.value,state),writable:ownDescriptor.writable};try{Object.defineProperty(clone,property,descriptor)}catch(_a){clone[property]=descriptor.get?descriptor.get():descriptor.value}}function copyOwnPropertiesStrict(value,clone,state){for(const name2 of Object.getOwnPropertyNames(value)){copyOwnDescriptor(value,clone,name2,state)}for(const symbol of Object.getOwnPropertySymbols(value)){copyOwnDescriptor(value,clone,symbol,state)}return clone}function copyArrayLoose(array,state){const clone=new state.Constructor;state.cache.set(array,clone);for(let index=0;index<array.length;++index){clone[index]=state.copier(array[index],state)}return clone}function copyArrayStrict(array,state){const clone=new state.Constructor;state.cache.set(array,clone);return copyOwnPropertiesStrict(array,clone,state)}function copyArrayBuffer(arrayBuffer,_state){return ArrayBuffer.isView(arrayBuffer)?sliceTypedArray.call(arrayBuffer,0):arrayBuffer.slice(0)}function copyBlob(blob,_state){return blob.slice(0,blob.size,blob.type)}function copyDataView(dataView,state){return new state.Constructor(copyArrayBuffer(dataView.buffer))}function copyDate(date,state){return new state.Constructor(date.getTime())}function copyMapLoose(map,state){const clone=new state.Constructor;state.cache.set(map,clone);for(const[key,value]of map){clone.set(key,state.copier(value,state))}return clone}function copyMapStrict(map,state){return copyOwnPropertiesStrict(map,copyMapLoose(map,state),state)}function copyObjectLoose(object,state){const clone=getCleanClone(state.prototype);state.cache.set(object,clone);for(const key of Object.keys(object)){clone[key]=state.copier(object[key],state)}for(const symbol of Object.getOwnPropertySymbols(object)){if(propertyIsEnumerable.call(object,symbol)){clone[symbol]=state.copier(object[symbol],state)}}return clone}function copyObjectStrict(object,state){const clone=getCleanClone(state.prototype);state.cache.set(object,clone);return copyOwnPropertiesStrict(object,clone,state)}function copyPrimitiveWrapper(primitiveObject,state){return new state.Constructor(primitiveObject.valueOf())}function copyRegExp(regExp,state){const clone=new state.Constructor(regExp.source,regExp.flags);clone.lastIndex=regExp.lastIndex;return clone}function copySelf(value,_state){return value}function copySetLoose(set,state){const clone=new state.Constructor;state.cache.set(set,clone);for(const value of set){clone.add(state.copier(value,state))}return clone}function copySetStrict(set,state){return copyOwnPropertiesStrict(set,copySetLoose(set,state),state)}function createDefaultCache(){return new WeakMap}function getOptions({createCache:createCacheOverride,maxDepth,methods:methodsOverride,strict}){const defaultMethods={array:strict?copyArrayStrict:copyArrayLoose,arrayBuffer:copyArrayBuffer,asyncGenerator:copySelf,blob:copyBlob,dataView:copyDataView,date:copyDate,error:copySelf,generator:copySelf,map:strict?copyMapStrict:copyMapLoose,object:strict?copyObjectStrict:copyObjectLoose,regExp:copyRegExp,set:strict?copySetStrict:copySetLoose};const methods=methodsOverride?Object.assign(defaultMethods,methodsOverride):defaultMethods;const copiers=getTagSpecificCopiers(methods);const createCache=createCacheOverride||createDefaultCache;if(!copiers.Object||!copiers.Array){throw new Error("An object and array copier must be provided.")}return{createCache,copiers,maxDepth:maxDepth==null?DEFAULT_MAX_DEPTH:maxDepth,methods,strict:Boolean(strict)}}function getTagSpecificCopiers(methods){return Object.assign(Object.create(null),{Arguments:methods.object,Array:methods.array,ArrayBuffer:methods.arrayBuffer,AsyncGenerator:methods.asyncGenerator,BigInt64Array:methods.arrayBuffer,BigUint64Array:methods.arrayBuffer,Blob:methods.blob,Boolean:copyPrimitiveWrapper,DataView:methods.dataView,Date:methods.date,Error:methods.error,Float32Array:methods.arrayBuffer,Float64Array:methods.arrayBuffer,Generator:methods.generator,Int8Array:methods.arrayBuffer,Int16Array:methods.arrayBuffer,Int32Array:methods.arrayBuffer,Map:methods.map,Number:copyPrimitiveWrapper,Object:methods.object,Promise:copySelf,RegExp:methods.regExp,Set:methods.set,String:copyPrimitiveWrapper,WeakMap:copySelf,WeakSet:copySelf,Uint8Array:methods.arrayBuffer,Uint8ClampedArray:methods.arrayBuffer,Uint16Array:methods.arrayBuffer,Uint32Array:methods.arrayBuffer})}function createCopier(options={}){const{createCache,copiers,maxDepth}=getOptions(options);const{Array:copyArray,Object:copyObject}=copiers;function copier(value,state){state.prototype=state.Constructor=undefined;if(!value||typeof value!=="object"){return value}if(state.cache.has(value)){return state.cache.get(value)}if(++state.depth>maxDepth){throw new MaxDepthExceededError(maxDepth)}state.prototype=Object.getPrototypeOf(value);state.Constructor=state.prototype&&state.prototype.constructor;let clone;if(!state.Constructor||state.Constructor===Object){clone=copyObject(value,state)}else if(Array.isArray(value)){clone=copyArray(value,state)}else{const tagSpecificCopier=copiers[getTag(value)];if(tagSpecificCopier){clone=tagSpecificCopier(value,state)}else{clone=typeof value.then==="function"?value:copyObject(value,state)}}--state.depth;return clone}return function copy(value){return copier(value,{Constructor:undefined,cache:createCache(),copier,depth:0,prototype:undefined})}}var MaxDepthExceededError,toStringFunction,toStringObject,propertyIsEnumerable,sliceTypedArray,DEFAULT_MAX_DEPTH=1000,copyStrict,copy;var init_es=__esm(()=>{MaxDepthExceededError=class MaxDepthExceededError extends RangeError{constructor(maxDepth){super(`Maximum copy depth of ${String(maxDepth)} exceeded; the value copied is nested too deeply.`);this.maxDepth=maxDepth;this.name="MaxDepthExceededError"}};toStringFunction=Function.prototype.toString;toStringObject=Object.prototype.toString;({propertyIsEnumerable}=Object.prototype);sliceTypedArray=Object.getPrototypeOf(Int8Array.prototype).slice;copyStrict=createCopier({strict:true});copy=createCopier()});function e(e){return e===`#`||e===``||Array.isArray(e)&&e.length===0||false}function i(e){return e.replace(t,`/`).replace(n,`~`)}function a(e){return i(decodeURIComponent(e))}function o(t){if(t==null||typeof t!=`string`||e(t))return Array.isArray(t)?t.slice():[];let n=t.indexOf(`#`)>=0?a:i;t=t.replace(r,``);let o=t.split(`/`);for(let e=0,t=o.length;e<t;e+=1)o[e]=n(o[e]);return o}function s(t,n,r=undefined){if(n==null||t==null)return r;if(e(n))return t;let i=c(t,o(n));return i===undefined?r:i}function c(e,t){let n=t.shift();if(e!==undefined)return n===undefined?e:e==null?undefined:c(e[n],t)}function y(e,t){if(e.length===0)return t?`#`:``;for(let n=0,r=e.length;n<r;n+=1)e[n]=e[n].replace(_,`~0`).replace(v,`~1`),t&&(e[n]=encodeURIComponent(e[n]));return(t?`#/`:`/`)+e.join(`/`)}function b(e,...t){let n=[];if(Array.isArray(e))return y(e,arguments[1]===true);let r=arguments[arguments.length-1],i=typeof r==`boolean`?r:e&&e[0]===`#`;for(let e=0,t=arguments.length;e<t;e+=1)n.push.apply(n,o(arguments[e]));let a=[];for(let e=0,t=n.length;e<t;e+=1)if(n[e]===`..`){if(a.length===0)return i?`#`:``;a.pop()}else a.push(n[e]);return y(a,i)}var t,n,r,_,v;var init_dist=__esm(()=>{t=/~1/g;n=/~0/g;r=/(^#?\/?)/g;_=/~/g;v=/\//g});var require_uri_all=__commonJS(function(exports,module){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.URI=global.URI||{})})(exports,function(exports2){function merge(){for(var _len=arguments.length,sets=Array(_len),_key=0;_key<_len;_key++){sets[_key]=arguments[_key]}if(sets.length>1){sets[0]=sets[0].slice(0,-1);var xl=sets.length-1;for(var x=1;x<xl;++x){sets[x]=sets[x].slice(1,-1)}sets[xl]=sets[xl].slice(1);return sets.join("")}else{return sets[0]}}function subexp(str){return"(?:"+str+")"}function typeOf(o){return o===undefined?"undefined":o===null?"null":Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(str){return str.toUpperCase()}function toArray(obj){return obj!==undefined&&obj!==null?obj instanceof Array?obj:typeof obj.length!=="number"||obj.split||obj.setInterval||obj.call?[obj]:Array.prototype.slice.call(obj):[]}function assign(target,source){var obj=target;if(source){for(var key in source){obj[key]=source[key]}}return obj}function buildExps(isIRI){var ALPHA$$="[A-Za-z]",CR$="[\\x0D]",DIGIT$$="[0-9]",DQUOTE$$="[\\x22]",HEXDIG$$=merge(DIGIT$$,"[A-Fa-f]"),LF$$="[\\x0A]",SP$$="[\\x20]",PCT_ENCODED$=subexp(subexp("%[EFef]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%[89A-Fa-f]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%"+HEXDIG$$+HEXDIG$$)),GEN_DELIMS$$="[\\:\\/\\?\\#\\[\\]\\@]",SUB_DELIMS$$="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",RESERVED$$=merge(GEN_DELIMS$$,SUB_DELIMS$$),UCSCHAR$$=isIRI?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",IPRIVATE$$=isIRI?"[\\uE000-\\uF8FF]":"[]",UNRESERVED$$=merge(ALPHA$$,DIGIT$$,"[\\-\\.\\_\\~]",UCSCHAR$$),SCHEME$=subexp(ALPHA$$+merge(ALPHA$$,DIGIT$$,"[\\+\\-\\.]")+"*"),USERINFO$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:]"))+"*"),DEC_OCTET$=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+DIGIT$$)+"|"+subexp("1"+DIGIT$$+DIGIT$$)+"|"+subexp("[1-9]"+DIGIT$$)+"|"+DIGIT$$),DEC_OCTET_RELAXED$=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+DIGIT$$)+"|"+subexp("1"+DIGIT$$+DIGIT$$)+"|"+subexp("0?[1-9]"+DIGIT$$)+"|0?0?"+DIGIT$$),IPV4ADDRESS$=subexp(DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$),H16$=subexp(HEXDIG$$+"{1,4}"),LS32$=subexp(subexp(H16$+"\\:"+H16$)+"|"+IPV4ADDRESS$),IPV6ADDRESS1$=subexp(subexp(H16$+"\\:")+"{6}"+LS32$),IPV6ADDRESS2$=subexp("\\:\\:"+subexp(H16$+"\\:")+"{5}"+LS32$),IPV6ADDRESS3$=subexp(subexp(H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{4}"+LS32$),IPV6ADDRESS4$=subexp(subexp(subexp(H16$+"\\:")+"{0,1}"+H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{3}"+LS32$),IPV6ADDRESS5$=subexp(subexp(subexp(H16$+"\\:")+"{0,2}"+H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{2}"+LS32$),IPV6ADDRESS6$=subexp(subexp(subexp(H16$+"\\:")+"{0,3}"+H16$)+"?\\:\\:"+H16$+"\\:"+LS32$),IPV6ADDRESS7$=subexp(subexp(subexp(H16$+"\\:")+"{0,4}"+H16$)+"?\\:\\:"+LS32$),IPV6ADDRESS8$=subexp(subexp(subexp(H16$+"\\:")+"{0,5}"+H16$)+"?\\:\\:"+H16$),IPV6ADDRESS9$=subexp(subexp(subexp(H16$+"\\:")+"{0,6}"+H16$)+"?\\:\\:"),IPV6ADDRESS$=subexp([IPV6ADDRESS1$,IPV6ADDRESS2$,IPV6ADDRESS3$,IPV6ADDRESS4$,IPV6ADDRESS5$,IPV6ADDRESS6$,IPV6ADDRESS7$,IPV6ADDRESS8$,IPV6ADDRESS9$].join("|")),ZONEID$=subexp(subexp(UNRESERVED$$+"|"+PCT_ENCODED$)+"+"),IPV6ADDRZ$=subexp(IPV6ADDRESS$+"\\%25"+ZONEID$),IPV6ADDRZ_RELAXED$=subexp(IPV6ADDRESS$+subexp("\\%25|\\%(?!"+HEXDIG$$+"{2})")+ZONEID$),IPVFUTURE$=subexp("[vV]"+HEXDIG$$+"+\\."+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:]")+"+"),IP_LITERAL$=subexp("\\["+subexp(IPV6ADDRZ_RELAXED$+"|"+IPV6ADDRESS$+"|"+IPVFUTURE$)+"\\]"),REG_NAME$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$))+"*"),HOST$=subexp(IP_LITERAL$+"|"+IPV4ADDRESS$+"(?!"+REG_NAME$+")"+"|"+REG_NAME$),PORT$=subexp(DIGIT$$+"*"),AUTHORITY$=subexp(subexp(USERINFO$+"@")+"?"+HOST$+subexp("\\:"+PORT$)+"?"),PCHAR$=subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@]")),SEGMENT$=subexp(PCHAR$+"*"),SEGMENT_NZ$=subexp(PCHAR$+"+"),SEGMENT_NZ_NC$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\@]"))+"+"),PATH_ABEMPTY$=subexp(subexp("\\/"+SEGMENT$)+"*"),PATH_ABSOLUTE$=subexp("\\/"+subexp(SEGMENT_NZ$+PATH_ABEMPTY$)+"?"),PATH_NOSCHEME$=subexp(SEGMENT_NZ_NC$+PATH_ABEMPTY$),PATH_ROOTLESS$=subexp(SEGMENT_NZ$+PATH_ABEMPTY$),PATH_EMPTY$="(?!"+PCHAR$+")",PATH$=subexp(PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$),QUERY$=subexp(subexp(PCHAR$+"|"+merge("[\\/\\?]",IPRIVATE$$))+"*"),FRAGMENT$=subexp(subexp(PCHAR$+"|[\\/\\?]")+"*"),HIER_PART$=subexp(subexp("\\/\\/"+AUTHORITY$+PATH_ABEMPTY$)+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$),URI$=subexp(SCHEME$+"\\:"+HIER_PART$+subexp("\\?"+QUERY$)+"?"+subexp("\\#"+FRAGMENT$)+"?"),RELATIVE_PART$=subexp(subexp("\\/\\/"+AUTHORITY$+PATH_ABEMPTY$)+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_EMPTY$),RELATIVE$=subexp(RELATIVE_PART$+subexp("\\?"+QUERY$)+"?"+subexp("\\#"+FRAGMENT$)+"?"),URI_REFERENCE$=subexp(URI$+"|"+RELATIVE$),ABSOLUTE_URI$=subexp(SCHEME$+"\\:"+HIER_PART$+subexp("\\?"+QUERY$)+"?"),GENERIC_REF$="^("+SCHEME$+")\\:"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?"+subexp("\\#("+FRAGMENT$+")")+"?$",RELATIVE_REF$="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?"+subexp("\\#("+FRAGMENT$+")")+"?$",ABSOLUTE_REF$="^("+SCHEME$+")\\:"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?$",SAMEDOC_REF$="^"+subexp("\\#("+FRAGMENT$+")")+"?$",AUTHORITY_REF$="^"+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",ALPHA$$,DIGIT$$,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@\\/\\?]",IPRIVATE$$),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",UNRESERVED$$,SUB_DELIMS$$),"g"),UNRESERVED:new RegExp(UNRESERVED$$,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",UNRESERVED$$,RESERVED$$),"g"),PCT_ENCODED:new RegExp(PCT_ENCODED$,"g"),IPV4ADDRESS:new RegExp("^("+IPV4ADDRESS$+")$"),IPV6ADDRESS:new RegExp("^\\[?("+IPV6ADDRESS$+")"+subexp(subexp("\\%25|\\%(?!"+HEXDIG$$+"{2})")+"("+ZONEID$+")")+"?\\]?$")}}var URI_PROTOCOL=buildExps(false);var IRI_PROTOCOL=buildExps(true);var slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"])_i["return"]()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr)){return arr}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}else{return Array.from(arr)}};var maxInt=2147483647;var base=36;var tMin=1;var tMax=26;var skew=38;var damp=700;var initialBias=72;var initialN=128;var delimiter="-";var regexPunycode=/^xn--/;var regexNonASCII=/[^\0-\x7E]/;var regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g;var errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var baseMinusTMin=base-tMin;var floor=Math.floor;var stringFromCharCode=String.fromCharCode;function error$1(type){throw new RangeError(errors[type])}function map(array,fn){var result=[];var length=array.length;while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[];var counter=0;var length=string.length;while(counter<length){var value=string.charCodeAt(counter++);if(value>=55296&&value<=56319&&counter<length){var extra=string.charCodeAt(counter++);if((extra&64512)==56320){output.push(((value&1023)<<10)+(extra&1023)+65536)}else{output.push(value);counter--}}else{output.push(value)}}return output}var ucs2encode=function ucs2encode(array){return String.fromCodePoint.apply(String,toConsumableArray(array))};var basicToDigit=function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base};var digitToBasic=function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)};var adapt=function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))};var decode=function decode(input){var output=[];var inputLength=input.length;var i=0;var n=initialN;var bias=initialBias;var basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(var j=0;j<basic;++j){if(input.charCodeAt(j)>=128){error$1("not-basic")}output.push(input.charCodeAt(j))}for(var index=basic>0?basic+1:0;index<inputLength;){var oldi=i;for(var w=1,k=base;;k+=base){if(index>=inputLength){error$1("invalid-input")}var digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error$1("overflow")}i+=digit*w;var t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break}var baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error$1("overflow")}w*=baseMinusT}var out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error$1("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return String.fromCodePoint.apply(String,output)};var encode=function encode(input){var output=[];input=ucs2decode(input);var inputLength=input.length;var n=initialN;var delta=0;var bias=initialBias;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=input[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _currentValue2=_step.value;if(_currentValue2<128){output.push(stringFromCharCode(_currentValue2))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var basicLength=output.length;var handledCPCount=basicLength;if(basicLength){output.push(delimiter)}while(handledCPCount<inputLength){var m=maxInt;var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=input[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var currentValue=_step2.value;if(currentValue>=n&¤tValue<m){m=currentValue}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error$1("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=input[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var _currentValue=_step3.value;if(_currentValue<n&&++delta>maxInt){error$1("overflow")}if(_currentValue==n){var q=delta;for(var k=base;;k+=base){var t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break}var qMinusT=q-t;var baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT)}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}++delta;++n}return output.join("")};var toUnicode=function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})};var toASCII=function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})};var punycode={version:"2.1.0",ucs2:{decode:ucs2decode,encode:ucs2encode},decode,encode,toASCII,toUnicode};var SCHEMES={};function pctEncChar(chr){var c=chr.charCodeAt(0);var e=undefined;if(c<16)e="%0"+c.toString(16).toUpperCase();else if(c<128)e="%"+c.toString(16).toUpperCase();else if(c<2048)e="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase();else e="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase();return e}function pctDecChars(str){var newStr="";var i=0;var il=str.length;while(i<il){var c=parseInt(str.substr(i+1,2),16);if(c<128){newStr+=String.fromCharCode(c);i+=3}else if(c>=194&&c<224){if(il-i>=6){var c2=parseInt(str.substr(i+4,2),16);newStr+=String.fromCharCode((c&31)<<6|c2&63)}else{newStr+=str.substr(i,6)}i+=6}else if(c>=224){if(il-i>=9){var _c=parseInt(str.substr(i+4,2),16);var c3=parseInt(str.substr(i+7,2),16);newStr+=String.fromCharCode((c&15)<<12|(_c&63)<<6|c3&63)}else{newStr+=str.substr(i,9)}i+=9}else{newStr+=str.substr(i,3);i+=3}}return newStr}function _normalizeComponentEncoding(components,protocol){function decodeUnreserved(str){var decStr=pctDecChars(str);return!decStr.match(protocol.UNRESERVED)?str:decStr}if(components.scheme)components.scheme=String(components.scheme).replace(protocol.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME,"");if(components.userinfo!==undefined)components.userinfo=String(components.userinfo).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_USERINFO,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.host!==undefined)components.host=String(components.host).replace(protocol.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.path!==undefined)components.path=String(components.path).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(components.scheme?protocol.NOT_PATH:protocol.NOT_PATH_NOSCHEME,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.query!==undefined)components.query=String(components.query).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_QUERY,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.fragment!==undefined)components.fragment=String(components.fragment).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_FRAGMENT,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);return components}function _stripLeadingZeros(str){return str.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(host,protocol){var matches=host.match(protocol.IPV4ADDRESS)||[];var _matches=slicedToArray(matches,2),address=_matches[1];if(address){return address.split(".").map(_stripLeadingZeros).join(".")}else{return host}}function _normalizeIPv6(host,protocol){var matches=host.match(protocol.IPV6ADDRESS)||[];var _matches2=slicedToArray(matches,3),address=_matches2[1],zone=_matches2[2];if(address){var _address$toLowerCase$=address.toLowerCase().split("::").reverse(),_address$toLowerCase$2=slicedToArray(_address$toLowerCase$,2),last=_address$toLowerCase$2[0],first=_address$toLowerCase$2[1];var firstFields=first?first.split(":").map(_stripLeadingZeros):[];var lastFields=last.split(":").map(_stripLeadingZeros);var isLastFieldIPv4Address=protocol.IPV4ADDRESS.test(lastFields[lastFields.length-1]);var fieldCount=isLastFieldIPv4Address?7:8;var lastFieldsStart=lastFields.length-fieldCount;var fields=Array(fieldCount);for(var x=0;x<fieldCount;++x){fields[x]=firstFields[x]||lastFields[lastFieldsStart+x]||""}if(isLastFieldIPv4Address){fields[fieldCount-1]=_normalizeIPv4(fields[fieldCount-1],protocol)}var allZeroFields=fields.reduce(function(acc,field,index){if(!field||field==="0"){var lastLongest=acc[acc.length-1];if(lastLongest&&lastLongest.index+lastLongest.length===index){lastLongest.length++}else{acc.push({index,length:1})}}return acc},[]);var longestZeroFields=allZeroFields.sort(function(a,b){return b.length-a.length})[0];var newHost=undefined;if(longestZeroFields&&longestZeroFields.length>1){var newFirst=fields.slice(0,longestZeroFields.index);var newLast=fields.slice(longestZeroFields.index+longestZeroFields.length);newHost=newFirst.join(":")+"::"+newLast.join(":")}else{newHost=fields.join(":")}if(zone){newHost+="%"+zone}return newHost}else{return host}}var URI_PARSE=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var NO_MATCH_IS_UNDEFINED="".match(/(){0}/)[1]===undefined;function parse(uriString){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var components={};var protocol=options.iri!==false?IRI_PROTOCOL:URI_PROTOCOL;if(options.reference==="suffix")uriString=(options.scheme?options.scheme+":":"")+"//"+uriString;var matches=uriString.match(URI_PARSE);if(matches){if(NO_MATCH_IS_UNDEFINED){components.scheme=matches[1];components.userinfo=matches[3];components.host=matches[4];components.port=parseInt(matches[5],10);components.path=matches[6]||"";components.query=matches[7];components.fragment=matches[8];if(isNaN(components.port)){components.port=matches[5]}}else{components.scheme=matches[1]||undefined;components.userinfo=uriString.indexOf("@")!==-1?matches[3]:undefined;components.host=uriString.indexOf("//")!==-1?matches[4]:undefined;components.port=parseInt(matches[5],10);components.path=matches[6]||"";components.query=uriString.indexOf("?")!==-1?matches[7]:undefined;components.fragment=uriString.indexOf("#")!==-1?matches[8]:undefined;if(isNaN(components.port)){components.port=uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?matches[4]:undefined}}if(components.host){components.host=_normalizeIPv6(_normalizeIPv4(components.host,protocol),protocol)}if(components.scheme===undefined&&components.userinfo===undefined&&components.host===undefined&&components.port===undefined&&!components.path&&components.query===undefined){components.reference="same-document"}else if(components.scheme===undefined){components.reference="relative"}else if(components.fragment===undefined){components.reference="absolute"}else{components.reference="uri"}if(options.reference&&options.reference!=="suffix"&&options.reference!==components.reference){components.error=components.error||"URI is not a "+options.reference+" reference."}var schemeHandler=SCHEMES[(options.scheme||components.scheme||"").toLowerCase()];if(!options.unicodeSupport&&(!schemeHandler||!schemeHandler.unicodeSupport)){if(components.host&&(options.domainHost||schemeHandler&&schemeHandler.domainHost)){try{components.host=punycode.toASCII(components.host.replace(protocol.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){components.error=components.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(components,URI_PROTOCOL)}else{_normalizeComponentEncoding(components,protocol)}if(schemeHandler&&schemeHandler.parse){schemeHandler.parse(components,options)}}else{components.error=components.error||"URI can not be parsed."}return components}function _recomposeAuthority(components,options){var protocol=options.iri!==false?IRI_PROTOCOL:URI_PROTOCOL;var uriTokens=[];if(components.userinfo!==undefined){uriTokens.push(components.userinfo);uriTokens.push("@")}if(components.host!==undefined){uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host),protocol),protocol).replace(protocol.IPV6ADDRESS,function(_,$1,$2){return"["+$1+($2?"%25"+$2:"")+"]"}))}if(typeof components.port==="number"||typeof components.port==="string"){uriTokens.push(":");uriTokens.push(String(components.port))}return uriTokens.length?uriTokens.join(""):undefined}var RDS1=/^\.\.?\//;var RDS2=/^\/\.(\/|$)/;var RDS3=/^\/\.\.(\/|$)/;var RDS5=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(input){var output=[];while(input.length){if(input.match(RDS1)){input=input.replace(RDS1,"")}else if(input.match(RDS2)){input=input.replace(RDS2,"/")}else if(input.match(RDS3)){input=input.replace(RDS3,"/");output.pop()}else if(input==="."||input===".."){input=""}else{var im=input.match(RDS5);if(im){var s=im[0];input=input.slice(s.length);output.push(s)}else{throw new Error("Unexpected dot segment condition")}}}return output.join("")}function serialize(components){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var protocol=options.iri?IRI_PROTOCOL:URI_PROTOCOL;var uriTokens=[];var schemeHandler=SCHEMES[(options.scheme||components.scheme||"").toLowerCase()];if(schemeHandler&&schemeHandler.serialize)schemeHandler.serialize(components,options);if(components.host){if(protocol.IPV6ADDRESS.test(components.host)){}else if(options.domainHost||schemeHandler&&schemeHandler.domainHost){try{components.host=!options.iri?punycode.toASCII(components.host.replace(protocol.PCT_ENCODED,pctDecChars).toLowerCase()):punycode.toUnicode(components.host)}catch(e){components.error=components.error||"Host's domain name can not be converted to "+(!options.iri?"ASCII":"Unicode")+" via punycode: "+e}}}_normalizeComponentEncoding(components,protocol);if(options.reference!=="suffix"&&components.scheme){uriTokens.push(components.scheme);uriTokens.push(":")}var authority=_recomposeAuthority(components,options);if(authority!==undefined){if(options.reference!=="suffix"){uriTokens.push("//")}uriTokens.push(authority);if(components.path&&components.path.charAt(0)!=="/"){uriTokens.push("/")}}if(components.path!==undefined){var s=components.path;if(!options.absolutePath&&(!schemeHandler||!schemeHandler.absolutePath)){s=removeDotSegments(s)}if(authority===undefined){s=s.replace(/^\/\//,"/%2F")}uriTokens.push(s)}if(components.query!==undefined){uriTokens.push("?");uriTokens.push(components.query)}if(components.fragment!==undefined){uriTokens.push("#");uriTokens.push(components.fragment)}return uriTokens.join("")}function resolveComponents(base,relative){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var skipNormalization=arguments[3];var target={};if(!skipNormalization){base=parse(serialize(base,options),options);relative=parse(serialize(relative,options),options)}options=options||{};if(!options.tolerant&&relative.scheme){target.scheme=relative.scheme;target.userinfo=relative.userinfo;target.host=relative.host;target.port=relative.port;target.path=removeDotSegments(relative.path||"");target.query=relative.query}else{if(relative.userinfo!==undefined||relative.host!==undefined||relative.port!==undefined){target.userinfo=relative.userinfo;target.host=relative.host;target.port=relative.port;target.path=removeDotSegments(relative.path||"");target.query=relative.query}else{if(!relative.path){target.path=base.path;if(relative.query!==undefined){target.query=relative.query}else{target.query=base.query}}else{if(relative.path.charAt(0)==="/"){target.path=removeDotSegments(relative.path)}else{if((base.userinfo!==undefined||base.host!==undefined||base.port!==undefined)&&!base.path){target.path="/"+relative.path}else if(!base.path){target.path=relative.path}else{target.path=base.path.slice(0,base.path.lastIndexOf("/")+1)+relative.path}target.path=removeDotSegments(target.path)}target.query=relative.query}target.userinfo=base.userinfo;target.host=base.host;target.port=base.port}target.scheme=base.scheme}target.fragment=relative.fragment;return target}function resolve(baseURI,relativeURI,options){var schemelessOptions=assign({scheme:"null"},options);return serialize(resolveComponents(parse(baseURI,schemelessOptions),parse(relativeURI,schemelessOptions),schemelessOptions,true),schemelessOptions)}function normalize(uri,options){if(typeof uri==="string"){uri=serialize(parse(uri,options),options)}else if(typeOf(uri)==="object"){uri=parse(serialize(uri,options),options)}return uri}function equal(uriA,uriB,options){if(typeof uriA==="string"){uriA=serialize(parse(uriA,options),options)}else if(typeOf(uriA)==="object"){uriA=serialize(uriA,options)}if(typeof uriB==="string"){uriB=serialize(parse(uriB,options),options)}else if(typeOf(uriB)==="object"){uriB=serialize(uriB,options)}return uriA===uriB}function escapeComponent(str,options){return str&&str.toString().replace(!options||!options.iri?URI_PROTOCOL.ESCAPE:IRI_PROTOCOL.ESCAPE,pctEncChar)}function unescapeComponent(str,options){return str&&str.toString().replace(!options||!options.iri?URI_PROTOCOL.PCT_ENCODED:IRI_PROTOCOL.PCT_ENCODED,pctDecChars)}var handler={scheme:"http",domainHost:true,parse:function parse(components,options){if(!components.host){components.error=components.error||"HTTP URIs must have a host."}return components},serialize:function serialize(components,options){var secure=String(components.scheme).toLowerCase()==="https";if(components.port===(secure?443:80)||components.port===""){components.port=undefined}if(!components.path){components.path="/"}return components}};var handler$1={scheme:"https",domainHost:handler.domainHost,parse:handler.parse,serialize:handler.serialize};function isSecure(wsComponents){return typeof wsComponents.secure==="boolean"?wsComponents.secure:String(wsComponents.scheme).toLowerCase()==="wss"}var handler$2={scheme:"ws",domainHost:true,parse:function parse(components,options){var wsComponents=components;wsComponents.secure=isSecure(wsComponents);wsComponents.resourceName=(wsComponents.path||"/")+(wsComponents.query?"?"+wsComponents.query:"");wsComponents.path=undefined;wsComponents.query=undefined;return wsComponents},serialize:function serialize(wsComponents,options){if(wsComponents.port===(isSecure(wsComponents)?443:80)||wsComponents.port===""){wsComponents.port=undefined}if(typeof wsComponents.secure==="boolean"){wsComponents.scheme=wsComponents.secure?"wss":"ws";wsComponents.secure=undefined}if(wsComponents.resourceName){var _wsComponents$resourc=wsComponents.resourceName.split("?"),_wsComponents$resourc2=slicedToArray(_wsComponents$resourc,2),path=_wsComponents$resourc2[0],query=_wsComponents$resourc2[1];wsComponents.path=path&&path!=="/"?path:undefined;wsComponents.query=query;wsComponents.resourceName=undefined}wsComponents.fragment=undefined;return wsComponents}};var handler$3={scheme:"wss",domainHost:handler$2.domainHost,parse:handler$2.parse,serialize:handler$2.serialize};var O={};var isIRI=true;var UNRESERVED$$="[A-Za-z0-9\\-\\.\\_\\~"+(isIRI?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var HEXDIG$$="[0-9A-Fa-f]";var PCT_ENCODED$=subexp(subexp("%[EFef]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%[89A-Fa-f]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%"+HEXDIG$$+HEXDIG$$));var ATEXT$$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var QTEXT$$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var VCHAR$$=merge(QTEXT$$,"[\\\"\\\\]");var SOME_DELIMS$$="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var UNRESERVED=new RegExp(UNRESERVED$$,"g");var PCT_ENCODED=new RegExp(PCT_ENCODED$,"g");var NOT_LOCAL_PART=new RegExp(merge("[^]",ATEXT$$,"[\\.]","[\\\"]",VCHAR$$),"g");var NOT_HFNAME=new RegExp(merge("[^]",UNRESERVED$$,SOME_DELIMS$$),"g");var NOT_HFVALUE=NOT_HFNAME;function decodeUnreserved(str){var decStr=pctDecChars(str);return!decStr.match(UNRESERVED)?str:decStr}var handler$4={scheme:"mailto",parse:function parse$$1(components,options){var mailtoComponents=components;var to=mailtoComponents.to=mailtoComponents.path?mailtoComponents.path.split(","):[];mailtoComponents.path=undefined;if(mailtoComponents.query){var unknownHeaders=false;var headers={};var hfields=mailtoComponents.query.split("&");for(var x=0,xl=hfields.length;x<xl;++x){var hfield=hfields[x].split("=");switch(hfield[0]){case"to":var toAddrs=hfield[1].split(",");for(var _x=0,_xl=toAddrs.length;_x<_xl;++_x){to.push(toAddrs[_x])}break;case"subject":mailtoComponents.subject=unescapeComponent(hfield[1],options);break;case"body":mailtoComponents.body=unescapeComponent(hfield[1],options);break;default:unknownHeaders=true;headers[unescapeComponent(hfield[0],options)]=unescapeComponent(hfield[1],options);break}}if(unknownHeaders)mailtoComponents.headers=headers}mailtoComponents.query=undefined;for(var _x2=0,_xl2=to.length;_x2<_xl2;++_x2){var addr=to[_x2].split("@");addr[0]=unescapeComponent(addr[0]);if(!options.unicodeSupport){try{addr[1]=punycode.toASCII(unescapeComponent(addr[1],options).toLowerCase())}catch(e){mailtoComponents.error=mailtoComponents.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}}else{addr[1]=unescapeComponent(addr[1],options).toLowerCase()}to[_x2]=addr.join("@")}return mailtoComponents},serialize:function serialize$$1(mailtoComponents,options){var components=mailtoComponents;var to=toArray(mailtoComponents.to);if(to){for(var x=0,xl=to.length;x<xl;++x){var toAddr=String(to[x]);var atIdx=toAddr.lastIndexOf("@");var localPart=toAddr.slice(0,atIdx).replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_LOCAL_PART,pctEncChar);var domain=toAddr.slice(atIdx+1);try{domain=!options.iri?punycode.toASCII(unescapeComponent(domain,options).toLowerCase()):punycode.toUnicode(domain)}catch(e){components.error=components.error||"Email address's domain name can not be converted to "+(!options.iri?"ASCII":"Unicode")+" via punycode: "+e}to[x]=localPart+"@"+domain}components.path=to.join(",")}var headers=mailtoComponents.headers=mailtoComponents.headers||{};if(mailtoComponents.subject)headers["subject"]=mailtoComponents.subject;if(mailtoComponents.body)headers["body"]=mailtoComponents.body;var fields=[];for(var name2 in headers){if(headers[name2]!==O[name2]){fields.push(name2.replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_HFNAME,pctEncChar)+"="+headers[name2].replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_HFVALUE,pctEncChar))}}if(fields.length){components.query=fields.join("&")}return components}};var URN_PARSE=/^([^\:]+)\:(.*)/;var handler$5={scheme:"urn",parse:function parse$$1(components,options){var matches=components.path&&components.path.match(URN_PARSE);var urnComponents=components;if(matches){var scheme=options.scheme||urnComponents.scheme||"urn";var nid=matches[1].toLowerCase();var nss=matches[2];var urnScheme=scheme+":"+(options.nid||nid);var schemeHandler=SCHEMES[urnScheme];urnComponents.nid=nid;urnComponents.nss=nss;urnComponents.path=undefined;if(schemeHandler){urnComponents=schemeHandler.parse(urnComponents,options)}}else{urnComponents.error=urnComponents.error||"URN can not be parsed."}return urnComponents},serialize:function serialize$$1(urnComponents,options){var scheme=options.scheme||urnComponents.scheme||"urn";var nid=urnComponents.nid;var urnScheme=scheme+":"+(options.nid||nid);var schemeHandler=SCHEMES[urnScheme];if(schemeHandler){urnComponents=schemeHandler.serialize(urnComponents,options)}var uriComponents=urnComponents;var nss=urnComponents.nss;uriComponents.path=(nid||options.nid)+":"+nss;return uriComponents}};var UUID=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var handler$6={scheme:"urn:uuid",parse:function parse(urnComponents,options){var uuidComponents=urnComponents;uuidComponents.uuid=uuidComponents.nss;uuidComponents.nss=undefined;if(!options.tolerant&&(!uuidComponents.uuid||!uuidComponents.uuid.match(UUID))){uuidComponents.error=uuidComponents.error||"UUID is not valid."}return uuidComponents},serialize:function serialize(uuidComponents,options){var urnComponents=uuidComponents;urnComponents.nss=(uuidComponents.uuid||"").toLowerCase();return urnComponents}};SCHEMES[handler.scheme]=handler;SCHEMES[handler$1.scheme]=handler$1;SCHEMES[handler$2.scheme]=handler$2;SCHEMES[handler$3.scheme]=handler$3;SCHEMES[handler$4.scheme]=handler$4;SCHEMES[handler$5.scheme]=handler$5;SCHEMES[handler$6.scheme]=handler$6;exports2.SCHEMES=SCHEMES;exports2.pctEncChar=pctEncChar;exports2.pctDecChars=pctDecChars;exports2.parse=parse;exports2.removeDotSegments=removeDotSegments;exports2.serialize=serialize;exports2.resolveComponents=resolveComponents;exports2.resolve=resolve;exports2.normalize=normalize;exports2.equal=equal;exports2.escapeComponent=escapeComponent;exports2.unescapeComponent=unescapeComponent;Object.defineProperty(exports2,"__esModule",{value:true})})});var require_valid_url=__commonJS(function(exports,module){(function(module2){module2.exports.is_uri=is_iri;module2.exports.is_http_uri=is_http_iri;module2.exports.is_https_uri=is_https_iri;module2.exports.is_web_uri=is_web_iri;module2.exports.isUri=is_iri;module2.exports.isHttpUri=is_http_iri;module2.exports.isHttpsUri=is_https_iri;module2.exports.isWebUri=is_web_iri;var splitUri=function(uri){var splitted=uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return splitted};function is_iri(value){if(!value){return}if(/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value))return;if(/%[^0-9a-f]/i.test(value))return;if(/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value))return;var splitted=[];var scheme="";var authority="";var path="";var query="";var fragment="";var out="";splitted=splitUri(value);scheme=splitted[1];authority=splitted[2];path=splitted[3];query=splitted[4];fragment=splitted[5];if(!(scheme&&scheme.length&&path.length>=0))return;if(authority&&authority.length){if(!(path.length===0||/^\//.test(path)))return}else{if(/^\/\//.test(path))return}if(!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase()))return;out+=scheme+":";if(authority&&authority.length){out+="//"+authority}out+=path;if(query&&query.length){out+="?"+query}if(fragment&&fragment.length){out+="#"+fragment}return out}function is_http_iri(value,allowHttps){if(!is_iri(value)){return}var splitted=[];var scheme="";var authority="";var path="";var port="";var query="";var fragment="";var out="";splitted=splitUri(value);scheme=splitted[1];authority=splitted[2];path=splitted[3];query=splitted[4];fragment=splitted[5];if(!scheme)return;if(allowHttps){if(scheme.toLowerCase()!="https")return}else{if(scheme.toLowerCase()!="http")return}if(!authority){return}if(/:(\d+)$/.test(authority)){port=authority.match(/:(\d+)$/)[0];authority=authority.replace(/:\d+$/,"")}out+=scheme+":";out+="//"+authority;if(port){out+=port}out+=path;if(query&&query.length){out+="?"+query}if(fragment&&fragment.length){out+="#"+fragment}return out}function is_https_iri(value){return is_http_iri(value,true)}function is_web_iri(value){return is_http_iri(value)||is_https_iri(value)}})(module)});var require_fast_deep_equal=__commonJS(function(exports,module){module.exports=function equal(a,b){if(a===b)return true;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;for(i=length;i--!==0;){var key=keys[i];if(!equal(a[key],b[key]))return false}return true}return a!==a&&b!==b}});var exports_dist={};__export(exports_dist,{addKeywords:()=>Fr,compileSchema:()=>Qi,draft04:()=>Yr,draft06:()=>oi,draft07:()=>di,draft2019:()=>Ei,draft2020:()=>Ji,draftEditor:()=>$i,extendDraft:()=>Pr,getSchemaType:()=>L,getTypeOf:()=>u,isAnnotation:()=>Ae,isBooleanSchema:()=>S,isJsonAnnotation:()=>je,isJsonError:()=>C,isJsonSchema:()=>x,isReduceable:()=>Se,isSchemaNode:()=>b2,mergeNode:()=>g,mergeSchema:()=>h,oneOfFuzzyKeyword:()=>pn,oneOfKeyword:()=>fn,propertyDependenciesKeyword:()=>ta,render:()=>me,sanitizeErrors:()=>s2,settings:()=>c2});function s2(e,t=[]){if(!Array.isArray(e))return e===undefined?[]:[e];for(let n of e)Array.isArray(n)?s2(n,t):(Ae(n)||n instanceof Promise)&&t.push(n);return t}function u(e){let t=l.call(e).slice(8,-1).toLowerCase();return t===`file`?`object`:t}function d(e){return u(e)===`object`}function f(e){let t=e===undefined?{}:{type:u(e)};return t.type===`object`&&d(e)&&(t.properties={},Object.keys(e).forEach((n)=>t.properties[n]=f(e[n]))),t.type===`array`&&Array.isArray(e)&&(e.length===1?t.items=f(e[0]):(t.items=e.map(f),t.items.find((e)=>e.type!==t.items[0].type)??(t.items=t.items[0]))),t}function ee(e,t){t!=null&&Object.values(t).forEach((t)=>p(t,e))}function te(e,t){t?.forEach((t)=>p(t,e))}function p(e,t=[]){return b2(e)?(t.push(e),ee(t,e.$defs),e.additionalProperties&&p(e.additionalProperties,t),te(t,e.allOf),te(t,e.anyOf),e.contains&&p(e.contains,t),ee(t,e.dependentSchemas),e.if&&p(e.if,t),e.else&&p(e.else,t),e.then&&p(e.then,t),e.items&&p(e.items,t),te(t,e.prefixItems),e.not&&p(e.not,t),te(t,e.oneOf),e.patternProperties&&Object.values(e.patternProperties).forEach(({node:e})=>p(e,t)),ee(t,e.properties),e.propertyNames&&p(e.propertyNames,t),e.unevaluatedProperties&&p(e.unevaluatedProperties,t),e.unevaluatedItems&&p(e.unevaluatedItems,t),t):t}function m(e,t){return t==null?e?.replace(re,``)??`#`:e==null||e===`#`?t?.replace(re,``):t[0]===`#`?e[0]===`/`?t:`${e.replace(ae,``)}${t.replace(ne,``)}`:ie.test(t)?t.replace(re,``):import_uri_js.resolve(e,t??``)??`#`}function h(e,t,...n){if(t?.type===`error`)return t;if(e?.type===`error`||u(e)!==u(t))return e;let r=oe(e,t);for(let e of n)delete r[e];return r}function oe(e,t,n){if(d(e)&&d(t)){let n={};return[...Object.keys(e),...Object.keys(t)].filter((e,t,n)=>n.indexOf(e)===t).forEach((r)=>n[r]=oe(e[r],t[r],r)),n}let r=Array.isArray(e),i=Array.isArray(t);if(r&&i){if(n===`required`||n===`anyOf`)return e.concat(t).filter((e,t,n)=>n.indexOf(e)===t);if(n===`items`||n===`prefixItems`){let n=[];for(let r=0;r<t.length;r+=1)d(e[r])&&d(t[r])&&e[r].type===t[r].type?n[r]=oe(e[r],t[r]):n.push(t[r]??e[r]);return n}let r=[],i=[];for(let n=0;n<Math.max(e.length,t.length);n+=1)d(e[n])&&d(t[n])?r[n]=oe(e[n],t[n]):e[n]!==undefined&&t[n]!==undefined?(r[n]=e[n],i.push(t[n])):e[n]===undefined?t[n]!==undefined&&i.push(t[n]):r[n]=e[n];return[...r,...i].filter((e,t,n)=>n.indexOf(e)===t)}if(n===`type`&&(r||i)){if(r&&e.includes(t))return t;if(i&&t.includes(e))return e;if(r)return[...e,t];if(i)return[...t,e]}return i?t:r||t===undefined?e:t}function se(e,t){return(t.order??0)-(e.order??0)}function ce(e,t,n){if(e==null||n.indexOf(e)!==t)return false;let r=e.toJSON?.()??e.name;return n.find((e,n)=>(e.toJSON?.()??e.name)===r&&n===t)}function le(e,t){if(e==null||t==null)return t||e;let n={};return[...Object.keys(e),...Object.keys(t)].filter((e,t,n)=>n.indexOf(e)===t).forEach((r)=>{let i=g(e[r],t[r]);b2(i)&&(n[r]=i)}),n}function ue(e,t){return e==null||t==null?t||e:e.concat(t).filter((e,t,n)=>n.indexOf(e)===t)}function de(e,t){if(e==null||t==null)return e||t;let n=[...e],r=e.map((e)=>e.node.evaluationPath);return t.forEach((e)=>{r.includes(e.node.evaluationPath)||n.push(e)}),n}function g(e,t,...n){if(e==null||t==null)return e||t;let r={};e.items&&t.prefixItems||e.prefixItems&&t.items?t.prefixItems?r.prefixItems=t.prefixItems:r.items=t.items:(r.prefixItems=t.prefixItems??e.prefixItems,r.items=g(e.items,t.items));let i={...e,...t,...r,dynamicId:we(e.dynamicId,t.dynamicId),oneOfIndex:e.oneOfIndex??t.oneOfIndex,schema:h(e.schema,t.schema,...n),parent:e.parent,resolvers:e.resolvers.concat(t.resolvers).filter(ce).sort(se),reducers:e.reducers.concat(t.reducers).filter(ce).sort(se),validators:e.validators.concat(t.validators).filter(ce).sort(se),additionalProperties:g(e.additionalProperties,t.additionalProperties),contains:g(e.contains,t.contains),enum:ue(e.enum,t.enum),if:g(e.if,t.if),then:g(e.then,t.then),else:g(e.else,t.else),not:g(e.not,t.not),propertyNames:g(e.propertyNames,t.propertyNames),unevaluatedProperties:g(e.unevaluatedProperties,t.unevaluatedProperties),unevaluatedItems:g(e.unevaluatedItems,t.unevaluatedItems),$defs:le(e.$defs,t.$defs),patternProperties:de(e.patternProperties,t.patternProperties),properties:le(e.properties,t.properties),required:ue(e.required,t.required)};function a(e){let t=e.toJSON?.()??e.name;return i.schema?.[t]===undefined?(i[t]=undefined,false):true}return n?.forEach((e)=>i[e]=undefined),i.resolvers=i.resolvers.filter(a),i.reducers=i.reducers.filter(a),i.validators=i.validators.filter(a),i}function fe(e,...t){let n={};return Object.keys(e).forEach((r)=>{t.includes(r)||(n[r]=e[r])}),n}function pe(e,...t){if(!d(e)||t.length===0)return e;let n={};return t.forEach((t)=>{e[t]!==undefined&&(n[t]=e[t])}),n}function me(e,t={}){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>{let r=t[n];return r==null?``:typeof r==`object`?JSON.stringify(r):String(r)})}function _2(e,t,n,r){if(C(e))return[e];r.push({pointer:n,node:e});let i=e.schema;if(i===true)return[];if(i===false)return[e.createError(`invalid-data-error`,{value:t,pointer:n,schema:e.schema})];let a=[];for(let i of e.validators){let o=i({node:e,data:t,pointer:n,path:r});Array.isArray(o)?a.push(...o):o&&a.push(o)}return s2(a)}function y2(e,t){if(d(e)&&v2(e,`${t}`)||Array.isArray(e))return e[t]}function ge(e,t,n={}){n.path=n.path??[],n.withSchemaWarning=n.withSchemaWarning??false,n.pointer=n.pointer??`#`;let i=this,a=o(e);if(a.length===0){let e=i.resolveRef(n);return C(e)?{node:undefined,error:e}:{node:e,error:undefined}}let o2=`#`,s=i;for(let e=0,r=a.length;e<r;e+=1){o2=`${o2}/${a[e]}`;let r=s.getNodeChild(a[e],t,{...n,pointer:o2});if(r.error||r.node==null)return r;s=r.node,t=y2(t,a[e])}let{node:c,error:l}=s.resolveRef(n).reduceNode(t);return C(l)?{node:undefined,error:l}:b2(c)?{node:c,error:undefined}:{error:undefined}}function _e(e,t,n={}){n.path=n.path??[],n.withSchemaWarning=n.withSchemaWarning??false,n.pointer=n.pointer??`#`;let{path:r,pointer:i}=n,a=this;if(a.reducers.length){let n=a.reduceNode(t,{key:e,path:r,pointer:i});if(n.error)return n;b2(n.node)&&(a=n.node)}for(let n of a.resolvers){let o=n({data:t,key:e,node:a});if(C(o))return{node:undefined,error:o};if(b2(o))return{node:o.resolveRef({pointer:i,path:r}),error:undefined}}return n.createSchema===true?{node:a.compileSchema(a.createSchema(y2(t,e)),`${a.evaluationPath}/additional`,`${a.schemaLocation}/additional`),error:undefined}:n.withSchemaWarning===true?{node:undefined,error:a.createError(`schema-warning`,{pointer:i,value:t,schema:a.schema,key:e})}:{node:undefined}}function b2(e){return d(e)&&Array.isArray(e?.reducers)&&Array.isArray(e?.resolvers)}function Se(e){for(let t=0,n=ve.length;t<n;t+=1)if(v2(e,ve[t]))return true;return false}function Ce(e,t){if(!Array.isArray(e)||e.length===0)throw Error(`Missing drafts in 'compileSchema({ $schema: "${t}" })'`);return e.length===1?e[0]:e.find((e)=>new RegExp(e.$schemaRegEx,ye).test(t))??e[e.length-1]}function we(e,t){return e==t?e??``:e==null||t==null?(e||t)??``:e.startsWith(t)?e:t.startsWith(e)?t:`${e}+${t}`}function Oe(e){if(e.schema.$ref&&De.includes(e.context.version))return e.context.keywords.filter(({keyword:e})=>Ee.includes(e)).map((t)=>ke(t,e));let t=Object.keys(e.schema),n=e.context.keywords.filter(({keyword:e})=>Ee.includes(e)||t.includes(e)).map((t)=>ke(t,e));return t.filter((t)=>!t.startsWith(`x-`)&&!xe.includes(t)&&e.context.keywords.find((e)=>e.keyword===t)==null).forEach((t)=>{n.push(e.createAnnotation(`unknown-keyword-warning`,{$id:e.$id,pointer:`${e.schemaLocation}/${t}`,schema:e.schema,value:t,draft:e.getDraftVersion()}))}),n}function ke(e,t){let n=e.parse?.(t);return e.reduce&&e.addReduce?.(t)&&t.reducers.push(e.reduce),e.resolve&&e.addResolve?.(t)&&t.resolvers.push(e.resolve),e.validate&&e.addValidate?.(t)&&t.validators.push(e.validate),n}function x(e){return d(e)}function S(e){return typeof e==`boolean`}function Ae(e){return d(e)&&(e?.type&&e?.code&&e?.data)!=null}function je(e){return d(e)&&e.type===`annotation`}function C(e){return d(e)&&e.type===`error`}function w(e){return typeof e==`number`}function Pe(e){if(Ne.includes(e))return[];if(e=e.replace(Me,``),e.indexOf(`#`)===-1)return[e.replace(/(#|\/)+$/g,``)];if(e.indexOf(`#`)===0)return[e.replace(Me,``)];let t=e.split(`#`);return t[0]=t[0].replace(/(#|\/)+$/g,``),t[1]=`#${t[1].replace(Me,``)}`,t}function Ie(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function Le(e){e.resolveRef=ze;let n=m(e.parent?.$id,e.schema?.$id);e.$id=n,e.lastIdPointer=e.parent?.lastIdPointer??`#`,n!==e.parent?.$id&&e.evaluationPath!==`#`&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)&&Ie(e,m(n,`#${e.evaluationPath.replace(e.lastIdPointer,``)}`)),Ie(e,m(e.context.rootNode.$id,e.evaluationPath));let r=e.schema.$anchor;if(r){let t=`${n.replace(/#$/,``)}#${r}`;e.context.anchors[t]??(e.context.anchors[t]=e)}let i=e.schema.$dynamicAnchor;if(i){let t=`${n.replace(/#$/,``)}#${i}`;e.context.dynamicAnchors[t]??(e.context.dynamicAnchors[t]=e)}if(e.schema.$ref&&(e.$ref=m(n,e.schema.$ref),e.$ref.startsWith(`/`)&&(e.$ref=`#${e.$ref}`)),e.$ref?.startsWith(`#/$defs/`)&&s(e.getNodeRoot().schema,e.$ref)==null)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/$ref`,schema:e.schema,value:e.schema.$ref,message:`Invalid $ref to missing target '${e.schema.ref}'`})}function Re({node:e,data:t,key:n,pointer:r,path:i}){if(e==null)return;let a=e.resolveRef({pointer:r,path:i});if(a==null)return e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$dynamicRef,pointer:r,schema:e.schema,value:t});if(a.schemaLocation===e.schemaLocation)return a;let{node:o,error:s}=g(e,a).reduceNode(t,{key:n,pointer:r,path:i});return o??s}function ze({pointer:e,path:t=[]}={}){if(this.schema.$dynamicRef){let n=Ve(this,t);return C(n)||t.push({pointer:e,node:n}),n}if(this.$ref==null)return this;let n=He(this);return b2(n)&&t.push({pointer:e,node:n}),n}function Be({node:e,data:t,pointer:n=`#`,path:r}){let i=e.resolveRef({pointer:n,path:r});return i==null?e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$dynamicRef,pointer:n,schema:e.schema,value:t}):_2(i,t,n,r)}function Ve(e,t){let n=t,r=m(e.$id,e.schema.$dynamicRef);if(e.context.dynamicAnchors[r]==null&&e.context.anchors[r])return T(e.context.anchors[r],e);for(let t of n){if(t.node.schema.$dynamicAnchor)return T(t.node,e);let n=e.schema.$dynamicRef.split(`#`).pop(),r=m(t.node.$id,`#${n}`);if(e.context.dynamicAnchors[r])return T(e.context.dynamicAnchors[r],e)}return He(e,r)}function T(e,t){let n=e.schema;return d(e.schema)&&(n={...fe(e.schema,`$id`),...pe(t.schema,...c2.PROPERTIES_TO_MERGE)}),e.compileSchema(n,`${t.evaluationPath}/$ref`,e.schemaLocation)}function He(e,n=e?.$ref){if(n==null)return e;if(e.context.refs[n])return T(e.context.refs[n],e);if(e.context.anchors[n])return T(e.context.anchors[n],e);if(e.context.dynamicAnchors[n])return T(e.context.dynamicAnchors[n],e);let i=Pe(n);if(i.length===0)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(i.length===1){let n=i[0];if(e.context.remotes[n])return T(e.context.remotes[n],e);if(n[0]===`#`){let r=e.context.rootNode.schema,i=s(r,n);if(i)return e.compileSchema(i,`${e.evaluationPath}/$ref`,n)}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(i.length===2){let t=i[0];if(e.context.remotes[t]&&e!==e.context.remotes[t]){let r=e.context.remotes[t],a=He(r,n);if(a||(a=He(r,i[1]),a))return a}if(e.context.refs[t]){let a=e.context.refs[t],o2=o(i[1]),s=a;for(let t of o2)if(s=s[t===`definitions`?`$defs`:t],s==null)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined,host:i[0],local:i[1]});return s}}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function E(e,...t){return t.reduce((e,t)=>(t.schemaValidation&&e.push(...t.schemaValidation),e),e)}function We(e){let t=[];return e.schema.$defs&&(d(e.schema.$defs)?(e.$defs=e.$defs??{},Object.keys(e.schema.$defs).forEach((n)=>{e.$defs[n]=e.compileSchema(e.schema.$defs[n],`${e.evaluationPath}/$defs/${Ge(n)}`,`${e.schemaLocation}/$defs/${n}`),E(t,e.$defs[n])})):t.push(e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:e.schema.$defs,message:`$defs must be an object - received: ${typeof e.schema.$defs}`}))),e.schema.definitions&&(d(e.schema.definitions)||t.push(e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:e.schema.$defs,message:`definitions must be an object - received: ${typeof e.schema.definitions}`})),e.$defs=e.$defs??{},Object.keys(e.schema.definitions).forEach((n)=>{e.$defs[n]=e.compileSchema(e.schema.definitions[n],`${e.evaluationPath}/definitions/${Ge(n)}`,`${e.schemaLocation}/definitions/${Ge(n)}`),E(t,e.$defs[n])})),t}function Ge(e){return e=e.replace(/~/g,`~0`),e=e.replace(/\//g,`~1`),encodeURIComponent(e)}function qe(e){let t=e.parent?.$id;if(e.schema?.$ref??(t=m(e.parent?.$id,e.schema?.$id)),e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,e.resolveRef=ze,e.context.refs[t]??(e.context.refs[t]=e),t!==e.parent?.$id&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)){let n=`#${e.evaluationPath.replace(e.lastIdPointer,``)}`;e.context.refs[m(t,n)]=e}else e.context.refs[m(t,e.evaluationPath)]=e;e.context.refs[m(e.context.rootNode.$id,e.evaluationPath)]=e,e.schema.$ref&&(e.$ref=m(t,e.schema.$ref))}function Je({node:e,data:t,pointer:n=`#`,path:r}){let i=Ye(e,n,r);return b2(i)?_2(i,t,n,r):e.createError(`ref-error`,{ref:e.schema.$ref,pointer:n,schema:e.schema,value:t})}function Ye(e,t,n){let r=e.resolveRef({pointer:t,path:n});return b2(r)?r!==e&&r?Ye(r,t,n):e:e.createError(`ref-error`,{ref:e.schema.$ref,pointer:t,schema:e.schema,value:undefined})}function Ze(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function Qe(e){let t=e.parent?.$id;if(e.schema?.$ref==null&&e.schema?.id&&(t=m(e.parent?.$id,e.schema.id)),e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,e.resolveRef=$e,e.context.refs[t]??(e.context.refs[t]=e),t!==e.parent?.$id&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)){let n=`#${e.evaluationPath.replace(e.lastIdPointer,``)}`;Ze(e,m(t,n))}else Ze(e,m(t,e.evaluationPath));Ze(e,m(e.context.rootNode.$id,e.evaluationPath)),e.schema.$ref&&(e.$ref=m(t,e.schema.$ref))}function $e({pointer:e,path:t}={}){if(this.$ref==null)return this;let n=tt(this);return b2(n)&&t?.push({pointer:e,node:n}),n}function et(e,t=e.evaluationPath){let n=d(e.schema)?fe(e.schema,`id`):e.schema;return e.compileSchema(n,`${t}/$ref`,n.schemaLocation)}function tt(e,t=e?.$ref){if(t==null)return e;if(e.context.refs[t])return et(e.context.refs[t],e.evaluationPath);if(e.context.anchors[t])return et(e.context.anchors[t],e.evaluationPath);let n=Pe(t);if(n.length===0)return e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(n.length===1){let t=n[0];return e.context.remotes[t]?et(e.context.remotes[t],e.evaluationPath):e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(n.length===2){let r=n[0];if(e.context.remotes[r]&&e!==e.context.remotes[r]){let i=e.context.remotes[r],a=tt(i,t);if(a||(a=tt(i,n[1]),a))return a}let i=n[0];if(e.context.refs[i]){let t=e.context.refs[i],r=n[1].split(`$defs/`).pop();if(r&&t?.$defs)return tt(t.$defs[r])}return}return e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function it(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t.additionalItems==null||t.additionalItems===false)return;let i=t[nt];if(!(d(i)||i===true))return e.createError(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${nt}' must be an object or a boolean - received '${typeof i}'`});if(!Array.isArray(t.items))return e.createAnnotation(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${nt}' is only evaluated with a given items-array`});e.items=e.compileSchema(t.additionalItems,`${n}/additionalItems`,`${r}/additionalItems`)}function at({node:e,key:t,data:n}){if(Array.isArray(n)){let r=y2(n,t),{node:i,error:a}=e.items.reduceNode(r);return i??a}}function ot({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||Array.isArray(i.items)&&i.items.length>=t.length)return;let a=Array.isArray(i.items)?i.items.length:0,o=[];for(let s=a;s<t.length;s+=1){let a=t[s];if(e.items){let t=_2(e.items,a,`${n}/${s}`,r);t&&o.push(...t)}else i.additionalItems===false&&o.push(e.createError(`additional-items-error`,{key:s,pointer:`${n}/${s}`,value:t,schema:i}))}return o}function ct(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(!(t.additionalProperties==null||S(t.additionalProperties)))return d(t.additionalProperties)?(e.additionalProperties=e.compileSchema(t.additionalProperties,`${n}/additionalProperties`,`${r}/additionalProperties`),e.additionalProperties.schemaValidation):e.createError(`schema-error`,{pointer:e.schemaLocation,schema:t,value:t.additionalProperties,message:`keyword 'additionalProperties' must be a valid JSON Schema - receoved: ${typeof t.additionalProperties}`})}function lt({node:e,data:t,key:n}){let r=y2(t,n);if(e.additionalProperties){let{node:t,error:n}=e.additionalProperties.reduceNode(r);return t??n}if(e.schema.additionalProperties===false)return e.createError(`no-additional-properties-error`,{pointer:`${n}`,schema:e.schema,value:y2(t,n),property:`${n}`})}function ut({node:e,data:t,pointer:n=`#`,path:r}){if(!d(t))return;let{schema:i}=e,a=[],o=Object.keys(t).filter((e)=>c2.propertyBlacklist.includes(e)===false),s=e.patternProperties;Array.isArray(s)&&(o=o.filter((e)=>{for(let t of s)if(t.pattern.test(e))return false;return true}));let l=e.properties?Object.keys(e.properties):[];return o.filter((e)=>l.indexOf(e)===-1).forEach((o)=>{let s=y2(t,o);if(s!==undefined)if(d(e.additionalProperties)){let t=_2(e.additionalProperties,s,`${n}/${o}`,r);t&&a.push(...t)}else a.push(e.createError(`no-additional-properties-error`,{pointer:`${n}/${o}`,schema:i,value:t,property:o,properties:l}))}),a}function ft(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[D]!=null){if(!Array.isArray(t[D]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[D],message:`Keyword '${D}' must be an array - received '${typeof t[D]}'`});if(t[D].length!==0)return e[D]=t[D].map((t,i)=>e.compileSchema(t,`${n}/${D}/${i}`,`${r}/${D}/${i}`)),E([],...e[D])}}function pt({node:e,data:t,key:n,pointer:r,path:i}){if(e[D]==null)return;let a={},o=``;for(let s=0;s<e[D].length;s+=1){let{node:c}=e[D][s].reduceNode(t,{key:n,pointer:r,path:i});if(c){let t=c.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`${D}/${s}`:t;o+=`${o===``?``:`,`}${n}`;let r=h(e[D][s].schema,c.schema);a=h(a,r,D,`contains`)}}return e.compileSchema(a,`${e.evaluationPath}/${o}`,e.schemaLocation,`${e.schemaLocation}(${o})`)}function mt({node:e,data:t,pointer:n,path:r}){if(!Array.isArray(e[D])||e[D].length===0)return;let i=[];return e[D].forEach((e)=>{i.push(..._2(e,t,n,r))}),i}function gt(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[O]!=null){if(!Array.isArray(t[O]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[O],message:`Keyword '${O}' must be an array - received '${typeof t[O]}'`});if(t[O].length!==0)return e[O]=t[O].map((t,i)=>e.compileSchema(t,`${n}/${O}/${i}`,`${r}/${O}/${i}`)),E([],...e[O])}}function _t({node:e,data:t,pointer:n,path:r}){if(e[O]==null)return;let i={},a=``;for(let o=0;o<e[O].length;o+=1)if(_2(e[O][o],t,n,r).length===0){let{node:n}=e[O][o].reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``)??``,r=t===``?`${O}/${o}`:t;a+=`${a===``?``:`,`}${r}`;let s=h(e[O][o].schema,n.schema);i=h(i,s,O)}}return e.compileSchema(i,`${e.evaluationPath}${a}`,e.schemaLocation,`${e.schemaLocation}(${a})`)}function vt({node:e,data:t,pointer:n,path:r}){if(e[O]!=null){for(let i of e[O])if(_2(i,t,n,r).length===0)return;return e.createError(`any-of-error`,{pointer:n,schema:e.schema,value:t,anyOf:e.schema[O]})}}function bt(e){let t=e.schema[k];if(t!=null)return x(t)||S(t)?(e[k]=e.compileSchema(t,`${e.evaluationPath}/${k}`),e[k].schemaValidation):e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${k}`,schema:e.schema,value:t,message:`Keyword '${k}' must be a valid JSON Schema - received '${typeof t}'`})}function xt({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t))return;if(i.contains===false)return e.createError(`contains-array-error`,{pointer:n,value:t,schema:i});if(i.contains===true)return Array.isArray(t)&&t.length===0?e.createError(`contains-any-error`,{pointer:n,value:t,schema:i}):undefined;if(!d(i.contains)||!Array.isArray(t))return;let a=0;for(let i of t)_2(e.contains,i,n,r).length===0&&a++;let o=i.maxContains??1/0,s=i.minContains??1;if(!(o>=a&&s<=a))return o<a?e.createError(`contains-max-error`,{pointer:n,schema:i,delta:a-o,value:t}):s>a?e.createError(`contains-min-error`,{pointer:n,schema:i,delta:s-a,value:t}):e.createError(`contains-error`,{pointer:n,schema:i,value:t})}function St(e){return Array.isArray(e)&&e.find((e)=>typeof e!=`string`)==null}function wt(e){let{schema:t}=e;if(t[A]==null)return;if(!d(t[A]))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${A}`,schema:t,value:t[A],message:`Keyword '${A}' must be an object - received '${typeof t[A]}'`});let n=[];e.dependentRequired={};for(let r of Object.keys(t[A])){let i=t[A][r];St(i)?e.dependentRequired[r]=i:n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${A}/${r}`,schema:t,value:i,message:`Keyword '${A}[string]' must be a string[] - received '${typeof i}'`}))}return n}function Tt({node:e,data:t,pointer:n=`#`}){let{dependentRequired:r}=e;if(r==null||!d(t))return;let i=[];return Object.keys(t).forEach((a)=>{let o=r[a];if(Array.isArray(o))for(let r=0,a=o.length;r<a;r+=1)t[o[r]]===undefined&&i.push(e.createError(`missing-dependency-error`,{missingProperty:o[r],pointer:n,schema:e.schema,value:t}))}),i}function Dt(e){let{dependentSchemas:t}=e.schema;if(t==null)return;if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${j}`,schema:e.schema,value:t,message:`Keyword '${j}' must be an object - received '${typeof t}'`});if(Object.keys(t).length===0)return;let n=[],r={};for(let i of Object.keys(t)){let a=t[i];d(a)?(r[i]=e.compileSchema(a,`${e.evaluationPath}/${j}/${i}`,`${e.schemaLocation}/${j}/${i}`),E(n,r[i])):S(a)?r[i]=a:n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${j}/${i}`,schema:e.schema,value:a,message:`Keyword '${j}[string]' must be a valid JSON Schema'`}))}return e.dependentSchemas=r,n}function Ot({node:e,data:t}){let{dependentSchemas:n}=e;if(!d(t)||n==null)return e;let r,i=0,a=`${e.schemaLocation}(`;return Object.keys(t).forEach((e)=>{n[e]!=null&&(r??={properties:{}},b2(n[e])?r=h(r,n[e].schema):r.properties[e]=n[e],a+=`${i?`,`:``}${j}/${e}`,i++)}),r==null?e:(r=h(e.schema,r,j),e.compileSchema(r,e.evaluationPath,e.schemaLocation,`${a})`))}function kt({node:e,data:t,pointer:n,path:r}){let{schema:i,dependentSchemas:a}=e;if(!d(t)||a==null)return;let o=[];return Object.keys(t).forEach((c)=>{let l=a[c];if(l!==true){if(l===false){o.push(e.createError(`missing-dependency-error`,{pointer:n,schema:i,value:t}));return}if(b2(l)){s2(_2(l,t,n,r),o);return}}}),o}function jt(e){let{dependencies:t}=e.schema;if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${M}`,schema:e.schema,value:t,message:`Keyword '${M}' must be an object - received ${typeof t}`});let n=[];for(let r of Object.keys(t)){let i=t[r];x(i)||S(i)?(e.dependentSchemas=e.dependentSchemas??{},e.dependentSchemas[r]=e.compileSchema(i,`${e.evaluationPath}/${M}/${r}`,`${e.schemaLocation}/${M}/${r}`),E(n,e.dependentSchemas[r])):St(i)?(e.dependentRequired=e.dependentRequired??{},e.dependentRequired[r]=i):n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${M}`,schema:e.schema,value:t,message:`Keyword '${M}[string]' must be JSON Schema or string[]`}))}return n}function Mt({node:e,data:t,key:n,pointer:r,path:i}){if(!d(t)||e.dependentRequired==null&&e.dependentSchemas==null)return e;let a=e.compileSchema(e.schema,e.evaluationPath,e.schemaLocation),o=a.schema.required??[],s=``,c=e.dependentRequired;c&&Object.keys(c).forEach((e)=>{if(!v2(t,e)&&!o.includes(e)||c[e]==null)return;o.push(...c[e]);let n=`${M}/${e}`;s+=`${s===``?``:`,`}${n}`});let l=e.dependentSchemas;return l&&Object.keys(l).forEach((c)=>{if(!v2(t,c)&&!o.includes(c))return true;let u2=l[c];if(!b2(u2))return true;Array.isArray(u2.schema.required)&&o.push(...u2.schema.required);let d={...u2,schema:{...u2.schema,required:o}}.reduceNode(t,{key:n,pointer:`${r}/${M}/${c}`,path:i}).node;a=g(a,d);let f=d.dynamicId?.replace(e.dynamicId,``)??``,ee=f===``?`${M}/${c}`:f;s+=`${s===``?``:`,`}${ee}`}),a===e?e:o.length===0?a:(o=a.schema.required?a.schema.required.concat(...o):o,o=o.filter((e,t,n)=>n.indexOf(e)===t),a=g(a,a,M),a.compileSchema({...a.schema,required:o},a.evaluationPath,a.schemaLocation,`${e.schemaLocation}(${s})`))}function Nt({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=[];return e.dependentRequired&&s2(Tt({node:e,data:t,pointer:n,path:r}),i),e.dependentSchemas&&s2(kt({node:e,data:t,pointer:n,path:r}),i),i}function Ft(e){let t=e.schema[N];if(t!=null){if(typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${N}`,schema:e.schema,value:t,message:`Keyword '${N}' must be a boolean - received '${typeof t}'`});e[N]=t}}function It({node:e,data:t,pointer:n}){return[e.createAnnotation(`deprecated-warning`,{pointer:n,schema:e.schema,value:t},e.schema.deprecatedMessage)]}function Rt(e){let{schema:t}=e;if(t[P]!=null){if(!Array.isArray(t[P]))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${P}`,schema:t,value:t[P],message:`Keyword '${P}' must be an array - received '${typeof t[P]}'`});e.enum=t[P]}}function zt({node:e,data:t,pointer:n=`#`}){if(e.enum==null)return;let r=u(t);if(r===`object`||r===`array`){let n=JSON.stringify(t);for(let t of e.enum)if(JSON.stringify(t)===n)return}else if(e.enum.includes(t))return;return e.createError(`enum-error`,{pointer:n,schema:e.schema,value:t,values:e.enum})}function Ht(e){let{exclusiveMaximum:t}=e.schema;if(t!=null&&typeof t!=`number`&&typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword 'exclusiveMaximum' must be a number - received '${typeof t}'`})}function Ut({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMaximum&&e.schema.maximum===t)return e.createError(`maximum-error`,{maximum:e.schema.exclusiveMaximum,length:t,pointer:n,schema:e.schema,value:t})}function Gt(e){let{exclusiveMinimum:t}=e.schema;if(t!=null&&typeof t!=`number`&&typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword 'exclusiveMinimum' must be a number - received '${typeof t}'`})}function Kt({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMinimum&&e.schema.minimum===t)return e.createError(`minimum-error`,{minimum:e.schema.exclusiveMinimum,length:t,pointer:n,schema:e.schema,value:t})}function Jt(e){let t=e.schema[F];if(t!=null){if(typeof t!=`string`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${F}`,schema:e.schema,value:t,message:`Keyword '${F}' must be a string - received '${typeof t}'`});if(e.context.formats[t]==null)return e.createAnnotation(`unknown-format-warning`,{pointer:`${e.schemaLocation}/${F}`,schema:e.schema,value:t,message:`Keyword '${F}' must be a string - received '${typeof t}'`})}}function Yt(e){let{node:t}=e,n=t.context.formats[t.schema.format];return n?.(e)}function on(e,t){if(e.oneOf)return e.oneOf.map((e)=>e.resolveRef());if(e.items?.oneOf)return e.items.oneOf.map((e)=>e.resolveRef());if(e.prefixItems&&e.prefixItems.length>+t){let{node:n,error:r}=e.getNodeChild(t);return n?[n]:r}if(e.schema.additionalItems){if(e.schema.additionalItems===true)return[e.compileSchema({type:`string`})];if(e.items)return[e.items.resolveRef()]}if(e.prefixItems&&e.prefixItems.length<=+t)return[];let{node:n,error:r}=e.getNodeChild(t);return n?[n]:r}function L(e,t){let n=u(t),r=e.schema;if(r===true)return n===`bigint`?`number`:sn.some((e)=>e===n)?n:undefined;if(!d(r))return;let i=r.type;if(Array.isArray(i)){if(i.includes(n))return n;let e=u(r.default);return i.includes(e)?e:i[0]}if(i)return i;if(Array.isArray(r.enum)){let e=r.enum.map((e)=>u(e)).filter((e,t,n)=>n.indexOf(e)===t);if(e.includes(n))return n;let t=u(r.default);return e.includes(t)?t:e[0]}let a=Object.keys(e.schema),o=a.filter((e)=>cn.includes(e)),s=a.filter((e)=>ln.includes(e));if(o.length>0&&o.length>s.length)return`object`;if(s.length>0&&s.length>o.length)return`array`;if(e.if)return L(e.if.resolveRef()??e.if,t);if(e.allOf)for(let n of e.allOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(e.oneOf)for(let n of e.oneOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(e.anyOf)for(let n of e.anyOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(r.$ref){let n=e.resolveRef();if(n)return L(n,t)}}function un(e){switch(u(e)){case`string`:case`array`:return e?.length===0;case`null`:case`undefined`:return true;case`object`:return Object.keys(e).length===0;default:return false}}function mn(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[R]!=null){if(!Array.isArray(t[R]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[R],message:`Keyword '${R}' must be an array - received '${typeof t[R]}'`});if(t[R].length!==0)return e[R]=t[R].map((t,i)=>e.compileSchema(t,`${n}/${R}/${i}`,`${r}/${R}/${i}`)),E([],...e[R])}}function hn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return;if(t!=null&&e.schema[dn])return gn({node:e,data:t,pointer:n,path:r});let i=[],a=[];for(let o=0;o<e.oneOf.length;o+=1){let s=_2(e.oneOf[o],t,n,r);s.length===0?i.push({index:o,node:e.oneOf[o]}):a.push(...s)}if(i.length===1){let{node:e,index:a}=i[0],{node:o,error:s}=e.reduceNode(t,{pointer:n,path:r});if(o){let t=o.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`oneOf/${a}`:t;return o.oneOfIndex=a,o.dynamicId=we(o.dynamicId,`+${e.schemaLocation}(${n})`),o}return s}return i.length,e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf,errors:a})}function gn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return;let i=e.schema[dn],a=y2(t,i);if(t===undefined||a===undefined)return e.createError(`missing-one-of-property-error`,{oneOfProperty:i,pointer:n,schema:e.schema,value:t});let o=[];for(let c=0;c<e.oneOf.length;c+=1){let{node:l}=e.oneOf[c].getNodeChild(i,t);if(!b2(l))return e.createError(`missing-one-of-declarator-error`,{declarator:dn,oneOfProperty:i,schemaLocation:e.oneOf[c].schemaLocation,pointer:`${n}/oneOf/${c}`,schema:e.schema,value:t});let u2=s2(_2(l,a,`${n}/${i}`,r));if(u2.length>0)o.push(...u2);else{let{node:i}=e.oneOf[c].reduceNode(t,{pointer:n,path:r});if(i)return i.oneOfIndex=c,i}}return e.createError(`one-of-property-error`,{property:i,value:t,pointer:n,schema:e.schema,errors:o})}function _n(e,t,n,r){if(t==null||e.properties==null)return-1;let i=0,a=Object.keys(e.properties??{});for(let o of a)t[o]&&_2(e.properties[o],t[o],n,r).length===0&&(i+=1);return i}function vn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return e;let i=hn({node:e,data:t,pointer:n,path:r});if(b2(i))return i;if(d(t)){let i,a=-1,o=0;for(let s=0;s<e.oneOf.length;s+=1){let c=e.oneOf[s],l=_n(c,t,n,r);o<l&&(o=l,i=c,a=s)}if(i===undefined)return e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf});let{node:s,error:c}=i.reduceNode(t,{pointer:n,path:r});return s?(s.oneOfIndex=a,s):c}else if(Array.isArray(t)){let i,a=-1,o=1/0;for(let n=0;n<e.oneOf.length;n+=1){let r=e.oneOf[n],{errors:s}=r.validate(t),c=s.length;c<o&&(o=c,i=r,a=n)}if(i===undefined)return e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf});let{node:s,error:c}=i.reduceNode(t,{pointer:n,path:r});return s?(s.oneOfIndex=a,s):c}return i}function yn({node:e,data:t,pointer:n=`#`,path:r}){let{oneOf:i,schema:a}=e;if(!i)return;let o=a[dn],s=y2(t,o),c=[],l=[];for(let e of i){let{node:t,error:a}=e.getNodeChild(o,s);if(t){let a=_2(t,s,`${n}/${o}`,r);a.length>0?l.push(...a):c.push({index:i.indexOf(e),node:e})}else console.log(`jlib oneOf error: failed getting schema for '${o}' to resolve ${dn} in ${n}/oneOf/${i.indexOf(e)}`,a)}if(c.length===1){let e=c[0];return e.node.oneOfIndex=e.index,_2(e.node,t,n,r)}return c.length>1?e.createError(`multiple-one-of-error`,{value:t,pointer:n,schema:a,matches:c}):e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:a,oneOf:a.oneOf,errors:l})}function bn({node:e,data:t,pointer:n=`#`,path:r}){let{oneOf:i,schema:a}=e;if(!i)return;if(a[dn])return yn({node:e,data:t,pointer:n,path:r});let o=[],s=[];for(let e=0;e<i.length;e+=1){let a=_2(i[e],t,n,r);a.length>0?s.push(...a):o.push({index:e,node:i[e]})}if(o.length===1){let{node:e,index:t}=o[0];e.oneOfIndex=t;return}return o.length>1?e.createError(`multiple-one-of-error`,{value:t,pointer:n,schema:a,matches:o}):e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:a,oneOf:a.oneOf,errors:s})}function Sn(e,t){if(e.$ref==null)return;t.cache=t.cache??{};let{cache:n,recursionLimit:r=1}=t,i=e.schemaLocation;if(n[i]=n[i]??{},n[i][e.$ref]=n[i][e.$ref]??0,n[i][e.$ref]>=r&&t.disableRecursionLimit!==true)return false;t.disableRecursionLimit=false,n[i][e.$ref]+=1;let a=e.resolveRef();if(a&&a!==e)return a}function Cn(e,t){return(t.cache?.[e.schemaLocation]?.[e.$ref]??-1)<(t.recursionLimit??1)}function wn(e,t){let n=u(t);if(e===undefined||t==null||n===e||n===`number`&&e===`integer`)return t;if(e===`string`)return JSON.stringify(t);if(n!==`string`)return t;try{let n=JSON.parse(t);if(u(n)===e)return n}catch{}return t}function Tn(e,t,n){if(n?.cache==null)throw Error(`Missing options`);if(e.schema===false||e.schema===true||xn(t))return t;if(e.schema?.const!==undefined)return e.schema?.const;let r=e,i=t;if(Array.isArray(e.schema.enum)&&e.schema.enum.length>0&&t===undefined)return e.schema.default??e.schema.enum[0];if(e.schema.default!==undefined&&i===undefined&&(i=e.schema.default),r.allOf?.length&&r.allOf.forEach((e)=>{i=e.getData(i,n)??i}),r.anyOf&&r.anyOf?.length>0&&(i=r.anyOf[0].getData(i,n)??i),r.oneOf&&r.oneOf?.length>0)if(un(i))r=g(r,r.oneOf[0]);else{let e=vn({node:r,data:i,path:[],pointer:`#`});if(C(e)){if(i!=null&&n.removeInvalidData!==true)return i;r=r.oneOf[0],i=undefined}else r=g(r,e)}let a=Sn(r,n);if(a===false)return i;b2(a)&&(i=a.getData(i,n)??i,r=a);let o=L(r,i),s=En[o]?.(r,i,n);return s===undefined?i:s}function Dn({schema:e},t,n,r){return t===undefined?e.const?e.const:e.default===undefined&&Array.isArray(e.enum)?e.enum[0]:e.default===undefined&&r!==false?n:e.default:wn(e.type,t)}function kn({node:e,key:t}){if(e.prefixItems?.[t])return e.prefixItems[t];if(e.items)return e.items}function An(e){let{schema:t,evaluationPath:n}=e,r=t[z];if(r!=null&&typeof r!=`boolean`){if(d(r)){e.items=e.compileSchema(r,`${n}/${z}`,`${e.schemaLocation}/${z}`);return}if(Array.isArray(r)){e.prefixItems=r.map((t,r)=>e.compileSchema(t,`${n}/${z}/${r}`,`${e.schemaLocation}/${z}/${r}`));return}return e.createError(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${z}' must be an object or array - received '${typeof r}'`})}}function jn({node:e,data:t,pointer:n=`#`,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0)return;if(i.items===false)return Array.isArray(t)&&t.length===0?undefined:e.createError(`invalid-data-error`,{pointer:n,value:t,schema:i});let a=[];if(e.prefixItems){for(let i=0;i<Math.min(e.prefixItems.length,t.length);i+=1){let o=t[i],s=e.prefixItems[i],c=_2(s,o,`${n}/${i}`,r);a.push(...c)}return a}if(e.items){for(let i=0;i<t.length;i+=1){let o=t[i],s=_2(e.items,o,`${n}/${i}`,r);s&&a.push(...s)}return a}}function Nn(e){let t=e.schema[B];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${B}`,schema:e.schema,value:t,message:`Keyword '${B}' must be a number - received '${typeof t}'`});e[B]=t}}function Pn({node:e,data:t,pointer:n}){if(!w(t))return;let r=e[B],{schema:i}=e;if(r&&r<t)return e.createError(`maximum-error`,{maximum:r,length:t,value:t,pointer:n,schema:i});if(r&&i.exclusiveMaximum===true&&r===t)return e.createError(`maximum-error`,{maximum:r,length:t,pointer:n,schema:i,value:t})}function Ln(e){let t=e.schema[Fn];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Fn}`,schema:e.schema,value:t,message:`Keyword '${Fn}' must be a number - received '${typeof t}'`});e[Fn]=t}}function Rn({node:e,data:t,pointer:n}){let{schema:r}=e;if(Array.isArray(t)&&r.maxItems<t.length)return e.createError(`max-items-error`,{maximum:r.maxItems,length:t.length,schema:r,value:t,pointer:n})}function zn(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function Vn(e){let t=e.schema[V];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${V}`,schema:e.schema,value:t,message:`Keyword '${V}' must be a number - received '${typeof t}'`});e[V]=t}}function Hn({node:e,data:t,pointer:n=`#`}){if(typeof t!=`string`)return;let r=e[V],i=zn(t).length;if(r<i)return e.createError(`max-length-error`,{maxLength:r,length:i,pointer:n,schema:e.schema,value:t})}function Wn(e){let t=e.schema[H];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${H}`,schema:e.schema,value:t,message:`Keyword '${H}' must be a number - received '${typeof t}'`});e[H]=t}}function Gn({node:e,data:t,pointer:n=`#`}){if(!d(t))return;let r=e[H],i=Object.keys(t).length;if(r<i)return e.createError(`max-properties-error`,{maxProperties:r,length:i,pointer:n,schema:e.schema,value:t})}function qn(e){let t=e.schema[U];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${U}`,schema:e.schema,value:t,message:`Keyword '${U}' must be a number - received '${typeof t}'`});e[U]=t}}function Jn({node:e,data:t,pointer:n}){if(!w(t))return;let r=e[U];if(r>t||e.schema.exclusiveMinimum===true&&e.schema.minimum===t)return e.createError(`minimum-error`,{minimum:r,length:t,pointer:n,schema:e.schema,value:t})}function Xn(e){let t=e.schema[W];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${W}`,schema:e.schema,value:t,message:`Keyword '${W}' must be a number - received '${typeof t}'`});e[W]=t}}function Zn({node:e,data:t,pointer:n}){if(!Array.isArray(t))return;let r=e[W];if(r>t.length)return e.createError(`min-items-error`,{minItems:r,length:t.length,pointer:n,schema:e.schema,value:t})}function $n(e){let t=e.schema[G];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${G}`,schema:e.schema,value:t,message:`Keyword '${G}' must be a number - received '${typeof t}'`});e[G]=t}}function er({node:e,data:t,pointer:n=`#`}){if(typeof t!=`string`)return;let r=zn(t).length,i=e[G];if(!(i<=r))return e.createError(`min-length-error`,{minLength:i,length:r,pointer:n,schema:e.schema,value:t})}function nr(e){let t=e.schema[K];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${K}`,schema:e.schema,value:t,message:`Keyword '${K}' must be a number - received '${typeof t}'`});e[K]=t}}function rr({node:e,data:t,pointer:n=`#`}){if(!d(t))return;let r=Object.keys(t).length;if(e.schema.minProperties>r)return e.createError(`min-properties-error`,{minProperties:e.schema.minProperties,length:r,pointer:n,schema:e.schema,value:t})}function ir(e){let t=`${e}`;if(t.includes(`e-`))return parseInt(t.replace(/.*e-/,``));let n=t.indexOf(`.`);return n===-1?0:t.length-(n+1)}function or(e){let t=e.schema[q];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${q}`,schema:e.schema,value:t,message:`Keyword '${q}' must be a number - received '${typeof t}'`});e[q]=t}}function sr({node:e,data:t,pointer:n}){if(typeof t!=`number`)return;let r=e[q],i=ir(t),a=ir(r);if(i>a)return e.createError(`multiple-of-error`,{multipleOf:r,value:t,pointer:n,schema:e.schema});let o=10**a;if(Math.round(t*o)%Math.round(r*o)/o!==0)return e.createError(`multiple-of-error`,{multipleOf:r,value:t,pointer:n,schema:e.schema})}function lr(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e,i=t.not;if(i!=null)return!x(i)&&!S(i)?e.createError(`schema-error`,{pointer:`${r}/not`,schema:t,value:i,message:`Keyword 'not' must be a valid JSON Schema - received '${typeof i}'`}):(e.not=e.compileSchema(t.not,`${n}/not`,`${r}/not`),e.not.schemaValidation)}function ur({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(_2(e.not,t,n,r).length===0)return e.createError(`not-error`,{value:t,not:i.not,pointer:n,schema:i})}function mr(e){let t=e.schema[dr];if(t!=null){if(typeof t!=`string`)return e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:t,message:`Keyword 'pattern' must be a string - received '${typeof t}'`});try{e[dr]=new RegExp(t,e.schema.regexFlags??fr)}catch(n){return e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:t,message:n.message})}}}function hr({node:e,data:t,pointer:n=`#`}){if(typeof t==`string`&&e.pattern.test(t)===false){let{schema:r}=e;return e.createError(`pattern-error`,{pattern:r.pattern,description:r.patternExample||r.pattern,received:t,schema:r,value:t,pointer:n})}}function vr(e){let{schema:t}=e;if(!d(t.patternProperties))return;let n=Object.keys(t.patternProperties);if(n.length!==0)return e.patternProperties=n.map((n)=>({name:n,pattern:new RegExp(n,t.regexFlags??gr),node:e.compileSchema(t.patternProperties[n],`${e.evaluationPath}/patternProperties/${n}`,`${e.schemaLocation}/patternProperties/${n}`)})),E([],...e.patternProperties.map(({node:e})=>e))}function yr({node:e,key:t}){return e.patternProperties?.find(({pattern:e})=>e.test(`${t}`))?.node}function br({node:e,data:t,key:n}){let{patternProperties:r}=e;if(r==null)return;let i,a=Object.keys(t??{});n&&a.push(`${n}`);let o=`${e.schemaLocation}(`;return a.push(...Object.keys(e.schema.properties??{})),a.forEach((t,n,a)=>{if(a.indexOf(t)!==n)return;let s=e.schema.properties?.[t]??{},c=r.filter((e)=>e.pattern.test(t));c.forEach((e)=>s=h(s,e.node.schema)),c.length>0&&(i??={properties:{}},i.properties[t]=s,o+=`${c.map(({name:e})=>`patternProperties/${e}`).join(`,`)}`)}),i==null?e:(i=h(e.schema,i,`patternProperties`),e.compileSchema(i,e.evaluationPath,e.schemaLocation,`${o})`))}function xr({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let{schema:i,patternProperties:a}=e,o=i.properties||{},s=Object.keys(i.patternProperties).join(`,`),c=[];return Object.keys(t).forEach((l)=>{let u2=y2(t,l),d=a.filter((e)=>e.pattern.test(l));d.forEach(({node:e})=>c.push(..._2(e,u2,`${n}/${l}`,r))),!o[l]&&d.length===0&&i.additionalProperties===false&&c.push(e.createError(`no-additional-properties-error`,{key:l,pointer:`${n}/${l}`,schema:i,value:u2,patterns:s}))}),c}function Cr({node:e,key:t}){return e.properties?.[t]}function wr(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t.properties==null)return;if(t.properties&&!d(t.properties))return e.createError(`schema-error`,{pointer:r,schema:t,value:undefined,message:"keyword `properties` must be of type `object`"});let i=[],a={};return Object.keys(t.properties).forEach((o)=>{let s=e.compileSchema(t.properties[o],`${n}/properties/${o}`,`${r}/properties/${o}`);a[o]=s,E(i,a[o])}),e.properties=a,i}function Tr({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=[],a=e.properties??{};return Object.keys(t).forEach((e)=>{let o=y2(t,e),s=a[e];if(s==null||o===undefined)return;let c=_2(s,o,`${n}/${e}`,r);i.push(...c)}),i}function Dr(e){let t=e.schema[J];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${J}`,schema:e.schema,value:t,message:`Keyword '${J}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.propertyNames=e.compileSchema(t,`${e.evaluationPath}/propertyNames`,`${e.schemaLocation}/propertyNames`),e.propertyNames.schemaValidation}}function Or({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!d(t))return;if(i.propertyNames===false)return Object.keys(t).length===0?undefined:e.createError(`invalid-property-name-error`,{property:Object.keys(t),pointer:n,value:t,schema:i});if(i[J]===true)return;let a=e[J];if(!d(a))return;let o=[];return Object.keys(t).forEach((s)=>{let c=_2(a,s,`${n}/${s}`,r);c.length>0&&o.push(e.createError(`invalid-property-name-error`,{property:s,pointer:n,validationError:c[0],value:t[s],schema:i}))}),o}function jr(e){let t=e.schema[kr];if(t!=null){if(!St(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${kr}`,schema:e.schema,value:t,message:`Keyword '${kr}' must be a string[]`});e.required=t}}function Mr({node:e,data:t,pointer:n=`#`}){let{required:r}=e;if(d(t))return r.map((r)=>{if(!v2(t,r))return e.createError(`required-property-error`,{key:r,pointer:n,schema:e.schema,value:t})})}function Nr(e){return{...e,keywords:[...e.keywords.map((e)=>({...e}))]}}function Pr(e,t){let{keywords:n}=Fr(e,...t.keywords??[]),r={...e.errors,...t.errors??{}},i={...e.formats,...t.formats??{}};return Lr({...e,...t,formats:i,keywords:n,errors:r})}function Fr(e,...t){let n=Nr(e);return t.forEach((e)=>Ir(n,e)),n}function Ir(e,t){let n=e.keywords.findIndex((e)=>e.keyword===t.keyword);n===-1?e.keywords.push(t):e.keywords[n]=t}function Lr(e){return e.keywords?.forEach((e)=>{let t=()=>e.keyword;e.validate&&(e.validate.toJSON=t,e.validate.order=e.order??0),e.reduce&&(e.reduce.toJSON=t,e.reduce.order=e.order??0),e.resolve&&(e.resolve.toJSON=t,e.resolve.order=e.order??0)}),e.keywords?.sort((e,t)=>(t.order??0)-(e.order??0)),e}function Rr(e,t,n=`#`,r=[]){let i=e.resolveRef()??e;return r.push({node:i,value:t,pointer:n}),d(t)?Object.keys(t).forEach((e)=>{let{node:a}=i.getNodeChild(e,t);a&&Rr(a,y2(t,e),`${n}/${e}`,r)}):Array.isArray(t)&&t.forEach((e,a)=>{let{node:o}=i.getNodeChild(a,t);o&&Rr(o,y2(t,a),`${n}/${a}`,r)}),r}function Vr(e){let t=e.schema[Y];if(t!=null){if(typeof t!=`string`&&!Array.isArray(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}`,schema:e.schema,value:t,message:`Keyword '${Y}' must be a string or a string[] - received ${typeof t}`});if(typeof t==`string`&&!zr.includes(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}`,schema:e.schema,value:t,message:`Keyword '${Y}' is not a valid JSON Schema type - received '${t}'. Expected one of ${zr.join(`, `)}`});if(Array.isArray(t)){let n=t.findIndex((e)=>!zr.includes(e));if(n!==-1)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}/${n}`,schema:e.schema,value:t[n],message:`Keyword '${Y}' contains an invalid JSON Schema type: '${t[n]}'`})}e[Y]=t}}function Hr({node:e,pointer:t,data:n}){let r=Ur(n,e.type);if(r!==`undefined`&&Array.isArray(e.schema.type)&&e.schema.type.includes(r))return e.compileSchema({...e.schema,pointer:t,type:r},e.evaluationPath)}function Ur(e,t){let n=u(e);return n===`number`&&(t===`integer`||Array.isArray(t)&&t.includes(`integer`))?Number.isInteger(e)||isNaN(e)?`integer`:`number`:n}function Wr({node:e,data:t,pointer:n}){let r=e[Y],i=Ur(t,r);if(!(t===undefined||r===i||Array.isArray(r)&&r.includes(i)))return e.createError(`type-error`,{value:t,received:i,expected:r,schema:e.schema,pointer:n})}function qr(e){let t=e.schema[Gr];if(t!=null&&t!==false){if(typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Gr}`,schema:e.schema,value:t,message:`Keyword '${Gr}' must be a boolean - received ${typeof t}`});e.uniqueItems=true}}function Jr({node:e,data:t,pointer:n}){if(!Array.isArray(t))return;let{schema:r}=e,i=[],a=[];return t.forEach((s,c)=>{for(let l=c+1;l<t.length;l+=1)import_fast_deep_equal.default(s,t[l])&&!i.includes(l)&&(a.push(e.createError(`unique-items-error`,{pointer:`${n}/${l}`,duplicatePointer:`${n}/${c}`,arrayPointer:n,value:JSON.stringify(s),schema:r})),i.push(l))}),a}function Zr({node:e,data:t,pointer:n}){if(!import_fast_deep_equal.default(t,e.schema.const))return[e.createError(`const-error`,{pointer:n,schema:e.schema,value:t,expected:e.schema.const})]}function ei(e){let t=e.schema[Qr];if(t!=null&&typeof t!=`number`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Qr}`,schema:e.schema,value:t,message:`Keyword '${Qr}' must be a number - received '${typeof t}'`})}function ti({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMaximum<=t)return e.createError(`exclusive-maximum-error`,{maximum:e.schema.exclusiveMaximum,length:t,pointer:n,schema:e.schema,value:t})}function ii(e){let t=e.schema[ni];if(t!=null&&typeof t!=`number`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${ni}`,schema:e.schema,value:t,message:`Keyword '${ni}' must be a number - received '${typeof t}'`})}function ai({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMinimum>=t)return e.createError(`exclusive-minimum-error`,{minimum:e.schema.exclusiveMinimum,length:t,pointer:n,schema:e.schema,value:t})}function ci(e){let{schema:t,evaluationPath:n}=e,r=[];return t.if!=null&&(x(t.if)||S(t.if)?(e.if=e.compileSchema(t.if,`${n}/if`),E(r,e.if)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/if`,schema:e.schema,value:t.if,message:`Keyword 'if' must be valid JSON Schema - received '${typeof t.if}'`}))),t.then!=null&&(x(t.then)||S(t.then)?(e.then=e.compileSchema(t.then,`${n}/then`),E(r,e.then)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/then`,schema:e.schema,value:t.then,message:`Keyword 'then' must be valid JSON Schema - received '${typeof t.then}'`}))),t.else!=null&&(x(t.else)||S(t.else)?(e.else=e.compileSchema(t.else,`${n}/else`),E(r,e.else)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/else`,schema:e.schema,value:t.else,message:`Keyword 'else' must be valid JSON Schema - received '${typeof t.else}'`}))),r}function li({node:e,data:t,pointer:n,path:r}){if(t!==undefined&&e.if!=null){if(_2(e.if,t,n,[...r??[]]).length===0){if(e.then){let{node:n}=e.then.reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``).replace(/^#/,``)??``,r=t===``?`(then)`:t,i=h(e.then.schema,n.schema,`if`,`then`,`else`);return e.compileSchema(i,e.then.evaluationPath,e.schemaLocation,`${e.schemaLocation}${r}`)}}}else if(e.else){let{node:n}=e.else.reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``)??``,r=t===``?`(else)`:t,i=h(e.else.schema,n.schema,`if`,`then`,`else`);return e.compileSchema(i,e.else.evaluationPath,e.schemaLocation,`${e.schemaLocation}${r}`)}}}}function ui({node:e,data:t,pointer:n,path:r}){if(e.if!=null){if(_2(e.if,t,n,[...r??[]]).length===0){if(e.then)return _2(e.then,t,n,r)}else if(e.else)return _2(e.else,t,n,r)}}function pi(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function mi(e){e.resolveRef=hi;let t=m(e.parent?.$id,e.schema?.$id);e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,t!==e.parent?.$id&&e.evaluationPath!==`#`&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)&&pi(e,m(t,`#${e.evaluationPath.replace(e.lastIdPointer,``)}`)),pi(e,m(e.context.rootNode.$id,e.evaluationPath)),e.schema.$anchor&&(e.context.anchors[`${t.replace(/#$/,``)}#${e.schema.$anchor}`]=e),e.schema.$ref&&(e.$ref=m(t,e.schema.$ref),e.$ref.startsWith(`/`)&&(e.$ref=`#${e.$ref}`))}function hi({pointer:e,path:t}={}){if(this.schema.$recursiveRef){let n=_i(this,t??[]);return b2(n)&&t?.push({pointer:e,node:n}),n}if(this.$ref==null)return this;let n=vi(this);return b2(n)&&t?.push({pointer:e,node:n}),n}function gi({node:e,data:t,pointer:n=`#`,path:r}){let i=e.resolveRef({pointer:n,path:r});return i==null?e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$recursiveRef,pointer:n,schema:e.schema,value:t}):_2(i,t,n,r)}function _i(e,t){let n=t,r=0;for(let t=n.length-1;t>=0;t--){if(n[t].node.schema.$recursiveAnchor===false)return vi(e,m(e.$id,e.schema.$recursiveRef));if(/^https?:\/\//.test(n[t].node.schema.$id??``)&&n[t].node.schema.$recursiveAnchor!==true){r=t;break}}let i=n.find((e,t)=>t>=r&&e.node.schema.$recursiveAnchor===true);return i?i.node:vi(e,m(e.$id,e.schema.$recursiveRef))}function vi(e,n=e?.$ref){if(n==null)return e;if(e.context.refs[n])return T(e.context.refs[n],e);if(e.context.anchors[n])return T(e.context.anchors[n],e);let i=Pe(n);if(i.length===0)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(i.length===1){let n=i[0];if(e.context.remotes[n])return T(e.context.remotes[n],e);if(n[0]===`#`){let r=n.match(/#[^#]*$/)?.pop(),i=e.context.rootNode.schema,a=s(i,r);if(a)return e.compileSchema(a,`${e.evaluationPath}/$ref`,r)}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(i.length===2){let t=i[0];if(e.context.remotes[t]&&e!==e.context.remotes[t]){let r=e.context.remotes[t],a=vi(r,n);if(a||(a=vi(r,i[1]),a))return a}if(e.context.refs[t]){let a=e.context.refs[t],o2=o(i[1]),s=a;for(let t of o2)if(s=s[t===`definitions`?`$defs`:t],s==null)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined,host:i[0],local:i[1]});return s}}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function xi(e){let{unevaluatedItems:t}=e.schema;if(t!=null&&typeof t!=`boolean`){if(!d(t))return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword '${yi}' must be an object - received '${typeof t}'`});e.unevaluatedItems=e.compileSchema(e.schema.unevaluatedItems,`${e.evaluationPath}/${yi}`,`${e.schemaLocation}/${yi}`)}}function Si({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||i.unevaluatedItems==null||i.unevaluatedItems===true)return;let{node:a}=e.reduceNode(t,{pointer:n,path:r});if(a??=e,a.schema.unevaluatedItems===true||a.schema.additionalItems===true)return;let o=e.if!=null&&_2(e.if,t,n,r).length===0,s=[];for(let a=0;a<t.length;a+=1){let c=t[a],{node:l}=e.getNodeChild(a,t,{path:r});if(l&&_2(l,c,`${n}/${a}`,r).length>0){let o=e.unevaluatedItems;if(o&&t.forEach((e)=>{let t=_2(o,e,`${n}/${a}`,r);if(t!=null){if(Array.isArray(t))return s.push(...t);s.push(t)}}),e.schema.unevaluatedItems===false)return e.createError(`unevaluated-items-error`,{pointer:`${n}/${a}`,value:JSON.stringify(c),schema:i})}if(l===undefined&&!(o&&e.if.prefixItems&&e.if.prefixItems.length>a))if(e.unevaluatedItems){let t=_2(e.unevaluatedItems,c,`${n}/${a}`,r);t.length>0&&s.push(...t)}else s.push(e.createError(`unevaluated-items-error`,{pointer:`${n}/${a}`,value:JSON.stringify(c),schema:i}))}return s}function X({node:e,data:t,key:n,pointer:r,path:i}){if(Array.isArray(e.schema.required)&&!e.schema.required.find((e)=>v2(t,e)))return false;if(e.schema.unevaluatedProperties===true||e.schema.additionalProperties===true||e.properties?.[n]&&e.properties[n].validate(t[n],r,i).valid||e.patternProperties&&e.patternProperties.find((e)=>e.pattern.test(n)))return true;if(e.allOf){for(let a of e.allOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.anyOf){for(let a of e.anyOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.oneOf){for(let a of e.oneOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.if){if(X({node:e.if,data:t,key:n,pointer:r,path:i}))return true;let a=_2(e.if,t,r,i).length===0;if(a&&e.then){if(X({node:e.then,data:t,key:n,pointer:r,path:i}))return true}else if(!a&&e.else&&X({node:e.else,data:t,key:n,pointer:r,path:i}))return true}let a=e.resolveRef({pointer:r,path:i});return!!(a!==e&&X({node:a,data:t,key:n,pointer:r,path:i}))}function wi(e){let t=e.schema[Z];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Z}`,schema:e.schema,value:t,message:`Keyword '${Z}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.unevaluatedProperties=e.compileSchema(e.schema.unevaluatedProperties,`${e.evaluationPath}/${Z}`,`${e.schemaLocation}/${Z}`),e.unevaluatedProperties.schemaValidation}}function Ti({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=Object.keys(t).filter((e)=>t[e]!==undefined);if(i.length===0)return;let a=[];for(let o of i){if(e.properties?.[o]||X({node:e,data:t,key:o,pointer:n,path:r}))continue;let{node:i}=e.getNodeChild(o,t,{pointer:n,path:r});if(i===undefined)if(e.unevaluatedProperties){let i=_2(e.unevaluatedProperties,t[o],`${n}/${o}`,r);a.push(...i)}else e.schema.unevaluatedProperties===false&&a.push(e.createError(`unevaluated-property-error`,{pointer:`${n}/${o}`,value:JSON.stringify(t[o]),schema:e.schema}));if(i&&_2(i,t[o],`${n}/${o}`,r).length>0)if(e.unevaluatedProperties){let i=_2(e.unevaluatedProperties,t[o],`${n}/${o}`,r);a.push(...i)}else e.schema.unevaluatedProperties===false&&a.push(e.createError(`unevaluated-property-error`,{pointer:`${n}/${o}`,value:JSON.stringify(t[o]),schema:e.schema}))}return a}function Di(e,t){if(e.items){let t=e.items.resolveRef();if(t?.oneOf)return t.oneOf.map((e)=>e.resolveRef())}if(e.oneOf)return e.oneOf.map((e)=>e.resolveRef());if(e.prefixItems&&e.prefixItems.length>+t){let{node:n,error:r}=e.getNodeChild(t);return b2(n)?[n]:r}if(e.schema.items===true)return[e.compileSchema({type:`string`})];if(e.schema.items===false)return[];if(e.items)return[e.items.resolveRef()];if(e.prefixItems&&e.prefixItems.length<=+t)return[];let{node:n,error:r}=e.getNodeChild(t);return r??[n]}function Oi(e,t){if(e.$ref==null)return;t.cache=t.cache??{};let{cache:n,recursionLimit:r=1}=t,i=e.schemaLocation;if(n[i]=n[i]??{},n[i][e.$ref]=n[i][e.$ref]??0,n[i][e.$ref]>=r&&t.disableRecursionLimit!==true)return false;t.disableRecursionLimit=false,n[i][e.$ref]+=1;let a=e.resolveRef();if(a&&a!==e)return a}function ki(e,t){return(t.cache?.[e.schemaLocation]?.[e.$ref]??-1)<(t.recursionLimit??1)}function Ai(e,t){let n=u(t);if(e===undefined||t==null||n===e||n===`number`&&e===`integer`)return t;if(e===`string`)return JSON.stringify(t);if(n!==`string`)return t;try{let n=JSON.parse(t);if(u(n)===e)return n}catch{}return t}function ji(e,t,n){if(n?.cache==null)throw Error(`Missing options`);if(e.schema===false||e.schema===true||xn(t))return t;if(e.schema?.const!==undefined)return e.schema?.const;let r=e,i=t;if(Array.isArray(e.schema.enum)&&e.schema.enum.length>0&&t===undefined)return e.schema.default??e.schema.enum[0];if(e.schema.default!==undefined&&i===undefined&&(i=e.schema.default),r.allOf?.length&&r.allOf.forEach((e)=>{i=e.getData(i,n)??i}),r.anyOf&&r.anyOf?.length>0&&(i=r.anyOf[0].getData(i,n)??i),r.oneOf&&r.oneOf?.length>0)if(un(i))r=g(r,r.oneOf[0]);else{let e=vn({node:r,data:i,path:[],pointer:`#`});if(C(e)){if(i!=null&&n.removeInvalidData!==true)return i;r=r.oneOf[0],i=undefined}else r=g(r,e)}let a=Oi(r,n);if(a===false)return i;b2(a)&&(i=a.getData(i,n)??i,r=a);let o=L(r,i),s=Mi[o]?.(r,i,n);return s===undefined?i:s}function Ni({schema:e},t,n,r){return t===undefined?e.const?e.const:e.default===undefined&&Array.isArray(e.enum)?e.enum[0]:e.default===undefined&&r!==false?n:e.default:Ai(e.type,t)}function Fi({node:e,key:t}){if(!(e.prefixItems&&e.prefixItems?.length>+t))return e.items}function Ii(e){let t=e.schema[Q];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Q}`,schema:e.schema,value:t,message:`Keyword '${Q}' must be a valid JSON Schema - received '${typeof t}'`});if(t!==true)return e[Q]=e.compileSchema(t,`${e.evaluationPath}/${Q}`,`${e.schemaLocation}/${Q}`),e[Q].schemaValidation}}function Li({node:e,data:t,pointer:n=`#`,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||Array.isArray(i.prefixItems)&&i.prefixItems.length>=t.length)return;if(i.items===false)return Array.isArray(t)&&t.length===0?undefined:e.createError(`invalid-data-error`,{pointer:n,value:t,schema:i});let a=[];if(e.items){for(let o=i.prefixItems?.length??0;o<t.length;o+=1){let i=t[o],s=_2(e.items,i,`${n}/${o}`,r);s&&a.push(...s)}return a}}function Bi({node:e,key:t}){if(e.prefixItems&&e.prefixItems[t])return e.prefixItems[t]}function Vi(e){let{schema:t,evaluationPath:n}=e;if(Array.isArray(t.prefixItems))return e.prefixItems=t.prefixItems.map((t,r)=>e.compileSchema(t,`${n}/${Ri}/${r}`,`${e.schemaLocation}/${Ri}/${r}`)),E([],...e.prefixItems)}function Hi({node:e,data:t,pointer:n=`#`,path:r}){if(!Array.isArray(t)||t.length===0)return;let i=[],a=e[Ri];if(a){for(let e=0;e<Math.min(a.length,t.length);e+=1){let o=t[e],s=a[e],c=_2(s,o,`${n}/${e}`,r);i.push(...c)}return i}}function Ui({node:e,data:t,key:n,pointer:r,path:i}){let a=y2(t,n);if(e.schema.unevaluatedItems===true||e.schema.items===true||e.contains&&_2(e.contains,a,`${r}/${n}`,i).length===0)return true;if(e.allOf){for(let a of e.allOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.anyOf){for(let a of e.anyOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.oneOf){for(let a of e.oneOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.if){if(Ui({node:e.if,data:t,key:n,pointer:r,path:i}))return true;let a=_2(e.if,t,r,i).length===0;if(a&&e.if.prefixItems&&e.if.prefixItems.length>n)return true;if(a&&e.then){if(Ui({node:e.then,data:t,key:n,pointer:r,path:i}))return true}else if(!a&&e.else&&Ui({node:e.else,data:t,key:n,pointer:r,path:i}))return true}}function Ki(e){let t=e.schema[Wi];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Wi}`,schema:e.schema,value:t,message:`Keyword '${Wi}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.unevaluatedItems=e.compileSchema(e.schema.unevaluatedItems,`${e.evaluationPath}/${Wi}`,`${e.schemaLocation}/${Wi}`),e.unevaluatedItems.schemaValidation}}function qi({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||i.unevaluatedItems==null||i.unevaluatedItems===true)return;let a=[];for(let o=0;o<t.length;o+=1){if(Ui({node:e,data:t,pointer:n,key:o,path:r}))continue;let s=t[o],{node:c}=e.getNodeChild(o,t,{path:r});if(c===undefined)if(e.unevaluatedItems){let t=_2(e.unevaluatedItems,s,`${n}/${o}`,r);t.length>0&&a.push(...t)}else a.push(e.createError(`unevaluated-items-error`,{pointer:`${n}/${o}`,value:JSON.stringify(s),schema:i}));if(c&&_2(c,s,`${n}/${o}`,r).length>0&&(e.unevaluatedItems&&e.unevaluatedItems.validate(s,`${n}/${o}`,r).valid===false||e.schema.unevaluatedItems===false))return e.createError(`unevaluated-items-error`,{pointer:`${n}/${o}`,value:JSON.stringify(s),schema:i})}return a}function Zi(e,t){return e.find((e)=>new RegExp(e.$schemaRegEx,Yi).test(t))??e[e.length-1]}function Qi(t,n={}){let r=n.remote;if(Array.isArray(n.remotes)&&n.remotes.length>0&&!n.remote){let e=[...n.remotes];e.forEach((e,t)=>{if(e.$id==null)throw Error(`required $id on remotes[${t}] is missing`)}),r=Qi(e.shift()),e.forEach((e)=>r?.addRemoteSchema(e.$id,e))}let i=n.formatAssertion??true,a=n.drafts??Xi,o=Zi(a,x(t)?n.draft??t.$schema:undefined),c={evaluationPath:`#`,lastIdPointer:`#`,schemaLocation:`#`,dynamicId:``,reducers:[],resolvers:[],validators:[],schema:t,context:{remotes:{},dynamicAnchors:{},...r?.context??{},anchors:{},refs:{},...copy(pe(o,`methods`,`keywords`,`version`,`formats`,`errors`)),draft:n.draft,getDataDefaultOptions:n.getDataDefaultOptions,throwOnInvalidRef:n.throwOnInvalidRef??false,drafts:a},...Te};if(c.context.rootNode=c,c.context.remotes[(x(t)?t.$id:undefined)??`#`]=c,r){let e=He(c,c.schema.$schema);if(b2(e)&&e.schema.$vocabulary){let t=Object.keys(e.schema.$vocabulary).find((e)=>e.includes(`vocab/format-assertion`));t&&i===`meta-schema`&&(i=e.schema.$vocabulary[t]===true);let n=Object.keys(e.getData({},{addOptionalProps:true}));n.length>0&&(c.context.keywords=c.context.keywords.filter((e)=>n.includes(e.keyword)))}}if(i===false&&(c.context.keywords=c.context.keywords.filter((e)=>e.keyword!==`format`)),!x(t)&&!S(t))return c.schemaErrors=[c.createError(`schema-error`,{pointer:`#`,schema:t,value:undefined,message:`JSON schema must be object or boolean - reveived: '${t}'`})],c;let l=Oe(c).filter((e)=>e!=null);l=s2(l);let u2=[],d=[];if(l.forEach((e)=>{C(e)?(e.data.schemaId=c.context.rootNode.$id??`#`,u2.push(e)):je(e)&&(e.data.schemaId=c.context.rootNode.$id??`#`,d.push(e))}),Array.isArray(r?.schemaErrors)&&u2.push(...r.schemaErrors),Array.isArray(r?.schemaAnnotations)&&d.push(...r.schemaAnnotations),n.throwOnInvalidSchema&&u2.length>0){let e=Error(`Invalid schema passed to compileSchema`);throw e.data=u2,e}return c.schemaErrors=u2,c.schemaAnnotations=d,c}function ea(e,t){let n=e[$14];if(n==null)return;let r=Object.keys(n),i=[];for(let e of r)if(v2(t,e)){let r=n[e],a=`${t[e]}`;v2(r,a)&&i.push({property:e,value:a,node:r[a]})}return i}function na(e){let t=e.schema[$14];if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}`,schema:e.schema,value:t,message:`Keyword '${$14}' must be an object - received '${typeof t}'`});let n=Object.create(null),r=[];return Object.keys(t).map((i)=>{let a=t[i];if(!d(a)){r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}/${i}`,schema:e.schema,value:t,message:`Keyword '${$14}[string]' must be an object - received '${typeof t}'`}));return}Object.keys(a).forEach((t)=>{let o=a[t];if(!(x(o)||S(o))){r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}/${i}/${t}`,schema:e.schema,value:o,message:`Keyword '${$14}[string][string]' must be a valid JSON Schema - received '${typeof o}'`}));return}n[i]=n[i]??Object.create(null),n[i][t]=e.compileSchema(o,`${e.evaluationPath}/${$14}/${i}/${t}`,`${e.schemaLocation}/${$14}/${i}/${t}`),E(r,n[i][t])})}),e[$14]=n,r}function ra({node:e,data:t,pointer:n=`#`,path:r}){if(!d(t))return;let i=ea(e,t);if(i==null||i.length===0)return;let a=[];for(let e of i){let i=_2(e.node,t,n,r);a.push(i)}return s2(a)}function ia({node:e,data:t,key:n,pointer:r,path:i}){if(!d(t))return;let a=ea(e,t);if(a==null||a.length===0)return;let o={},s=``;for(let c of a){let{node:a}=c.node.reduceNode(t,{key:n,pointer:r,path:i});if(a){let t=a.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`propertyDependencies/${c.property}/${c.value}`:t;s+=`${s===``?``:`,`}${n}`;let r=h(c.node.schema,a.schema);o=h(o,r,`propertyDependencies`)}}return e.compileSchema(o,`${e.evaluationPath}/${s}`,e.schemaLocation,`${e.schemaLocation}(${s})`)}var import_uri_js,import_valid_url,import_fast_deep_equal,c2,l,ne,re,ie,ae,he,v2=(e,t)=>!(e[t]===undefined||!he.call(e,t)),ve,ye,be,xe,Te,Ee,De,Me,Ne,Fe,Ue,Ke,Xe,nt=`additionalItems`,rt,st,D=`allOf`,dt,O=`anyOf`,ht,k=`contains`,yt,A=`dependentRequired`,Ct,j=`dependentSchemas`,Et,M=`dependencies`,At,N=`deprecated`,Pt,P=`enum`,Lt,Bt,Vt,Wt,F=`format`,qt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,I,sn,cn,ln,R=`oneOf`,dn,fn,pn,xn=()=>false,En,z=`items`,On,B=`maximum`,Mn,Fn=`maxItems`,In,V=`maxLength`,Bn,H=`maxProperties`,Un,U=`minimum`,Kn,W=`minItems`,Yn,G=`minLength`,Qn,K=`minProperties`,tr,q=`multipleOf`,ar,cr,dr=`pattern`,fr,pr,gr,_r,Sr,J=`propertyNames`,Er,kr=`required`,Ar,Y=`type`,zr,Br,Gr=`uniqueItems`,Kr,Yr,Xr,Qr=`exclusiveMaximum`,$r,ni=`exclusiveMinimum`,ri,oi,si,di,fi,yi=`unevaluatedItems`,bi,Z=`unevaluatedProperties`,Ci,Ei,Mi,Q=`items`,Pi,Ri=`prefixItems`,zi,Wi=`unevaluatedItems`,Gi,Ji,Yi,Xi,$i,$14=`propertyDependencies`,ta;var init_dist2=__esm(()=>{init_es();init_dist();import_uri_js=__toESM(require_uri_all(),1);import_valid_url=__toESM(require_valid_url(),1);import_fast_deep_equal=__toESM(require_fast_deep_equal(),1);c2={DECLARATOR_ONEOF:`oneOfProperty`,propertyBlacklist:[`_id`],DYNAMIC_PROPERTIES:[`$ref`,`$defs`,`if`,`then`,`else`,`allOf`,`anyOf`,`oneOf`,`dependentSchemas`,`dependentRequired`,`definitions`,`dependencies`,`patternProperties`,`propertyDependencies`],REGEX_FLAGS:`u`,VALID_ANNOTATION_KEYWORDS:[`$id`,`$schema`,`title`,`description`,`default`,`oneOfProperty`],PROPERTIES_TO_MERGE:[`title`,`description`,`default`,`options`,`x-options`,`readOnly`,`writeOnly`]};l=Object.prototype.toString;ne=/(#)+$/;re=/#$/;ie=/^[^:]+:\/\/[^/]+\//;ae=/#.*$/;he=Object.prototype.hasOwnProperty;({DYNAMIC_PROPERTIES:ve,REGEX_FLAGS:ye,DECLARATOR_ONEOF:be,VALID_ANNOTATION_KEYWORDS:xe}=c2);Te={compileSchema(e,t,r,i){let a=this;t??=a.evaluationPath;let o=t.split(`/$ref`)[0],c={lastIdPointer:a.lastIdPointer,context:a.context,parent:a,evaluationPath:t,dynamicId:we(a.dynamicId,i),schemaLocation:r??b(a.schemaLocation,o),reducers:[],resolvers:[],validators:[],schema:e,...Te};return!x(e)&&!S(e)?(c.schemaValidation=[c.createError(`schema-error`,{pointer:r??t,schema:e,value:undefined,message:`JSON schema must be object or boolean - reveived: '${e}'`})],c):(c.schemaValidation=s2(Oe(c).filter((e)=>e!=null)),c)},createError(e,t,n){let r=this,i=n;if(i===undefined){let n=r.schema?.errorMessages?.[e]??r.context.errors[e];if(typeof n==`function`)return n(t);i=me(n??name,t)}return{type:`error`,code:e,message:i,data:t}},createAnnotation(e,t,n){let r=this,i=n;if(i===undefined){let n=r.schema?.errorMessages?.[e]??r.context.errors[e];if(typeof n==`function`)return n(t);i=me(n??name,t)}return{type:`annotation`,code:e,message:i,data:t}},createSchema:f,getChildSelection(e){let t=this;return t.context.methods.getChildSelection(t,e)},getNode:ge,getNodeChild:_e,getNodeRef(e){return this.compileSchema({$ref:e},`$dynamic`).resolveRef()},getNodeRoot(){return this.context.rootNode},getDraftVersion(){return this.context.version},getData(e,t){let n=this,r={recursionLimit:1,...n.context.getDataDefaultOptions,cache:{},...t??{}};return n.context.methods.getData(n,e,r)},reduceNode(e,t={}){let n=this,{key:r=`missing-key`,pointer:i=n.evaluationPath,path:a}=t;if(n.schema===false)return{node:n,error:undefined};if(n.schema===true){let t=n.compileSchema(f(e),n.evaluationPath,n.schemaLocation);return a?.push({pointer:i,node:n}),{node:t,error:undefined}}let o,s=n.compileSchema(n.schema,n.evaluationPath,n.schemaLocation),c=n.reducers;for(let t of c){let c=t({data:e,key:r,node:n,pointer:i,path:a??[]});if(C(c))return{node:undefined,error:c};if(c){if(c.schema===false){o=false;break}s=g(s,c)}}return o===false?{node:{...n,schema:false,reducers:[]},error:undefined}:(s!==n&&a?.push({pointer:i,node:n}),s.schema=fe(s.schema,be,...ve),ve.forEach((e)=>s[e]=undefined),{node:s,error:undefined})},validate(e,t=`#`,n=[]){let r=this,i=_2(r,e,t,n)??[],a=[],o=[],c=s2(Array.isArray(i)?i:[i]).filter(C),l=[];return s2(Array.isArray(i)?i:[i]).forEach((e)=>{if(C(e)){if(r.context.throwOnInvalidRef&&e.code===`ref-error`){let t=Error(`Invalid $ref: `+e.message);throw t.data=a,t}a.push(e)}else e instanceof Promise?l.push(e.then(s2)):je(e)&&o.push(e)}),{valid:c.length===0,errors:a,annotations:o,errorsAsync:l}},addRemoteSchema(t,n){x(n)&&(n.$id=m(n.$id||t));let r=this,{context:i}=r,a=x(n)?r.context.draft??n.$schema:undefined,o=Ce(i.drafts,a??i.rootNode.schema?.$schema),c={evaluationPath:`#`,lastIdPointer:`#`,schemaLocation:`#`,dynamicId:``,reducers:[],resolvers:[],validators:[],schema:n,context:{...i,refs:{},anchors:{},...copy(pe(o,`methods`,`keywords`,`version`,`formats`,`errors`))},...Te};c.context.rootNode=c,c.context.remotes[m(t)]=c;let l=Oe(c).filter((e)=>e!=null);l=s2(l);let u2=[],d=[];return l.forEach((e)=>{C(e)?u2.push(e):je(e)&&d.push(e)}),r.schemaErrors=u2,r.schemaAnnotations=d,r},resolveRef(e){throw Error(`method 'resolveRef' is not implemented`)},toSchemaNodes(){return p(this)},toDataNodes(e,t){let n=this;return n.context.methods.toDataNodes(n,e,t)},toJSON(){let e=this;return{...e,context:undefined,errors:undefined,parent:e.parent?.evaluationPath}}};Ee=[`$ref`,`if`,`$defs`];De=[`draft-04`,`draft-06`,`draft-07`];Me=/(#)+$/g;Ne=[``,null,`#`];Fe={id:`$ref`,keyword:`$ref`,order:10,parse:Le,addReduce:(e)=>e.$ref!=null||e.schema.$dynamicRef!=null,reduce:Re,addValidate:({schema:e})=>e.$ref!=null||e.$dynamicRef!=null,validate:Be};Ue={id:`$defs`,keyword:`$defs`,parse:We};Ke={id:`$ref`,keyword:`$ref`,parse:qe,addValidate:({schema:e})=>e.$ref!=null,validate:Je};Xe={id:`$ref`,keyword:`$ref`,parse:Qe,addValidate:({schema:e})=>e.$ref!=null,validate:Ke.validate};rt={id:nt,keyword:nt,order:-10,parse:it,addResolve:(e)=>e.items!=null,resolve:at,addValidate:({schema:e})=>e[nt]!=null&&e[nt]!==true&&Array.isArray(e.items),validate:ot};st={id:`additionalProperties`,keyword:`additionalProperties`,order:-10,parse:ct,addResolve:({schema:e})=>e.additionalProperties!=null,resolve:lt,addValidate:({schema:e})=>e.additionalProperties!==true&&e.additionalProperties!=null&&!(e.additionalProperties===false&&d(e.patternProperties)),validate:ut};dt={id:D,keyword:D,parse:ft,addReduce:(e)=>e[D]!=null,reduce:pt,addValidate:(e)=>e[D]!=null,validate:mt};ht={id:O,keyword:O,parse:gt,addReduce:(e)=>e[O]!=null,reduce:_t,addValidate:(e)=>e[O]!=null,validate:vt};yt={id:k,keyword:k,parse:bt,addValidate:(e)=>e[k]!=null,validate:xt,addReduce:(e)=>e[k]!=null,reduce:({node:e})=>e.compileSchema({items:{anyOf:[e[k].schema]}},e.evaluationPath,e.schemaLocation)};Ct={id:A,keyword:A,parse:wt,addValidate:(e)=>e[A]!=null,validate:Tt};Et={id:j,keyword:j,parse:Dt,addReduce:(e)=>e.dependentSchemas!=null,reduce:Ot,addValidate:(e)=>e.dependentSchemas!=null,validate:kt};At={id:M,keyword:M,parse:jt,order:-9,addReduce:(e)=>e.schema[M]!=null,reduce:Mt,addValidate:(e)=>e.schema[M]!=null,validate:Nt};Pt={id:N,keyword:N,parse:Ft,addValidate:(e)=>e[N]===true,validate:It};Lt={id:P,keyword:P,parse:Rt,addValidate:(e)=>e.enum!=null,validate:zt};Bt={"additional-items-error":"Array at `{{pointer}}` may not have an additional item `{{key}}`","additional-properties-error":"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`","all-of-error":"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`","any-of-error":"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`","const-error":"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`","contains-any-error":"The array at `{{pointer}}` must contain at least one item","contains-array-error":"The property at `{{pointer}}` must not be an array","contains-error":"The array at `{{pointer}}` must contain an element that matches `{{schema}}`","contains-min-error":"The array at `{{pointer}}` contains {{delta}} too few items matching `{{schema}}`","contains-max-error":"The array at `{{pointer}}` contains {{delta}} too many items matching `{{schema}}`","enum-error":"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`","exclusive-maximum-error":"Value in `{{pointer}}` is `{{length}}`, but should be at most `{{maximum}}`","exclusive-minimum-error":"Value in `{{pointer}}` is `{{length}}`, but should be at minimum `{{minimum}}`","forbidden-property-error":"Property name `{{property}}` at `{{pointer}}` is not allowed","format-date-error":"Value `{{value}}` at `{{pointer}}` is not a valid date","format-date-time-error":"Value `{{value}}` at `{{pointer}}` is not a valid date-time","format-duration-error":"Value `{{value}}` at `{{pointer}}` is not a valid duration","format-email-error":"Value `{{value}}` at `{{pointer}}` is not a valid email","format-hostname-error":"Value `{{value}}` at `{{pointer}}` is not a valid hostname","format-idn-hostname-error":"Value `{{value}}` at `{{pointer}}` is not a valid idn hostname","format-ipv4-error":"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address","format-ipv4-leading-zero-error":`IPv4 addresses starting with zero are invalid, since they are interpreted as octals`,"format-ipv6-error":"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address","format-ipv6-leading-zero-error":`IPv6 addresses starting with zero are invalid, since they are interpreted as octals`,"format-iri-error":"Value `{{value}}` at `{{pointer}}` is not a valid iri","format-iri-reference-error":"Value `{{value}}` at `{{pointer}}` is not a valid iri-reference","format-json-pointer-error":"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer","format-regex-error":"Value `{{value}}` at `{{pointer}}` is not a valid regular expression","format-time-error":"Value `{{value}}` at `{{pointer}}` is not a valid time","format-uri-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri","format-uri-reference-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference","format-uri-template-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri-template","format-url-error":"Value `{{value}}` at `{{pointer}}` is not a valid url","format-uuid-error":"Value `{{value}}` at `{{pointer}}` is not a valid uuid","invalid-data-error":"No value may be specified in `{{pointer}}`","invalid-property-name-error":"Invalid property name `{{property}}` at `{{pointer}}`","maximum-error":"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum","max-items-error":"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`","max-length-error":"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.","max-properties-error":"Too many properties in `{{pointer}}`, should be `{{maxProperties}}` at most, but got `{{length}}`","minimum-error":"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum","min-items-error":"Too few items in `{{pointer}}`, should be at least `{{minItems}}`, but got `{{length}}`","min-items-one-error":"At least one item is required in `{{pointer}}`","min-length-error":"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.","min-length-one-error":"A value is required in `{{pointer}}`","missing-one-of-declarator-error":"Missing oneOf declarator `{{declarator}}` in schema `{{schemaLocation}}`","min-properties-error":"Too few properties in `{{pointer}}`, should be at least `{{minProperties}}`, but got `{{length}}`","missing-array-item-error":`Array at '{{pointer}}' has a missing item at '{{key}}'`,"missing-dependency-error":"The required propery '{{missingProperty}}' in `{{pointer}}` is missing","missing-one-of-property-error":"Value at `{{pointer}}` must be object or array and have a property ${oneOfProperty}: ${value}","multiple-of-error":"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`","multiple-one-of-error":"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`","no-additional-properties-error":"Additional property `{{property}}` in `{{pointer}}` is not allowed","not-error":"Value `{{value}}` at pointer should not match schema `{{not}}`","one-of-error":"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema","one-of-property-error":"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`","pattern-error":"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`","pattern-properties-error":"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}","ref-error":`Could not resolve $ref '{{ref}}' from '{{pointer}}'`,"required-property-error":"The required property `{{key}}` is missing at `{{pointer}}`","schema-warning":`Failed retrieving a schema from '{{pointer}}' to key '{{key}}'`,"type-error":"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`","undefined-value-error":"Value must not be undefined in `{{pointer}}`","unevaluated-property-error":"Invalid unevaluated property `{{pointer}}`","unevaluated-items-error":"Invalid unevaluated item `{{pointer}}`","unique-items-error":"Items in array must be unique. Value `{{value}}` in `{{pointer}}` is a duplicate of {{duplicatePointer}}.","unknown-property-error":"Could not find a valid schema for property `{{pointer}}` within object","value-not-empty-error":"A value for `{{property}}` is required at `{{pointer}}`","deprecated-warning":"Value at `{{pointer}}` is deprecated","schema-error":`Invalid schema found at {{pointer}}: {{message}}`,"unknown-keyword-warning":`Keyword '{{value}}' is not a valid keyword to draft '{{draft}}'`,"unknown-format-warning":`Format {{value}} is not a valid format`};Vt={id:`exclusiveMaximum`,keyword:`exclusiveMaximum`,parse:Ht,addValidate:({schema:e})=>e.exclusiveMaximum===true||!isNaN(e.maximum),validate:Ut};Wt={id:`exclusiveMinimum`,keyword:`exclusiveMinimum`,parse:Gt,addValidate:({schema:e})=>e.exclusiveMinimum===true||!isNaN(e.minimum),validate:Kt};qt={id:F,keyword:F,parse:Jt,addValidate:({schema:e})=>e?.format!=null,validate:Yt};({REGEX_FLAGS:Xt}=c2);Zt=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;Qt=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;$t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;en=/^(?<time>(?:([0-1]\d|2[0-3]):[0-5]\d:(?<second>[0-5]\d|60)))(?:\.\d+)?(?<offset>(?:z|[+-]([0-1]\d|2[0-3])(?::?[0-5]\d)?))$/i;tn=[0,31,28,31,30,31,30,31,31,30,31,30,31];nn=/^(?:\/(?:[^~/]|~0|~1)*)*$/;rn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;an=/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/;I={date:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.match($t);if(!i)return e.createError(`format-date-error`,{value:n,pointer:t,schema:r});let a=+i[1],o=+i[2],s=+i[3],c=a%4==0&&(a%100!=0||a%400==0);if(!(o>=1&&o<=12&&s>=1&&s<=(o==2&&c?29:tn[o])))return e.createError(`format-date-error`,{value:n,pointer:t,schema:r})},"date-time":({node:e,pointer:t,data:n,path:r})=>{let{schema:i}=e;if(typeof n!=`string`||n===``)return;let a=n.split(/t/i);if(a.length===2){let n=I.date({node:e,pointer:t,data:a[0],path:r})===undefined,i=I.time({node:e,pointer:t,data:a[1],path:r})===undefined;if(n&&i)return}return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:i})},duration:({node:e,pointer:t,data:n})=>{if(u(n)===`string`&&(!an.test(n)||/(\d+M)(\d+W)|(\d+Y)(\d+W)/.test(n)))return e.createError(`format-duration-error`,{value:n,pointer:t,schema:e.schema})},email:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.lastIndexOf(`@`),a=n.substr(0,i),o=n.substr(i+1);if(!a||!o||a.length>64||o.length>253)return e.createError(`format-email-error`,{value:n,pointer:t,schema:r});let s=a;if(/^".*"$/.test(a)&&(s=a.replace(/(^")|([. @]+)|("$)/g,``)),s[0]===`.`||s.endsWith(`.`)||s.includes(`..`)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(s))return e.createError(`format-email-error`,{value:n,pointer:t,schema:r});if(/^\[.*\]$/.test(o)){let e=o.substr(1,o.length-2);if(Zt.test(e)||Qt.test(e)||/IPv6:::[0-9a-f]{1,4}/.test(e))return}if(!/^[a-z0-9.-]+$/i.test(o)||!o.split(`.`).every((e)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e)))return e.createError(`format-email-error`,{value:n,pointer:t,schema:r})},"json-pointer":({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n==`string`&&n!==``&&!nn.test(n))return e.createError(`format-json-pointer-error`,{value:n,pointer:t,schema:r})},"relative-json-pointer":({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n==`string`&&!rn.test(n))return e.createError(`format-json-pointer-error`,{value:n,pointer:t,schema:r})},regex:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(!(typeof n==`object`||typeof n==`number`||Array.isArray(n)||u(n)===`boolean`)){if(typeof n==`string`&&/\\Z$/.test(n)===false){try{new RegExp(n,r.regexFlags??Xt);return}catch{}return e.createError(`format-regex-error`,{value:n,pointer:t,schema:r})}return e.createError(`format-regex-error`,{value:n,pointer:t,schema:r})}},time:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.match(en);if(!i)return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:r});if(i.groups?.second===`60`){if(/23:59:60(z|\+00:00)/i.test(n))return;let a=i.groups.time.match(/(\d+):(\d+):/),o=i.groups.offset.match(/(\d+):(\d+)/);if(a&&o){let e=parseInt(a[1]),t=parseInt(o[1]),n=parseInt(a[2]),r=parseInt(o[2]),s;s=/^-/.test(i.groups.offset)?(e+t)*60+(n+r):(24+e-t)*60+(n-r);let c=Math.floor(s/60),l=c%24,u2=s-c*60;if(l===23&&u2===59)return}return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:r})}},url:({node:e,data:t,pointer:n})=>{let{schema:r}=e;if(!(t===``||import_valid_url.isWebUri(`${t}`)))return e.createError(`format-url-error`,{value:t,pointer:n,schema:r})},uuid:({node:e,data:t,pointer:n})=>{let{schema:r}=e;if(typeof t==`string`&&t!==``&&!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))return e.createError(`format-uuid-error`,{value:t,pointer:n,schema:r})}};sn=[`string`,`number`,`integer`,`boolean`,`null`,`array`,`object`];cn=[`additionalProperties`,`dependencies`,`dependentSchemas`,`dependentRequired`,`maxProperties`,`minProperties`,`patternProperties`,`properties`,`propertyNames`,`required`,`unevaluatedProperties`];ln=[`contains`,`items`,`maxItems`,`minItems`,`unevaluatedItems`,`uniqueItems`];({DECLARATOR_ONEOF:dn}=c2);fn={id:R,keyword:R,parse:mn,addReduce:(e)=>e[R]!=null,reduce:hn,addValidate:(e)=>e[R]!=null,validate:bn};pn={id:`oneOf-fuzzy`,keyword:`oneOf`,parse:mn,addReduce:(e)=>e.oneOf!=null,reduce:vn,addValidate:(e)=>e.oneOf!=null,validate:bn};try{typeof File==`function`&&(xn=(e)=>e instanceof File)}catch{}En={null:(e,t,n)=>Dn(e,t,null,n.useTypeDefaults),string:(e,t,n)=>Dn(e,t,``,n.useTypeDefaults),number:(e,t,n)=>Dn(e,t,0,n.useTypeDefaults),integer:(e,t,n)=>Dn(e,t,0,n.useTypeDefaults),boolean:(e,t,n)=>Dn(e,t,false,n.useTypeDefaults),object:(e,t,n)=>{let r=e.schema,i=r.default===undefined?{}:r.default,a={},o=n.extendDefaults===false&&r.default!==undefined?[]:r.required??[],s=e.properties;s&&Object.keys(s).forEach((e)=>{let r=s[e],c=o.includes(e),l=y2(t,e),d=t===undefined||l===undefined?y2(i,e):l;if(d!==undefined||c||n.addOptionalProps){let t=r.getData(d,n),i=u(t);if(n.removeInvalidData&&i!==`object`&&i!==`array`&&!r.validate(t).valid)return;(t!==undefined||n.useTypeDefaults!==false)&&(a[e]=t)}});let c=e.dependentRequired;d(c)&&Object.keys(c).forEach((t)=>{let r=c[t];y2(a,t)!==undefined&&r.forEach((t)=>{let{node:r}=e.getNodeChild(t,a);r&&(a[t]=r.getData(y2(a,t),n))})});let l=e.dependentSchemas;if(l&&Object.keys(l).forEach((e)=>{let r=l[e];if(a[e]!==undefined&&b2(r)){let e=r.getData(t??a,n);Object.assign(a,e)}}),t)if(n.removeInvalidData===true&&(r.additionalProperties===false||d(r.additionalProperties))){let n=e.additionalProperties;b2(n)&&Object.keys(t).forEach((e)=>{if(a[e]==null){let r=y2(t,e);n.validate(r).valid&&(a[e]=r)}})}else Object.keys(t).forEach((r)=>{let i=u(r);if(n.removeInvalidData&&e.properties&&e.properties[r]&&i!==`object`&&i!==`array`){let i=e.properties[r],a=i.getData(y2(t,r),n);if(!i.validate(a).valid)return}a[r]??(a[r]=y2(t,r))});if(e.if){let{valid:t}=e.if.validate(a);if(t&&e.then){let t=e.then.getData(a,n);Object.assign(a,t)}else if(!t&&e.else){let t=e.else.getData(a,n);Object.assign(a,t)}}return{...i,...a}},array:(t,n,r)=>{let i=t.schema,a=i.default===undefined?[]:i.default,o=Array.isArray(n)?[...n]:a,s=r.extendDefaults===false&&i.default!==undefined?0:i.minItems??0;if(i.items==null){if(t.items){let e=Math.max(s,o.length);for(let n=0;n<e;n+=1)o[n]=t.items.getData(o[n],r)}return o||[]}if(t.prefixItems){let e=Array.isArray(n)?n:[],i=Math.max(s??0,t.prefixItems.length);for(let n=0;n<i;n+=1){let i=t.prefixItems[n]??t.items;if(i&&Cn(i,r)||e[n]!==undefined){let e=i.getData(o[n]==null?a[n]:o[n],r);e!==undefined&&(o[n]=e)}}return o||[]}if(t.items==null)return o;if(t.items&&Cn(t.items,r)||Array.isArray(n)&&n?.length>0){let n={...r.cache};for(let i=0,c=Math.max(s,o.length);i<c;i+=1){r.cache=copy(n);let s={...r,disableRecursionLimit:true},c=t.items.getData(o[i]==null?a[i]:o[i],s);if(c===undefined)return o;o[i]=c}}return o}};On={id:z,keyword:z,parse:An,addResolve:(e)=>(e.prefixItems||e[z])!=null,resolve:kn,addValidate:({schema:e})=>e.items!=null,validate:jn};Mn={id:B,keyword:B,parse:Nn,addValidate:(e)=>e.maximum!=null,validate:Pn};In={id:Fn,keyword:Fn,parse:Ln,addValidate:({schema:e})=>!isNaN(e.maxItems),validate:Rn};Bn={id:V,keyword:V,parse:Vn,addValidate:(e)=>e[V]!=null,validate:Hn};Un={id:H,keyword:H,parse:Wn,addValidate:(e)=>e[H]!=null,validate:Gn};Kn={id:U,keyword:U,parse:qn,addValidate:(e)=>e[U]!=null,validate:Jn};Yn={id:W,keyword:W,parse:Xn,addValidate:(e)=>e[W]!=null,validate:Zn};Qn={id:G,keyword:G,parse:$n,addValidate:(e)=>e[G]!=null,validate:er};tr={id:K,keyword:K,parse:nr,addValidate:(e)=>e[K]!=null,validate:rr};ar={id:q,keyword:q,parse:or,addValidate:(e)=>e[q]!=null,validate:sr};cr={id:`not`,keyword:`not`,parse:lr,addValidate:(e)=>e.not!=null,validate:ur};({REGEX_FLAGS:fr}=c2);pr={id:dr,keyword:dr,parse:mr,addValidate:(e)=>e[dr]!=null,validate:hr};({REGEX_FLAGS:gr}=c2);_r={id:`patternProperties`,keyword:`patternProperties`,parse:vr,addReduce:(e)=>e.patternProperties!=null,reduce:br,addResolve:(e)=>e.patternProperties!=null,resolve:yr,addValidate:(e)=>e.patternProperties!=null,validate:xr};Sr={id:`property`,keyword:`properties`,parse:wr,addResolve:(e)=>e.properties!=null,resolve:Cr,addValidate:(e)=>e.properties!=null,validate:Tr};Er={id:J,keyword:J,parse:Dr,addValidate:(e)=>e.schema[J]!=null,validate:Or};Ar={id:kr,keyword:kr,parse:jr,addValidate:(e)=>e.required!=null,validate:Mr};zr=[`null`,`boolean`,`number`,`integer`,`string`,`object`,`array`];Br={id:Y,keyword:Y,parse:Vr,addReduce:(e)=>Array.isArray(e.type),reduce:Hr,addValidate:(e)=>e.type!=null,validate:Wr};Kr={id:Gr,keyword:Gr,parse:qr,addValidate:({schema:e})=>e[Gr]===true,validate:Jr};Yr=Lr({version:`draft-04`,$schemaRegEx:`draft-?0?4`,$schema:`http://json-schema.org/draft-04/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Xe,dt,ht,yt,Ue,At,Pt,Lt,Vt,Wt,qt,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});Xr={id:`const`,keyword:`const`,addValidate:({schema:e})=>e.const!==undefined,validate:Zr};$r={id:Qr,keyword:Qr,parse:ei,addValidate:({schema:e})=>e.exclusiveMaximum!=null&&!isNaN(parseInt(e.exclusiveMaximum)),validate:ti};ri={id:ni,keyword:ni,parse:ii,addValidate:({schema:e})=>e[ni]!=null&&!isNaN(parseInt(e[ni])),validate:ai};oi=Lr({version:`draft-06`,$schemaRegEx:`draft-?0?6`,$schema:`http://json-schema.org/draft-06/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Ke,dt,ht,Xr,yt,Ue,At,Pt,Lt,$r,ri,qt,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});si={id:`if-then-else`,keyword:`if`,parse:ci,addReduce:(e)=>e.if!=null&&(e.then!=null||e.else!=null),reduce:li,addValidate:(e)=>e.if!=null,validate:ui};di=Lr({version:`draft-07`,$schemaRegEx:`draft-?0?7`,$schema:`http://json-schema.org/draft-07/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Ke,dt,ht,Xr,yt,Ue,At,Pt,Lt,$r,ri,qt,si,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});fi={id:`$ref`,keyword:`$ref`,parse:mi,addValidate:({schema:e})=>e.$ref!=null||e.$recursiveRef!=null,validate:gi,addReduce:({schema:e})=>e.$ref!=null||e.$recursiveRef!=null,reduce:Re};bi={id:yi,keyword:yi,parse:xi,addValidate:({schema:e})=>e[yi]!=null,validate:Si};Ci={id:Z,keyword:Z,parse:wi,addValidate:({schema:e})=>e[Z]!=null,validate:Ti};Ei=Lr({version:`draft-2019-09`,$schemaRegEx:`draft[/-]2019-?(09)?`,$schema:`https://json-schema.org/draft/2019-09/schema`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[fi,dt,ht,Xr,yt,Ue,At,Ct,Et,Pt,Lt,$r,ri,qt,si,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,bi,Ci,Kr,fn,rt,st]});Mi={null:(e,t,n)=>Ni(e,t,null,n.useTypeDefaults),string:(e,t,n)=>Ni(e,t,``,n.useTypeDefaults),number:(e,t,n)=>Ni(e,t,0,n.useTypeDefaults),integer:(e,t,n)=>Ni(e,t,0,n.useTypeDefaults),boolean:(e,t,n)=>Ni(e,t,false,n.useTypeDefaults),object:(e,t,n)=>{let r=e.schema,i=r.default===undefined?{}:r.default,a={},o=n.extendDefaults===false&&r.default!==undefined?[]:r.required??[],s=e.properties;s&&Object.keys(s).forEach((e)=>{let r=s[e],c=o.includes(e),l=y2(t,e),d=t===undefined||l===undefined?y2(i,e):l;if(d!==undefined||c||n.addOptionalProps){let t=r.getData(d,n),i=u(t);if(n.removeInvalidData&&i!==`object`&&i!==`array`&&!r.validate(t).valid)return;(t!==undefined||n.useTypeDefaults!==false)&&(a[e]=t)}});let c=e.dependentRequired;d(c)&&Object.keys(c).forEach((t)=>{let r=c[t];y2(a,t)!==undefined&&r.forEach((t)=>{let{node:r}=e.getNodeChild(t,a);r&&(a[t]=r.getData(y2(a,t),n))})});let l=e.dependentSchemas;if(l&&Object.keys(l).forEach((e)=>{let r=l[e];if(a[e]!==undefined&&b2(r)){let e=r.getData(t??a,n);Object.assign(a,e)}}),t&&(n.removeInvalidData===true&&(r.additionalProperties===false||d(r.additionalProperties))?b2(e.additionalProperties)&&Object.keys(t).forEach((n)=>{if(a[n]==null){let r=y2(t,n);e.additionalProperties?.validate(r).valid&&(a[n]=r)}}):Object.keys(t).forEach((r)=>{let i=u(r);if(n.removeInvalidData&&e.properties&&e.properties[r]&&i!==`object`&&i!==`array`){let i=e.properties[r],a=i.getData(y2(t,r),n);if(!i.validate(a).valid)return}a[r]??(a[r]=y2(t,r))})),e.if){let{errors:t}=e.if.validate(a);if(t.length===0&&e.then){let t=e.then.getData(a,n);Object.assign(a,t)}else if(t.length>0&&e.else){let t=e.else.getData(a,n);Object.assign(a,t)}}return{...i,...a}},array:(t,n,r)=>{let i=t.schema,a=i.default===undefined?[]:i.default,o=Array.isArray(n)?[...n]:a,s=r.extendDefaults===false&&i.default!==undefined?0:i.minItems??0;if(i.prefixItems==null){if(t.items&&(ki(t.items,r)||o?.length>0)){let n={...r.cache},i=Math.max(s,o.length);for(let s=0;s<i;s+=1){r.cache=copy(n);let i={...r,disableRecursionLimit:true};o[s]=t.items.getData(o[s]==null?a[s]:o[s],i)}}return o||[]}if(t.prefixItems){let e=Array.isArray(n)?n:[],i=Math.max(s??0,t.prefixItems.length);for(let n=0;n<i;n+=1){let i=t.prefixItems[n]??t.items;if(i&&ki(i,r)||e[n]!==undefined){let e=i.getData(o[n]==null?a[n]:o[n],r);e!==undefined&&(o[n]=e)}}return o||[]}if(t.items==null)return o;if(t.items&&ki(t.items,r)||n?.length>0){let n={...r.cache};for(let i=0,c=Math.max(s,o.length);i<c;i+=1){r.cache=copy(n);let s={...r,disableRecursionLimit:true},c=t.items.getData(o[i]==null?a[i]:o[i],s);if(c===undefined)return o;o[i]=c}}return o}};Pi={id:Q,keyword:Q,parse:Ii,addResolve:(e)=>e[Q]!=null,resolve:Fi,addValidate:(e)=>e[Q]!=null,validate:Li};zi={id:Ri,keyword:Ri,parse:Vi,addResolve:(e)=>e[Ri]!=null,resolve:Bi,addValidate:(e)=>e[Ri]!=null,validate:Hi};Gi={id:Wi,keyword:Wi,parse:Ki,addValidate:({schema:e})=>e.unevaluatedItems!=null,validate:qi};Ji=Lr({version:`draft-2020-12`,$schemaRegEx:`draft[/-]2020-?(12)?`,$schema:`https://json-schema.org/draft/2020-12/schema`,errors:Bt,formats:I,methods:{createSchema:f,getData:ji,getChildSelection:Di,toDataNodes:Rr},keywords:[Fe,st,dt,ht,Xr,yt,Ue,At,Ct,Et,Pt,Lt,$r,ri,qt,si,Pi,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,fn,pr,_r,zi,Sr,Er,Ar,Br,Gi,Ci,Kr]});({REGEX_FLAGS:Yi}=c2);Xi=[Yr,oi,di,Ei,Ji];$i=Pr(Ji,{$schemaRegEx:`.`,keywords:[pn],errors:{"min-length-error":(e)=>e.minLength===1?{type:`error`,code:`min-length-one-error`,message:`An input is required`,data:e}:{type:`error`,code:`min-length-error`,message:me("Value in `{{pointer}}` is `{{length}}`, but should be `{{minLength}}` at minimum",e),data:e}}});ta={id:$14,keyword:$14,parse:na,addValidate:(e)=>e[$14]!=null,validate:ra,addReduce:(e)=>e[$14]!=null,reduce:ia}});import"@lostgradient/cinder/schema-form/styles";import"svelte/internal/disclose-version";import*as $17 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $16 from"svelte/internal/client";import{tick}from"svelte";function classNames(...parts){return parts.filter((part)=>typeof part==="string"&&part.length>0).join(" ")}import"svelte/internal/disclose-version";import*as $5 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $ from"svelte/internal/client";var root=$.from_html(`<span data-cinder-checkbox-indicator-shell=""><!> <span class="cinder-checkbox-field__indicator" aria-hidden="true"></span></span>`);function Checkbox_indicator_shell($$anchor,$$props){var span=root();var node=$.child(span);$.snippet(node,()=>$$props.control);$.next(2);$.reset(span);$.template_effect(()=>$.set_class(span,1,$.clsx(["cinder-checkbox-field__control",$$props.class])));$.append($$anchor,span)}function describeId(fieldId,hasDescription){return hasDescription?`${fieldId}-description`:undefined}function errorId(fieldId,hasError){return hasError?`${fieldId}-error`:undefined}function composeDescribedBy(...ids){const filtered=ids.flatMap((id)=>typeof id==="string"?id.trim().split(/\s+/).filter(Boolean):[]);const unique=Array.from(new Set(filtered));return unique.length>0?unique.join(" "):undefined}function ariaInvalid(hasError){return hasError?"true":undefined}function resolveFieldControl(input){const resolvedId=input.id??input.context?.controlId??input.generatedId;const defaultDescriptionId=describeId(resolvedId,input.hasDescription??false);const defaultErrorId=errorId(resolvedId,input.hasError??false);const ownDescriptionId=defaultDescriptionId&&defaultDescriptionId===input.context?.descriptionId&&input.localIdNamespace?`${resolvedId}-${input.localIdNamespace}-description`:defaultDescriptionId;const ownErrorId=defaultErrorId&&defaultErrorId===input.context?.errorId&&input.localIdNamespace?`${resolvedId}-${input.localIdNamespace}-error`:defaultErrorId;const descriptionId=ownDescriptionId??input.context?.descriptionId;const resolvedErrorId=ownErrorId??input.context?.errorId;const explicitInvalid=ariaInvalid(input.hasError??false);const consumerInvalid=input.consumerInvalid===true?"true":input.consumerInvalid===false?undefined:input.consumerInvalid??undefined;return{id:resolvedId,ownDescriptionId,ownErrorId,descriptionId,errorId:resolvedErrorId,describedBy:composeDescribedBy(ownDescriptionId,...input.additionalDescribedBy??[],ownErrorId,input.context?.describedBy,input.consumerDescribedBy),ariaInvalid:explicitInvalid??input.context?.invalid??consumerInvalid,required:input.required??input.context?.required??false,disabled:input.disabled??input.context?.disabled??false}}import{createContext}from"svelte";function optionalContext(getStrict){return()=>{try{return getStrict()}catch{return}}}var[getFormFieldContextStrict,setFormFieldContextRaw]=createContext();function setFormFieldContext(context){setFormFieldContextRaw(context)}var getFormFieldContext=optionalContext(getFormFieldContextStrict);var true_default=true;function devWarn(message,...args){if(!true_default)return;console.warn(message,...args)}function commitValue(proposed,onValueChangeRequest,setValue,onValueChange){const requested=onValueChangeRequest?.(proposed);const committed=requested===undefined?proposed:requested;setValue(committed);onValueChange?.(committed);return committed}import"@lostgradient/cinder/form-field/styles";import"svelte/internal/disclose-version";import*as $4 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $3 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $2 from"svelte/internal/client";function Form_field_provider($$anchor,$$props){$2.push($$props,true);const forwardedContext={get controlId(){return $$props.context.controlId},get labelId(){return $$props.context.labelId},get describedBy(){return $$props.context.describedBy},get descriptionId(){return $$props.context.descriptionId},get warningId(){return $$props.context.warningId},get managedId(){return $$props.context.managedId},get errorId(){return $$props.context.errorId},get invalid(){return $$props.context.invalid},get required(){return $$props.context.required},get disabled(){return $$props.context.disabled}};setFormFieldContext(forwardedContext);var fragment=$2.comment();var node=$2.first_child(fragment);$2.snippet(node,()=>$$props.children);$2.append($$anchor,fragment);$2.pop()}var rest_excludes=new Set(["$$slots","$$events","$$legacy","id","label","labelVisible","description","warning","error","managed","required","disabled","class","controlClass","labelClass","descriptionClass","warningClass","errorClass","descriptionId","errorId","controlLeading","controlTrailing","controlNativeDate","controlDisabled","controlInvalid","fullWidth","errorMountedOnDemand","control","before","after","message"]);var root2=$3.from_html(`<span class="cinder-_required-marker" aria-hidden="true">*</span>`);var root_1=$3.from_html(`<label> <!></label>`);var root_2=$3.from_html(`<div><!> <!> <!></div>`);var root_3=$3.from_html(`<p> </p>`);var root_4=$3.from_html(`<p class="cinder-form-field__managed"> </p>`);var root_5=$3.from_html(`<p aria-live="polite"> </p>`);var root_6=$3.from_html(`<div><!> <!> <!> <!> <!> <!> <!></div>`);function Form_field_frame($$anchor,$$props){$3.push($$props,true);let labelVisible=$3.prop($$props,"labelVisible",3,true),required=$3.prop($$props,"required",3,false),disabled=$3.prop($$props,"disabled",3,false),controlLeading=$3.prop($$props,"controlLeading",3,false),controlTrailing=$3.prop($$props,"controlTrailing",3,false),controlNativeDate=$3.prop($$props,"controlNativeDate",3,false),controlDisabled=$3.prop($$props,"controlDisabled",3,false),controlInvalid=$3.prop($$props,"controlInvalid",3,false),fullWidth=$3.prop($$props,"fullWidth",3,false),errorMountedOnDemand=$3.prop($$props,"errorMountedOnDemand",3,false),rest=$3.rest_props($$props,rest_excludes);const labelId=$3.derived(()=>$$props.label?`${$$props.id}-label`:undefined);const descriptionId=$3.derived(()=>$$props.descriptionId??describeId($$props.id,!!$$props.description));const warningId=$3.derived(()=>$$props.warning?`${$$props.id}-warning`:undefined);const managedId=$3.derived(()=>$$props.managed?`${$$props.id}-managed`:undefined);const errorId2=$3.derived(()=>$$props.errorId??errorId($$props.id,!!$$props.error));const describedBy=$3.derived(()=>composeDescribedBy($3.get(descriptionId),$3.get(warningId),$3.get(managedId),$3.get(errorId2)));const invalid=$3.derived(()=>ariaInvalid(!!$$props.error));const needsControlWrapper=$3.derived(()=>!!$$props.controlClass||!!$$props.before||!!$$props.after);const context={get controlId(){return $$props.id},get labelId(){return $3.get(labelId)},get describedBy(){return $3.get(describedBy)},get descriptionId(){return $3.get(descriptionId)},get warningId(){return $3.get(warningId)},get managedId(){return $3.get(managedId)},get errorId(){return $3.get(errorId2)},get invalid(){return $3.get(invalid)},get required(){return required()},get disabled(){return disabled()}};var div=root_6();$3.attribute_effect(div,($0)=>({...rest,class:$0,"data-cinder-full-width":fullWidth()?"":undefined,"data-cinder-managed":$$props.managed?"":undefined,"data-cinder-managed-by":$$props.managed?.by||undefined}),[()=>classNames("cinder-form-field",$$props.class)]);var node=$3.child(div);{var consequent_1=($$anchor)=>{var label_1=root_1();var text=$3.child(label_1);var node_1=$3.sibling(text);{var consequent=($$anchor)=>{var span=root2();$3.append($$anchor,span)};$3.if(node_1,($$render)=>{if(required())$$render(consequent)})}$3.reset(label_1);$3.template_effect(($0)=>{$3.set_attribute(label_1,"id",$3.get(labelId));$3.set_attribute(label_1,"for",$$props.id);$3.set_class(label_1,1,$0);$3.set_attribute(label_1,"data-disabled",disabled()||undefined);$3.set_text(text,`${$$props.label??""} `)},[()=>$3.clsx(classNames("cinder-form-field__label",$$props.labelClass,!labelVisible()&&"cinder-sr-only"))]);$3.append($$anchor,label_1)};$3.if(node,($$render)=>{if($$props.label)$$render(consequent_1)})}var node_2=$3.sibling(node,2);{var consequent_4=($$anchor)=>{var div_1=root_2();var node_3=$3.child(div_1);{var consequent_2=($$anchor)=>{var fragment=$3.comment();var node_4=$3.first_child(fragment);$3.snippet(node_4,()=>$$props.before);$3.append($$anchor,fragment)};$3.if(node_3,($$render)=>{if($$props.before)$$render(consequent_2)})}var node_5=$3.sibling(node_3,2);Form_field_provider(node_5,{get context(){return context},children:($$anchor,$$slotProps)=>{var fragment_1=$3.comment();var node_6=$3.first_child(fragment_1);$3.snippet(node_6,()=>$$props.control);$3.append($$anchor,fragment_1)},$$slots:{default:true}});var node_7=$3.sibling(node_5,2);{var consequent_3=($$anchor)=>{var fragment_2=$3.comment();var node_8=$3.first_child(fragment_2);$3.snippet(node_8,()=>$$props.after);$3.append($$anchor,fragment_2)};$3.if(node_7,($$render)=>{if($$props.after)$$render(consequent_3)})}$3.reset(div_1);$3.template_effect(($0)=>{$3.set_class(div_1,1,$0);$3.set_attribute(div_1,"data-cinder-full-width",fullWidth()?"":undefined);$3.set_attribute(div_1,"data-leading",controlLeading()?"":undefined);$3.set_attribute(div_1,"data-trailing",controlTrailing()?"":undefined);$3.set_attribute(div_1,"data-native-date",controlNativeDate()?"":undefined);$3.set_attribute(div_1,"data-disabled",controlDisabled()?"":undefined);$3.set_attribute(div_1,"data-invalid",controlInvalid()?"":undefined)},[()=>$3.clsx(classNames("cinder-form-field__control",$$props.controlClass))]);$3.append($$anchor,div_1)};var alternate=($$anchor)=>{Form_field_provider($$anchor,{get context(){return context},children:($$anchor,$$slotProps)=>{var fragment_4=$3.comment();var node_9=$3.first_child(fragment_4);$3.snippet(node_9,()=>$$props.control);$3.append($$anchor,fragment_4)},$$slots:{default:true}})};$3.if(node_2,($$render)=>{if($3.get(needsControlWrapper))$$render(consequent_4);else $$render(alternate,-1)})}var node_10=$3.sibling(node_2,2);{var consequent_5=($$anchor)=>{var p=root_3();var text_1=$3.only_child(p,true);$3.template_effect(($0)=>{$3.set_attribute(p,"id",$3.get(descriptionId));$3.set_class(p,1,$0);$3.set_text(text_1,$$props.description)},[()=>$3.clsx(classNames("cinder-form-field__description",$$props.descriptionClass))]);$3.append($$anchor,p)};$3.if(node_10,($$render)=>{if($$props.description)$$render(consequent_5)})}var node_11=$3.sibling(node_10,2);{var consequent_6=($$anchor)=>{var p_1=root_3();var text_2=$3.only_child(p_1,true);$3.template_effect(($0)=>{$3.set_attribute(p_1,"id",$3.get(warningId));$3.set_class(p_1,1,$0);$3.set_text(text_2,$$props.warning)},[()=>$3.clsx(classNames("cinder-form-field__warning",$$props.warningClass))]);$3.append($$anchor,p_1)};$3.if(node_11,($$render)=>{if($$props.warning)$$render(consequent_6)})}var node_12=$3.sibling(node_11,2);{var consequent_7=($$anchor)=>{var p_2=root_4();var text_3=$3.only_child(p_2);$3.template_effect(()=>{$3.set_attribute(p_2,"id",$3.get(managedId));$3.set_text(text_3,`${$$props.managed.by?`Managed by ${$$props.managed.by}`:"Managed by policy"}${$$props.managed.reason?`: ${$$props.managed.reason}`:""}`)});$3.append($$anchor,p_2)};$3.if(node_12,($$render)=>{if($$props.managed)$$render(consequent_7)})}var node_13=$3.sibling(node_12,2);{var consequent_8=($$anchor)=>{var fragment_5=$3.comment();var node_14=$3.first_child(fragment_5);$3.snippet(node_14,()=>$$props.message);$3.append($$anchor,fragment_5)};$3.if(node_13,($$render)=>{if($$props.message)$$render(consequent_8)})}var node_15=$3.sibling(node_13,2);{var consequent_9=($$anchor)=>{var p_3=root_5();var text_4=$3.only_child(p_3,true);$3.template_effect(($0)=>{$3.set_attribute(p_3,"id",$3.get(errorId2));$3.set_class(p_3,1,$0);$3.set_attribute(p_3,"data-cinder-error",$$props.error?"":undefined);$3.set_text(text_4,$$props.error??"")},[()=>$3.clsx(classNames("cinder-form-field__error",$$props.errorClass))]);$3.append($$anchor,p_3)};$3.if(node_15,($$render)=>{if($$props.error||!errorMountedOnDemand())$$render(consequent_9)})}$3.reset(div);$3.append($$anchor,div);$3.pop()}function Form_field($$anchor,$$props){$4.push($$props,true);let labelVisible=$4.prop($$props,"labelVisible",3,true),required=$4.prop($$props,"required",3,false),disabled=$4.prop($$props,"disabled",3,false);{let $0=$4.derived(()=>classNames($$props.class));Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get warning(){return $$props.warning},get error(){return $$props.error},get managed(){return $$props.managed},get required(){return required()},get disabled(){return disabled()},get class(){return $4.get($0)},get control(){return $$props.children}})}$4.pop()}var form_field_default=Form_field;var rest_excludes2=new Set(["$$slots","$$events","$$legacy","id","checked","onValueChangeRequest","onValueChange","indeterminate","label","description","error","disabled","required","class","aria-describedby","aria-invalid","onchange"]);var root3=$5.from_html(`<input/>`);var root_12=$5.from_html(`<div class="cinder-checkbox-row"><!></div>`);function Checkbox($$anchor,$$props){const generatedId=$5.props_id();$5.push($$props,true);const control=($$anchor)=>{var div=root_12();var node=$5.child(div);{const control=($$anchor)=>{var input=root3();$5.attribute_effect(input,($0)=>({id:$5.get(field).id,type:"checkbox",...rest,disabled:$5.get(field).disabled,required:$5.get(field).required,checked:checked(),onchange:handleChange,class:$0,"aria-invalid":$5.get(field).ariaInvalid,"aria-describedby":$5.get(field).describedBy}),[()=>classNames("cinder-checkbox",$$props.class)],undefined,undefined,undefined,true);$5.bind_this(input,($$value)=>$5.set(inputElement,$$value),()=>$5.get(inputElement));$5.append($$anchor,input)};Checkbox_indicator_shell(node,{control,$$slots:{control:true}})}$5.reset(div);$5.append($$anchor,div)};let checked=$5.prop($$props,"checked",15,false),indeterminate=$5.prop($$props,"indeterminate",11,false),rest=$5.rest_props($$props,rest_excludes2);const context=getFormFieldContext();const field=$5.derived(()=>resolveFieldControl({...$$props.id!==undefined?{id:$$props.id}:{},generatedId,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"checkbox",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],disabled:$$props.disabled,required:$$props.required??undefined}));const renderInlineLabel=$5.derived(()=>!!$$props.label&&(!context||!context.labelId));$5.user_effect(()=>{if(context&&$$props.id&&context.controlId!==$$props.id){devWarn(`[cinder/Checkbox] id mismatch: Checkbox id="${$$props.id}" but wrapping FormField expects controlId="${context.controlId}". Set the same id on both, or omit id on the Checkbox to inherit it.`)}});let inputElement=$5.state(undefined);$5.user_effect(()=>{if($5.get(inputElement)){$5.get(inputElement).indeterminate=indeterminate()&&!checked()}});let resetSyncTimeout;function syncCheckedAfterFormReset(){if(resetSyncTimeout!==undefined)clearTimeout(resetSyncTimeout);resetSyncTimeout=setTimeout(()=>{resetSyncTimeout=undefined;if(!$5.get(inputElement))return;checked($5.get(inputElement).checked);$5.get(inputElement).indeterminate=indeterminate()&&!$5.get(inputElement).checked},0)}$5.user_effect(()=>{const form=$5.get(inputElement)?.form;if(!form)return;form.addEventListener("reset",syncCheckedAfterFormReset);return()=>{form.removeEventListener("reset",syncCheckedAfterFormReset);if(resetSyncTimeout!==undefined){clearTimeout(resetSyncTimeout);resetSyncTimeout=undefined}}});function handleChange(event){const target=event.currentTarget;const rawChecked=target.checked;$$props.onchange?.(event);const committed=commitValue(rawChecked,$$props.onValueChangeRequest,(next)=>{checked(next)},$$props.onValueChange);target.checked=committed;target.indeterminate=indeterminate()&&!committed}var fragment=$5.comment();var node_1=$5.first_child(fragment);{var consequent_1=($$anchor)=>{var fragment_1=$5.comment();var node_2=$5.first_child(fragment_1);{var consequent=($$anchor)=>{{let $0=$5.derived(()=>$5.get(renderInlineLabel)?$$props.label:undefined);Form_field_frame($$anchor,{get id(){return $5.get(field).id},get label(){return $5.get($0)},get description(){return $$props.description},get error(){return $$props.error},get descriptionId(){return $5.get(field).ownDescriptionId},get errorId(){return $5.get(field).ownErrorId},get required(){return $5.get(field).required},get disabled(){return $5.get(field).disabled},class:"cinder-checkbox-field",get control(){return control}})}};var alternate=($$anchor)=>{control($$anchor)};$5.if(node_2,($$render)=>{if($5.get(renderInlineLabel)||$$props.description||$$props.error)$$render(consequent);else $$render(alternate,-1)})}$5.append($$anchor,fragment_1)};var alternate_1=($$anchor)=>{form_field_default($$anchor,{get id(){return $5.get(field).id},get label(){return $$props.label},get description(){return $$props.description},get error(){return $$props.error},get required(){return $5.get(field).required},get disabled(){return $5.get(field).disabled},class:"cinder-checkbox-field",children:($$anchor,$$slotProps)=>{control($$anchor)},$$slots:{default:true}})};$5.if(node_1,($$render)=>{if(context)$$render(consequent_1);else $$render(alternate_1,-1)})}$5.append($$anchor,fragment);$5.pop()}import"svelte/internal/disclose-version";import*as $6 from"svelte/internal/client";var calendarIcon=($$anchor)=>{var svg=root4();$6.append($$anchor,svg)};var rest_excludes3=new Set(["$$slots","$$events","$$legacy","id","value","onValueChangeRequest","onValueChange","label","labelVisible","description","error","disabled","required","type","variant","inputAttachment","groupClassName","class","leading","trailing","leadingInteractive","trailingInteractive","aria-describedby","aria-invalid","oninput"]);var root4=$6.from_svg(`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>`);var root_13=$6.from_html(`<input/>`);var root_22=$6.from_html(`<span><!></span>`);var root_32=$6.from_html(`<span class="cinder-input-group__trailing cinder-input-group__date-icon cinder-_truncate" aria-hidden="true"><!></span>`);function Input($$anchor,$$props){$6.push($$props,true);const inputElement=($$anchor)=>{var input=root_13();$6.attribute_effect(input,($0)=>({id:$$props.id,type:type(),...rest,disabled:$6.get(resolvedDisabled),required:$6.get(resolvedRequired),value:value(),oninput:handleInput,class:$0,"data-cinder-full-width":true,"data-cinder-variant":variant(),"data-cinder-native-date":$6.get(rendersNativeDateIcon)?"":undefined,"aria-invalid":$6.get(resolvedAriaInvalid),"aria-describedby":$6.get(describedBy)}),[()=>classNames("cinder-input",$$props.class)],undefined,undefined,undefined,true);$6.bind_this(input,($$value)=>$6.set(inputNode,$$value),()=>$6.get(inputNode));$6.attach(input,()=>$$props.inputAttachment);$6.append($$anchor,input)};const leadingAdornment=($$anchor)=>{var fragment=$6.comment();var node=$6.first_child(fragment);{var consequent=($$anchor)=>{var span=root_22();var node_1=$6.child(span);$6.snippet(node_1,()=>$$props.leading);$6.reset(span);$6.template_effect(($0)=>{$6.set_class(span,1,$0);$6.set_attribute(span,"aria-hidden",leadingInteractive()?undefined:"true")},[()=>$6.clsx(classNames("cinder-input-group__leading",!leadingInteractive()&&"cinder-_truncate"))]);$6.append($$anchor,span)};$6.if(node,($$render)=>{if($$props.leading)$$render(consequent)})}$6.append($$anchor,fragment)};const trailingAdornment=($$anchor)=>{var fragment_1=$6.comment();var node_2=$6.first_child(fragment_1);{var consequent_1=($$anchor)=>{var span_1=root_22();var node_3=$6.child(span_1);$6.snippet(node_3,()=>$$props.trailing);$6.reset(span_1);$6.template_effect(($0)=>{$6.set_class(span_1,1,$0);$6.set_attribute(span_1,"aria-hidden",trailingInteractive()?undefined:"true")},[()=>$6.clsx(classNames("cinder-input-group__trailing",!trailingInteractive()&&"cinder-_truncate"))]);$6.append($$anchor,span_1)};var consequent_2=($$anchor)=>{var span_2=root_32();var node_4=$6.child(span_2);calendarIcon(node_4);$6.reset(span_2);$6.append($$anchor,span_2)};$6.if(node_2,($$render)=>{if($$props.trailing)$$render(consequent_1);else if($6.get(rendersNativeDateIcon))$$render(consequent_2,1)})}$6.append($$anchor,fragment_1)};let value=$6.prop($$props,"value",15,""),labelVisible=$6.prop($$props,"labelVisible",3,true),type=$6.prop($$props,"type",3,"text"),variant=$6.prop($$props,"variant",3,"default"),leadingInteractive=$6.prop($$props,"leadingInteractive",3,false),trailingInteractive=$6.prop($$props,"trailingInteractive",3,false),rest=$6.rest_props($$props,rest_excludes3);const context=getFormFieldContext();$6.user_effect(()=>{if(context&&context.controlId!==$$props.id){devWarn(`[cinder/Input] id mismatch: Input id="${$$props.id}" but wrapping FormField expects controlId="${context.controlId}". Set the same id on both.`)}});const field=$6.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"input",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],required:$$props.required,disabled:$$props.disabled}));const describedBy=$6.derived(()=>$6.get(field).describedBy);const resolvedAriaInvalid=$6.derived(()=>$6.get(field).ariaInvalid);const resolvedRequired=$6.derived(()=>$6.get(field).required);const resolvedDisabled=$6.derived(()=>$6.get(field).disabled);const isNativeDateInput=$6.derived(()=>type()==="date");const rendersNativeDateIcon=$6.derived(()=>$6.get(isNativeDateInput)&&!$$props.trailing);const hasTrailing=$6.derived(()=>!!$$props.trailing||$6.get(isNativeDateInput));const hasGroupWrapper=$6.derived(()=>!!$$props.leading||$6.get(hasTrailing));const isInvalid=$6.derived(()=>$6.get(resolvedAriaInvalid)==="true");const groupModifiers=$6.derived(()=>classNames($$props.leading&&"cinder-input-group--leading",$6.get(hasTrailing)&&"cinder-input-group--trailing",$6.get(rendersNativeDateIcon)&&"cinder-input-group--native-date",$6.get(resolvedDisabled)&&"cinder-input-group--disabled",$6.get(isInvalid)&&"cinder-input-group--invalid"));const hostClass=$6.derived(()=>$6.get(hasGroupWrapper)?classNames("cinder-input-group",$$props.groupClassName,$6.get(groupModifiers)):"cinder-input-host");let inputNode=$6.state(undefined);let resetSyncTimeout;function syncValueAfterFormReset(){if(resetSyncTimeout!==undefined)clearTimeout(resetSyncTimeout);resetSyncTimeout=setTimeout(()=>{resetSyncTimeout=undefined;if($6.get(inputNode))value($6.get(inputNode).value)},0)}$6.user_effect(()=>{const form=$6.get(inputNode)?.form;if(!form)return;form.addEventListener("reset",syncValueAfterFormReset);return()=>{form.removeEventListener("reset",syncValueAfterFormReset);if(resetSyncTimeout!==undefined){clearTimeout(resetSyncTimeout);resetSyncTimeout=undefined}}});function handleInput(event){const target=event.currentTarget;const committed=commitValue(target.value,$$props.onValueChangeRequest,(next)=>{value(next)},$$props.onValueChange);target.value=committed;$$props.oninput?.(event)}var fragment_2=$6.comment();var node_5=$6.first_child(fragment_2);{var consequent_3=($$anchor)=>{{let $0=$6.derived(()=>context.labelId?undefined:$$props.label);let $1=$6.derived(()=>!!$$props.leading);Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $6.get($0)},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $6.get(resolvedRequired)},get disabled(){return $6.get(resolvedDisabled)},class:"cinder-input-field",get "data-cinder-variant"(){return variant()},fullWidth:true,descriptionClass:"cinder-input-field__description",errorClass:"cinder-input-field__error",get descriptionId(){return $6.get(field).ownDescriptionId},get errorId(){return $6.get(field).ownErrorId},get control(){return inputElement},get controlClass(){return $6.get(hostClass)},get controlLeading(){return $6.get($1)},get controlTrailing(){return $6.get(hasTrailing)},get controlNativeDate(){return $6.get(rendersNativeDateIcon)},get controlDisabled(){return $6.get(resolvedDisabled)},get controlInvalid(){return $6.get(isInvalid)},get before(){return leadingAdornment},get after(){return trailingAdornment}})}};var alternate=($$anchor)=>{{let $0=$6.derived(()=>$$props.required??false);let $1=$6.derived(()=>$$props.disabled??false);let $2=$6.derived(()=>!!$$props.leading);Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $6.get($0)},get disabled(){return $6.get($1)},class:"cinder-input-field",get "data-cinder-variant"(){return variant()},fullWidth:true,descriptionClass:"cinder-input-field__description",errorClass:"cinder-input-field__error",get control(){return inputElement},get controlClass(){return $6.get(hostClass)},get controlLeading(){return $6.get($2)},get controlTrailing(){return $6.get(hasTrailing)},get controlNativeDate(){return $6.get(rendersNativeDateIcon)},get controlDisabled(){return $6.get(resolvedDisabled)},get controlInvalid(){return $6.get(isInvalid)},get before(){return leadingAdornment},get after(){return trailingAdornment}})}};$6.if(node_5,($$render)=>{if(context)$$render(consequent_3);else $$render(alternate,-1)})}$6.append($$anchor,fragment_2);$6.pop()}import"svelte/internal/disclose-version";import*as $11 from"svelte/internal/client";import"@lostgradient/cinder/input/styles";var input_default=Input;import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $8 from"svelte/internal/client";import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $7 from"svelte/internal/client";var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var defaultAttributes_default=defaultAttributes;var root5=$7.from_svg(`<svg><!><!></svg>`);function Icon($$anchor,$$props){const $$sanitized_props=$7.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const $$restProps=$7.legacy_rest_props($$sanitized_props,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);$7.push($$props,false);let name2=$7.prop($$props,"name",8,undefined);let color=$7.prop($$props,"color",8,"currentColor");let size=$7.prop($$props,"size",8,24);let strokeWidth=$7.prop($$props,"strokeWidth",8,2);let absoluteStrokeWidth=$7.prop($$props,"absoluteStrokeWidth",8,false);let iconNode=$7.prop($$props,"iconNode",24,()=>[]);const mergeClasses=(...classes)=>classes.filter((className,index,array)=>{return Boolean(className)&&array.indexOf(className)===index}).join(" ");$7.init();var svg=root5();$7.attribute_effect(svg,($0,$1)=>({...defaultAttributes_default,...$$restProps,width:size(),height:size(),stroke:color(),"stroke-width":$0,class:$1}),[()=>($7.deep_read_state(absoluteStrokeWidth()),$7.deep_read_state(strokeWidth()),$7.deep_read_state(size()),$7.untrack(()=>absoluteStrokeWidth()?Number(strokeWidth())*24/Number(size()):strokeWidth())),()=>($7.deep_read_state(name2()),$7.deep_read_state($$sanitized_props),$7.untrack(()=>mergeClasses("lucide-icon","lucide",name2()?`lucide-${name2()}`:"",$$sanitized_props.class)))]);var node=$7.child(svg);$7.each(node,1,iconNode,$7.index,($$anchor,$$item)=>{var $$array=$7.derived(()=>$7.to_array($7.get($$item),2));let tag=()=>$7.get($$array)[0];let attrs=()=>$7.get($$array)[1];var fragment=$7.comment();var node_1=$7.first_child(fragment);$7.element(node_1,tag,true,($$element,$$anchor)=>{$7.attribute_effect($$element,()=>({...attrs()}))});$7.append($$anchor,fragment)});var node_2=$7.sibling(node);$7.slot(node_2,$$props,"default",{},null);$7.reset(svg);$7.append($$anchor,svg);$7.pop()}function Minus($$anchor,$$props){const $$sanitized_props=$8.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}]];Icon($$anchor,$8.spread_props({name:"minus"},()=>$$sanitized_props,{get iconNode(){return iconNode},children:($$anchor,$$slotProps)=>{var fragment_1=$8.comment();var node=$8.first_child(fragment_1);$8.slot(node,$$props,"default",{},null);$8.append($$anchor,fragment_1)},$$slots:{default:true}}))}import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $9 from"svelte/internal/client";function Plus($$anchor,$$props){const $$sanitized_props=$9.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Icon($$anchor,$9.spread_props({name:"plus"},()=>$$sanitized_props,{get iconNode(){return iconNode},children:($$anchor,$$slotProps)=>{var fragment_1=$9.comment();var node=$9.first_child(fragment_1);$9.slot(node,$$props,"default",{},null);$9.append($$anchor,fragment_1)},$$slots:{default:true}}))}import{untrack as untrack2}from"svelte";import{createContext as createContext2}from"svelte";var[getLocaleContextStrict,setLocaleContextRaw]=createContext2();function setLocaleContext(context){setLocaleContextRaw(context)}var getLocaleContext=optionalContext(getLocaleContextStrict);function formatNumber(value,locale="en-US",options){return new Intl.NumberFormat(locale,options).format(value)}function escapeRegex(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function normalizeLocalizedDigits(text,locale){let working=text;const digitFormatter=new Intl.NumberFormat(locale,{useGrouping:false,maximumFractionDigits:0});for(let d=0;d<=9;d++){const glyph=digitFormatter.format(d);if(glyph!==String(d)){working=working.split(glyph).join(String(d))}}return working}var formatAffixTypes=new Set(["currency","percentSign","literal","unit","compact"]);function stripFormatAffixes(text,locale,format){let working=text;let isNegativeByFormatAffix=false;if(format){const positiveAffixValues=new Set(new Intl.NumberFormat(locale,format).formatToParts(0).filter((part)=>formatAffixTypes.has(part.type)).map((part)=>part.value));const negativeParts=new Intl.NumberFormat(locale,format).formatToParts(-1);const negativeOnlyAffixes=negativeParts.filter((part)=>formatAffixTypes.has(part.type)&&part.value.trim()!==""&&!positiveAffixValues.has(part.value)).map((part)=>part.value);isNegativeByFormatAffix=negativeOnlyAffixes.length>0&&negativeOnlyAffixes.every((part)=>working.includes(part));const stripSamples=[0,-1];for(const sample of stripSamples){const parts=new Intl.NumberFormat(locale,format).formatToParts(sample);for(const part of parts){if(formatAffixTypes.has(part.type)){if(part.value)working=working.split(part.value).join("")}}}}if(isNegativeByFormatAffix&&!/^[+-]/.test(working)){working="-"+working}return working}function hasValidGrouping(integerPart,groupSep,locale){if(groupSep&&integerPart.includes(groupSep)){const probeParts=new Intl.NumberFormat(locale,{useGrouping:true}).formatToParts(12345678);const integerRuns=[];for(const p of probeParts){if(p.type==="integer")integerRuns.push(p.value)}const primary=integerRuns.length>0?(integerRuns[integerRuns.length-1]??"").length:3;const secondary=integerRuns.length>1?(integerRuns[integerRuns.length-2]??"").length:primary;const groupEsc=escapeRegex(groupSep);const grouped=new RegExp(`^[+-]?\\d{1,${secondary}}(${groupEsc}\\d{${secondary}})*${groupEsc}\\d{${primary}}$`);return grouped.test(integerPart)}return true}function parseNumericParts(working,locale,groupSep,decimalSep){if(working==="")return{value:null,status:"empty"};const decimalSplit=working.split(decimalSep);if(decimalSplit.length>2)return{value:null,status:"malformed"};const integerPart=decimalSplit[0]??"";const fractionPart=decimalSplit[1];if(!hasValidGrouping(integerPart,groupSep,locale)){return{value:null,status:"malformed"}}let normalized=groupSep.length>0?integerPart.split(groupSep).join(""):integerPart;if(fractionPart!==undefined)normalized+="."+fractionPart;if(!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(normalized)){return{value:null,status:"malformed"}}const parsed=parseFloat(normalized);if(!Number.isFinite(parsed))return{value:null,status:"malformed"};return{value:parsed,status:"valid"}}function parseLocaleNumber(text,locale,format){if(text.trim()==="")return{value:null,status:"empty"};let working=normalizeLocalizedDigits(text,locale);const sepParts=new Intl.NumberFormat(locale,{useGrouping:true,minimumFractionDigits:1,maximumFractionDigits:1}).formatToParts(-12345.6);const groupSep=sepParts.find((p)=>p.type==="group")?.value??"";const decimalSep=sepParts.find((p)=>p.type==="decimal")?.value??".";working=working.replace(/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,"");const localeMinus=sepParts.find((p)=>p.type==="minusSign")?.value??"-";if(localeMinus!=="-"){working=working.split(localeMinus).join("-")}working=stripFormatAffixes(working,locale,format);working=working.split("%").join("");working=working.replace(/^[\s ]+|[\s ]+$/g,"");return parseNumericParts(working,locale,groupSep,decimalSep)}import*as $10 from"svelte/internal/client";function toAriaInvalidValue(value){return value==="true"||value==="false"?value:undefined}function attachInputNode(getInputAttachment,setInput){return(node)=>{setInput(node);const cleanup=getInputAttachment()?.(node);return()=>{cleanup?.();setInput(undefined)}}}function applyCommit(next,parseStatus,emitChange,options){const malformed=!options.disabled&&parseStatus==="malformed";const requiredEmpty=!options.disabled&&!malformed&&options.required&&next===null;const message=malformed?"Please enter a valid number.":requiredEmpty?"Please enter a number.":"";options.input?.setCustomValidity(message);options.setMalformed(malformed);options.setRequiredEmpty(requiredEmpty);if(!Object.is(next,options.current)){options.markInternal();options.setValue(next)}if(emitChange)options.emit(next);return next}function synchronizeValidity(input,state){if(state.disabled){clearValidity(input,state);return}if(hasExternalValue(state)){clearValidity(input,state);return}if(state.malformed)return;if(needsRequiredValidity(state)){input.setCustomValidity("Please enter a number.");state.setRequiredEmpty(true);return}if(shouldSuppressRequiredValidity(state)){input.setCustomValidity("");state.setRequiredEmpty(false);return}if(hasValue(state)){input.setCustomValidity("");state.setRequiredEmpty(false)}}function clearValidity(input,state){input.setCustomValidity("");state.clearErrors()}function hasValue(state){return state.value!==null&&state.value!==undefined}function hasExternalValue(state){return hasValue(state)&&!state.internalChange}function needsRequiredValidity(state){return!state.focused&&state.required&&!hasValue(state)}function shouldSuppressRequiredValidity(state){return state.focused&&state.requiredEmpty}function isValidStep(value){return typeof value==="number"&&Number.isFinite(value)&&value>0}function roundToPrecision(value,digits){return Number(value.toFixed(Math.min(digits,12)))}function fractionalDigits(value){if(!Number.isFinite(value))return 0;const text=String(value);if(!text.includes("e")&&!text.includes("E"))return text.split(".")[1]?.length??0;const[mantissa,exponentText="0"]=text.toLowerCase().split("e");const exponent=Number(exponentText);const mantissaDigits=mantissa?.split(".")[1]?.length??0;return Math.max(0,mantissaDigits-exponent)}function normalizeCommitValue({source,raw,parseStatus="valid",min,max,snapStep}){if(raw===null||!Number.isFinite(raw)){return{value:null,parseStatus:raw===null?parseStatus:"malformed"}}let result=raw;if(source==="typed"&&snapStep!==null){const origin=Number.isFinite(min)?min:0;result=origin+Math.round((raw-origin)/snapStep)*snapStep;result=roundToPrecision(result,fractionalDigits(snapStep))}else if(source==="delta"&&snapStep!==null){const cleanRaw=roundToPrecision(raw,12);result=roundToPrecision(raw,Math.max(fractionalDigits(snapStep),fractionalDigits(cleanRaw)))}return{value:Math.min(max,Math.max(min,result)),parseStatus}}function createStepController(options){function getBase(direction){const parsed=options.getFocused()?parseLocaleNumber(options.getEditorBuffer(),options.getLocale(),options.getFormat()):null;if(parsed?.status==="valid"){return options.getFormat()?.style==="percent"?roundToPrecision(parsed.value/100,Math.max(2,fractionalDigits(parsed.value)+2)):parsed.value}const bound=direction==="increment"?options.getMin():options.getMax();return options.getValue()??(Number.isFinite(bound)?bound:0)}function stepBy(direction,multiplier=1){const delta=options.getStep()*multiplier*(direction==="increment"?1:-1);const next=options.commitNumber("delta",getBase(direction)+delta);if(options.getFocused()){options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}options.focus()}function onKeyDown(event){const actions={ArrowUp:()=>stepBy("increment"),ArrowDown:()=>stepBy("decrement"),PageUp:()=>stepBy("increment",10),PageDown:()=>stepBy("decrement",10)};const action=actions[event.key];if(action){event.preventDefault();action();return}if(event.key==="Home"&&Number.isFinite(options.getMin())){event.preventDefault();const next=options.commitNumber("delta",options.getMin());if(options.getFocused())options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}else if(event.key==="End"&&Number.isFinite(options.getMax())){event.preventDefault();const next=options.commitNumber("delta",options.getMax());if(options.getFocused())options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}}return{onKeyDown,stepBy}}function installFormListeners(input,options){const form=input.closest("form");if(!form)return()=>{};const onSubmit=()=>{if(options.isDisabled())return;if(options.hasEnterKeyFlush()){options.clearEnterKeyFlush();return}if(options.isFocused())options.flushSubmit()};const onReset=()=>{if(!options.isDisabled())options.reset()};form.addEventListener("submit",onSubmit,true);form.addEventListener("reset",onReset);return()=>{form.removeEventListener("submit",onSubmit,true);form.removeEventListener("reset",onReset)}}var rest_excludes4=new Set(["$$slots","$$events","$$legacy","id","value","min","max","step","format","locale","disabled","required","name","label","description","error","inputAttachment","class","adornment","onValueChange","onblur","aria-describedby"]);var root6=$11.from_html(`<button type="button" class="cinder-number-input__stepper cinder-number-input__stepper--increment" tabindex="-1"><!></button> <button type="button" class="cinder-number-input__stepper cinder-number-input__stepper--decrement" tabindex="-1"><!></button>`,1);var root_14=$11.from_html(`<span class="cinder-number-input__adornment"><!></span>`);var root_23=$11.from_html(`<!> <!>`,1);var root_33=$11.from_html(`<input type="hidden"/>`);var root_42=$11.from_html(`<p class="cinder-input-field__error" aria-live="polite"> </p>`);var root_52=$11.from_html(`<div data-cinder-full-width=""><!> <!> <!></div>`);function Number_input($$anchor,$$props){$11.push($$props,true);const steppers=($$anchor)=>{var fragment=root6();var button=$11.first_child(fragment);var node_1=$11.child(button);Plus(node_1,{class:"cinder-icon-sm","aria-hidden":"true"});$11.reset(button);var button_1=$11.sibling(button,2);var node_2=$11.child(button_1);Minus(node_2,{class:"cinder-icon-sm","aria-hidden":"true"});$11.reset(button_1);$11.template_effect(()=>{$11.set_attribute(button,"aria-label",`Increment${$11.get(stepperLabelSuffix)}`);button.disabled=$11.get(incrementDisabled);$11.set_attribute(button_1,"aria-label",`Decrement${$11.get(stepperLabelSuffix)}`);button_1.disabled=$11.get(decrementDisabled)});$11.delegated("click",button,()=>stepController.stepBy("increment"));$11.delegated("click",button_1,()=>stepController.stepBy("decrement"));$11.append($$anchor,fragment)};const trailingContent=($$anchor)=>{var fragment_1=root_23();var node_3=$11.first_child(fragment_1);{var consequent_1=($$anchor)=>{var span=root_14();var node_4=$11.child(span);{var consequent=($$anchor)=>{var text_1=$11.text();$11.template_effect(()=>$11.set_text(text_1,$$props.adornment));$11.append($$anchor,text_1)};var alternate=($$anchor)=>{var fragment_3=$11.comment();var node_5=$11.first_child(fragment_3);$11.snippet(node_5,()=>$$props.adornment);$11.append($$anchor,fragment_3)};$11.if(node_4,($$render)=>{if(typeof $$props.adornment==="string")$$render(consequent);else $$render(alternate,-1)})}$11.reset(span);$11.append($$anchor,span)};$11.if(node_3,($$render)=>{if($$props.adornment)$$render(consequent_1)})}var node_6=$11.sibling(node_3,2);steppers(node_6);$11.append($$anchor,fragment_1)};let value=$11.prop($$props,"value",15,null),rest=$11.rest_props($$props,rest_excludes4);const context=getFormFieldContext();const localeContext=getLocaleContext();let editorBuffer=$11.state("");let isFocused=$11.state(false);let hasMounted=$11.state(false);let inputElement=$11.state(undefined);$11.user_effect(()=>{$11.set(hasMounted,true)});let malformedError=$11.state(false);let requiredEmptyError=$11.state(false);const resetTarget=untrack2(()=>value());const resolvedLocale=$11.derived(()=>$$props.locale??localeContext?.locale??($11.get(hasMounted)?navigator.language:"en-US"));const resolvedMin=$11.derived(()=>typeof $$props.min==="number"&&Number.isFinite($$props.min)?$$props.min:-Infinity);const resolvedMax=$11.derived(()=>typeof $$props.max==="number"&&Number.isFinite($$props.max)?$$props.max:Infinity);const incrementStep=$11.derived(()=>isValidStep($$props.step)?$$props.step:1);const snapStep=$11.derived(()=>isValidStep($$props.step)?$$props.step:null);const resolvedRequired=$11.derived(()=>$$props.required??context?.required??false);const resolvedDisabled=$11.derived(()=>$$props.disabled??context?.disabled??false);const commit=(next,parseStatus,emitChange)=>applyCommit(next,parseStatus,emitChange,{disabled:$11.get(resolvedDisabled),required:$11.get(resolvedRequired),current:value(),input:$11.get(inputElement),setMalformed:(nextValue)=>{$11.set(malformedError,nextValue,true)},setRequiredEmpty:(nextValue)=>{$11.set(requiredEmptyError,nextValue,true)},markInternal:()=>{$11.set(isInternalValueChange,true)},setValue:(nextValue)=>{value(nextValue)},emit:(nextValue)=>$$props.onValueChange?.(nextValue)});function commitFromNumber(source,raw,parseStatus="valid"){const result=normalizeCommitValue({source,raw,parseStatus,min:$11.get(resolvedMin),max:$11.get(resolvedMax),snapStep:$11.get(snapStep)});return commit(result.value,result.parseStatus,true)}function commitFromText(source,text){const result=parseLocaleNumber(text,$11.get(resolvedLocale),$$props.format);if(result.status!=="valid"){return commit(null,result.status,true)}const canonical=$$props.format?.style==="percent"?roundToPrecision(result.value/100,Math.max(2,fractionalDigits(result.value)+2)):result.value;return commitFromNumber(source,canonical,"valid")}let isInternalValueChange=$11.state(false);let enterKeyFlushed=false;const displayValue=$11.derived(()=>$11.get(isFocused)?$11.get(editorBuffer):$11.get(malformedError)?$11.get(editorBuffer):value()===null||value()===undefined?"":formatNumber(value(),$11.get(resolvedLocale),$$props.format));const parentValueSignature=$11.derived(()=>`${value()??""}|${$11.get(resolvedLocale)}|${JSON.stringify($$props.format??null)}`);let lastSeenParentSignature=untrack2(()=>$11.get(parentValueSignature));$11.user_effect(()=>{const signature=$11.get(parentValueSignature);if(signature===lastSeenParentSignature)return;lastSeenParentSignature=signature;if($11.get(isInternalValueChange)){$11.set(isInternalValueChange,false);return}if(!$11.get(isFocused))return;$11.set(editorBuffer,value()===null||value()===undefined?"":buildEditDisplay(value()),true)});$11.user_effect(()=>{if(!$11.get(inputElement))return;synchronizeValidity($11.get(inputElement),{disabled:$11.get(resolvedDisabled),value:value(),internalChange:$11.get(isInternalValueChange),focused:$11.get(isFocused),required:$11.get(resolvedRequired),malformed:$11.get(malformedError),requiredEmpty:$11.get(requiredEmptyError),clearErrors:()=>{$11.set(malformedError,false);$11.set(requiredEmptyError,false)},setRequiredEmpty:(nextValue)=>{$11.set(requiredEmptyError,nextValue,true)}})});function buildEditDisplay(v){const editFormat={...$$props.format,style:"decimal",useGrouping:false,currency:undefined,currencyDisplay:undefined,notation:"standard",compactDisplay:undefined};if($$props.format?.style==="percent"){const asPercent=roundToPrecision(v*100,12);return formatNumber(asPercent,$11.get(resolvedLocale),editFormat)}return formatNumber(v,$11.get(resolvedLocale),editFormat)}function ariaValueNowFromText(text){const result=parseLocaleNumber(text,$11.get(resolvedLocale),$$props.format);if(result.status!=="valid")return;return Number.isFinite(result.value)?result.value:undefined}const resolvedAriaValueNow=$11.derived(()=>$11.get(isFocused)?ariaValueNowFromText($11.get(editorBuffer)):value()===null||value()===undefined?undefined:$$props.format?.style==="percent"?roundToPrecision(value()*100,12):value());const resolvedAriaValueMin=$11.derived(()=>Number.isFinite($11.get(resolvedMin))?$$props.format?.style==="percent"?roundToPrecision($11.get(resolvedMin)*100,12):$11.get(resolvedMin):undefined);const resolvedAriaValueMax=$11.derived(()=>Number.isFinite($11.get(resolvedMax))?$$props.format?.style==="percent"?roundToPrecision($11.get(resolvedMax)*100,12):$11.get(resolvedMax):undefined);function onFocus(){if(!$11.get(malformedError)){$11.set(editorBuffer,value()===null||value()===undefined?"":buildEditDisplay(value()),true)}$11.set(isFocused,true)}function onBlur(event){const buffered=$11.get(editorBuffer);$11.set(isFocused,false);commitFromText("typed",buffered);$$props.onblur?.(event)}function onInput(event){$11.set(editorBuffer,event.currentTarget.value,true);if($11.get(malformedError)){$11.set(malformedError,false);$11.get(inputElement)?.setCustomValidity("")}}const stepController=createStepController({getValue:()=>value(),getEditorBuffer:()=>$11.get(editorBuffer),setEditorBuffer:(next)=>{$11.set(editorBuffer,next,true)},getFocused:()=>$11.get(isFocused),getLocale:()=>$11.get(resolvedLocale),getFormat:()=>$$props.format,getMin:()=>$11.get(resolvedMin),getMax:()=>$11.get(resolvedMax),getStep:()=>$11.get(incrementStep),commitNumber:(source,raw)=>commitFromNumber(source,raw),buildEditDisplay,focus:()=>$11.get(inputElement)?.focus()});function onKeyDown(event){if($11.get(resolvedDisabled))return;if(event.key==="Enter"){event.preventDefault();commitFromText("typed",$11.get(isFocused)?$11.get(editorBuffer):"");const form=$11.get(inputElement)?.closest("form");if(!form)return;if(form.checkValidity()){enterKeyFlushed=true;form.requestSubmit()}else{form.reportValidity()}return}stepController.onKeyDown(event)}$11.user_effect(()=>{if(!$11.get(inputElement))return;return installFormListeners($11.get(inputElement),{isDisabled:()=>$11.get(resolvedDisabled),isFocused:()=>$11.get(isFocused),hasEnterKeyFlush:()=>enterKeyFlushed,clearEnterKeyFlush:()=>{enterKeyFlushed=false},flushSubmit:()=>commitFromText("typed",$11.get(editorBuffer)),reset:()=>commitFromNumber("reset",resetTarget,resetTarget===null?"empty":"valid")})});const internalErrorMessage=$11.derived(()=>!$$props.error&&$11.get(malformedError)?"Please enter a valid number.":!$$props.error&&$11.get(requiredEmptyError)?"Please enter a number.":null);const internalErrorId=$11.derived(()=>$11.get(internalErrorMessage)?`${$$props.id}-internal-error`:undefined);const internalInvalid=$11.derived(()=>$11.get(malformedError)||$11.get(requiredEmptyError)?"true":undefined);const resolvedAriaInvalid=$11.derived(()=>$11.get(internalInvalid)??toAriaInvalidValue(rest["aria-invalid"]));const incrementDisabled=$11.derived(()=>$11.get(resolvedDisabled)||value()!==null&&value()!==undefined&&value()>=$11.get(resolvedMax));const decrementDisabled=$11.derived(()=>$11.get(resolvedDisabled)||value()!==null&&value()!==undefined&&value()<=$11.get(resolvedMin));const showHiddenInput=$11.derived(()=>typeof $$props.name==="string"&&$$props.name.length>0&&!$11.get(resolvedDisabled));const stepperLabelSuffix=$11.derived(()=>$$props.label?` ${$$props.label} by ${$11.get(incrementStep)}`:` by ${$11.get(incrementStep)}`);const attachInput=attachInputNode(()=>$$props.inputAttachment,(node)=>{$11.set(inputElement,node,true)});var div=root_52();var node_7=$11.child(div);{let $0=$11.derived(()=>[$$props["aria-describedby"],$11.get(internalErrorId)].filter(Boolean).join(" ")||undefined);input_default(node_7,$11.spread_props({get id(){return $$props.id},get value(){return $11.get(displayValue)}},()=>$$props.label===undefined?{}:{label:$$props.label},()=>$$props.description===undefined?{}:{description:$$props.description},()=>$$props.error===undefined?{}:{error:$$props.error},{get disabled(){return $11.get(resolvedDisabled)},get required(){return $11.get(resolvedRequired)},class:"cinder-number-input__input",groupClassName:"cinder-number-input"},()=>rest,{type:"text",role:"spinbutton",inputmode:"decimal",get inputAttachment(){return attachInput},get trailing(){return trailingContent},trailingInteractive:true,get "aria-invalid"(){return $11.get(resolvedAriaInvalid)},get "aria-describedby"(){return $11.get($0)},get "aria-valuenow"(){return $11.get(resolvedAriaValueNow)},get "aria-valuemin"(){return $11.get(resolvedAriaValueMin)},get "aria-valuemax"(){return $11.get(resolvedAriaValueMax)},oninput:onInput,onfocus:onFocus,onblur:onBlur,onkeydown:onKeyDown}))}var node_8=$11.sibling(node_7,2);{var consequent_2=($$anchor)=>{var input=root_33();$11.remove_input_defaults(input);$11.template_effect(($0)=>{$11.set_attribute(input,"name",$$props.name);$11.set_value(input,$0)},[()=>value()===null||value()===undefined?"":String(value())]);$11.append($$anchor,input)};$11.if(node_8,($$render)=>{if($11.get(showHiddenInput))$$render(consequent_2)})}var node_9=$11.sibling(node_8,2);{var consequent_3=($$anchor)=>{var p=root_42();var text_2=$11.only_child(p,true);$11.template_effect(()=>{$11.set_attribute(p,"id",$11.get(internalErrorId));$11.set_text(text_2,$11.get(internalErrorMessage))});$11.append($$anchor,p)};$11.if(node_9,($$render)=>{if($11.get(internalErrorMessage))$$render(consequent_3)})}$11.reset(div);$11.template_effect(($0)=>$11.set_class(div,1,$0),[()=>$11.clsx(classNames("cinder-input-field",$$props.class))]);$11.append($$anchor,div);$11.pop()}$11.delegate(["click"]);import"svelte/internal/disclose-version";import*as $12 from"svelte/internal/client";var rest_excludes5=new Set(["$$slots","$$events","$$legacy","id","value","options","label","labelVisible","description","error","required","disabled","class","aria-describedby","aria-invalid"]);var root7=$12.from_html(`<select></select>`);var root_15=$12.from_html(`<option> </option>`);var root_24=$12.from_html(`<span class="cinder-select-field__control"><!> <span class="cinder-select-field__chevron" aria-hidden="true"></span></span>`);function Select($$anchor,$$props){$12.push($$props,true);const selectControl=($$anchor)=>{var span=root_24();var node=$12.child(span);{var consequent=($$anchor)=>{var select=root7();$12.attribute_effect(select,()=>({id:$$props.id,class:"cinder-_input-frame cinder-select",disabled:$12.get(field).disabled,required:$12.get(field).required,"data-cinder-empty":"true",...rest,"aria-describedby":$12.get(field).describedBy,"aria-invalid":$12.get(field).ariaInvalid}));$12.append($$anchor,select)};var alternate=($$anchor)=>{var select_1=root7();$12.attribute_effect(select_1,()=>({id:$$props.id,class:"cinder-_input-frame cinder-select",disabled:$12.get(field).disabled,required:$12.get(field).required,...rest,"aria-describedby":$12.get(field).describedBy,"aria-invalid":$12.get(field).ariaInvalid}));$12.each(select_1,21,()=>$$props.options,(option)=>option.value,($$anchor,option)=>{var option_1=root_15();var text=$12.only_child(option_1,true);var option_1_value={};$12.template_effect(()=>{option_1.disabled=$12.get(option).disabled;$12.set_text(text,$12.get(option).label);if(option_1_value!==(option_1_value=$12.get(option).value)){option_1.value=(option_1.__value=option_1_value)??""}});$12.append($$anchor,option_1)});$12.reset(select_1);$12.bind_select_value(select_1,value);$12.append($$anchor,select_1)};$12.if(node,($$render)=>{if($$props.options.length===0)$$render(consequent);else $$render(alternate,-1)})}$12.next(2);$12.reset(span);$12.append($$anchor,span)};let value=$12.prop($$props,"value",15),labelVisible=$12.prop($$props,"labelVisible",3,true),rest=$12.rest_props($$props,rest_excludes5);const context=getFormFieldContext();const field=$12.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"select",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],required:$$props.required,disabled:$$props.disabled}));const stableLocalErrorId=$12.derived(()=>context?.errorId===`${$12.get(field).id}-error`?`${$12.get(field).id}-select-error`:`${$12.get(field).id}-error`);$12.user_effect(()=>{if($$props.options.length===0){devWarn("[cinder/Select] options is empty — pass at least one option, or ignore during async load.")}else if(value()!==undefined&&!$$props.options.some((option)=>option.value===value())){devWarn("[cinder/Select] value does not match any option — pass a value from options or omit it.")}});{let $0=$12.derived(()=>classNames("cinder-select-field",$$props.class));let $1=$12.derived(()=>$12.get(field).ownErrorId??$12.get(stableLocalErrorId));Form_field_frame($$anchor,{get id(){return $12.get(field).id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $12.get(field).required},get disabled(){return $12.get(field).disabled},get class(){return $12.get($0)},labelClass:"cinder-select-field__label",descriptionClass:"cinder-select-field__description",errorClass:"cinder-select-field__error",get descriptionId(){return $12.get(field).ownDescriptionId},get errorId(){return $12.get($1)},get control(){return selectControl}})}$12.pop()}import"svelte/internal/disclose-version";import*as $13 from"svelte/internal/client";function resolveMaximumLength(value){if(typeof value==="number"){return Number.isSafeInteger(value)&&value>=0?value:undefined}if(typeof value==="string"){const trimmed=value.trim();if(!/^\d+$/.test(trimmed))return;const parsed=Number(trimmed);return parsed>=0&&Number.isSafeInteger(parsed)?parsed:undefined}return}var rest_excludes6=new Set(["$$slots","$$events","$$legacy","id","value","label","description","error","rows","disabled","required","class","variant","maxlength","countVisible","aria-describedby","aria-invalid"]);var root8=$13.from_html(`<textarea></textarea>`);var root_16=$13.from_html(`<output class="cinder-textarea-count" aria-live="polite" aria-atomic="true"> </output>`);function Textarea($$anchor,$$props){$13.push($$props,true);const textareaControl=($$anchor)=>{var textarea=root8();$13.remove_textarea_child(textarea);$13.attribute_effect(textarea,($0)=>({id:$$props.id,rows:rows(),disabled:$13.get(field).disabled,required:$13.get(field).required,maxlength:$$props.maxlength,class:$0,"data-cinder-variant":variant(),"aria-invalid":$13.get(field).ariaInvalid,"aria-describedby":$13.get(field).describedBy,...rest}),[()=>classNames("cinder-_input-frame","cinder-textarea",$$props.class)]);$13.bind_value(textarea,value);$13.append($$anchor,textarea)};const counter=($$anchor)=>{var fragment=$13.comment();var node=$13.first_child(fragment);{var consequent=($$anchor)=>{var output=root_16();var text=$13.only_child(output);$13.template_effect(()=>{$13.set_attribute(output,"id",$13.get(countId));$13.set_attribute(output,"for",$$props.id);$13.set_text(text,`${$13.get(currentCount)??""}/${$13.get(maximumLength)??""}`)});$13.append($$anchor,output)};$13.if(node,($$render)=>{if($13.get(countId))$$render(consequent)})}$13.append($$anchor,fragment)};let value=$13.prop($$props,"value",15,""),rows=$13.prop($$props,"rows",3,4),variant=$13.prop($$props,"variant",3,"default"),countVisible=$13.prop($$props,"countVisible",3,false),rest=$13.rest_props($$props,rest_excludes6);const context=getFormFieldContext();const maximumLength=$13.derived(()=>resolveMaximumLength($$props.maxlength));const countId=$13.derived(()=>countVisible()&&$13.get(maximumLength)!==undefined?`${$$props.id}-count`:undefined);const currentCount=$13.derived(()=>value()?.length??0);const ownRequired=$13.derived(()=>$$props.required??undefined);const field=$13.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"textarea",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],additionalDescribedBy:[$13.get(countId)],required:$13.get(ownRequired),disabled:$$props.disabled}));var fragment_1=$13.comment();var node_1=$13.first_child(fragment_1);{var consequent_2=($$anchor)=>{var fragment_2=$13.comment();var node_2=$13.first_child(fragment_2);{var consequent_1=($$anchor)=>{{let $0=$13.derived(()=>context.labelId?undefined:$$props.label);Form_field_frame($$anchor,{get id(){return $13.get(field).id},get label(){return $13.get($0)},get description(){return $$props.description},get error(){return $$props.error},get required(){return $13.get(field).required},get disabled(){return $13.get(field).disabled},class:"cinder-textarea-field",get "data-cinder-variant"(){return variant()},labelClass:"cinder-textarea-label",descriptionClass:"cinder-textarea-description",errorClass:"cinder-textarea-error",get descriptionId(){return $13.get(field).ownDescriptionId},get errorId(){return $13.get(field).ownErrorId},get control(){return textareaControl},get message(){return counter}})}};var alternate=($$anchor)=>{textareaControl($$anchor)};$13.if(node_2,($$render)=>{if($$props.label||$$props.description||$$props.error||$13.get(countId))$$render(consequent_1);else $$render(alternate,-1)})}$13.append($$anchor,fragment_2)};var alternate_1=($$anchor)=>{Form_field_frame($$anchor,{get id(){return $13.get(field).id},get label(){return $$props.label},get description(){return $$props.description},get error(){return $$props.error},get required(){return $13.get(field).required},get disabled(){return $13.get(field).disabled},class:"cinder-textarea-field",get "data-cinder-variant"(){return variant()},labelClass:"cinder-textarea-label",descriptionClass:"cinder-textarea-description",errorClass:"cinder-textarea-error",get control(){return textareaControl},get message(){return counter}})};$13.if(node_1,($$render)=>{if(context)$$render(consequent_2);else $$render(alternate_1,-1)})}$13.append($$anchor,fragment_1);$13.pop()}function isRecord(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)}function createSchemaFormModel(schema){return{field:fieldFromJsonSchema(schema,[],"value",true),sourceSchema:schema}}function fieldFromJsonSchema(schema,path,key,required){if(!isRecord(schema)){return baseField("json",{},path,key,required)}const normalizedSchema=schema;const options=enumOptions(normalizedSchema);if(options.length>0){return{...baseField("enum",normalizedSchema,path,key,required),options}}const schemaType=schemaTypeOf(normalizedSchema);const schemaProperties=normalizedSchema["properties"];if(schemaType==="object"||isRecord(schemaProperties)){const requiredProperties=requiredPropertyNames(normalizedSchema);const properties=isRecord(schemaProperties)?schemaProperties:{};const fields=Object.entries(properties).map(([propertyKey,propertySchema])=>fieldFromJsonSchema(propertySchema,[...path,propertyKey],propertyKey,requiredProperties.has(propertyKey)));return{...baseField("object",normalizedSchema,path,key,required),fields}}if(schemaType==="array"){const schemaItems=normalizedSchema["items"];const itemSchema=isRecord(schemaItems)?schemaItems:{};const item=fieldFromJsonSchema(itemSchema,[...path,"0"],"item",true);return{...baseField("array",normalizedSchema,path,key,required),item}}const fieldKind=fieldKindForSchemaType(schemaType);if(fieldKind){return baseField(fieldKind,normalizedSchema,path,key,required)}return baseField("json",normalizedSchema,path,key,required)}function fieldKindForSchemaType(type){switch(type){case"string":case"number":case"integer":case"boolean":case"array":case"object":return type;default:return}}function baseField(kind,schema,path,key,required){const description=schema["description"];return{kind,key,path,label:fieldLabel(schema,key),required,...typeof description==="string"&&description.length>0?{description}:{},schema,fields:[],options:[]}}function schemaTypeOf(schema){const{type}=schema;if(typeof type==="string")return type;if(Array.isArray(type)){const supported=type.find((candidate)=>typeof candidate==="string"&&candidate!=="null");return typeof supported==="string"?supported:undefined}return}function requiredPropertyNames(schema){const required=schema["required"];if(!Array.isArray(required))return new Set;return new Set(required.filter((property)=>typeof property==="string"))}function enumOptions(schema){const values=schema["enum"];if(!Array.isArray(values)||values.length===0)return[];if(!values.every((value)=>isJsonPrimitive(value)))return[];return values.map((value)=>({label:String(value),value,encodedValue:encodeEnumValue(value)}))}function isJsonPrimitive(value){return value===null||["string","number","boolean"].includes(typeof value)}function encodeEnumValue(value){return JSON.stringify(value)}function decodeEnumValue(value){const parsed=JSON.parse(value);if(!isJsonPrimitive(parsed)){throw new Error("SchemaForm enum values must be JSON primitives.")}return parsed}function fieldLabel(schema,key){const title=schema["title"];if(typeof title==="string"&&title.trim().length>0){return title}if(key==="value")return"Value";return key.replaceAll(/[-_]+/g," ").replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/^\w/,(letter)=>letter.toUpperCase())}function defaultValueForField(field){if("default"in field.schema)return cloneJsonCompatible(field.schema["default"]);if(field.kind==="object"){const value={};for(const child of field.fields){value[child.key]=defaultValueForField(child)}return value}if(field.kind==="array")return[];if(field.kind==="boolean")return false;if(field.kind==="enum")return field.options[0]?.value??"";if(field.kind==="string")return"";if(field.kind==="json")return null;return}function initialValueForField(field,value){if(value===undefined)return defaultValueForField(field);const clonedValue=cloneJsonCompatible(value);if(clonedValue===undefined)return defaultValueForField(field);return mergeInitialValueWithFieldDefaults(field,clonedValue)}function mergeInitialValueWithFieldDefaults(field,value){if(field.kind==="object"&&isRecord(value)){const defaultValue=defaultValueForField(field);const defaultRecord=isRecord(defaultValue)?defaultValue:{};const result={...defaultRecord};const fieldKeys=new Set(field.fields.map((child)=>child.key));for(const child of field.fields){const seededValue=Object.hasOwn(value,child.key)?value[child.key]:defaultRecord[child.key];result[child.key]=seededValue===undefined?defaultValueForField(child):mergeInitialValueWithFieldDefaults(child,seededValue)}for(const[key,extraValue]of Object.entries(value)){if(!fieldKeys.has(key))result[key]=extraValue}return result}if(field.kind==="array"&&Array.isArray(value)&&field.item){return value.map((item)=>mergeInitialValueWithFieldDefaults(field.item,item))}return value}function cloneJsonCompatible(value){if(value===undefined)return;try{const serializedValue=JSON.stringify(value,cloneJsonCompatibleReplacer);if(serializedValue===undefined)return;const clonedValue=JSON.parse(serializedValue);return clonedValue}catch{return}}function cloneJsonCompatibleReplacer(_key,value){if(typeof value==="number"&&!Number.isFinite(value)){throw new TypeError("SchemaForm values must contain finite numbers.")}if(typeof value==="bigint"){throw new TypeError("SchemaForm values must not contain bigint values.")}return value}function pathKey(path){return path.map((segment)=>segment.replaceAll("~","~0").replaceAll("/","~1")).join("/")}function pathId(path){return path.length===0?"value":path.map(domIdSegment).join("__")}function domIdSegment(segment){let encoded="";for(const character of segment){if(/^[a-zA-Z0-9]$/.test(character)){encoded+=character}else{encoded+=`_${character.codePointAt(0)?.toString(16)??"0"}_`}}return`${segment.length}_${encoded}`}function getValueAtPath(value,path){let current=value;for(const segment of path){if(Array.isArray(current)){const index=Number(segment);current=Number.isInteger(index)?current[index]:undefined}else if(isRecord(current)){current=current[segment]}else{return}}return current}function setValueAtPath(value,path,next){if(path.length===0)return next;const[head,...tail]=path;if(head===undefined)return next;if(Array.isArray(value)){const copy=[...value];const index=Number(head);if(!Number.isInteger(index)||index<0)return copy;copy[index]=setValueAtPath(copy[index],tail,next);return copy}const copy=isRecord(value)?{...value}:{};copy[head]=setValueAtPath(copy[head],tail,next);return copy}function pruneUndefined(value){if(Array.isArray(value))return value.map((item)=>pruneUndefined(item));if(!isRecord(value))return value;const output={};for(const[key,child]of Object.entries(value)){if(child!==undefined)output[key]=pruneUndefined(child)}return output}function arrayValueAtPath(value,path){const array=getValueAtPath(value,path);return Array.isArray(array)?array:[]}function rebaseFieldPath(field,path){const originalPath=field.path;function rebase(candidate){const suffix=candidate.path.slice(originalPath.length);return{...candidate,path:[...path,...suffix],fields:candidate.fields.map(rebase),...candidate.item?{item:rebase(candidate.item)}:{}}}return rebase(field)}import*as $15 from"svelte/internal/client";var loadLibrary=createRetryingLoaderCache(()=>Promise.resolve().then(() => (init_dist2(),exports_dist)));var HOSTNAME_PATTERN=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;var IPV4_PATTERN=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;var IPV6_PATTERN=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;var NOT_URI_FRAGMENT=/\/|:/;var URI_PATTERN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var URI_REFERENCE_PATTERN=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var URI_TEMPLATE_PATTERN=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;var JSON_POINTER_URI_FRAGMENT_PATTERN=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var BYTE_PATTERN=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;var ISO_TIME_PATTERN=/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i;var ISO_DATE_TIME_PATTERN=/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i;var MIN_INT32=-(2**31);var MAX_INT32=2**31-1;function stringFormat(pattern,code,label){return({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(pattern.test(data))return;return node.createError(code,{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid ${label}`)}}var uriFormat=({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(NOT_URI_FRAGMENT.test(data)&&URI_PATTERN.test(data))return;return node.createError("format-uri-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid uri`)};var byteFormat=({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(BYTE_PATTERN.test(data))return;return node.createError("format-byte-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid byte (base64)`)};var int32Format=({node,pointer,data})=>{if(typeof data!=="number")return;if(Number.isInteger(data)&&data>=MIN_INT32&&data<=MAX_INT32)return;return node.createError("format-int32-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid int32`)};var int64Format=({node,pointer,data})=>{if(typeof data!=="number")return;if(Number.isInteger(data))return;return node.createError("format-int64-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid int64`)};var alwaysValidFormat=()=>{return};function buildCustomFormats(){return{hostname:stringFormat(HOSTNAME_PATTERN,"format-hostname-error","hostname"),ipv4:stringFormat(IPV4_PATTERN,"format-ipv4-error","ipv4 address"),ipv6:stringFormat(IPV6_PATTERN,"format-ipv6-error","ipv6 address"),uri:uriFormat,"uri-reference":stringFormat(URI_REFERENCE_PATTERN,"format-uri-reference-error","uri-reference"),"uri-template":stringFormat(URI_TEMPLATE_PATTERN,"format-uri-template-error","uri-template"),"json-pointer-uri-fragment":stringFormat(JSON_POINTER_URI_FRAGMENT_PATTERN,"format-json-pointer-error","json-pointer-uri-fragment"),"iso-time":stringFormat(ISO_TIME_PATTERN,"format-date-time-error","iso-time"),"iso-date-time":stringFormat(ISO_DATE_TIME_PATTERN,"format-date-time-error","iso-date-time"),byte:byteFormat,int32:int32Format,int64:int64Format,float:alwaysValidFormat,double:alwaysValidFormat,password:alwaysValidFormat,binary:alwaysValidFormat}}var cachedDrafts=null;function draftsFor(lib){if(cachedDrafts)return cachedDrafts;const formats=buildCustomFormats();cachedDrafts={"draft-07":lib.extendDraft(lib.draft07,{formats}),"2019-09":lib.extendDraft(lib.draft2019,{formats}),"2020-12":lib.extendDraft(lib.draft2020,{formats})};return cachedDrafts}function toInterpreterError(error){const rawPointer=error.data?.["pointer"];const pointer=typeof rawPointer==="string"?rawPointer:"#";const code=typeof error.code==="string"?error.code:String(error.code);return{code,message:error.message,pointer,data:error.data??{}}}function isRefResolutionSchemaError(error){return error.code==="schema-error"&&error.pointer.endsWith("/$ref")}function isSchemaNode(value){return value!==null&&typeof value==="object"&&"schema"in value}function hasOwnRef(node){const schema=node.schema;return typeof schema==="object"&&schema!==null&&(schema["$ref"]!=null||schema["$dynamicRef"]!=null||schema["$recursiveRef"]!=null)}function childNodes(node){const children=[];const single=[node.additionalProperties,node.items,node.contains,node.not,node.if,node.then,node.else,node.propertyNames,node.unevaluatedItems,node.unevaluatedProperties];for(const child of single)if(child)children.push(child);const arrays=[node.allOf,node.anyOf,node.oneOf,node.prefixItems];for(const array of arrays)if(array)children.push(...array);const records=[node.properties,node.$defs];for(const record of records)if(record)children.push(...Object.values(record));if(node.dependentSchemas){for(const child of Object.values(node.dependentSchemas)){if(isSchemaNode(child))children.push(child)}}if(node.propertyDependencies){for(const inner of Object.values(node.propertyDependencies)){children.push(...Object.values(inner))}}return children}function collectRefErrors(root){const seen=new Set;const errors=[];function visit(node){if(seen.has(node))return;seen.add(node);if(hasOwnRef(node)){const result=node.validate(undefined);for(const error of result.errors){if(error.code==="ref-error")errors.push(toInterpreterError(error))}}for(const child of childNodes(node))visit(child)}visit(root);return errors}async function compileInterpreted(schema,draft,options={}){const lib=await loadLibrary();const draftObject=draftsFor(lib)[draft];const node=lib.compileSchema(schema,{drafts:[draftObject],formatAssertion:options.formats??true});const schemaErrors=(node.schemaErrors??[]).map(toInterpreterError);const refErrors=collectRefErrors(node);return{schemaErrors,refErrors,validate:(data)=>{const result=node.validate(data);return{valid:result.valid,errors:result.errors.map(toInterpreterError)}}}}function dedupeInterpreterErrors(errors){const seen=new Set;const result=[];for(const error of errors){const key=`${error.code}\x00${error.pointer}`;if(seen.has(key))continue;seen.add(key);result.push(error)}return result}function stripPointerHash(pointer){return pointer==="#"?"":pointer.slice(1)}var validatorCache=new WeakMap;async function validateSchemaValue(schema,value){if(!isRecord(schema)){return validationFailure(value,"SchemaForm only accepts JSON Schema objects.")}if(isLegacyStandardSchema(schema)){return validationFailure(value,"SchemaForm only accepts JSON Schema objects.")}return validateJsonSchemaValue(schema,value)}async function validateJsonSchemaValue(schema,value){let compiled;try{compiled=await validatorForSchema(schema)}catch(error){return validationFailure(value,readableSchemaError(error))}const compileErrors=dedupeInterpreterErrors([...compiled.schemaErrors,...compiled.refErrors]);if(compileErrors.length>0){return validationFailure(value,readableSchemaError(new Error(compileErrors[0]?.message)))}const result=compiled.validate(value);if(result.valid)return{valid:true,value,issues:[]};return{valid:false,value,issues:interpreterIssues(result.errors)}}function validationFailure(value,message){return{valid:false,value,issues:[{path:[],message}]}}function isLegacyStandardSchema(schema){const standard=schema["~standard"];return isRecord(standard)&&standard["version"]===1}function readableSchemaError(error){const message=error instanceof Error?error.message:typeof error==="string"?error:"";if(message.startsWith("Invalid JSON Schema"))return message;return message===""?"Invalid JSON Schema.":`Invalid JSON Schema: ${message}`}function validatorForSchema(schema){const cached=validatorCache.get(schema);if(cached)return cached;const promise=createValidator(schema).then((compiled)=>{if(compiled.schemaErrors.length>0||compiled.refErrors.length>0){validatorCache.delete(schema)}return compiled}).catch((error)=>{validatorCache.delete(schema);throw error});validatorCache.set(schema,promise);return promise}function createValidator(schema){return compileInterpreted(schema,jsonSchemaDraft(schema),{formats:false})}function jsonSchemaDraft(schema){const id=schema["$schema"];if(typeof id!=="string")return"2020-12";if(id.includes("draft-07"))return"draft-07";if(id.includes("2019-09"))return"2019-09";return"2020-12"}function interpreterIssues(errors){return errors.map((error)=>({path:interpreterErrorPath(error),message:readableInterpreterMessage(error)}))}function readableInterpreterMessage(error){const fieldName=interpreterErrorPath(error).at(-1)??"Value";const label=humanizeFieldName(fieldName);if(error.code==="required-property-error")return`${label} is required.`;if(error.code==="min-length-error")return`${label} is too short.`;if(error.code==="max-length-error")return`${label} is too long.`;if(error.code==="minimum-error"){return`${label} must be at least ${String(error.data["minimum"])}.`}if(error.code==="maximum-error"){return`${label} must be at most ${String(error.data["maximum"])}.`}if(error.code==="type-error")return`${label} must be ${String(error.data["expected"])}.`;return error.message||"Invalid value"}function humanizeFieldName(name2){return name2.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,(character)=>character.toUpperCase())}function interpreterErrorPath(error){const parentPath=jsonPointerToPath(stripPointerHash(error.pointer));if(error.code!=="required-property-error")return parentPath;const missingProperty=error.data["key"];return typeof missingProperty==="string"?[...parentPath,missingProperty]:parentPath}function jsonPointerToPath(pointer){if(pointer==="")return[];return pointer.slice(1).split("/").map((segment)=>segment.replaceAll("~1","/").replaceAll("~0","~"))}function issuesByPath(issues){const grouped={};for(const issue of issues){const key=pathKey(issue.path);grouped[key]??=issue.message}return grouped}function parseJsonDraft(path,text){try{return{ok:true,value:JSON.parse(text)}}catch(error){return{ok:false,issue:{path,message:error instanceof Error?error.message:"Invalid JSON"}}}}function serializeValidatedValue(value){try{const serialized=JSON.stringify(value,schemaFormJsonReplacer);if(serialized===undefined){throw new TypeError("Validated value is not JSON serializable.")}return{ok:true,value:serialized}}catch(error){return{ok:false,issue:{path:[],message:error instanceof Error?error.message:"Validated value is not JSON serializable"}}}}function schemaFormJsonReplacer(_key,value){if(typeof value==="number"&&!Number.isFinite(value)){throw new TypeError("Validated value contains a non-finite number.")}if(typeof value==="bigint"){throw new TypeError("Validated value contains a bigint, which is not JSON serializable.")}return value}function readSchemaFormData(formData,name2="value"){const raw=formData.get(name2);if(typeof raw!=="string")return;try{return JSON.parse(raw)}catch{return}}class SchemaFormState{#formValue=$15.state();get formValue(){return $15.get(this.#formValue)}set formValue(value){$15.set(this.#formValue,value,true)}#serializedValue=$15.state("");get serializedValue(){return $15.get(this.#serializedValue)}set serializedValue(value){$15.set(this.#serializedValue,value,true)}#errors=$15.state($15.proxy({}));#rawDrafts=$15.state($15.proxy({}));#parsedRawDrafts=$15.state($15.proxy({}));#numericDrafts=$15.state($15.proxy({}));#touchedValidationSequences=$15.state($15.proxy({}));#arrayKeys=$15.state($15.proxy({}));#arrayKeyCounter=0;#model;#options;constructor(model,initialValue,options){this.#model=model;this.#options=options;this.formValue=initialValue;$15.set(this.#rawDrafts,this.#seedRawDrafts(model.field,initialValue),true);$15.set(this.#arrayKeys,this.#seedArrayKeys(model.field,initialValue),true)}get errors(){return $15.get(this.#errors)}get rawDrafts(){return $15.get(this.#rawDrafts)}clearSerializedValue(){this.serializedValue=""}#bumpTouchedValidationSequence(path){const key=pathKey(path);$15.set(this.#touchedValidationSequences,{...$15.get(this.#touchedValidationSequences),[key]:($15.get(this.#touchedValidationSequences)[key]??0)+1},true)}#currentDraft(){let nextValue=this.formValue;for(const field of this.#currentNumericFields(this.#model.field,this.formValue)){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(draft!==undefined)nextValue=setValueAtPath(nextValue,field.path,draft)}for(const field of this.#currentJsonFields(this.#model.field,this.formValue)){const key=pathKey(field.path);const parsed=$15.get(this.#parsedRawDrafts)[key];if(parsed===undefined)continue;nextValue=setValueAtPath(nextValue,field.path,parsed.ok?parsed.value:$15.get(this.#rawDrafts)[key])}return pruneUndefined(nextValue)}#reportDraftChange(){this.#options.onDraftChange?.(this.#currentDraft())}updateValue(path,next,reportChange=true){if(this.#options.getSubmitting())return;this.formValue=setValueAtPath(this.formValue,path,next);const key=pathKey(path);if($15.get(this.#numericDrafts)[key]!==undefined){const{[key]:_removedDraft,...remainingDrafts}=$15.get(this.#numericDrafts);$15.set(this.#numericDrafts,remainingDrafts,true)}this.#bumpTouchedValidationSequence(path);if($15.get(this.#errors)[key]){const{[key]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}this.clearSerializedValue();if(reportChange)this.#reportDraftChange()}updateNumberValue(field,next){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(next===null&&draft!==undefined&&draft.trim()!=="")return;this.updateValue(field.path,next??undefined)}async validateTouchedField(field){if(this.#options.getSubmitting())return;const fieldKey=pathKey(field.path);const sequence=($15.get(this.#touchedValidationSequences)[fieldKey]??0)+1;$15.set(this.#touchedValidationSequences,{...$15.get(this.#touchedValidationSequences),[fieldKey]:sequence},true);const raw=this.#rawJsonIssues();const rawIssue=raw.issues.find((candidateIssue)=>{const candidateKey=pathKey(candidateIssue.path);return candidateKey===fieldKey||candidateKey.startsWith(`${fieldKey}/`)});if(rawIssue){$15.set(this.#errors,{...$15.get(this.#errors),[fieldKey]:rawIssue.message},true);return}const candidate=pruneUndefined(raw.value);const result=await validateSchemaValue(this.#model.sourceSchema,candidate);if($15.get(this.#touchedValidationSequences)[fieldKey]!==sequence)return;const issue=(result.valid?[]:result.issues).find((candidateIssue)=>{const candidateKey=pathKey(candidateIssue.path);return candidateKey===fieldKey||candidateKey.startsWith(`${fieldKey}/`)});if(issue){$15.set(this.#errors,{...$15.get(this.#errors),[fieldKey]:issue.message},true);return}if($15.get(this.#errors)[fieldKey]){const{[fieldKey]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}}updateEnum(field,event){if(this.#options.getSubmitting())return;const select=event.currentTarget;if(!(select instanceof HTMLSelectElement))return;this.updateValue(field.path,decodeEnumValue(select.value))}updateRawJsonValue(field,next){if(this.#options.getSubmitting())return;const key=pathKey(field.path);$15.set(this.#rawDrafts,{...$15.get(this.#rawDrafts),[key]:next},true);const parsed=parseJsonDraft(field.path,next);$15.set(this.#parsedRawDrafts,{...$15.get(this.#parsedRawDrafts),[key]:parsed.ok?parsed:{ok:false,message:parsed.issue.message}},true);this.#bumpTouchedValidationSequence(field.path);if($15.get(this.#errors)[key]){const{[key]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}this.clearSerializedValue();this.#reportDraftChange()}handleFieldInput(field,event){if(this.#options.getSubmitting())return;this.#bumpTouchedValidationSequence(field.path);if(field.kind!=="number"&&field.kind!=="integer")return;if(!(event.target instanceof HTMLInputElement))return;$15.set(this.#numericDrafts,{...$15.get(this.#numericDrafts),[pathKey(field.path)]:event.target.value},true);this.clearSerializedValue();this.#reportDraftChange()}arrayRows(field){const values=arrayValueAtPath(this.formValue,field.path);const keys=$15.get(this.#arrayKeys)[pathKey(field.path)]??[];return values.map((_,index)=>({key:keys[index]??`${pathKey(field.path)}-${index}`,index}))}addArrayItem(field){if(this.#options.getSubmitting())return;const values=arrayValueAtPath(this.formValue,field.path);const nextValue=field.item?defaultValueForField(field.item):null;this.updateValue(field.path,[...values,nextValue]);const key=pathKey(field.path);$15.set(this.#arrayKeys,{...$15.get(this.#arrayKeys),[key]:[...$15.get(this.#arrayKeys)[key]??[],`${key}-${this.#arrayKeyCounter++}`]},true)}removeArrayItem(field,index){if(this.#options.getSubmitting())return;const values=arrayValueAtPath(this.formValue,field.path);this.updateValue(field.path,values.filter((_,candidateIndex)=>candidateIndex!==index),false);$15.set(this.#rawDrafts,this.#reindexArrayPathState($15.get(this.#rawDrafts),field.path,index),true);$15.set(this.#parsedRawDrafts,this.#reindexArrayPathState($15.get(this.#parsedRawDrafts),field.path,index),true);$15.set(this.#numericDrafts,this.#reindexArrayPathState($15.get(this.#numericDrafts),field.path,index),true);$15.set(this.#errors,this.#reindexArrayPathState($15.get(this.#errors),field.path,index),true);$15.set(this.#touchedValidationSequences,this.#bumpPathValidationSequences(this.#reindexArrayPathState($15.get(this.#touchedValidationSequences),field.path,index),field.path),true);const key=pathKey(field.path);$15.set(this.#arrayKeys,{...$15.get(this.#arrayKeys),[key]:($15.get(this.#arrayKeys)[key]??[]).filter((_,candidateIndex)=>candidateIndex!==index)},true);this.#reportDraftChange()}#reindexArrayPathState(state,arrayPath,removedIndex){const prefix=pathKey(arrayPath);const pathPrefix=prefix===""?"":`${prefix}/`;const next={};for(const[key,stateValue]of Object.entries(state)){if(!key.startsWith(pathPrefix)){next[key]=stateValue;continue}const relativeKey=key.slice(pathPrefix.length);if(relativeKey===""){next[key]=stateValue;continue}const[indexSegment="",...remainingSegments]=relativeKey.split("/");const index=Number(indexSegment);if(!Number.isInteger(index)||index<0){next[key]=stateValue;continue}if(index<removedIndex){next[key]=stateValue;continue}if(index===removedIndex)continue;const shiftedKey=[String(index-1),...remainingSegments].join("/");next[`${pathPrefix}${shiftedKey}`]=stateValue}return next}#bumpPathValidationSequences(state,path){const prefix=pathKey(path);const pathPrefix=prefix===""?"":`${prefix}/`;const next={};for(const[key,sequence]of Object.entries(state)){next[key]=key===prefix||key.startsWith(pathPrefix)?sequence+1:sequence}return next}#seedRawDrafts(field,currentValue){const drafts={};for(const jsonField of this.#currentJsonFields(field,currentValue)){drafts[pathKey(jsonField.path)]=JSON.stringify(getValueAtPath(currentValue,jsonField.path)??null,null,2)}return drafts}#currentJsonFields(field,currentValue){const fields=[];const visit=(candidate)=>{if(candidate.kind==="json")fields.push(candidate);for(const child of candidate.fields)visit(child);if(candidate.kind==="array"&&candidate.item){for(const[index]of arrayValueAtPath(currentValue,candidate.path).entries()){visit(rebaseFieldPath(candidate.item,[...candidate.path,String(index)]))}}};visit(field);return fields}#currentNumericFields(field,currentValue){const fields=[];const visit=(candidate)=>{if(candidate.kind==="number"||candidate.kind==="integer")fields.push(candidate);for(const child of candidate.fields)visit(child);if(candidate.kind==="array"&&candidate.item){for(const[index]of arrayValueAtPath(currentValue,candidate.path).entries()){visit(rebaseFieldPath(candidate.item,[...candidate.path,String(index)]))}}};visit(field);return fields}#seedArrayKeys(field,currentValue){const keys={};const visit=(candidate)=>{if(candidate.kind==="array"){const key=pathKey(candidate.path);keys[key]=arrayValueAtPath(currentValue,candidate.path).map(()=>`${key}-${this.#arrayKeyCounter++}`)}for(const child of candidate.fields)visit(child);if(candidate.item)visit(candidate.item)};visit(field);return keys}#rawJsonIssues(){let nextValue=this.formValue;const issues=[];for(const field of this.#currentJsonFields(this.#model.field,this.formValue)){const parsed=$15.get(this.#parsedRawDrafts)[pathKey(field.path)];if(parsed===undefined)continue;if(parsed.ok){nextValue=setValueAtPath(nextValue,field.path,parsed.value)}else{issues.push({path:field.path,message:parsed.message})}}return{value:nextValue,issues}}buildSubmitCandidate(){const raw=this.#rawJsonIssues();if(raw.issues.length>0)return{ok:false,issues:raw.issues};let candidate=raw.value;for(const field of this.#currentNumericFields(this.#model.field,this.formValue)){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(draft!==undefined)candidate=setValueAtPath(candidate,field.path,draft)}return{ok:true,value:pruneUndefined(candidate)}}applyIssues(issues){$15.set(this.#errors,issuesByPath(issues),true);this.clearSerializedValue()}commit(value,serializedValue){this.formValue=value;$15.set(this.#errors,{},true);this.serializedValue=serializedValue}}function createSchemaFormState(model,initialValue,options){return new SchemaFormState(model,initialValue,options)}var rest_excludes7=new Set(["$$slots","$$events","$$legacy","schema","value","name","submitLabel","class","onSubmit","onDraftChange","novalidate"]);var root9=$16.from_html(`<span class="cinder-_required-marker" aria-hidden="true">*</span>`);var root_17=$16.from_html(`<p class="cinder-schema-form__description"> </p>`);var root_25=$16.from_html(`<p class="cinder-schema-form__error" aria-live="polite" tabindex="-1"> </p>`);var root_34=$16.from_html(`<legend class="cinder-schema-form__legend"> <!></legend> <!> <!>`,1);var root_43=$16.from_html(`<fieldset class="cinder-schema-form__fieldset"><!> <div class="cinder-schema-form__fields"></div></fieldset>`);var root_53=$16.from_html(`<div class="cinder-schema-form__array-item"><!> <button type="button" class="cinder-schema-form__secondary-button">Remove</button></div>`);var root_62=$16.from_html(`<fieldset class="cinder-schema-form__fieldset"><!> <div class="cinder-schema-form__array"></div> <button type="button" class="cinder-schema-form__secondary-button"> </button></fieldset>`);var root_7=$16.from_html(`<div class="cinder-schema-form__field"><!></div>`);var root_8=$16.from_html(`<p class="cinder-schema-form__error" role="alert" aria-live="polite" tabindex="-1"> </p>`);var root_9=$16.from_html(`<form><!> <div class="cinder-schema-form__fields"></div> <input type="hidden"/> <button type="submit" class="cinder-schema-form__submit"> </button></form>`);function Schema_form_body($$anchor,$$props){const generatedId=$16.props_id();$16.push($$props,true);const groupLegend=($$anchor,field=$16.noop)=>{var fragment=root_34();var legend=$16.first_child(fragment);var text=$16.child(legend);var node=$16.sibling(text);{var consequent=($$anchor)=>{var span=root9();$16.append($$anchor,span)};$16.if(node,($$render)=>{if(field().required)$$render(consequent)})}$16.reset(legend);var node_1=$16.sibling(legend,2);{var consequent_1=($$anchor)=>{var p=root_17();var text_1=$16.only_child(p,true);$16.template_effect(($0)=>{$16.set_attribute(p,"id",`${$0??""}-description`);$16.set_text(text_1,field().description)},[()=>fieldDomId(field())]);$16.append($$anchor,p)};$16.if(node_1,($$render)=>{if(field().description)$$render(consequent_1)})}var node_2=$16.sibling(node_1,2);{var consequent_2=($$anchor)=>{var p_1=root_25();var text_2=$16.only_child(p_1,true);$16.template_effect(($0,$1)=>{$16.set_attribute(p_1,"id",`${$0??""}-error`);$16.set_text(text_2,$1)},[()=>fieldDomId(field()),()=>fieldError(field())]);$16.append($$anchor,p_1)};var d=$16.derived(()=>fieldError(field()));$16.if(node_2,($$render)=>{if($16.get(d))$$render(consequent_2)})}$16.template_effect(()=>$16.set_text(text,`${field().label??""} `));$16.append($$anchor,fragment)};const renderField=($$anchor,field=$16.noop)=>{const id=$16.derived(()=>fieldDomId(field()));const error=$16.derived(()=>fieldError(field()));const labelledProps=$16.derived(()=>({label:field().label,...field().description!==undefined?{description:field().description}:{},...$16.get(error)!==undefined?{error:$16.get(error)}:{}}));var fragment_1=$16.comment();var node_3=$16.first_child(fragment_1);{var consequent_3=($$anchor)=>{var fieldset=root_43();var node_4=$16.child(fieldset);groupLegend(node_4,field);var div=$16.sibling(node_4,2);$16.each(div,21,()=>field().fields,(child)=>pathKey(child.path),($$anchor,child)=>{renderField($$anchor,()=>$16.get(child))});$16.reset(div);$16.reset(fieldset);$16.append($$anchor,fieldset)};var consequent_5=($$anchor)=>{var fieldset_1=root_62();var node_5=$16.child(fieldset_1);groupLegend(node_5,field);var div_1=$16.sibling(node_5,2);$16.each(div_1,21,()=>formState.arrayRows(field()),(row)=>row.key,($$anchor,row)=>{const itemField=$16.derived(()=>field().item?rebaseFieldPath(field().item,[...field().path,String($16.get(row).index)]):undefined);var div_2=root_53();var node_6=$16.child(div_2);{var consequent_4=($$anchor)=>{renderField($$anchor,()=>$16.get(itemField))};$16.if(node_6,($$render)=>{if($16.get(itemField))$$render(consequent_4)})}var button=$16.sibling(node_6,2);$16.reset(div_2);$16.template_effect(()=>{$16.set_attribute(button,"aria-label",`Remove ${field().label} item ${$16.get(row).index+1}`);button.disabled=$16.get(submitting)});$16.delegated("click",button,()=>formState.removeArrayItem(field(),$16.get(row).index));$16.append($$anchor,div_2)});$16.reset(div_1);var button_1=$16.sibling(div_1,2);var text_3=$16.only_child(button_1);$16.reset(fieldset_1);$16.template_effect(($0)=>{$16.set_attribute(div_1,"data-cinder-empty",$0);button_1.disabled=$16.get(submitting);$16.set_text(text_3,`Add ${field().label??""}`)},[()=>formState.arrayRows(field()).length===0||undefined]);$16.delegated("click",button_1,()=>formState.addArrayItem(field()));$16.append($$anchor,fieldset_1)};var alternate_1=($$anchor)=>{var div_3=root_7();var node_7=$16.child(div_3);{var consequent_6=($$anchor)=>{var bind_get=()=>stringValue(field());var bind_set=(next)=>formState.updateValue(field().path,next);Input($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},onblur:()=>formState.validateTouchedField(field()),get value(){return bind_get()},set value($$value){bind_set($$value)}}))};var consequent_7=($$anchor)=>{{let $0=$16.derived(()=>field().kind==="integer"?1:undefined);let $1=$16.derived(()=>numberFieldValue(field()));Number_input($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},get step(){return $16.get($0)},onblur:()=>formState.validateTouchedField(field()),get value(){return $16.get($1)},onValueChange:(next)=>formState.updateNumberValue(field(),next)}))}};var consequent_8=($$anchor)=>{{let $0=$16.derived(()=>selectOptions(field()));let $1=$16.derived(()=>enumValue(field()));Select($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},get options(){return $16.get($0)},get value(){return $16.get($1)},onchange:(event)=>formState.updateEnum(field(),event),onblur:()=>formState.validateTouchedField(field())}))}};var consequent_9=($$anchor)=>{var bind_get_1=()=>booleanValue(field());var bind_set_1=(next)=>formState.updateValue(field().path,next);Checkbox($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get disabled(){return $16.get(submitting)},get checked(){return bind_get_1()},set checked($$value){bind_set_1($$value)}}))};var alternate=($$anchor)=>{var bind_get_2=()=>rawJsonValue(field());var bind_set_2=(next)=>formState.updateRawJsonValue(field(),next);Textarea($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},rows:6,spellcheck:false,variant:"code",class:"cinder-schema-form__json-control",onblur:()=>formState.validateTouchedField(field()),get value(){return bind_get_2()},set value($$value){bind_set_2($$value)}}))};$16.if(node_7,($$render)=>{if(field().kind==="string")$$render(consequent_6);else if(field().kind==="number"||field().kind==="integer")$$render(consequent_7,1);else if(field().kind==="enum")$$render(consequent_8,2);else if(field().kind==="boolean")$$render(consequent_9,3);else $$render(alternate,-1)})}$16.reset(div_3);$16.delegated("input",div_3,(event)=>formState.handleFieldInput(field(),event));$16.append($$anchor,div_3)};$16.if(node_3,($$render)=>{if(field().kind==="object")$$render(consequent_3);else if(field().kind==="array")$$render(consequent_5,1);else $$render(alternate_1,-1)})}$16.append($$anchor,fragment_1)};let name2=$16.prop($$props,"name",3,"value"),submitLabel=$16.prop($$props,"submitLabel",3,"Submit"),rest=$16.rest_props($$props,rest_excludes7);function createInitialState(){const initialModel=createSchemaFormModel($$props.schema);return{initialModel,initialFormValue:initialValueForField(initialModel.field,$$props.value)}}const{initialModel,initialFormValue}=createInitialState();const model=$16.derived(()=>createSchemaFormModel($$props.schema));let formElement=$16.state(undefined);let serializedInputElement=$16.state(undefined);let submitting=$16.state(false);let allowNativeSubmit=false;let activeSubmitId=0;const formState=createSchemaFormState(initialModel,initialFormValue,{getSubmitting:()=>$16.get(submitting),onDraftChange:(draft)=>$$props.onDraftChange?.(draft)});$16.user_effect(()=>{if($16.get(serializedInputElement))$16.get(serializedInputElement).value=formState.serializedValue});const formId=$16.derived(()=>$$props.id??`${generatedId}-form`);const rootFields=$16.derived(()=>$16.get(model).field.kind==="object"?$16.get(model).field.fields:[$16.get(model).field]);const rootError=$16.derived(()=>$16.get(model).field.kind==="object"?formState.errors[pathKey([])]:undefined);const rootErrorId=$16.derived(()=>`${$16.get(formId)}-${pathId([])}-error`);function fieldDomId(field){return`${$16.get(formId)}-${pathId(field.path)}`}function fieldError(field){return formState.errors[pathKey(field.path)]}function stringValue(field){const current=getValueAtPath(formState.formValue,field.path);return current===undefined||current===null?"":String(current)}function numberValue(field){const current=getValueAtPath(formState.formValue,field.path);return typeof current==="number"?current:undefined}function booleanValue(field){return getValueAtPath(formState.formValue,field.path)===true}function enumValue(field){const current=getValueAtPath(formState.formValue,field.path);const option=field.options.find((candidate)=>Object.is(candidate.value,current));return option?.encodedValue??field.options[0]?.encodedValue??""}function selectOptions(field){return field.options.map((option)=>({value:option.encodedValue,label:option.label}))}function numberFieldValue(field){return numberValue(field)??null}function rawJsonValue(field){const key=pathKey(field.path);if(formState.rawDrafts[key]!==undefined)return formState.rawDrafts[key];return JSON.stringify(getValueAtPath(formState.formValue,field.path)??null,null,2)}async function reportSubmitIssues(issues,submitId){if(activeSubmitId!==submitId)return;formState.applyIssues(issues);$16.set(submitting,false);await focusFirstError(submitId)}async function focusFirstError(submitId){await tick();if(activeSubmitId!==submitId)return;$16.get(formElement)?.querySelector('[aria-invalid="true"], [data-cinder-invalid="true"], .cinder-schema-form__error')?.focus()}function shouldResumeNativeSubmit(){return $$props.onSubmit===undefined&&($$props.action!==undefined||$$props.method!==undefined)}function nativeSubmitter(event){const submitter=event.submitter;if(submitter instanceof HTMLButtonElement&&submitter.type==="submit"&&submitter.form===$16.get(formElement)){return submitter}if(submitter instanceof HTMLInputElement&&(submitter.type==="submit"||submitter.type==="image")&&submitter.form===$16.get(formElement)){return submitter}return}async function handleSubmit(event){if(allowNativeSubmit){allowNativeSubmit=false;return}event.preventDefault();if($16.get(submitting))return;const submitId=activeSubmitId+1;activeSubmitId=submitId;$16.set(submitting,true);try{const draft=formState.buildSubmitCandidate();if(!draft.ok){await reportSubmitIssues(draft.issues,submitId);return}const result=await validateSchemaValue($$props.schema,draft.value);if(!result.valid){await reportSubmitIssues(result.issues,submitId);return}const serialized=serializeValidatedValue(result.value);if(!serialized.ok){await reportSubmitIssues([serialized.issue],submitId);return}formState.commit(result.value,serialized.value);await $$props.onSubmit?.(result.value,event);if(shouldResumeNativeSubmit()){allowNativeSubmit=true;await tick();$16.get(formElement)?.requestSubmit(nativeSubmitter(event))}}finally{if(activeSubmitId===submitId)$16.set(submitting,false)}}var form=root_9();$16.attribute_effect(form,($0)=>({...rest,id:$16.get(formId),class:$0,novalidate:$$props.novalidate??true,onsubmit:handleSubmit}),[()=>classNames("cinder-schema-form",$$props.class)]);var node_8=$16.child(form);{var consequent_10=($$anchor)=>{var p_2=root_8();var text_4=$16.only_child(p_2,true);$16.template_effect(()=>{$16.set_attribute(p_2,"id",$16.get(rootErrorId));$16.set_text(text_4,$16.get(rootError))});$16.append($$anchor,p_2)};$16.if(node_8,($$render)=>{if($16.get(rootError))$$render(consequent_10)})}var div_4=$16.sibling(node_8,2);$16.each(div_4,21,()=>$16.get(rootFields),(field)=>pathKey(field.path),($$anchor,field)=>{renderField($$anchor,()=>$16.get(field))});$16.reset(div_4);var input=$16.sibling(div_4,2);$16.remove_input_defaults(input);$16.bind_this(input,($$value)=>$16.set(serializedInputElement,$$value),()=>$16.get(serializedInputElement));var button_2=$16.sibling(input,2);var text_5=$16.only_child(button_2,true);$16.reset(form);$16.bind_this(form,($$value)=>$16.set(formElement,$$value),()=>$16.get(formElement));$16.template_effect(()=>{$16.set_attribute(input,"name",name2());$16.set_value(input,formState.serializedValue);button_2.disabled=$16.get(submitting);$16.set_text(text_5,$16.get(submitting)?"Validating...":submitLabel())});$16.append($$anchor,form);$16.pop()}$16.delegate(["click","input"]);var rest_excludes8=new Set(["$$slots","$$events","$$legacy","schema"]);function Schema_form($$anchor,$$props){let rest=$17.rest_props($$props,rest_excludes8);var fragment=$17.comment();var node=$17.first_child(fragment);$17.key(node,()=>$$props.schema,($$anchor)=>{Schema_form_body($$anchor,$17.spread_props({get schema(){return $$props.schema}},()=>rest))});$17.append($$anchor,fragment)}var schema_form_default=Schema_form;export{Schema_form as SchemaForm,schema_form_default as default,readSchemaFormData};
|
|
1
|
+
var __create=Object.create;var __getProtoOf=Object.getPrototypeOf;var __defProp=Object.defineProperty;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;function __accessProp(key){return this[key]}var __toESMCache_node;var __toESMCache_esm;var __toESM=(mod,isNodeMode,target)=>{var canCache=mod!=null&&typeof mod==="object";if(canCache){var cache=isNodeMode?__toESMCache_node??=new WeakMap:__toESMCache_esm??=new WeakMap;var cached=cache.get(mod);if(cached)return cached}target=mod!=null?__create(__getProtoOf(mod)):{};const to=isNodeMode||!mod||!mod.__esModule||!__hasOwnProp.call(mod,"default")?__defProp(target,"default",{value:mod,enumerable:true}):target;if(mod&&typeof mod==="object"||typeof mod==="function"){for(let key of __getOwnPropNames(mod))if(!__hasOwnProp.call(to,key))__defProp(to,key,{get:__accessProp.bind(mod,key),enumerable:true})}if(canCache)cache.set(mod,to);return to};var __commonJS=(cb,mod)=>()=>(mod||cb((mod={exports:{}}).exports,mod),mod.exports);var __returnValue=(v)=>v;function __exportSetter(name2,newValue){this[name2]=__returnValue.bind(null,newValue)}var __export=(target,all)=>{for(var name2 in all)__defProp(target,name2,{get:all[name2],enumerable:true,configurable:true,set:__exportSetter.bind(all,name2)})};var __esm=(fn,res,err)=>()=>{if(fn)try{res=fn(fn=0)}catch(e){err=[e]}if(err)throw err[0];return res};var __exportCjs=(target,getters,setters)=>{for(var name2 in getters)__defProp(target,name2,{get:getters[name2],set:setters[name2],enumerable:true,configurable:true})};function getCleanClone(prototype){if(!prototype){return Object.create(null)}const Constructor=prototype.constructor;if(Constructor===Object){return prototype===Object.prototype?{}:Object.create(prototype)}if(Constructor&&~toStringFunction.call(Constructor).indexOf("[native code]")){try{return new Constructor}catch(_a){}}return Object.create(prototype)}function getTag(value){const stringTag=value[Symbol.toStringTag];if(stringTag){return stringTag}const type=toStringObject.call(value);return type.substring(8,type.length-1)}function copyOwnDescriptor(original,clone,property,state){const ownDescriptor=Object.getOwnPropertyDescriptor(original,property)||{configurable:true,enumerable:true,value:original[property],writable:true};const descriptor=ownDescriptor.get||ownDescriptor.set?ownDescriptor:{configurable:ownDescriptor.configurable,enumerable:ownDescriptor.enumerable,value:state.copier(ownDescriptor.value,state),writable:ownDescriptor.writable};try{Object.defineProperty(clone,property,descriptor)}catch(_a){clone[property]=descriptor.get?descriptor.get():descriptor.value}}function copyOwnPropertiesStrict(value,clone,state){for(const name2 of Object.getOwnPropertyNames(value)){copyOwnDescriptor(value,clone,name2,state)}for(const symbol of Object.getOwnPropertySymbols(value)){copyOwnDescriptor(value,clone,symbol,state)}return clone}function copyArrayLoose(array,state){const clone=new state.Constructor;state.cache.set(array,clone);for(let index=0;index<array.length;++index){clone[index]=state.copier(array[index],state)}return clone}function copyArrayStrict(array,state){const clone=new state.Constructor;state.cache.set(array,clone);return copyOwnPropertiesStrict(array,clone,state)}function copyArrayBuffer(arrayBuffer,_state){return ArrayBuffer.isView(arrayBuffer)?sliceTypedArray.call(arrayBuffer,0):arrayBuffer.slice(0)}function copyBlob(blob,_state){return blob.slice(0,blob.size,blob.type)}function copyDataView(dataView,state){return new state.Constructor(copyArrayBuffer(dataView.buffer))}function copyDate(date,state){return new state.Constructor(date.getTime())}function copyMapLoose(map,state){const clone=new state.Constructor;state.cache.set(map,clone);for(const[key,value]of map){clone.set(key,state.copier(value,state))}return clone}function copyMapStrict(map,state){return copyOwnPropertiesStrict(map,copyMapLoose(map,state),state)}function copyObjectLoose(object,state){const clone=getCleanClone(state.prototype);state.cache.set(object,clone);for(const key of Object.keys(object)){clone[key]=state.copier(object[key],state)}for(const symbol of Object.getOwnPropertySymbols(object)){if(propertyIsEnumerable.call(object,symbol)){clone[symbol]=state.copier(object[symbol],state)}}return clone}function copyObjectStrict(object,state){const clone=getCleanClone(state.prototype);state.cache.set(object,clone);return copyOwnPropertiesStrict(object,clone,state)}function copyPrimitiveWrapper(primitiveObject,state){return new state.Constructor(primitiveObject.valueOf())}function copyRegExp(regExp,state){const clone=new state.Constructor(regExp.source,regExp.flags);clone.lastIndex=regExp.lastIndex;return clone}function copySelf(value,_state){return value}function copySetLoose(set,state){const clone=new state.Constructor;state.cache.set(set,clone);for(const value of set){clone.add(state.copier(value,state))}return clone}function copySetStrict(set,state){return copyOwnPropertiesStrict(set,copySetLoose(set,state),state)}function createDefaultCache(){return new WeakMap}function getOptions({createCache:createCacheOverride,maxDepth,methods:methodsOverride,strict}){const defaultMethods={array:strict?copyArrayStrict:copyArrayLoose,arrayBuffer:copyArrayBuffer,asyncGenerator:copySelf,blob:copyBlob,dataView:copyDataView,date:copyDate,error:copySelf,generator:copySelf,map:strict?copyMapStrict:copyMapLoose,object:strict?copyObjectStrict:copyObjectLoose,regExp:copyRegExp,set:strict?copySetStrict:copySetLoose};const methods=methodsOverride?Object.assign(defaultMethods,methodsOverride):defaultMethods;const copiers=getTagSpecificCopiers(methods);const createCache=createCacheOverride||createDefaultCache;if(!copiers.Object||!copiers.Array){throw new Error("An object and array copier must be provided.")}return{createCache,copiers,maxDepth:maxDepth==null?DEFAULT_MAX_DEPTH:maxDepth,methods,strict:Boolean(strict)}}function getTagSpecificCopiers(methods){return Object.assign(Object.create(null),{Arguments:methods.object,Array:methods.array,ArrayBuffer:methods.arrayBuffer,AsyncGenerator:methods.asyncGenerator,BigInt64Array:methods.arrayBuffer,BigUint64Array:methods.arrayBuffer,Blob:methods.blob,Boolean:copyPrimitiveWrapper,DataView:methods.dataView,Date:methods.date,Error:methods.error,Float32Array:methods.arrayBuffer,Float64Array:methods.arrayBuffer,Generator:methods.generator,Int8Array:methods.arrayBuffer,Int16Array:methods.arrayBuffer,Int32Array:methods.arrayBuffer,Map:methods.map,Number:copyPrimitiveWrapper,Object:methods.object,Promise:copySelf,RegExp:methods.regExp,Set:methods.set,String:copyPrimitiveWrapper,WeakMap:copySelf,WeakSet:copySelf,Uint8Array:methods.arrayBuffer,Uint8ClampedArray:methods.arrayBuffer,Uint16Array:methods.arrayBuffer,Uint32Array:methods.arrayBuffer})}function createCopier(options={}){const{createCache,copiers,maxDepth}=getOptions(options);const{Array:copyArray,Object:copyObject}=copiers;function copier(value,state){state.prototype=state.Constructor=undefined;if(!value||typeof value!=="object"){return value}if(state.cache.has(value)){return state.cache.get(value)}if(++state.depth>maxDepth){throw new MaxDepthExceededError(maxDepth)}state.prototype=Object.getPrototypeOf(value);state.Constructor=state.prototype&&state.prototype.constructor;let clone;if(!state.Constructor||state.Constructor===Object){clone=copyObject(value,state)}else if(Array.isArray(value)){clone=copyArray(value,state)}else{const tagSpecificCopier=copiers[getTag(value)];if(tagSpecificCopier){clone=tagSpecificCopier(value,state)}else{clone=typeof value.then==="function"?value:copyObject(value,state)}}--state.depth;return clone}return function copy(value){return copier(value,{Constructor:undefined,cache:createCache(),copier,depth:0,prototype:undefined})}}var MaxDepthExceededError,toStringFunction,toStringObject,propertyIsEnumerable,sliceTypedArray,DEFAULT_MAX_DEPTH=1000,copyStrict,copy;var init_es=__esm(()=>{MaxDepthExceededError=class MaxDepthExceededError extends RangeError{constructor(maxDepth){super(`Maximum copy depth of ${String(maxDepth)} exceeded; the value copied is nested too deeply.`);this.maxDepth=maxDepth;this.name="MaxDepthExceededError"}};toStringFunction=Function.prototype.toString;toStringObject=Object.prototype.toString;({propertyIsEnumerable}=Object.prototype);sliceTypedArray=Object.getPrototypeOf(Int8Array.prototype).slice;copyStrict=createCopier({strict:true});copy=createCopier()});function e(e){return e===`#`||e===``||Array.isArray(e)&&e.length===0||false}function i(e){return e.replace(t,`/`).replace(n,`~`)}function a(e){return i(decodeURIComponent(e))}function o(t){if(t==null||typeof t!=`string`||e(t))return Array.isArray(t)?t.slice():[];let n=t.indexOf(`#`)>=0?a:i;t=t.replace(r,``);let o=t.split(`/`);for(let e=0,t=o.length;e<t;e+=1)o[e]=n(o[e]);return o}function s(t,n,r=undefined){if(n==null||t==null)return r;if(e(n))return t;let i=c(t,o(n));return i===undefined?r:i}function c(e,t){let n=t.shift();if(e!==undefined)return n===undefined?e:e==null?undefined:c(e[n],t)}function y(e,t){if(e.length===0)return t?`#`:``;for(let n=0,r=e.length;n<r;n+=1)e[n]=e[n].replace(_,`~0`).replace(v,`~1`),t&&(e[n]=encodeURIComponent(e[n]));return(t?`#/`:`/`)+e.join(`/`)}function b(e,...t){let n=[];if(Array.isArray(e))return y(e,arguments[1]===true);let r=arguments[arguments.length-1],i=typeof r==`boolean`?r:e&&e[0]===`#`;for(let e=0,t=arguments.length;e<t;e+=1)n.push.apply(n,o(arguments[e]));let a=[];for(let e=0,t=n.length;e<t;e+=1)if(n[e]===`..`){if(a.length===0)return i?`#`:``;a.pop()}else a.push(n[e]);return y(a,i)}var t,n,r,_,v;var init_dist=__esm(()=>{t=/~1/g;n=/~0/g;r=/(^#?\/?)/g;_=/~/g;v=/\//g});var require_uri_all=__commonJS(function(exports,module){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.URI=global.URI||{})})(exports,function(exports2){function merge(){for(var _len=arguments.length,sets=Array(_len),_key=0;_key<_len;_key++){sets[_key]=arguments[_key]}if(sets.length>1){sets[0]=sets[0].slice(0,-1);var xl=sets.length-1;for(var x=1;x<xl;++x){sets[x]=sets[x].slice(1,-1)}sets[xl]=sets[xl].slice(1);return sets.join("")}else{return sets[0]}}function subexp(str){return"(?:"+str+")"}function typeOf(o){return o===undefined?"undefined":o===null?"null":Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(str){return str.toUpperCase()}function toArray(obj){return obj!==undefined&&obj!==null?obj instanceof Array?obj:typeof obj.length!=="number"||obj.split||obj.setInterval||obj.call?[obj]:Array.prototype.slice.call(obj):[]}function assign(target,source){var obj=target;if(source){for(var key in source){obj[key]=source[key]}}return obj}function buildExps(isIRI){var ALPHA$$="[A-Za-z]",CR$="[\\x0D]",DIGIT$$="[0-9]",DQUOTE$$="[\\x22]",HEXDIG$$=merge(DIGIT$$,"[A-Fa-f]"),LF$$="[\\x0A]",SP$$="[\\x20]",PCT_ENCODED$=subexp(subexp("%[EFef]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%[89A-Fa-f]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%"+HEXDIG$$+HEXDIG$$)),GEN_DELIMS$$="[\\:\\/\\?\\#\\[\\]\\@]",SUB_DELIMS$$="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",RESERVED$$=merge(GEN_DELIMS$$,SUB_DELIMS$$),UCSCHAR$$=isIRI?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",IPRIVATE$$=isIRI?"[\\uE000-\\uF8FF]":"[]",UNRESERVED$$=merge(ALPHA$$,DIGIT$$,"[\\-\\.\\_\\~]",UCSCHAR$$),SCHEME$=subexp(ALPHA$$+merge(ALPHA$$,DIGIT$$,"[\\+\\-\\.]")+"*"),USERINFO$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:]"))+"*"),DEC_OCTET$=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+DIGIT$$)+"|"+subexp("1"+DIGIT$$+DIGIT$$)+"|"+subexp("[1-9]"+DIGIT$$)+"|"+DIGIT$$),DEC_OCTET_RELAXED$=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+DIGIT$$)+"|"+subexp("1"+DIGIT$$+DIGIT$$)+"|"+subexp("0?[1-9]"+DIGIT$$)+"|0?0?"+DIGIT$$),IPV4ADDRESS$=subexp(DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$+"\\."+DEC_OCTET_RELAXED$),H16$=subexp(HEXDIG$$+"{1,4}"),LS32$=subexp(subexp(H16$+"\\:"+H16$)+"|"+IPV4ADDRESS$),IPV6ADDRESS1$=subexp(subexp(H16$+"\\:")+"{6}"+LS32$),IPV6ADDRESS2$=subexp("\\:\\:"+subexp(H16$+"\\:")+"{5}"+LS32$),IPV6ADDRESS3$=subexp(subexp(H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{4}"+LS32$),IPV6ADDRESS4$=subexp(subexp(subexp(H16$+"\\:")+"{0,1}"+H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{3}"+LS32$),IPV6ADDRESS5$=subexp(subexp(subexp(H16$+"\\:")+"{0,2}"+H16$)+"?\\:\\:"+subexp(H16$+"\\:")+"{2}"+LS32$),IPV6ADDRESS6$=subexp(subexp(subexp(H16$+"\\:")+"{0,3}"+H16$)+"?\\:\\:"+H16$+"\\:"+LS32$),IPV6ADDRESS7$=subexp(subexp(subexp(H16$+"\\:")+"{0,4}"+H16$)+"?\\:\\:"+LS32$),IPV6ADDRESS8$=subexp(subexp(subexp(H16$+"\\:")+"{0,5}"+H16$)+"?\\:\\:"+H16$),IPV6ADDRESS9$=subexp(subexp(subexp(H16$+"\\:")+"{0,6}"+H16$)+"?\\:\\:"),IPV6ADDRESS$=subexp([IPV6ADDRESS1$,IPV6ADDRESS2$,IPV6ADDRESS3$,IPV6ADDRESS4$,IPV6ADDRESS5$,IPV6ADDRESS6$,IPV6ADDRESS7$,IPV6ADDRESS8$,IPV6ADDRESS9$].join("|")),ZONEID$=subexp(subexp(UNRESERVED$$+"|"+PCT_ENCODED$)+"+"),IPV6ADDRZ$=subexp(IPV6ADDRESS$+"\\%25"+ZONEID$),IPV6ADDRZ_RELAXED$=subexp(IPV6ADDRESS$+subexp("\\%25|\\%(?!"+HEXDIG$$+"{2})")+ZONEID$),IPVFUTURE$=subexp("[vV]"+HEXDIG$$+"+\\."+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:]")+"+"),IP_LITERAL$=subexp("\\["+subexp(IPV6ADDRZ_RELAXED$+"|"+IPV6ADDRESS$+"|"+IPVFUTURE$)+"\\]"),REG_NAME$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$))+"*"),HOST$=subexp(IP_LITERAL$+"|"+IPV4ADDRESS$+"(?!"+REG_NAME$+")"+"|"+REG_NAME$),PORT$=subexp(DIGIT$$+"*"),AUTHORITY$=subexp(subexp(USERINFO$+"@")+"?"+HOST$+subexp("\\:"+PORT$)+"?"),PCHAR$=subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@]")),SEGMENT$=subexp(PCHAR$+"*"),SEGMENT_NZ$=subexp(PCHAR$+"+"),SEGMENT_NZ_NC$=subexp(subexp(PCT_ENCODED$+"|"+merge(UNRESERVED$$,SUB_DELIMS$$,"[\\@]"))+"+"),PATH_ABEMPTY$=subexp(subexp("\\/"+SEGMENT$)+"*"),PATH_ABSOLUTE$=subexp("\\/"+subexp(SEGMENT_NZ$+PATH_ABEMPTY$)+"?"),PATH_NOSCHEME$=subexp(SEGMENT_NZ_NC$+PATH_ABEMPTY$),PATH_ROOTLESS$=subexp(SEGMENT_NZ$+PATH_ABEMPTY$),PATH_EMPTY$="(?!"+PCHAR$+")",PATH$=subexp(PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$),QUERY$=subexp(subexp(PCHAR$+"|"+merge("[\\/\\?]",IPRIVATE$$))+"*"),FRAGMENT$=subexp(subexp(PCHAR$+"|[\\/\\?]")+"*"),HIER_PART$=subexp(subexp("\\/\\/"+AUTHORITY$+PATH_ABEMPTY$)+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$),URI$=subexp(SCHEME$+"\\:"+HIER_PART$+subexp("\\?"+QUERY$)+"?"+subexp("\\#"+FRAGMENT$)+"?"),RELATIVE_PART$=subexp(subexp("\\/\\/"+AUTHORITY$+PATH_ABEMPTY$)+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_EMPTY$),RELATIVE$=subexp(RELATIVE_PART$+subexp("\\?"+QUERY$)+"?"+subexp("\\#"+FRAGMENT$)+"?"),URI_REFERENCE$=subexp(URI$+"|"+RELATIVE$),ABSOLUTE_URI$=subexp(SCHEME$+"\\:"+HIER_PART$+subexp("\\?"+QUERY$)+"?"),GENERIC_REF$="^("+SCHEME$+")\\:"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?"+subexp("\\#("+FRAGMENT$+")")+"?$",RELATIVE_REF$="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_NOSCHEME$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?"+subexp("\\#("+FRAGMENT$+")")+"?$",ABSOLUTE_REF$="^("+SCHEME$+")\\:"+subexp(subexp("\\/\\/("+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?)")+"?("+PATH_ABEMPTY$+"|"+PATH_ABSOLUTE$+"|"+PATH_ROOTLESS$+"|"+PATH_EMPTY$+")")+subexp("\\?("+QUERY$+")")+"?$",SAMEDOC_REF$="^"+subexp("\\#("+FRAGMENT$+")")+"?$",AUTHORITY_REF$="^"+subexp("("+USERINFO$+")@")+"?("+HOST$+")"+subexp("\\:("+PORT$+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",ALPHA$$,DIGIT$$,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",UNRESERVED$$,SUB_DELIMS$$),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@\\/\\?]",IPRIVATE$$),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",UNRESERVED$$,SUB_DELIMS$$,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",UNRESERVED$$,SUB_DELIMS$$),"g"),UNRESERVED:new RegExp(UNRESERVED$$,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",UNRESERVED$$,RESERVED$$),"g"),PCT_ENCODED:new RegExp(PCT_ENCODED$,"g"),IPV4ADDRESS:new RegExp("^("+IPV4ADDRESS$+")$"),IPV6ADDRESS:new RegExp("^\\[?("+IPV6ADDRESS$+")"+subexp(subexp("\\%25|\\%(?!"+HEXDIG$$+"{2})")+"("+ZONEID$+")")+"?\\]?$")}}var URI_PROTOCOL=buildExps(false);var IRI_PROTOCOL=buildExps(true);var slicedToArray=function(){function sliceIterator(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break}}catch(err){_d=true;_e=err}finally{try{if(!_n&&_i["return"])_i["return"]()}finally{if(_d)throw _e}}return _arr}return function(arr,i){if(Array.isArray(arr)){return arr}else if(Symbol.iterator in Object(arr)){return sliceIterator(arr,i)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}else{return Array.from(arr)}};var maxInt=2147483647;var base=36;var tMin=1;var tMax=26;var skew=38;var damp=700;var initialBias=72;var initialN=128;var delimiter="-";var regexPunycode=/^xn--/;var regexNonASCII=/[^\0-\x7E]/;var regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g;var errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"};var baseMinusTMin=base-tMin;var floor=Math.floor;var stringFromCharCode=String.fromCharCode;function error$1(type){throw new RangeError(errors[type])}function map(array,fn){var result=[];var length=array.length;while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[];var counter=0;var length=string.length;while(counter<length){var value=string.charCodeAt(counter++);if(value>=55296&&value<=56319&&counter<length){var extra=string.charCodeAt(counter++);if((extra&64512)==56320){output.push(((value&1023)<<10)+(extra&1023)+65536)}else{output.push(value);counter--}}else{output.push(value)}}return output}var ucs2encode=function ucs2encode(array){return String.fromCodePoint.apply(String,toConsumableArray(array))};var basicToDigit=function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base};var digitToBasic=function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)};var adapt=function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))};var decode=function decode(input){var output=[];var inputLength=input.length;var i=0;var n=initialN;var bias=initialBias;var basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(var j=0;j<basic;++j){if(input.charCodeAt(j)>=128){error$1("not-basic")}output.push(input.charCodeAt(j))}for(var index=basic>0?basic+1:0;index<inputLength;){var oldi=i;for(var w=1,k=base;;k+=base){if(index>=inputLength){error$1("invalid-input")}var digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error$1("overflow")}i+=digit*w;var t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break}var baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error$1("overflow")}w*=baseMinusT}var out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error$1("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return String.fromCodePoint.apply(String,output)};var encode=function encode(input){var output=[];input=ucs2decode(input);var inputLength=input.length;var n=initialN;var delta=0;var bias=initialBias;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=input[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _currentValue2=_step.value;if(_currentValue2<128){output.push(stringFromCharCode(_currentValue2))}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var basicLength=output.length;var handledCPCount=basicLength;if(basicLength){output.push(delimiter)}while(handledCPCount<inputLength){var m=maxInt;var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=input[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var currentValue=_step2.value;if(currentValue>=n&¤tValue<m){m=currentValue}}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error$1("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=input[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var _currentValue=_step3.value;if(_currentValue<n&&++delta>maxInt){error$1("overflow")}if(_currentValue==n){var q=delta;for(var k=base;;k+=base){var t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break}var qMinusT=q-t;var baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT)}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}++delta;++n}return output.join("")};var toUnicode=function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})};var toASCII=function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})};var punycode={version:"2.1.0",ucs2:{decode:ucs2decode,encode:ucs2encode},decode,encode,toASCII,toUnicode};var SCHEMES={};function pctEncChar(chr){var c=chr.charCodeAt(0);var e=undefined;if(c<16)e="%0"+c.toString(16).toUpperCase();else if(c<128)e="%"+c.toString(16).toUpperCase();else if(c<2048)e="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase();else e="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase();return e}function pctDecChars(str){var newStr="";var i=0;var il=str.length;while(i<il){var c=parseInt(str.substr(i+1,2),16);if(c<128){newStr+=String.fromCharCode(c);i+=3}else if(c>=194&&c<224){if(il-i>=6){var c2=parseInt(str.substr(i+4,2),16);newStr+=String.fromCharCode((c&31)<<6|c2&63)}else{newStr+=str.substr(i,6)}i+=6}else if(c>=224){if(il-i>=9){var _c=parseInt(str.substr(i+4,2),16);var c3=parseInt(str.substr(i+7,2),16);newStr+=String.fromCharCode((c&15)<<12|(_c&63)<<6|c3&63)}else{newStr+=str.substr(i,9)}i+=9}else{newStr+=str.substr(i,3);i+=3}}return newStr}function _normalizeComponentEncoding(components,protocol){function decodeUnreserved(str){var decStr=pctDecChars(str);return!decStr.match(protocol.UNRESERVED)?str:decStr}if(components.scheme)components.scheme=String(components.scheme).replace(protocol.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME,"");if(components.userinfo!==undefined)components.userinfo=String(components.userinfo).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_USERINFO,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.host!==undefined)components.host=String(components.host).replace(protocol.PCT_ENCODED,decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.path!==undefined)components.path=String(components.path).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(components.scheme?protocol.NOT_PATH:protocol.NOT_PATH_NOSCHEME,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.query!==undefined)components.query=String(components.query).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_QUERY,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);if(components.fragment!==undefined)components.fragment=String(components.fragment).replace(protocol.PCT_ENCODED,decodeUnreserved).replace(protocol.NOT_FRAGMENT,pctEncChar).replace(protocol.PCT_ENCODED,toUpperCase);return components}function _stripLeadingZeros(str){return str.replace(/^0*(.*)/,"$1")||"0"}function _normalizeIPv4(host,protocol){var matches=host.match(protocol.IPV4ADDRESS)||[];var _matches=slicedToArray(matches,2),address=_matches[1];if(address){return address.split(".").map(_stripLeadingZeros).join(".")}else{return host}}function _normalizeIPv6(host,protocol){var matches=host.match(protocol.IPV6ADDRESS)||[];var _matches2=slicedToArray(matches,3),address=_matches2[1],zone=_matches2[2];if(address){var _address$toLowerCase$=address.toLowerCase().split("::").reverse(),_address$toLowerCase$2=slicedToArray(_address$toLowerCase$,2),last=_address$toLowerCase$2[0],first=_address$toLowerCase$2[1];var firstFields=first?first.split(":").map(_stripLeadingZeros):[];var lastFields=last.split(":").map(_stripLeadingZeros);var isLastFieldIPv4Address=protocol.IPV4ADDRESS.test(lastFields[lastFields.length-1]);var fieldCount=isLastFieldIPv4Address?7:8;var lastFieldsStart=lastFields.length-fieldCount;var fields=Array(fieldCount);for(var x=0;x<fieldCount;++x){fields[x]=firstFields[x]||lastFields[lastFieldsStart+x]||""}if(isLastFieldIPv4Address){fields[fieldCount-1]=_normalizeIPv4(fields[fieldCount-1],protocol)}var allZeroFields=fields.reduce(function(acc,field,index){if(!field||field==="0"){var lastLongest=acc[acc.length-1];if(lastLongest&&lastLongest.index+lastLongest.length===index){lastLongest.length++}else{acc.push({index,length:1})}}return acc},[]);var longestZeroFields=allZeroFields.sort(function(a,b){return b.length-a.length})[0];var newHost=undefined;if(longestZeroFields&&longestZeroFields.length>1){var newFirst=fields.slice(0,longestZeroFields.index);var newLast=fields.slice(longestZeroFields.index+longestZeroFields.length);newHost=newFirst.join(":")+"::"+newLast.join(":")}else{newHost=fields.join(":")}if(zone){newHost+="%"+zone}return newHost}else{return host}}var URI_PARSE=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;var NO_MATCH_IS_UNDEFINED="".match(/(){0}/)[1]===undefined;function parse(uriString){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var components={};var protocol=options.iri!==false?IRI_PROTOCOL:URI_PROTOCOL;if(options.reference==="suffix")uriString=(options.scheme?options.scheme+":":"")+"//"+uriString;var matches=uriString.match(URI_PARSE);if(matches){if(NO_MATCH_IS_UNDEFINED){components.scheme=matches[1];components.userinfo=matches[3];components.host=matches[4];components.port=parseInt(matches[5],10);components.path=matches[6]||"";components.query=matches[7];components.fragment=matches[8];if(isNaN(components.port)){components.port=matches[5]}}else{components.scheme=matches[1]||undefined;components.userinfo=uriString.indexOf("@")!==-1?matches[3]:undefined;components.host=uriString.indexOf("//")!==-1?matches[4]:undefined;components.port=parseInt(matches[5],10);components.path=matches[6]||"";components.query=uriString.indexOf("?")!==-1?matches[7]:undefined;components.fragment=uriString.indexOf("#")!==-1?matches[8]:undefined;if(isNaN(components.port)){components.port=uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?matches[4]:undefined}}if(components.host){components.host=_normalizeIPv6(_normalizeIPv4(components.host,protocol),protocol)}if(components.scheme===undefined&&components.userinfo===undefined&&components.host===undefined&&components.port===undefined&&!components.path&&components.query===undefined){components.reference="same-document"}else if(components.scheme===undefined){components.reference="relative"}else if(components.fragment===undefined){components.reference="absolute"}else{components.reference="uri"}if(options.reference&&options.reference!=="suffix"&&options.reference!==components.reference){components.error=components.error||"URI is not a "+options.reference+" reference."}var schemeHandler=SCHEMES[(options.scheme||components.scheme||"").toLowerCase()];if(!options.unicodeSupport&&(!schemeHandler||!schemeHandler.unicodeSupport)){if(components.host&&(options.domainHost||schemeHandler&&schemeHandler.domainHost)){try{components.host=punycode.toASCII(components.host.replace(protocol.PCT_ENCODED,pctDecChars).toLowerCase())}catch(e){components.error=components.error||"Host's domain name can not be converted to ASCII via punycode: "+e}}_normalizeComponentEncoding(components,URI_PROTOCOL)}else{_normalizeComponentEncoding(components,protocol)}if(schemeHandler&&schemeHandler.parse){schemeHandler.parse(components,options)}}else{components.error=components.error||"URI can not be parsed."}return components}function _recomposeAuthority(components,options){var protocol=options.iri!==false?IRI_PROTOCOL:URI_PROTOCOL;var uriTokens=[];if(components.userinfo!==undefined){uriTokens.push(components.userinfo);uriTokens.push("@")}if(components.host!==undefined){uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host),protocol),protocol).replace(protocol.IPV6ADDRESS,function(_,$1,$2){return"["+$1+($2?"%25"+$2:"")+"]"}))}if(typeof components.port==="number"||typeof components.port==="string"){uriTokens.push(":");uriTokens.push(String(components.port))}return uriTokens.length?uriTokens.join(""):undefined}var RDS1=/^\.\.?\//;var RDS2=/^\/\.(\/|$)/;var RDS3=/^\/\.\.(\/|$)/;var RDS5=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(input){var output=[];while(input.length){if(input.match(RDS1)){input=input.replace(RDS1,"")}else if(input.match(RDS2)){input=input.replace(RDS2,"/")}else if(input.match(RDS3)){input=input.replace(RDS3,"/");output.pop()}else if(input==="."||input===".."){input=""}else{var im=input.match(RDS5);if(im){var s=im[0];input=input.slice(s.length);output.push(s)}else{throw new Error("Unexpected dot segment condition")}}}return output.join("")}function serialize(components){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var protocol=options.iri?IRI_PROTOCOL:URI_PROTOCOL;var uriTokens=[];var schemeHandler=SCHEMES[(options.scheme||components.scheme||"").toLowerCase()];if(schemeHandler&&schemeHandler.serialize)schemeHandler.serialize(components,options);if(components.host){if(protocol.IPV6ADDRESS.test(components.host)){}else if(options.domainHost||schemeHandler&&schemeHandler.domainHost){try{components.host=!options.iri?punycode.toASCII(components.host.replace(protocol.PCT_ENCODED,pctDecChars).toLowerCase()):punycode.toUnicode(components.host)}catch(e){components.error=components.error||"Host's domain name can not be converted to "+(!options.iri?"ASCII":"Unicode")+" via punycode: "+e}}}_normalizeComponentEncoding(components,protocol);if(options.reference!=="suffix"&&components.scheme){uriTokens.push(components.scheme);uriTokens.push(":")}var authority=_recomposeAuthority(components,options);if(authority!==undefined){if(options.reference!=="suffix"){uriTokens.push("//")}uriTokens.push(authority);if(components.path&&components.path.charAt(0)!=="/"){uriTokens.push("/")}}if(components.path!==undefined){var s=components.path;if(!options.absolutePath&&(!schemeHandler||!schemeHandler.absolutePath)){s=removeDotSegments(s)}if(authority===undefined){s=s.replace(/^\/\//,"/%2F")}uriTokens.push(s)}if(components.query!==undefined){uriTokens.push("?");uriTokens.push(components.query)}if(components.fragment!==undefined){uriTokens.push("#");uriTokens.push(components.fragment)}return uriTokens.join("")}function resolveComponents(base,relative){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var skipNormalization=arguments[3];var target={};if(!skipNormalization){base=parse(serialize(base,options),options);relative=parse(serialize(relative,options),options)}options=options||{};if(!options.tolerant&&relative.scheme){target.scheme=relative.scheme;target.userinfo=relative.userinfo;target.host=relative.host;target.port=relative.port;target.path=removeDotSegments(relative.path||"");target.query=relative.query}else{if(relative.userinfo!==undefined||relative.host!==undefined||relative.port!==undefined){target.userinfo=relative.userinfo;target.host=relative.host;target.port=relative.port;target.path=removeDotSegments(relative.path||"");target.query=relative.query}else{if(!relative.path){target.path=base.path;if(relative.query!==undefined){target.query=relative.query}else{target.query=base.query}}else{if(relative.path.charAt(0)==="/"){target.path=removeDotSegments(relative.path)}else{if((base.userinfo!==undefined||base.host!==undefined||base.port!==undefined)&&!base.path){target.path="/"+relative.path}else if(!base.path){target.path=relative.path}else{target.path=base.path.slice(0,base.path.lastIndexOf("/")+1)+relative.path}target.path=removeDotSegments(target.path)}target.query=relative.query}target.userinfo=base.userinfo;target.host=base.host;target.port=base.port}target.scheme=base.scheme}target.fragment=relative.fragment;return target}function resolve(baseURI,relativeURI,options){var schemelessOptions=assign({scheme:"null"},options);return serialize(resolveComponents(parse(baseURI,schemelessOptions),parse(relativeURI,schemelessOptions),schemelessOptions,true),schemelessOptions)}function normalize(uri,options){if(typeof uri==="string"){uri=serialize(parse(uri,options),options)}else if(typeOf(uri)==="object"){uri=parse(serialize(uri,options),options)}return uri}function equal(uriA,uriB,options){if(typeof uriA==="string"){uriA=serialize(parse(uriA,options),options)}else if(typeOf(uriA)==="object"){uriA=serialize(uriA,options)}if(typeof uriB==="string"){uriB=serialize(parse(uriB,options),options)}else if(typeOf(uriB)==="object"){uriB=serialize(uriB,options)}return uriA===uriB}function escapeComponent(str,options){return str&&str.toString().replace(!options||!options.iri?URI_PROTOCOL.ESCAPE:IRI_PROTOCOL.ESCAPE,pctEncChar)}function unescapeComponent(str,options){return str&&str.toString().replace(!options||!options.iri?URI_PROTOCOL.PCT_ENCODED:IRI_PROTOCOL.PCT_ENCODED,pctDecChars)}var handler={scheme:"http",domainHost:true,parse:function parse(components,options){if(!components.host){components.error=components.error||"HTTP URIs must have a host."}return components},serialize:function serialize(components,options){var secure=String(components.scheme).toLowerCase()==="https";if(components.port===(secure?443:80)||components.port===""){components.port=undefined}if(!components.path){components.path="/"}return components}};var handler$1={scheme:"https",domainHost:handler.domainHost,parse:handler.parse,serialize:handler.serialize};function isSecure(wsComponents){return typeof wsComponents.secure==="boolean"?wsComponents.secure:String(wsComponents.scheme).toLowerCase()==="wss"}var handler$2={scheme:"ws",domainHost:true,parse:function parse(components,options){var wsComponents=components;wsComponents.secure=isSecure(wsComponents);wsComponents.resourceName=(wsComponents.path||"/")+(wsComponents.query?"?"+wsComponents.query:"");wsComponents.path=undefined;wsComponents.query=undefined;return wsComponents},serialize:function serialize(wsComponents,options){if(wsComponents.port===(isSecure(wsComponents)?443:80)||wsComponents.port===""){wsComponents.port=undefined}if(typeof wsComponents.secure==="boolean"){wsComponents.scheme=wsComponents.secure?"wss":"ws";wsComponents.secure=undefined}if(wsComponents.resourceName){var _wsComponents$resourc=wsComponents.resourceName.split("?"),_wsComponents$resourc2=slicedToArray(_wsComponents$resourc,2),path=_wsComponents$resourc2[0],query=_wsComponents$resourc2[1];wsComponents.path=path&&path!=="/"?path:undefined;wsComponents.query=query;wsComponents.resourceName=undefined}wsComponents.fragment=undefined;return wsComponents}};var handler$3={scheme:"wss",domainHost:handler$2.domainHost,parse:handler$2.parse,serialize:handler$2.serialize};var O={};var isIRI=true;var UNRESERVED$$="[A-Za-z0-9\\-\\.\\_\\~"+(isIRI?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]";var HEXDIG$$="[0-9A-Fa-f]";var PCT_ENCODED$=subexp(subexp("%[EFef]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%[89A-Fa-f]"+HEXDIG$$+"%"+HEXDIG$$+HEXDIG$$)+"|"+subexp("%"+HEXDIG$$+HEXDIG$$));var ATEXT$$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";var QTEXT$$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";var VCHAR$$=merge(QTEXT$$,"[\\\"\\\\]");var SOME_DELIMS$$="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";var UNRESERVED=new RegExp(UNRESERVED$$,"g");var PCT_ENCODED=new RegExp(PCT_ENCODED$,"g");var NOT_LOCAL_PART=new RegExp(merge("[^]",ATEXT$$,"[\\.]","[\\\"]",VCHAR$$),"g");var NOT_HFNAME=new RegExp(merge("[^]",UNRESERVED$$,SOME_DELIMS$$),"g");var NOT_HFVALUE=NOT_HFNAME;function decodeUnreserved(str){var decStr=pctDecChars(str);return!decStr.match(UNRESERVED)?str:decStr}var handler$4={scheme:"mailto",parse:function parse$$1(components,options){var mailtoComponents=components;var to=mailtoComponents.to=mailtoComponents.path?mailtoComponents.path.split(","):[];mailtoComponents.path=undefined;if(mailtoComponents.query){var unknownHeaders=false;var headers={};var hfields=mailtoComponents.query.split("&");for(var x=0,xl=hfields.length;x<xl;++x){var hfield=hfields[x].split("=");switch(hfield[0]){case"to":var toAddrs=hfield[1].split(",");for(var _x=0,_xl=toAddrs.length;_x<_xl;++_x){to.push(toAddrs[_x])}break;case"subject":mailtoComponents.subject=unescapeComponent(hfield[1],options);break;case"body":mailtoComponents.body=unescapeComponent(hfield[1],options);break;default:unknownHeaders=true;headers[unescapeComponent(hfield[0],options)]=unescapeComponent(hfield[1],options);break}}if(unknownHeaders)mailtoComponents.headers=headers}mailtoComponents.query=undefined;for(var _x2=0,_xl2=to.length;_x2<_xl2;++_x2){var addr=to[_x2].split("@");addr[0]=unescapeComponent(addr[0]);if(!options.unicodeSupport){try{addr[1]=punycode.toASCII(unescapeComponent(addr[1],options).toLowerCase())}catch(e){mailtoComponents.error=mailtoComponents.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}}else{addr[1]=unescapeComponent(addr[1],options).toLowerCase()}to[_x2]=addr.join("@")}return mailtoComponents},serialize:function serialize$$1(mailtoComponents,options){var components=mailtoComponents;var to=toArray(mailtoComponents.to);if(to){for(var x=0,xl=to.length;x<xl;++x){var toAddr=String(to[x]);var atIdx=toAddr.lastIndexOf("@");var localPart=toAddr.slice(0,atIdx).replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_LOCAL_PART,pctEncChar);var domain=toAddr.slice(atIdx+1);try{domain=!options.iri?punycode.toASCII(unescapeComponent(domain,options).toLowerCase()):punycode.toUnicode(domain)}catch(e){components.error=components.error||"Email address's domain name can not be converted to "+(!options.iri?"ASCII":"Unicode")+" via punycode: "+e}to[x]=localPart+"@"+domain}components.path=to.join(",")}var headers=mailtoComponents.headers=mailtoComponents.headers||{};if(mailtoComponents.subject)headers["subject"]=mailtoComponents.subject;if(mailtoComponents.body)headers["body"]=mailtoComponents.body;var fields=[];for(var name2 in headers){if(headers[name2]!==O[name2]){fields.push(name2.replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_HFNAME,pctEncChar)+"="+headers[name2].replace(PCT_ENCODED,decodeUnreserved).replace(PCT_ENCODED,toUpperCase).replace(NOT_HFVALUE,pctEncChar))}}if(fields.length){components.query=fields.join("&")}return components}};var URN_PARSE=/^([^\:]+)\:(.*)/;var handler$5={scheme:"urn",parse:function parse$$1(components,options){var matches=components.path&&components.path.match(URN_PARSE);var urnComponents=components;if(matches){var scheme=options.scheme||urnComponents.scheme||"urn";var nid=matches[1].toLowerCase();var nss=matches[2];var urnScheme=scheme+":"+(options.nid||nid);var schemeHandler=SCHEMES[urnScheme];urnComponents.nid=nid;urnComponents.nss=nss;urnComponents.path=undefined;if(schemeHandler){urnComponents=schemeHandler.parse(urnComponents,options)}}else{urnComponents.error=urnComponents.error||"URN can not be parsed."}return urnComponents},serialize:function serialize$$1(urnComponents,options){var scheme=options.scheme||urnComponents.scheme||"urn";var nid=urnComponents.nid;var urnScheme=scheme+":"+(options.nid||nid);var schemeHandler=SCHEMES[urnScheme];if(schemeHandler){urnComponents=schemeHandler.serialize(urnComponents,options)}var uriComponents=urnComponents;var nss=urnComponents.nss;uriComponents.path=(nid||options.nid)+":"+nss;return uriComponents}};var UUID=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;var handler$6={scheme:"urn:uuid",parse:function parse(urnComponents,options){var uuidComponents=urnComponents;uuidComponents.uuid=uuidComponents.nss;uuidComponents.nss=undefined;if(!options.tolerant&&(!uuidComponents.uuid||!uuidComponents.uuid.match(UUID))){uuidComponents.error=uuidComponents.error||"UUID is not valid."}return uuidComponents},serialize:function serialize(uuidComponents,options){var urnComponents=uuidComponents;urnComponents.nss=(uuidComponents.uuid||"").toLowerCase();return urnComponents}};SCHEMES[handler.scheme]=handler;SCHEMES[handler$1.scheme]=handler$1;SCHEMES[handler$2.scheme]=handler$2;SCHEMES[handler$3.scheme]=handler$3;SCHEMES[handler$4.scheme]=handler$4;SCHEMES[handler$5.scheme]=handler$5;SCHEMES[handler$6.scheme]=handler$6;exports2.SCHEMES=SCHEMES;exports2.pctEncChar=pctEncChar;exports2.pctDecChars=pctDecChars;exports2.parse=parse;exports2.removeDotSegments=removeDotSegments;exports2.serialize=serialize;exports2.resolveComponents=resolveComponents;exports2.resolve=resolve;exports2.normalize=normalize;exports2.equal=equal;exports2.escapeComponent=escapeComponent;exports2.unescapeComponent=unescapeComponent;Object.defineProperty(exports2,"__esModule",{value:true})})});var require_valid_url=__commonJS(function(exports,module){(function(module2){module2.exports.is_uri=is_iri;module2.exports.is_http_uri=is_http_iri;module2.exports.is_https_uri=is_https_iri;module2.exports.is_web_uri=is_web_iri;module2.exports.isUri=is_iri;module2.exports.isHttpUri=is_http_iri;module2.exports.isHttpsUri=is_https_iri;module2.exports.isWebUri=is_web_iri;var splitUri=function(uri){var splitted=uri.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return splitted};function is_iri(value){if(!value){return}if(/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(value))return;if(/%[^0-9a-f]/i.test(value))return;if(/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value))return;var splitted=[];var scheme="";var authority="";var path="";var query="";var fragment="";var out="";splitted=splitUri(value);scheme=splitted[1];authority=splitted[2];path=splitted[3];query=splitted[4];fragment=splitted[5];if(!(scheme&&scheme.length&&path.length>=0))return;if(authority&&authority.length){if(!(path.length===0||/^\//.test(path)))return}else{if(/^\/\//.test(path))return}if(!/^[a-z][a-z0-9\+\-\.]*$/.test(scheme.toLowerCase()))return;out+=scheme+":";if(authority&&authority.length){out+="//"+authority}out+=path;if(query&&query.length){out+="?"+query}if(fragment&&fragment.length){out+="#"+fragment}return out}function is_http_iri(value,allowHttps){if(!is_iri(value)){return}var splitted=[];var scheme="";var authority="";var path="";var port="";var query="";var fragment="";var out="";splitted=splitUri(value);scheme=splitted[1];authority=splitted[2];path=splitted[3];query=splitted[4];fragment=splitted[5];if(!scheme)return;if(allowHttps){if(scheme.toLowerCase()!="https")return}else{if(scheme.toLowerCase()!="http")return}if(!authority){return}if(/:(\d+)$/.test(authority)){port=authority.match(/:(\d+)$/)[0];authority=authority.replace(/:\d+$/,"")}out+=scheme+":";out+="//"+authority;if(port){out+=port}out+=path;if(query&&query.length){out+="?"+query}if(fragment&&fragment.length){out+="#"+fragment}return out}function is_https_iri(value){return is_http_iri(value,true)}function is_web_iri(value){return is_http_iri(value)||is_https_iri(value)}})(module)});var require_fast_deep_equal=__commonJS(function(exports,module){module.exports=function equal(a,b){if(a===b)return true;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;for(i=length;i--!==0;){var key=keys[i];if(!equal(a[key],b[key]))return false}return true}return a!==a&&b!==b}});var exports_dist={};__export(exports_dist,{addKeywords:()=>Fr,compileSchema:()=>Qi,draft04:()=>Yr,draft06:()=>oi,draft07:()=>di,draft2019:()=>Ei,draft2020:()=>Ji,draftEditor:()=>$i,extendDraft:()=>Pr,getSchemaType:()=>L,getTypeOf:()=>u,isAnnotation:()=>Ae,isBooleanSchema:()=>S,isJsonAnnotation:()=>je,isJsonError:()=>C,isJsonSchema:()=>x,isReduceable:()=>Se,isSchemaNode:()=>b2,mergeNode:()=>g,mergeSchema:()=>h,oneOfFuzzyKeyword:()=>pn,oneOfKeyword:()=>fn,propertyDependenciesKeyword:()=>ta,render:()=>me,sanitizeErrors:()=>s2,settings:()=>c2});function s2(e,t=[]){if(!Array.isArray(e))return e===undefined?[]:[e];for(let n of e)Array.isArray(n)?s2(n,t):(Ae(n)||n instanceof Promise)&&t.push(n);return t}function u(e){let t=l.call(e).slice(8,-1).toLowerCase();return t===`file`?`object`:t}function d(e){return u(e)===`object`}function f(e){let t=e===undefined?{}:{type:u(e)};return t.type===`object`&&d(e)&&(t.properties={},Object.keys(e).forEach((n)=>t.properties[n]=f(e[n]))),t.type===`array`&&Array.isArray(e)&&(e.length===1?t.items=f(e[0]):(t.items=e.map(f),t.items.find((e)=>e.type!==t.items[0].type)??(t.items=t.items[0]))),t}function ee(e,t){t!=null&&Object.values(t).forEach((t)=>p(t,e))}function te(e,t){t?.forEach((t)=>p(t,e))}function p(e,t=[]){return b2(e)?(t.push(e),ee(t,e.$defs),e.additionalProperties&&p(e.additionalProperties,t),te(t,e.allOf),te(t,e.anyOf),e.contains&&p(e.contains,t),ee(t,e.dependentSchemas),e.if&&p(e.if,t),e.else&&p(e.else,t),e.then&&p(e.then,t),e.items&&p(e.items,t),te(t,e.prefixItems),e.not&&p(e.not,t),te(t,e.oneOf),e.patternProperties&&Object.values(e.patternProperties).forEach(({node:e})=>p(e,t)),ee(t,e.properties),e.propertyNames&&p(e.propertyNames,t),e.unevaluatedProperties&&p(e.unevaluatedProperties,t),e.unevaluatedItems&&p(e.unevaluatedItems,t),t):t}function m(e,t){return t==null?e?.replace(re,``)??`#`:e==null||e===`#`?t?.replace(re,``):t[0]===`#`?e[0]===`/`?t:`${e.replace(ae,``)}${t.replace(ne,``)}`:ie.test(t)?t.replace(re,``):import_uri_js.resolve(e,t??``)??`#`}function h(e,t,...n){if(t?.type===`error`)return t;if(e?.type===`error`||u(e)!==u(t))return e;let r=oe(e,t);for(let e of n)delete r[e];return r}function oe(e,t,n){if(d(e)&&d(t)){let n={};return[...Object.keys(e),...Object.keys(t)].filter((e,t,n)=>n.indexOf(e)===t).forEach((r)=>n[r]=oe(e[r],t[r],r)),n}let r=Array.isArray(e),i=Array.isArray(t);if(r&&i){if(n===`required`||n===`anyOf`)return e.concat(t).filter((e,t,n)=>n.indexOf(e)===t);if(n===`items`||n===`prefixItems`){let n=[];for(let r=0;r<t.length;r+=1)d(e[r])&&d(t[r])&&e[r].type===t[r].type?n[r]=oe(e[r],t[r]):n.push(t[r]??e[r]);return n}let r=[],i=[];for(let n=0;n<Math.max(e.length,t.length);n+=1)d(e[n])&&d(t[n])?r[n]=oe(e[n],t[n]):e[n]!==undefined&&t[n]!==undefined?(r[n]=e[n],i.push(t[n])):e[n]===undefined?t[n]!==undefined&&i.push(t[n]):r[n]=e[n];return[...r,...i].filter((e,t,n)=>n.indexOf(e)===t)}if(n===`type`&&(r||i)){if(r&&e.includes(t))return t;if(i&&t.includes(e))return e;if(r)return[...e,t];if(i)return[...t,e]}return i?t:r||t===undefined?e:t}function se(e,t){return(t.order??0)-(e.order??0)}function ce(e,t,n){if(e==null||n.indexOf(e)!==t)return false;let r=e.toJSON?.()??e.name;return n.find((e,n)=>(e.toJSON?.()??e.name)===r&&n===t)}function le(e,t){if(e==null||t==null)return t||e;let n={};return[...Object.keys(e),...Object.keys(t)].filter((e,t,n)=>n.indexOf(e)===t).forEach((r)=>{let i=g(e[r],t[r]);b2(i)&&(n[r]=i)}),n}function ue(e,t){return e==null||t==null?t||e:e.concat(t).filter((e,t,n)=>n.indexOf(e)===t)}function de(e,t){if(e==null||t==null)return e||t;let n=[...e],r=e.map((e)=>e.node.evaluationPath);return t.forEach((e)=>{r.includes(e.node.evaluationPath)||n.push(e)}),n}function g(e,t,...n){if(e==null||t==null)return e||t;let r={};e.items&&t.prefixItems||e.prefixItems&&t.items?t.prefixItems?r.prefixItems=t.prefixItems:r.items=t.items:(r.prefixItems=t.prefixItems??e.prefixItems,r.items=g(e.items,t.items));let i={...e,...t,...r,dynamicId:we(e.dynamicId,t.dynamicId),oneOfIndex:e.oneOfIndex??t.oneOfIndex,schema:h(e.schema,t.schema,...n),parent:e.parent,resolvers:e.resolvers.concat(t.resolvers).filter(ce).sort(se),reducers:e.reducers.concat(t.reducers).filter(ce).sort(se),validators:e.validators.concat(t.validators).filter(ce).sort(se),additionalProperties:g(e.additionalProperties,t.additionalProperties),contains:g(e.contains,t.contains),enum:ue(e.enum,t.enum),if:g(e.if,t.if),then:g(e.then,t.then),else:g(e.else,t.else),not:g(e.not,t.not),propertyNames:g(e.propertyNames,t.propertyNames),unevaluatedProperties:g(e.unevaluatedProperties,t.unevaluatedProperties),unevaluatedItems:g(e.unevaluatedItems,t.unevaluatedItems),$defs:le(e.$defs,t.$defs),patternProperties:de(e.patternProperties,t.patternProperties),properties:le(e.properties,t.properties),required:ue(e.required,t.required)};function a(e){let t=e.toJSON?.()??e.name;return i.schema?.[t]===undefined?(i[t]=undefined,false):true}return n?.forEach((e)=>i[e]=undefined),i.resolvers=i.resolvers.filter(a),i.reducers=i.reducers.filter(a),i.validators=i.validators.filter(a),i}function fe(e,...t){let n={};return Object.keys(e).forEach((r)=>{t.includes(r)||(n[r]=e[r])}),n}function pe(e,...t){if(!d(e)||t.length===0)return e;let n={};return t.forEach((t)=>{e[t]!==undefined&&(n[t]=e[t])}),n}function me(e,t={}){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>{let r=t[n];return r==null?``:typeof r==`object`?JSON.stringify(r):String(r)})}function _2(e,t,n,r){if(C(e))return[e];r.push({pointer:n,node:e});let i=e.schema;if(i===true)return[];if(i===false)return[e.createError(`invalid-data-error`,{value:t,pointer:n,schema:e.schema})];let a=[];for(let i of e.validators){let o=i({node:e,data:t,pointer:n,path:r});Array.isArray(o)?a.push(...o):o&&a.push(o)}return s2(a)}function y2(e,t){if(d(e)&&v2(e,`${t}`)||Array.isArray(e))return e[t]}function ge(e,t,n={}){n.path=n.path??[],n.withSchemaWarning=n.withSchemaWarning??false,n.pointer=n.pointer??`#`;let i=this,a=o(e);if(a.length===0){let e=i.resolveRef(n);return C(e)?{node:undefined,error:e}:{node:e,error:undefined}}let o2=`#`,s=i;for(let e=0,r=a.length;e<r;e+=1){o2=`${o2}/${a[e]}`;let r=s.getNodeChild(a[e],t,{...n,pointer:o2});if(r.error||r.node==null)return r;s=r.node,t=y2(t,a[e])}let{node:c,error:l}=s.resolveRef(n).reduceNode(t);return C(l)?{node:undefined,error:l}:b2(c)?{node:c,error:undefined}:{error:undefined}}function _e(e,t,n={}){n.path=n.path??[],n.withSchemaWarning=n.withSchemaWarning??false,n.pointer=n.pointer??`#`;let{path:r,pointer:i}=n,a=this;if(a.reducers.length){let n=a.reduceNode(t,{key:e,path:r,pointer:i});if(n.error)return n;b2(n.node)&&(a=n.node)}for(let n of a.resolvers){let o=n({data:t,key:e,node:a});if(C(o))return{node:undefined,error:o};if(b2(o))return{node:o.resolveRef({pointer:i,path:r}),error:undefined}}return n.createSchema===true?{node:a.compileSchema(a.createSchema(y2(t,e)),`${a.evaluationPath}/additional`,`${a.schemaLocation}/additional`),error:undefined}:n.withSchemaWarning===true?{node:undefined,error:a.createError(`schema-warning`,{pointer:i,value:t,schema:a.schema,key:e})}:{node:undefined}}function b2(e){return d(e)&&Array.isArray(e?.reducers)&&Array.isArray(e?.resolvers)}function Se(e){for(let t=0,n=ve.length;t<n;t+=1)if(v2(e,ve[t]))return true;return false}function Ce(e,t){if(!Array.isArray(e)||e.length===0)throw Error(`Missing drafts in 'compileSchema({ $schema: "${t}" })'`);return e.length===1?e[0]:e.find((e)=>new RegExp(e.$schemaRegEx,ye).test(t))??e[e.length-1]}function we(e,t){return e==t?e??``:e==null||t==null?(e||t)??``:e.startsWith(t)?e:t.startsWith(e)?t:`${e}+${t}`}function Oe(e){if(e.schema.$ref&&De.includes(e.context.version))return e.context.keywords.filter(({keyword:e})=>Ee.includes(e)).map((t)=>ke(t,e));let t=Object.keys(e.schema),n=e.context.keywords.filter(({keyword:e})=>Ee.includes(e)||t.includes(e)).map((t)=>ke(t,e));return t.filter((t)=>!t.startsWith(`x-`)&&!xe.includes(t)&&e.context.keywords.find((e)=>e.keyword===t)==null).forEach((t)=>{n.push(e.createAnnotation(`unknown-keyword-warning`,{$id:e.$id,pointer:`${e.schemaLocation}/${t}`,schema:e.schema,value:t,draft:e.getDraftVersion()}))}),n}function ke(e,t){let n=e.parse?.(t);return e.reduce&&e.addReduce?.(t)&&t.reducers.push(e.reduce),e.resolve&&e.addResolve?.(t)&&t.resolvers.push(e.resolve),e.validate&&e.addValidate?.(t)&&t.validators.push(e.validate),n}function x(e){return d(e)}function S(e){return typeof e==`boolean`}function Ae(e){return d(e)&&(e?.type&&e?.code&&e?.data)!=null}function je(e){return d(e)&&e.type===`annotation`}function C(e){return d(e)&&e.type===`error`}function w(e){return typeof e==`number`}function Pe(e){if(Ne.includes(e))return[];if(e=e.replace(Me,``),e.indexOf(`#`)===-1)return[e.replace(/(#|\/)+$/g,``)];if(e.indexOf(`#`)===0)return[e.replace(Me,``)];let t=e.split(`#`);return t[0]=t[0].replace(/(#|\/)+$/g,``),t[1]=`#${t[1].replace(Me,``)}`,t}function Ie(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function Le(e){e.resolveRef=ze;let n=m(e.parent?.$id,e.schema?.$id);e.$id=n,e.lastIdPointer=e.parent?.lastIdPointer??`#`,n!==e.parent?.$id&&e.evaluationPath!==`#`&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)&&Ie(e,m(n,`#${e.evaluationPath.replace(e.lastIdPointer,``)}`)),Ie(e,m(e.context.rootNode.$id,e.evaluationPath));let r=e.schema.$anchor;if(r){let t=`${n.replace(/#$/,``)}#${r}`;e.context.anchors[t]??(e.context.anchors[t]=e)}let i=e.schema.$dynamicAnchor;if(i){let t=`${n.replace(/#$/,``)}#${i}`;e.context.dynamicAnchors[t]??(e.context.dynamicAnchors[t]=e)}if(e.schema.$ref&&(e.$ref=m(n,e.schema.$ref),e.$ref.startsWith(`/`)&&(e.$ref=`#${e.$ref}`)),e.$ref?.startsWith(`#/$defs/`)&&s(e.getNodeRoot().schema,e.$ref)==null)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/$ref`,schema:e.schema,value:e.schema.$ref,message:`Invalid $ref to missing target '${e.schema.ref}'`})}function Re({node:e,data:t,key:n,pointer:r,path:i}){if(e==null)return;let a=e.resolveRef({pointer:r,path:i});if(a==null)return e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$dynamicRef,pointer:r,schema:e.schema,value:t});if(a.schemaLocation===e.schemaLocation)return a;let{node:o,error:s}=g(e,a).reduceNode(t,{key:n,pointer:r,path:i});return o??s}function ze({pointer:e,path:t=[]}={}){if(this.schema.$dynamicRef){let n=Ve(this,t);return C(n)||t.push({pointer:e,node:n}),n}if(this.$ref==null)return this;let n=He(this);return b2(n)&&t.push({pointer:e,node:n}),n}function Be({node:e,data:t,pointer:n=`#`,path:r}){let i=e.resolveRef({pointer:n,path:r});return i==null?e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$dynamicRef,pointer:n,schema:e.schema,value:t}):_2(i,t,n,r)}function Ve(e,t){let n=t,r=m(e.$id,e.schema.$dynamicRef);if(e.context.dynamicAnchors[r]==null&&e.context.anchors[r])return T(e.context.anchors[r],e);for(let t of n){if(t.node.schema.$dynamicAnchor)return T(t.node,e);let n=e.schema.$dynamicRef.split(`#`).pop(),r=m(t.node.$id,`#${n}`);if(e.context.dynamicAnchors[r])return T(e.context.dynamicAnchors[r],e)}return He(e,r)}function T(e,t){let n=e.schema;return d(e.schema)&&(n={...fe(e.schema,`$id`),...pe(t.schema,...c2.PROPERTIES_TO_MERGE)}),e.compileSchema(n,`${t.evaluationPath}/$ref`,e.schemaLocation)}function He(e,n=e?.$ref){if(n==null)return e;if(e.context.refs[n])return T(e.context.refs[n],e);if(e.context.anchors[n])return T(e.context.anchors[n],e);if(e.context.dynamicAnchors[n])return T(e.context.dynamicAnchors[n],e);let i=Pe(n);if(i.length===0)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(i.length===1){let n=i[0];if(e.context.remotes[n])return T(e.context.remotes[n],e);if(n[0]===`#`){let r=e.context.rootNode.schema,i=s(r,n);if(i)return e.compileSchema(i,`${e.evaluationPath}/$ref`,n)}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(i.length===2){let t=i[0];if(e.context.remotes[t]&&e!==e.context.remotes[t]){let r=e.context.remotes[t],a=He(r,n);if(a||(a=He(r,i[1]),a))return a}if(e.context.refs[t]){let a=e.context.refs[t],o2=o(i[1]),s=a;for(let t of o2)if(s=s[t===`definitions`?`$defs`:t],s==null)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined,host:i[0],local:i[1]});return s}}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function E(e,...t){return t.reduce((e,t)=>(t.schemaValidation&&e.push(...t.schemaValidation),e),e)}function We(e){let t=[];return e.schema.$defs&&(d(e.schema.$defs)?(e.$defs=e.$defs??{},Object.keys(e.schema.$defs).forEach((n)=>{e.$defs[n]=e.compileSchema(e.schema.$defs[n],`${e.evaluationPath}/$defs/${Ge(n)}`,`${e.schemaLocation}/$defs/${n}`),E(t,e.$defs[n])})):t.push(e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:e.schema.$defs,message:`$defs must be an object - received: ${typeof e.schema.$defs}`}))),e.schema.definitions&&(d(e.schema.definitions)||t.push(e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:e.schema.$defs,message:`definitions must be an object - received: ${typeof e.schema.definitions}`})),e.$defs=e.$defs??{},Object.keys(e.schema.definitions).forEach((n)=>{e.$defs[n]=e.compileSchema(e.schema.definitions[n],`${e.evaluationPath}/definitions/${Ge(n)}`,`${e.schemaLocation}/definitions/${Ge(n)}`),E(t,e.$defs[n])})),t}function Ge(e){return e=e.replace(/~/g,`~0`),e=e.replace(/\//g,`~1`),encodeURIComponent(e)}function qe(e){let t=e.parent?.$id;if(e.schema?.$ref??(t=m(e.parent?.$id,e.schema?.$id)),e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,e.resolveRef=ze,e.context.refs[t]??(e.context.refs[t]=e),t!==e.parent?.$id&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)){let n=`#${e.evaluationPath.replace(e.lastIdPointer,``)}`;e.context.refs[m(t,n)]=e}else e.context.refs[m(t,e.evaluationPath)]=e;e.context.refs[m(e.context.rootNode.$id,e.evaluationPath)]=e,e.schema.$ref&&(e.$ref=m(t,e.schema.$ref))}function Je({node:e,data:t,pointer:n=`#`,path:r}){let i=Ye(e,n,r);return b2(i)?_2(i,t,n,r):e.createError(`ref-error`,{ref:e.schema.$ref,pointer:n,schema:e.schema,value:t})}function Ye(e,t,n){let r=e.resolveRef({pointer:t,path:n});return b2(r)?r!==e&&r?Ye(r,t,n):e:e.createError(`ref-error`,{ref:e.schema.$ref,pointer:t,schema:e.schema,value:undefined})}function Ze(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function Qe(e){let t=e.parent?.$id;if(e.schema?.$ref==null&&e.schema?.id&&(t=m(e.parent?.$id,e.schema.id)),e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,e.resolveRef=$e,e.context.refs[t]??(e.context.refs[t]=e),t!==e.parent?.$id&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)){let n=`#${e.evaluationPath.replace(e.lastIdPointer,``)}`;Ze(e,m(t,n))}else Ze(e,m(t,e.evaluationPath));Ze(e,m(e.context.rootNode.$id,e.evaluationPath)),e.schema.$ref&&(e.$ref=m(t,e.schema.$ref))}function $e({pointer:e,path:t}={}){if(this.$ref==null)return this;let n=tt(this);return b2(n)&&t?.push({pointer:e,node:n}),n}function et(e,t=e.evaluationPath){let n=d(e.schema)?fe(e.schema,`id`):e.schema;return e.compileSchema(n,`${t}/$ref`,n.schemaLocation)}function tt(e,t=e?.$ref){if(t==null)return e;if(e.context.refs[t])return et(e.context.refs[t],e.evaluationPath);if(e.context.anchors[t])return et(e.context.anchors[t],e.evaluationPath);let n=Pe(t);if(n.length===0)return e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(n.length===1){let t=n[0];return e.context.remotes[t]?et(e.context.remotes[t],e.evaluationPath):e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(n.length===2){let r=n[0];if(e.context.remotes[r]&&e!==e.context.remotes[r]){let i=e.context.remotes[r],a=tt(i,t);if(a||(a=tt(i,n[1]),a))return a}let i=n[0];if(e.context.refs[i]){let t=e.context.refs[i],r=n[1].split(`$defs/`).pop();if(r&&t?.$defs)return tt(t.$defs[r])}return}return e.createError(`ref-error`,{ref:t,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function it(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t.additionalItems==null||t.additionalItems===false)return;let i=t[nt];if(!(d(i)||i===true))return e.createError(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${nt}' must be an object or a boolean - received '${typeof i}'`});if(!Array.isArray(t.items))return e.createAnnotation(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${nt}' is only evaluated with a given items-array`});e.items=e.compileSchema(t.additionalItems,`${n}/additionalItems`,`${r}/additionalItems`)}function at({node:e,key:t,data:n}){if(Array.isArray(n)){let r=y2(n,t),{node:i,error:a}=e.items.reduceNode(r);return i??a}}function ot({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||Array.isArray(i.items)&&i.items.length>=t.length)return;let a=Array.isArray(i.items)?i.items.length:0,o=[];for(let s=a;s<t.length;s+=1){let a=t[s];if(e.items){let t=_2(e.items,a,`${n}/${s}`,r);t&&o.push(...t)}else i.additionalItems===false&&o.push(e.createError(`additional-items-error`,{key:s,pointer:`${n}/${s}`,value:t,schema:i}))}return o}function ct(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(!(t.additionalProperties==null||S(t.additionalProperties)))return d(t.additionalProperties)?(e.additionalProperties=e.compileSchema(t.additionalProperties,`${n}/additionalProperties`,`${r}/additionalProperties`),e.additionalProperties.schemaValidation):e.createError(`schema-error`,{pointer:e.schemaLocation,schema:t,value:t.additionalProperties,message:`keyword 'additionalProperties' must be a valid JSON Schema - receoved: ${typeof t.additionalProperties}`})}function lt({node:e,data:t,key:n}){let r=y2(t,n);if(e.additionalProperties){let{node:t,error:n}=e.additionalProperties.reduceNode(r);return t??n}if(e.schema.additionalProperties===false)return e.createError(`no-additional-properties-error`,{pointer:`${n}`,schema:e.schema,value:y2(t,n),property:`${n}`})}function ut({node:e,data:t,pointer:n=`#`,path:r}){if(!d(t))return;let{schema:i}=e,a=[],o=Object.keys(t).filter((e)=>c2.propertyBlacklist.includes(e)===false),s=e.patternProperties;Array.isArray(s)&&(o=o.filter((e)=>{for(let t of s)if(t.pattern.test(e))return false;return true}));let l=e.properties?Object.keys(e.properties):[];return o.filter((e)=>l.indexOf(e)===-1).forEach((o)=>{let s=y2(t,o);if(s!==undefined)if(d(e.additionalProperties)){let t=_2(e.additionalProperties,s,`${n}/${o}`,r);t&&a.push(...t)}else a.push(e.createError(`no-additional-properties-error`,{pointer:`${n}/${o}`,schema:i,value:t,property:o,properties:l}))}),a}function ft(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[D]!=null){if(!Array.isArray(t[D]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[D],message:`Keyword '${D}' must be an array - received '${typeof t[D]}'`});if(t[D].length!==0)return e[D]=t[D].map((t,i)=>e.compileSchema(t,`${n}/${D}/${i}`,`${r}/${D}/${i}`)),E([],...e[D])}}function pt({node:e,data:t,key:n,pointer:r,path:i}){if(e[D]==null)return;let a={},o=``;for(let s=0;s<e[D].length;s+=1){let{node:c}=e[D][s].reduceNode(t,{key:n,pointer:r,path:i});if(c){let t=c.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`${D}/${s}`:t;o+=`${o===``?``:`,`}${n}`;let r=h(e[D][s].schema,c.schema);a=h(a,r,D,`contains`)}}return e.compileSchema(a,`${e.evaluationPath}/${o}`,e.schemaLocation,`${e.schemaLocation}(${o})`)}function mt({node:e,data:t,pointer:n,path:r}){if(!Array.isArray(e[D])||e[D].length===0)return;let i=[];return e[D].forEach((e)=>{i.push(..._2(e,t,n,r))}),i}function gt(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[O]!=null){if(!Array.isArray(t[O]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[O],message:`Keyword '${O}' must be an array - received '${typeof t[O]}'`});if(t[O].length!==0)return e[O]=t[O].map((t,i)=>e.compileSchema(t,`${n}/${O}/${i}`,`${r}/${O}/${i}`)),E([],...e[O])}}function _t({node:e,data:t,pointer:n,path:r}){if(e[O]==null)return;let i={},a=``;for(let o=0;o<e[O].length;o+=1)if(_2(e[O][o],t,n,r).length===0){let{node:n}=e[O][o].reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``)??``,r=t===``?`${O}/${o}`:t;a+=`${a===``?``:`,`}${r}`;let s=h(e[O][o].schema,n.schema);i=h(i,s,O)}}return e.compileSchema(i,`${e.evaluationPath}${a}`,e.schemaLocation,`${e.schemaLocation}(${a})`)}function vt({node:e,data:t,pointer:n,path:r}){if(e[O]!=null){for(let i of e[O])if(_2(i,t,n,r).length===0)return;return e.createError(`any-of-error`,{pointer:n,schema:e.schema,value:t,anyOf:e.schema[O]})}}function bt(e){let t=e.schema[k];if(t!=null)return x(t)||S(t)?(e[k]=e.compileSchema(t,`${e.evaluationPath}/${k}`),e[k].schemaValidation):e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${k}`,schema:e.schema,value:t,message:`Keyword '${k}' must be a valid JSON Schema - received '${typeof t}'`})}function xt({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t))return;if(i.contains===false)return e.createError(`contains-array-error`,{pointer:n,value:t,schema:i});if(i.contains===true)return Array.isArray(t)&&t.length===0?e.createError(`contains-any-error`,{pointer:n,value:t,schema:i}):undefined;if(!d(i.contains)||!Array.isArray(t))return;let a=0;for(let i of t)_2(e.contains,i,n,r).length===0&&a++;let o=i.maxContains??1/0,s=i.minContains??1;if(!(o>=a&&s<=a))return o<a?e.createError(`contains-max-error`,{pointer:n,schema:i,delta:a-o,value:t}):s>a?e.createError(`contains-min-error`,{pointer:n,schema:i,delta:s-a,value:t}):e.createError(`contains-error`,{pointer:n,schema:i,value:t})}function St(e){return Array.isArray(e)&&e.find((e)=>typeof e!=`string`)==null}function wt(e){let{schema:t}=e;if(t[A]==null)return;if(!d(t[A]))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${A}`,schema:t,value:t[A],message:`Keyword '${A}' must be an object - received '${typeof t[A]}'`});let n=[];e.dependentRequired={};for(let r of Object.keys(t[A])){let i=t[A][r];St(i)?e.dependentRequired[r]=i:n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${A}/${r}`,schema:t,value:i,message:`Keyword '${A}[string]' must be a string[] - received '${typeof i}'`}))}return n}function Tt({node:e,data:t,pointer:n=`#`}){let{dependentRequired:r}=e;if(r==null||!d(t))return;let i=[];return Object.keys(t).forEach((a)=>{let o=r[a];if(Array.isArray(o))for(let r=0,a=o.length;r<a;r+=1)t[o[r]]===undefined&&i.push(e.createError(`missing-dependency-error`,{missingProperty:o[r],pointer:n,schema:e.schema,value:t}))}),i}function Dt(e){let{dependentSchemas:t}=e.schema;if(t==null)return;if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${j}`,schema:e.schema,value:t,message:`Keyword '${j}' must be an object - received '${typeof t}'`});if(Object.keys(t).length===0)return;let n=[],r={};for(let i of Object.keys(t)){let a=t[i];d(a)?(r[i]=e.compileSchema(a,`${e.evaluationPath}/${j}/${i}`,`${e.schemaLocation}/${j}/${i}`),E(n,r[i])):S(a)?r[i]=a:n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${j}/${i}`,schema:e.schema,value:a,message:`Keyword '${j}[string]' must be a valid JSON Schema'`}))}return e.dependentSchemas=r,n}function Ot({node:e,data:t}){let{dependentSchemas:n}=e;if(!d(t)||n==null)return e;let r,i=0,a=`${e.schemaLocation}(`;return Object.keys(t).forEach((e)=>{n[e]!=null&&(r??={properties:{}},b2(n[e])?r=h(r,n[e].schema):r.properties[e]=n[e],a+=`${i?`,`:``}${j}/${e}`,i++)}),r==null?e:(r=h(e.schema,r,j),e.compileSchema(r,e.evaluationPath,e.schemaLocation,`${a})`))}function kt({node:e,data:t,pointer:n,path:r}){let{schema:i,dependentSchemas:a}=e;if(!d(t)||a==null)return;let o=[];return Object.keys(t).forEach((c)=>{let l=a[c];if(l!==true){if(l===false){o.push(e.createError(`missing-dependency-error`,{pointer:n,schema:i,value:t}));return}if(b2(l)){s2(_2(l,t,n,r),o);return}}}),o}function jt(e){let{dependencies:t}=e.schema;if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${M}`,schema:e.schema,value:t,message:`Keyword '${M}' must be an object - received ${typeof t}`});let n=[];for(let r of Object.keys(t)){let i=t[r];x(i)||S(i)?(e.dependentSchemas=e.dependentSchemas??{},e.dependentSchemas[r]=e.compileSchema(i,`${e.evaluationPath}/${M}/${r}`,`${e.schemaLocation}/${M}/${r}`),E(n,e.dependentSchemas[r])):St(i)?(e.dependentRequired=e.dependentRequired??{},e.dependentRequired[r]=i):n.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${M}`,schema:e.schema,value:t,message:`Keyword '${M}[string]' must be JSON Schema or string[]`}))}return n}function Mt({node:e,data:t,key:n,pointer:r,path:i}){if(!d(t)||e.dependentRequired==null&&e.dependentSchemas==null)return e;let a=e.compileSchema(e.schema,e.evaluationPath,e.schemaLocation),o=a.schema.required??[],s=``,c=e.dependentRequired;c&&Object.keys(c).forEach((e)=>{if(!v2(t,e)&&!o.includes(e)||c[e]==null)return;o.push(...c[e]);let n=`${M}/${e}`;s+=`${s===``?``:`,`}${n}`});let l=e.dependentSchemas;return l&&Object.keys(l).forEach((c)=>{if(!v2(t,c)&&!o.includes(c))return true;let u2=l[c];if(!b2(u2))return true;Array.isArray(u2.schema.required)&&o.push(...u2.schema.required);let d={...u2,schema:{...u2.schema,required:o}}.reduceNode(t,{key:n,pointer:`${r}/${M}/${c}`,path:i}).node;a=g(a,d);let f=d.dynamicId?.replace(e.dynamicId,``)??``,ee=f===``?`${M}/${c}`:f;s+=`${s===``?``:`,`}${ee}`}),a===e?e:o.length===0?a:(o=a.schema.required?a.schema.required.concat(...o):o,o=o.filter((e,t,n)=>n.indexOf(e)===t),a=g(a,a,M),a.compileSchema({...a.schema,required:o},a.evaluationPath,a.schemaLocation,`${e.schemaLocation}(${s})`))}function Nt({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=[];return e.dependentRequired&&s2(Tt({node:e,data:t,pointer:n,path:r}),i),e.dependentSchemas&&s2(kt({node:e,data:t,pointer:n,path:r}),i),i}function Ft(e){let t=e.schema[N];if(t!=null){if(typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${N}`,schema:e.schema,value:t,message:`Keyword '${N}' must be a boolean - received '${typeof t}'`});e[N]=t}}function It({node:e,data:t,pointer:n}){return[e.createAnnotation(`deprecated-warning`,{pointer:n,schema:e.schema,value:t},e.schema.deprecatedMessage)]}function Rt(e){let{schema:t}=e;if(t[P]!=null){if(!Array.isArray(t[P]))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${P}`,schema:t,value:t[P],message:`Keyword '${P}' must be an array - received '${typeof t[P]}'`});e.enum=t[P]}}function zt({node:e,data:t,pointer:n=`#`}){if(e.enum==null)return;let r=u(t);if(r===`object`||r===`array`){let n=JSON.stringify(t);for(let t of e.enum)if(JSON.stringify(t)===n)return}else if(e.enum.includes(t))return;return e.createError(`enum-error`,{pointer:n,schema:e.schema,value:t,values:e.enum})}function Ht(e){let{exclusiveMaximum:t}=e.schema;if(t!=null&&typeof t!=`number`&&typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword 'exclusiveMaximum' must be a number - received '${typeof t}'`})}function Ut({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMaximum&&e.schema.maximum===t)return e.createError(`maximum-error`,{maximum:e.schema.exclusiveMaximum,length:t,pointer:n,schema:e.schema,value:t})}function Gt(e){let{exclusiveMinimum:t}=e.schema;if(t!=null&&typeof t!=`number`&&typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword 'exclusiveMinimum' must be a number - received '${typeof t}'`})}function Kt({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMinimum&&e.schema.minimum===t)return e.createError(`minimum-error`,{minimum:e.schema.exclusiveMinimum,length:t,pointer:n,schema:e.schema,value:t})}function Jt(e){let t=e.schema[F];if(t!=null){if(typeof t!=`string`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${F}`,schema:e.schema,value:t,message:`Keyword '${F}' must be a string - received '${typeof t}'`});if(e.context.formats[t]==null)return e.createAnnotation(`unknown-format-warning`,{pointer:`${e.schemaLocation}/${F}`,schema:e.schema,value:t,message:`Keyword '${F}' must be a string - received '${typeof t}'`})}}function Yt(e){let{node:t}=e,n=t.context.formats[t.schema.format];return n?.(e)}function on(e,t){if(e.oneOf)return e.oneOf.map((e)=>e.resolveRef());if(e.items?.oneOf)return e.items.oneOf.map((e)=>e.resolveRef());if(e.prefixItems&&e.prefixItems.length>+t){let{node:n,error:r}=e.getNodeChild(t);return n?[n]:r}if(e.schema.additionalItems){if(e.schema.additionalItems===true)return[e.compileSchema({type:`string`})];if(e.items)return[e.items.resolveRef()]}if(e.prefixItems&&e.prefixItems.length<=+t)return[];let{node:n,error:r}=e.getNodeChild(t);return n?[n]:r}function L(e,t){let n=u(t),r=e.schema;if(r===true)return n===`bigint`?`number`:sn.some((e)=>e===n)?n:undefined;if(!d(r))return;let i=r.type;if(Array.isArray(i)){if(i.includes(n))return n;let e=u(r.default);return i.includes(e)?e:i[0]}if(i)return i;if(Array.isArray(r.enum)){let e=r.enum.map((e)=>u(e)).filter((e,t,n)=>n.indexOf(e)===t);if(e.includes(n))return n;let t=u(r.default);return e.includes(t)?t:e[0]}let a=Object.keys(e.schema),o=a.filter((e)=>cn.includes(e)),s=a.filter((e)=>ln.includes(e));if(o.length>0&&o.length>s.length)return`object`;if(s.length>0&&s.length>o.length)return`array`;if(e.if)return L(e.if.resolveRef()??e.if,t);if(e.allOf)for(let n of e.allOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(e.oneOf)for(let n of e.oneOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(e.anyOf)for(let n of e.anyOf){let e=L(n.resolveRef()??n,t);if(e)return e}if(r.$ref){let n=e.resolveRef();if(n)return L(n,t)}}function un(e){switch(u(e)){case`string`:case`array`:return e?.length===0;case`null`:case`undefined`:return true;case`object`:return Object.keys(e).length===0;default:return false}}function mn(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t[R]!=null){if(!Array.isArray(t[R]))return e.createError(`schema-error`,{pointer:r,schema:t,value:t[R],message:`Keyword '${R}' must be an array - received '${typeof t[R]}'`});if(t[R].length!==0)return e[R]=t[R].map((t,i)=>e.compileSchema(t,`${n}/${R}/${i}`,`${r}/${R}/${i}`)),E([],...e[R])}}function hn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return;if(t!=null&&e.schema[dn])return gn({node:e,data:t,pointer:n,path:r});let i=[],a=[];for(let o=0;o<e.oneOf.length;o+=1){let s=_2(e.oneOf[o],t,n,r);s.length===0?i.push({index:o,node:e.oneOf[o]}):a.push(...s)}if(i.length===1){let{node:e,index:a}=i[0],{node:o,error:s}=e.reduceNode(t,{pointer:n,path:r});if(o){let t=o.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`oneOf/${a}`:t;return o.oneOfIndex=a,o.dynamicId=we(o.dynamicId,`+${e.schemaLocation}(${n})`),o}return s}return i.length,e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf,errors:a})}function gn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return;let i=e.schema[dn],a=y2(t,i);if(t===undefined||a===undefined)return e.createError(`missing-one-of-property-error`,{oneOfProperty:i,pointer:n,schema:e.schema,value:t});let o=[];for(let c=0;c<e.oneOf.length;c+=1){let{node:l}=e.oneOf[c].getNodeChild(i,t);if(!b2(l))return e.createError(`missing-one-of-declarator-error`,{declarator:dn,oneOfProperty:i,schemaLocation:e.oneOf[c].schemaLocation,pointer:`${n}/oneOf/${c}`,schema:e.schema,value:t});let u2=s2(_2(l,a,`${n}/${i}`,r));if(u2.length>0)o.push(...u2);else{let{node:i}=e.oneOf[c].reduceNode(t,{pointer:n,path:r});if(i)return i.oneOfIndex=c,i}}return e.createError(`one-of-property-error`,{property:i,value:t,pointer:n,schema:e.schema,errors:o})}function _n(e,t,n,r){if(t==null||e.properties==null)return-1;let i=0,a=Object.keys(e.properties??{});for(let o of a)t[o]&&_2(e.properties[o],t[o],n,r).length===0&&(i+=1);return i}function vn({node:e,data:t,pointer:n,path:r}){if(e.oneOf==null)return e;let i=hn({node:e,data:t,pointer:n,path:r});if(b2(i))return i;if(d(t)){let i,a=-1,o=0;for(let s=0;s<e.oneOf.length;s+=1){let c=e.oneOf[s],l=_n(c,t,n,r);o<l&&(o=l,i=c,a=s)}if(i===undefined)return e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf});let{node:s,error:c}=i.reduceNode(t,{pointer:n,path:r});return s?(s.oneOfIndex=a,s):c}else if(Array.isArray(t)){let i,a=-1,o=1/0;for(let n=0;n<e.oneOf.length;n+=1){let r=e.oneOf[n],{errors:s}=r.validate(t),c=s.length;c<o&&(o=c,i=r,a=n)}if(i===undefined)return e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:e.schema,oneOf:e.schema.oneOf});let{node:s,error:c}=i.reduceNode(t,{pointer:n,path:r});return s?(s.oneOfIndex=a,s):c}return i}function yn({node:e,data:t,pointer:n=`#`,path:r}){let{oneOf:i,schema:a}=e;if(!i)return;let o=a[dn],s=y2(t,o),c=[],l=[];for(let e of i){let{node:t,error:a}=e.getNodeChild(o,s);if(t){let a=_2(t,s,`${n}/${o}`,r);a.length>0?l.push(...a):c.push({index:i.indexOf(e),node:e})}else console.log(`jlib oneOf error: failed getting schema for '${o}' to resolve ${dn} in ${n}/oneOf/${i.indexOf(e)}`,a)}if(c.length===1){let e=c[0];return e.node.oneOfIndex=e.index,_2(e.node,t,n,r)}return c.length>1?e.createError(`multiple-one-of-error`,{value:t,pointer:n,schema:a,matches:c}):e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:a,oneOf:a.oneOf,errors:l})}function bn({node:e,data:t,pointer:n=`#`,path:r}){let{oneOf:i,schema:a}=e;if(!i)return;if(a[dn])return yn({node:e,data:t,pointer:n,path:r});let o=[],s=[];for(let e=0;e<i.length;e+=1){let a=_2(i[e],t,n,r);a.length>0?s.push(...a):o.push({index:e,node:i[e]})}if(o.length===1){let{node:e,index:t}=o[0];e.oneOfIndex=t;return}return o.length>1?e.createError(`multiple-one-of-error`,{value:t,pointer:n,schema:a,matches:o}):e.createError(`one-of-error`,{value:JSON.stringify(t),pointer:n,schema:a,oneOf:a.oneOf,errors:s})}function Sn(e,t){if(e.$ref==null)return;t.cache=t.cache??{};let{cache:n,recursionLimit:r=1}=t,i=e.schemaLocation;if(n[i]=n[i]??{},n[i][e.$ref]=n[i][e.$ref]??0,n[i][e.$ref]>=r&&t.disableRecursionLimit!==true)return false;t.disableRecursionLimit=false,n[i][e.$ref]+=1;let a=e.resolveRef();if(a&&a!==e)return a}function Cn(e,t){return(t.cache?.[e.schemaLocation]?.[e.$ref]??-1)<(t.recursionLimit??1)}function wn(e,t){let n=u(t);if(e===undefined||t==null||n===e||n===`number`&&e===`integer`)return t;if(e===`string`)return JSON.stringify(t);if(n!==`string`)return t;try{let n=JSON.parse(t);if(u(n)===e)return n}catch{}return t}function Tn(e,t,n){if(n?.cache==null)throw Error(`Missing options`);if(e.schema===false||e.schema===true||xn(t))return t;if(e.schema?.const!==undefined)return e.schema?.const;let r=e,i=t;if(Array.isArray(e.schema.enum)&&e.schema.enum.length>0&&t===undefined)return e.schema.default??e.schema.enum[0];if(e.schema.default!==undefined&&i===undefined&&(i=e.schema.default),r.allOf?.length&&r.allOf.forEach((e)=>{i=e.getData(i,n)??i}),r.anyOf&&r.anyOf?.length>0&&(i=r.anyOf[0].getData(i,n)??i),r.oneOf&&r.oneOf?.length>0)if(un(i))r=g(r,r.oneOf[0]);else{let e=vn({node:r,data:i,path:[],pointer:`#`});if(C(e)){if(i!=null&&n.removeInvalidData!==true)return i;r=r.oneOf[0],i=undefined}else r=g(r,e)}let a=Sn(r,n);if(a===false)return i;b2(a)&&(i=a.getData(i,n)??i,r=a);let o=L(r,i),s=En[o]?.(r,i,n);return s===undefined?i:s}function Dn({schema:e},t,n,r){return t===undefined?e.const?e.const:e.default===undefined&&Array.isArray(e.enum)?e.enum[0]:e.default===undefined&&r!==false?n:e.default:wn(e.type,t)}function kn({node:e,key:t}){if(e.prefixItems?.[t])return e.prefixItems[t];if(e.items)return e.items}function An(e){let{schema:t,evaluationPath:n}=e,r=t[z];if(r!=null&&typeof r!=`boolean`){if(d(r)){e.items=e.compileSchema(r,`${n}/${z}`,`${e.schemaLocation}/${z}`);return}if(Array.isArray(r)){e.prefixItems=r.map((t,r)=>e.compileSchema(t,`${n}/${z}/${r}`,`${e.schemaLocation}/${z}/${r}`));return}return e.createError(`schema-error`,{pointer:n,schema:t,value:undefined,message:`Keyword '${z}' must be an object or array - received '${typeof r}'`})}}function jn({node:e,data:t,pointer:n=`#`,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0)return;if(i.items===false)return Array.isArray(t)&&t.length===0?undefined:e.createError(`invalid-data-error`,{pointer:n,value:t,schema:i});let a=[];if(e.prefixItems){for(let i=0;i<Math.min(e.prefixItems.length,t.length);i+=1){let o=t[i],s=e.prefixItems[i],c=_2(s,o,`${n}/${i}`,r);a.push(...c)}return a}if(e.items){for(let i=0;i<t.length;i+=1){let o=t[i],s=_2(e.items,o,`${n}/${i}`,r);s&&a.push(...s)}return a}}function Nn(e){let t=e.schema[B];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${B}`,schema:e.schema,value:t,message:`Keyword '${B}' must be a number - received '${typeof t}'`});e[B]=t}}function Pn({node:e,data:t,pointer:n}){if(!w(t))return;let r=e[B],{schema:i}=e;if(r&&r<t)return e.createError(`maximum-error`,{maximum:r,length:t,value:t,pointer:n,schema:i});if(r&&i.exclusiveMaximum===true&&r===t)return e.createError(`maximum-error`,{maximum:r,length:t,pointer:n,schema:i,value:t})}function Ln(e){let t=e.schema[Fn];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Fn}`,schema:e.schema,value:t,message:`Keyword '${Fn}' must be a number - received '${typeof t}'`});e[Fn]=t}}function Rn({node:e,data:t,pointer:n}){let{schema:r}=e;if(Array.isArray(t)&&r.maxItems<t.length)return e.createError(`max-items-error`,{maximum:r.maxItems,length:t.length,schema:r,value:t,pointer:n})}function zn(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function Vn(e){let t=e.schema[V];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${V}`,schema:e.schema,value:t,message:`Keyword '${V}' must be a number - received '${typeof t}'`});e[V]=t}}function Hn({node:e,data:t,pointer:n=`#`}){if(typeof t!=`string`)return;let r=e[V],i=zn(t).length;if(r<i)return e.createError(`max-length-error`,{maxLength:r,length:i,pointer:n,schema:e.schema,value:t})}function Wn(e){let t=e.schema[H];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${H}`,schema:e.schema,value:t,message:`Keyword '${H}' must be a number - received '${typeof t}'`});e[H]=t}}function Gn({node:e,data:t,pointer:n=`#`}){if(!d(t))return;let r=e[H],i=Object.keys(t).length;if(r<i)return e.createError(`max-properties-error`,{maxProperties:r,length:i,pointer:n,schema:e.schema,value:t})}function qn(e){let t=e.schema[U];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${U}`,schema:e.schema,value:t,message:`Keyword '${U}' must be a number - received '${typeof t}'`});e[U]=t}}function Jn({node:e,data:t,pointer:n}){if(!w(t))return;let r=e[U];if(r>t||e.schema.exclusiveMinimum===true&&e.schema.minimum===t)return e.createError(`minimum-error`,{minimum:r,length:t,pointer:n,schema:e.schema,value:t})}function Xn(e){let t=e.schema[W];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${W}`,schema:e.schema,value:t,message:`Keyword '${W}' must be a number - received '${typeof t}'`});e[W]=t}}function Zn({node:e,data:t,pointer:n}){if(!Array.isArray(t))return;let r=e[W];if(r>t.length)return e.createError(`min-items-error`,{minItems:r,length:t.length,pointer:n,schema:e.schema,value:t})}function $n(e){let t=e.schema[G];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${G}`,schema:e.schema,value:t,message:`Keyword '${G}' must be a number - received '${typeof t}'`});e[G]=t}}function er({node:e,data:t,pointer:n=`#`}){if(typeof t!=`string`)return;let r=zn(t).length,i=e[G];if(!(i<=r))return e.createError(`min-length-error`,{minLength:i,length:r,pointer:n,schema:e.schema,value:t})}function nr(e){let t=e.schema[K];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${K}`,schema:e.schema,value:t,message:`Keyword '${K}' must be a number - received '${typeof t}'`});e[K]=t}}function rr({node:e,data:t,pointer:n=`#`}){if(!d(t))return;let r=Object.keys(t).length;if(e.schema.minProperties>r)return e.createError(`min-properties-error`,{minProperties:e.schema.minProperties,length:r,pointer:n,schema:e.schema,value:t})}function ir(e){let t=`${e}`;if(t.includes(`e-`))return parseInt(t.replace(/.*e-/,``));let n=t.indexOf(`.`);return n===-1?0:t.length-(n+1)}function or(e){let t=e.schema[q];if(t!=null){if(!w(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${q}`,schema:e.schema,value:t,message:`Keyword '${q}' must be a number - received '${typeof t}'`});e[q]=t}}function sr({node:e,data:t,pointer:n}){if(typeof t!=`number`)return;let r=e[q],i=ir(t),a=ir(r);if(i>a)return e.createError(`multiple-of-error`,{multipleOf:r,value:t,pointer:n,schema:e.schema});let o=10**a;if(Math.round(t*o)%Math.round(r*o)/o!==0)return e.createError(`multiple-of-error`,{multipleOf:r,value:t,pointer:n,schema:e.schema})}function lr(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e,i=t.not;if(i!=null)return!x(i)&&!S(i)?e.createError(`schema-error`,{pointer:`${r}/not`,schema:t,value:i,message:`Keyword 'not' must be a valid JSON Schema - received '${typeof i}'`}):(e.not=e.compileSchema(t.not,`${n}/not`,`${r}/not`),e.not.schemaValidation)}function ur({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(_2(e.not,t,n,r).length===0)return e.createError(`not-error`,{value:t,not:i.not,pointer:n,schema:i})}function mr(e){let t=e.schema[dr];if(t!=null){if(typeof t!=`string`)return e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:t,message:`Keyword 'pattern' must be a string - received '${typeof t}'`});try{e[dr]=new RegExp(t,e.schema.regexFlags??fr)}catch(n){return e.createError(`schema-error`,{pointer:e.schemaLocation,schema:e.schema,value:t,message:n.message})}}}function hr({node:e,data:t,pointer:n=`#`}){if(typeof t==`string`&&e.pattern.test(t)===false){let{schema:r}=e;return e.createError(`pattern-error`,{pattern:r.pattern,description:r.patternExample||r.pattern,received:t,schema:r,value:t,pointer:n})}}function vr(e){let{schema:t}=e;if(!d(t.patternProperties))return;let n=Object.keys(t.patternProperties);if(n.length!==0)return e.patternProperties=n.map((n)=>({name:n,pattern:new RegExp(n,t.regexFlags??gr),node:e.compileSchema(t.patternProperties[n],`${e.evaluationPath}/patternProperties/${n}`,`${e.schemaLocation}/patternProperties/${n}`)})),E([],...e.patternProperties.map(({node:e})=>e))}function yr({node:e,key:t}){return e.patternProperties?.find(({pattern:e})=>e.test(`${t}`))?.node}function br({node:e,data:t,key:n}){let{patternProperties:r}=e;if(r==null)return;let i,a=Object.keys(t??{});n&&a.push(`${n}`);let o=`${e.schemaLocation}(`;return a.push(...Object.keys(e.schema.properties??{})),a.forEach((t,n,a)=>{if(a.indexOf(t)!==n)return;let s=e.schema.properties?.[t]??{},c=r.filter((e)=>e.pattern.test(t));c.forEach((e)=>s=h(s,e.node.schema)),c.length>0&&(i??={properties:{}},i.properties[t]=s,o+=`${c.map(({name:e})=>`patternProperties/${e}`).join(`,`)}`)}),i==null?e:(i=h(e.schema,i,`patternProperties`),e.compileSchema(i,e.evaluationPath,e.schemaLocation,`${o})`))}function xr({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let{schema:i,patternProperties:a}=e,o=i.properties||{},s=Object.keys(i.patternProperties).join(`,`),c=[];return Object.keys(t).forEach((l)=>{let u2=y2(t,l),d=a.filter((e)=>e.pattern.test(l));d.forEach(({node:e})=>c.push(..._2(e,u2,`${n}/${l}`,r))),!o[l]&&d.length===0&&i.additionalProperties===false&&c.push(e.createError(`no-additional-properties-error`,{key:l,pointer:`${n}/${l}`,schema:i,value:u2,patterns:s}))}),c}function Cr({node:e,key:t}){return e.properties?.[t]}function wr(e){let{schema:t,evaluationPath:n,schemaLocation:r}=e;if(t.properties==null)return;if(t.properties&&!d(t.properties))return e.createError(`schema-error`,{pointer:r,schema:t,value:undefined,message:"keyword `properties` must be of type `object`"});let i=[],a={};return Object.keys(t.properties).forEach((o)=>{let s=e.compileSchema(t.properties[o],`${n}/properties/${o}`,`${r}/properties/${o}`);a[o]=s,E(i,a[o])}),e.properties=a,i}function Tr({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=[],a=e.properties??{};return Object.keys(t).forEach((e)=>{let o=y2(t,e),s=a[e];if(s==null||o===undefined)return;let c=_2(s,o,`${n}/${e}`,r);i.push(...c)}),i}function Dr(e){let t=e.schema[J];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${J}`,schema:e.schema,value:t,message:`Keyword '${J}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.propertyNames=e.compileSchema(t,`${e.evaluationPath}/propertyNames`,`${e.schemaLocation}/propertyNames`),e.propertyNames.schemaValidation}}function Or({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!d(t))return;if(i.propertyNames===false)return Object.keys(t).length===0?undefined:e.createError(`invalid-property-name-error`,{property:Object.keys(t),pointer:n,value:t,schema:i});if(i[J]===true)return;let a=e[J];if(!d(a))return;let o=[];return Object.keys(t).forEach((s)=>{let c=_2(a,s,`${n}/${s}`,r);c.length>0&&o.push(e.createError(`invalid-property-name-error`,{property:s,pointer:n,validationError:c[0],value:t[s],schema:i}))}),o}function jr(e){let t=e.schema[kr];if(t!=null){if(!St(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${kr}`,schema:e.schema,value:t,message:`Keyword '${kr}' must be a string[]`});e.required=t}}function Mr({node:e,data:t,pointer:n=`#`}){let{required:r}=e;if(d(t))return r.map((r)=>{if(!v2(t,r))return e.createError(`required-property-error`,{key:r,pointer:n,schema:e.schema,value:t})})}function Nr(e){return{...e,keywords:[...e.keywords.map((e)=>({...e}))]}}function Pr(e,t){let{keywords:n}=Fr(e,...t.keywords??[]),r={...e.errors,...t.errors??{}},i={...e.formats,...t.formats??{}};return Lr({...e,...t,formats:i,keywords:n,errors:r})}function Fr(e,...t){let n=Nr(e);return t.forEach((e)=>Ir(n,e)),n}function Ir(e,t){let n=e.keywords.findIndex((e)=>e.keyword===t.keyword);n===-1?e.keywords.push(t):e.keywords[n]=t}function Lr(e){return e.keywords?.forEach((e)=>{let t=()=>e.keyword;e.validate&&(e.validate.toJSON=t,e.validate.order=e.order??0),e.reduce&&(e.reduce.toJSON=t,e.reduce.order=e.order??0),e.resolve&&(e.resolve.toJSON=t,e.resolve.order=e.order??0)}),e.keywords?.sort((e,t)=>(t.order??0)-(e.order??0)),e}function Rr(e,t,n=`#`,r=[]){let i=e.resolveRef()??e;return r.push({node:i,value:t,pointer:n}),d(t)?Object.keys(t).forEach((e)=>{let{node:a}=i.getNodeChild(e,t);a&&Rr(a,y2(t,e),`${n}/${e}`,r)}):Array.isArray(t)&&t.forEach((e,a)=>{let{node:o}=i.getNodeChild(a,t);o&&Rr(o,y2(t,a),`${n}/${a}`,r)}),r}function Vr(e){let t=e.schema[Y];if(t!=null){if(typeof t!=`string`&&!Array.isArray(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}`,schema:e.schema,value:t,message:`Keyword '${Y}' must be a string or a string[] - received ${typeof t}`});if(typeof t==`string`&&!zr.includes(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}`,schema:e.schema,value:t,message:`Keyword '${Y}' is not a valid JSON Schema type - received '${t}'. Expected one of ${zr.join(`, `)}`});if(Array.isArray(t)){let n=t.findIndex((e)=>!zr.includes(e));if(n!==-1)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Y}/${n}`,schema:e.schema,value:t[n],message:`Keyword '${Y}' contains an invalid JSON Schema type: '${t[n]}'`})}e[Y]=t}}function Hr({node:e,pointer:t,data:n}){let r=Ur(n,e.type);if(r!==`undefined`&&Array.isArray(e.schema.type)&&e.schema.type.includes(r))return e.compileSchema({...e.schema,pointer:t,type:r},e.evaluationPath)}function Ur(e,t){let n=u(e);return n===`number`&&(t===`integer`||Array.isArray(t)&&t.includes(`integer`))?Number.isInteger(e)||isNaN(e)?`integer`:`number`:n}function Wr({node:e,data:t,pointer:n}){let r=e[Y],i=Ur(t,r);if(!(t===undefined||r===i||Array.isArray(r)&&r.includes(i)))return e.createError(`type-error`,{value:t,received:i,expected:r,schema:e.schema,pointer:n})}function qr(e){let t=e.schema[Gr];if(t!=null&&t!==false){if(typeof t!=`boolean`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Gr}`,schema:e.schema,value:t,message:`Keyword '${Gr}' must be a boolean - received ${typeof t}`});e.uniqueItems=true}}function Jr({node:e,data:t,pointer:n}){if(!Array.isArray(t))return;let{schema:r}=e,i=[],a=[];return t.forEach((s,c)=>{for(let l=c+1;l<t.length;l+=1)import_fast_deep_equal.default(s,t[l])&&!i.includes(l)&&(a.push(e.createError(`unique-items-error`,{pointer:`${n}/${l}`,duplicatePointer:`${n}/${c}`,arrayPointer:n,value:JSON.stringify(s),schema:r})),i.push(l))}),a}function Zr({node:e,data:t,pointer:n}){if(!import_fast_deep_equal.default(t,e.schema.const))return[e.createError(`const-error`,{pointer:n,schema:e.schema,value:t,expected:e.schema.const})]}function ei(e){let t=e.schema[Qr];if(t!=null&&typeof t!=`number`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Qr}`,schema:e.schema,value:t,message:`Keyword '${Qr}' must be a number - received '${typeof t}'`})}function ti({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMaximum<=t)return e.createError(`exclusive-maximum-error`,{maximum:e.schema.exclusiveMaximum,length:t,pointer:n,schema:e.schema,value:t})}function ii(e){let t=e.schema[ni];if(t!=null&&typeof t!=`number`)return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${ni}`,schema:e.schema,value:t,message:`Keyword '${ni}' must be a number - received '${typeof t}'`})}function ai({node:e,data:t,pointer:n}){if(typeof t==`number`&&e.schema.exclusiveMinimum>=t)return e.createError(`exclusive-minimum-error`,{minimum:e.schema.exclusiveMinimum,length:t,pointer:n,schema:e.schema,value:t})}function ci(e){let{schema:t,evaluationPath:n}=e,r=[];return t.if!=null&&(x(t.if)||S(t.if)?(e.if=e.compileSchema(t.if,`${n}/if`),E(r,e.if)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/if`,schema:e.schema,value:t.if,message:`Keyword 'if' must be valid JSON Schema - received '${typeof t.if}'`}))),t.then!=null&&(x(t.then)||S(t.then)?(e.then=e.compileSchema(t.then,`${n}/then`),E(r,e.then)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/then`,schema:e.schema,value:t.then,message:`Keyword 'then' must be valid JSON Schema - received '${typeof t.then}'`}))),t.else!=null&&(x(t.else)||S(t.else)?(e.else=e.compileSchema(t.else,`${n}/else`),E(r,e.else)):r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/else`,schema:e.schema,value:t.else,message:`Keyword 'else' must be valid JSON Schema - received '${typeof t.else}'`}))),r}function li({node:e,data:t,pointer:n,path:r}){if(t!==undefined&&e.if!=null){if(_2(e.if,t,n,[...r??[]]).length===0){if(e.then){let{node:n}=e.then.reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``).replace(/^#/,``)??``,r=t===``?`(then)`:t,i=h(e.then.schema,n.schema,`if`,`then`,`else`);return e.compileSchema(i,e.then.evaluationPath,e.schemaLocation,`${e.schemaLocation}${r}`)}}}else if(e.else){let{node:n}=e.else.reduceNode(t);if(n){let t=n.dynamicId?.replace(e.dynamicId,``)??``,r=t===``?`(else)`:t,i=h(e.else.schema,n.schema,`if`,`then`,`else`);return e.compileSchema(i,e.else.evaluationPath,e.schemaLocation,`${e.schemaLocation}${r}`)}}}}function ui({node:e,data:t,pointer:n,path:r}){if(e.if!=null){if(_2(e.if,t,n,[...r??[]]).length===0){if(e.then)return _2(e.then,t,n,r)}else if(e.else)return _2(e.else,t,n,r)}}function pi(e,t){e.context.refs[t]??(e.context.refs[t]=e)}function mi(e){e.resolveRef=hi;let t=m(e.parent?.$id,e.schema?.$id);e.$id=t,e.lastIdPointer=e.parent?.lastIdPointer??`#`,t!==e.parent?.$id&&e.evaluationPath!==`#`&&(e.lastIdPointer=e.evaluationPath),e.lastIdPointer!==`#`&&e.evaluationPath.startsWith(e.lastIdPointer)&&pi(e,m(t,`#${e.evaluationPath.replace(e.lastIdPointer,``)}`)),pi(e,m(e.context.rootNode.$id,e.evaluationPath)),e.schema.$anchor&&(e.context.anchors[`${t.replace(/#$/,``)}#${e.schema.$anchor}`]=e),e.schema.$ref&&(e.$ref=m(t,e.schema.$ref),e.$ref.startsWith(`/`)&&(e.$ref=`#${e.$ref}`))}function hi({pointer:e,path:t}={}){if(this.schema.$recursiveRef){let n=_i(this,t??[]);return b2(n)&&t?.push({pointer:e,node:n}),n}if(this.$ref==null)return this;let n=vi(this);return b2(n)&&t?.push({pointer:e,node:n}),n}function gi({node:e,data:t,pointer:n=`#`,path:r}){let i=e.resolveRef({pointer:n,path:r});return i==null?e.createError(`ref-error`,{ref:e.schema.$ref??e.schema.$recursiveRef,pointer:n,schema:e.schema,value:t}):_2(i,t,n,r)}function _i(e,t){let n=t,r=0;for(let t=n.length-1;t>=0;t--){if(n[t].node.schema.$recursiveAnchor===false)return vi(e,m(e.$id,e.schema.$recursiveRef));if(/^https?:\/\//.test(n[t].node.schema.$id??``)&&n[t].node.schema.$recursiveAnchor!==true){r=t;break}}let i=n.find((e,t)=>t>=r&&e.node.schema.$recursiveAnchor===true);return i?i.node:vi(e,m(e.$id,e.schema.$recursiveRef))}function vi(e,n=e?.$ref){if(n==null)return e;if(e.context.refs[n])return T(e.context.refs[n],e);if(e.context.anchors[n])return T(e.context.anchors[n],e);let i=Pe(n);if(i.length===0)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined});if(i.length===1){let n=i[0];if(e.context.remotes[n])return T(e.context.remotes[n],e);if(n[0]===`#`){let r=n.match(/#[^#]*$/)?.pop(),i=e.context.rootNode.schema,a=s(i,r);if(a)return e.compileSchema(a,`${e.evaluationPath}/$ref`,r)}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}if(i.length===2){let t=i[0];if(e.context.remotes[t]&&e!==e.context.remotes[t]){let r=e.context.remotes[t],a=vi(r,n);if(a||(a=vi(r,i[1]),a))return a}if(e.context.refs[t]){let a=e.context.refs[t],o2=o(i[1]),s=a;for(let t of o2)if(s=s[t===`definitions`?`$defs`:t],s==null)return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined,host:i[0],local:i[1]});return s}}return e.createError(`ref-error`,{ref:n,pointer:e.evaluationPath,schema:e.schema,value:undefined})}function xi(e){let{unevaluatedItems:t}=e.schema;if(t!=null&&typeof t!=`boolean`){if(!d(t))return e.createError(`schema-error`,{pointer:e.evaluationPath,schema:e.schema,value:undefined,message:`Keyword '${yi}' must be an object - received '${typeof t}'`});e.unevaluatedItems=e.compileSchema(e.schema.unevaluatedItems,`${e.evaluationPath}/${yi}`,`${e.schemaLocation}/${yi}`)}}function Si({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||i.unevaluatedItems==null||i.unevaluatedItems===true)return;let{node:a}=e.reduceNode(t,{pointer:n,path:r});if(a??=e,a.schema.unevaluatedItems===true||a.schema.additionalItems===true)return;let o=e.if!=null&&_2(e.if,t,n,r).length===0,s=[];for(let a=0;a<t.length;a+=1){let c=t[a],{node:l}=e.getNodeChild(a,t,{path:r});if(l&&_2(l,c,`${n}/${a}`,r).length>0){let o=e.unevaluatedItems;if(o&&t.forEach((e)=>{let t=_2(o,e,`${n}/${a}`,r);if(t!=null){if(Array.isArray(t))return s.push(...t);s.push(t)}}),e.schema.unevaluatedItems===false)return e.createError(`unevaluated-items-error`,{pointer:`${n}/${a}`,value:JSON.stringify(c),schema:i})}if(l===undefined&&!(o&&e.if.prefixItems&&e.if.prefixItems.length>a))if(e.unevaluatedItems){let t=_2(e.unevaluatedItems,c,`${n}/${a}`,r);t.length>0&&s.push(...t)}else s.push(e.createError(`unevaluated-items-error`,{pointer:`${n}/${a}`,value:JSON.stringify(c),schema:i}))}return s}function X({node:e,data:t,key:n,pointer:r,path:i}){if(Array.isArray(e.schema.required)&&!e.schema.required.find((e)=>v2(t,e)))return false;if(e.schema.unevaluatedProperties===true||e.schema.additionalProperties===true||e.properties?.[n]&&e.properties[n].validate(t[n],r,i).valid||e.patternProperties&&e.patternProperties.find((e)=>e.pattern.test(n)))return true;if(e.allOf){for(let a of e.allOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.anyOf){for(let a of e.anyOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.oneOf){for(let a of e.oneOf)if(X({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.if){if(X({node:e.if,data:t,key:n,pointer:r,path:i}))return true;let a=_2(e.if,t,r,i).length===0;if(a&&e.then){if(X({node:e.then,data:t,key:n,pointer:r,path:i}))return true}else if(!a&&e.else&&X({node:e.else,data:t,key:n,pointer:r,path:i}))return true}let a=e.resolveRef({pointer:r,path:i});return!!(a!==e&&X({node:a,data:t,key:n,pointer:r,path:i}))}function wi(e){let t=e.schema[Z];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Z}`,schema:e.schema,value:t,message:`Keyword '${Z}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.unevaluatedProperties=e.compileSchema(e.schema.unevaluatedProperties,`${e.evaluationPath}/${Z}`,`${e.schemaLocation}/${Z}`),e.unevaluatedProperties.schemaValidation}}function Ti({node:e,data:t,pointer:n,path:r}){if(!d(t))return;let i=Object.keys(t).filter((e)=>t[e]!==undefined);if(i.length===0)return;let a=[];for(let o of i){if(e.properties?.[o]||X({node:e,data:t,key:o,pointer:n,path:r}))continue;let{node:i}=e.getNodeChild(o,t,{pointer:n,path:r});if(i===undefined)if(e.unevaluatedProperties){let i=_2(e.unevaluatedProperties,t[o],`${n}/${o}`,r);a.push(...i)}else e.schema.unevaluatedProperties===false&&a.push(e.createError(`unevaluated-property-error`,{pointer:`${n}/${o}`,value:JSON.stringify(t[o]),schema:e.schema}));if(i&&_2(i,t[o],`${n}/${o}`,r).length>0)if(e.unevaluatedProperties){let i=_2(e.unevaluatedProperties,t[o],`${n}/${o}`,r);a.push(...i)}else e.schema.unevaluatedProperties===false&&a.push(e.createError(`unevaluated-property-error`,{pointer:`${n}/${o}`,value:JSON.stringify(t[o]),schema:e.schema}))}return a}function Di(e,t){if(e.items){let t=e.items.resolveRef();if(t?.oneOf)return t.oneOf.map((e)=>e.resolveRef())}if(e.oneOf)return e.oneOf.map((e)=>e.resolveRef());if(e.prefixItems&&e.prefixItems.length>+t){let{node:n,error:r}=e.getNodeChild(t);return b2(n)?[n]:r}if(e.schema.items===true)return[e.compileSchema({type:`string`})];if(e.schema.items===false)return[];if(e.items)return[e.items.resolveRef()];if(e.prefixItems&&e.prefixItems.length<=+t)return[];let{node:n,error:r}=e.getNodeChild(t);return r??[n]}function Oi(e,t){if(e.$ref==null)return;t.cache=t.cache??{};let{cache:n,recursionLimit:r=1}=t,i=e.schemaLocation;if(n[i]=n[i]??{},n[i][e.$ref]=n[i][e.$ref]??0,n[i][e.$ref]>=r&&t.disableRecursionLimit!==true)return false;t.disableRecursionLimit=false,n[i][e.$ref]+=1;let a=e.resolveRef();if(a&&a!==e)return a}function ki(e,t){return(t.cache?.[e.schemaLocation]?.[e.$ref]??-1)<(t.recursionLimit??1)}function Ai(e,t){let n=u(t);if(e===undefined||t==null||n===e||n===`number`&&e===`integer`)return t;if(e===`string`)return JSON.stringify(t);if(n!==`string`)return t;try{let n=JSON.parse(t);if(u(n)===e)return n}catch{}return t}function ji(e,t,n){if(n?.cache==null)throw Error(`Missing options`);if(e.schema===false||e.schema===true||xn(t))return t;if(e.schema?.const!==undefined)return e.schema?.const;let r=e,i=t;if(Array.isArray(e.schema.enum)&&e.schema.enum.length>0&&t===undefined)return e.schema.default??e.schema.enum[0];if(e.schema.default!==undefined&&i===undefined&&(i=e.schema.default),r.allOf?.length&&r.allOf.forEach((e)=>{i=e.getData(i,n)??i}),r.anyOf&&r.anyOf?.length>0&&(i=r.anyOf[0].getData(i,n)??i),r.oneOf&&r.oneOf?.length>0)if(un(i))r=g(r,r.oneOf[0]);else{let e=vn({node:r,data:i,path:[],pointer:`#`});if(C(e)){if(i!=null&&n.removeInvalidData!==true)return i;r=r.oneOf[0],i=undefined}else r=g(r,e)}let a=Oi(r,n);if(a===false)return i;b2(a)&&(i=a.getData(i,n)??i,r=a);let o=L(r,i),s=Mi[o]?.(r,i,n);return s===undefined?i:s}function Ni({schema:e},t,n,r){return t===undefined?e.const?e.const:e.default===undefined&&Array.isArray(e.enum)?e.enum[0]:e.default===undefined&&r!==false?n:e.default:Ai(e.type,t)}function Fi({node:e,key:t}){if(!(e.prefixItems&&e.prefixItems?.length>+t))return e.items}function Ii(e){let t=e.schema[Q];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Q}`,schema:e.schema,value:t,message:`Keyword '${Q}' must be a valid JSON Schema - received '${typeof t}'`});if(t!==true)return e[Q]=e.compileSchema(t,`${e.evaluationPath}/${Q}`,`${e.schemaLocation}/${Q}`),e[Q].schemaValidation}}function Li({node:e,data:t,pointer:n=`#`,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||Array.isArray(i.prefixItems)&&i.prefixItems.length>=t.length)return;if(i.items===false)return Array.isArray(t)&&t.length===0?undefined:e.createError(`invalid-data-error`,{pointer:n,value:t,schema:i});let a=[];if(e.items){for(let o=i.prefixItems?.length??0;o<t.length;o+=1){let i=t[o],s=_2(e.items,i,`${n}/${o}`,r);s&&a.push(...s)}return a}}function Bi({node:e,key:t}){if(e.prefixItems&&e.prefixItems[t])return e.prefixItems[t]}function Vi(e){let{schema:t,evaluationPath:n}=e;if(Array.isArray(t.prefixItems))return e.prefixItems=t.prefixItems.map((t,r)=>e.compileSchema(t,`${n}/${Ri}/${r}`,`${e.schemaLocation}/${Ri}/${r}`)),E([],...e.prefixItems)}function Hi({node:e,data:t,pointer:n=`#`,path:r}){if(!Array.isArray(t)||t.length===0)return;let i=[],a=e[Ri];if(a){for(let e=0;e<Math.min(a.length,t.length);e+=1){let o=t[e],s=a[e],c=_2(s,o,`${n}/${e}`,r);i.push(...c)}return i}}function Ui({node:e,data:t,key:n,pointer:r,path:i}){let a=y2(t,n);if(e.schema.unevaluatedItems===true||e.schema.items===true||e.contains&&_2(e.contains,a,`${r}/${n}`,i).length===0)return true;if(e.allOf){for(let a of e.allOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.anyOf){for(let a of e.anyOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.oneOf){for(let a of e.oneOf)if(Ui({node:a,data:t,key:n,pointer:r,path:i}))return true}if(e.if){if(Ui({node:e.if,data:t,key:n,pointer:r,path:i}))return true;let a=_2(e.if,t,r,i).length===0;if(a&&e.if.prefixItems&&e.if.prefixItems.length>n)return true;if(a&&e.then){if(Ui({node:e.then,data:t,key:n,pointer:r,path:i}))return true}else if(!a&&e.else&&Ui({node:e.else,data:t,key:n,pointer:r,path:i}))return true}}function Ki(e){let t=e.schema[Wi];if(t!=null){if(!(x(t)||S(t)))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${Wi}`,schema:e.schema,value:t,message:`Keyword '${Wi}' must be a valid JSON Schema - received '${typeof t}'`});if(!S(t))return e.unevaluatedItems=e.compileSchema(e.schema.unevaluatedItems,`${e.evaluationPath}/${Wi}`,`${e.schemaLocation}/${Wi}`),e.unevaluatedItems.schemaValidation}}function qi({node:e,data:t,pointer:n,path:r}){let{schema:i}=e;if(!Array.isArray(t)||t.length===0||i.unevaluatedItems==null||i.unevaluatedItems===true)return;let a=[];for(let o=0;o<t.length;o+=1){if(Ui({node:e,data:t,pointer:n,key:o,path:r}))continue;let s=t[o],{node:c}=e.getNodeChild(o,t,{path:r});if(c===undefined)if(e.unevaluatedItems){let t=_2(e.unevaluatedItems,s,`${n}/${o}`,r);t.length>0&&a.push(...t)}else a.push(e.createError(`unevaluated-items-error`,{pointer:`${n}/${o}`,value:JSON.stringify(s),schema:i}));if(c&&_2(c,s,`${n}/${o}`,r).length>0&&(e.unevaluatedItems&&e.unevaluatedItems.validate(s,`${n}/${o}`,r).valid===false||e.schema.unevaluatedItems===false))return e.createError(`unevaluated-items-error`,{pointer:`${n}/${o}`,value:JSON.stringify(s),schema:i})}return a}function Zi(e,t){return e.find((e)=>new RegExp(e.$schemaRegEx,Yi).test(t))??e[e.length-1]}function Qi(t,n={}){let r=n.remote;if(Array.isArray(n.remotes)&&n.remotes.length>0&&!n.remote){let e=[...n.remotes];e.forEach((e,t)=>{if(e.$id==null)throw Error(`required $id on remotes[${t}] is missing`)}),r=Qi(e.shift()),e.forEach((e)=>r?.addRemoteSchema(e.$id,e))}let i=n.formatAssertion??true,a=n.drafts??Xi,o=Zi(a,x(t)?n.draft??t.$schema:undefined),c={evaluationPath:`#`,lastIdPointer:`#`,schemaLocation:`#`,dynamicId:``,reducers:[],resolvers:[],validators:[],schema:t,context:{remotes:{},dynamicAnchors:{},...r?.context??{},anchors:{},refs:{},...copy(pe(o,`methods`,`keywords`,`version`,`formats`,`errors`)),draft:n.draft,getDataDefaultOptions:n.getDataDefaultOptions,throwOnInvalidRef:n.throwOnInvalidRef??false,drafts:a},...Te};if(c.context.rootNode=c,c.context.remotes[(x(t)?t.$id:undefined)??`#`]=c,r){let e=He(c,c.schema.$schema);if(b2(e)&&e.schema.$vocabulary){let t=Object.keys(e.schema.$vocabulary).find((e)=>e.includes(`vocab/format-assertion`));t&&i===`meta-schema`&&(i=e.schema.$vocabulary[t]===true);let n=Object.keys(e.getData({},{addOptionalProps:true}));n.length>0&&(c.context.keywords=c.context.keywords.filter((e)=>n.includes(e.keyword)))}}if(i===false&&(c.context.keywords=c.context.keywords.filter((e)=>e.keyword!==`format`)),!x(t)&&!S(t))return c.schemaErrors=[c.createError(`schema-error`,{pointer:`#`,schema:t,value:undefined,message:`JSON schema must be object or boolean - reveived: '${t}'`})],c;let l=Oe(c).filter((e)=>e!=null);l=s2(l);let u2=[],d=[];if(l.forEach((e)=>{C(e)?(e.data.schemaId=c.context.rootNode.$id??`#`,u2.push(e)):je(e)&&(e.data.schemaId=c.context.rootNode.$id??`#`,d.push(e))}),Array.isArray(r?.schemaErrors)&&u2.push(...r.schemaErrors),Array.isArray(r?.schemaAnnotations)&&d.push(...r.schemaAnnotations),n.throwOnInvalidSchema&&u2.length>0){let e=Error(`Invalid schema passed to compileSchema`);throw e.data=u2,e}return c.schemaErrors=u2,c.schemaAnnotations=d,c}function ea(e,t){let n=e[$14];if(n==null)return;let r=Object.keys(n),i=[];for(let e of r)if(v2(t,e)){let r=n[e],a=`${t[e]}`;v2(r,a)&&i.push({property:e,value:a,node:r[a]})}return i}function na(e){let t=e.schema[$14];if(!d(t))return e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}`,schema:e.schema,value:t,message:`Keyword '${$14}' must be an object - received '${typeof t}'`});let n=Object.create(null),r=[];return Object.keys(t).map((i)=>{let a=t[i];if(!d(a)){r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}/${i}`,schema:e.schema,value:t,message:`Keyword '${$14}[string]' must be an object - received '${typeof t}'`}));return}Object.keys(a).forEach((t)=>{let o=a[t];if(!(x(o)||S(o))){r.push(e.createError(`schema-error`,{pointer:`${e.schemaLocation}/${$14}/${i}/${t}`,schema:e.schema,value:o,message:`Keyword '${$14}[string][string]' must be a valid JSON Schema - received '${typeof o}'`}));return}n[i]=n[i]??Object.create(null),n[i][t]=e.compileSchema(o,`${e.evaluationPath}/${$14}/${i}/${t}`,`${e.schemaLocation}/${$14}/${i}/${t}`),E(r,n[i][t])})}),e[$14]=n,r}function ra({node:e,data:t,pointer:n=`#`,path:r}){if(!d(t))return;let i=ea(e,t);if(i==null||i.length===0)return;let a=[];for(let e of i){let i=_2(e.node,t,n,r);a.push(i)}return s2(a)}function ia({node:e,data:t,key:n,pointer:r,path:i}){if(!d(t))return;let a=ea(e,t);if(a==null||a.length===0)return;let o={},s=``;for(let c of a){let{node:a}=c.node.reduceNode(t,{key:n,pointer:r,path:i});if(a){let t=a.dynamicId?.replace(e.dynamicId,``)??``,n=t===``?`propertyDependencies/${c.property}/${c.value}`:t;s+=`${s===``?``:`,`}${n}`;let r=h(c.node.schema,a.schema);o=h(o,r,`propertyDependencies`)}}return e.compileSchema(o,`${e.evaluationPath}/${s}`,e.schemaLocation,`${e.schemaLocation}(${s})`)}var import_uri_js,import_valid_url,import_fast_deep_equal,c2,l,ne,re,ie,ae,he,v2=(e,t)=>!(e[t]===undefined||!he.call(e,t)),ve,ye,be,xe,Te,Ee,De,Me,Ne,Fe,Ue,Ke,Xe,nt=`additionalItems`,rt,st,D=`allOf`,dt,O=`anyOf`,ht,k=`contains`,yt,A=`dependentRequired`,Ct,j=`dependentSchemas`,Et,M=`dependencies`,At,N=`deprecated`,Pt,P=`enum`,Lt,Bt,Vt,Wt,F=`format`,qt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,I,sn,cn,ln,R=`oneOf`,dn,fn,pn,xn=()=>false,En,z=`items`,On,B=`maximum`,Mn,Fn=`maxItems`,In,V=`maxLength`,Bn,H=`maxProperties`,Un,U=`minimum`,Kn,W=`minItems`,Yn,G=`minLength`,Qn,K=`minProperties`,tr,q=`multipleOf`,ar,cr,dr=`pattern`,fr,pr,gr,_r,Sr,J=`propertyNames`,Er,kr=`required`,Ar,Y=`type`,zr,Br,Gr=`uniqueItems`,Kr,Yr,Xr,Qr=`exclusiveMaximum`,$r,ni=`exclusiveMinimum`,ri,oi,si,di,fi,yi=`unevaluatedItems`,bi,Z=`unevaluatedProperties`,Ci,Ei,Mi,Q=`items`,Pi,Ri=`prefixItems`,zi,Wi=`unevaluatedItems`,Gi,Ji,Yi,Xi,$i,$14=`propertyDependencies`,ta;var init_dist2=__esm(()=>{init_es();init_dist();import_uri_js=__toESM(require_uri_all(),1);import_valid_url=__toESM(require_valid_url(),1);import_fast_deep_equal=__toESM(require_fast_deep_equal(),1);c2={DECLARATOR_ONEOF:`oneOfProperty`,propertyBlacklist:[`_id`],DYNAMIC_PROPERTIES:[`$ref`,`$defs`,`if`,`then`,`else`,`allOf`,`anyOf`,`oneOf`,`dependentSchemas`,`dependentRequired`,`definitions`,`dependencies`,`patternProperties`,`propertyDependencies`],REGEX_FLAGS:`u`,VALID_ANNOTATION_KEYWORDS:[`$id`,`$schema`,`title`,`description`,`default`,`oneOfProperty`],PROPERTIES_TO_MERGE:[`title`,`description`,`default`,`options`,`x-options`,`readOnly`,`writeOnly`]};l=Object.prototype.toString;ne=/(#)+$/;re=/#$/;ie=/^[^:]+:\/\/[^/]+\//;ae=/#.*$/;he=Object.prototype.hasOwnProperty;({DYNAMIC_PROPERTIES:ve,REGEX_FLAGS:ye,DECLARATOR_ONEOF:be,VALID_ANNOTATION_KEYWORDS:xe}=c2);Te={compileSchema(e,t,r,i){let a=this;t??=a.evaluationPath;let o=t.split(`/$ref`)[0],c={lastIdPointer:a.lastIdPointer,context:a.context,parent:a,evaluationPath:t,dynamicId:we(a.dynamicId,i),schemaLocation:r??b(a.schemaLocation,o),reducers:[],resolvers:[],validators:[],schema:e,...Te};return!x(e)&&!S(e)?(c.schemaValidation=[c.createError(`schema-error`,{pointer:r??t,schema:e,value:undefined,message:`JSON schema must be object or boolean - reveived: '${e}'`})],c):(c.schemaValidation=s2(Oe(c).filter((e)=>e!=null)),c)},createError(e,t,n){let r=this,i=n;if(i===undefined){let n=r.schema?.errorMessages?.[e]??r.context.errors[e];if(typeof n==`function`)return n(t);i=me(n??name,t)}return{type:`error`,code:e,message:i,data:t}},createAnnotation(e,t,n){let r=this,i=n;if(i===undefined){let n=r.schema?.errorMessages?.[e]??r.context.errors[e];if(typeof n==`function`)return n(t);i=me(n??name,t)}return{type:`annotation`,code:e,message:i,data:t}},createSchema:f,getChildSelection(e){let t=this;return t.context.methods.getChildSelection(t,e)},getNode:ge,getNodeChild:_e,getNodeRef(e){return this.compileSchema({$ref:e},`$dynamic`).resolveRef()},getNodeRoot(){return this.context.rootNode},getDraftVersion(){return this.context.version},getData(e,t){let n=this,r={recursionLimit:1,...n.context.getDataDefaultOptions,cache:{},...t??{}};return n.context.methods.getData(n,e,r)},reduceNode(e,t={}){let n=this,{key:r=`missing-key`,pointer:i=n.evaluationPath,path:a}=t;if(n.schema===false)return{node:n,error:undefined};if(n.schema===true){let t=n.compileSchema(f(e),n.evaluationPath,n.schemaLocation);return a?.push({pointer:i,node:n}),{node:t,error:undefined}}let o,s=n.compileSchema(n.schema,n.evaluationPath,n.schemaLocation),c=n.reducers;for(let t of c){let c=t({data:e,key:r,node:n,pointer:i,path:a??[]});if(C(c))return{node:undefined,error:c};if(c){if(c.schema===false){o=false;break}s=g(s,c)}}return o===false?{node:{...n,schema:false,reducers:[]},error:undefined}:(s!==n&&a?.push({pointer:i,node:n}),s.schema=fe(s.schema,be,...ve),ve.forEach((e)=>s[e]=undefined),{node:s,error:undefined})},validate(e,t=`#`,n=[]){let r=this,i=_2(r,e,t,n)??[],a=[],o=[],c=s2(Array.isArray(i)?i:[i]).filter(C),l=[];return s2(Array.isArray(i)?i:[i]).forEach((e)=>{if(C(e)){if(r.context.throwOnInvalidRef&&e.code===`ref-error`){let t=Error(`Invalid $ref: `+e.message);throw t.data=a,t}a.push(e)}else e instanceof Promise?l.push(e.then(s2)):je(e)&&o.push(e)}),{valid:c.length===0,errors:a,annotations:o,errorsAsync:l}},addRemoteSchema(t,n){x(n)&&(n.$id=m(n.$id||t));let r=this,{context:i}=r,a=x(n)?r.context.draft??n.$schema:undefined,o=Ce(i.drafts,a??i.rootNode.schema?.$schema),c={evaluationPath:`#`,lastIdPointer:`#`,schemaLocation:`#`,dynamicId:``,reducers:[],resolvers:[],validators:[],schema:n,context:{...i,refs:{},anchors:{},...copy(pe(o,`methods`,`keywords`,`version`,`formats`,`errors`))},...Te};c.context.rootNode=c,c.context.remotes[m(t)]=c;let l=Oe(c).filter((e)=>e!=null);l=s2(l);let u2=[],d=[];return l.forEach((e)=>{C(e)?u2.push(e):je(e)&&d.push(e)}),r.schemaErrors=u2,r.schemaAnnotations=d,r},resolveRef(e){throw Error(`method 'resolveRef' is not implemented`)},toSchemaNodes(){return p(this)},toDataNodes(e,t){let n=this;return n.context.methods.toDataNodes(n,e,t)},toJSON(){let e=this;return{...e,context:undefined,errors:undefined,parent:e.parent?.evaluationPath}}};Ee=[`$ref`,`if`,`$defs`];De=[`draft-04`,`draft-06`,`draft-07`];Me=/(#)+$/g;Ne=[``,null,`#`];Fe={id:`$ref`,keyword:`$ref`,order:10,parse:Le,addReduce:(e)=>e.$ref!=null||e.schema.$dynamicRef!=null,reduce:Re,addValidate:({schema:e})=>e.$ref!=null||e.$dynamicRef!=null,validate:Be};Ue={id:`$defs`,keyword:`$defs`,parse:We};Ke={id:`$ref`,keyword:`$ref`,parse:qe,addValidate:({schema:e})=>e.$ref!=null,validate:Je};Xe={id:`$ref`,keyword:`$ref`,parse:Qe,addValidate:({schema:e})=>e.$ref!=null,validate:Ke.validate};rt={id:nt,keyword:nt,order:-10,parse:it,addResolve:(e)=>e.items!=null,resolve:at,addValidate:({schema:e})=>e[nt]!=null&&e[nt]!==true&&Array.isArray(e.items),validate:ot};st={id:`additionalProperties`,keyword:`additionalProperties`,order:-10,parse:ct,addResolve:({schema:e})=>e.additionalProperties!=null,resolve:lt,addValidate:({schema:e})=>e.additionalProperties!==true&&e.additionalProperties!=null&&!(e.additionalProperties===false&&d(e.patternProperties)),validate:ut};dt={id:D,keyword:D,parse:ft,addReduce:(e)=>e[D]!=null,reduce:pt,addValidate:(e)=>e[D]!=null,validate:mt};ht={id:O,keyword:O,parse:gt,addReduce:(e)=>e[O]!=null,reduce:_t,addValidate:(e)=>e[O]!=null,validate:vt};yt={id:k,keyword:k,parse:bt,addValidate:(e)=>e[k]!=null,validate:xt,addReduce:(e)=>e[k]!=null,reduce:({node:e})=>e.compileSchema({items:{anyOf:[e[k].schema]}},e.evaluationPath,e.schemaLocation)};Ct={id:A,keyword:A,parse:wt,addValidate:(e)=>e[A]!=null,validate:Tt};Et={id:j,keyword:j,parse:Dt,addReduce:(e)=>e.dependentSchemas!=null,reduce:Ot,addValidate:(e)=>e.dependentSchemas!=null,validate:kt};At={id:M,keyword:M,parse:jt,order:-9,addReduce:(e)=>e.schema[M]!=null,reduce:Mt,addValidate:(e)=>e.schema[M]!=null,validate:Nt};Pt={id:N,keyword:N,parse:Ft,addValidate:(e)=>e[N]===true,validate:It};Lt={id:P,keyword:P,parse:Rt,addValidate:(e)=>e.enum!=null,validate:zt};Bt={"additional-items-error":"Array at `{{pointer}}` may not have an additional item `{{key}}`","additional-properties-error":"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`","all-of-error":"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`","any-of-error":"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`","const-error":"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`","contains-any-error":"The array at `{{pointer}}` must contain at least one item","contains-array-error":"The property at `{{pointer}}` must not be an array","contains-error":"The array at `{{pointer}}` must contain an element that matches `{{schema}}`","contains-min-error":"The array at `{{pointer}}` contains {{delta}} too few items matching `{{schema}}`","contains-max-error":"The array at `{{pointer}}` contains {{delta}} too many items matching `{{schema}}`","enum-error":"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`","exclusive-maximum-error":"Value in `{{pointer}}` is `{{length}}`, but should be at most `{{maximum}}`","exclusive-minimum-error":"Value in `{{pointer}}` is `{{length}}`, but should be at minimum `{{minimum}}`","forbidden-property-error":"Property name `{{property}}` at `{{pointer}}` is not allowed","format-date-error":"Value `{{value}}` at `{{pointer}}` is not a valid date","format-date-time-error":"Value `{{value}}` at `{{pointer}}` is not a valid date-time","format-duration-error":"Value `{{value}}` at `{{pointer}}` is not a valid duration","format-email-error":"Value `{{value}}` at `{{pointer}}` is not a valid email","format-hostname-error":"Value `{{value}}` at `{{pointer}}` is not a valid hostname","format-idn-hostname-error":"Value `{{value}}` at `{{pointer}}` is not a valid idn hostname","format-ipv4-error":"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address","format-ipv4-leading-zero-error":`IPv4 addresses starting with zero are invalid, since they are interpreted as octals`,"format-ipv6-error":"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address","format-ipv6-leading-zero-error":`IPv6 addresses starting with zero are invalid, since they are interpreted as octals`,"format-iri-error":"Value `{{value}}` at `{{pointer}}` is not a valid iri","format-iri-reference-error":"Value `{{value}}` at `{{pointer}}` is not a valid iri-reference","format-json-pointer-error":"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer","format-regex-error":"Value `{{value}}` at `{{pointer}}` is not a valid regular expression","format-time-error":"Value `{{value}}` at `{{pointer}}` is not a valid time","format-uri-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri","format-uri-reference-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference","format-uri-template-error":"Value `{{value}}` at `{{pointer}}` is not a valid uri-template","format-url-error":"Value `{{value}}` at `{{pointer}}` is not a valid url","format-uuid-error":"Value `{{value}}` at `{{pointer}}` is not a valid uuid","invalid-data-error":"No value may be specified in `{{pointer}}`","invalid-property-name-error":"Invalid property name `{{property}}` at `{{pointer}}`","maximum-error":"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum","max-items-error":"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`","max-length-error":"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.","max-properties-error":"Too many properties in `{{pointer}}`, should be `{{maxProperties}}` at most, but got `{{length}}`","minimum-error":"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum","min-items-error":"Too few items in `{{pointer}}`, should be at least `{{minItems}}`, but got `{{length}}`","min-items-one-error":"At least one item is required in `{{pointer}}`","min-length-error":"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.","min-length-one-error":"A value is required in `{{pointer}}`","missing-one-of-declarator-error":"Missing oneOf declarator `{{declarator}}` in schema `{{schemaLocation}}`","min-properties-error":"Too few properties in `{{pointer}}`, should be at least `{{minProperties}}`, but got `{{length}}`","missing-array-item-error":`Array at '{{pointer}}' has a missing item at '{{key}}'`,"missing-dependency-error":"The required propery '{{missingProperty}}' in `{{pointer}}` is missing","missing-one-of-property-error":"Value at `{{pointer}}` must be object or array and have a property ${oneOfProperty}: ${value}","multiple-of-error":"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`","multiple-one-of-error":"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`","no-additional-properties-error":"Additional property `{{property}}` in `{{pointer}}` is not allowed","not-error":"Value `{{value}}` at pointer should not match schema `{{not}}`","one-of-error":"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema","one-of-property-error":"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`","pattern-error":"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`","pattern-properties-error":"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}","ref-error":`Could not resolve $ref '{{ref}}' from '{{pointer}}'`,"required-property-error":"The required property `{{key}}` is missing at `{{pointer}}`","schema-warning":`Failed retrieving a schema from '{{pointer}}' to key '{{key}}'`,"type-error":"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`","undefined-value-error":"Value must not be undefined in `{{pointer}}`","unevaluated-property-error":"Invalid unevaluated property `{{pointer}}`","unevaluated-items-error":"Invalid unevaluated item `{{pointer}}`","unique-items-error":"Items in array must be unique. Value `{{value}}` in `{{pointer}}` is a duplicate of {{duplicatePointer}}.","unknown-property-error":"Could not find a valid schema for property `{{pointer}}` within object","value-not-empty-error":"A value for `{{property}}` is required at `{{pointer}}`","deprecated-warning":"Value at `{{pointer}}` is deprecated","schema-error":`Invalid schema found at {{pointer}}: {{message}}`,"unknown-keyword-warning":`Keyword '{{value}}' is not a valid keyword to draft '{{draft}}'`,"unknown-format-warning":`Format {{value}} is not a valid format`};Vt={id:`exclusiveMaximum`,keyword:`exclusiveMaximum`,parse:Ht,addValidate:({schema:e})=>e.exclusiveMaximum===true||!isNaN(e.maximum),validate:Ut};Wt={id:`exclusiveMinimum`,keyword:`exclusiveMinimum`,parse:Gt,addValidate:({schema:e})=>e.exclusiveMinimum===true||!isNaN(e.minimum),validate:Kt};qt={id:F,keyword:F,parse:Jt,addValidate:({schema:e})=>e?.format!=null,validate:Yt};({REGEX_FLAGS:Xt}=c2);Zt=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;Qt=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;$t=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;en=/^(?<time>(?:([0-1]\d|2[0-3]):[0-5]\d:(?<second>[0-5]\d|60)))(?:\.\d+)?(?<offset>(?:z|[+-]([0-1]\d|2[0-3])(?::?[0-5]\d)?))$/i;tn=[0,31,28,31,30,31,30,31,31,30,31,30,31];nn=/^(?:\/(?:[^~/]|~0|~1)*)*$/;rn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;an=/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/;I={date:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.match($t);if(!i)return e.createError(`format-date-error`,{value:n,pointer:t,schema:r});let a=+i[1],o=+i[2],s=+i[3],c=a%4==0&&(a%100!=0||a%400==0);if(!(o>=1&&o<=12&&s>=1&&s<=(o==2&&c?29:tn[o])))return e.createError(`format-date-error`,{value:n,pointer:t,schema:r})},"date-time":({node:e,pointer:t,data:n,path:r})=>{let{schema:i}=e;if(typeof n!=`string`||n===``)return;let a=n.split(/t/i);if(a.length===2){let n=I.date({node:e,pointer:t,data:a[0],path:r})===undefined,i=I.time({node:e,pointer:t,data:a[1],path:r})===undefined;if(n&&i)return}return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:i})},duration:({node:e,pointer:t,data:n})=>{if(u(n)===`string`&&(!an.test(n)||/(\d+M)(\d+W)|(\d+Y)(\d+W)/.test(n)))return e.createError(`format-duration-error`,{value:n,pointer:t,schema:e.schema})},email:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.lastIndexOf(`@`),a=n.substr(0,i),o=n.substr(i+1);if(!a||!o||a.length>64||o.length>253)return e.createError(`format-email-error`,{value:n,pointer:t,schema:r});let s=a;if(/^".*"$/.test(a)&&(s=a.replace(/(^")|([. @]+)|("$)/g,``)),s[0]===`.`||s.endsWith(`.`)||s.includes(`..`)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(s))return e.createError(`format-email-error`,{value:n,pointer:t,schema:r});if(/^\[.*\]$/.test(o)){let e=o.substr(1,o.length-2);if(Zt.test(e)||Qt.test(e)||/IPv6:::[0-9a-f]{1,4}/.test(e))return}if(!/^[a-z0-9.-]+$/i.test(o)||!o.split(`.`).every((e)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e)))return e.createError(`format-email-error`,{value:n,pointer:t,schema:r})},"json-pointer":({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n==`string`&&n!==``&&!nn.test(n))return e.createError(`format-json-pointer-error`,{value:n,pointer:t,schema:r})},"relative-json-pointer":({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n==`string`&&!rn.test(n))return e.createError(`format-json-pointer-error`,{value:n,pointer:t,schema:r})},regex:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(!(typeof n==`object`||typeof n==`number`||Array.isArray(n)||u(n)===`boolean`)){if(typeof n==`string`&&/\\Z$/.test(n)===false){try{new RegExp(n,r.regexFlags??Xt);return}catch{}return e.createError(`format-regex-error`,{value:n,pointer:t,schema:r})}return e.createError(`format-regex-error`,{value:n,pointer:t,schema:r})}},time:({node:e,pointer:t,data:n})=>{let{schema:r}=e;if(typeof n!=`string`||n===``)return;let i=n.match(en);if(!i)return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:r});if(i.groups?.second===`60`){if(/23:59:60(z|\+00:00)/i.test(n))return;let a=i.groups.time.match(/(\d+):(\d+):/),o=i.groups.offset.match(/(\d+):(\d+)/);if(a&&o){let e=parseInt(a[1]),t=parseInt(o[1]),n=parseInt(a[2]),r=parseInt(o[2]),s;s=/^-/.test(i.groups.offset)?(e+t)*60+(n+r):(24+e-t)*60+(n-r);let c=Math.floor(s/60),l=c%24,u2=s-c*60;if(l===23&&u2===59)return}return e.createError(`format-date-time-error`,{value:n,pointer:t,schema:r})}},url:({node:e,data:t,pointer:n})=>{let{schema:r}=e;if(!(t===``||import_valid_url.isWebUri(`${t}`)))return e.createError(`format-url-error`,{value:t,pointer:n,schema:r})},uuid:({node:e,data:t,pointer:n})=>{let{schema:r}=e;if(typeof t==`string`&&t!==``&&!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))return e.createError(`format-uuid-error`,{value:t,pointer:n,schema:r})}};sn=[`string`,`number`,`integer`,`boolean`,`null`,`array`,`object`];cn=[`additionalProperties`,`dependencies`,`dependentSchemas`,`dependentRequired`,`maxProperties`,`minProperties`,`patternProperties`,`properties`,`propertyNames`,`required`,`unevaluatedProperties`];ln=[`contains`,`items`,`maxItems`,`minItems`,`unevaluatedItems`,`uniqueItems`];({DECLARATOR_ONEOF:dn}=c2);fn={id:R,keyword:R,parse:mn,addReduce:(e)=>e[R]!=null,reduce:hn,addValidate:(e)=>e[R]!=null,validate:bn};pn={id:`oneOf-fuzzy`,keyword:`oneOf`,parse:mn,addReduce:(e)=>e.oneOf!=null,reduce:vn,addValidate:(e)=>e.oneOf!=null,validate:bn};try{typeof File==`function`&&(xn=(e)=>e instanceof File)}catch{}En={null:(e,t,n)=>Dn(e,t,null,n.useTypeDefaults),string:(e,t,n)=>Dn(e,t,``,n.useTypeDefaults),number:(e,t,n)=>Dn(e,t,0,n.useTypeDefaults),integer:(e,t,n)=>Dn(e,t,0,n.useTypeDefaults),boolean:(e,t,n)=>Dn(e,t,false,n.useTypeDefaults),object:(e,t,n)=>{let r=e.schema,i=r.default===undefined?{}:r.default,a={},o=n.extendDefaults===false&&r.default!==undefined?[]:r.required??[],s=e.properties;s&&Object.keys(s).forEach((e)=>{let r=s[e],c=o.includes(e),l=y2(t,e),d=t===undefined||l===undefined?y2(i,e):l;if(d!==undefined||c||n.addOptionalProps){let t=r.getData(d,n),i=u(t);if(n.removeInvalidData&&i!==`object`&&i!==`array`&&!r.validate(t).valid)return;(t!==undefined||n.useTypeDefaults!==false)&&(a[e]=t)}});let c=e.dependentRequired;d(c)&&Object.keys(c).forEach((t)=>{let r=c[t];y2(a,t)!==undefined&&r.forEach((t)=>{let{node:r}=e.getNodeChild(t,a);r&&(a[t]=r.getData(y2(a,t),n))})});let l=e.dependentSchemas;if(l&&Object.keys(l).forEach((e)=>{let r=l[e];if(a[e]!==undefined&&b2(r)){let e=r.getData(t??a,n);Object.assign(a,e)}}),t)if(n.removeInvalidData===true&&(r.additionalProperties===false||d(r.additionalProperties))){let n=e.additionalProperties;b2(n)&&Object.keys(t).forEach((e)=>{if(a[e]==null){let r=y2(t,e);n.validate(r).valid&&(a[e]=r)}})}else Object.keys(t).forEach((r)=>{let i=u(r);if(n.removeInvalidData&&e.properties&&e.properties[r]&&i!==`object`&&i!==`array`){let i=e.properties[r],a=i.getData(y2(t,r),n);if(!i.validate(a).valid)return}a[r]??(a[r]=y2(t,r))});if(e.if){let{valid:t}=e.if.validate(a);if(t&&e.then){let t=e.then.getData(a,n);Object.assign(a,t)}else if(!t&&e.else){let t=e.else.getData(a,n);Object.assign(a,t)}}return{...i,...a}},array:(t,n,r)=>{let i=t.schema,a=i.default===undefined?[]:i.default,o=Array.isArray(n)?[...n]:a,s=r.extendDefaults===false&&i.default!==undefined?0:i.minItems??0;if(i.items==null){if(t.items){let e=Math.max(s,o.length);for(let n=0;n<e;n+=1)o[n]=t.items.getData(o[n],r)}return o||[]}if(t.prefixItems){let e=Array.isArray(n)?n:[],i=Math.max(s??0,t.prefixItems.length);for(let n=0;n<i;n+=1){let i=t.prefixItems[n]??t.items;if(i&&Cn(i,r)||e[n]!==undefined){let e=i.getData(o[n]==null?a[n]:o[n],r);e!==undefined&&(o[n]=e)}}return o||[]}if(t.items==null)return o;if(t.items&&Cn(t.items,r)||Array.isArray(n)&&n?.length>0){let n={...r.cache};for(let i=0,c=Math.max(s,o.length);i<c;i+=1){r.cache=copy(n);let s={...r,disableRecursionLimit:true},c=t.items.getData(o[i]==null?a[i]:o[i],s);if(c===undefined)return o;o[i]=c}}return o}};On={id:z,keyword:z,parse:An,addResolve:(e)=>(e.prefixItems||e[z])!=null,resolve:kn,addValidate:({schema:e})=>e.items!=null,validate:jn};Mn={id:B,keyword:B,parse:Nn,addValidate:(e)=>e.maximum!=null,validate:Pn};In={id:Fn,keyword:Fn,parse:Ln,addValidate:({schema:e})=>!isNaN(e.maxItems),validate:Rn};Bn={id:V,keyword:V,parse:Vn,addValidate:(e)=>e[V]!=null,validate:Hn};Un={id:H,keyword:H,parse:Wn,addValidate:(e)=>e[H]!=null,validate:Gn};Kn={id:U,keyword:U,parse:qn,addValidate:(e)=>e[U]!=null,validate:Jn};Yn={id:W,keyword:W,parse:Xn,addValidate:(e)=>e[W]!=null,validate:Zn};Qn={id:G,keyword:G,parse:$n,addValidate:(e)=>e[G]!=null,validate:er};tr={id:K,keyword:K,parse:nr,addValidate:(e)=>e[K]!=null,validate:rr};ar={id:q,keyword:q,parse:or,addValidate:(e)=>e[q]!=null,validate:sr};cr={id:`not`,keyword:`not`,parse:lr,addValidate:(e)=>e.not!=null,validate:ur};({REGEX_FLAGS:fr}=c2);pr={id:dr,keyword:dr,parse:mr,addValidate:(e)=>e[dr]!=null,validate:hr};({REGEX_FLAGS:gr}=c2);_r={id:`patternProperties`,keyword:`patternProperties`,parse:vr,addReduce:(e)=>e.patternProperties!=null,reduce:br,addResolve:(e)=>e.patternProperties!=null,resolve:yr,addValidate:(e)=>e.patternProperties!=null,validate:xr};Sr={id:`property`,keyword:`properties`,parse:wr,addResolve:(e)=>e.properties!=null,resolve:Cr,addValidate:(e)=>e.properties!=null,validate:Tr};Er={id:J,keyword:J,parse:Dr,addValidate:(e)=>e.schema[J]!=null,validate:Or};Ar={id:kr,keyword:kr,parse:jr,addValidate:(e)=>e.required!=null,validate:Mr};zr=[`null`,`boolean`,`number`,`integer`,`string`,`object`,`array`];Br={id:Y,keyword:Y,parse:Vr,addReduce:(e)=>Array.isArray(e.type),reduce:Hr,addValidate:(e)=>e.type!=null,validate:Wr};Kr={id:Gr,keyword:Gr,parse:qr,addValidate:({schema:e})=>e[Gr]===true,validate:Jr};Yr=Lr({version:`draft-04`,$schemaRegEx:`draft-?0?4`,$schema:`http://json-schema.org/draft-04/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Xe,dt,ht,yt,Ue,At,Pt,Lt,Vt,Wt,qt,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});Xr={id:`const`,keyword:`const`,addValidate:({schema:e})=>e.const!==undefined,validate:Zr};$r={id:Qr,keyword:Qr,parse:ei,addValidate:({schema:e})=>e.exclusiveMaximum!=null&&!isNaN(parseInt(e.exclusiveMaximum)),validate:ti};ri={id:ni,keyword:ni,parse:ii,addValidate:({schema:e})=>e[ni]!=null&&!isNaN(parseInt(e[ni])),validate:ai};oi=Lr({version:`draft-06`,$schemaRegEx:`draft-?0?6`,$schema:`http://json-schema.org/draft-06/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Ke,dt,ht,Xr,yt,Ue,At,Pt,Lt,$r,ri,qt,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});si={id:`if-then-else`,keyword:`if`,parse:ci,addReduce:(e)=>e.if!=null&&(e.then!=null||e.else!=null),reduce:li,addValidate:(e)=>e.if!=null,validate:ui};di=Lr({version:`draft-07`,$schemaRegEx:`draft-?0?7`,$schema:`http://json-schema.org/draft-07/schema#`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[Ke,dt,ht,Xr,yt,Ue,At,Pt,Lt,$r,ri,qt,si,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,Kr,fn,rt,st]});fi={id:`$ref`,keyword:`$ref`,parse:mi,addValidate:({schema:e})=>e.$ref!=null||e.$recursiveRef!=null,validate:gi,addReduce:({schema:e})=>e.$ref!=null||e.$recursiveRef!=null,reduce:Re};bi={id:yi,keyword:yi,parse:xi,addValidate:({schema:e})=>e[yi]!=null,validate:Si};Ci={id:Z,keyword:Z,parse:wi,addValidate:({schema:e})=>e[Z]!=null,validate:Ti};Ei=Lr({version:`draft-2019-09`,$schemaRegEx:`draft[/-]2019-?(09)?`,$schema:`https://json-schema.org/draft/2019-09/schema`,errors:Bt,formats:I,methods:{createSchema:f,getData:Tn,getChildSelection:on,toDataNodes:Rr},keywords:[fi,dt,ht,Xr,yt,Ue,At,Ct,Et,Pt,Lt,$r,ri,qt,si,On,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,_r,pr,Sr,Er,Ar,Br,bi,Ci,Kr,fn,rt,st]});Mi={null:(e,t,n)=>Ni(e,t,null,n.useTypeDefaults),string:(e,t,n)=>Ni(e,t,``,n.useTypeDefaults),number:(e,t,n)=>Ni(e,t,0,n.useTypeDefaults),integer:(e,t,n)=>Ni(e,t,0,n.useTypeDefaults),boolean:(e,t,n)=>Ni(e,t,false,n.useTypeDefaults),object:(e,t,n)=>{let r=e.schema,i=r.default===undefined?{}:r.default,a={},o=n.extendDefaults===false&&r.default!==undefined?[]:r.required??[],s=e.properties;s&&Object.keys(s).forEach((e)=>{let r=s[e],c=o.includes(e),l=y2(t,e),d=t===undefined||l===undefined?y2(i,e):l;if(d!==undefined||c||n.addOptionalProps){let t=r.getData(d,n),i=u(t);if(n.removeInvalidData&&i!==`object`&&i!==`array`&&!r.validate(t).valid)return;(t!==undefined||n.useTypeDefaults!==false)&&(a[e]=t)}});let c=e.dependentRequired;d(c)&&Object.keys(c).forEach((t)=>{let r=c[t];y2(a,t)!==undefined&&r.forEach((t)=>{let{node:r}=e.getNodeChild(t,a);r&&(a[t]=r.getData(y2(a,t),n))})});let l=e.dependentSchemas;if(l&&Object.keys(l).forEach((e)=>{let r=l[e];if(a[e]!==undefined&&b2(r)){let e=r.getData(t??a,n);Object.assign(a,e)}}),t&&(n.removeInvalidData===true&&(r.additionalProperties===false||d(r.additionalProperties))?b2(e.additionalProperties)&&Object.keys(t).forEach((n)=>{if(a[n]==null){let r=y2(t,n);e.additionalProperties?.validate(r).valid&&(a[n]=r)}}):Object.keys(t).forEach((r)=>{let i=u(r);if(n.removeInvalidData&&e.properties&&e.properties[r]&&i!==`object`&&i!==`array`){let i=e.properties[r],a=i.getData(y2(t,r),n);if(!i.validate(a).valid)return}a[r]??(a[r]=y2(t,r))})),e.if){let{errors:t}=e.if.validate(a);if(t.length===0&&e.then){let t=e.then.getData(a,n);Object.assign(a,t)}else if(t.length>0&&e.else){let t=e.else.getData(a,n);Object.assign(a,t)}}return{...i,...a}},array:(t,n,r)=>{let i=t.schema,a=i.default===undefined?[]:i.default,o=Array.isArray(n)?[...n]:a,s=r.extendDefaults===false&&i.default!==undefined?0:i.minItems??0;if(i.prefixItems==null){if(t.items&&(ki(t.items,r)||o?.length>0)){let n={...r.cache},i=Math.max(s,o.length);for(let s=0;s<i;s+=1){r.cache=copy(n);let i={...r,disableRecursionLimit:true};o[s]=t.items.getData(o[s]==null?a[s]:o[s],i)}}return o||[]}if(t.prefixItems){let e=Array.isArray(n)?n:[],i=Math.max(s??0,t.prefixItems.length);for(let n=0;n<i;n+=1){let i=t.prefixItems[n]??t.items;if(i&&ki(i,r)||e[n]!==undefined){let e=i.getData(o[n]==null?a[n]:o[n],r);e!==undefined&&(o[n]=e)}}return o||[]}if(t.items==null)return o;if(t.items&&ki(t.items,r)||n?.length>0){let n={...r.cache};for(let i=0,c=Math.max(s,o.length);i<c;i+=1){r.cache=copy(n);let s={...r,disableRecursionLimit:true},c=t.items.getData(o[i]==null?a[i]:o[i],s);if(c===undefined)return o;o[i]=c}}return o}};Pi={id:Q,keyword:Q,parse:Ii,addResolve:(e)=>e[Q]!=null,resolve:Fi,addValidate:(e)=>e[Q]!=null,validate:Li};zi={id:Ri,keyword:Ri,parse:Vi,addResolve:(e)=>e[Ri]!=null,resolve:Bi,addValidate:(e)=>e[Ri]!=null,validate:Hi};Gi={id:Wi,keyword:Wi,parse:Ki,addValidate:({schema:e})=>e.unevaluatedItems!=null,validate:qi};Ji=Lr({version:`draft-2020-12`,$schemaRegEx:`draft[/-]2020-?(12)?`,$schema:`https://json-schema.org/draft/2020-12/schema`,errors:Bt,formats:I,methods:{createSchema:f,getData:ji,getChildSelection:Di,toDataNodes:Rr},keywords:[Fe,st,dt,ht,Xr,yt,Ue,At,Ct,Et,Pt,Lt,$r,ri,qt,si,Pi,Mn,In,Bn,Un,Kn,Yn,Qn,tr,ar,cr,fn,pr,_r,zi,Sr,Er,Ar,Br,Gi,Ci,Kr]});({REGEX_FLAGS:Yi}=c2);Xi=[Yr,oi,di,Ei,Ji];$i=Pr(Ji,{$schemaRegEx:`.`,keywords:[pn],errors:{"min-length-error":(e)=>e.minLength===1?{type:`error`,code:`min-length-one-error`,message:`An input is required`,data:e}:{type:`error`,code:`min-length-error`,message:me("Value in `{{pointer}}` is `{{length}}`, but should be `{{minLength}}` at minimum",e),data:e}}});ta={id:$14,keyword:$14,parse:na,addValidate:(e)=>e[$14]!=null,validate:ra,addReduce:(e)=>e[$14]!=null,reduce:ia}});import"@lostgradient/cinder/schema-form/styles";import"svelte/internal/disclose-version";import*as $17 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $16 from"svelte/internal/client";import{tick}from"svelte";function classNames(...parts){return parts.filter((part)=>typeof part==="string"&&part.length>0).join(" ")}import"svelte/internal/disclose-version";import*as $5 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $ from"svelte/internal/client";var root=$.from_html(`<span data-cinder-checkbox-indicator-shell=""><!> <span class="cinder-checkbox-field__indicator" aria-hidden="true"></span></span>`);function Checkbox_indicator_shell($$anchor,$$props){var span=root();var node=$.child(span);$.snippet(node,()=>$$props.control);$.next(2);$.reset(span);$.template_effect(()=>$.set_class(span,1,$.clsx(["cinder-checkbox-field__control",$$props.class])));$.append($$anchor,span)}function describeId(fieldId,hasDescription){return hasDescription?`${fieldId}-description`:undefined}function errorId(fieldId,hasError){return hasError?`${fieldId}-error`:undefined}function composeDescribedBy(...ids){const filtered=ids.flatMap((id)=>typeof id==="string"?id.trim().split(/\s+/).filter(Boolean):[]);const unique=Array.from(new Set(filtered));return unique.length>0?unique.join(" "):undefined}function ariaInvalid(hasError){return hasError?"true":undefined}function resolveFieldControl(input){const resolvedId=input.id??input.context?.controlId??input.generatedId;const defaultDescriptionId=describeId(resolvedId,input.hasDescription??false);const defaultErrorId=errorId(resolvedId,input.hasError??false);const ownDescriptionId=defaultDescriptionId&&defaultDescriptionId===input.context?.descriptionId&&input.localIdNamespace?`${resolvedId}-${input.localIdNamespace}-description`:defaultDescriptionId;const ownErrorId=defaultErrorId&&defaultErrorId===input.context?.errorId&&input.localIdNamespace?`${resolvedId}-${input.localIdNamespace}-error`:defaultErrorId;const descriptionId=ownDescriptionId??input.context?.descriptionId;const resolvedErrorId=ownErrorId??input.context?.errorId;const explicitInvalid=ariaInvalid(input.hasError??false);const consumerInvalid=input.consumerInvalid===true?"true":input.consumerInvalid===false?undefined:input.consumerInvalid??undefined;return{id:resolvedId,ownDescriptionId,ownErrorId,descriptionId,errorId:resolvedErrorId,describedBy:composeDescribedBy(ownDescriptionId,...input.additionalDescribedBy??[],ownErrorId,input.context?.describedBy,input.consumerDescribedBy),ariaInvalid:explicitInvalid??input.context?.invalid??consumerInvalid,required:input.required??input.context?.required??false,disabled:input.disabled??input.context?.disabled??false}}import{createContext}from"svelte";function optionalContext(getStrict){return()=>{try{return getStrict()}catch{return}}}var[getFormFieldContextStrict,setFormFieldContextRaw]=createContext();function setFormFieldContext(context){setFormFieldContextRaw(context)}var getFormFieldContext=optionalContext(getFormFieldContextStrict);var true_default=true;function devWarn(message,...args){if(!true_default)return;console.warn(message,...args)}function commitValue(proposed,onValueChangeRequest,setValue,onValueChange){const requested=onValueChangeRequest?.(proposed);const committed=requested===undefined?proposed:requested;setValue(committed);onValueChange?.(committed);return committed}import"@lostgradient/cinder/form-field/styles";import"svelte/internal/disclose-version";import*as $4 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $3 from"svelte/internal/client";import"svelte/internal/disclose-version";import*as $2 from"svelte/internal/client";function Form_field_provider($$anchor,$$props){$2.push($$props,true);const forwardedContext={get controlId(){return $$props.context.controlId},get labelId(){return $$props.context.labelId},get describedBy(){return $$props.context.describedBy},get descriptionId(){return $$props.context.descriptionId},get warningId(){return $$props.context.warningId},get managedId(){return $$props.context.managedId},get errorId(){return $$props.context.errorId},get invalid(){return $$props.context.invalid},get required(){return $$props.context.required},get disabled(){return $$props.context.disabled}};setFormFieldContext(forwardedContext);var fragment=$2.comment();var node=$2.first_child(fragment);$2.snippet(node,()=>$$props.children);$2.append($$anchor,fragment);$2.pop()}var rest_excludes=new Set(["$$slots","$$events","$$legacy","id","label","labelVisible","description","warning","error","managed","required","disabled","class","controlClass","labelClass","descriptionClass","warningClass","errorClass","descriptionId","errorId","controlLeading","controlTrailing","controlNativeDate","controlDisabled","controlInvalid","fullWidth","errorMountedOnDemand","control","before","after","message"]);var root2=$3.from_html(`<span class="cinder-_required-marker" aria-hidden="true">*</span>`);var root_1=$3.from_html(`<label> <!></label>`);var root_2=$3.from_html(`<div><!> <!> <!></div>`);var root_3=$3.from_html(`<p> </p>`);var root_4=$3.from_html(`<p class="cinder-form-field__managed"> </p>`);var root_5=$3.from_html(`<p aria-live="polite"> </p>`);var root_6=$3.from_html(`<div><!> <!> <!> <!> <!> <!> <!></div>`);function Form_field_frame($$anchor,$$props){$3.push($$props,true);let labelVisible=$3.prop($$props,"labelVisible",3,true),required=$3.prop($$props,"required",3,false),disabled=$3.prop($$props,"disabled",3,false),controlLeading=$3.prop($$props,"controlLeading",3,false),controlTrailing=$3.prop($$props,"controlTrailing",3,false),controlNativeDate=$3.prop($$props,"controlNativeDate",3,false),controlDisabled=$3.prop($$props,"controlDisabled",3,false),controlInvalid=$3.prop($$props,"controlInvalid",3,false),fullWidth=$3.prop($$props,"fullWidth",3,false),errorMountedOnDemand=$3.prop($$props,"errorMountedOnDemand",3,false),rest=$3.rest_props($$props,rest_excludes);const labelId=$3.derived(()=>$$props.label?`${$$props.id}-label`:undefined);const descriptionId=$3.derived(()=>$$props.descriptionId??describeId($$props.id,!!$$props.description));const warningId=$3.derived(()=>$$props.warning?`${$$props.id}-warning`:undefined);const managedId=$3.derived(()=>$$props.managed?`${$$props.id}-managed`:undefined);const errorId2=$3.derived(()=>$$props.errorId??errorId($$props.id,!!$$props.error));const describedBy=$3.derived(()=>composeDescribedBy($3.get(descriptionId),$3.get(warningId),$3.get(managedId),$3.get(errorId2)));const invalid=$3.derived(()=>ariaInvalid(!!$$props.error));const needsControlWrapper=$3.derived(()=>!!$$props.controlClass||!!$$props.before||!!$$props.after);const context={get controlId(){return $$props.id},get labelId(){return $3.get(labelId)},get describedBy(){return $3.get(describedBy)},get descriptionId(){return $3.get(descriptionId)},get warningId(){return $3.get(warningId)},get managedId(){return $3.get(managedId)},get errorId(){return $3.get(errorId2)},get invalid(){return $3.get(invalid)},get required(){return required()},get disabled(){return disabled()}};var div=root_6();$3.attribute_effect(div,($0)=>({...rest,class:$0,"data-cinder-full-width":fullWidth()?"":undefined,"data-cinder-managed":$$props.managed?"":undefined,"data-cinder-managed-by":$$props.managed?.by||undefined}),[()=>classNames("cinder-form-field",$$props.class)]);var node=$3.child(div);{var consequent_1=($$anchor)=>{var label_1=root_1();var text=$3.child(label_1);var node_1=$3.sibling(text);{var consequent=($$anchor)=>{var span=root2();$3.append($$anchor,span)};$3.if(node_1,($$render)=>{if(required())$$render(consequent)})}$3.reset(label_1);$3.template_effect(($0)=>{$3.set_attribute(label_1,"id",$3.get(labelId));$3.set_attribute(label_1,"for",$$props.id);$3.set_class(label_1,1,$0);$3.set_attribute(label_1,"data-disabled",disabled()||undefined);$3.set_text(text,`${$$props.label??""} `)},[()=>$3.clsx(classNames("cinder-form-field__label",$$props.labelClass,!labelVisible()&&"cinder-sr-only"))]);$3.append($$anchor,label_1)};$3.if(node,($$render)=>{if($$props.label)$$render(consequent_1)})}var node_2=$3.sibling(node,2);{var consequent_4=($$anchor)=>{var div_1=root_2();var node_3=$3.child(div_1);{var consequent_2=($$anchor)=>{var fragment=$3.comment();var node_4=$3.first_child(fragment);$3.snippet(node_4,()=>$$props.before);$3.append($$anchor,fragment)};$3.if(node_3,($$render)=>{if($$props.before)$$render(consequent_2)})}var node_5=$3.sibling(node_3,2);Form_field_provider(node_5,{get context(){return context},children:($$anchor,$$slotProps)=>{var fragment_1=$3.comment();var node_6=$3.first_child(fragment_1);$3.snippet(node_6,()=>$$props.control);$3.append($$anchor,fragment_1)},$$slots:{default:true}});var node_7=$3.sibling(node_5,2);{var consequent_3=($$anchor)=>{var fragment_2=$3.comment();var node_8=$3.first_child(fragment_2);$3.snippet(node_8,()=>$$props.after);$3.append($$anchor,fragment_2)};$3.if(node_7,($$render)=>{if($$props.after)$$render(consequent_3)})}$3.reset(div_1);$3.template_effect(($0)=>{$3.set_class(div_1,1,$0);$3.set_attribute(div_1,"data-cinder-full-width",fullWidth()?"":undefined);$3.set_attribute(div_1,"data-leading",controlLeading()?"":undefined);$3.set_attribute(div_1,"data-trailing",controlTrailing()?"":undefined);$3.set_attribute(div_1,"data-native-date",controlNativeDate()?"":undefined);$3.set_attribute(div_1,"data-disabled",controlDisabled()?"":undefined);$3.set_attribute(div_1,"data-invalid",controlInvalid()?"":undefined)},[()=>$3.clsx(classNames("cinder-form-field__control",$$props.controlClass))]);$3.append($$anchor,div_1)};var alternate=($$anchor)=>{Form_field_provider($$anchor,{get context(){return context},children:($$anchor,$$slotProps)=>{var fragment_4=$3.comment();var node_9=$3.first_child(fragment_4);$3.snippet(node_9,()=>$$props.control);$3.append($$anchor,fragment_4)},$$slots:{default:true}})};$3.if(node_2,($$render)=>{if($3.get(needsControlWrapper))$$render(consequent_4);else $$render(alternate,-1)})}var node_10=$3.sibling(node_2,2);{var consequent_5=($$anchor)=>{var p=root_3();var text_1=$3.only_child(p,true);$3.template_effect(($0)=>{$3.set_attribute(p,"id",$3.get(descriptionId));$3.set_class(p,1,$0);$3.set_text(text_1,$$props.description)},[()=>$3.clsx(classNames("cinder-form-field__description",$$props.descriptionClass))]);$3.append($$anchor,p)};$3.if(node_10,($$render)=>{if($$props.description)$$render(consequent_5)})}var node_11=$3.sibling(node_10,2);{var consequent_6=($$anchor)=>{var p_1=root_3();var text_2=$3.only_child(p_1,true);$3.template_effect(($0)=>{$3.set_attribute(p_1,"id",$3.get(warningId));$3.set_class(p_1,1,$0);$3.set_text(text_2,$$props.warning)},[()=>$3.clsx(classNames("cinder-form-field__warning",$$props.warningClass))]);$3.append($$anchor,p_1)};$3.if(node_11,($$render)=>{if($$props.warning)$$render(consequent_6)})}var node_12=$3.sibling(node_11,2);{var consequent_7=($$anchor)=>{var p_2=root_4();var text_3=$3.only_child(p_2);$3.template_effect(()=>{$3.set_attribute(p_2,"id",$3.get(managedId));$3.set_text(text_3,`${$$props.managed.by?`Managed by ${$$props.managed.by}`:"Managed by policy"}${$$props.managed.reason?`: ${$$props.managed.reason}`:""}`)});$3.append($$anchor,p_2)};$3.if(node_12,($$render)=>{if($$props.managed)$$render(consequent_7)})}var node_13=$3.sibling(node_12,2);{var consequent_8=($$anchor)=>{var fragment_5=$3.comment();var node_14=$3.first_child(fragment_5);$3.snippet(node_14,()=>$$props.message);$3.append($$anchor,fragment_5)};$3.if(node_13,($$render)=>{if($$props.message)$$render(consequent_8)})}var node_15=$3.sibling(node_13,2);{var consequent_9=($$anchor)=>{var p_3=root_5();var text_4=$3.only_child(p_3,true);$3.template_effect(($0)=>{$3.set_attribute(p_3,"id",$3.get(errorId2));$3.set_class(p_3,1,$0);$3.set_attribute(p_3,"data-cinder-error",$$props.error?"":undefined);$3.set_text(text_4,$$props.error??"")},[()=>$3.clsx(classNames("cinder-form-field__error",$$props.errorClass))]);$3.append($$anchor,p_3)};$3.if(node_15,($$render)=>{if($$props.error||!errorMountedOnDemand())$$render(consequent_9)})}$3.reset(div);$3.append($$anchor,div);$3.pop()}function Form_field($$anchor,$$props){$4.push($$props,true);let labelVisible=$4.prop($$props,"labelVisible",3,true),required=$4.prop($$props,"required",3,false),disabled=$4.prop($$props,"disabled",3,false);{let $0=$4.derived(()=>classNames($$props.class));Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get warning(){return $$props.warning},get error(){return $$props.error},get managed(){return $$props.managed},get required(){return required()},get disabled(){return disabled()},get class(){return $4.get($0)},get control(){return $$props.children}})}$4.pop()}var form_field_default=Form_field;var rest_excludes2=new Set(["$$slots","$$events","$$legacy","id","checked","onValueChangeRequest","onValueChange","indeterminate","label","description","error","disabled","required","class","aria-describedby","aria-invalid","onchange"]);var root3=$5.from_html(`<input/>`);var root_12=$5.from_html(`<div class="cinder-checkbox-row"><!></div>`);function Checkbox($$anchor,$$props){const generatedId=$5.props_id();$5.push($$props,true);const control=($$anchor)=>{var div=root_12();var node=$5.child(div);{const control=($$anchor)=>{var input=root3();$5.attribute_effect(input,($0)=>({id:$5.get(field).id,type:"checkbox",...rest,disabled:$5.get(field).disabled,required:$5.get(field).required,checked:checked(),onchange:handleChange,class:$0,"aria-invalid":$5.get(field).ariaInvalid,"aria-describedby":$5.get(field).describedBy}),[()=>classNames("cinder-checkbox",$$props.class)],undefined,undefined,undefined,true);$5.bind_this(input,($$value)=>$5.set(inputElement,$$value),()=>$5.get(inputElement));$5.append($$anchor,input)};Checkbox_indicator_shell(node,{control,$$slots:{control:true}})}$5.reset(div);$5.append($$anchor,div)};let checked=$5.prop($$props,"checked",15,false),indeterminate=$5.prop($$props,"indeterminate",11,false),rest=$5.rest_props($$props,rest_excludes2);const context=getFormFieldContext();const field=$5.derived(()=>resolveFieldControl({...$$props.id!==undefined?{id:$$props.id}:{},generatedId,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"checkbox",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],disabled:$$props.disabled,required:$$props.required??undefined}));const renderInlineLabel=$5.derived(()=>!!$$props.label&&(!context||!context.labelId));$5.user_effect(()=>{if(context&&$$props.id&&context.controlId!==$$props.id){devWarn(`[cinder/Checkbox] id mismatch: Checkbox id="${$$props.id}" but wrapping FormField expects controlId="${context.controlId}". Set the same id on both, or omit id on the Checkbox to inherit it.`)}});let inputElement=$5.state(undefined);$5.user_effect(()=>{if($5.get(inputElement)){$5.get(inputElement).indeterminate=indeterminate()&&!checked()}});let resetSyncTimeout;function syncCheckedAfterFormReset(){if(resetSyncTimeout!==undefined)clearTimeout(resetSyncTimeout);resetSyncTimeout=setTimeout(()=>{resetSyncTimeout=undefined;if(!$5.get(inputElement))return;checked($5.get(inputElement).checked);$5.get(inputElement).indeterminate=indeterminate()&&!$5.get(inputElement).checked},0)}$5.user_effect(()=>{const form=$5.get(inputElement)?.form;if(!form)return;form.addEventListener("reset",syncCheckedAfterFormReset);return()=>{form.removeEventListener("reset",syncCheckedAfterFormReset);if(resetSyncTimeout!==undefined){clearTimeout(resetSyncTimeout);resetSyncTimeout=undefined}}});function handleChange(event){const target=event.currentTarget;const rawChecked=target.checked;$$props.onchange?.(event);const committed=commitValue(rawChecked,$$props.onValueChangeRequest,(next)=>{checked(next)},$$props.onValueChange);target.checked=committed;target.indeterminate=indeterminate()&&!committed}var fragment=$5.comment();var node_1=$5.first_child(fragment);{var consequent_1=($$anchor)=>{var fragment_1=$5.comment();var node_2=$5.first_child(fragment_1);{var consequent=($$anchor)=>{{let $0=$5.derived(()=>$5.get(renderInlineLabel)?$$props.label:undefined);Form_field_frame($$anchor,{get id(){return $5.get(field).id},get label(){return $5.get($0)},get description(){return $$props.description},get error(){return $$props.error},get descriptionId(){return $5.get(field).ownDescriptionId},get errorId(){return $5.get(field).ownErrorId},get required(){return $5.get(field).required},get disabled(){return $5.get(field).disabled},class:"cinder-checkbox-field",get control(){return control}})}};var alternate=($$anchor)=>{control($$anchor)};$5.if(node_2,($$render)=>{if($5.get(renderInlineLabel)||$$props.description||$$props.error)$$render(consequent);else $$render(alternate,-1)})}$5.append($$anchor,fragment_1)};var alternate_1=($$anchor)=>{form_field_default($$anchor,{get id(){return $5.get(field).id},get label(){return $$props.label},get description(){return $$props.description},get error(){return $$props.error},get required(){return $5.get(field).required},get disabled(){return $5.get(field).disabled},class:"cinder-checkbox-field",children:($$anchor,$$slotProps)=>{control($$anchor)},$$slots:{default:true}})};$5.if(node_1,($$render)=>{if(context)$$render(consequent_1);else $$render(alternate_1,-1)})}$5.append($$anchor,fragment);$5.pop()}import"svelte/internal/disclose-version";import*as $6 from"svelte/internal/client";var calendarIcon=($$anchor)=>{var svg=root4();$6.append($$anchor,svg)};var rest_excludes3=new Set(["$$slots","$$events","$$legacy","id","value","onValueChangeRequest","onValueChange","label","labelVisible","description","error","disabled","required","type","variant","inputAttachment","groupClassName","class","leading","trailing","leadingInteractive","trailingInteractive","aria-describedby","aria-invalid","oninput"]);var root4=$6.from_svg(`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>`);var root_13=$6.from_html(`<input/>`);var root_22=$6.from_html(`<span><!></span>`);var root_32=$6.from_html(`<span class="cinder-input-group__trailing cinder-input-group__date-icon cinder-_truncate" aria-hidden="true"><!></span>`);function Input($$anchor,$$props){$6.push($$props,true);const inputElement=($$anchor)=>{var input=root_13();$6.attribute_effect(input,($0)=>({id:$$props.id,type:type(),...rest,disabled:$6.get(resolvedDisabled),required:$6.get(resolvedRequired),value:value(),oninput:handleInput,class:$0,"data-cinder-full-width":true,"data-cinder-variant":variant(),"data-cinder-native-date":$6.get(rendersNativeDateIcon)?"":undefined,"aria-invalid":$6.get(resolvedAriaInvalid),"aria-describedby":$6.get(describedBy)}),[()=>classNames("cinder-input",$$props.class)],undefined,undefined,undefined,true);$6.bind_this(input,($$value)=>$6.set(inputNode,$$value),()=>$6.get(inputNode));$6.attach(input,()=>$$props.inputAttachment);$6.append($$anchor,input)};const leadingAdornment=($$anchor)=>{var fragment=$6.comment();var node=$6.first_child(fragment);{var consequent=($$anchor)=>{var span=root_22();var node_1=$6.child(span);$6.snippet(node_1,()=>$$props.leading);$6.reset(span);$6.template_effect(($0)=>{$6.set_class(span,1,$0);$6.set_attribute(span,"aria-hidden",leadingInteractive()?undefined:"true")},[()=>$6.clsx(classNames("cinder-input-group__leading",!leadingInteractive()&&"cinder-_truncate"))]);$6.append($$anchor,span)};$6.if(node,($$render)=>{if($$props.leading)$$render(consequent)})}$6.append($$anchor,fragment)};const trailingAdornment=($$anchor)=>{var fragment_1=$6.comment();var node_2=$6.first_child(fragment_1);{var consequent_1=($$anchor)=>{var span_1=root_22();var node_3=$6.child(span_1);$6.snippet(node_3,()=>$$props.trailing);$6.reset(span_1);$6.template_effect(($0)=>{$6.set_class(span_1,1,$0);$6.set_attribute(span_1,"aria-hidden",trailingInteractive()?undefined:"true")},[()=>$6.clsx(classNames("cinder-input-group__trailing",!trailingInteractive()&&"cinder-_truncate"))]);$6.append($$anchor,span_1)};var consequent_2=($$anchor)=>{var span_2=root_32();var node_4=$6.child(span_2);calendarIcon(node_4);$6.reset(span_2);$6.append($$anchor,span_2)};$6.if(node_2,($$render)=>{if($$props.trailing)$$render(consequent_1);else if($6.get(rendersNativeDateIcon))$$render(consequent_2,1)})}$6.append($$anchor,fragment_1)};let value=$6.prop($$props,"value",15,""),labelVisible=$6.prop($$props,"labelVisible",3,true),type=$6.prop($$props,"type",3,"text"),variant=$6.prop($$props,"variant",3,"default"),leadingInteractive=$6.prop($$props,"leadingInteractive",3,false),trailingInteractive=$6.prop($$props,"trailingInteractive",3,false),rest=$6.rest_props($$props,rest_excludes3);const context=getFormFieldContext();$6.user_effect(()=>{if(context&&context.controlId!==$$props.id){devWarn(`[cinder/Input] id mismatch: Input id="${$$props.id}" but wrapping FormField expects controlId="${context.controlId}". Set the same id on both.`)}});const field=$6.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"input",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],required:$$props.required,disabled:$$props.disabled}));const describedBy=$6.derived(()=>$6.get(field).describedBy);const resolvedAriaInvalid=$6.derived(()=>$6.get(field).ariaInvalid);const resolvedRequired=$6.derived(()=>$6.get(field).required);const resolvedDisabled=$6.derived(()=>$6.get(field).disabled);const isNativeDateInput=$6.derived(()=>type()==="date");const rendersNativeDateIcon=$6.derived(()=>$6.get(isNativeDateInput)&&!$$props.trailing);const hasTrailing=$6.derived(()=>!!$$props.trailing||$6.get(isNativeDateInput));const hasGroupWrapper=$6.derived(()=>!!$$props.leading||$6.get(hasTrailing));const isInvalid=$6.derived(()=>$6.get(resolvedAriaInvalid)==="true");const groupModifiers=$6.derived(()=>classNames($$props.leading&&"cinder-input-group--leading",$6.get(hasTrailing)&&"cinder-input-group--trailing",$6.get(rendersNativeDateIcon)&&"cinder-input-group--native-date",$6.get(resolvedDisabled)&&"cinder-input-group--disabled",$6.get(isInvalid)&&"cinder-input-group--invalid"));const hostClass=$6.derived(()=>$6.get(hasGroupWrapper)?classNames("cinder-input-group",$$props.groupClassName,$6.get(groupModifiers)):"cinder-input-host");let inputNode=$6.state(undefined);let resetSyncTimeout;function syncValueAfterFormReset(){if(resetSyncTimeout!==undefined)clearTimeout(resetSyncTimeout);resetSyncTimeout=setTimeout(()=>{resetSyncTimeout=undefined;if($6.get(inputNode))value($6.get(inputNode).value)},0)}$6.user_effect(()=>{const form=$6.get(inputNode)?.form;if(!form)return;form.addEventListener("reset",syncValueAfterFormReset);return()=>{form.removeEventListener("reset",syncValueAfterFormReset);if(resetSyncTimeout!==undefined){clearTimeout(resetSyncTimeout);resetSyncTimeout=undefined}}});function handleInput(event){const target=event.currentTarget;const committed=commitValue(target.value,$$props.onValueChangeRequest,(next)=>{value(next)},$$props.onValueChange);target.value=committed;$$props.oninput?.(event)}var fragment_2=$6.comment();var node_5=$6.first_child(fragment_2);{var consequent_3=($$anchor)=>{{let $0=$6.derived(()=>context.labelId?undefined:$$props.label);let $1=$6.derived(()=>!!$$props.leading);Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $6.get($0)},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $6.get(resolvedRequired)},get disabled(){return $6.get(resolvedDisabled)},class:"cinder-input-field",get "data-cinder-variant"(){return variant()},fullWidth:true,descriptionClass:"cinder-input-field__description",errorClass:"cinder-input-field__error",get descriptionId(){return $6.get(field).ownDescriptionId},get errorId(){return $6.get(field).ownErrorId},get control(){return inputElement},get controlClass(){return $6.get(hostClass)},get controlLeading(){return $6.get($1)},get controlTrailing(){return $6.get(hasTrailing)},get controlNativeDate(){return $6.get(rendersNativeDateIcon)},get controlDisabled(){return $6.get(resolvedDisabled)},get controlInvalid(){return $6.get(isInvalid)},get before(){return leadingAdornment},get after(){return trailingAdornment}})}};var alternate=($$anchor)=>{{let $0=$6.derived(()=>$$props.required??false);let $1=$6.derived(()=>$$props.disabled??false);let $2=$6.derived(()=>!!$$props.leading);Form_field_frame($$anchor,{get id(){return $$props.id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $6.get($0)},get disabled(){return $6.get($1)},class:"cinder-input-field",get "data-cinder-variant"(){return variant()},fullWidth:true,descriptionClass:"cinder-input-field__description",errorClass:"cinder-input-field__error",get control(){return inputElement},get controlClass(){return $6.get(hostClass)},get controlLeading(){return $6.get($2)},get controlTrailing(){return $6.get(hasTrailing)},get controlNativeDate(){return $6.get(rendersNativeDateIcon)},get controlDisabled(){return $6.get(resolvedDisabled)},get controlInvalid(){return $6.get(isInvalid)},get before(){return leadingAdornment},get after(){return trailingAdornment}})}};$6.if(node_5,($$render)=>{if(context)$$render(consequent_3);else $$render(alternate,-1)})}$6.append($$anchor,fragment_2);$6.pop()}import"svelte/internal/disclose-version";import*as $11 from"svelte/internal/client";import"@lostgradient/cinder/input/styles";var input_default=Input;import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $8 from"svelte/internal/client";import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $7 from"svelte/internal/client";var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var defaultAttributes_default=defaultAttributes;var root5=$7.from_svg(`<svg><!><!></svg>`);function Icon($$anchor,$$props){const $$sanitized_props=$7.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const $$restProps=$7.legacy_rest_props($$sanitized_props,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);$7.push($$props,false);let name2=$7.prop($$props,"name",8,undefined);let color=$7.prop($$props,"color",8,"currentColor");let size=$7.prop($$props,"size",8,24);let strokeWidth=$7.prop($$props,"strokeWidth",8,2);let absoluteStrokeWidth=$7.prop($$props,"absoluteStrokeWidth",8,false);let iconNode=$7.prop($$props,"iconNode",24,()=>[]);const mergeClasses=(...classes)=>classes.filter((className,index,array)=>{return Boolean(className)&&array.indexOf(className)===index}).join(" ");$7.init();var svg=root5();$7.attribute_effect(svg,($0,$1)=>({...defaultAttributes_default,...$$restProps,width:size(),height:size(),stroke:color(),"stroke-width":$0,class:$1}),[()=>($7.deep_read_state(absoluteStrokeWidth()),$7.deep_read_state(strokeWidth()),$7.deep_read_state(size()),$7.untrack(()=>absoluteStrokeWidth()?Number(strokeWidth())*24/Number(size()):strokeWidth())),()=>($7.deep_read_state(name2()),$7.deep_read_state($$sanitized_props),$7.untrack(()=>mergeClasses("lucide-icon","lucide",name2()?`lucide-${name2()}`:"",$$sanitized_props.class)))]);var node=$7.child(svg);$7.each(node,1,iconNode,$7.index,($$anchor,$$item)=>{var $$array=$7.derived(()=>$7.to_array($7.get($$item),2));let tag=()=>$7.get($$array)[0];let attrs=()=>$7.get($$array)[1];var fragment=$7.comment();var node_1=$7.first_child(fragment);$7.element(node_1,tag,true,($$element,$$anchor)=>{$7.attribute_effect($$element,()=>({...attrs()}))});$7.append($$anchor,fragment)});var node_2=$7.sibling(node);$7.slot(node_2,$$props,"default",{},null);$7.reset(svg);$7.append($$anchor,svg);$7.pop()}function Minus($$anchor,$$props){const $$sanitized_props=$8.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}]];Icon($$anchor,$8.spread_props({name:"minus"},()=>$$sanitized_props,{get iconNode(){return iconNode},children:($$anchor,$$slotProps)=>{var fragment_1=$8.comment();var node=$8.first_child(fragment_1);$8.slot(node,$$props,"default",{},null);$8.append($$anchor,fragment_1)},$$slots:{default:true}}))}import"svelte/internal/disclose-version";import"svelte/internal/flags/legacy";import*as $9 from"svelte/internal/client";function Plus($$anchor,$$props){const $$sanitized_props=$9.legacy_rest_props($$props,["children","$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Icon($$anchor,$9.spread_props({name:"plus"},()=>$$sanitized_props,{get iconNode(){return iconNode},children:($$anchor,$$slotProps)=>{var fragment_1=$9.comment();var node=$9.first_child(fragment_1);$9.slot(node,$$props,"default",{},null);$9.append($$anchor,fragment_1)},$$slots:{default:true}}))}import{untrack as untrack2}from"svelte";import{createContext as createContext2}from"svelte";var[getLocaleContextStrict,setLocaleContextRaw]=createContext2();function setLocaleContext(context){setLocaleContextRaw(context)}var getLocaleContext=optionalContext(getLocaleContextStrict);function formatNumber(value,locale="en-US",options){return new Intl.NumberFormat(locale,options).format(value)}function escapeRegex(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function normalizeLocalizedDigits(text,locale){let working=text;const digitFormatter=new Intl.NumberFormat(locale,{useGrouping:false,maximumFractionDigits:0});for(let d=0;d<=9;d++){const glyph=digitFormatter.format(d);if(glyph!==String(d)){working=working.split(glyph).join(String(d))}}return working}var formatAffixTypes=new Set(["currency","percentSign","literal","unit","compact"]);function stripFormatAffixes(text,locale,format){let working=text;let isNegativeByFormatAffix=false;if(format){const positiveAffixValues=new Set(new Intl.NumberFormat(locale,format).formatToParts(0).filter((part)=>formatAffixTypes.has(part.type)).map((part)=>part.value));const negativeParts=new Intl.NumberFormat(locale,format).formatToParts(-1);const negativeOnlyAffixes=negativeParts.filter((part)=>formatAffixTypes.has(part.type)&&part.value.trim()!==""&&!positiveAffixValues.has(part.value)).map((part)=>part.value);isNegativeByFormatAffix=negativeOnlyAffixes.length>0&&negativeOnlyAffixes.every((part)=>working.includes(part));const stripSamples=[0,-1];for(const sample of stripSamples){const parts=new Intl.NumberFormat(locale,format).formatToParts(sample);for(const part of parts){if(formatAffixTypes.has(part.type)){if(part.value)working=working.split(part.value).join("")}}}}if(isNegativeByFormatAffix&&!/^[+-]/.test(working)){working="-"+working}return working}function hasValidGrouping(integerPart,groupSep,locale){if(groupSep&&integerPart.includes(groupSep)){const probeParts=new Intl.NumberFormat(locale,{useGrouping:true}).formatToParts(12345678);const integerRuns=[];for(const p of probeParts){if(p.type==="integer")integerRuns.push(p.value)}const primary=integerRuns.length>0?(integerRuns[integerRuns.length-1]??"").length:3;const secondary=integerRuns.length>1?(integerRuns[integerRuns.length-2]??"").length:primary;const groupEsc=escapeRegex(groupSep);const grouped=new RegExp(`^[+-]?\\d{1,${secondary}}(${groupEsc}\\d{${secondary}})*${groupEsc}\\d{${primary}}$`);return grouped.test(integerPart)}return true}function parseNumericParts(working,locale,groupSep,decimalSep){if(working==="")return{value:null,status:"empty"};const decimalSplit=working.split(decimalSep);if(decimalSplit.length>2)return{value:null,status:"malformed"};const integerPart=decimalSplit[0]??"";const fractionPart=decimalSplit[1];if(!hasValidGrouping(integerPart,groupSep,locale)){return{value:null,status:"malformed"}}let normalized=groupSep.length>0?integerPart.split(groupSep).join(""):integerPart;if(fractionPart!==undefined)normalized+="."+fractionPart;if(!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(normalized)){return{value:null,status:"malformed"}}const parsed=parseFloat(normalized);if(!Number.isFinite(parsed))return{value:null,status:"malformed"};return{value:parsed,status:"valid"}}function parseLocaleNumber(text,locale,format){if(text.trim()==="")return{value:null,status:"empty"};let working=normalizeLocalizedDigits(text,locale);const sepParts=new Intl.NumberFormat(locale,{useGrouping:true,minimumFractionDigits:1,maximumFractionDigits:1}).formatToParts(-12345.6);const groupSep=sepParts.find((p)=>p.type==="group")?.value??"";const decimalSep=sepParts.find((p)=>p.type==="decimal")?.value??".";working=working.replace(/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g,"");const localeMinus=sepParts.find((p)=>p.type==="minusSign")?.value??"-";if(localeMinus!=="-"){working=working.split(localeMinus).join("-")}working=stripFormatAffixes(working,locale,format);working=working.split("%").join("");working=working.replace(/^[\s ]+|[\s ]+$/g,"");return parseNumericParts(working,locale,groupSep,decimalSep)}import*as $10 from"svelte/internal/client";function toAriaInvalidValue(value){return value==="true"||value==="false"?value:undefined}function attachInputNode(getInputAttachment,setInput){return(node)=>{setInput(node);const cleanup=getInputAttachment()?.(node);return()=>{cleanup?.();setInput(undefined)}}}function applyCommit(next,parseStatus,emitChange,options){const malformed=!options.disabled&&parseStatus==="malformed";const requiredEmpty=!options.disabled&&!malformed&&options.required&&next===null;const message=malformed?"Please enter a valid number.":requiredEmpty?"Please enter a number.":"";options.input?.setCustomValidity(message);options.setMalformed(malformed);options.setRequiredEmpty(requiredEmpty);if(!Object.is(next,options.current)){options.markInternal();options.setValue(next)}if(emitChange)options.emit(next);return next}function synchronizeValidity(input,state){if(state.disabled){clearValidity(input,state);return}if(hasExternalValue(state)){clearValidity(input,state);return}if(state.malformed)return;if(needsRequiredValidity(state)){input.setCustomValidity("Please enter a number.");state.setRequiredEmpty(true);return}if(shouldSuppressRequiredValidity(state)){input.setCustomValidity("");state.setRequiredEmpty(false);return}if(hasValue(state)){input.setCustomValidity("");state.setRequiredEmpty(false)}}function clearValidity(input,state){input.setCustomValidity("");state.clearErrors()}function hasValue(state){return state.value!==null&&state.value!==undefined}function hasExternalValue(state){return hasValue(state)&&!state.internalChange}function needsRequiredValidity(state){return!state.focused&&state.required&&!hasValue(state)}function shouldSuppressRequiredValidity(state){return state.focused&&state.requiredEmpty}function isValidStep(value){return typeof value==="number"&&Number.isFinite(value)&&value>0}function roundToPrecision(value,digits){return Number(value.toFixed(Math.min(digits,12)))}function fractionalDigits(value){if(!Number.isFinite(value))return 0;const text=String(value);if(!text.includes("e")&&!text.includes("E"))return text.split(".")[1]?.length??0;const[mantissa,exponentText="0"]=text.toLowerCase().split("e");const exponent=Number(exponentText);const mantissaDigits=mantissa?.split(".")[1]?.length??0;return Math.max(0,mantissaDigits-exponent)}function normalizeCommitValue({source,raw,parseStatus="valid",min,max,snapStep}){if(raw===null||!Number.isFinite(raw)){return{value:null,parseStatus:raw===null?parseStatus:"malformed"}}let result=raw;if(source==="typed"&&snapStep!==null){const origin=Number.isFinite(min)?min:0;result=origin+Math.round((raw-origin)/snapStep)*snapStep;result=roundToPrecision(result,fractionalDigits(snapStep))}else if(source==="delta"&&snapStep!==null){const cleanRaw=roundToPrecision(raw,12);result=roundToPrecision(raw,Math.max(fractionalDigits(snapStep),fractionalDigits(cleanRaw)))}return{value:Math.min(max,Math.max(min,result)),parseStatus}}function createStepController(options){function getBase(direction){const parsed=options.getFocused()?parseLocaleNumber(options.getEditorBuffer(),options.getLocale(),options.getFormat()):null;if(parsed?.status==="valid"){return options.getFormat()?.style==="percent"?roundToPrecision(parsed.value/100,Math.max(2,fractionalDigits(parsed.value)+2)):parsed.value}const bound=direction==="increment"?options.getMin():options.getMax();return options.getValue()??(Number.isFinite(bound)?bound:0)}function stepBy(direction,multiplier=1){const delta=options.getStep()*multiplier*(direction==="increment"?1:-1);const next=options.commitNumber("delta",getBase(direction)+delta);if(options.getFocused()){options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}options.focus()}function onKeyDown(event){const actions={ArrowUp:()=>stepBy("increment"),ArrowDown:()=>stepBy("decrement"),PageUp:()=>stepBy("increment",10),PageDown:()=>stepBy("decrement",10)};const action=actions[event.key];if(action){event.preventDefault();action();return}if(event.key==="Home"&&Number.isFinite(options.getMin())){event.preventDefault();const next=options.commitNumber("delta",options.getMin());if(options.getFocused())options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}else if(event.key==="End"&&Number.isFinite(options.getMax())){event.preventDefault();const next=options.commitNumber("delta",options.getMax());if(options.getFocused())options.setEditorBuffer(next===null?"":options.buildEditDisplay(next))}}return{onKeyDown,stepBy}}function installFormListeners(input,options){const form=input.closest("form");if(!form)return()=>{};const onSubmit=()=>{if(options.isDisabled())return;if(options.hasEnterKeyFlush()){options.clearEnterKeyFlush();return}if(options.isFocused())options.flushSubmit()};const onReset=()=>{if(!options.isDisabled())options.reset()};form.addEventListener("submit",onSubmit,true);form.addEventListener("reset",onReset);return()=>{form.removeEventListener("submit",onSubmit,true);form.removeEventListener("reset",onReset)}}var rest_excludes4=new Set(["$$slots","$$events","$$legacy","id","value","min","max","step","format","locale","disabled","required","name","label","description","error","inputAttachment","class","adornment","onValueChange","onblur","aria-describedby"]);var root6=$11.from_html(`<button type="button" class="cinder-number-input__stepper cinder-number-input__stepper--increment" tabindex="-1"><!></button> <button type="button" class="cinder-number-input__stepper cinder-number-input__stepper--decrement" tabindex="-1"><!></button>`,1);var root_14=$11.from_html(`<span class="cinder-number-input__adornment"><!></span>`);var root_23=$11.from_html(`<!> <!>`,1);var root_33=$11.from_html(`<input type="hidden"/>`);var root_42=$11.from_html(`<p class="cinder-input-field__error" aria-live="polite"> </p>`);var root_52=$11.from_html(`<div data-cinder-full-width=""><!> <!> <!></div>`);function Number_input($$anchor,$$props){$11.push($$props,true);const steppers=($$anchor)=>{var fragment=root6();var button=$11.first_child(fragment);var node_1=$11.child(button);Plus(node_1,{class:"cinder-icon-sm","aria-hidden":"true"});$11.reset(button);var button_1=$11.sibling(button,2);var node_2=$11.child(button_1);Minus(node_2,{class:"cinder-icon-sm","aria-hidden":"true"});$11.reset(button_1);$11.template_effect(()=>{$11.set_attribute(button,"aria-label",`Increment${$11.get(stepperLabelSuffix)}`);button.disabled=$11.get(incrementDisabled);$11.set_attribute(button_1,"aria-label",`Decrement${$11.get(stepperLabelSuffix)}`);button_1.disabled=$11.get(decrementDisabled)});$11.delegated("click",button,()=>stepController.stepBy("increment"));$11.delegated("click",button_1,()=>stepController.stepBy("decrement"));$11.append($$anchor,fragment)};const trailingContent=($$anchor)=>{var fragment_1=root_23();var node_3=$11.first_child(fragment_1);{var consequent_1=($$anchor)=>{var span=root_14();var node_4=$11.child(span);{var consequent=($$anchor)=>{var text_1=$11.text();$11.template_effect(()=>$11.set_text(text_1,$$props.adornment));$11.append($$anchor,text_1)};var alternate=($$anchor)=>{var fragment_3=$11.comment();var node_5=$11.first_child(fragment_3);$11.snippet(node_5,()=>$$props.adornment);$11.append($$anchor,fragment_3)};$11.if(node_4,($$render)=>{if(typeof $$props.adornment==="string")$$render(consequent);else $$render(alternate,-1)})}$11.reset(span);$11.append($$anchor,span)};$11.if(node_3,($$render)=>{if($$props.adornment)$$render(consequent_1)})}var node_6=$11.sibling(node_3,2);steppers(node_6);$11.append($$anchor,fragment_1)};let value=$11.prop($$props,"value",15,null),rest=$11.rest_props($$props,rest_excludes4);const context=getFormFieldContext();const localeContext=getLocaleContext();let editorBuffer=$11.state("");let isFocused=$11.state(false);let hasMounted=$11.state(false);let inputElement=$11.state(undefined);$11.user_effect(()=>{$11.set(hasMounted,true)});let malformedError=$11.state(false);let requiredEmptyError=$11.state(false);const resetTarget=untrack2(()=>value());const resolvedLocale=$11.derived(()=>$$props.locale??localeContext?.locale??($11.get(hasMounted)?navigator.language:"en-US"));const resolvedMin=$11.derived(()=>typeof $$props.min==="number"&&Number.isFinite($$props.min)?$$props.min:-Infinity);const resolvedMax=$11.derived(()=>typeof $$props.max==="number"&&Number.isFinite($$props.max)?$$props.max:Infinity);const incrementStep=$11.derived(()=>isValidStep($$props.step)?$$props.step:1);const snapStep=$11.derived(()=>isValidStep($$props.step)?$$props.step:null);const resolvedRequired=$11.derived(()=>$$props.required??context?.required??false);const resolvedDisabled=$11.derived(()=>$$props.disabled??context?.disabled??false);const commit=(next,parseStatus,emitChange)=>applyCommit(next,parseStatus,emitChange,{disabled:$11.get(resolvedDisabled),required:$11.get(resolvedRequired),current:value(),input:$11.get(inputElement),setMalformed:(nextValue)=>{$11.set(malformedError,nextValue,true)},setRequiredEmpty:(nextValue)=>{$11.set(requiredEmptyError,nextValue,true)},markInternal:()=>{$11.set(isInternalValueChange,true)},setValue:(nextValue)=>{value(nextValue)},emit:(nextValue)=>$$props.onValueChange?.(nextValue)});function commitFromNumber(source,raw,parseStatus="valid"){const result=normalizeCommitValue({source,raw,parseStatus,min:$11.get(resolvedMin),max:$11.get(resolvedMax),snapStep:$11.get(snapStep)});return commit(result.value,result.parseStatus,true)}function commitFromText(source,text){const result=parseLocaleNumber(text,$11.get(resolvedLocale),$$props.format);if(result.status!=="valid"){return commit(null,result.status,true)}const canonical=$$props.format?.style==="percent"?roundToPrecision(result.value/100,Math.max(2,fractionalDigits(result.value)+2)):result.value;return commitFromNumber(source,canonical,"valid")}let isInternalValueChange=$11.state(false);let enterKeyFlushed=false;const displayValue=$11.derived(()=>$11.get(isFocused)?$11.get(editorBuffer):$11.get(malformedError)?$11.get(editorBuffer):value()===null||value()===undefined?"":formatNumber(value(),$11.get(resolvedLocale),$$props.format));const parentValueSignature=$11.derived(()=>`${value()??""}|${$11.get(resolvedLocale)}|${JSON.stringify($$props.format??null)}`);let lastSeenParentSignature=untrack2(()=>$11.get(parentValueSignature));$11.user_effect(()=>{const signature=$11.get(parentValueSignature);if(signature===lastSeenParentSignature)return;lastSeenParentSignature=signature;if($11.get(isInternalValueChange)){$11.set(isInternalValueChange,false);return}if(!$11.get(isFocused))return;$11.set(editorBuffer,value()===null||value()===undefined?"":buildEditDisplay(value()),true)});$11.user_effect(()=>{if(!$11.get(inputElement))return;synchronizeValidity($11.get(inputElement),{disabled:$11.get(resolvedDisabled),value:value(),internalChange:$11.get(isInternalValueChange),focused:$11.get(isFocused),required:$11.get(resolvedRequired),malformed:$11.get(malformedError),requiredEmpty:$11.get(requiredEmptyError),clearErrors:()=>{$11.set(malformedError,false);$11.set(requiredEmptyError,false)},setRequiredEmpty:(nextValue)=>{$11.set(requiredEmptyError,nextValue,true)}})});function buildEditDisplay(v){const editFormat={...$$props.format,style:"decimal",useGrouping:false,currency:undefined,currencyDisplay:undefined,notation:"standard",compactDisplay:undefined};if($$props.format?.style==="percent"){const asPercent=roundToPrecision(v*100,12);return formatNumber(asPercent,$11.get(resolvedLocale),editFormat)}return formatNumber(v,$11.get(resolvedLocale),editFormat)}function ariaValueNowFromText(text){const result=parseLocaleNumber(text,$11.get(resolvedLocale),$$props.format);if(result.status!=="valid")return;return Number.isFinite(result.value)?result.value:undefined}const resolvedAriaValueNow=$11.derived(()=>$11.get(isFocused)?ariaValueNowFromText($11.get(editorBuffer)):value()===null||value()===undefined?undefined:$$props.format?.style==="percent"?roundToPrecision(value()*100,12):value());const resolvedAriaValueMin=$11.derived(()=>Number.isFinite($11.get(resolvedMin))?$$props.format?.style==="percent"?roundToPrecision($11.get(resolvedMin)*100,12):$11.get(resolvedMin):undefined);const resolvedAriaValueMax=$11.derived(()=>Number.isFinite($11.get(resolvedMax))?$$props.format?.style==="percent"?roundToPrecision($11.get(resolvedMax)*100,12):$11.get(resolvedMax):undefined);function onFocus(){if(!$11.get(malformedError)){$11.set(editorBuffer,value()===null||value()===undefined?"":buildEditDisplay(value()),true)}$11.set(isFocused,true)}function onBlur(event){const buffered=$11.get(editorBuffer);$11.set(isFocused,false);commitFromText("typed",buffered);$$props.onblur?.(event)}function onInput(event){$11.set(editorBuffer,event.currentTarget.value,true);if($11.get(malformedError)){$11.set(malformedError,false);$11.get(inputElement)?.setCustomValidity("")}}const stepController=createStepController({getValue:()=>value(),getEditorBuffer:()=>$11.get(editorBuffer),setEditorBuffer:(next)=>{$11.set(editorBuffer,next,true)},getFocused:()=>$11.get(isFocused),getLocale:()=>$11.get(resolvedLocale),getFormat:()=>$$props.format,getMin:()=>$11.get(resolvedMin),getMax:()=>$11.get(resolvedMax),getStep:()=>$11.get(incrementStep),commitNumber:(source,raw)=>commitFromNumber(source,raw),buildEditDisplay,focus:()=>$11.get(inputElement)?.focus()});function onKeyDown(event){if($11.get(resolvedDisabled))return;if(event.key==="Enter"){event.preventDefault();commitFromText("typed",$11.get(isFocused)?$11.get(editorBuffer):"");const form=$11.get(inputElement)?.closest("form");if(!form)return;if(form.checkValidity()){enterKeyFlushed=true;form.requestSubmit()}else{form.reportValidity()}return}stepController.onKeyDown(event)}$11.user_effect(()=>{if(!$11.get(inputElement))return;return installFormListeners($11.get(inputElement),{isDisabled:()=>$11.get(resolvedDisabled),isFocused:()=>$11.get(isFocused),hasEnterKeyFlush:()=>enterKeyFlushed,clearEnterKeyFlush:()=>{enterKeyFlushed=false},flushSubmit:()=>commitFromText("typed",$11.get(editorBuffer)),reset:()=>commitFromNumber("reset",resetTarget,resetTarget===null?"empty":"valid")})});const internalErrorMessage=$11.derived(()=>!$$props.error&&$11.get(malformedError)?"Please enter a valid number.":!$$props.error&&$11.get(requiredEmptyError)?"Please enter a number.":null);const internalErrorId=$11.derived(()=>$11.get(internalErrorMessage)?`${$$props.id}-internal-error`:undefined);const internalInvalid=$11.derived(()=>$11.get(malformedError)||$11.get(requiredEmptyError)?"true":undefined);const resolvedAriaInvalid=$11.derived(()=>$11.get(internalInvalid)??toAriaInvalidValue(rest["aria-invalid"]));const incrementDisabled=$11.derived(()=>$11.get(resolvedDisabled)||value()!==null&&value()!==undefined&&value()>=$11.get(resolvedMax));const decrementDisabled=$11.derived(()=>$11.get(resolvedDisabled)||value()!==null&&value()!==undefined&&value()<=$11.get(resolvedMin));const showHiddenInput=$11.derived(()=>typeof $$props.name==="string"&&$$props.name.length>0&&!$11.get(resolvedDisabled));const stepperLabelSuffix=$11.derived(()=>$$props.label?` ${$$props.label} by ${$11.get(incrementStep)}`:` by ${$11.get(incrementStep)}`);const attachInput=attachInputNode(()=>$$props.inputAttachment,(node)=>{$11.set(inputElement,node,true)});var div=root_52();var node_7=$11.child(div);{let $0=$11.derived(()=>[$$props["aria-describedby"],$11.get(internalErrorId)].filter(Boolean).join(" ")||undefined);input_default(node_7,$11.spread_props({get id(){return $$props.id},get value(){return $11.get(displayValue)}},()=>$$props.label===undefined?{}:{label:$$props.label},()=>$$props.description===undefined?{}:{description:$$props.description},()=>$$props.error===undefined?{}:{error:$$props.error},{get disabled(){return $11.get(resolvedDisabled)},get required(){return $11.get(resolvedRequired)},class:"cinder-number-input__input",groupClassName:"cinder-number-input"},()=>rest,{type:"text",role:"spinbutton",inputmode:"decimal",get inputAttachment(){return attachInput},get trailing(){return trailingContent},trailingInteractive:true,get "aria-invalid"(){return $11.get(resolvedAriaInvalid)},get "aria-describedby"(){return $11.get($0)},get "aria-valuenow"(){return $11.get(resolvedAriaValueNow)},get "aria-valuemin"(){return $11.get(resolvedAriaValueMin)},get "aria-valuemax"(){return $11.get(resolvedAriaValueMax)},oninput:onInput,onfocus:onFocus,onblur:onBlur,onkeydown:onKeyDown}))}var node_8=$11.sibling(node_7,2);{var consequent_2=($$anchor)=>{var input=root_33();$11.remove_input_defaults(input);$11.template_effect(($0)=>{$11.set_attribute(input,"name",$$props.name);$11.set_value(input,$0)},[()=>value()===null||value()===undefined?"":String(value())]);$11.append($$anchor,input)};$11.if(node_8,($$render)=>{if($11.get(showHiddenInput))$$render(consequent_2)})}var node_9=$11.sibling(node_8,2);{var consequent_3=($$anchor)=>{var p=root_42();var text_2=$11.only_child(p,true);$11.template_effect(()=>{$11.set_attribute(p,"id",$11.get(internalErrorId));$11.set_text(text_2,$11.get(internalErrorMessage))});$11.append($$anchor,p)};$11.if(node_9,($$render)=>{if($11.get(internalErrorMessage))$$render(consequent_3)})}$11.reset(div);$11.template_effect(($0)=>$11.set_class(div,1,$0),[()=>$11.clsx(classNames("cinder-input-field",$$props.class))]);$11.append($$anchor,div);$11.pop()}$11.delegate(["click"]);import"svelte/internal/disclose-version";import*as $12 from"svelte/internal/client";var rest_excludes5=new Set(["$$slots","$$events","$$legacy","id","value","options","label","labelVisible","description","error","required","disabled","class","aria-describedby","aria-invalid"]);var root7=$12.from_html(`<select></select>`);var root_15=$12.from_html(`<option> </option>`);var root_24=$12.from_html(`<span class="cinder-select-field__control"><!> <span class="cinder-select-field__chevron" aria-hidden="true"></span></span>`);function Select($$anchor,$$props){$12.push($$props,true);const selectControl=($$anchor)=>{var span=root_24();var node=$12.child(span);{var consequent=($$anchor)=>{var select=root7();$12.attribute_effect(select,()=>({id:$$props.id,class:"cinder-_input-frame cinder-select",disabled:$12.get(field).disabled,required:$12.get(field).required,"data-cinder-empty":"true",...rest,"aria-describedby":$12.get(field).describedBy,"aria-invalid":$12.get(field).ariaInvalid}));$12.append($$anchor,select)};var alternate=($$anchor)=>{var select_1=root7();$12.attribute_effect(select_1,()=>({id:$$props.id,class:"cinder-_input-frame cinder-select",disabled:$12.get(field).disabled,required:$12.get(field).required,...rest,"aria-describedby":$12.get(field).describedBy,"aria-invalid":$12.get(field).ariaInvalid}));$12.each(select_1,21,()=>$$props.options,(option)=>option.value,($$anchor,option)=>{var option_1=root_15();var text=$12.only_child(option_1,true);var option_1_value={};$12.template_effect(()=>{option_1.disabled=$12.get(option).disabled;$12.set_text(text,$12.get(option).label);if(option_1_value!==(option_1_value=$12.get(option).value)){option_1.value=(option_1.__value=option_1_value)??""}});$12.append($$anchor,option_1)});$12.reset(select_1);$12.bind_select_value(select_1,value);$12.append($$anchor,select_1)};$12.if(node,($$render)=>{if($$props.options.length===0)$$render(consequent);else $$render(alternate,-1)})}$12.next(2);$12.reset(span);$12.append($$anchor,span)};let value=$12.prop($$props,"value",15),labelVisible=$12.prop($$props,"labelVisible",3,true),rest=$12.rest_props($$props,rest_excludes5);const context=getFormFieldContext();const field=$12.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"select",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],required:$$props.required,disabled:$$props.disabled}));const stableLocalErrorId=$12.derived(()=>context?.errorId===`${$12.get(field).id}-error`?`${$12.get(field).id}-select-error`:`${$12.get(field).id}-error`);$12.user_effect(()=>{if($$props.options.length===0){devWarn("[cinder/Select] options is empty — pass at least one option, or ignore during async load.")}else if(value()!==undefined&&!$$props.options.some((option)=>option.value===value())){devWarn("[cinder/Select] value does not match any option — pass a value from options or omit it.")}});{let $0=$12.derived(()=>classNames("cinder-select-field",$$props.class));let $1=$12.derived(()=>$12.get(field).ownErrorId??$12.get(stableLocalErrorId));Form_field_frame($$anchor,{get id(){return $12.get(field).id},get label(){return $$props.label},get labelVisible(){return labelVisible()},get description(){return $$props.description},get error(){return $$props.error},get required(){return $12.get(field).required},get disabled(){return $12.get(field).disabled},get class(){return $12.get($0)},labelClass:"cinder-select-field__label",descriptionClass:"cinder-select-field__description",errorClass:"cinder-select-field__error",get descriptionId(){return $12.get(field).ownDescriptionId},get errorId(){return $12.get($1)},get control(){return selectControl}})}$12.pop()}import"svelte/internal/disclose-version";import*as $13 from"svelte/internal/client";function resolveMaximumLength(value){if(typeof value==="number"){return Number.isSafeInteger(value)&&value>=0?value:undefined}if(typeof value==="string"){const trimmed=value.trim();if(!/^\d+$/.test(trimmed))return;const parsed=Number(trimmed);return parsed>=0&&Number.isSafeInteger(parsed)?parsed:undefined}return}var rest_excludes6=new Set(["$$slots","$$events","$$legacy","id","value","label","description","error","rows","disabled","required","class","variant","maxlength","countVisible","aria-describedby","aria-invalid"]);var root8=$13.from_html(`<textarea></textarea>`);var root_16=$13.from_html(`<output class="cinder-textarea-count" aria-live="polite" aria-atomic="true"> </output>`);function Textarea($$anchor,$$props){$13.push($$props,true);const textareaControl=($$anchor)=>{var textarea=root8();$13.remove_textarea_child(textarea);$13.attribute_effect(textarea,($0)=>({id:$$props.id,rows:rows(),disabled:$13.get(field).disabled,required:$13.get(field).required,maxlength:$$props.maxlength,class:$0,"data-cinder-variant":variant(),"aria-invalid":$13.get(field).ariaInvalid,"aria-describedby":$13.get(field).describedBy,...rest}),[()=>classNames("cinder-_input-frame","cinder-textarea",$$props.class)]);$13.bind_value(textarea,value);$13.append($$anchor,textarea)};const counter=($$anchor)=>{var fragment=$13.comment();var node=$13.first_child(fragment);{var consequent=($$anchor)=>{var output=root_16();var text=$13.only_child(output);$13.template_effect(()=>{$13.set_attribute(output,"id",$13.get(countId));$13.set_attribute(output,"for",$$props.id);$13.set_text(text,`${$13.get(currentCount)??""}/${$13.get(maximumLength)??""}`)});$13.append($$anchor,output)};$13.if(node,($$render)=>{if($13.get(countId))$$render(consequent)})}$13.append($$anchor,fragment)};let value=$13.prop($$props,"value",15,""),rows=$13.prop($$props,"rows",3,4),variant=$13.prop($$props,"variant",3,"default"),countVisible=$13.prop($$props,"countVisible",3,false),rest=$13.rest_props($$props,rest_excludes6);const context=getFormFieldContext();const maximumLength=$13.derived(()=>resolveMaximumLength($$props.maxlength));const countId=$13.derived(()=>countVisible()&&$13.get(maximumLength)!==undefined?`${$$props.id}-count`:undefined);const currentCount=$13.derived(()=>value()?.length??0);const ownRequired=$13.derived(()=>$$props.required??undefined);const field=$13.derived(()=>resolveFieldControl({id:$$props.id,generatedId:$$props.id,context,hasDescription:!!$$props.description,hasError:!!$$props.error,localIdNamespace:"textarea",consumerDescribedBy:$$props["aria-describedby"],consumerInvalid:$$props["aria-invalid"],additionalDescribedBy:[$13.get(countId)],required:$13.get(ownRequired),disabled:$$props.disabled}));var fragment_1=$13.comment();var node_1=$13.first_child(fragment_1);{var consequent_2=($$anchor)=>{var fragment_2=$13.comment();var node_2=$13.first_child(fragment_2);{var consequent_1=($$anchor)=>{{let $0=$13.derived(()=>context.labelId?undefined:$$props.label);Form_field_frame($$anchor,{get id(){return $13.get(field).id},get label(){return $13.get($0)},get description(){return $$props.description},get error(){return $$props.error},get required(){return $13.get(field).required},get disabled(){return $13.get(field).disabled},class:"cinder-textarea-field",get "data-cinder-variant"(){return variant()},labelClass:"cinder-textarea-label",descriptionClass:"cinder-textarea-description",errorClass:"cinder-textarea-error",get descriptionId(){return $13.get(field).ownDescriptionId},get errorId(){return $13.get(field).ownErrorId},get control(){return textareaControl},get message(){return counter}})}};var alternate=($$anchor)=>{textareaControl($$anchor)};$13.if(node_2,($$render)=>{if($$props.label||$$props.description||$$props.error||$13.get(countId))$$render(consequent_1);else $$render(alternate,-1)})}$13.append($$anchor,fragment_2)};var alternate_1=($$anchor)=>{Form_field_frame($$anchor,{get id(){return $13.get(field).id},get label(){return $$props.label},get description(){return $$props.description},get error(){return $$props.error},get required(){return $13.get(field).required},get disabled(){return $13.get(field).disabled},class:"cinder-textarea-field",get "data-cinder-variant"(){return variant()},labelClass:"cinder-textarea-label",descriptionClass:"cinder-textarea-description",errorClass:"cinder-textarea-error",get control(){return textareaControl},get message(){return counter}})};$13.if(node_1,($$render)=>{if(context)$$render(consequent_2);else $$render(alternate_1,-1)})}$13.append($$anchor,fragment_1);$13.pop()}function isRecord(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)}function createSchemaFormModel(schema){return{field:fieldFromJsonSchema(schema,[],"value",true),sourceSchema:schema}}function fieldFromJsonSchema(schema,path,key,required){if(!isRecord(schema)){return baseField("json",{},path,key,required)}const normalizedSchema=schema;const options=enumOptions(normalizedSchema);if(options.length>0){return{...baseField("enum",normalizedSchema,path,key,required),options}}const schemaType=schemaTypeOf(normalizedSchema);const schemaProperties=normalizedSchema["properties"];if(schemaType==="object"||isRecord(schemaProperties)){const requiredProperties=requiredPropertyNames(normalizedSchema);const properties=isRecord(schemaProperties)?schemaProperties:{};const fields=Object.entries(properties).map(([propertyKey,propertySchema])=>fieldFromJsonSchema(propertySchema,[...path,propertyKey],propertyKey,requiredProperties.has(propertyKey)));return{...baseField("object",normalizedSchema,path,key,required),fields}}if(schemaType==="array"){const schemaItems=normalizedSchema["items"];const itemSchema=isRecord(schemaItems)?schemaItems:{};const item=fieldFromJsonSchema(itemSchema,[...path,"0"],"item",true);return{...baseField("array",normalizedSchema,path,key,required),item}}const fieldKind=fieldKindForSchemaType(schemaType);if(fieldKind){return baseField(fieldKind,normalizedSchema,path,key,required)}return baseField("json",normalizedSchema,path,key,required)}function fieldKindForSchemaType(type){switch(type){case"string":case"number":case"integer":case"boolean":case"array":case"object":return type;default:return}}function baseField(kind,schema,path,key,required){const description=schema["description"];return{kind,key,path,label:fieldLabel(schema,key),required,...typeof description==="string"&&description.length>0?{description}:{},schema,fields:[],options:[]}}function schemaTypeOf(schema){const{type}=schema;if(typeof type==="string")return type;if(Array.isArray(type)){const supported=type.find((candidate)=>typeof candidate==="string"&&candidate!=="null");return typeof supported==="string"?supported:undefined}return}function requiredPropertyNames(schema){const required=schema["required"];if(!Array.isArray(required))return new Set;return new Set(required.filter((property)=>typeof property==="string"))}function enumOptions(schema){const values=schema["enum"];if(!Array.isArray(values)||values.length===0)return[];if(!values.every((value)=>isJsonPrimitive(value)))return[];return values.map((value)=>({label:String(value),value,encodedValue:encodeEnumValue(value)}))}function isJsonPrimitive(value){return value===null||["string","number","boolean"].includes(typeof value)}function encodeEnumValue(value){return JSON.stringify(value)}function decodeEnumValue(value){const parsed=JSON.parse(value);if(!isJsonPrimitive(parsed)){throw new Error("SchemaForm enum values must be JSON primitives.")}return parsed}function fieldLabel(schema,key){const title=schema["title"];if(typeof title==="string"&&title.trim().length>0){return title}if(key==="value")return"Value";return key.replaceAll(/[-_]+/g," ").replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/^\w/,(letter)=>letter.toUpperCase())}function defaultValueForField(field){if("default"in field.schema)return cloneJsonCompatible(field.schema["default"]);if(field.kind==="object"){const value={};for(const child of field.fields){value[child.key]=defaultValueForField(child)}return value}if(field.kind==="array")return[];if(field.kind==="boolean")return false;if(field.kind==="enum")return field.options[0]?.value??"";if(field.kind==="string")return"";if(field.kind==="json")return null;return}function initialValueForField(field,value){if(value===undefined)return defaultValueForField(field);const clonedValue=cloneJsonCompatible(value);if(clonedValue===undefined)return defaultValueForField(field);return mergeInitialValueWithFieldDefaults(field,clonedValue)}function mergeInitialValueWithFieldDefaults(field,value){if(field.kind==="object"&&isRecord(value)){const defaultValue=defaultValueForField(field);const defaultRecord=isRecord(defaultValue)?defaultValue:{};const result={...defaultRecord};const fieldKeys=new Set(field.fields.map((child)=>child.key));for(const child of field.fields){const seededValue=Object.hasOwn(value,child.key)?value[child.key]:defaultRecord[child.key];result[child.key]=seededValue===undefined?defaultValueForField(child):mergeInitialValueWithFieldDefaults(child,seededValue)}for(const[key,extraValue]of Object.entries(value)){if(!fieldKeys.has(key))result[key]=extraValue}return result}if(field.kind==="array"&&Array.isArray(value)&&field.item){return value.map((item)=>mergeInitialValueWithFieldDefaults(field.item,item))}return value}function cloneJsonCompatible(value){if(value===undefined)return;try{const serializedValue=JSON.stringify(value,cloneJsonCompatibleReplacer);if(serializedValue===undefined)return;const clonedValue=JSON.parse(serializedValue);return clonedValue}catch{return}}function cloneJsonCompatibleReplacer(_key,value){if(typeof value==="number"&&!Number.isFinite(value)){throw new TypeError("SchemaForm values must contain finite numbers.")}if(typeof value==="bigint"){throw new TypeError("SchemaForm values must not contain bigint values.")}return value}function pathKey(path){return path.map((segment)=>segment.replaceAll("~","~0").replaceAll("/","~1")).join("/")}function pathId(path){return path.length===0?"value":path.map(domIdSegment).join("__")}function domIdSegment(segment){let encoded="";for(const character of segment){if(/^[a-zA-Z0-9]$/.test(character)){encoded+=character}else{encoded+=`_${character.codePointAt(0)?.toString(16)??"0"}_`}}return`${segment.length}_${encoded}`}function getValueAtPath(value,path){let current=value;for(const segment of path){if(Array.isArray(current)){const index=Number(segment);current=Number.isInteger(index)?current[index]:undefined}else if(isRecord(current)){current=current[segment]}else{return}}return current}function setValueAtPath(value,path,next){if(path.length===0)return next;const[head,...tail]=path;if(head===undefined)return next;if(Array.isArray(value)){const copy=[...value];const index=Number(head);if(!Number.isInteger(index)||index<0)return copy;copy[index]=setValueAtPath(copy[index],tail,next);return copy}const copy=isRecord(value)?{...value}:{};copy[head]=setValueAtPath(copy[head],tail,next);return copy}function pruneUndefined(value){if(Array.isArray(value))return value.map((item)=>pruneUndefined(item));if(!isRecord(value))return value;const output={};for(const[key,child]of Object.entries(value)){if(child!==undefined)output[key]=pruneUndefined(child)}return output}function arrayValueAtPath(value,path){const array=getValueAtPath(value,path);return Array.isArray(array)?array:[]}function rebaseFieldPath(field,path){const originalPath=field.path;function rebase(candidate){const suffix=candidate.path.slice(originalPath.length);return{...candidate,path:[...path,...suffix],fields:candidate.fields.map(rebase),...candidate.item?{item:rebase(candidate.item)}:{}}}return rebase(field)}import*as $15 from"svelte/internal/client";function createRetryingLoaderCache(loader){let cached;return()=>{if(cached===undefined){const pending=loader();pending.catch(()=>{if(cached===pending){cached=undefined}});cached=pending}return cached}}var loadLibrary=createRetryingLoaderCache(()=>Promise.resolve().then(() => (init_dist2(),exports_dist)));var HOSTNAME_PATTERN=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;var IPV4_PATTERN=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;var IPV6_PATTERN=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;var NOT_URI_FRAGMENT=/\/|:/;var URI_PATTERN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var URI_REFERENCE_PATTERN=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var URI_TEMPLATE_PATTERN=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;var JSON_POINTER_URI_FRAGMENT_PATTERN=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;var BYTE_PATTERN=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;var ISO_TIME_PATTERN=/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i;var ISO_DATE_TIME_PATTERN=/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i;var MIN_INT32=-(2**31);var MAX_INT32=2**31-1;function stringFormat(pattern,code,label){return({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(pattern.test(data))return;return node.createError(code,{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid ${label}`)}}var uriFormat=({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(NOT_URI_FRAGMENT.test(data)&&URI_PATTERN.test(data))return;return node.createError("format-uri-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid uri`)};var byteFormat=({node,pointer,data})=>{if(typeof data!=="string"||data==="")return;if(BYTE_PATTERN.test(data))return;return node.createError("format-byte-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid byte (base64)`)};var int32Format=({node,pointer,data})=>{if(typeof data!=="number")return;if(Number.isInteger(data)&&data>=MIN_INT32&&data<=MAX_INT32)return;return node.createError("format-int32-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid int32`)};var int64Format=({node,pointer,data})=>{if(typeof data!=="number")return;if(Number.isInteger(data))return;return node.createError("format-int64-error",{value:data,pointer,schema:node.schema},`Value \`${data}\` at \`${pointer}\` is not a valid int64`)};var alwaysValidFormat=()=>{return};function buildCustomFormats(){return{hostname:stringFormat(HOSTNAME_PATTERN,"format-hostname-error","hostname"),ipv4:stringFormat(IPV4_PATTERN,"format-ipv4-error","ipv4 address"),ipv6:stringFormat(IPV6_PATTERN,"format-ipv6-error","ipv6 address"),uri:uriFormat,"uri-reference":stringFormat(URI_REFERENCE_PATTERN,"format-uri-reference-error","uri-reference"),"uri-template":stringFormat(URI_TEMPLATE_PATTERN,"format-uri-template-error","uri-template"),"json-pointer-uri-fragment":stringFormat(JSON_POINTER_URI_FRAGMENT_PATTERN,"format-json-pointer-error","json-pointer-uri-fragment"),"iso-time":stringFormat(ISO_TIME_PATTERN,"format-date-time-error","iso-time"),"iso-date-time":stringFormat(ISO_DATE_TIME_PATTERN,"format-date-time-error","iso-date-time"),byte:byteFormat,int32:int32Format,int64:int64Format,float:alwaysValidFormat,double:alwaysValidFormat,password:alwaysValidFormat,binary:alwaysValidFormat}}var cachedDrafts=null;function draftsFor(lib){if(cachedDrafts)return cachedDrafts;const formats=buildCustomFormats();cachedDrafts={"draft-07":lib.extendDraft(lib.draft07,{formats}),"2019-09":lib.extendDraft(lib.draft2019,{formats}),"2020-12":lib.extendDraft(lib.draft2020,{formats})};return cachedDrafts}function toInterpreterError(error){const rawPointer=error.data?.["pointer"];const pointer=typeof rawPointer==="string"?rawPointer:"#";const code=typeof error.code==="string"?error.code:String(error.code);return{code,message:error.message,pointer,data:error.data??{}}}function isRefResolutionSchemaError(error){return error.code==="schema-error"&&error.pointer.endsWith("/$ref")}function isSchemaNode(value){return value!==null&&typeof value==="object"&&"schema"in value}function hasOwnRef(node){const schema=node.schema;return typeof schema==="object"&&schema!==null&&(schema["$ref"]!=null||schema["$dynamicRef"]!=null||schema["$recursiveRef"]!=null)}function childNodes(node){const children=[];const single=[node.additionalProperties,node.items,node.contains,node.not,node.if,node.then,node.else,node.propertyNames,node.unevaluatedItems,node.unevaluatedProperties];for(const child of single)if(child)children.push(child);const arrays=[node.allOf,node.anyOf,node.oneOf,node.prefixItems];for(const array of arrays)if(array)children.push(...array);const records=[node.properties,node.$defs];for(const record of records)if(record)children.push(...Object.values(record));if(node.dependentSchemas){for(const child of Object.values(node.dependentSchemas)){if(isSchemaNode(child))children.push(child)}}if(node.propertyDependencies){for(const inner of Object.values(node.propertyDependencies)){children.push(...Object.values(inner))}}return children}function collectRefErrors(root){const seen=new Set;const errors=[];function visit(node){if(seen.has(node))return;seen.add(node);if(hasOwnRef(node)){const result=node.validate(undefined);for(const error of result.errors){if(error.code==="ref-error")errors.push(toInterpreterError(error))}}for(const child of childNodes(node))visit(child)}visit(root);return errors}async function compileInterpreted(schema,draft,options={}){const lib=await loadLibrary();const draftObject=draftsFor(lib)[draft];const node=lib.compileSchema(schema,{drafts:[draftObject],formatAssertion:options.formats??true});const schemaErrors=(node.schemaErrors??[]).map(toInterpreterError);const refErrors=collectRefErrors(node);return{schemaErrors,refErrors,validate:(data)=>{const result=node.validate(data);return{valid:result.valid,errors:result.errors.map(toInterpreterError)}}}}function dedupeInterpreterErrors(errors){const seen=new Set;const result=[];for(const error of errors){const key=`${error.code}\x00${error.pointer}`;if(seen.has(key))continue;seen.add(key);result.push(error)}return result}function stripPointerHash(pointer){return pointer==="#"?"":pointer.slice(1)}var validatorCache=new WeakMap;async function validateSchemaValue(schema,value){if(!isRecord(schema)){return validationFailure(value,"SchemaForm only accepts JSON Schema objects.")}if(isLegacyStandardSchema(schema)){return validationFailure(value,"SchemaForm only accepts JSON Schema objects.")}return validateJsonSchemaValue(schema,value)}async function validateJsonSchemaValue(schema,value){let compiled;try{compiled=await validatorForSchema(schema)}catch(error){return validationFailure(value,readableSchemaError(error))}const compileErrors=dedupeInterpreterErrors([...compiled.schemaErrors,...compiled.refErrors]);if(compileErrors.length>0){return validationFailure(value,readableSchemaError(new Error(compileErrors[0]?.message)))}const result=compiled.validate(value);if(result.valid)return{valid:true,value,issues:[]};return{valid:false,value,issues:interpreterIssues(result.errors)}}function validationFailure(value,message){return{valid:false,value,issues:[{path:[],message}]}}function isLegacyStandardSchema(schema){const standard=schema["~standard"];return isRecord(standard)&&standard["version"]===1}function readableSchemaError(error){const message=error instanceof Error?error.message:typeof error==="string"?error:"";if(message.startsWith("Invalid JSON Schema"))return message;return message===""?"Invalid JSON Schema.":`Invalid JSON Schema: ${message}`}function validatorForSchema(schema){const cached=validatorCache.get(schema);if(cached)return cached;const promise=createValidator(schema).then((compiled)=>{if(compiled.schemaErrors.length>0||compiled.refErrors.length>0){validatorCache.delete(schema)}return compiled}).catch((error)=>{validatorCache.delete(schema);throw error});validatorCache.set(schema,promise);return promise}function createValidator(schema){return compileInterpreted(schema,jsonSchemaDraft(schema),{formats:false})}function jsonSchemaDraft(schema){const id=schema["$schema"];if(typeof id!=="string")return"2020-12";if(id.includes("draft-07"))return"draft-07";if(id.includes("2019-09"))return"2019-09";return"2020-12"}function interpreterIssues(errors){return errors.map((error)=>({path:interpreterErrorPath(error),message:readableInterpreterMessage(error)}))}function readableInterpreterMessage(error){const fieldName=interpreterErrorPath(error).at(-1)??"Value";const label=humanizeFieldName(fieldName);if(error.code==="required-property-error")return`${label} is required.`;if(error.code==="min-length-error")return`${label} is too short.`;if(error.code==="max-length-error")return`${label} is too long.`;if(error.code==="minimum-error"){return`${label} must be at least ${String(error.data["minimum"])}.`}if(error.code==="maximum-error"){return`${label} must be at most ${String(error.data["maximum"])}.`}if(error.code==="type-error")return`${label} must be ${String(error.data["expected"])}.`;return error.message||"Invalid value"}function humanizeFieldName(name2){return name2.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,(character)=>character.toUpperCase())}function interpreterErrorPath(error){const parentPath=jsonPointerToPath(stripPointerHash(error.pointer));if(error.code!=="required-property-error")return parentPath;const missingProperty=error.data["key"];return typeof missingProperty==="string"?[...parentPath,missingProperty]:parentPath}function jsonPointerToPath(pointer){if(pointer==="")return[];return pointer.slice(1).split("/").map((segment)=>segment.replaceAll("~1","/").replaceAll("~0","~"))}function issuesByPath(issues){const grouped={};for(const issue of issues){const key=pathKey(issue.path);grouped[key]??=issue.message}return grouped}function parseJsonDraft(path,text){try{return{ok:true,value:JSON.parse(text)}}catch(error){return{ok:false,issue:{path,message:error instanceof Error?error.message:"Invalid JSON"}}}}function serializeValidatedValue(value){try{const serialized=JSON.stringify(value,schemaFormJsonReplacer);if(serialized===undefined){throw new TypeError("Validated value is not JSON serializable.")}return{ok:true,value:serialized}}catch(error){return{ok:false,issue:{path:[],message:error instanceof Error?error.message:"Validated value is not JSON serializable"}}}}function schemaFormJsonReplacer(_key,value){if(typeof value==="number"&&!Number.isFinite(value)){throw new TypeError("Validated value contains a non-finite number.")}if(typeof value==="bigint"){throw new TypeError("Validated value contains a bigint, which is not JSON serializable.")}return value}function readSchemaFormData(formData,name2="value"){const raw=formData.get(name2);if(typeof raw!=="string")return;try{return JSON.parse(raw)}catch{return}}class SchemaFormState{#formValue=$15.state();get formValue(){return $15.get(this.#formValue)}set formValue(value){$15.set(this.#formValue,value,true)}#serializedValue=$15.state("");get serializedValue(){return $15.get(this.#serializedValue)}set serializedValue(value){$15.set(this.#serializedValue,value,true)}#errors=$15.state($15.proxy({}));#rawDrafts=$15.state($15.proxy({}));#parsedRawDrafts=$15.state($15.proxy({}));#numericDrafts=$15.state($15.proxy({}));#touchedValidationSequences=$15.state($15.proxy({}));#arrayKeys=$15.state($15.proxy({}));#arrayKeyCounter=0;#model;#options;constructor(model,initialValue,options){this.#model=model;this.#options=options;this.formValue=initialValue;$15.set(this.#rawDrafts,this.#seedRawDrafts(model.field,initialValue),true);$15.set(this.#arrayKeys,this.#seedArrayKeys(model.field,initialValue),true)}get errors(){return $15.get(this.#errors)}get rawDrafts(){return $15.get(this.#rawDrafts)}clearSerializedValue(){this.serializedValue=""}#bumpTouchedValidationSequence(path){const key=pathKey(path);$15.set(this.#touchedValidationSequences,{...$15.get(this.#touchedValidationSequences),[key]:($15.get(this.#touchedValidationSequences)[key]??0)+1},true)}#currentDraft(){let nextValue=this.formValue;for(const field of this.#currentNumericFields(this.#model.field,this.formValue)){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(draft!==undefined)nextValue=setValueAtPath(nextValue,field.path,draft)}for(const field of this.#currentJsonFields(this.#model.field,this.formValue)){const key=pathKey(field.path);const parsed=$15.get(this.#parsedRawDrafts)[key];if(parsed===undefined)continue;nextValue=setValueAtPath(nextValue,field.path,parsed.ok?parsed.value:$15.get(this.#rawDrafts)[key])}return pruneUndefined(nextValue)}#reportDraftChange(){this.#options.onDraftChange?.(this.#currentDraft())}updateValue(path,next,reportChange=true){if(this.#options.getSubmitting())return;this.formValue=setValueAtPath(this.formValue,path,next);const key=pathKey(path);if($15.get(this.#numericDrafts)[key]!==undefined){const{[key]:_removedDraft,...remainingDrafts}=$15.get(this.#numericDrafts);$15.set(this.#numericDrafts,remainingDrafts,true)}this.#bumpTouchedValidationSequence(path);if($15.get(this.#errors)[key]){const{[key]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}this.clearSerializedValue();if(reportChange)this.#reportDraftChange()}updateNumberValue(field,next){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(next===null&&draft!==undefined&&draft.trim()!=="")return;this.updateValue(field.path,next??undefined)}async validateTouchedField(field){if(this.#options.getSubmitting())return;const fieldKey=pathKey(field.path);const sequence=($15.get(this.#touchedValidationSequences)[fieldKey]??0)+1;$15.set(this.#touchedValidationSequences,{...$15.get(this.#touchedValidationSequences),[fieldKey]:sequence},true);const raw=this.#rawJsonIssues();const rawIssue=raw.issues.find((candidateIssue)=>{const candidateKey=pathKey(candidateIssue.path);return candidateKey===fieldKey||candidateKey.startsWith(`${fieldKey}/`)});if(rawIssue){$15.set(this.#errors,{...$15.get(this.#errors),[fieldKey]:rawIssue.message},true);return}const candidate=pruneUndefined(raw.value);const result=await validateSchemaValue(this.#model.sourceSchema,candidate);if($15.get(this.#touchedValidationSequences)[fieldKey]!==sequence)return;const issue=(result.valid?[]:result.issues).find((candidateIssue)=>{const candidateKey=pathKey(candidateIssue.path);return candidateKey===fieldKey||candidateKey.startsWith(`${fieldKey}/`)});if(issue){$15.set(this.#errors,{...$15.get(this.#errors),[fieldKey]:issue.message},true);return}if($15.get(this.#errors)[fieldKey]){const{[fieldKey]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}}updateEnum(field,event){if(this.#options.getSubmitting())return;const select=event.currentTarget;if(!(select instanceof HTMLSelectElement))return;this.updateValue(field.path,decodeEnumValue(select.value))}updateRawJsonValue(field,next){if(this.#options.getSubmitting())return;const key=pathKey(field.path);$15.set(this.#rawDrafts,{...$15.get(this.#rawDrafts),[key]:next},true);const parsed=parseJsonDraft(field.path,next);$15.set(this.#parsedRawDrafts,{...$15.get(this.#parsedRawDrafts),[key]:parsed.ok?parsed:{ok:false,message:parsed.issue.message}},true);this.#bumpTouchedValidationSequence(field.path);if($15.get(this.#errors)[key]){const{[key]:_removed,...remaining}=$15.get(this.#errors);$15.set(this.#errors,remaining,true)}this.clearSerializedValue();this.#reportDraftChange()}handleFieldInput(field,event){if(this.#options.getSubmitting())return;this.#bumpTouchedValidationSequence(field.path);if(field.kind!=="number"&&field.kind!=="integer")return;if(!(event.target instanceof HTMLInputElement))return;$15.set(this.#numericDrafts,{...$15.get(this.#numericDrafts),[pathKey(field.path)]:event.target.value},true);this.clearSerializedValue();this.#reportDraftChange()}arrayRows(field){const values=arrayValueAtPath(this.formValue,field.path);const keys=$15.get(this.#arrayKeys)[pathKey(field.path)]??[];return values.map((_,index)=>({key:keys[index]??`${pathKey(field.path)}-${index}`,index}))}addArrayItem(field){if(this.#options.getSubmitting())return;const values=arrayValueAtPath(this.formValue,field.path);const nextValue=field.item?defaultValueForField(field.item):null;this.updateValue(field.path,[...values,nextValue]);const key=pathKey(field.path);$15.set(this.#arrayKeys,{...$15.get(this.#arrayKeys),[key]:[...$15.get(this.#arrayKeys)[key]??[],`${key}-${this.#arrayKeyCounter++}`]},true)}removeArrayItem(field,index){if(this.#options.getSubmitting())return;const values=arrayValueAtPath(this.formValue,field.path);this.updateValue(field.path,values.filter((_,candidateIndex)=>candidateIndex!==index),false);$15.set(this.#rawDrafts,this.#reindexArrayPathState($15.get(this.#rawDrafts),field.path,index),true);$15.set(this.#parsedRawDrafts,this.#reindexArrayPathState($15.get(this.#parsedRawDrafts),field.path,index),true);$15.set(this.#numericDrafts,this.#reindexArrayPathState($15.get(this.#numericDrafts),field.path,index),true);$15.set(this.#errors,this.#reindexArrayPathState($15.get(this.#errors),field.path,index),true);$15.set(this.#touchedValidationSequences,this.#bumpPathValidationSequences(this.#reindexArrayPathState($15.get(this.#touchedValidationSequences),field.path,index),field.path),true);const key=pathKey(field.path);$15.set(this.#arrayKeys,{...$15.get(this.#arrayKeys),[key]:($15.get(this.#arrayKeys)[key]??[]).filter((_,candidateIndex)=>candidateIndex!==index)},true);this.#reportDraftChange()}#reindexArrayPathState(state,arrayPath,removedIndex){const prefix=pathKey(arrayPath);const pathPrefix=prefix===""?"":`${prefix}/`;const next={};for(const[key,stateValue]of Object.entries(state)){if(!key.startsWith(pathPrefix)){next[key]=stateValue;continue}const relativeKey=key.slice(pathPrefix.length);if(relativeKey===""){next[key]=stateValue;continue}const[indexSegment="",...remainingSegments]=relativeKey.split("/");const index=Number(indexSegment);if(!Number.isInteger(index)||index<0){next[key]=stateValue;continue}if(index<removedIndex){next[key]=stateValue;continue}if(index===removedIndex)continue;const shiftedKey=[String(index-1),...remainingSegments].join("/");next[`${pathPrefix}${shiftedKey}`]=stateValue}return next}#bumpPathValidationSequences(state,path){const prefix=pathKey(path);const pathPrefix=prefix===""?"":`${prefix}/`;const next={};for(const[key,sequence]of Object.entries(state)){next[key]=key===prefix||key.startsWith(pathPrefix)?sequence+1:sequence}return next}#seedRawDrafts(field,currentValue){const drafts={};for(const jsonField of this.#currentJsonFields(field,currentValue)){drafts[pathKey(jsonField.path)]=JSON.stringify(getValueAtPath(currentValue,jsonField.path)??null,null,2)}return drafts}#currentJsonFields(field,currentValue){const fields=[];const visit=(candidate)=>{if(candidate.kind==="json")fields.push(candidate);for(const child of candidate.fields)visit(child);if(candidate.kind==="array"&&candidate.item){for(const[index]of arrayValueAtPath(currentValue,candidate.path).entries()){visit(rebaseFieldPath(candidate.item,[...candidate.path,String(index)]))}}};visit(field);return fields}#currentNumericFields(field,currentValue){const fields=[];const visit=(candidate)=>{if(candidate.kind==="number"||candidate.kind==="integer")fields.push(candidate);for(const child of candidate.fields)visit(child);if(candidate.kind==="array"&&candidate.item){for(const[index]of arrayValueAtPath(currentValue,candidate.path).entries()){visit(rebaseFieldPath(candidate.item,[...candidate.path,String(index)]))}}};visit(field);return fields}#seedArrayKeys(field,currentValue){const keys={};const visit=(candidate)=>{if(candidate.kind==="array"){const key=pathKey(candidate.path);keys[key]=arrayValueAtPath(currentValue,candidate.path).map(()=>`${key}-${this.#arrayKeyCounter++}`)}for(const child of candidate.fields)visit(child);if(candidate.item)visit(candidate.item)};visit(field);return keys}#rawJsonIssues(){let nextValue=this.formValue;const issues=[];for(const field of this.#currentJsonFields(this.#model.field,this.formValue)){const parsed=$15.get(this.#parsedRawDrafts)[pathKey(field.path)];if(parsed===undefined)continue;if(parsed.ok){nextValue=setValueAtPath(nextValue,field.path,parsed.value)}else{issues.push({path:field.path,message:parsed.message})}}return{value:nextValue,issues}}buildSubmitCandidate(){const raw=this.#rawJsonIssues();if(raw.issues.length>0)return{ok:false,issues:raw.issues};let candidate=raw.value;for(const field of this.#currentNumericFields(this.#model.field,this.formValue)){const draft=$15.get(this.#numericDrafts)[pathKey(field.path)];if(draft!==undefined)candidate=setValueAtPath(candidate,field.path,draft)}return{ok:true,value:pruneUndefined(candidate)}}applyIssues(issues){$15.set(this.#errors,issuesByPath(issues),true);this.clearSerializedValue()}commit(value,serializedValue){this.formValue=value;$15.set(this.#errors,{},true);this.serializedValue=serializedValue}}function createSchemaFormState(model,initialValue,options){return new SchemaFormState(model,initialValue,options)}var rest_excludes7=new Set(["$$slots","$$events","$$legacy","schema","value","name","submitLabel","class","onSubmit","onDraftChange","novalidate"]);var root9=$16.from_html(`<span class="cinder-_required-marker" aria-hidden="true">*</span>`);var root_17=$16.from_html(`<p class="cinder-schema-form__description"> </p>`);var root_25=$16.from_html(`<p class="cinder-schema-form__error" aria-live="polite" tabindex="-1"> </p>`);var root_34=$16.from_html(`<legend class="cinder-schema-form__legend"> <!></legend> <!> <!>`,1);var root_43=$16.from_html(`<fieldset class="cinder-schema-form__fieldset"><!> <div class="cinder-schema-form__fields"></div></fieldset>`);var root_53=$16.from_html(`<div class="cinder-schema-form__array-item"><!> <button type="button" class="cinder-schema-form__secondary-button">Remove</button></div>`);var root_62=$16.from_html(`<fieldset class="cinder-schema-form__fieldset"><!> <div class="cinder-schema-form__array"></div> <button type="button" class="cinder-schema-form__secondary-button"> </button></fieldset>`);var root_7=$16.from_html(`<div class="cinder-schema-form__field"><!></div>`);var root_8=$16.from_html(`<p class="cinder-schema-form__error" role="alert" aria-live="polite" tabindex="-1"> </p>`);var root_9=$16.from_html(`<form><!> <div class="cinder-schema-form__fields"></div> <input type="hidden"/> <button type="submit" class="cinder-schema-form__submit"> </button></form>`);function Schema_form_body($$anchor,$$props){const generatedId=$16.props_id();$16.push($$props,true);const groupLegend=($$anchor,field=$16.noop)=>{var fragment=root_34();var legend=$16.first_child(fragment);var text=$16.child(legend);var node=$16.sibling(text);{var consequent=($$anchor)=>{var span=root9();$16.append($$anchor,span)};$16.if(node,($$render)=>{if(field().required)$$render(consequent)})}$16.reset(legend);var node_1=$16.sibling(legend,2);{var consequent_1=($$anchor)=>{var p=root_17();var text_1=$16.only_child(p,true);$16.template_effect(($0)=>{$16.set_attribute(p,"id",`${$0??""}-description`);$16.set_text(text_1,field().description)},[()=>fieldDomId(field())]);$16.append($$anchor,p)};$16.if(node_1,($$render)=>{if(field().description)$$render(consequent_1)})}var node_2=$16.sibling(node_1,2);{var consequent_2=($$anchor)=>{var p_1=root_25();var text_2=$16.only_child(p_1,true);$16.template_effect(($0,$1)=>{$16.set_attribute(p_1,"id",`${$0??""}-error`);$16.set_text(text_2,$1)},[()=>fieldDomId(field()),()=>fieldError(field())]);$16.append($$anchor,p_1)};var d=$16.derived(()=>fieldError(field()));$16.if(node_2,($$render)=>{if($16.get(d))$$render(consequent_2)})}$16.template_effect(()=>$16.set_text(text,`${field().label??""} `));$16.append($$anchor,fragment)};const renderField=($$anchor,field=$16.noop)=>{const id=$16.derived(()=>fieldDomId(field()));const error=$16.derived(()=>fieldError(field()));const labelledProps=$16.derived(()=>({label:field().label,...field().description!==undefined?{description:field().description}:{},...$16.get(error)!==undefined?{error:$16.get(error)}:{}}));var fragment_1=$16.comment();var node_3=$16.first_child(fragment_1);{var consequent_3=($$anchor)=>{var fieldset=root_43();var node_4=$16.child(fieldset);groupLegend(node_4,field);var div=$16.sibling(node_4,2);$16.each(div,21,()=>field().fields,(child)=>pathKey(child.path),($$anchor,child)=>{renderField($$anchor,()=>$16.get(child))});$16.reset(div);$16.reset(fieldset);$16.append($$anchor,fieldset)};var consequent_5=($$anchor)=>{var fieldset_1=root_62();var node_5=$16.child(fieldset_1);groupLegend(node_5,field);var div_1=$16.sibling(node_5,2);$16.each(div_1,21,()=>formState.arrayRows(field()),(row)=>row.key,($$anchor,row)=>{const itemField=$16.derived(()=>field().item?rebaseFieldPath(field().item,[...field().path,String($16.get(row).index)]):undefined);var div_2=root_53();var node_6=$16.child(div_2);{var consequent_4=($$anchor)=>{renderField($$anchor,()=>$16.get(itemField))};$16.if(node_6,($$render)=>{if($16.get(itemField))$$render(consequent_4)})}var button=$16.sibling(node_6,2);$16.reset(div_2);$16.template_effect(()=>{$16.set_attribute(button,"aria-label",`Remove ${field().label} item ${$16.get(row).index+1}`);button.disabled=$16.get(submitting)});$16.delegated("click",button,()=>formState.removeArrayItem(field(),$16.get(row).index));$16.append($$anchor,div_2)});$16.reset(div_1);var button_1=$16.sibling(div_1,2);var text_3=$16.only_child(button_1);$16.reset(fieldset_1);$16.template_effect(($0)=>{$16.set_attribute(div_1,"data-cinder-empty",$0);button_1.disabled=$16.get(submitting);$16.set_text(text_3,`Add ${field().label??""}`)},[()=>formState.arrayRows(field()).length===0||undefined]);$16.delegated("click",button_1,()=>formState.addArrayItem(field()));$16.append($$anchor,fieldset_1)};var alternate_1=($$anchor)=>{var div_3=root_7();var node_7=$16.child(div_3);{var consequent_6=($$anchor)=>{var bind_get=()=>stringValue(field());var bind_set=(next)=>formState.updateValue(field().path,next);Input($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},onblur:()=>formState.validateTouchedField(field()),get value(){return bind_get()},set value($$value){bind_set($$value)}}))};var consequent_7=($$anchor)=>{{let $0=$16.derived(()=>field().kind==="integer"?1:undefined);let $1=$16.derived(()=>numberFieldValue(field()));Number_input($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},get step(){return $16.get($0)},onblur:()=>formState.validateTouchedField(field()),get value(){return $16.get($1)},onValueChange:(next)=>formState.updateNumberValue(field(),next)}))}};var consequent_8=($$anchor)=>{{let $0=$16.derived(()=>selectOptions(field()));let $1=$16.derived(()=>enumValue(field()));Select($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},get options(){return $16.get($0)},get value(){return $16.get($1)},onchange:(event)=>formState.updateEnum(field(),event),onblur:()=>formState.validateTouchedField(field())}))}};var consequent_9=($$anchor)=>{var bind_get_1=()=>booleanValue(field());var bind_set_1=(next)=>formState.updateValue(field().path,next);Checkbox($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get disabled(){return $16.get(submitting)},get checked(){return bind_get_1()},set checked($$value){bind_set_1($$value)}}))};var alternate=($$anchor)=>{var bind_get_2=()=>rawJsonValue(field());var bind_set_2=(next)=>formState.updateRawJsonValue(field(),next);Textarea($$anchor,$16.spread_props({get id(){return $16.get(id)}},()=>$16.get(labelledProps),{get required(){return field().required},get disabled(){return $16.get(submitting)},rows:6,spellcheck:false,variant:"code",class:"cinder-schema-form__json-control",onblur:()=>formState.validateTouchedField(field()),get value(){return bind_get_2()},set value($$value){bind_set_2($$value)}}))};$16.if(node_7,($$render)=>{if(field().kind==="string")$$render(consequent_6);else if(field().kind==="number"||field().kind==="integer")$$render(consequent_7,1);else if(field().kind==="enum")$$render(consequent_8,2);else if(field().kind==="boolean")$$render(consequent_9,3);else $$render(alternate,-1)})}$16.reset(div_3);$16.delegated("input",div_3,(event)=>formState.handleFieldInput(field(),event));$16.append($$anchor,div_3)};$16.if(node_3,($$render)=>{if(field().kind==="object")$$render(consequent_3);else if(field().kind==="array")$$render(consequent_5,1);else $$render(alternate_1,-1)})}$16.append($$anchor,fragment_1)};let name2=$16.prop($$props,"name",3,"value"),submitLabel=$16.prop($$props,"submitLabel",3,"Submit"),rest=$16.rest_props($$props,rest_excludes7);function createInitialState(){const initialModel=createSchemaFormModel($$props.schema);return{initialModel,initialFormValue:initialValueForField(initialModel.field,$$props.value)}}const{initialModel,initialFormValue}=createInitialState();const model=$16.derived(()=>createSchemaFormModel($$props.schema));let formElement=$16.state(undefined);let serializedInputElement=$16.state(undefined);let submitting=$16.state(false);let allowNativeSubmit=false;let activeSubmitId=0;const formState=createSchemaFormState(initialModel,initialFormValue,{getSubmitting:()=>$16.get(submitting),onDraftChange:(draft)=>$$props.onDraftChange?.(draft)});$16.user_effect(()=>{if($16.get(serializedInputElement))$16.get(serializedInputElement).value=formState.serializedValue});const formId=$16.derived(()=>$$props.id??`${generatedId}-form`);const rootFields=$16.derived(()=>$16.get(model).field.kind==="object"?$16.get(model).field.fields:[$16.get(model).field]);const rootError=$16.derived(()=>$16.get(model).field.kind==="object"?formState.errors[pathKey([])]:undefined);const rootErrorId=$16.derived(()=>`${$16.get(formId)}-${pathId([])}-error`);function fieldDomId(field){return`${$16.get(formId)}-${pathId(field.path)}`}function fieldError(field){return formState.errors[pathKey(field.path)]}function stringValue(field){const current=getValueAtPath(formState.formValue,field.path);return current===undefined||current===null?"":String(current)}function numberValue(field){const current=getValueAtPath(formState.formValue,field.path);return typeof current==="number"?current:undefined}function booleanValue(field){return getValueAtPath(formState.formValue,field.path)===true}function enumValue(field){const current=getValueAtPath(formState.formValue,field.path);const option=field.options.find((candidate)=>Object.is(candidate.value,current));return option?.encodedValue??field.options[0]?.encodedValue??""}function selectOptions(field){return field.options.map((option)=>({value:option.encodedValue,label:option.label}))}function numberFieldValue(field){return numberValue(field)??null}function rawJsonValue(field){const key=pathKey(field.path);if(formState.rawDrafts[key]!==undefined)return formState.rawDrafts[key];return JSON.stringify(getValueAtPath(formState.formValue,field.path)??null,null,2)}async function reportSubmitIssues(issues,submitId){if(activeSubmitId!==submitId)return;formState.applyIssues(issues);$16.set(submitting,false);await focusFirstError(submitId)}async function focusFirstError(submitId){await tick();if(activeSubmitId!==submitId)return;$16.get(formElement)?.querySelector('[aria-invalid="true"], [data-cinder-invalid="true"], .cinder-schema-form__error')?.focus()}function shouldResumeNativeSubmit(){return $$props.onSubmit===undefined&&($$props.action!==undefined||$$props.method!==undefined)}function nativeSubmitter(event){const submitter=event.submitter;if(submitter instanceof HTMLButtonElement&&submitter.type==="submit"&&submitter.form===$16.get(formElement)){return submitter}if(submitter instanceof HTMLInputElement&&(submitter.type==="submit"||submitter.type==="image")&&submitter.form===$16.get(formElement)){return submitter}return}async function handleSubmit(event){if(allowNativeSubmit){allowNativeSubmit=false;return}event.preventDefault();if($16.get(submitting))return;const submitId=activeSubmitId+1;activeSubmitId=submitId;$16.set(submitting,true);try{const draft=formState.buildSubmitCandidate();if(!draft.ok){await reportSubmitIssues(draft.issues,submitId);return}const result=await validateSchemaValue($$props.schema,draft.value);if(!result.valid){await reportSubmitIssues(result.issues,submitId);return}const serialized=serializeValidatedValue(result.value);if(!serialized.ok){await reportSubmitIssues([serialized.issue],submitId);return}formState.commit(result.value,serialized.value);await $$props.onSubmit?.(result.value,event);if(shouldResumeNativeSubmit()){allowNativeSubmit=true;await tick();$16.get(formElement)?.requestSubmit(nativeSubmitter(event))}}finally{if(activeSubmitId===submitId)$16.set(submitting,false)}}var form=root_9();$16.attribute_effect(form,($0)=>({...rest,id:$16.get(formId),class:$0,novalidate:$$props.novalidate??true,onsubmit:handleSubmit}),[()=>classNames("cinder-schema-form",$$props.class)]);var node_8=$16.child(form);{var consequent_10=($$anchor)=>{var p_2=root_8();var text_4=$16.only_child(p_2,true);$16.template_effect(()=>{$16.set_attribute(p_2,"id",$16.get(rootErrorId));$16.set_text(text_4,$16.get(rootError))});$16.append($$anchor,p_2)};$16.if(node_8,($$render)=>{if($16.get(rootError))$$render(consequent_10)})}var div_4=$16.sibling(node_8,2);$16.each(div_4,21,()=>$16.get(rootFields),(field)=>pathKey(field.path),($$anchor,field)=>{renderField($$anchor,()=>$16.get(field))});$16.reset(div_4);var input=$16.sibling(div_4,2);$16.remove_input_defaults(input);$16.bind_this(input,($$value)=>$16.set(serializedInputElement,$$value),()=>$16.get(serializedInputElement));var button_2=$16.sibling(input,2);var text_5=$16.only_child(button_2,true);$16.reset(form);$16.bind_this(form,($$value)=>$16.set(formElement,$$value),()=>$16.get(formElement));$16.template_effect(()=>{$16.set_attribute(input,"name",name2());$16.set_value(input,formState.serializedValue);button_2.disabled=$16.get(submitting);$16.set_text(text_5,$16.get(submitting)?"Validating...":submitLabel())});$16.append($$anchor,form);$16.pop()}$16.delegate(["click","input"]);var rest_excludes8=new Set(["$$slots","$$events","$$legacy","schema"]);function Schema_form($$anchor,$$props){let rest=$17.rest_props($$props,rest_excludes8);var fragment=$17.comment();var node=$17.first_child(fragment);$17.key(node,()=>$$props.schema,($$anchor)=>{Schema_form_body($$anchor,$17.spread_props({get schema(){return $$props.schema}},()=>rest))});$17.append($$anchor,fragment)}var schema_form_default=Schema_form;export{Schema_form as SchemaForm,schema_form_default as default,readSchemaFormData};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=9339EB813C1296DE64756E2164756E21
|