@remoteoss/json-schema-form 1.0.0-beta.10 â 1.0.0-beta.11
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/LICENSE +21 -0
- package/README.md +26 -67
- package/dist/index.d.ts +14 -4
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Remote Technology, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,87 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src=".github/media/jsf_logo_dark.png" width="600" alt="json-schema-form">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<code>json-schema-form</code> is a headless UI form library powered by <a href="https://json-schema.org/">JSON Schemas</a>.
|
|
7
|
+
<br/>
|
|
8
|
+
It transforms JSON schemas into Javascript `fields` to be more easily consumed by your UI libraries.
|
|
9
|
+
</p>
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
avoiding any major breaking change.
|
|
11
|
-
This is under active development, more info soon!
|
|
11
|
+
---
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### Why JSON Schemas for forms?
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
JSON Schemas are the SSoT (Single Source of Truth) that allows you to share form's data _structure_ and _validations_ between the server (backend) and the client (frontend), regardless of the language used.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
git clone https://github.com/remoteoss/json-schema-form.git --recursive
|
|
19
|
-
```
|
|
17
|
+
You can use it beyond UI Forms, like lists, tables, and any other UI that needs structured JSON data.
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
you can initialize and update them with:
|
|
19
|
+
## Installation
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
git submodule update --init
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
2. Navigate to the "next" folder
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
cd json-schema-form/next
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
3. Install dependencies. You **must use [`pnpm`](https://pnpm.io/)**
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pnpm install
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
4. Work in the "next" folder only
|
|
41
|
-
|
|
42
|
-
Open your editor in this folder and run commands from.
|
|
43
|
-
Otherwise, your editor may fail to set up linting and type checking,
|
|
44
|
-
while your terminal may fail to resolve paths.
|
|
45
|
-
|
|
46
|
-
The limitation of this approach is that
|
|
47
|
-
your editor will fail to recognise our git repository here.
|
|
48
|
-
This also means you should turn off the editor's suggestion
|
|
49
|
-
to open git repository at root.
|
|
50
|
-
|
|
51
|
-
## Testing
|
|
52
|
-
|
|
53
|
-
To run the tests, navigate to the "next" folder and run:
|
|
21
|
+
Available on [NPM](https://www.npmjs.com/package/@remoteoss/json-schema-form).
|
|
54
22
|
|
|
55
23
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Or run the tests in watch mode:
|
|
24
|
+
npm install @remoteoss/json-schema-form
|
|
25
|
+
# or
|
|
60
26
|
|
|
61
|
-
|
|
62
|
-
pnpm test:watch
|
|
27
|
+
yarn install @remoteoss/json-schema-form
|
|
63
28
|
```
|
|
64
29
|
|
|
65
|
-
|
|
30
|
+
## Getting Started
|
|
66
31
|
|
|
67
|
-
|
|
68
|
-
1. The new tests for this version
|
|
32
|
+
Check the đ **[JSF website](https://json-schema-form.vercel.app/)** for documentation.
|
|
69
33
|
|
|
70
|
-
|
|
71
|
-
The new tests are located in the `./test` folder.
|
|
34
|
+
### Playground
|
|
72
35
|
|
|
73
|
-
|
|
36
|
+
Check the đšī¸ **[JSF Playground](https://json-schema-form.vercel.app/?path=/docs/playground--docs)** for demos.
|
|
74
37
|
|
|
75
|
-
##
|
|
38
|
+
## Contributing
|
|
76
39
|
|
|
77
|
-
|
|
78
|
-
We recommend using the exact version specified in `.nvmrc`:
|
|
40
|
+
Read [CONTRIBUTING](CONTRIBUTING.md) to get started.
|
|
79
41
|
|
|
80
|
-
|
|
42
|
+
## Migrating
|
|
81
43
|
|
|
82
|
-
|
|
83
|
-
nvm use
|
|
84
|
-
```
|
|
44
|
+
If you're using `v0` and wish to migrate to `v1`, read [MIGRATING](MIGRATING.md) to get started.
|
|
85
45
|
|
|
86
|
-
|
|
87
|
-
tests and other development tasks will likely fail.
|
|
46
|
+
_Backed by [Remote.com](https://remote.com/)_
|
package/dist/index.d.ts
CHANGED
|
@@ -156,11 +156,21 @@ interface CreateHeadlessFormOptions {
|
|
|
156
156
|
}
|
|
157
157
|
declare function createHeadlessForm(schema: JsfObjectSchema, options?: CreateHeadlessFormOptions): FormResult;
|
|
158
158
|
|
|
159
|
-
type FieldOutput = Partial<JsfSchema
|
|
159
|
+
type FieldOutput = Partial<JsfSchema>;
|
|
160
|
+
type FieldModification = Partial<JsfSchema> & {
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated Use `x-jsf-presentation` instead
|
|
163
|
+
*/
|
|
164
|
+
presentation?: JsfSchema['x-jsf-presentation'];
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated Use `x-jsf-errorMessage` instead
|
|
167
|
+
*/
|
|
168
|
+
errorMessage?: JsfSchema['x-jsf-errorMessage'];
|
|
169
|
+
};
|
|
160
170
|
interface ModifyConfig {
|
|
161
|
-
fields?: Record<string,
|
|
162
|
-
allFields?: (name: string, attrs: JsfSchema) =>
|
|
163
|
-
create?: Record<string,
|
|
171
|
+
fields?: Record<string, FieldModification | ((attrs: JsfSchema) => FieldOutput)>;
|
|
172
|
+
allFields?: (name: string, attrs: JsfSchema) => FieldModification;
|
|
173
|
+
create?: Record<string, FieldModification>;
|
|
164
174
|
pick?: string[];
|
|
165
175
|
orderRoot?: string[] | ((originalOrder: string[]) => string[]);
|
|
166
176
|
muteLogging?: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var Ya=Object.create;var hr=Object.defineProperty;var Za=Object.getOwnPropertyDescriptor;var Qa=Object.getOwnPropertyNames;var es=Object.getPrototypeOf,rs=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ts=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Qa(r))!rs.call(e,o)&&o!==t&&hr(e,o,{get:()=>r[o],enumerable:!(n=Za(r,o))||n.enumerable});return e};var A=(e,r,t)=>(t=e!=null?Ya(es(e)):{},ts(r||!e||!e.__esModule?hr(t,"default",{value:e,enumerable:!0}):t,e));var k=u((mm,mr)=>{"use strict";mr.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Je=u(q=>{"use strict";var d=k(),je=()=>[{type:d.RANGE,from:48,to:57}],gr=()=>[{type:d.CHAR,value:95},{type:d.RANGE,from:97,to:122},{type:d.RANGE,from:65,to:90}].concat(je()),yr=()=>[{type:d.CHAR,value:9},{type:d.CHAR,value:10},{type:d.CHAR,value:11},{type:d.CHAR,value:12},{type:d.CHAR,value:13},{type:d.CHAR,value:32},{type:d.CHAR,value:160},{type:d.CHAR,value:5760},{type:d.RANGE,from:8192,to:8202},{type:d.CHAR,value:8232},{type:d.CHAR,value:8233},{type:d.CHAR,value:8239},{type:d.CHAR,value:8287},{type:d.CHAR,value:12288},{type:d.CHAR,value:65279}],ns=()=>[{type:d.CHAR,value:10},{type:d.CHAR,value:13},{type:d.CHAR,value:8232},{type:d.CHAR,value:8233}];q.words=()=>({type:d.SET,set:gr(),not:!1});q.notWords=()=>({type:d.SET,set:gr(),not:!0});q.ints=()=>({type:d.SET,set:je(),not:!1});q.notInts=()=>({type:d.SET,set:je(),not:!0});q.whitespace=()=>({type:d.SET,set:yr(),not:!1});q.notWhitespace=()=>({type:d.SET,set:yr(),not:!0});q.anyChar=()=>({type:d.SET,set:ns(),not:!0})});var xr=u(W=>{"use strict";var br=k(),F=Je(),is="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",os={0:0,t:9,n:10,v:11,f:12,r:13};W.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,o,i,a,s,l,c){if(o)return t;var f=n?8:i?parseInt(i,16):a?parseInt(a,16):s?parseInt(s,8):l?is.indexOf(l):os[c],p=String.fromCharCode(f);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};W.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,o,i;(o=n.exec(e))!=null;)if(o[1])t.push(F.words());else if(o[2])t.push(F.ints());else if(o[3])t.push(F.whitespace());else if(o[4])t.push(F.notWords());else if(o[5])t.push(F.notInts());else if(o[6])t.push(F.notWhitespace());else if(o[7])t.push({type:br.RANGE,from:(o[8]||o[9]).charCodeAt(0),to:o[10].charCodeAt(0)});else if(i=o[12])t.push({type:br.CHAR,value:i.charCodeAt(0)});else return[t,n.lastIndex];W.error(r,"Unterminated character class")};W.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Sr=u(K=>{"use strict";var pe=k();K.wordBoundary=()=>({type:pe.POSITION,value:"b"});K.nonWordBoundary=()=>({type:pe.POSITION,value:"B"});K.begin=()=>({type:pe.POSITION,value:"^"});K.end=()=>({type:pe.POSITION,value:"$"})});var Or=u((xm,Fe)=>{"use strict";var N=xr(),O=k(),V=Je(),de=Sr();Fe.exports=e=>{var r=0,t,n,o={type:O.ROOT,stack:[]},i=o,a=o.stack,s=[],l=Xa=>{N.error(e,`Nothing to repeat at column ${Xa-1}`)},c=N.strToChars(e);for(t=c.length;r<t;)switch(n=c[r++],n){case"\\":switch(n=c[r++],n){case"b":a.push(de.wordBoundary());break;case"B":a.push(de.nonWordBoundary());break;case"w":a.push(V.words());break;case"W":a.push(V.notWords());break;case"d":a.push(V.ints());break;case"D":a.push(V.notInts());break;case"s":a.push(V.whitespace());break;case"S":a.push(V.notWhitespace());break;default:/\d/.test(n)?a.push({type:O.REFERENCE,value:parseInt(n,10)}):a.push({type:O.CHAR,value:n.charCodeAt(0)})}break;case"^":a.push(de.begin());break;case"$":a.push(de.end());break;case"[":var f;c[r]==="^"?(f=!0,r++):f=!1;var p=N.tokenizeClass(c.slice(r),e);r+=p[1],a.push({type:O.SET,set:p[0],not:f});break;case".":a.push(V.anyChar());break;case"(":var h={type:O.GROUP,stack:[],remember:!0};n=c[r],n==="?"&&(n=c[r+1],r+=2,n==="="?h.followedBy=!0:n==="!"?h.notFollowedBy=!0:n!==":"&&N.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),h.remember=!1),a.push(h),s.push(i),i=h,a=h.stack;break;case")":s.length===0&&N.error(e,`Unmatched ) at column ${r-1}`),i=s.pop(),a=i.options?i.options[i.options.length-1]:i.stack;break;case"|":i.options||(i.options=[i.stack],delete i.stack);var b=[];i.options.push(b),a=b;break;case"{":var g=/^(\d+)(,(\d+)?)?\}/.exec(c.slice(r)),J,dr;g!==null?(a.length===0&&l(r),J=parseInt(g[1],10),dr=g[2]?g[3]?parseInt(g[3],10):1/0:J,r+=g[0].length,a.push({type:O.REPETITION,min:J,max:dr,value:a.pop()})):a.push({type:O.CHAR,value:123});break;case"?":a.length===0&&l(r),a.push({type:O.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&l(r),a.push({type:O.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&l(r),a.push({type:O.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:O.CHAR,value:n.charCodeAt(0)})}return s.length!==0&&N.error(e,"Unterminated group"),o};Fe.exports.types=O});var Er=u((Sm,vr)=>{"use strict";var P=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},Ne=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=o=>{for(var i=0;i<this.ranges.length&&!o.touches(this.ranges[i]);)i++;for(var a=this.ranges.slice(0,i);i<this.ranges.length&&o.touches(this.ranges[i]);)o=o.add(this.ranges[i]),i++;a.push(o),this.ranges=a.concat(this.ranges.slice(i)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}subtract(r,t){var n=o=>{for(var i=0;i<this.ranges.length&&!o.overlaps(this.ranges[i]);)i++;for(var a=this.ranges.slice(0,i);i<this.ranges.length&&o.overlaps(this.ranges[i]);)a=a.concat(this.ranges[i].subtract(o)),i++;this.ranges=a.concat(this.ranges.slice(i)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new P(r,t))),this}intersect(r,t){var n=[],o=i=>{for(var a=0;a<this.ranges.length&&!i.overlaps(this.ranges[a]);)a++;for(;a<this.ranges.length&&i.overlaps(this.ranges[a]);){var s=Math.max(this.ranges[a].low,i.low),l=Math.min(this.ranges[a].high,i.high);n.push(new P(s,l)),a++}};return r instanceof e?r.ranges.forEach(o):(t==null&&(t=r),o(new P(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};vr.exports=Ne});var qr=u((Om,Tr)=>{"use strict";var he=Or(),X=Er(),_=he.types;Tr.exports=class Y{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=he(r)}_setDefaults(r){this.max=r.max!=null?r.max:Y.prototype.max!=null?Y.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,o,i,a,s;switch(r.type){case _.ROOT:case _.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,o="",a=0,s=n.length;a<s;a++)o+=this._gen(n[a],t);return r.remember&&(t[r.groupNumber]=o),o;case _.POSITION:return"";case _.SET:var l=this._expand(r);return l.length?String.fromCharCode(this._randSelect(l)):"";case _.REPETITION:for(i=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),o="",a=0;a<i;a++)o+=this._gen(r.value,t);return o;case _.REFERENCE:return t[r.value-1]||"";case _.CHAR:var c=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(c)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof X?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===he.types.CHAR)return new X(r.value);if(r.type===he.types.RANGE)return new X(r.from,r.to);{let t=new X;for(let n=0;n<r.set.length;n++){let o=this._expand(r.set[n]);if(t.add(o),this.ignoreCase)for(let i=0;i<o.length;i++){let a=o.index(i),s=this._toOtherCase(a);a!==s&&t.add(s)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new X(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new Y(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Y.randexp(this)}}}});var Be=u((_g,ot)=>{"use strict";var Ms=typeof global=="object"&&global&&global.Object===Object&&global;ot.exports=Ms});var C=u((wg,at)=>{"use strict";var Ls=Be(),Ds=typeof self=="object"&&self&&self.Object===Object&&self,Bs=Ls||Ds||Function("return this")();at.exports=Bs});var ee=u((Cg,st)=>{"use strict";var $s=C(),Us=$s.Symbol;st.exports=Us});var ct=u((Rg,ft)=>{"use strict";var ut=ee(),lt=Object.prototype,Hs=lt.hasOwnProperty,zs=lt.toString,re=ut?ut.toStringTag:void 0;function Gs(e){var r=Hs.call(e,re),t=e[re];try{e[re]=void 0;var n=!0}catch{}var o=zs.call(e);return n&&(r?e[re]=t:delete e[re]),o}ft.exports=Gs});var dt=u((jg,pt)=>{"use strict";var ks=Object.prototype,Ws=ks.toString;function Ks(e){return Ws.call(e)}pt.exports=Ks});var M=u((Jg,gt)=>{"use strict";var ht=ee(),Xs=ct(),Ys=dt(),Zs="[object Null]",Qs="[object Undefined]",mt=ht?ht.toStringTag:void 0;function eu(e){return e==null?e===void 0?Qs:Zs:mt&&mt in Object(e)?Xs(e):Ys(e)}gt.exports=eu});var T=u((Fg,yt)=>{"use strict";function ru(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}yt.exports=ru});var Se=u((Ng,bt)=>{"use strict";var tu=M(),nu=T(),iu="[object AsyncFunction]",ou="[object Function]",au="[object GeneratorFunction]",su="[object Proxy]";function uu(e){if(!nu(e))return!1;var r=tu(e);return r==ou||r==au||r==iu||r==su}bt.exports=uu});var St=u((Pg,xt)=>{"use strict";var lu=C(),fu=lu["__core-js_shared__"];xt.exports=fu});var Et=u((Mg,vt)=>{"use strict";var $e=St(),Ot=function(){var e=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function cu(e){return!!Ot&&Ot in e}vt.exports=cu});var qt=u((Lg,Tt)=>{"use strict";var pu=Function.prototype,du=pu.toString;function hu(e){if(e!=null){try{return du.call(e)}catch{}try{return e+""}catch{}}return""}Tt.exports=hu});var At=u((Dg,It)=>{"use strict";var mu=Se(),gu=Et(),yu=T(),bu=qt(),xu=/[\\^$.*+?()[\]{}|]/g,Su=/^\[object .+?Constructor\]$/,Ou=Function.prototype,vu=Object.prototype,Eu=Ou.toString,Tu=vu.hasOwnProperty,qu=RegExp("^"+Eu.call(Tu).replace(xu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iu(e){if(!yu(e)||gu(e))return!1;var r=mu(e)?qu:Su;return r.test(bu(e))}It.exports=Iu});var _t=u((Bg,Vt)=>{"use strict";function Au(e,r){return e?.[r]}Vt.exports=Au});var Oe=u(($g,wt)=>{"use strict";var Vu=At(),_u=_t();function wu(e,r){var t=_u(e,r);return Vu(t)?t:void 0}wt.exports=wu});var te=u((Ug,Ct)=>{"use strict";var Cu=Oe(),Ru=Cu(Object,"create");Ct.exports=Ru});var Jt=u((Hg,jt)=>{"use strict";var Rt=te();function ju(){this.__data__=Rt?Rt(null):{},this.size=0}jt.exports=ju});var Nt=u((zg,Ft)=>{"use strict";function Ju(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}Ft.exports=Ju});var Mt=u((Gg,Pt)=>{"use strict";var Fu=te(),Nu="__lodash_hash_undefined__",Pu=Object.prototype,Mu=Pu.hasOwnProperty;function Lu(e){var r=this.__data__;if(Fu){var t=r[e];return t===Nu?void 0:t}return Mu.call(r,e)?r[e]:void 0}Pt.exports=Lu});var Dt=u((kg,Lt)=>{"use strict";var Du=te(),Bu=Object.prototype,$u=Bu.hasOwnProperty;function Uu(e){var r=this.__data__;return Du?r[e]!==void 0:$u.call(r,e)}Lt.exports=Uu});var $t=u((Wg,Bt)=>{"use strict";var Hu=te(),zu="__lodash_hash_undefined__";function Gu(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Hu&&r===void 0?zu:r,this}Bt.exports=Gu});var Ht=u((Kg,Ut)=>{"use strict";var ku=Jt(),Wu=Nt(),Ku=Mt(),Xu=Dt(),Yu=$t();function L(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}L.prototype.clear=ku;L.prototype.delete=Wu;L.prototype.get=Ku;L.prototype.has=Xu;L.prototype.set=Yu;Ut.exports=L});var Gt=u((Xg,zt)=>{"use strict";function Zu(){this.__data__=[],this.size=0}zt.exports=Zu});var ne=u((Yg,kt)=>{"use strict";function Qu(e,r){return e===r||e!==e&&r!==r}kt.exports=Qu});var ie=u((Zg,Wt)=>{"use strict";var el=ne();function rl(e,r){for(var t=e.length;t--;)if(el(e[t][0],r))return t;return-1}Wt.exports=rl});var Xt=u((Qg,Kt)=>{"use strict";var tl=ie(),nl=Array.prototype,il=nl.splice;function ol(e){var r=this.__data__,t=tl(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():il.call(r,t,1),--this.size,!0}Kt.exports=ol});var Zt=u((ey,Yt)=>{"use strict";var al=ie();function sl(e){var r=this.__data__,t=al(r,e);return t<0?void 0:r[t][1]}Yt.exports=sl});var en=u((ry,Qt)=>{"use strict";var ul=ie();function ll(e){return ul(this.__data__,e)>-1}Qt.exports=ll});var tn=u((ty,rn)=>{"use strict";var fl=ie();function cl(e,r){var t=this.__data__,n=fl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}rn.exports=cl});var oe=u((ny,nn)=>{"use strict";var pl=Gt(),dl=Xt(),hl=Zt(),ml=en(),gl=tn();function D(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}D.prototype.clear=pl;D.prototype.delete=dl;D.prototype.get=hl;D.prototype.has=ml;D.prototype.set=gl;nn.exports=D});var Ue=u((iy,on)=>{"use strict";var yl=Oe(),bl=C(),xl=yl(bl,"Map");on.exports=xl});var un=u((oy,sn)=>{"use strict";var an=Ht(),Sl=oe(),Ol=Ue();function vl(){this.size=0,this.__data__={hash:new an,map:new(Ol||Sl),string:new an}}sn.exports=vl});var fn=u((ay,ln)=>{"use strict";function El(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}ln.exports=El});var ae=u((sy,cn)=>{"use strict";var Tl=fn();function ql(e,r){var t=e.__data__;return Tl(r)?t[typeof r=="string"?"string":"hash"]:t.map}cn.exports=ql});var dn=u((uy,pn)=>{"use strict";var Il=ae();function Al(e){var r=Il(this,e).delete(e);return this.size-=r?1:0,r}pn.exports=Al});var mn=u((ly,hn)=>{"use strict";var Vl=ae();function _l(e){return Vl(this,e).get(e)}hn.exports=_l});var yn=u((fy,gn)=>{"use strict";var wl=ae();function Cl(e){return wl(this,e).has(e)}gn.exports=Cl});var xn=u((cy,bn)=>{"use strict";var Rl=ae();function jl(e,r){var t=Rl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}bn.exports=jl});var ve=u((py,Sn)=>{"use strict";var Jl=un(),Fl=dn(),Nl=mn(),Pl=yn(),Ml=xn();function B(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}B.prototype.clear=Jl;B.prototype.delete=Fl;B.prototype.get=Nl;B.prototype.has=Pl;B.prototype.set=Ml;Sn.exports=B});var vn=u((dy,On)=>{"use strict";var Ll="__lodash_hash_undefined__";function Dl(e){return this.__data__.set(e,Ll),this}On.exports=Dl});var Tn=u((hy,En)=>{"use strict";function Bl(e){return this.__data__.has(e)}En.exports=Bl});var He=u((my,qn)=>{"use strict";var $l=ve(),Ul=vn(),Hl=Tn();function Ee(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new $l;++r<t;)this.add(e[r])}Ee.prototype.add=Ee.prototype.push=Ul;Ee.prototype.has=Hl;qn.exports=Ee});var An=u((gy,In)=>{"use strict";function zl(e,r,t,n){for(var o=e.length,i=t+(n?1:-1);n?i--:++i<o;)if(r(e[i],i,e))return i;return-1}In.exports=zl});var _n=u((yy,Vn)=>{"use strict";function Gl(e){return e!==e}Vn.exports=Gl});var Cn=u((by,wn)=>{"use strict";function kl(e,r,t){for(var n=t-1,o=e.length;++n<o;)if(e[n]===r)return n;return-1}wn.exports=kl});var jn=u((xy,Rn)=>{"use strict";var Wl=An(),Kl=_n(),Xl=Cn();function Yl(e,r,t){return r===r?Xl(e,r,t):Wl(e,Kl,t)}Rn.exports=Yl});var ze=u((Sy,Jn)=>{"use strict";var Zl=jn();function Ql(e,r){var t=e==null?0:e.length;return!!t&&Zl(e,r,0)>-1}Jn.exports=Ql});var Ge=u((Oy,Fn)=>{"use strict";function ef(e,r,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(r,e[n]))return!0;return!1}Fn.exports=ef});var se=u((vy,Nn)=>{"use strict";function rf(e,r){for(var t=-1,n=e==null?0:e.length,o=Array(n);++t<n;)o[t]=r(e[t],t,e);return o}Nn.exports=rf});var Te=u((Ey,Pn)=>{"use strict";function tf(e){return function(r){return e(r)}}Pn.exports=tf});var ke=u((Ty,Mn)=>{"use strict";function nf(e,r){return e.has(r)}Mn.exports=nf});var Dn=u((qy,Ln)=>{"use strict";var of=He(),af=ze(),sf=Ge(),uf=se(),lf=Te(),ff=ke(),cf=200;function pf(e,r,t,n){var o=-1,i=af,a=!0,s=e.length,l=[],c=r.length;if(!s)return l;t&&(r=uf(r,lf(t))),n?(i=sf,a=!1):r.length>=cf&&(i=ff,a=!1,r=new of(r));e:for(;++o<s;){var f=e[o],p=t==null?f:t(f);if(f=n||f!==0?f:0,a&&p===p){for(var h=c;h--;)if(r[h]===p)continue e;l.push(f)}else i(r,p,n)||l.push(f)}return l}Ln.exports=pf});var $n=u((Iy,Bn)=>{"use strict";function df(e,r){for(var t=-1,n=r.length,o=e.length;++t<n;)e[o+t]=r[t];return e}Bn.exports=df});var R=u((Ay,Un)=>{"use strict";function hf(e){return e!=null&&typeof e=="object"}Un.exports=hf});var zn=u((Vy,Hn)=>{"use strict";var mf=M(),gf=R(),yf="[object Arguments]";function bf(e){return gf(e)&&mf(e)==yf}Hn.exports=bf});var qe=u((_y,Wn)=>{"use strict";var Gn=zn(),xf=R(),kn=Object.prototype,Sf=kn.hasOwnProperty,Of=kn.propertyIsEnumerable,vf=Gn(function(){return arguments}())?Gn:function(e){return xf(e)&&Sf.call(e,"callee")&&!Of.call(e,"callee")};Wn.exports=vf});var j=u((wy,Kn)=>{"use strict";var Ef=Array.isArray;Kn.exports=Ef});var Qn=u((Cy,Zn)=>{"use strict";var Xn=ee(),Tf=qe(),qf=j(),Yn=Xn?Xn.isConcatSpreadable:void 0;function If(e){return qf(e)||Tf(e)||!!(Yn&&e&&e[Yn])}Zn.exports=If});var ti=u((Ry,ri)=>{"use strict";var Af=$n(),Vf=Qn();function ei(e,r,t,n,o){var i=-1,a=e.length;for(t||(t=Vf),o||(o=[]);++i<a;){var s=e[i];r>0&&t(s)?r>1?ei(s,r-1,t,n,o):Af(o,s):n||(o[o.length]=s)}return o}ri.exports=ei});var We=u((jy,ni)=>{"use strict";function _f(e){return e}ni.exports=_f});var oi=u((Jy,ii)=>{"use strict";function wf(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}ii.exports=wf});var ui=u((Fy,si)=>{"use strict";var Cf=oi(),ai=Math.max;function Rf(e,r,t){return r=ai(r===void 0?e.length-1:r,0),function(){for(var n=arguments,o=-1,i=ai(n.length-r,0),a=Array(i);++o<i;)a[o]=n[r+o];o=-1;for(var s=Array(r+1);++o<r;)s[o]=n[o];return s[r]=t(a),Cf(e,this,s)}}si.exports=Rf});var fi=u((Ny,li)=>{"use strict";function jf(e){return function(){return e}}li.exports=jf});var Ke=u((Py,ci)=>{"use strict";var Jf=Oe(),Ff=function(){try{var e=Jf(Object,"defineProperty");return e({},"",{}),e}catch{}}();ci.exports=Ff});var hi=u((My,di)=>{"use strict";var Nf=fi(),pi=Ke(),Pf=We(),Mf=pi?function(e,r){return pi(e,"toString",{configurable:!0,enumerable:!1,value:Nf(r),writable:!0})}:Pf;di.exports=Mf});var gi=u((Ly,mi)=>{"use strict";var Lf=800,Df=16,Bf=Date.now;function $f(e){var r=0,t=0;return function(){var n=Bf(),o=Df-(n-t);if(t=n,o>0){if(++r>=Lf)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}mi.exports=$f});var bi=u((Dy,yi)=>{"use strict";var Uf=hi(),Hf=gi(),zf=Hf(Uf);yi.exports=zf});var Ie=u((By,xi)=>{"use strict";var Gf=We(),kf=ui(),Wf=bi();function Kf(e,r){return Wf(kf(e,r,Gf),e+"")}xi.exports=Kf});var Xe=u(($y,Si)=>{"use strict";var Xf=9007199254740991;function Yf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Xf}Si.exports=Yf});var Ae=u((Uy,Oi)=>{"use strict";var Zf=Se(),Qf=Xe();function ec(e){return e!=null&&Qf(e.length)&&!Zf(e)}Oi.exports=ec});var Ve=u((Hy,vi)=>{"use strict";var rc=Ae(),tc=R();function nc(e){return tc(e)&&rc(e)}vi.exports=nc});var qi=u((zy,Ti)=>{"use strict";var ic=Dn(),oc=ti(),ac=Ie(),Ei=Ve(),sc=ac(function(e,r){return Ei(e)?ic(e,oc(r,1,Ei,!0)):[]});Ti.exports=sc});var _e=u((Gy,Ii)=>{"use strict";var uc=M(),lc=R(),fc="[object Symbol]";function cc(e){return typeof e=="symbol"||lc(e)&&uc(e)==fc}Ii.exports=cc});var Vi=u((ky,Ai)=>{"use strict";var pc=j(),dc=_e(),hc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mc=/^\w*$/;function gc(e,r){if(pc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||dc(e)?!0:mc.test(e)||!hc.test(e)||r!=null&&e in Object(r)}Ai.exports=gc});var Ci=u((Wy,wi)=>{"use strict";var _i=ve(),yc="Expected a function";function Ye(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(yc);var t=function(){var n=arguments,o=r?r.apply(this,n):n[0],i=t.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return t.cache=i.set(o,a)||i,a};return t.cache=new(Ye.Cache||_i),t}Ye.Cache=_i;wi.exports=Ye});var ji=u((Ky,Ri)=>{"use strict";var bc=Ci(),xc=500;function Sc(e){var r=bc(e,function(n){return t.size===xc&&t.clear(),n}),t=r.cache;return r}Ri.exports=Sc});var Fi=u((Xy,Ji)=>{"use strict";var Oc=ji(),vc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ec=/\\(\\)?/g,Tc=Oc(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(vc,function(t,n,o,i){r.push(o?i.replace(Ec,"$1"):n||t)}),r});Ji.exports=Tc});var Bi=u((Yy,Di)=>{"use strict";var Ni=ee(),qc=se(),Ic=j(),Ac=_e(),Vc=1/0,Pi=Ni?Ni.prototype:void 0,Mi=Pi?Pi.toString:void 0;function Li(e){if(typeof e=="string")return e;if(Ic(e))return qc(e,Li)+"";if(Ac(e))return Mi?Mi.call(e):"";var r=e+"";return r=="0"&&1/e==-Vc?"-0":r}Di.exports=Li});var Ui=u((Zy,$i)=>{"use strict";var _c=Bi();function wc(e){return e==null?"":_c(e)}$i.exports=wc});var Ze=u((Qy,Hi)=>{"use strict";var Cc=j(),Rc=Vi(),jc=Fi(),Jc=Ui();function Fc(e,r){return Cc(e)?e:Rc(e,r)?[e]:jc(Jc(e))}Hi.exports=Fc});var Qe=u((eb,zi)=>{"use strict";var Nc=_e(),Pc=1/0;function Mc(e){if(typeof e=="string"||Nc(e))return e;var r=e+"";return r=="0"&&1/e==-Pc?"-0":r}zi.exports=Mc});var ki=u((rb,Gi)=>{"use strict";var Lc=Ze(),Dc=Qe();function Bc(e,r){r=Lc(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[Dc(r[t++])];return t&&t==n?e:void 0}Gi.exports=Bc});var Ki=u((tb,Wi)=>{"use strict";var $c=ki();function Uc(e,r,t){var n=e==null?void 0:$c(e,r);return n===void 0?t:n}Wi.exports=Uc});var Zi=u((nb,Yi)=>{"use strict";var Hc=He(),zc=ze(),Gc=Ge(),kc=se(),Wc=Te(),Xi=ke(),Kc=Math.min;function Xc(e,r,t){for(var n=t?Gc:zc,o=e[0].length,i=e.length,a=i,s=Array(i),l=1/0,c=[];a--;){var f=e[a];a&&r&&(f=kc(f,Wc(r))),l=Kc(f.length,l),s[a]=!t&&(r||o>=120&&f.length>=120)?new Hc(a&&f):void 0}f=e[0];var p=-1,h=s[0];e:for(;++p<o&&c.length<l;){var b=f[p],g=r?r(b):b;if(b=t||b!==0?b:0,!(h?Xi(h,g):n(c,g,t))){for(a=i;--a;){var J=s[a];if(!(J?Xi(J,g):n(e[a],g,t)))continue e}h&&h.push(g),c.push(b)}}return c}Yi.exports=Xc});var eo=u((ib,Qi)=>{"use strict";var Yc=Ve();function Zc(e){return Yc(e)?e:[]}Qi.exports=Zc});var to=u((ob,ro)=>{"use strict";var Qc=se(),ep=Zi(),rp=Ie(),tp=eo(),np=rp(function(e){var r=Qc(e,tp);return r.length&&r[0]===e[0]?ep(r):[]});ro.exports=np});var io=u((ab,no)=>{"use strict";var ip=oe();function op(){this.__data__=new ip,this.size=0}no.exports=op});var ao=u((sb,oo)=>{"use strict";function ap(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}oo.exports=ap});var uo=u((ub,so)=>{"use strict";function sp(e){return this.__data__.get(e)}so.exports=sp});var fo=u((lb,lo)=>{"use strict";function up(e){return this.__data__.has(e)}lo.exports=up});var po=u((fb,co)=>{"use strict";var lp=oe(),fp=Ue(),cp=ve(),pp=200;function dp(e,r){var t=this.__data__;if(t instanceof lp){var n=t.__data__;if(!fp||n.length<pp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new cp(n)}return t.set(e,r),this.size=t.size,this}co.exports=dp});var mo=u((cb,ho)=>{"use strict";var hp=oe(),mp=io(),gp=ao(),yp=uo(),bp=fo(),xp=po();function $(e){var r=this.__data__=new hp(e);this.size=r.size}$.prototype.clear=mp;$.prototype.delete=gp;$.prototype.get=yp;$.prototype.has=bp;$.prototype.set=xp;ho.exports=$});var we=u((pb,yo)=>{"use strict";var go=Ke();function Sp(e,r,t){r=="__proto__"&&go?go(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}yo.exports=Sp});var er=u((db,bo)=>{"use strict";var Op=we(),vp=ne();function Ep(e,r,t){(t!==void 0&&!vp(e[r],t)||t===void 0&&!(r in e))&&Op(e,r,t)}bo.exports=Ep});var So=u((hb,xo)=>{"use strict";function Tp(e){return function(r,t,n){for(var o=-1,i=Object(r),a=n(r),s=a.length;s--;){var l=a[e?s:++o];if(t(i[l],l,i)===!1)break}return r}}xo.exports=Tp});var vo=u((mb,Oo)=>{"use strict";var qp=So(),Ip=qp();Oo.exports=Ip});var Ao=u((ue,U)=>{"use strict";var Ap=C(),Io=typeof ue=="object"&&ue&&!ue.nodeType&&ue,Eo=Io&&typeof U=="object"&&U&&!U.nodeType&&U,Vp=Eo&&Eo.exports===Io,To=Vp?Ap.Buffer:void 0,qo=To?To.allocUnsafe:void 0;function _p(e,r){if(r)return e.slice();var t=e.length,n=qo?qo(t):new e.constructor(t);return e.copy(n),n}U.exports=_p});var _o=u((gb,Vo)=>{"use strict";var wp=C(),Cp=wp.Uint8Array;Vo.exports=Cp});var Ro=u((yb,Co)=>{"use strict";var wo=_o();function Rp(e){var r=new e.constructor(e.byteLength);return new wo(r).set(new wo(e)),r}Co.exports=Rp});var Jo=u((bb,jo)=>{"use strict";var jp=Ro();function Jp(e,r){var t=r?jp(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}jo.exports=Jp});var No=u((xb,Fo)=>{"use strict";function Fp(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}Fo.exports=Fp});var Lo=u((Sb,Mo)=>{"use strict";var Np=T(),Po=Object.create,Pp=function(){function e(){}return function(r){if(!Np(r))return{};if(Po)return Po(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();Mo.exports=Pp});var Bo=u((Ob,Do)=>{"use strict";function Mp(e,r){return function(t){return e(r(t))}}Do.exports=Mp});var rr=u((vb,$o)=>{"use strict";var Lp=Bo(),Dp=Lp(Object.getPrototypeOf,Object);$o.exports=Dp});var tr=u((Eb,Uo)=>{"use strict";var Bp=Object.prototype;function $p(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Bp;return e===t}Uo.exports=$p});var zo=u((Tb,Ho)=>{"use strict";var Up=Lo(),Hp=rr(),zp=tr();function Gp(e){return typeof e.constructor=="function"&&!zp(e)?Up(Hp(e)):{}}Ho.exports=Gp});var ko=u((qb,Go)=>{"use strict";function kp(){return!1}Go.exports=kp});var nr=u((le,H)=>{"use strict";var Wp=C(),Kp=ko(),Xo=typeof le=="object"&&le&&!le.nodeType&&le,Wo=Xo&&typeof H=="object"&&H&&!H.nodeType&&H,Xp=Wo&&Wo.exports===Xo,Ko=Xp?Wp.Buffer:void 0,Yp=Ko?Ko.isBuffer:void 0,Zp=Yp||Kp;H.exports=Zp});var Qo=u((Ib,Zo)=>{"use strict";var Qp=M(),ed=rr(),rd=R(),td="[object Object]",nd=Function.prototype,id=Object.prototype,Yo=nd.toString,od=id.hasOwnProperty,ad=Yo.call(Object);function sd(e){if(!rd(e)||Qp(e)!=td)return!1;var r=ed(e);if(r===null)return!0;var t=od.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Yo.call(t)==ad}Zo.exports=sd});var ra=u((Ab,ea)=>{"use strict";var ud=M(),ld=Xe(),fd=R(),cd="[object Arguments]",pd="[object Array]",dd="[object Boolean]",hd="[object Date]",md="[object Error]",gd="[object Function]",yd="[object Map]",bd="[object Number]",xd="[object Object]",Sd="[object RegExp]",Od="[object Set]",vd="[object String]",Ed="[object WeakMap]",Td="[object ArrayBuffer]",qd="[object DataView]",Id="[object Float32Array]",Ad="[object Float64Array]",Vd="[object Int8Array]",_d="[object Int16Array]",wd="[object Int32Array]",Cd="[object Uint8Array]",Rd="[object Uint8ClampedArray]",jd="[object Uint16Array]",Jd="[object Uint32Array]",m={};m[Id]=m[Ad]=m[Vd]=m[_d]=m[wd]=m[Cd]=m[Rd]=m[jd]=m[Jd]=!0;m[cd]=m[pd]=m[Td]=m[dd]=m[qd]=m[hd]=m[md]=m[gd]=m[yd]=m[bd]=m[xd]=m[Sd]=m[Od]=m[vd]=m[Ed]=!1;function Fd(e){return fd(e)&&ld(e.length)&&!!m[ud(e)]}ea.exports=Fd});var na=u((fe,z)=>{"use strict";var Nd=Be(),ta=typeof fe=="object"&&fe&&!fe.nodeType&&fe,ce=ta&&typeof z=="object"&&z&&!z.nodeType&&z,Pd=ce&&ce.exports===ta,ir=Pd&&Nd.process,Md=function(){try{var e=ce&&ce.require&&ce.require("util").types;return e||ir&&ir.binding&&ir.binding("util")}catch{}}();z.exports=Md});var or=u((Vb,aa)=>{"use strict";var Ld=ra(),Dd=Te(),ia=na(),oa=ia&&ia.isTypedArray,Bd=oa?Dd(oa):Ld;aa.exports=Bd});var ar=u((_b,sa)=>{"use strict";function $d(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}sa.exports=$d});var sr=u((wb,ua)=>{"use strict";var Ud=we(),Hd=ne(),zd=Object.prototype,Gd=zd.hasOwnProperty;function kd(e,r,t){var n=e[r];(!(Gd.call(e,r)&&Hd(n,t))||t===void 0&&!(r in e))&&Ud(e,r,t)}ua.exports=kd});var fa=u((Cb,la)=>{"use strict";var Wd=sr(),Kd=we();function Xd(e,r,t,n){var o=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var s=r[i],l=n?n(t[s],e[s],s,t,e):void 0;l===void 0&&(l=e[s]),o?Kd(t,s,l):Wd(t,s,l)}return t}la.exports=Xd});var pa=u((Rb,ca)=>{"use strict";function Yd(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}ca.exports=Yd});var Ce=u((jb,da)=>{"use strict";var Zd=9007199254740991,Qd=/^(?:0|[1-9]\d*)$/;function eh(e,r){var t=typeof e;return r=r??Zd,!!r&&(t=="number"||t!="symbol"&&Qd.test(e))&&e>-1&&e%1==0&&e<r}da.exports=eh});var ma=u((Jb,ha)=>{"use strict";var rh=pa(),th=qe(),nh=j(),ih=nr(),oh=Ce(),ah=or(),sh=Object.prototype,uh=sh.hasOwnProperty;function lh(e,r){var t=nh(e),n=!t&&th(e),o=!t&&!n&&ih(e),i=!t&&!n&&!o&&ah(e),a=t||n||o||i,s=a?rh(e.length,String):[],l=s.length;for(var c in e)(r||uh.call(e,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||oh(c,l)))&&s.push(c);return s}ha.exports=lh});var ya=u((Fb,ga)=>{"use strict";function fh(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}ga.exports=fh});var xa=u((Nb,ba)=>{"use strict";var ch=T(),ph=tr(),dh=ya(),hh=Object.prototype,mh=hh.hasOwnProperty;function gh(e){if(!ch(e))return dh(e);var r=ph(e),t=[];for(var n in e)n=="constructor"&&(r||!mh.call(e,n))||t.push(n);return t}ba.exports=gh});var ur=u((Pb,Sa)=>{"use strict";var yh=ma(),bh=xa(),xh=Ae();function Sh(e){return xh(e)?yh(e,!0):bh(e)}Sa.exports=Sh});var va=u((Mb,Oa)=>{"use strict";var Oh=fa(),vh=ur();function Eh(e){return Oh(e,vh(e))}Oa.exports=Eh});var Va=u((Lb,Aa)=>{"use strict";var Ea=er(),Th=Ao(),qh=Jo(),Ih=No(),Ah=zo(),Ta=qe(),qa=j(),Vh=Ve(),_h=nr(),wh=Se(),Ch=T(),Rh=Qo(),jh=or(),Ia=ar(),Jh=va();function Fh(e,r,t,n,o,i,a){var s=Ia(e,t),l=Ia(r,t),c=a.get(l);if(c){Ea(e,t,c);return}var f=i?i(s,l,t+"",e,r,a):void 0,p=f===void 0;if(p){var h=qa(l),b=!h&&_h(l),g=!h&&!b&&jh(l);f=l,h||b||g?qa(s)?f=s:Vh(s)?f=Ih(s):b?(p=!1,f=Th(l,!0)):g?(p=!1,f=qh(l,!0)):f=[]:Rh(l)||Ta(l)?(f=s,Ta(s)?f=Jh(s):(!Ch(s)||wh(s))&&(f=Ah(l))):p=!1}p&&(a.set(l,f),o(f,l,n,i,a),a.delete(l)),Ea(e,t,f)}Aa.exports=Fh});var lr=u((Db,wa)=>{"use strict";var Nh=mo(),Ph=er(),Mh=vo(),Lh=Va(),Dh=T(),Bh=ur(),$h=ar();function _a(e,r,t,n,o){e!==r&&Mh(r,function(i,a){if(o||(o=new Nh),Dh(i))Lh(e,r,a,t,_a,n,o);else{var s=n?n($h(e,a),i,a+"",e,r,o):void 0;s===void 0&&(s=i),Ph(e,a,s)}},Bh)}wa.exports=_a});var Ra=u((Bb,Ca)=>{"use strict";var Uh=ne(),Hh=Ae(),zh=Ce(),Gh=T();function kh(e,r,t){if(!Gh(t))return!1;var n=typeof r;return(n=="number"?Hh(t)&&zh(r,t.length):n=="string"&&r in t)?Uh(t[r],e):!1}Ca.exports=kh});var fr=u(($b,ja)=>{"use strict";var Wh=Ie(),Kh=Ra();function Xh(e){return Wh(function(r,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&Kh(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),r=Object(r);++n<o;){var s=t[n];s&&e(r,s,n,i)}return r})}ja.exports=Xh});var Fa=u((Ub,Ja)=>{"use strict";var Yh=lr(),Zh=fr(),Qh=Zh(function(e,r,t){Yh(e,r,t)});Ja.exports=Qh});var Pa=u((Hb,Na)=>{"use strict";var em=lr(),rm=fr(),tm=rm(function(e,r,t,n){em(e,r,t,n)});Na.exports=tm});var Da=u((zb,La)=>{"use strict";var nm=sr(),im=Ze(),om=Ce(),Ma=T(),am=Qe();function sm(e,r,t,n){if(!Ma(e))return e;r=im(r,e);for(var o=-1,i=r.length,a=i-1,s=e;s!=null&&++o<i;){var l=am(r[o]),c=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(o!=a){var f=s[l];c=n?n(f,l,s):void 0,c===void 0&&(c=Ma(f)?f:om(r[o+1])?[]:{})}nm(s,l,c),s=s[l]}return e}La.exports=sm});var $a=u((Gb,Ba)=>{"use strict";var um=Da();function lm(e,r,t){return e==null?e:um(e,r,t)}Ba.exports=lm});var jr=A(qr(),1);function Ar(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var as=["if","then","else"];function Ir(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Z(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(as.includes(t))continue;let o=e[t];if(Ir(n))Ir(o)?Z(o,n):o!==n&&(e[t]=n);else if(o&&Array.isArray(n)){let i=o;for(let a of n)a&&typeof a=="object"?Z(i,n):t==="required"?i.find(s=>s===a)||i.push(a):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Vr="yyyy-MM-dd";function _r(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function ss(e,r){let t=_r(e,r);return t==="GREATER"||t==="EQUAL"}function us(e,r){let t=_r(e,r);return t==="LESSER"||t==="EQUAL"}function wr(e,r,t,n=[]){let o=typeof e=="string",i=e==="",a=e===void 0||e===null&&t.treatNullAsUndefined,s=i||a,l=[];if(!o||s||r["x-jsf-presentation"]===void 0)return l;let{minDate:c,maxDate:f}=r["x-jsf-presentation"];return c&&!ss(e,c)&&l.push({path:n,validation:"minDate",schema:r,value:e}),f&&!us(e,f)&&l.push({path:n,validation:"maxDate",schema:r,value:e}),l}function Cr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Rr="Please acknowledge this field";function Jr(e,r,t,n){let o=e["x-jsf-presentation"];switch(t){case"type":return ls(e.type);case"required":return Cr(e)?Rr:"Required field";case"forbidden":return"Not allowed";case"const":return Cr(e)&&r===!1?Rr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${Pe(r)}" is not valid.`;case"anyOf":return`The option "${Pe(r)}" is not valid.`;case"oneOf":return`The option "${Pe(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,jr.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let i=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Vr.toLowerCase()} format. e.g. ${i}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${o?.minDate} or after.`;case"maxDate":return`The date must be ${o?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let i=o?.maxFileSize,a=typeof i=="number"?Ar(i):void 0;return`File size too large.${a?` The limit is ${a} MB.`:""}`}case"accept":{let i=o?.accept;return`Unsupported file format.${i?` The acceptable formats are ${i}.`:""}`}case"minItems":{let i=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${i}`}case"maxItems":{let i=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${i}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"json-logic":return n||"The value is not valid"}}function ls(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function Pe(e){return typeof e=="string"?e:JSON.stringify(e)}function fs(e,r){let t={};return r.forEach((o,i)=>{t[o]=i}),e.sort((o,i)=>{let a=t[o.name]??1/0,s=t[i.name]??1/0;return a!==s?a-s:e.indexOf(o)-e.indexOf(i)})}function Me(e,r){if(typeof e=="boolean")throw new Error("Schema must be an object");return e["x-jsf-order"]!==void 0?fs(r,e["x-jsf-order"]):r}function cs(e,r,t){r.checkboxValue=t.const,t.type==="boolean"&&(r.checkboxValue=!0)}function ps(e,r){if(e.options===void 0){let t=ms(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function ds(e,r,t,n){if(e.options===void 0){let o=bs(r,t,n);o&&(e.fields=o)}}function hs(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function Fr(e,r,t,n){let o=t["x-jsf-presentation"];if(o?.inputType)return o.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
|
|
2
|
-
You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return hs(e||t.type||"string",t)}function me(e){return e.filter(r=>r!==null&&typeof r=="object"&&r.const!==null).map(r=>{let t=r.title,n=r.const,i=r["x-jsf-presentation"]?.meta,a={label:t||"",value:n};i&&(a.meta=i);let{title:s,const:l,"x-jsf-presentation":c,...f}=r;return{...a,...f}})}function ms(e){if(e.oneOf)return me(e.oneOf||[]);if(e.items?.anyOf)return me(e.items.anyOf);if(e.anyOf)return me(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return me(r)}return null}function gs(e,r,t){let n=[];for(let i in e.properties){let a=e.required?.includes(i)||!1,s=w({schema:e.properties[i],name:i,required:a,originalSchema:r.properties?.[i]||e.properties[i],strictInputType:t});s&&n.push(s)}return Me(e,n)}function ys(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let i=e.items;for(let a in i.properties){let s=i.required?.includes(a)||!1,l=w({schema:i.properties[a],name:a,required:s,originalSchema:r,strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let i=w({schema:e.items,name:"item",required:!1,originalSchema:r,strictInputType:t});i&&n.push(i)}return Me(e.items,n)}function bs(e,r,t){return typeof e.properties=="object"&&e.properties!==null?gs(e,r,t):typeof e.items=="object"&&e.items!==null?ys(e,r,t):null}var xs=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function w({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:o=!1,type:i=void 0}){if(e===!1){let f=Fr(i,r,n,o),p=["fieldset","group-array"].includes(f);return{type:f,name:r,inputType:f,jsonType:"boolean",required:t,isVisible:!1,...p&&{fields:[]}}}if(typeof e=="boolean")return null;let a=e["x-jsf-presentation"]||{},s=e["x-jsf-errorMessage"],l=Fr(i,r,e,o),c={...Object.entries(e).filter(([f])=>!xs.includes(f)).reduce((f,[p,h])=>({...f,[p]:h}),{}),name:r,inputType:l,type:l,jsonType:i||e.type,required:t,isVisible:!0,...s&&{errorMessage:s}};return l==="checkbox"&&cs(l,c,e),e.title&&(c.label=e.title),Object.keys(a).length>0&&Object.entries(a).forEach(([f,p])=>{f!=="inputType"&&(c[f]=p)}),ps(c,e),ds(c,e,n),c}import ge from"json-logic-js";function be(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function Nr(e){return/\{\{.*?\}\}/.test(e)}function ye(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function Pr(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(o=>{let i=r?.schema?.validations?.[o],a=r?.value;if(!i)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${o}" doesn't exist.`);if(ge.apply(i.rule,ye(a))===!1){let l=i.errorMessage;return l&&Nr(l)&&(l=l.replace(/\{\{(.*?)\}\}/g,(c,f)=>{let p=f.trim(),h=r.schema.computedValues?.[p];return h?ge.apply(h.rule,ye(a)):ge.apply({var:p},ye(a))})),[{path:t,validation:"json-logic",customErrorMessage:l,schema:e,value:a}]}return[]}).flat()}function Ss(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return ge.apply(r,ye(t))}function Mr(e,r,t){if(r){let n={};Object.entries(r).forEach(([o,i])=>{let a=Ss(o,i.rule,t);n[o]=a}),Lr(e,n)}return e}function Lr(e,r){function t(n){let o=n["x-jsf-logic-computedAttrs"];o&&Os(n,r,o),n.type==="object"&&n.properties&&Lr(n,r),delete n["x-jsf-logic-computedAttrs"]}if(e.properties)for(let n in e.properties)t(e.properties[n]);else t(e)}function Os(e,r,t){function n(i){return Nr(i)?i.replace(/\{\{(.*?)\}\}/g,(a,s)=>{let l=s.trim();return r[l]||`{{${l}}}`}):r[i]}function o(i,a,s,l){let c=a;i[c]||(i[c]={}),Object.entries(s).forEach(([f,p])=>{typeof p=="string"?i[c][f]=n(p):o(i[c],f,p,l)})}for(let i in t){let a=i,s=t[i];typeof s=="string"?e[a]=n(s):o(e,a,s,r)}}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>E(t,r[n]));if(v(e)&&v(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!E(t,n)?!1:t.every(o=>E(e[o],r[o]))}return!1}function Dr(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch(r){console.warn("structuredClone failed, falling back to JSON method:",r)}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function Br(e,r,t,n,o){return Array.isArray(e)?[...vs(r,e,o),...Is(r,e,o),...qs(e,r,t,n,o),...Ts(r,e,t,n,o),...Es(r,e,t,n,o)]:[]}function vs(e,r,t){let n=[],o=r.length;return e.maxItems!==void 0&&o>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&o<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function Es(e,r,t,n,o){if(e.items===void 0)return[];let i=[],a=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[s,l]of r.slice(a).entries())i.push(...x(l,e.items,t,[...o,"items",s+a],n));return i}function Ts(e,r,t,n,o){if(!Array.isArray(e.prefixItems))return[];let i=[];for(let[a,s]of r.entries())a<e.prefixItems.length&&i.push(...x(s,e.prefixItems[a],t,[...o,"prefixItems",a],n));return i}function qs(e,r,t,n,o){if(!("contains"in r))return[];let i=[],a=e.filter(s=>x(s,r.contains,t,[...o,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?a<1&&i.push({path:o,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&a<r.minContains&&i.push({path:o,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&a>r.maxContains&&i.push({path:o,validation:"maxContains",schema:r,value:e})),i}function Is(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let o=0;o<r.length;o++){for(let i of n.values())if(E(r[o],i))return[{path:t,validation:"uniqueItems",schema:e,value:r[o]}];n.set(o,r[o])}return[]}function $r(e,r,t,n,o=[]){if(!r.allOf)return[];for(let i=0;i<r.allOf.length;i++){let a=r.allOf[i],s=x(e,a,t,[...o,"allOf",i],n);if(s.length>0)return s}return[]}function Ur(e,r,t,n,o=[]){if(!r.anyOf)return[];for(let i of r.anyOf)if(x(e,i,t,o,n).length===0)return[];return[{path:o,validation:"anyOf",schema:r,value:e}]}function Hr(e,r,t,n,o=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let i=0;for(let a=0;a<r.oneOf.length&&!(x(e,r.oneOf[a],t,o,n).length===0&&(i++,i>1));a++);return i===0?[{path:o,validation:"oneOf",schema:r,value:e}]:i>1?[{path:o,validation:"oneOf",schema:r,value:e}]:[]}function zr(e,r,t,n,o=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:o,validation:"not",schema:r,value:e}]:[]:x(e,r.not,t,o,n).length===0?[{path:o,validation:"not",schema:r,value:e}]:[]}function Gr(e,r,t,n,o=[]){if(r.if===void 0)return[];let i=x(e,r.if,t,o,n).length===0;return i&&r.then!==void 0?x(e,r.then,t,[...o,"then"],n):!i&&r.else!==void 0?x(e,r.else,t,[...o,"else"],n):[]}function kr(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:E(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function Wr(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function Kr(e,r,t=[]){let n=r["x-jsf-presentation"],o=n?.inputType==="file",i=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(o||i))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(c=>v(c)&&typeof c.name=="string"&&typeof c.size=="number"))return[{path:t,validation:"fileStructure",schema:r,value:e}];let l=e;if(typeof n?.maxFileSize=="number"){let c=n.maxFileSize*1024;if(l.some(p=>p.size>c))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let c=n.accept.toLowerCase().split(",").map(f=>f.trim()).filter(f=>f).map(f=>f.startsWith(".")?f:`.${f}`);if(c.length>0&&!l.some(p=>{let h=p.name.toLowerCase(),b=h.includes(".")?`.${h.split(".").pop()}`:"";return b!==""&&c.includes(b)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function Xr(e,r,t=[]){let n=[],o=Q(r);return typeof e!="number"?[]:o!==void 0&&!["number","integer"].includes(o)?[]:(r.multipleOf!==void 0&&e%r.multipleOf!==0&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function Yr(e,r,t,n,o=[]){if(typeof r=="object"&&r.properties&&v(e)){let i=[];for(let[a,s]of Object.entries(r.properties))i.push(...x(e[a],s,t,[...o,a],n));return i}return[]}var Zr;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(Zr||(Zr={}));var y;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(y||(y={}));var Qr;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(Qr||(Qr={}));var S={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},As={[y.DateTime]:e=>S.DATE_TIME.test(e),[y.Date]:e=>S.DATE.test(e),[y.Time]:e=>S.TIME.test(e),[y.Duration]:e=>S.DURATION.test(e),[y.Email]:e=>e.length<=254&&S.EMAIL.test(e),[y.IDNEmail]:e=>e.length<=254&&S.IDN_EMAIL.test(e),[y.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>S.HOSTNAME.test(t)),[y.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&S.IDN_HOSTNAME.test(t)),[y.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[y.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):S.IPV6_PART.test(n))},[y.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[y.URIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[y.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[y.IRIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[y.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[y.UUID]:e=>S.UUID.test(e),[y.JSONPointer]:e=>S.JSON_POINTER.test(e),[y.JSONPointerURIFragment]:e=>S.JSON_POINTER_URI_FRAGMENT.test(e),[y.RelativeJSONPointer]:e=>S.RELATIVE_JSON_POINTER.test(e),[y.URITemplate]:e=>S.URI_TEMPLATE.test(e)};function et(e,r,t=[]){let n=[];if(typeof e!="string")return n;let o=As[r.format];return o&&!o(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function rt(e,r,t=[]){let n=[],o=Q(r);if(typeof e!="string")return[];if(o!==void 0&&o!=="string")return[];let i=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&i<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&i>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let a=et(e,r,t);n.push(...a)}return n}function Q(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function Vs(e,r,t=[]){let n=Q(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let o=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let i of n){if(i==="array"&&Array.isArray(e))return[];if(o==="number"&&i==="integer"&&Number.isInteger(e))return[];if(o===i||i==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(o==="number"&&n==="integer"&&Number.isInteger(e))return[];if(o===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function _s(e,r,t={},n=[],o){return r?x(e,r,t,n,o):[]}function x(e,r,t={},n=[],o){let i=o,a;if(!o&&r["x-jsf-logic"]){i=be(r["x-jsf-logic"],e);let{validations:h,computedValues:b,...g}=r["x-jsf-logic"];a=g}let s=e===void 0||e===null&&t.treatNullAsUndefined,l=[];if(s)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let f=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!f&&(p=Vs(e,r,n),p.length>0))return p;if(r.required&&v(e)){let h=r.required.filter(b=>{let g=e[b];return Array.isArray(g)?g.length===0:v(g)?Object.keys(g).length===0:g===void 0||g===null&&t.treatNullAsUndefined});for(let b of h)l.push({path:[...n,b],validation:"required",schema:r?.properties?.[b]||r,value:e})}return[...l,...kr(e,r,n),...Wr(e,r,n),...Yr(e,r,t,i,n),...Br(e,r,t,i,n),...rt(e,r,n),...Xr(e,r,n),...Kr(e,r,n),...zr(e,r,t,i,n),...$r(e,r,t,i,n),...Ur(e,r,t,i,n),...Hr(e,r,t,i,n),...Gr(e,r,t,i,n),...wr(e,r,t,n),..._s(e,a,t,n,i),...Pr(r,i,n)]}function Le({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?be(e["x-jsf-logic"],r):void 0,o=Dr(e);return xe(o,r,t,n),n?.schema.computedValues&&Mr(o,n.schema.computedValues,r),o}function tt(e,r,t,n={}){let o=x(e,t.if,n).length===0,i=!1;return o&&t.if?.required&&(i=t.if.required.some(s=>{if(!r.properties||!r.properties[s])return!1;let l=r.properties[s],c=e[s];return x(c,l,n).some(p=>p.validation==="type")})),{rule:t,matches:o&&!i}}function xe(e,r={},t={},n){if(!v(r))return;let o=[];e.if&&o.push(tt(r,e,e,t)),(e.allOf??[]).filter(i=>typeof i.if<"u").forEach(i=>{let a=tt(r,e,i,t);o.push(a)});for(let{rule:i,matches:a}of o)a&&i.then?(nt(e,r,i.then,t,n),delete i.then):!a&&i.else&&(nt(e,r,i.else,t,n),delete i.else);if(e.properties){for(let[i,a]of Object.entries(e.properties))if(typeof a=="object"){let s=a;s.type==="object"&&xe(s,r[i],t,n),s.items&&xe(s.items,r[i],t,n)}}}function nt(e,r,t,n={},o){let i=t;xe(i,r,n,o),Z(e,i)}function De(e,r,t){let n=w({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let o of e){let i=n.find(a=>a.name===o.name);if(i){it(o,i),Z(o,i);let a=r.properties?.[o.name];a&&typeof a=="object"&&o.fields&&a.type==="object"&&De(o.fields,a,t)}}}function it(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&it(e[t],r[t]):delete e[t]}function ws(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function Cs(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let o=ws(n),i=r;for(let a=0;a<o.length-1;a++){let s=o[a];if(typeof s=="number"){if(!Array.isArray(i))throw new TypeError(`Expected an array at path: ${o.slice(0,a).join(".")}`);i[s]||(i[s]={}),i=i[s]}else typeof o[a+1]=="number"?s in i||(i[s]=[]):(!(s in i)||typeof i[s]=="string")&&(i[s]={}),i=i[s]}if(o.length>0){let a=o[o.length-1];i[a]=t.message}}return r}function Rs(e){return e.map(r=>{let{schema:t,value:n,validation:o,customErrorMessage:i}=r;return{...r,message:Jr(t,n,o,i)}})}function js(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,o=n["x-jsf-errorMessage"]?.[t.validation];return n&&o?{...t,message:o}:t})}function Js(e,r,t={}){let n={},o=x(e,r,t),i=Rs(o),a=js(i,r),s=Cs(a);return s&&(n.formErrors=s),n}function Fs(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return w({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function Ns(e){if(Object.prototype.hasOwnProperty.call(e,"modifyConfig"))throw new Error("`modifyConfig` is a deprecated option and it's not supported on json-schema-form v1")}function Ps(e,r={}){Ns(r);let t=r.initialValues||{},n=r.strictInputType||!1,o=Le({schema:e,values:t,options:r.validationOptions}),i=Fs({schema:o,originalSchema:e,strictInputType:n});return{fields:i,isError:!1,error:null,handleValidation:l=>{let c=Le({schema:e,values:l,options:r.validationOptions}),f=Js(l,c,r.validationOptions);return De(i,c,e),f}}}var Ua=A(qi(),1),I=A(Ki(),1),G=A(to(),1),Ha=A(Fa(),1),pr=A(Pa(),1),Re=A($a(),1);function za(e){return e.replace(".",".properties.")}function Ga(e,r){return Array.isArray(r)?r:void 0}function fm(e,r){let{if:t,then:n,else:o}=e;return(0,G.default)(t?.required||[],r).length>0||((0,G.default)(n?.required||[],r)||(0,G.default)(Object.keys(n?.properties||{}),r)).length>0||((0,G.default)(o?.required||[],r)||(0,G.default)(Object.keys(o?.properties||{}),r)).length>0}function ka(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([o,i])=>{let a=za(o);if(!(0,I.default)(e.properties,a)){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${o}" was ignored because it does not exist.`});return}let s=(0,I.default)(e.properties,a);if(!s)return{warnings:null};let l=typeof i=="function"?i(s):i,{properties:c,...f}=l;if((0,pr.default)((0,I.default)(e.properties,a),{...s,...f},Ga),l.properties){let p=ka((0,I.default)(e.properties,a),l.properties);p.warnings&&t.push(...p.warnings)}}),{warnings:t.flat()}}function Wa(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([o,i])=>{let a=n?`${n}.${o}`:o;(0,pr.default)((0,I.default)(e.properties,o),{...i,...r(a,i)},Ga),i.properties&&Wa(i,r,{parent:o})}),{warnings:null}}function cm(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],o=typeof r=="function"?r(n):r,i=(0,Ua.default)(n,o);return i.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${i.join(", ")}`}),e["x-jsf-order"]=[...o,...i],{warnings:t}}function Ka(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([o,i])=>{let a=za(o);if(!i)return{warnings:null};if(i.properties){let c=(0,I.default)(e.properties,a);if(!c)return{warnings:null};let f=Ka(c,i.properties);f.warnings&&t.push(...f.warnings)}if((0,I.default)(e.properties,a)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${o}" was ignored because it already exists.`});return}let l=(0,Re.default)({},a,i);(0,Ha.default)(e.properties,l)}),{warnings:t.flat()}}function pm(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([i,a])=>{switch(i){case"properties":r.forEach(s=>{(0,Re.default)(t.properties,s,a[s])});break;case"x-jsf-order":case"required":t[i]=a.filter(s=>r.includes(s));break;case"allOf":{let s=e[i]?.filter(l=>fm(l,r));t[i]=s;break}case"x-jsf-logic":t[i]=a;break}});let n={};t.allOf?.length&&t.allOf.forEach(i=>{let{if:a,then:s,else:l}=i,c=e.allOf?.indexOf(i);n={...n,...cr(a,{fields:r,path:`allOf[${c}].if`}),...cr(s,{fields:r,path:`allOf[${c}].then`}),...cr(l,{fields:r,path:`allOf[${c}].else`})}});let o=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([i])=>{(0,Re.default)(t.properties,i,e.properties?.[i])}),o.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(i=>`"${i}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:o}}function cr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(o=>{r.includes(o)||(n[o]={path:t})}),Object.entries(e.properties||[]).forEach(([o])=>{r.includes(o)||(n[o]={path:t})}),n}function dm(e,r){let t=JSON.parse(JSON.stringify(e)),n=ka(t,r.fields),o=Wa(t,r.allFields),i=Ka(t,r.create),a=pm(t,r.pick),s=a.schema,l=cm(s,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let c=[n.warnings,o.warnings,i.warnings,a.warnings,l.warnings].flat().filter(Boolean);return{schema:s,warnings:c}}export{Ps as createHeadlessForm,dm as modify};
|
|
1
|
+
var Za=Object.create;var hr=Object.defineProperty;var Qa=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var rs=Object.getPrototypeOf,ts=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ns=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of es(r))!ts.call(e,o)&&o!==t&&hr(e,o,{get:()=>r[o],enumerable:!(n=Qa(r,o))||n.enumerable});return e};var I=(e,r,t)=>(t=e!=null?Za(rs(e)):{},ns(r||!e||!e.__esModule?hr(t,"default",{value:e,enumerable:!0}):t,e));var k=u((gm,mr)=>{"use strict";mr.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Je=u(q=>{"use strict";var d=k(),je=()=>[{type:d.RANGE,from:48,to:57}],gr=()=>[{type:d.CHAR,value:95},{type:d.RANGE,from:97,to:122},{type:d.RANGE,from:65,to:90}].concat(je()),yr=()=>[{type:d.CHAR,value:9},{type:d.CHAR,value:10},{type:d.CHAR,value:11},{type:d.CHAR,value:12},{type:d.CHAR,value:13},{type:d.CHAR,value:32},{type:d.CHAR,value:160},{type:d.CHAR,value:5760},{type:d.RANGE,from:8192,to:8202},{type:d.CHAR,value:8232},{type:d.CHAR,value:8233},{type:d.CHAR,value:8239},{type:d.CHAR,value:8287},{type:d.CHAR,value:12288},{type:d.CHAR,value:65279}],is=()=>[{type:d.CHAR,value:10},{type:d.CHAR,value:13},{type:d.CHAR,value:8232},{type:d.CHAR,value:8233}];q.words=()=>({type:d.SET,set:gr(),not:!1});q.notWords=()=>({type:d.SET,set:gr(),not:!0});q.ints=()=>({type:d.SET,set:je(),not:!1});q.notInts=()=>({type:d.SET,set:je(),not:!0});q.whitespace=()=>({type:d.SET,set:yr(),not:!1});q.notWhitespace=()=>({type:d.SET,set:yr(),not:!0});q.anyChar=()=>({type:d.SET,set:is(),not:!0})});var xr=u(W=>{"use strict";var br=k(),J=Je(),os="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",as={0:0,t:9,n:10,v:11,f:12,r:13};W.strToChars=function(e){var r=/(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g;return e=e.replace(r,function(t,n,o,i,a,s,l,f){if(o)return t;var c=n?8:i?parseInt(i,16):a?parseInt(a,16):s?parseInt(s,8):l?os.indexOf(l):as[f],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};W.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,o,i;(o=n.exec(e))!=null;)if(o[1])t.push(J.words());else if(o[2])t.push(J.ints());else if(o[3])t.push(J.whitespace());else if(o[4])t.push(J.notWords());else if(o[5])t.push(J.notInts());else if(o[6])t.push(J.notWhitespace());else if(o[7])t.push({type:br.RANGE,from:(o[8]||o[9]).charCodeAt(0),to:o[10].charCodeAt(0)});else if(i=o[12])t.push({type:br.CHAR,value:i.charCodeAt(0)});else return[t,n.lastIndex];W.error(r,"Unterminated character class")};W.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Sr=u(K=>{"use strict";var pe=k();K.wordBoundary=()=>({type:pe.POSITION,value:"b"});K.nonWordBoundary=()=>({type:pe.POSITION,value:"B"});K.begin=()=>({type:pe.POSITION,value:"^"});K.end=()=>({type:pe.POSITION,value:"$"})});var Or=u((Sm,Fe)=>{"use strict";var F=xr(),O=k(),A=Je(),de=Sr();Fe.exports=e=>{var r=0,t,n,o={type:O.ROOT,stack:[]},i=o,a=o.stack,s=[],l=Ya=>{F.error(e,`Nothing to repeat at column ${Ya-1}`)},f=F.strToChars(e);for(t=f.length;r<t;)switch(n=f[r++],n){case"\\":switch(n=f[r++],n){case"b":a.push(de.wordBoundary());break;case"B":a.push(de.nonWordBoundary());break;case"w":a.push(A.words());break;case"W":a.push(A.notWords());break;case"d":a.push(A.ints());break;case"D":a.push(A.notInts());break;case"s":a.push(A.whitespace());break;case"S":a.push(A.notWhitespace());break;default:/\d/.test(n)?a.push({type:O.REFERENCE,value:parseInt(n,10)}):a.push({type:O.CHAR,value:n.charCodeAt(0)})}break;case"^":a.push(de.begin());break;case"$":a.push(de.end());break;case"[":var c;f[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(f.slice(r),e);r+=p[1],a.push({type:O.SET,set:p[0],not:c});break;case".":a.push(A.anyChar());break;case"(":var h={type:O.GROUP,stack:[],remember:!0};n=f[r],n==="?"&&(n=f[r+1],r+=2,n==="="?h.followedBy=!0:n==="!"?h.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),h.remember=!1),a.push(h),s.push(i),i=h,a=h.stack;break;case")":s.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),i=s.pop(),a=i.options?i.options[i.options.length-1]:i.stack;break;case"|":i.options||(i.options=[i.stack],delete i.stack);var b=[];i.options.push(b),a=b;break;case"{":var g=/^(\d+)(,(\d+)?)?\}/.exec(f.slice(r)),j,dr;g!==null?(a.length===0&&l(r),j=parseInt(g[1],10),dr=g[2]?g[3]?parseInt(g[3],10):1/0:j,r+=g[0].length,a.push({type:O.REPETITION,min:j,max:dr,value:a.pop()})):a.push({type:O.CHAR,value:123});break;case"?":a.length===0&&l(r),a.push({type:O.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&l(r),a.push({type:O.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&l(r),a.push({type:O.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:O.CHAR,value:n.charCodeAt(0)})}return s.length!==0&&F.error(e,"Unterminated group"),o};Fe.exports.types=O});var Er=u((Om,vr)=>{"use strict";var N=class e{constructor(r,t){this.low=r,this.high=t,this.length=1+t-r}overlaps(r){return!(this.high<r.low||this.low>r.high)}touches(r){return!(this.high+1<r.low||this.low-1>r.high)}add(r){return new e(Math.min(this.low,r.low),Math.max(this.high,r.high))}subtract(r){return r.low<=this.low&&r.high>=this.high?[]:r.low>this.low&&r.high<this.high?[new e(this.low,r.low-1),new e(r.high+1,this.high)]:r.low<=this.low?[new e(r.high+1,this.high)]:[new e(this.low,r.low-1)]}toString(){return this.low==this.high?this.low.toString():this.low+"-"+this.high}},Ne=class e{constructor(r,t){this.ranges=[],this.length=0,r!=null&&this.add(r,t)}_update_length(){this.length=this.ranges.reduce((r,t)=>r+t.length,0)}add(r,t){var n=o=>{for(var i=0;i<this.ranges.length&&!o.touches(this.ranges[i]);)i++;for(var a=this.ranges.slice(0,i);i<this.ranges.length&&o.touches(this.ranges[i]);)o=o.add(this.ranges[i]),i++;a.push(o),this.ranges=a.concat(this.ranges.slice(i)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new N(r,t))),this}subtract(r,t){var n=o=>{for(var i=0;i<this.ranges.length&&!o.overlaps(this.ranges[i]);)i++;for(var a=this.ranges.slice(0,i);i<this.ranges.length&&o.overlaps(this.ranges[i]);)a=a.concat(this.ranges[i].subtract(o)),i++;this.ranges=a.concat(this.ranges.slice(i)),this._update_length()};return r instanceof e?r.ranges.forEach(n):(t==null&&(t=r),n(new N(r,t))),this}intersect(r,t){var n=[],o=i=>{for(var a=0;a<this.ranges.length&&!i.overlaps(this.ranges[a]);)a++;for(;a<this.ranges.length&&i.overlaps(this.ranges[a]);){var s=Math.max(this.ranges[a].low,i.low),l=Math.min(this.ranges[a].high,i.high);n.push(new N(s,l)),a++}};return r instanceof e?r.ranges.forEach(o):(t==null&&(t=r),o(new N(r,t))),this.ranges=n,this._update_length(),this}index(r){for(var t=0;t<this.ranges.length&&this.ranges[t].length<=r;)r-=this.ranges[t].length,t++;return this.ranges[t].low+r}toString(){return"[ "+this.ranges.join(", ")+" ]"}clone(){return new e(this)}numbers(){return this.ranges.reduce((r,t)=>{for(var n=t.low;n<=t.high;)r.push(n),n++;return r},[])}subranges(){return this.ranges.map(r=>({low:r.low,high:r.high,length:1+r.high-r.low}))}};vr.exports=Ne});var qr=u((vm,Tr)=>{"use strict";var he=Or(),X=Er(),V=he.types;Tr.exports=class Y{constructor(r,t){if(this._setDefaults(r),r instanceof RegExp)this.ignoreCase=r.ignoreCase,this.multiline=r.multiline,r=r.source;else if(typeof r=="string")this.ignoreCase=t&&t.indexOf("i")!==-1,this.multiline=t&&t.indexOf("m")!==-1;else throw new Error("Expected a regexp or string");this.tokens=he(r)}_setDefaults(r){this.max=r.max!=null?r.max:Y.prototype.max!=null?Y.prototype.max:100,this.defaultRange=r.defaultRange?r.defaultRange:this.defaultRange.clone(),r.randInt&&(this.randInt=r.randInt)}gen(){return this._gen(this.tokens,[])}_gen(r,t){var n,o,i,a,s;switch(r.type){case V.ROOT:case V.GROUP:if(r.followedBy||r.notFollowedBy)return"";for(r.remember&&r.groupNumber===void 0&&(r.groupNumber=t.push(null)-1),n=r.options?this._randSelect(r.options):r.stack,o="",a=0,s=n.length;a<s;a++)o+=this._gen(n[a],t);return r.remember&&(t[r.groupNumber]=o),o;case V.POSITION:return"";case V.SET:var l=this._expand(r);return l.length?String.fromCharCode(this._randSelect(l)):"";case V.REPETITION:for(i=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),o="",a=0;a<i;a++)o+=this._gen(r.value,t);return o;case V.REFERENCE:return t[r.value-1]||"";case V.CHAR:var f=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(f)}}_toOtherCase(r){return r+(97<=r&&r<=122?-32:65<=r&&r<=90?32:0)}_randBool(){return!this.randInt(0,1)}_randSelect(r){return r instanceof X?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===he.types.CHAR)return new X(r.value);if(r.type===he.types.RANGE)return new X(r.from,r.to);{let t=new X;for(let n=0;n<r.set.length;n++){let o=this._expand(r.set[n]);if(t.add(o),this.ignoreCase)for(let i=0;i<o.length;i++){let a=o.index(i),s=this._toOtherCase(a);a!==s&&t.add(s)}}return r.not?this.defaultRange.clone().subtract(t):this.defaultRange.clone().intersect(t)}}randInt(r,t){return r+Math.floor(Math.random()*(1+t-r))}get defaultRange(){return this._range=this._range||new X(32,126)}set defaultRange(r){this._range=r}static randexp(r,t){var n;return typeof r=="string"&&(r=new RegExp(r,t)),r._randexp===void 0?(n=new Y(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Y.randexp(this)}}}});var Be=u((wg,ot)=>{"use strict";var Ls=typeof global=="object"&&global&&global.Object===Object&&global;ot.exports=Ls});var w=u((Cg,at)=>{"use strict";var Ds=Be(),Bs=typeof self=="object"&&self&&self.Object===Object&&self,$s=Ds||Bs||Function("return this")();at.exports=$s});var ee=u((Rg,st)=>{"use strict";var Us=w(),Hs=Us.Symbol;st.exports=Hs});var ct=u((jg,ft)=>{"use strict";var ut=ee(),lt=Object.prototype,zs=lt.hasOwnProperty,Gs=lt.toString,re=ut?ut.toStringTag:void 0;function ks(e){var r=zs.call(e,re),t=e[re];try{e[re]=void 0;var n=!0}catch{}var o=Gs.call(e);return n&&(r?e[re]=t:delete e[re]),o}ft.exports=ks});var dt=u((Jg,pt)=>{"use strict";var Ws=Object.prototype,Ks=Ws.toString;function Xs(e){return Ks.call(e)}pt.exports=Xs});var P=u((Fg,gt)=>{"use strict";var ht=ee(),Ys=ct(),Zs=dt(),Qs="[object Null]",eu="[object Undefined]",mt=ht?ht.toStringTag:void 0;function ru(e){return e==null?e===void 0?eu:Qs:mt&&mt in Object(e)?Ys(e):Zs(e)}gt.exports=ru});var T=u((Ng,yt)=>{"use strict";function tu(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}yt.exports=tu});var Se=u((Pg,bt)=>{"use strict";var nu=P(),iu=T(),ou="[object AsyncFunction]",au="[object Function]",su="[object GeneratorFunction]",uu="[object Proxy]";function lu(e){if(!iu(e))return!1;var r=nu(e);return r==au||r==su||r==ou||r==uu}bt.exports=lu});var St=u((Mg,xt)=>{"use strict";var fu=w(),cu=fu["__core-js_shared__"];xt.exports=cu});var Et=u((Lg,vt)=>{"use strict";var $e=St(),Ot=function(){var e=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function pu(e){return!!Ot&&Ot in e}vt.exports=pu});var qt=u((Dg,Tt)=>{"use strict";var du=Function.prototype,hu=du.toString;function mu(e){if(e!=null){try{return hu.call(e)}catch{}try{return e+""}catch{}}return""}Tt.exports=mu});var At=u((Bg,It)=>{"use strict";var gu=Se(),yu=Et(),bu=T(),xu=qt(),Su=/[\\^$.*+?()[\]{}|]/g,Ou=/^\[object .+?Constructor\]$/,vu=Function.prototype,Eu=Object.prototype,Tu=vu.toString,qu=Eu.hasOwnProperty,Iu=RegExp("^"+Tu.call(qu).replace(Su,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Au(e){if(!bu(e)||yu(e))return!1;var r=gu(e)?Iu:Ou;return r.test(xu(e))}It.exports=Au});var _t=u(($g,Vt)=>{"use strict";function Vu(e,r){return e?.[r]}Vt.exports=Vu});var Oe=u((Ug,wt)=>{"use strict";var _u=At(),wu=_t();function Cu(e,r){var t=wu(e,r);return _u(t)?t:void 0}wt.exports=Cu});var te=u((Hg,Ct)=>{"use strict";var Ru=Oe(),ju=Ru(Object,"create");Ct.exports=ju});var Jt=u((zg,jt)=>{"use strict";var Rt=te();function Ju(){this.__data__=Rt?Rt(null):{},this.size=0}jt.exports=Ju});var Nt=u((Gg,Ft)=>{"use strict";function Fu(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}Ft.exports=Fu});var Mt=u((kg,Pt)=>{"use strict";var Nu=te(),Pu="__lodash_hash_undefined__",Mu=Object.prototype,Lu=Mu.hasOwnProperty;function Du(e){var r=this.__data__;if(Nu){var t=r[e];return t===Pu?void 0:t}return Lu.call(r,e)?r[e]:void 0}Pt.exports=Du});var Dt=u((Wg,Lt)=>{"use strict";var Bu=te(),$u=Object.prototype,Uu=$u.hasOwnProperty;function Hu(e){var r=this.__data__;return Bu?r[e]!==void 0:Uu.call(r,e)}Lt.exports=Hu});var $t=u((Kg,Bt)=>{"use strict";var zu=te(),Gu="__lodash_hash_undefined__";function ku(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=zu&&r===void 0?Gu:r,this}Bt.exports=ku});var Ht=u((Xg,Ut)=>{"use strict";var Wu=Jt(),Ku=Nt(),Xu=Mt(),Yu=Dt(),Zu=$t();function M(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}M.prototype.clear=Wu;M.prototype.delete=Ku;M.prototype.get=Xu;M.prototype.has=Yu;M.prototype.set=Zu;Ut.exports=M});var Gt=u((Yg,zt)=>{"use strict";function Qu(){this.__data__=[],this.size=0}zt.exports=Qu});var ne=u((Zg,kt)=>{"use strict";function el(e,r){return e===r||e!==e&&r!==r}kt.exports=el});var ie=u((Qg,Wt)=>{"use strict";var rl=ne();function tl(e,r){for(var t=e.length;t--;)if(rl(e[t][0],r))return t;return-1}Wt.exports=tl});var Xt=u((ey,Kt)=>{"use strict";var nl=ie(),il=Array.prototype,ol=il.splice;function al(e){var r=this.__data__,t=nl(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():ol.call(r,t,1),--this.size,!0}Kt.exports=al});var Zt=u((ry,Yt)=>{"use strict";var sl=ie();function ul(e){var r=this.__data__,t=sl(r,e);return t<0?void 0:r[t][1]}Yt.exports=ul});var en=u((ty,Qt)=>{"use strict";var ll=ie();function fl(e){return ll(this.__data__,e)>-1}Qt.exports=fl});var tn=u((ny,rn)=>{"use strict";var cl=ie();function pl(e,r){var t=this.__data__,n=cl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}rn.exports=pl});var oe=u((iy,nn)=>{"use strict";var dl=Gt(),hl=Xt(),ml=Zt(),gl=en(),yl=tn();function L(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}L.prototype.clear=dl;L.prototype.delete=hl;L.prototype.get=ml;L.prototype.has=gl;L.prototype.set=yl;nn.exports=L});var Ue=u((oy,on)=>{"use strict";var bl=Oe(),xl=w(),Sl=bl(xl,"Map");on.exports=Sl});var un=u((ay,sn)=>{"use strict";var an=Ht(),Ol=oe(),vl=Ue();function El(){this.size=0,this.__data__={hash:new an,map:new(vl||Ol),string:new an}}sn.exports=El});var fn=u((sy,ln)=>{"use strict";function Tl(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}ln.exports=Tl});var ae=u((uy,cn)=>{"use strict";var ql=fn();function Il(e,r){var t=e.__data__;return ql(r)?t[typeof r=="string"?"string":"hash"]:t.map}cn.exports=Il});var dn=u((ly,pn)=>{"use strict";var Al=ae();function Vl(e){var r=Al(this,e).delete(e);return this.size-=r?1:0,r}pn.exports=Vl});var mn=u((fy,hn)=>{"use strict";var _l=ae();function wl(e){return _l(this,e).get(e)}hn.exports=wl});var yn=u((cy,gn)=>{"use strict";var Cl=ae();function Rl(e){return Cl(this,e).has(e)}gn.exports=Rl});var xn=u((py,bn)=>{"use strict";var jl=ae();function Jl(e,r){var t=jl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}bn.exports=Jl});var ve=u((dy,Sn)=>{"use strict";var Fl=un(),Nl=dn(),Pl=mn(),Ml=yn(),Ll=xn();function D(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}D.prototype.clear=Fl;D.prototype.delete=Nl;D.prototype.get=Pl;D.prototype.has=Ml;D.prototype.set=Ll;Sn.exports=D});var vn=u((hy,On)=>{"use strict";var Dl="__lodash_hash_undefined__";function Bl(e){return this.__data__.set(e,Dl),this}On.exports=Bl});var Tn=u((my,En)=>{"use strict";function $l(e){return this.__data__.has(e)}En.exports=$l});var He=u((gy,qn)=>{"use strict";var Ul=ve(),Hl=vn(),zl=Tn();function Ee(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Ul;++r<t;)this.add(e[r])}Ee.prototype.add=Ee.prototype.push=Hl;Ee.prototype.has=zl;qn.exports=Ee});var An=u((yy,In)=>{"use strict";function Gl(e,r,t,n){for(var o=e.length,i=t+(n?1:-1);n?i--:++i<o;)if(r(e[i],i,e))return i;return-1}In.exports=Gl});var _n=u((by,Vn)=>{"use strict";function kl(e){return e!==e}Vn.exports=kl});var Cn=u((xy,wn)=>{"use strict";function Wl(e,r,t){for(var n=t-1,o=e.length;++n<o;)if(e[n]===r)return n;return-1}wn.exports=Wl});var jn=u((Sy,Rn)=>{"use strict";var Kl=An(),Xl=_n(),Yl=Cn();function Zl(e,r,t){return r===r?Yl(e,r,t):Kl(e,Xl,t)}Rn.exports=Zl});var ze=u((Oy,Jn)=>{"use strict";var Ql=jn();function ef(e,r){var t=e==null?0:e.length;return!!t&&Ql(e,r,0)>-1}Jn.exports=ef});var Ge=u((vy,Fn)=>{"use strict";function rf(e,r,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(r,e[n]))return!0;return!1}Fn.exports=rf});var se=u((Ey,Nn)=>{"use strict";function tf(e,r){for(var t=-1,n=e==null?0:e.length,o=Array(n);++t<n;)o[t]=r(e[t],t,e);return o}Nn.exports=tf});var Te=u((Ty,Pn)=>{"use strict";function nf(e){return function(r){return e(r)}}Pn.exports=nf});var ke=u((qy,Mn)=>{"use strict";function of(e,r){return e.has(r)}Mn.exports=of});var Dn=u((Iy,Ln)=>{"use strict";var af=He(),sf=ze(),uf=Ge(),lf=se(),ff=Te(),cf=ke(),pf=200;function df(e,r,t,n){var o=-1,i=sf,a=!0,s=e.length,l=[],f=r.length;if(!s)return l;t&&(r=lf(r,ff(t))),n?(i=uf,a=!1):r.length>=pf&&(i=cf,a=!1,r=new af(r));e:for(;++o<s;){var c=e[o],p=t==null?c:t(c);if(c=n||c!==0?c:0,a&&p===p){for(var h=f;h--;)if(r[h]===p)continue e;l.push(c)}else i(r,p,n)||l.push(c)}return l}Ln.exports=df});var $n=u((Ay,Bn)=>{"use strict";function hf(e,r){for(var t=-1,n=r.length,o=e.length;++t<n;)e[o+t]=r[t];return e}Bn.exports=hf});var C=u((Vy,Un)=>{"use strict";function mf(e){return e!=null&&typeof e=="object"}Un.exports=mf});var zn=u((_y,Hn)=>{"use strict";var gf=P(),yf=C(),bf="[object Arguments]";function xf(e){return yf(e)&&gf(e)==bf}Hn.exports=xf});var qe=u((wy,Wn)=>{"use strict";var Gn=zn(),Sf=C(),kn=Object.prototype,Of=kn.hasOwnProperty,vf=kn.propertyIsEnumerable,Ef=Gn(function(){return arguments}())?Gn:function(e){return Sf(e)&&Of.call(e,"callee")&&!vf.call(e,"callee")};Wn.exports=Ef});var R=u((Cy,Kn)=>{"use strict";var Tf=Array.isArray;Kn.exports=Tf});var Qn=u((Ry,Zn)=>{"use strict";var Xn=ee(),qf=qe(),If=R(),Yn=Xn?Xn.isConcatSpreadable:void 0;function Af(e){return If(e)||qf(e)||!!(Yn&&e&&e[Yn])}Zn.exports=Af});var ti=u((jy,ri)=>{"use strict";var Vf=$n(),_f=Qn();function ei(e,r,t,n,o){var i=-1,a=e.length;for(t||(t=_f),o||(o=[]);++i<a;){var s=e[i];r>0&&t(s)?r>1?ei(s,r-1,t,n,o):Vf(o,s):n||(o[o.length]=s)}return o}ri.exports=ei});var We=u((Jy,ni)=>{"use strict";function wf(e){return e}ni.exports=wf});var oi=u((Fy,ii)=>{"use strict";function Cf(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}ii.exports=Cf});var ui=u((Ny,si)=>{"use strict";var Rf=oi(),ai=Math.max;function jf(e,r,t){return r=ai(r===void 0?e.length-1:r,0),function(){for(var n=arguments,o=-1,i=ai(n.length-r,0),a=Array(i);++o<i;)a[o]=n[r+o];o=-1;for(var s=Array(r+1);++o<r;)s[o]=n[o];return s[r]=t(a),Rf(e,this,s)}}si.exports=jf});var fi=u((Py,li)=>{"use strict";function Jf(e){return function(){return e}}li.exports=Jf});var Ke=u((My,ci)=>{"use strict";var Ff=Oe(),Nf=function(){try{var e=Ff(Object,"defineProperty");return e({},"",{}),e}catch{}}();ci.exports=Nf});var hi=u((Ly,di)=>{"use strict";var Pf=fi(),pi=Ke(),Mf=We(),Lf=pi?function(e,r){return pi(e,"toString",{configurable:!0,enumerable:!1,value:Pf(r),writable:!0})}:Mf;di.exports=Lf});var gi=u((Dy,mi)=>{"use strict";var Df=800,Bf=16,$f=Date.now;function Uf(e){var r=0,t=0;return function(){var n=$f(),o=Bf-(n-t);if(t=n,o>0){if(++r>=Df)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}mi.exports=Uf});var bi=u((By,yi)=>{"use strict";var Hf=hi(),zf=gi(),Gf=zf(Hf);yi.exports=Gf});var Ie=u(($y,xi)=>{"use strict";var kf=We(),Wf=ui(),Kf=bi();function Xf(e,r){return Kf(Wf(e,r,kf),e+"")}xi.exports=Xf});var Xe=u((Uy,Si)=>{"use strict";var Yf=9007199254740991;function Zf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Yf}Si.exports=Zf});var Ae=u((Hy,Oi)=>{"use strict";var Qf=Se(),ec=Xe();function rc(e){return e!=null&&ec(e.length)&&!Qf(e)}Oi.exports=rc});var Ve=u((zy,vi)=>{"use strict";var tc=Ae(),nc=C();function ic(e){return nc(e)&&tc(e)}vi.exports=ic});var qi=u((Gy,Ti)=>{"use strict";var oc=Dn(),ac=ti(),sc=Ie(),Ei=Ve(),uc=sc(function(e,r){return Ei(e)?oc(e,ac(r,1,Ei,!0)):[]});Ti.exports=uc});var _e=u((ky,Ii)=>{"use strict";var lc=P(),fc=C(),cc="[object Symbol]";function pc(e){return typeof e=="symbol"||fc(e)&&lc(e)==cc}Ii.exports=pc});var Vi=u((Wy,Ai)=>{"use strict";var dc=R(),hc=_e(),mc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gc=/^\w*$/;function yc(e,r){if(dc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||hc(e)?!0:gc.test(e)||!mc.test(e)||r!=null&&e in Object(r)}Ai.exports=yc});var Ci=u((Ky,wi)=>{"use strict";var _i=ve(),bc="Expected a function";function Ye(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(bc);var t=function(){var n=arguments,o=r?r.apply(this,n):n[0],i=t.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return t.cache=i.set(o,a)||i,a};return t.cache=new(Ye.Cache||_i),t}Ye.Cache=_i;wi.exports=Ye});var ji=u((Xy,Ri)=>{"use strict";var xc=Ci(),Sc=500;function Oc(e){var r=xc(e,function(n){return t.size===Sc&&t.clear(),n}),t=r.cache;return r}Ri.exports=Oc});var Fi=u((Yy,Ji)=>{"use strict";var vc=ji(),Ec=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tc=/\\(\\)?/g,qc=vc(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Ec,function(t,n,o,i){r.push(o?i.replace(Tc,"$1"):n||t)}),r});Ji.exports=qc});var Bi=u((Zy,Di)=>{"use strict";var Ni=ee(),Ic=se(),Ac=R(),Vc=_e(),_c=1/0,Pi=Ni?Ni.prototype:void 0,Mi=Pi?Pi.toString:void 0;function Li(e){if(typeof e=="string")return e;if(Ac(e))return Ic(e,Li)+"";if(Vc(e))return Mi?Mi.call(e):"";var r=e+"";return r=="0"&&1/e==-_c?"-0":r}Di.exports=Li});var Ui=u((Qy,$i)=>{"use strict";var wc=Bi();function Cc(e){return e==null?"":wc(e)}$i.exports=Cc});var Ze=u((eb,Hi)=>{"use strict";var Rc=R(),jc=Vi(),Jc=Fi(),Fc=Ui();function Nc(e,r){return Rc(e)?e:jc(e,r)?[e]:Jc(Fc(e))}Hi.exports=Nc});var Qe=u((rb,zi)=>{"use strict";var Pc=_e(),Mc=1/0;function Lc(e){if(typeof e=="string"||Pc(e))return e;var r=e+"";return r=="0"&&1/e==-Mc?"-0":r}zi.exports=Lc});var ki=u((tb,Gi)=>{"use strict";var Dc=Ze(),Bc=Qe();function $c(e,r){r=Dc(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[Bc(r[t++])];return t&&t==n?e:void 0}Gi.exports=$c});var Ki=u((nb,Wi)=>{"use strict";var Uc=ki();function Hc(e,r,t){var n=e==null?void 0:Uc(e,r);return n===void 0?t:n}Wi.exports=Hc});var Zi=u((ib,Yi)=>{"use strict";var zc=He(),Gc=ze(),kc=Ge(),Wc=se(),Kc=Te(),Xi=ke(),Xc=Math.min;function Yc(e,r,t){for(var n=t?kc:Gc,o=e[0].length,i=e.length,a=i,s=Array(i),l=1/0,f=[];a--;){var c=e[a];a&&r&&(c=Wc(c,Kc(r))),l=Xc(c.length,l),s[a]=!t&&(r||o>=120&&c.length>=120)?new zc(a&&c):void 0}c=e[0];var p=-1,h=s[0];e:for(;++p<o&&f.length<l;){var b=c[p],g=r?r(b):b;if(b=t||b!==0?b:0,!(h?Xi(h,g):n(f,g,t))){for(a=i;--a;){var j=s[a];if(!(j?Xi(j,g):n(e[a],g,t)))continue e}h&&h.push(g),f.push(b)}}return f}Yi.exports=Yc});var eo=u((ob,Qi)=>{"use strict";var Zc=Ve();function Qc(e){return Zc(e)?e:[]}Qi.exports=Qc});var to=u((ab,ro)=>{"use strict";var ep=se(),rp=Zi(),tp=Ie(),np=eo(),ip=tp(function(e){var r=ep(e,np);return r.length&&r[0]===e[0]?rp(r):[]});ro.exports=ip});var io=u((sb,no)=>{"use strict";var op=oe();function ap(){this.__data__=new op,this.size=0}no.exports=ap});var ao=u((ub,oo)=>{"use strict";function sp(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}oo.exports=sp});var uo=u((lb,so)=>{"use strict";function up(e){return this.__data__.get(e)}so.exports=up});var fo=u((fb,lo)=>{"use strict";function lp(e){return this.__data__.has(e)}lo.exports=lp});var po=u((cb,co)=>{"use strict";var fp=oe(),cp=Ue(),pp=ve(),dp=200;function hp(e,r){var t=this.__data__;if(t instanceof fp){var n=t.__data__;if(!cp||n.length<dp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new pp(n)}return t.set(e,r),this.size=t.size,this}co.exports=hp});var mo=u((pb,ho)=>{"use strict";var mp=oe(),gp=io(),yp=ao(),bp=uo(),xp=fo(),Sp=po();function B(e){var r=this.__data__=new mp(e);this.size=r.size}B.prototype.clear=gp;B.prototype.delete=yp;B.prototype.get=bp;B.prototype.has=xp;B.prototype.set=Sp;ho.exports=B});var we=u((db,yo)=>{"use strict";var go=Ke();function Op(e,r,t){r=="__proto__"&&go?go(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}yo.exports=Op});var er=u((hb,bo)=>{"use strict";var vp=we(),Ep=ne();function Tp(e,r,t){(t!==void 0&&!Ep(e[r],t)||t===void 0&&!(r in e))&&vp(e,r,t)}bo.exports=Tp});var So=u((mb,xo)=>{"use strict";function qp(e){return function(r,t,n){for(var o=-1,i=Object(r),a=n(r),s=a.length;s--;){var l=a[e?s:++o];if(t(i[l],l,i)===!1)break}return r}}xo.exports=qp});var vo=u((gb,Oo)=>{"use strict";var Ip=So(),Ap=Ip();Oo.exports=Ap});var Ao=u((ue,$)=>{"use strict";var Vp=w(),Io=typeof ue=="object"&&ue&&!ue.nodeType&&ue,Eo=Io&&typeof $=="object"&&$&&!$.nodeType&&$,_p=Eo&&Eo.exports===Io,To=_p?Vp.Buffer:void 0,qo=To?To.allocUnsafe:void 0;function wp(e,r){if(r)return e.slice();var t=e.length,n=qo?qo(t):new e.constructor(t);return e.copy(n),n}$.exports=wp});var _o=u((yb,Vo)=>{"use strict";var Cp=w(),Rp=Cp.Uint8Array;Vo.exports=Rp});var Ro=u((bb,Co)=>{"use strict";var wo=_o();function jp(e){var r=new e.constructor(e.byteLength);return new wo(r).set(new wo(e)),r}Co.exports=jp});var Jo=u((xb,jo)=>{"use strict";var Jp=Ro();function Fp(e,r){var t=r?Jp(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}jo.exports=Fp});var No=u((Sb,Fo)=>{"use strict";function Np(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}Fo.exports=Np});var Lo=u((Ob,Mo)=>{"use strict";var Pp=T(),Po=Object.create,Mp=function(){function e(){}return function(r){if(!Pp(r))return{};if(Po)return Po(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();Mo.exports=Mp});var Bo=u((vb,Do)=>{"use strict";function Lp(e,r){return function(t){return e(r(t))}}Do.exports=Lp});var rr=u((Eb,$o)=>{"use strict";var Dp=Bo(),Bp=Dp(Object.getPrototypeOf,Object);$o.exports=Bp});var tr=u((Tb,Uo)=>{"use strict";var $p=Object.prototype;function Up(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||$p;return e===t}Uo.exports=Up});var zo=u((qb,Ho)=>{"use strict";var Hp=Lo(),zp=rr(),Gp=tr();function kp(e){return typeof e.constructor=="function"&&!Gp(e)?Hp(zp(e)):{}}Ho.exports=kp});var ko=u((Ib,Go)=>{"use strict";function Wp(){return!1}Go.exports=Wp});var nr=u((le,U)=>{"use strict";var Kp=w(),Xp=ko(),Xo=typeof le=="object"&&le&&!le.nodeType&&le,Wo=Xo&&typeof U=="object"&&U&&!U.nodeType&&U,Yp=Wo&&Wo.exports===Xo,Ko=Yp?Kp.Buffer:void 0,Zp=Ko?Ko.isBuffer:void 0,Qp=Zp||Xp;U.exports=Qp});var Qo=u((Ab,Zo)=>{"use strict";var ed=P(),rd=rr(),td=C(),nd="[object Object]",id=Function.prototype,od=Object.prototype,Yo=id.toString,ad=od.hasOwnProperty,sd=Yo.call(Object);function ud(e){if(!td(e)||ed(e)!=nd)return!1;var r=rd(e);if(r===null)return!0;var t=ad.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Yo.call(t)==sd}Zo.exports=ud});var ra=u((Vb,ea)=>{"use strict";var ld=P(),fd=Xe(),cd=C(),pd="[object Arguments]",dd="[object Array]",hd="[object Boolean]",md="[object Date]",gd="[object Error]",yd="[object Function]",bd="[object Map]",xd="[object Number]",Sd="[object Object]",Od="[object RegExp]",vd="[object Set]",Ed="[object String]",Td="[object WeakMap]",qd="[object ArrayBuffer]",Id="[object DataView]",Ad="[object Float32Array]",Vd="[object Float64Array]",_d="[object Int8Array]",wd="[object Int16Array]",Cd="[object Int32Array]",Rd="[object Uint8Array]",jd="[object Uint8ClampedArray]",Jd="[object Uint16Array]",Fd="[object Uint32Array]",m={};m[Ad]=m[Vd]=m[_d]=m[wd]=m[Cd]=m[Rd]=m[jd]=m[Jd]=m[Fd]=!0;m[pd]=m[dd]=m[qd]=m[hd]=m[Id]=m[md]=m[gd]=m[yd]=m[bd]=m[xd]=m[Sd]=m[Od]=m[vd]=m[Ed]=m[Td]=!1;function Nd(e){return cd(e)&&fd(e.length)&&!!m[ld(e)]}ea.exports=Nd});var na=u((fe,H)=>{"use strict";var Pd=Be(),ta=typeof fe=="object"&&fe&&!fe.nodeType&&fe,ce=ta&&typeof H=="object"&&H&&!H.nodeType&&H,Md=ce&&ce.exports===ta,ir=Md&&Pd.process,Ld=function(){try{var e=ce&&ce.require&&ce.require("util").types;return e||ir&&ir.binding&&ir.binding("util")}catch{}}();H.exports=Ld});var or=u((_b,aa)=>{"use strict";var Dd=ra(),Bd=Te(),ia=na(),oa=ia&&ia.isTypedArray,$d=oa?Bd(oa):Dd;aa.exports=$d});var ar=u((wb,sa)=>{"use strict";function Ud(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}sa.exports=Ud});var sr=u((Cb,ua)=>{"use strict";var Hd=we(),zd=ne(),Gd=Object.prototype,kd=Gd.hasOwnProperty;function Wd(e,r,t){var n=e[r];(!(kd.call(e,r)&&zd(n,t))||t===void 0&&!(r in e))&&Hd(e,r,t)}ua.exports=Wd});var fa=u((Rb,la)=>{"use strict";var Kd=sr(),Xd=we();function Yd(e,r,t,n){var o=!t;t||(t={});for(var i=-1,a=r.length;++i<a;){var s=r[i],l=n?n(t[s],e[s],s,t,e):void 0;l===void 0&&(l=e[s]),o?Xd(t,s,l):Kd(t,s,l)}return t}la.exports=Yd});var pa=u((jb,ca)=>{"use strict";function Zd(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}ca.exports=Zd});var Ce=u((Jb,da)=>{"use strict";var Qd=9007199254740991,eh=/^(?:0|[1-9]\d*)$/;function rh(e,r){var t=typeof e;return r=r??Qd,!!r&&(t=="number"||t!="symbol"&&eh.test(e))&&e>-1&&e%1==0&&e<r}da.exports=rh});var ma=u((Fb,ha)=>{"use strict";var th=pa(),nh=qe(),ih=R(),oh=nr(),ah=Ce(),sh=or(),uh=Object.prototype,lh=uh.hasOwnProperty;function fh(e,r){var t=ih(e),n=!t&&nh(e),o=!t&&!n&&oh(e),i=!t&&!n&&!o&&sh(e),a=t||n||o||i,s=a?th(e.length,String):[],l=s.length;for(var f in e)(r||lh.call(e,f))&&!(a&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ah(f,l)))&&s.push(f);return s}ha.exports=fh});var ya=u((Nb,ga)=>{"use strict";function ch(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}ga.exports=ch});var xa=u((Pb,ba)=>{"use strict";var ph=T(),dh=tr(),hh=ya(),mh=Object.prototype,gh=mh.hasOwnProperty;function yh(e){if(!ph(e))return hh(e);var r=dh(e),t=[];for(var n in e)n=="constructor"&&(r||!gh.call(e,n))||t.push(n);return t}ba.exports=yh});var ur=u((Mb,Sa)=>{"use strict";var bh=ma(),xh=xa(),Sh=Ae();function Oh(e){return Sh(e)?bh(e,!0):xh(e)}Sa.exports=Oh});var va=u((Lb,Oa)=>{"use strict";var vh=fa(),Eh=ur();function Th(e){return vh(e,Eh(e))}Oa.exports=Th});var Va=u((Db,Aa)=>{"use strict";var Ea=er(),qh=Ao(),Ih=Jo(),Ah=No(),Vh=zo(),Ta=qe(),qa=R(),_h=Ve(),wh=nr(),Ch=Se(),Rh=T(),jh=Qo(),Jh=or(),Ia=ar(),Fh=va();function Nh(e,r,t,n,o,i,a){var s=Ia(e,t),l=Ia(r,t),f=a.get(l);if(f){Ea(e,t,f);return}var c=i?i(s,l,t+"",e,r,a):void 0,p=c===void 0;if(p){var h=qa(l),b=!h&&wh(l),g=!h&&!b&&Jh(l);c=l,h||b||g?qa(s)?c=s:_h(s)?c=Ah(s):b?(p=!1,c=qh(l,!0)):g?(p=!1,c=Ih(l,!0)):c=[]:jh(l)||Ta(l)?(c=s,Ta(s)?c=Fh(s):(!Rh(s)||Ch(s))&&(c=Vh(l))):p=!1}p&&(a.set(l,c),o(c,l,n,i,a),a.delete(l)),Ea(e,t,c)}Aa.exports=Nh});var lr=u((Bb,wa)=>{"use strict";var Ph=mo(),Mh=er(),Lh=vo(),Dh=Va(),Bh=T(),$h=ur(),Uh=ar();function _a(e,r,t,n,o){e!==r&&Lh(r,function(i,a){if(o||(o=new Ph),Bh(i))Dh(e,r,a,t,_a,n,o);else{var s=n?n(Uh(e,a),i,a+"",e,r,o):void 0;s===void 0&&(s=i),Mh(e,a,s)}},$h)}wa.exports=_a});var Ra=u(($b,Ca)=>{"use strict";var Hh=ne(),zh=Ae(),Gh=Ce(),kh=T();function Wh(e,r,t){if(!kh(t))return!1;var n=typeof r;return(n=="number"?zh(t)&&Gh(r,t.length):n=="string"&&r in t)?Hh(t[r],e):!1}Ca.exports=Wh});var fr=u((Ub,ja)=>{"use strict";var Kh=Ie(),Xh=Ra();function Yh(e){return Kh(function(r,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&Xh(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),r=Object(r);++n<o;){var s=t[n];s&&e(r,s,n,i)}return r})}ja.exports=Yh});var Fa=u((Hb,Ja)=>{"use strict";var Zh=lr(),Qh=fr(),em=Qh(function(e,r,t){Zh(e,r,t)});Ja.exports=em});var Pa=u((zb,Na)=>{"use strict";var rm=lr(),tm=fr(),nm=tm(function(e,r,t,n){rm(e,r,t,n)});Na.exports=nm});var Da=u((Gb,La)=>{"use strict";var im=sr(),om=Ze(),am=Ce(),Ma=T(),sm=Qe();function um(e,r,t,n){if(!Ma(e))return e;r=om(r,e);for(var o=-1,i=r.length,a=i-1,s=e;s!=null&&++o<i;){var l=sm(r[o]),f=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(o!=a){var c=s[l];f=n?n(c,l,s):void 0,f===void 0&&(f=Ma(c)?c:am(r[o+1])?[]:{})}im(s,l,f),s=s[l]}return e}La.exports=um});var $a=u((kb,Ba)=>{"use strict";var lm=Da();function fm(e,r,t){return e==null?e:lm(e,r,t)}Ba.exports=fm});var jr=I(qr(),1);function Ar(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var ss=["if","then","else"];function Ir(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Z(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(ss.includes(t))continue;let o=e[t];if(Ir(n))Ir(o)?Z(o,n):o!==n&&(e[t]=n);else if(o&&Array.isArray(n)){let i=o;for(let a of n)a&&typeof a=="object"?Z(i,n):t==="required"?i.find(s=>s===a)||i.push(a):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Vr="yyyy-MM-dd";function _r(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function us(e,r){let t=_r(e,r);return t==="GREATER"||t==="EQUAL"}function ls(e,r){let t=_r(e,r);return t==="LESSER"||t==="EQUAL"}function wr(e,r,t,n=[]){let o=typeof e=="string",i=e==="",a=e===void 0||e===null&&t.treatNullAsUndefined,s=i||a,l=[];if(!o||s||r["x-jsf-presentation"]===void 0)return l;let{minDate:f,maxDate:c}=r["x-jsf-presentation"];return f&&!us(e,f)&&l.push({path:n,validation:"minDate",schema:r,value:e}),c&&!ls(e,c)&&l.push({path:n,validation:"maxDate",schema:r,value:e}),l}function Cr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Rr="Please acknowledge this field";function Jr(e,r,t,n){let o=e["x-jsf-presentation"];switch(t){case"type":return fs(e.type);case"required":return Cr(e)?Rr:"Required field";case"forbidden":return"Not allowed";case"const":return Cr(e)&&r===!1?Rr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${Pe(r)}" is not valid.`;case"anyOf":return`The option "${Pe(r)}" is not valid.`;case"oneOf":return`The option "${Pe(r)}" is not valid.`;case"not":return"The value must not satisfy the provided schema";case"minLength":return`Please insert at least ${e.minLength} characters`;case"maxLength":return`Please insert up to ${e.maxLength} characters`;case"pattern":return`Must have a valid format. E.g. ${(0,jr.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let i=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Vr.toLowerCase()} format. e.g. ${i}`}return`Must be a valid ${e.format} format`;case"multipleOf":return`Must be a multiple of ${e.multipleOf}`;case"maximum":return`Must be smaller or equal to ${e.maximum}`;case"exclusiveMaximum":return`Must be smaller than ${e.exclusiveMaximum}`;case"minimum":return`Must be greater or equal to ${e.minimum}`;case"exclusiveMinimum":return`Must be greater than ${e.exclusiveMinimum}`;case"minDate":return`The date must be ${o?.minDate} or after.`;case"maxDate":return`The date must be ${o?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let i=o?.maxFileSize,a=typeof i=="number"?Ar(i):void 0;return`File size too large.${a?` The limit is ${a} MB.`:""}`}case"accept":{let i=o?.accept;return`Unsupported file format.${i?` The acceptable formats are ${i}.`:""}`}case"minItems":{let i=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${i}`}case"maxItems":{let i=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${i}`}case"uniqueItems":return"Items must be unique";case"contains":throw new Error('"contains" is not implemented yet');case"minContains":throw new Error('"minContains" is not implemented yet');case"maxContains":throw new Error('"maxContains" is not implemented yet');case"json-logic":return n||"The value is not valid"}}function fs(e){if(Array.isArray(e))return`The value must be a ${e.map(t=>t==="integer"?"number":t).join(" or ")}`;switch(e){case"number":case"integer":return"The value must be a number";case"boolean":return"The value must be a boolean";case"null":return"The value must be null";case"string":return"The value must be a string";case"object":return"The value must be an object";case"array":return"The value must be an array";default:return e?`The value must be ${e}`:"Invalid value"}}function Pe(e){return typeof e=="string"?e:JSON.stringify(e)}function cs(e,r){let t={};return r.forEach((o,i)=>{t[o]=i}),e.sort((o,i)=>{let a=t[o.name]??1/0,s=t[i.name]??1/0;return a!==s?a-s:e.indexOf(o)-e.indexOf(i)})}function Me(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?cs(r,e["x-jsf-order"]):r}function ps(e,r,t){r.checkboxValue=t.const,t.type==="boolean"&&(r.checkboxValue=!0)}function ds(e,r){if(e.options===void 0){let t=gs(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function hs(e,r,t,n){if(e.options===void 0){let o=xs(r,t,n);o&&(e.fields=o)}}function ms(e,r){if(!e)return"text";switch(e){case"string":{let{oneOf:t,format:n}=r;return n==="email"?"email":n==="date"?"date":n==="data-url"?"file":t?"radio":"text"}case"number":case"integer":return"number";case"object":return"fieldset";case"array":{let{items:t}=r;return t?.properties?"group-array":"select"}case"boolean":return"checkbox";default:return"text"}}function Fr(e,r,t,n){let o=t["x-jsf-presentation"];if(o?.inputType)return o.inputType;if(n&&r!=="root")throw new Error(`Strict error: Missing inputType to field "${t.title}".
|
|
2
|
+
You can fix the json schema or skip this error by calling createHeadlessForm(schema, { strictInputType: false })`);if(!t.type){if(t.items?.properties)return"group-array";if(t.properties)return"select"}return ms(e||t.type||"string",t)}function me(e){return e.filter(r=>r!==null&&typeof r=="object"&&r.const!==null).map(r=>{let t=r.title,n=r.const,i=r["x-jsf-presentation"]?.meta,a={label:t||"",value:n};i&&(a.meta=i);let{title:s,const:l,"x-jsf-presentation":f,...c}=r;return{...a,...c}})}function gs(e){if(e.oneOf)return me(e.oneOf||[]);if(e.items?.anyOf)return me(e.items.anyOf);if(e.anyOf)return me(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return me(r)}return null}function ys(e,r,t){let n=[];for(let i in e.properties){let a=e.required?.includes(i)||!1,s=_({schema:e.properties[i],name:i,required:a,originalSchema:r.properties?.[i]||e.properties[i],strictInputType:t});s&&n.push(s)}return Me(e,n)}function bs(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let i=e.items;for(let a in i.properties){let s=i.required?.includes(a)||!1,l=_({schema:i.properties[a],name:a,required:s,originalSchema:r,strictInputType:t});l&&(l.nameKey=a,n.push(l))}}else{let i=_({schema:e.items,name:"item",required:!1,originalSchema:r,strictInputType:t});i&&n.push(i)}return Me(e.items,n)}function xs(e,r,t){return typeof e.properties=="object"&&e.properties!==null?ys(e,r,t):typeof e.items=="object"&&e.items!==null?bs(e,r,t):null}var Ss=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function _({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:o=!1,type:i=void 0}){if(e===!1){let c=Fr(i,r,n,o),p=["fieldset","group-array"].includes(c);return{type:c,name:r,inputType:c,jsonType:"boolean",required:t,isVisible:!1,...p&&{fields:[]}}}if(typeof e=="boolean")return null;let a=e["x-jsf-presentation"]||{},s=e["x-jsf-errorMessage"],l=Fr(i,r,e,o),f={...Object.entries(e).filter(([c])=>!Ss.includes(c)).reduce((c,[p,h])=>({...c,[p]:h}),{}),name:r,inputType:l,type:l,jsonType:i||e.type,required:t,isVisible:!0,...s&&{errorMessage:s}};return l==="checkbox"&&ps(l,f,e),e.title&&(f.label=e.title),Object.keys(a).length>0&&Object.entries(a).forEach(([c,p])=>{c!=="inputType"&&(f[c]=p)}),ds(f,e),hs(f,e,n),f}import ge from"json-logic-js";function be(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function Nr(e){return/\{\{.*?\}\}/.test(e)}function ye(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function Pr(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(o=>{let i=r?.schema?.validations?.[o],a=r?.value;if(!i)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${o}" doesn't exist.`);if(ge.apply(i.rule,ye(a))===!1){let l=i.errorMessage;return l&&Nr(l)&&(l=l.replace(/\{\{(.*?)\}\}/g,(f,c)=>{let p=c.trim(),h=r.schema.computedValues?.[p];return h?ge.apply(h.rule,ye(a)):ge.apply({var:p},ye(a))})),[{path:t,validation:"json-logic",customErrorMessage:l,schema:e,value:a}]}return[]}).flat()}function Os(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return ge.apply(r,ye(t))}function Mr(e,r,t){if(r){let n={};Object.entries(r).forEach(([o,i])=>{let a=Os(o,i.rule,t);n[o]=a}),Lr(e,n)}return e}function Lr(e,r){function t(n){let o=n["x-jsf-logic-computedAttrs"];o&&vs(n,r,o),n.type==="object"&&n.properties&&Lr(n,r),delete n["x-jsf-logic-computedAttrs"]}if(e.properties)for(let n in e.properties)t(e.properties[n]);else t(e)}function vs(e,r,t){function n(i){return Nr(i)?i.replace(/\{\{(.*?)\}\}/g,(a,s)=>{let l=s.trim();return r[l]||`{{${l}}}`}):r[i]}function o(i,a,s,l){let f=a;i[f]||(i[f]={}),Object.entries(s).forEach(([c,p])=>{typeof p=="string"?i[f][c]=n(p):o(i[f],c,p,l)})}for(let i in t){let a=i,s=t[i];typeof s=="string"?e[a]=n(s):o(e,a,s,r)}}function v(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e,r){if(typeof e!=typeof r)return!1;if(e===r)return!0;if(e===null||r===null)return!1;if(Array.isArray(e)&&Array.isArray(r))return e.length!==r.length?!1:e.every((t,n)=>E(t,r[n]));if(v(e)&&v(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!E(t,n)?!1:t.every(o=>E(e[o],r[o]))}return!1}function Dr(e){if(typeof structuredClone=="function")try{return structuredClone(e)}catch(r){console.warn("structuredClone failed, falling back to JSON method:",r)}try{return JSON.parse(JSON.stringify(e))}catch{throw new Error("Deep clone failed: Object may contain circular references or non-serializable values")}}function Br(e,r,t,n,o){return Array.isArray(e)?[...Es(r,e,o),...As(r,e,o),...Is(e,r,t,n,o),...qs(r,e,t,n,o),...Ts(r,e,t,n,o)]:[]}function Es(e,r,t){let n=[],o=r.length;return e.maxItems!==void 0&&o>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&o<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function Ts(e,r,t,n,o){if(e.items===void 0)return[];let i=[],a=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[s,l]of r.slice(a).entries())i.push(...x(l,e.items,t,[...o,"items",s+a],n));return i}function qs(e,r,t,n,o){if(!Array.isArray(e.prefixItems))return[];let i=[];for(let[a,s]of r.entries())a<e.prefixItems.length&&i.push(...x(s,e.prefixItems[a],t,[...o,"prefixItems",a],n));return i}function Is(e,r,t,n,o){if(!("contains"in r))return[];let i=[],a=e.filter(s=>x(s,r.contains,t,[...o,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?a<1&&i.push({path:o,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&a<r.minContains&&i.push({path:o,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&a>r.maxContains&&i.push({path:o,validation:"maxContains",schema:r,value:e})),i}function As(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let o=0;o<r.length;o++){for(let i of n.values())if(E(r[o],i))return[{path:t,validation:"uniqueItems",schema:e,value:r[o]}];n.set(o,r[o])}return[]}function $r(e,r,t,n,o=[]){if(!r.allOf)return[];for(let i=0;i<r.allOf.length;i++){let a=r.allOf[i],s=x(e,a,t,[...o,"allOf",i],n);if(s.length>0)return s}return[]}function Ur(e,r,t,n,o=[]){if(!r.anyOf)return[];for(let i of r.anyOf)if(x(e,i,t,o,n).length===0)return[];return[{path:o,validation:"anyOf",schema:r,value:e}]}function Hr(e,r,t,n,o=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let i=0;for(let a=0;a<r.oneOf.length&&!(x(e,r.oneOf[a],t,o,n).length===0&&(i++,i>1));a++);return i===0?[{path:o,validation:"oneOf",schema:r,value:e}]:i>1?[{path:o,validation:"oneOf",schema:r,value:e}]:[]}function zr(e,r,t,n,o=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:o,validation:"not",schema:r,value:e}]:[]:x(e,r.not,t,o,n).length===0?[{path:o,validation:"not",schema:r,value:e}]:[]}function Gr(e,r,t,n,o=[]){if(r.if===void 0)return[];let i=x(e,r.if,t,o,n).length===0;return i&&r.then!==void 0?x(e,r.then,t,[...o,"then"],n):!i&&r.else!==void 0?x(e,r.else,t,[...o,"else"],n):[]}function kr(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:E(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function Wr(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function Kr(e,r,t=[]){let n=r["x-jsf-presentation"],o=n?.inputType==="file",i=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(o||i))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(f=>v(f)&&typeof f.name=="string"&&typeof f.size=="number"))return[{path:t,validation:"fileStructure",schema:r,value:e}];let l=e;if(typeof n?.maxFileSize=="number"){let f=n.maxFileSize*1024;if(l.some(p=>p.size>f))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let f=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(f.length>0&&!l.some(p=>{let h=p.name.toLowerCase(),b=h.includes(".")?`.${h.split(".").pop()}`:"";return b!==""&&f.includes(b)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}function Xr(e,r,t=[]){let n=[],o=Q(r);return typeof e!="number"?[]:o!==void 0&&!["number","integer"].includes(o)?[]:(r.multipleOf!==void 0&&e%r.multipleOf!==0&&n.push({path:t,validation:"multipleOf",schema:r,value:e}),r.maximum!==void 0&&e>r.maximum&&n.push({path:t,validation:"maximum",schema:r,value:e}),r.exclusiveMaximum!==void 0&&e>=r.exclusiveMaximum&&n.push({path:t,validation:"exclusiveMaximum",schema:r,value:e}),r.minimum!==void 0&&e<r.minimum&&n.push({path:t,validation:"minimum",schema:r,value:e}),r.exclusiveMinimum!==void 0&&e<=r.exclusiveMinimum&&n.push({path:t,validation:"exclusiveMinimum",schema:r,value:e}),n)}function Yr(e,r,t,n,o=[]){if(typeof r=="object"&&r.properties&&v(e)){let i=[];for(let[a,s]of Object.entries(r.properties))i.push(...x(e[a],s,t,[...o,a],n));return i}return[]}var Zr;(function(e){e["7bit"]="7bit",e["8bit"]="8bit",e.Base64="base64",e.Binary="binary",e.IETFToken="ietf-token",e.QuotedPrintable="quoted-printable",e.XToken="x-token"})(Zr||(Zr={}));var y;(function(e){e.Date="date",e.DateTime="date-time",e.Duration="duration",e.Email="email",e.Hostname="hostname",e.IDNEmail="idn-email",e.IDNHostname="idn-hostname",e.IPv4="ipv4",e.IPv6="ipv6",e.IRI="iri",e.IRIReference="iri-reference",e.JSONPointer="json-pointer",e.JSONPointerURIFragment="json-pointer-uri-fragment",e.RegEx="regex",e.RelativeJSONPointer="relative-json-pointer",e.Time="time",e.URI="uri",e.URIReference="uri-reference",e.URITemplate="uri-template",e.UUID="uuid"})(y||(y={}));var Qr;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(Qr||(Qr={}));var S={DATE_TIME:/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,DATE:/^\d{4}-\d{2}-\d{2}$/,TIME:/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/,DURATION:/^P(?!$)(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?=\d)(?:\d+H)?(?:\d+M)?(?:\d+S)?)?$/,EMAIL:/^[\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,IDN_EMAIL:/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/,HOSTNAME:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i,IDN_HOSTNAME:/^[^\s._-].*[^\s._-]$/,IPV6_PART:/^[0-9a-f]{1,4}$/i,PROTOCOL:/^[a-z]+:/,URI_REFERENCE:/^\S*$/,UUID:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,JSON_POINTER:/^(?:\/(?:[^~/]|~0|~1)*)*$/,JSON_POINTER_URI_FRAGMENT:/^#(?:\/(?:[\w\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,RELATIVE_JSON_POINTER:/^(?:0|[1-9]\d*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,URI_TEMPLATE:/^(?:[!#$&'()*+,/:;=?@\w\-.~]|%[0-9a-f]{2}|\{[+#./;?&=,!@|]?(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?(?:,(?:\w|%[0-9a-f]{2})+(?::[1-9]\d{0,3}|\*)?)*\})*$/i},Vs={[y.DateTime]:e=>S.DATE_TIME.test(e),[y.Date]:e=>S.DATE.test(e),[y.Time]:e=>S.TIME.test(e),[y.Duration]:e=>S.DURATION.test(e),[y.Email]:e=>e.length<=254&&S.EMAIL.test(e),[y.IDNEmail]:e=>e.length<=254&&S.IDN_EMAIL.test(e),[y.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>S.HOSTNAME.test(t)),[y.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&S.IDN_HOSTNAME.test(t)),[y.IPv4]:e=>{let r=e.split(".");return r.length!==4?!1:r.every(t=>{let n=Number.parseInt(t,10);return n>=0&&n<=255&&t===n.toString()})},[y.IPv6]:e=>{let r=e.split(":");if(r.length>8)return!1;let t=!1;return r.every(n=>n===""?t?!1:(t=!0,!0):S.IPV6_PART.test(n))},[y.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[y.URIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[y.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&S.PROTOCOL.test(r.protocol)}catch{return!1}},[y.IRIReference]:e=>{try{return e.startsWith("//")?S.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[y.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[y.UUID]:e=>S.UUID.test(e),[y.JSONPointer]:e=>S.JSON_POINTER.test(e),[y.JSONPointerURIFragment]:e=>S.JSON_POINTER_URI_FRAGMENT.test(e),[y.RelativeJSONPointer]:e=>S.RELATIVE_JSON_POINTER.test(e),[y.URITemplate]:e=>S.URI_TEMPLATE.test(e)};function et(e,r,t=[]){let n=[];if(typeof e!="string")return n;let o=Vs[r.format];return o&&!o(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function rt(e,r,t=[]){let n=[],o=Q(r);if(typeof e!="string")return[];if(o!==void 0&&o!=="string")return[];let i=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&i<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&i>r.maxLength&&n.push({path:t,validation:"maxLength",schema:r,value:e}),r.pattern!==void 0&&(new RegExp(r.pattern).test(e)||n.push({path:t,validation:"pattern",schema:r,value:e})),r.format!==void 0){let a=et(e,r,t);n.push(...a)}return n}function Q(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function _s(e,r,t=[]){let n=Q(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let o=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let i of n){if(i==="array"&&Array.isArray(e))return[];if(o==="number"&&i==="integer"&&Number.isInteger(e))return[];if(o===i||i==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(o==="number"&&n==="integer"&&Number.isInteger(e))return[];if(o===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function ws(e,r,t={},n=[],o){return r?x(e,r,t,n,o):[]}function x(e,r,t={},n=[],o){let i=o,a;if(!o&&r["x-jsf-logic"]){i=be(r["x-jsf-logic"],e);let{validations:h,computedValues:b,...g}=r["x-jsf-logic"];a=g}let s=e===void 0||e===null&&t.treatNullAsUndefined,l=[];if(s)return[];if(typeof r=="boolean")return!r&&!t.allowForbiddenValues?[{path:n,validation:"forbidden",schema:r,value:e}]:[];let c=r["x-jsf-presentation"]?.inputType==="file",p=[];if(!c&&(p=_s(e,r,n),p.length>0))return p;if(r.required&&v(e)){let h=r.required.filter(b=>{let g=e[b];return Array.isArray(g)?g.length===0:v(g)?Object.keys(g).length===0:g===void 0||g===null&&t.treatNullAsUndefined});for(let b of h)l.push({path:[...n,b],validation:"required",schema:r?.properties?.[b]||r,value:e})}return[...l,...kr(e,r,n),...Wr(e,r,n),...Yr(e,r,t,i,n),...Br(e,r,t,i,n),...rt(e,r,n),...Xr(e,r,n),...Kr(e,r,n),...zr(e,r,t,i,n),...$r(e,r,t,i,n),...Ur(e,r,t,i,n),...Hr(e,r,t,i,n),...Gr(e,r,t,i,n),...wr(e,r,t,n),...ws(e,a,t,n,i),...Pr(r,i,n)]}function Le({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?be(e["x-jsf-logic"],r):void 0,o=Dr(e);return xe(o,r,t,n),n?.schema.computedValues&&Mr(o,n.schema.computedValues,r),o}function tt(e,r,t,n={}){let o=x(e,t.if,n).length===0,i=!1;return o&&t.if?.required&&(i=t.if.required.some(s=>{if(!r.properties||!r.properties[s])return!1;let l=r.properties[s],f=e[s];return x(f,l,n).some(p=>p.validation==="type")})),{rule:t,matches:o&&!i}}function xe(e,r={},t={},n){if(!v(r))return;let o=[];e.if&&o.push(tt(r,e,e,t)),(e.allOf??[]).filter(i=>typeof i.if<"u").forEach(i=>{let a=tt(r,e,i,t);o.push(a)});for(let{rule:i,matches:a}of o)a&&i.then?(nt(e,r,i.then,t,n),delete i.then):!a&&i.else&&(nt(e,r,i.else,t,n),delete i.else);if(e.properties){for(let[i,a]of Object.entries(e.properties))if(typeof a=="object"){let s=a;s.type==="object"&&xe(s,r[i],t,n),s.items&&xe(s.items,r[i],t,n)}}}function nt(e,r,t,n={},o){let i=t;xe(i,r,n,o),Z(e,i)}function De(e,r,t){let n=_({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let o of e){let i=n.find(a=>a.name===o.name);if(i){it(o,i),Z(o,i);let a=r.properties?.[o.name];a&&typeof a=="object"&&o.fields&&a.type==="object"&&De(o.fields,a,t)}}}function it(e,r){for(let[t]of Object.entries(e))r[t]?e[t]&&typeof e[t]=="object"&&!Array.isArray(e[t])&&r[t]&&typeof r[t]=="object"&&!Array.isArray(r[t])&&it(e[t],r[t]):delete e[t]}function Cs(e){let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(["allOf","anyOf","oneOf"].includes(n)){t+1<e.length&&typeof e[t+1]=="number"&&t++;continue}n==="then"||n==="else"||(n==="items"&&typeof e[t+1]=="number"?(t++,r.push(e[t])):r.push(n))}return r}function Rs(e){if(e.length===0)return null;let r={};for(let t of e){let{path:n}=t;if(n.length===0){r[""]=t.message;continue}let o=Cs(n),i=r;for(let a=0;a<o.length-1;a++){let s=o[a];if(typeof s=="number"){if(!Array.isArray(i))throw new TypeError(`Expected an array at path: ${o.slice(0,a).join(".")}`);i[s]||(i[s]={}),i=i[s]}else typeof o[a+1]=="number"?s in i||(i[s]=[]):(!(s in i)||typeof i[s]=="string")&&(i[s]={}),i=i[s]}if(o.length>0){let a=o[o.length-1];i[a]=t.message}}return r}function js(e){return e.map(r=>{let{schema:t,value:n,validation:o,customErrorMessage:i}=r;return{...r,message:Jr(t,n,o,i)}})}function Js(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,o=n["x-jsf-errorMessage"]?.[t.validation];return n&&o?{...t,message:o}:t})}function Fs(e,r,t={}){let n={},o=x(e,r,t),i=js(o),a=Js(i,r),s=Rs(a);return s&&(n.formErrors=s),n}function Ns(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return _({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function Ps(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties"))throw new Error("`customProperties` is a deprecated option and it's not supported on json-schema-form v1")}function Ms(e,r={}){Ps(r);let t=r.initialValues||{},n=r.strictInputType||!1,o=Le({schema:e,values:t,options:r.validationOptions}),i=Ns({schema:o,originalSchema:e,strictInputType:n});return{fields:i,isError:!1,error:null,handleValidation:l=>{let f=Le({schema:e,values:l,options:r.validationOptions}),c=Fs(l,f,r.validationOptions);return De(i,f,e),c}}}var Ua=I(qi(),1),G=I(Ki(),1),z=I(to(),1),Ha=I(Fa(),1),pr=I(Pa(),1),Re=I($a(),1);function za(e){return e.replace(".",".properties.")}function Ga(e){let{errorMessage:r,presentation:t,properties:n,...o}=e;return{...o,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function ka(e,r){return Array.isArray(r)?r:void 0}function cm(e,r){let{if:t,then:n,else:o}=e;return(0,z.default)(t?.required||[],r).length>0||((0,z.default)(n?.required||[],r)||(0,z.default)(Object.keys(n?.properties||{}),r)).length>0||((0,z.default)(o?.required||[],r)||(0,z.default)(Object.keys(o?.properties||{}),r)).length>0}function Wa(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([o,i])=>{let a=za(o),s=(0,G.default)(e.properties,a);if(!s){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${o}" was ignored because it does not exist.`});return}let l=typeof i=="function"?i(s):i;if((0,pr.default)(s,{...Ga(l)},ka),l.properties){let f=Wa((0,G.default)(e.properties,a),l.properties);f.warnings&&t.push(...f.warnings)}}),{warnings:t.flat()}}function Ka(e,r,t){if(!r||typeof e!="object"||e===null)return{warnings:null};let n=t?.parent;return typeof e=="object"&&e.properties&&Object.entries(e.properties).forEach(([o,i])=>{let a=n?`${n}.${o}`:o,s=r(a,i),l=Ga(s);(0,pr.default)((0,G.default)(e.properties,o),{...i,...l},ka),i.properties&&Ka(i,r,{parent:o})}),{warnings:null}}function pm(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],o=typeof r=="function"?r(n):r,i=(0,Ua.default)(n,o);return i.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${i.join(", ")}`}),e["x-jsf-order"]=[...o,...i],{warnings:t}}function Xa(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([o,i])=>{let a=za(o);if(!i)return{warnings:null};if(i.properties){let f=(0,G.default)(e.properties,a);if(!f)return{warnings:null};let c=Xa(f,i.properties);c.warnings&&t.push(...c.warnings)}if((0,G.default)(e.properties,a)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${o}" was ignored because it already exists.`});return}let l=(0,Re.default)({},a,i);(0,Ha.default)(e.properties,l)}),{warnings:t.flat()}}function dm(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([i,a])=>{switch(i){case"properties":r.forEach(s=>{(0,Re.default)(t.properties,s,a[s])});break;case"x-jsf-order":case"required":t[i]=a.filter(s=>r.includes(s));break;case"allOf":{let s=e[i]?.filter(l=>cm(l,r));t[i]=s;break}case"x-jsf-logic":t[i]=a;break}});let n={};t.allOf?.length&&t.allOf.forEach(i=>{let{if:a,then:s,else:l}=i,f=e.allOf?.indexOf(i);n={...n,...cr(a,{fields:r,path:`allOf[${f}].if`}),...cr(s,{fields:r,path:`allOf[${f}].then`}),...cr(l,{fields:r,path:`allOf[${f}].else`})}});let o=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([i])=>{(0,Re.default)(t.properties,i,e.properties?.[i])}),o.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(i=>`"${i}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:o}}function cr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(o=>{r.includes(o)||(n[o]={path:t})}),Object.entries(e.properties||[]).forEach(([o])=>{r.includes(o)||(n[o]={path:t})}),n}function hm(e,r){let t=JSON.parse(JSON.stringify(e)),n=Wa(t,r.fields),o=Ka(t,r.allFields),i=Xa(t,r.create),a=dm(t,r.pick),s=a.schema,l=pm(s,r.orderRoot);r.muteLogging||console.warn("json-schema-form modify(): We highly recommend you to handle/report the returned `warnings` as they highlight possible bugs in your modifications. To mute this log, pass `muteLogging: true` to the config.");let f=[n.warnings,o.warnings,i.warnings,a.warnings,l.warnings].flat().filter(Boolean);return{schema:s,warnings:f}}export{Ms as createHeadlessForm,hm as modify};
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|