@remoteoss/json-schema-form 1.0.2 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -173,6 +173,10 @@ interface CreateHeadlessFormOptions {
|
|
|
173
173
|
* @default false
|
|
174
174
|
*/
|
|
175
175
|
strictInputType?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Custom user defined functions. A dictionary of name and function
|
|
178
|
+
*/
|
|
179
|
+
customJsonLogicOps?: Record<string, (...args: any[]) => any>;
|
|
176
180
|
}
|
|
177
181
|
declare function createHeadlessForm(schema: JsfObjectSchema, options?: CreateHeadlessFormOptions): FormResult;
|
|
178
182
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var Qa=Object.create;var gr=Object.defineProperty;var es=Object.getOwnPropertyDescriptor;var rs=Object.getOwnPropertyNames;var ts=Object.getPrototypeOf,ns=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var is=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of rs(r))!ns.call(e,o)&&o!==t&&gr(e,o,{get:()=>r[o],enumerable:!(n=es(r,o))||n.enumerable});return e};var I=(e,r,t)=>(t=e!=null?Qa(ts(e)):{},is(r||!e||!e.__esModule?gr(t,"default",{value:e,enumerable:!0}):t,e));var W=u((ym,yr)=>{"use strict";yr.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Fe=u(q=>{"use strict";var h=W(),Je=()=>[{type:h.RANGE,from:48,to:57}],br=()=>[{type:h.CHAR,value:95},{type:h.RANGE,from:97,to:122},{type:h.RANGE,from:65,to:90}].concat(Je()),xr=()=>[{type:h.CHAR,value:9},{type:h.CHAR,value:10},{type:h.CHAR,value:11},{type:h.CHAR,value:12},{type:h.CHAR,value:13},{type:h.CHAR,value:32},{type:h.CHAR,value:160},{type:h.CHAR,value:5760},{type:h.RANGE,from:8192,to:8202},{type:h.CHAR,value:8232},{type:h.CHAR,value:8233},{type:h.CHAR,value:8239},{type:h.CHAR,value:8287},{type:h.CHAR,value:12288},{type:h.CHAR,value:65279}],os=()=>[{type:h.CHAR,value:10},{type:h.CHAR,value:13},{type:h.CHAR,value:8232},{type:h.CHAR,value:8233}];q.words=()=>({type:h.SET,set:br(),not:!1});q.notWords=()=>({type:h.SET,set:br(),not:!0});q.ints=()=>({type:h.SET,set:Je(),not:!1});q.notInts=()=>({type:h.SET,set:Je(),not:!0});q.whitespace=()=>({type:h.SET,set:xr(),not:!1});q.notWhitespace=()=>({type:h.SET,set:xr(),not:!0});q.anyChar=()=>({type:h.SET,set:os(),not:!0})});var Or=u(K=>{"use strict";var Sr=W(),J=Fe(),as="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",ss={0:0,t:9,n:10,v:11,f:12,r:13};K.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?as.indexOf(l):ss[f],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};K.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:Sr.RANGE,from:(o[8]||o[9]).charCodeAt(0),to:o[10].charCodeAt(0)});else if(i=o[12])t.push({type:Sr.CHAR,value:i.charCodeAt(0)});else return[t,n.lastIndex];K.error(r,"Unterminated character class")};K.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var vr=u(X=>{"use strict";var he=W();X.wordBoundary=()=>({type:he.POSITION,value:"b"});X.nonWordBoundary=()=>({type:he.POSITION,value:"B"});X.begin=()=>({type:he.POSITION,value:"^"});X.end=()=>({type:he.POSITION,value:"$"})});var Er=u((Om,Ne)=>{"use strict";var F=Or(),O=W(),A=Fe(),me=vr();Ne.exports=e=>{var r=0,t,n,o={type:O.ROOT,stack:[]},i=o,a=o.stack,s=[],l=Za=>{F.error(e,`Nothing to repeat at column ${Za-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(me.wordBoundary());break;case"B":a.push(me.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(me.begin());break;case"$":a.push(me.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 d={type:O.GROUP,stack:[],remember:!0};n=f[r],n==="?"&&(n=f[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),a.push(d),s.push(i),i=d,a=d.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)),V,mr;g!==null?(a.length===0&&l(r),V=parseInt(g[1],10),mr=g[2]?g[3]?parseInt(g[3],10):1/0:V,r+=g[0].length,a.push({type:O.REPETITION,min:V,max:mr,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};Ne.exports.types=O});var qr=u((vm,Tr)=>{"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}},Pe=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}))}};Tr.exports=Pe});var Ar=u((Em,Ir)=>{"use strict";var ge=Er(),Y=qr(),_=ge.types;Ir.exports=class Z{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=ge(r)}_setDefaults(r){this.max=r.max!=null?r.max:Z.prototype.max!=null?Z.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 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 Y?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===ge.types.CHAR)return new Y(r.value);if(r.type===ge.types.RANGE)return new Y(r.from,r.to);{let t=new Y;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 Y(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 Z(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Z.randexp(this)}}}});var Ue=u((jg,at)=>{"use strict";var Ds=typeof global=="object"&&global&&global.Object===Object&&global;at.exports=Ds});var C=u((Vg,st)=>{"use strict";var Bs=Ue(),$s=typeof self=="object"&&self&&self.Object===Object&&self,Us=Bs||$s||Function("return this")();st.exports=Us});var te=u((Jg,ut)=>{"use strict";var Hs=C(),zs=Hs.Symbol;ut.exports=zs});var pt=u((Fg,ct)=>{"use strict";var lt=te(),ft=Object.prototype,Gs=ft.hasOwnProperty,ks=ft.toString,ne=lt?lt.toStringTag:void 0;function Ws(e){var r=Gs.call(e,ne),t=e[ne];try{e[ne]=void 0;var n=!0}catch{}var o=ks.call(e);return n&&(r?e[ne]=t:delete e[ne]),o}ct.exports=Ws});var ht=u((Ng,dt)=>{"use strict";var Ks=Object.prototype,Xs=Ks.toString;function Ys(e){return Xs.call(e)}dt.exports=Ys});var L=u((Pg,yt)=>{"use strict";var mt=te(),Zs=pt(),Qs=ht(),eu="[object Null]",ru="[object Undefined]",gt=mt?mt.toStringTag:void 0;function tu(e){return e==null?e===void 0?ru:eu:gt&> in Object(e)?Zs(e):Qs(e)}yt.exports=tu});var T=u((Lg,bt)=>{"use strict";function nu(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}bt.exports=nu});var Oe=u((Mg,xt)=>{"use strict";var iu=L(),ou=T(),au="[object AsyncFunction]",su="[object Function]",uu="[object GeneratorFunction]",lu="[object Proxy]";function fu(e){if(!ou(e))return!1;var r=iu(e);return r==su||r==uu||r==au||r==lu}xt.exports=fu});var Ot=u((Dg,St)=>{"use strict";var cu=C(),pu=cu["__core-js_shared__"];St.exports=pu});var Tt=u((Bg,Et)=>{"use strict";var He=Ot(),vt=function(){var e=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function du(e){return!!vt&&vt in e}Et.exports=du});var It=u(($g,qt)=>{"use strict";var hu=Function.prototype,mu=hu.toString;function gu(e){if(e!=null){try{return mu.call(e)}catch{}try{return e+""}catch{}}return""}qt.exports=gu});var _t=u((Ug,At)=>{"use strict";var yu=Oe(),bu=Tt(),xu=T(),Su=It(),Ou=/[\\^$.*+?()[\]{}|]/g,vu=/^\[object .+?Constructor\]$/,Eu=Function.prototype,Tu=Object.prototype,qu=Eu.toString,Iu=Tu.hasOwnProperty,Au=RegExp("^"+qu.call(Iu).replace(Ou,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _u(e){if(!xu(e)||bu(e))return!1;var r=yu(e)?Au:vu;return r.test(Su(e))}At.exports=_u});var Ct=u((Hg,wt)=>{"use strict";function wu(e,r){return e?.[r]}wt.exports=wu});var ve=u((zg,Rt)=>{"use strict";var Cu=_t(),Ru=Ct();function ju(e,r){var t=Ru(e,r);return Cu(t)?t:void 0}Rt.exports=ju});var ie=u((Gg,jt)=>{"use strict";var Vu=ve(),Ju=Vu(Object,"create");jt.exports=Ju});var Ft=u((kg,Jt)=>{"use strict";var Vt=ie();function Fu(){this.__data__=Vt?Vt(null):{},this.size=0}Jt.exports=Fu});var Pt=u((Wg,Nt)=>{"use strict";function Nu(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}Nt.exports=Nu});var Mt=u((Kg,Lt)=>{"use strict";var Pu=ie(),Lu="__lodash_hash_undefined__",Mu=Object.prototype,Du=Mu.hasOwnProperty;function Bu(e){var r=this.__data__;if(Pu){var t=r[e];return t===Lu?void 0:t}return Du.call(r,e)?r[e]:void 0}Lt.exports=Bu});var Bt=u((Xg,Dt)=>{"use strict";var $u=ie(),Uu=Object.prototype,Hu=Uu.hasOwnProperty;function zu(e){var r=this.__data__;return $u?r[e]!==void 0:Hu.call(r,e)}Dt.exports=zu});var Ut=u((Yg,$t)=>{"use strict";var Gu=ie(),ku="__lodash_hash_undefined__";function Wu(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Gu&&r===void 0?ku:r,this}$t.exports=Wu});var zt=u((Zg,Ht)=>{"use strict";var Ku=Ft(),Xu=Pt(),Yu=Mt(),Zu=Bt(),Qu=Ut();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=Ku;M.prototype.delete=Xu;M.prototype.get=Yu;M.prototype.has=Zu;M.prototype.set=Qu;Ht.exports=M});var kt=u((Qg,Gt)=>{"use strict";function el(){this.__data__=[],this.size=0}Gt.exports=el});var oe=u((ey,Wt)=>{"use strict";function rl(e,r){return e===r||e!==e&&r!==r}Wt.exports=rl});var ae=u((ry,Kt)=>{"use strict";var tl=oe();function nl(e,r){for(var t=e.length;t--;)if(tl(e[t][0],r))return t;return-1}Kt.exports=nl});var Yt=u((ty,Xt)=>{"use strict";var il=ae(),ol=Array.prototype,al=ol.splice;function sl(e){var r=this.__data__,t=il(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():al.call(r,t,1),--this.size,!0}Xt.exports=sl});var Qt=u((ny,Zt)=>{"use strict";var ul=ae();function ll(e){var r=this.__data__,t=ul(r,e);return t<0?void 0:r[t][1]}Zt.exports=ll});var rn=u((iy,en)=>{"use strict";var fl=ae();function cl(e){return fl(this.__data__,e)>-1}en.exports=cl});var nn=u((oy,tn)=>{"use strict";var pl=ae();function dl(e,r){var t=this.__data__,n=pl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}tn.exports=dl});var se=u((ay,on)=>{"use strict";var hl=kt(),ml=Yt(),gl=Qt(),yl=rn(),bl=nn();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=hl;D.prototype.delete=ml;D.prototype.get=gl;D.prototype.has=yl;D.prototype.set=bl;on.exports=D});var ze=u((sy,an)=>{"use strict";var xl=ve(),Sl=C(),Ol=xl(Sl,"Map");an.exports=Ol});var ln=u((uy,un)=>{"use strict";var sn=zt(),vl=se(),El=ze();function Tl(){this.size=0,this.__data__={hash:new sn,map:new(El||vl),string:new sn}}un.exports=Tl});var cn=u((ly,fn)=>{"use strict";function ql(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}fn.exports=ql});var ue=u((fy,pn)=>{"use strict";var Il=cn();function Al(e,r){var t=e.__data__;return Il(r)?t[typeof r=="string"?"string":"hash"]:t.map}pn.exports=Al});var hn=u((cy,dn)=>{"use strict";var _l=ue();function wl(e){var r=_l(this,e).delete(e);return this.size-=r?1:0,r}dn.exports=wl});var gn=u((py,mn)=>{"use strict";var Cl=ue();function Rl(e){return Cl(this,e).get(e)}mn.exports=Rl});var bn=u((dy,yn)=>{"use strict";var jl=ue();function Vl(e){return jl(this,e).has(e)}yn.exports=Vl});var Sn=u((hy,xn)=>{"use strict";var Jl=ue();function Fl(e,r){var t=Jl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}xn.exports=Fl});var Ee=u((my,On)=>{"use strict";var Nl=ln(),Pl=hn(),Ll=gn(),Ml=bn(),Dl=Sn();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=Nl;B.prototype.delete=Pl;B.prototype.get=Ll;B.prototype.has=Ml;B.prototype.set=Dl;On.exports=B});var En=u((gy,vn)=>{"use strict";var Bl="__lodash_hash_undefined__";function $l(e){return this.__data__.set(e,Bl),this}vn.exports=$l});var qn=u((yy,Tn)=>{"use strict";function Ul(e){return this.__data__.has(e)}Tn.exports=Ul});var Ge=u((by,In)=>{"use strict";var Hl=Ee(),zl=En(),Gl=qn();function Te(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Hl;++r<t;)this.add(e[r])}Te.prototype.add=Te.prototype.push=zl;Te.prototype.has=Gl;In.exports=Te});var _n=u((xy,An)=>{"use strict";function kl(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}An.exports=kl});var Cn=u((Sy,wn)=>{"use strict";function Wl(e){return e!==e}wn.exports=Wl});var jn=u((Oy,Rn)=>{"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}Rn.exports=Kl});var Jn=u((vy,Vn)=>{"use strict";var Xl=_n(),Yl=Cn(),Zl=jn();function Ql(e,r,t){return r===r?Zl(e,r,t):Xl(e,Yl,t)}Vn.exports=Ql});var ke=u((Ey,Fn)=>{"use strict";var ef=Jn();function rf(e,r){var t=e==null?0:e.length;return!!t&&ef(e,r,0)>-1}Fn.exports=rf});var We=u((Ty,Nn)=>{"use strict";function tf(e,r,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(r,e[n]))return!0;return!1}Nn.exports=tf});var le=u((qy,Pn)=>{"use strict";function nf(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}Pn.exports=nf});var qe=u((Iy,Ln)=>{"use strict";function of(e){return function(r){return e(r)}}Ln.exports=of});var Ke=u((Ay,Mn)=>{"use strict";function af(e,r){return e.has(r)}Mn.exports=af});var Bn=u((_y,Dn)=>{"use strict";var sf=Ge(),uf=ke(),lf=We(),ff=le(),cf=qe(),pf=Ke(),df=200;function hf(e,r,t,n){var o=-1,i=uf,a=!0,s=e.length,l=[],f=r.length;if(!s)return l;t&&(r=ff(r,cf(t))),n?(i=lf,a=!1):r.length>=df&&(i=pf,a=!1,r=new sf(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 d=f;d--;)if(r[d]===p)continue e;l.push(c)}else i(r,p,n)||l.push(c)}return l}Dn.exports=hf});var Un=u((wy,$n)=>{"use strict";function mf(e,r){for(var t=-1,n=r.length,o=e.length;++t<n;)e[o+t]=r[t];return e}$n.exports=mf});var R=u((Cy,Hn)=>{"use strict";function gf(e){return e!=null&&typeof e=="object"}Hn.exports=gf});var Gn=u((Ry,zn)=>{"use strict";var yf=L(),bf=R(),xf="[object Arguments]";function Sf(e){return bf(e)&&yf(e)==xf}zn.exports=Sf});var Ie=u((jy,Kn)=>{"use strict";var kn=Gn(),Of=R(),Wn=Object.prototype,vf=Wn.hasOwnProperty,Ef=Wn.propertyIsEnumerable,Tf=kn(function(){return arguments}())?kn:function(e){return Of(e)&&vf.call(e,"callee")&&!Ef.call(e,"callee")};Kn.exports=Tf});var j=u((Vy,Xn)=>{"use strict";var qf=Array.isArray;Xn.exports=qf});var ei=u((Jy,Qn)=>{"use strict";var Yn=te(),If=Ie(),Af=j(),Zn=Yn?Yn.isConcatSpreadable:void 0;function _f(e){return Af(e)||If(e)||!!(Zn&&e&&e[Zn])}Qn.exports=_f});var ni=u((Fy,ti)=>{"use strict";var wf=Un(),Cf=ei();function ri(e,r,t,n,o){var i=-1,a=e.length;for(t||(t=Cf),o||(o=[]);++i<a;){var s=e[i];r>0&&t(s)?r>1?ri(s,r-1,t,n,o):wf(o,s):n||(o[o.length]=s)}return o}ti.exports=ri});var Xe=u((Ny,ii)=>{"use strict";function Rf(e){return e}ii.exports=Rf});var ai=u((Py,oi)=>{"use strict";function jf(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)}oi.exports=jf});var li=u((Ly,ui)=>{"use strict";var Vf=ai(),si=Math.max;function Jf(e,r,t){return r=si(r===void 0?e.length-1:r,0),function(){for(var n=arguments,o=-1,i=si(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),Vf(e,this,s)}}ui.exports=Jf});var ci=u((My,fi)=>{"use strict";function Ff(e){return function(){return e}}fi.exports=Ff});var Ye=u((Dy,pi)=>{"use strict";var Nf=ve(),Pf=function(){try{var e=Nf(Object,"defineProperty");return e({},"",{}),e}catch{}}();pi.exports=Pf});var mi=u((By,hi)=>{"use strict";var Lf=ci(),di=Ye(),Mf=Xe(),Df=di?function(e,r){return di(e,"toString",{configurable:!0,enumerable:!1,value:Lf(r),writable:!0})}:Mf;hi.exports=Df});var yi=u(($y,gi)=>{"use strict";var Bf=800,$f=16,Uf=Date.now;function Hf(e){var r=0,t=0;return function(){var n=Uf(),o=$f-(n-t);if(t=n,o>0){if(++r>=Bf)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}gi.exports=Hf});var xi=u((Uy,bi)=>{"use strict";var zf=mi(),Gf=yi(),kf=Gf(zf);bi.exports=kf});var Ae=u((Hy,Si)=>{"use strict";var Wf=Xe(),Kf=li(),Xf=xi();function Yf(e,r){return Xf(Kf(e,r,Wf),e+"")}Si.exports=Yf});var Ze=u((zy,Oi)=>{"use strict";var Zf=9007199254740991;function Qf(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zf}Oi.exports=Qf});var _e=u((Gy,vi)=>{"use strict";var ec=Oe(),rc=Ze();function tc(e){return e!=null&&rc(e.length)&&!ec(e)}vi.exports=tc});var we=u((ky,Ei)=>{"use strict";var nc=_e(),ic=R();function oc(e){return ic(e)&&nc(e)}Ei.exports=oc});var Ii=u((Wy,qi)=>{"use strict";var ac=Bn(),sc=ni(),uc=Ae(),Ti=we(),lc=uc(function(e,r){return Ti(e)?ac(e,sc(r,1,Ti,!0)):[]});qi.exports=lc});var Ce=u((Ky,Ai)=>{"use strict";var fc=L(),cc=R(),pc="[object Symbol]";function dc(e){return typeof e=="symbol"||cc(e)&&fc(e)==pc}Ai.exports=dc});var wi=u((Xy,_i)=>{"use strict";var hc=j(),mc=Ce(),gc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yc=/^\w*$/;function bc(e,r){if(hc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||mc(e)?!0:yc.test(e)||!gc.test(e)||r!=null&&e in Object(r)}_i.exports=bc});var ji=u((Yy,Ri)=>{"use strict";var Ci=Ee(),xc="Expected a function";function Qe(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(xc);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(Qe.Cache||Ci),t}Qe.Cache=Ci;Ri.exports=Qe});var Ji=u((Zy,Vi)=>{"use strict";var Sc=ji(),Oc=500;function vc(e){var r=Sc(e,function(n){return t.size===Oc&&t.clear(),n}),t=r.cache;return r}Vi.exports=vc});var Ni=u((Qy,Fi)=>{"use strict";var Ec=Ji(),Tc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qc=/\\(\\)?/g,Ic=Ec(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Tc,function(t,n,o,i){r.push(o?i.replace(qc,"$1"):n||t)}),r});Fi.exports=Ic});var $i=u((eb,Bi)=>{"use strict";var Pi=te(),Ac=le(),_c=j(),wc=Ce(),Cc=1/0,Li=Pi?Pi.prototype:void 0,Mi=Li?Li.toString:void 0;function Di(e){if(typeof e=="string")return e;if(_c(e))return Ac(e,Di)+"";if(wc(e))return Mi?Mi.call(e):"";var r=e+"";return r=="0"&&1/e==-Cc?"-0":r}Bi.exports=Di});var Hi=u((rb,Ui)=>{"use strict";var Rc=$i();function jc(e){return e==null?"":Rc(e)}Ui.exports=jc});var er=u((tb,zi)=>{"use strict";var Vc=j(),Jc=wi(),Fc=Ni(),Nc=Hi();function Pc(e,r){return Vc(e)?e:Jc(e,r)?[e]:Fc(Nc(e))}zi.exports=Pc});var rr=u((nb,Gi)=>{"use strict";var Lc=Ce(),Mc=1/0;function Dc(e){if(typeof e=="string"||Lc(e))return e;var r=e+"";return r=="0"&&1/e==-Mc?"-0":r}Gi.exports=Dc});var Wi=u((ib,ki)=>{"use strict";var Bc=er(),$c=rr();function Uc(e,r){r=Bc(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[$c(r[t++])];return t&&t==n?e:void 0}ki.exports=Uc});var Xi=u((ob,Ki)=>{"use strict";var Hc=Wi();function zc(e,r,t){var n=e==null?void 0:Hc(e,r);return n===void 0?t:n}Ki.exports=zc});var Qi=u((ab,Zi)=>{"use strict";var Gc=Ge(),kc=ke(),Wc=We(),Kc=le(),Xc=qe(),Yi=Ke(),Yc=Math.min;function Zc(e,r,t){for(var n=t?Wc:kc,o=e[0].length,i=e.length,a=i,s=Array(i),l=1/0,f=[];a--;){var c=e[a];a&&r&&(c=Kc(c,Xc(r))),l=Yc(c.length,l),s[a]=!t&&(r||o>=120&&c.length>=120)?new Gc(a&&c):void 0}c=e[0];var p=-1,d=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,!(d?Yi(d,g):n(f,g,t))){for(a=i;--a;){var V=s[a];if(!(V?Yi(V,g):n(e[a],g,t)))continue e}d&&d.push(g),f.push(b)}}return f}Zi.exports=Zc});var ro=u((sb,eo)=>{"use strict";var Qc=we();function ep(e){return Qc(e)?e:[]}eo.exports=ep});var no=u((ub,to)=>{"use strict";var rp=le(),tp=Qi(),np=Ae(),ip=ro(),op=np(function(e){var r=rp(e,ip);return r.length&&r[0]===e[0]?tp(r):[]});to.exports=op});var oo=u((lb,io)=>{"use strict";var ap=se();function sp(){this.__data__=new ap,this.size=0}io.exports=sp});var so=u((fb,ao)=>{"use strict";function up(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}ao.exports=up});var lo=u((cb,uo)=>{"use strict";function lp(e){return this.__data__.get(e)}uo.exports=lp});var co=u((pb,fo)=>{"use strict";function fp(e){return this.__data__.has(e)}fo.exports=fp});var ho=u((db,po)=>{"use strict";var cp=se(),pp=ze(),dp=Ee(),hp=200;function mp(e,r){var t=this.__data__;if(t instanceof cp){var n=t.__data__;if(!pp||n.length<hp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new dp(n)}return t.set(e,r),this.size=t.size,this}po.exports=mp});var go=u((hb,mo)=>{"use strict";var gp=se(),yp=oo(),bp=so(),xp=lo(),Sp=co(),Op=ho();function $(e){var r=this.__data__=new gp(e);this.size=r.size}$.prototype.clear=yp;$.prototype.delete=bp;$.prototype.get=xp;$.prototype.has=Sp;$.prototype.set=Op;mo.exports=$});var Re=u((mb,bo)=>{"use strict";var yo=Ye();function vp(e,r,t){r=="__proto__"&&yo?yo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}bo.exports=vp});var tr=u((gb,xo)=>{"use strict";var Ep=Re(),Tp=oe();function qp(e,r,t){(t!==void 0&&!Tp(e[r],t)||t===void 0&&!(r in e))&&Ep(e,r,t)}xo.exports=qp});var Oo=u((yb,So)=>{"use strict";function Ip(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}}So.exports=Ip});var Eo=u((bb,vo)=>{"use strict";var Ap=Oo(),_p=Ap();vo.exports=_p});var _o=u((fe,U)=>{"use strict";var wp=C(),Ao=typeof fe=="object"&&fe&&!fe.nodeType&&fe,To=Ao&&typeof U=="object"&&U&&!U.nodeType&&U,Cp=To&&To.exports===Ao,qo=Cp?wp.Buffer:void 0,Io=qo?qo.allocUnsafe:void 0;function Rp(e,r){if(r)return e.slice();var t=e.length,n=Io?Io(t):new e.constructor(t);return e.copy(n),n}U.exports=Rp});var Co=u((xb,wo)=>{"use strict";var jp=C(),Vp=jp.Uint8Array;wo.exports=Vp});var Vo=u((Sb,jo)=>{"use strict";var Ro=Co();function Jp(e){var r=new e.constructor(e.byteLength);return new Ro(r).set(new Ro(e)),r}jo.exports=Jp});var Fo=u((Ob,Jo)=>{"use strict";var Fp=Vo();function Np(e,r){var t=r?Fp(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}Jo.exports=Np});var Po=u((vb,No)=>{"use strict";function Pp(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}No.exports=Pp});var Do=u((Eb,Mo)=>{"use strict";var Lp=T(),Lo=Object.create,Mp=function(){function e(){}return function(r){if(!Lp(r))return{};if(Lo)return Lo(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();Mo.exports=Mp});var $o=u((Tb,Bo)=>{"use strict";function Dp(e,r){return function(t){return e(r(t))}}Bo.exports=Dp});var nr=u((qb,Uo)=>{"use strict";var Bp=$o(),$p=Bp(Object.getPrototypeOf,Object);Uo.exports=$p});var ir=u((Ib,Ho)=>{"use strict";var Up=Object.prototype;function Hp(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Up;return e===t}Ho.exports=Hp});var Go=u((Ab,zo)=>{"use strict";var zp=Do(),Gp=nr(),kp=ir();function Wp(e){return typeof e.constructor=="function"&&!kp(e)?zp(Gp(e)):{}}zo.exports=Wp});var Wo=u((_b,ko)=>{"use strict";function Kp(){return!1}ko.exports=Kp});var or=u((ce,H)=>{"use strict";var Xp=C(),Yp=Wo(),Yo=typeof ce=="object"&&ce&&!ce.nodeType&&ce,Ko=Yo&&typeof H=="object"&&H&&!H.nodeType&&H,Zp=Ko&&Ko.exports===Yo,Xo=Zp?Xp.Buffer:void 0,Qp=Xo?Xo.isBuffer:void 0,ed=Qp||Yp;H.exports=ed});var ea=u((wb,Qo)=>{"use strict";var rd=L(),td=nr(),nd=R(),id="[object Object]",od=Function.prototype,ad=Object.prototype,Zo=od.toString,sd=ad.hasOwnProperty,ud=Zo.call(Object);function ld(e){if(!nd(e)||rd(e)!=id)return!1;var r=td(e);if(r===null)return!0;var t=sd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Zo.call(t)==ud}Qo.exports=ld});var ta=u((Cb,ra)=>{"use strict";var fd=L(),cd=Ze(),pd=R(),dd="[object Arguments]",hd="[object Array]",md="[object Boolean]",gd="[object Date]",yd="[object Error]",bd="[object Function]",xd="[object Map]",Sd="[object Number]",Od="[object Object]",vd="[object RegExp]",Ed="[object Set]",Td="[object String]",qd="[object WeakMap]",Id="[object ArrayBuffer]",Ad="[object DataView]",_d="[object Float32Array]",wd="[object Float64Array]",Cd="[object Int8Array]",Rd="[object Int16Array]",jd="[object Int32Array]",Vd="[object Uint8Array]",Jd="[object Uint8ClampedArray]",Fd="[object Uint16Array]",Nd="[object Uint32Array]",m={};m[_d]=m[wd]=m[Cd]=m[Rd]=m[jd]=m[Vd]=m[Jd]=m[Fd]=m[Nd]=!0;m[dd]=m[hd]=m[Id]=m[md]=m[Ad]=m[gd]=m[yd]=m[bd]=m[xd]=m[Sd]=m[Od]=m[vd]=m[Ed]=m[Td]=m[qd]=!1;function Pd(e){return pd(e)&&cd(e.length)&&!!m[fd(e)]}ra.exports=Pd});var ia=u((pe,z)=>{"use strict";var Ld=Ue(),na=typeof pe=="object"&&pe&&!pe.nodeType&&pe,de=na&&typeof z=="object"&&z&&!z.nodeType&&z,Md=de&&de.exports===na,ar=Md&&Ld.process,Dd=function(){try{var e=de&&de.require&&de.require("util").types;return e||ar&&ar.binding&&ar.binding("util")}catch{}}();z.exports=Dd});var sr=u((Rb,sa)=>{"use strict";var Bd=ta(),$d=qe(),oa=ia(),aa=oa&&oa.isTypedArray,Ud=aa?$d(aa):Bd;sa.exports=Ud});var ur=u((jb,ua)=>{"use strict";function Hd(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}ua.exports=Hd});var lr=u((Vb,la)=>{"use strict";var zd=Re(),Gd=oe(),kd=Object.prototype,Wd=kd.hasOwnProperty;function Kd(e,r,t){var n=e[r];(!(Wd.call(e,r)&&Gd(n,t))||t===void 0&&!(r in e))&&zd(e,r,t)}la.exports=Kd});var ca=u((Jb,fa)=>{"use strict";var Xd=lr(),Yd=Re();function Zd(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?Yd(t,s,l):Xd(t,s,l)}return t}fa.exports=Zd});var da=u((Fb,pa)=>{"use strict";function Qd(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}pa.exports=Qd});var je=u((Nb,ha)=>{"use strict";var eh=9007199254740991,rh=/^(?:0|[1-9]\d*)$/;function th(e,r){var t=typeof e;return r=r??eh,!!r&&(t=="number"||t!="symbol"&&rh.test(e))&&e>-1&&e%1==0&&e<r}ha.exports=th});var ga=u((Pb,ma)=>{"use strict";var nh=da(),ih=Ie(),oh=j(),ah=or(),sh=je(),uh=sr(),lh=Object.prototype,fh=lh.hasOwnProperty;function ch(e,r){var t=oh(e),n=!t&&ih(e),o=!t&&!n&&ah(e),i=!t&&!n&&!o&&uh(e),a=t||n||o||i,s=a?nh(e.length,String):[],l=s.length;for(var f in e)(r||fh.call(e,f))&&!(a&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||sh(f,l)))&&s.push(f);return s}ma.exports=ch});var ba=u((Lb,ya)=>{"use strict";function ph(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}ya.exports=ph});var Sa=u((Mb,xa)=>{"use strict";var dh=T(),hh=ir(),mh=ba(),gh=Object.prototype,yh=gh.hasOwnProperty;function bh(e){if(!dh(e))return mh(e);var r=hh(e),t=[];for(var n in e)n=="constructor"&&(r||!yh.call(e,n))||t.push(n);return t}xa.exports=bh});var fr=u((Db,Oa)=>{"use strict";var xh=ga(),Sh=Sa(),Oh=_e();function vh(e){return Oh(e)?xh(e,!0):Sh(e)}Oa.exports=vh});var Ea=u((Bb,va)=>{"use strict";var Eh=ca(),Th=fr();function qh(e){return Eh(e,Th(e))}va.exports=qh});var wa=u(($b,_a)=>{"use strict";var Ta=tr(),Ih=_o(),Ah=Fo(),_h=Po(),wh=Go(),qa=Ie(),Ia=j(),Ch=we(),Rh=or(),jh=Oe(),Vh=T(),Jh=ea(),Fh=sr(),Aa=ur(),Nh=Ea();function Ph(e,r,t,n,o,i,a){var s=Aa(e,t),l=Aa(r,t),f=a.get(l);if(f){Ta(e,t,f);return}var c=i?i(s,l,t+"",e,r,a):void 0,p=c===void 0;if(p){var d=Ia(l),b=!d&&Rh(l),g=!d&&!b&&Fh(l);c=l,d||b||g?Ia(s)?c=s:Ch(s)?c=_h(s):b?(p=!1,c=Ih(l,!0)):g?(p=!1,c=Ah(l,!0)):c=[]:Jh(l)||qa(l)?(c=s,qa(s)?c=Nh(s):(!Vh(s)||jh(s))&&(c=wh(l))):p=!1}p&&(a.set(l,c),o(c,l,n,i,a),a.delete(l)),Ta(e,t,c)}_a.exports=Ph});var cr=u((Ub,Ra)=>{"use strict";var Lh=go(),Mh=tr(),Dh=Eo(),Bh=wa(),$h=T(),Uh=fr(),Hh=ur();function Ca(e,r,t,n,o){e!==r&&Dh(r,function(i,a){if(o||(o=new Lh),$h(i))Bh(e,r,a,t,Ca,n,o);else{var s=n?n(Hh(e,a),i,a+"",e,r,o):void 0;s===void 0&&(s=i),Mh(e,a,s)}},Uh)}Ra.exports=Ca});var Va=u((Hb,ja)=>{"use strict";var zh=oe(),Gh=_e(),kh=je(),Wh=T();function Kh(e,r,t){if(!Wh(t))return!1;var n=typeof r;return(n=="number"?Gh(t)&&kh(r,t.length):n=="string"&&r in t)?zh(t[r],e):!1}ja.exports=Kh});var pr=u((zb,Ja)=>{"use strict";var Xh=Ae(),Yh=Va();function Zh(e){return Xh(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&&Yh(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=Zh});var Na=u((Gb,Fa)=>{"use strict";var Qh=cr(),em=pr(),rm=em(function(e,r,t){Qh(e,r,t)});Fa.exports=rm});var La=u((kb,Pa)=>{"use strict";var tm=cr(),nm=pr(),im=nm(function(e,r,t,n){tm(e,r,t,n)});Pa.exports=im});var Ba=u((Wb,Da)=>{"use strict";var om=lr(),am=er(),sm=je(),Ma=T(),um=rr();function lm(e,r,t,n){if(!Ma(e))return e;r=am(r,e);for(var o=-1,i=r.length,a=i-1,s=e;s!=null&&++o<i;){var l=um(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:sm(r[o+1])?[]:{})}om(s,l,f),s=s[l]}return e}Da.exports=lm});var Ua=u((Kb,$a)=>{"use strict";var fm=Ba();function cm(e,r,t){return e==null?e:fm(e,r,t)}$a.exports=cm});var Fr=I(Ar(),1);function wr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var us=["if","then","else"];function _r(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Q(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(us.includes(t))continue;let o=e[t];if(_r(n))_r(o)?Q(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"?Q(i,n):t==="required"?i.find(s=>s===a)||i.push(a):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Cr="yyyy-MM-dd";function Rr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function ls(e,r){let t=Rr(e,r);return t==="GREATER"||t==="EQUAL"}function fs(e,r){let t=Rr(e,r);return t==="LESSER"||t==="EQUAL"}function jr(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&&!ls(e,f)&&l.push({path:n,validation:"minDate",schema:r,value:e}),c&&!fs(e,c)&&l.push({path:n,validation:"maxDate",schema:r,value:e}),l}function Vr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Jr="Please acknowledge this field";function Nr(e,r,t,n){let o=e["x-jsf-presentation"];switch(t){case"type":return cs(e.type);case"required":return Vr(e)?Jr:"Required field";case"forbidden":return"Not allowed";case"const":return Vr(e)&&r===!1?Jr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${Le(r)}" is not valid.`;case"anyOf":return`The option "${Le(r)}" is not valid.`;case"oneOf":return`The option "${Le(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,Fr.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 ${Cr.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"?wr(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 cs(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 Le(e){return typeof e=="string"?e:JSON.stringify(e)}function ps(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?ps(r,e["x-jsf-order"]):r}function ds(e,r,t){r.checkboxValue=t.const,t.type==="boolean"&&(r.checkboxValue=!0)}function hs(e,r){if(e.options===void 0){let t=ys(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function ms(e,r,t,n){if(e.options===void 0){let o=Ss(r,t,n);o&&(e.fields=o)}}function gs(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 Pr(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 gs(e||t.type||"string",t)}function ye(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 ys(e){if(e.oneOf)return ye(e.oneOf||[]);if(e.items?.anyOf)return ye(e.items.anyOf);if(e.anyOf)return ye(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return ye(r)}return null}function bs(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 xs(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 Ss(e,r,t){return typeof e.properties=="object"&&e.properties!==null?bs(e,r,t):typeof e.items=="object"&&e.items!==null?xs(e,r,t):null}var Os=["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 c=Pr(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={...n["x-jsf-presentation"]||{},...e["x-jsf-presentation"]||{}},s=e["x-jsf-errorMessage"],l=Pr(i,r,e,o),f={...Object.entries(e).filter(([c])=>!Os.includes(c)).reduce((c,[p,d])=>({...c,[p]:d}),{}),name:r,inputType:l,type:l,jsonType:i||e.type,required:t,isVisible:!0,...s&&{errorMessage:s}};return l==="checkbox"&&ds(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)}),hs(f,e),ms(f,e,n),f}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 Lr(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 Mr(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 Dr(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 Br(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 $r(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 Ur(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 Hr(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 zr(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>E(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function Gr(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 d=p.name.toLowerCase(),b=d.includes(".")?`.${d.split(".").pop()}`:"";return b!==""&&f.includes(b)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}import be from"json-logic-js";function Se(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function kr(e){return/\{\{.*?\}\}/.test(e)}function xe(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function Wr(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(be.apply(i.rule,xe(a))===!1){let l=i.errorMessage;return l&&kr(l)&&(l=l.replace(/\{\{(.*?)\}\}/g,(f,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?be.apply(d.rule,xe(a)):be.apply({var:p},xe(a))})),[{path:t,validation:"json-logic",customErrorMessage:l,schema:e,value:a}]}return[]}).flat()}function As(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return be.apply(r,xe(t))}function Kr(e,r,t){if(r){let n={};Object.entries(r).forEach(([o,i])=>{let a=As(o,i.rule,t);n[o]=a}),P(e,n)}return e}function P(e,r){function t(n){if(typeof n!="object")return;let o=n["x-jsf-logic-computedAttrs"];o&&_s(n,r,o),n.type==="object"&&n.properties&&P(n,r),delete n["x-jsf-logic-computedAttrs"]}if(e.properties)for(let n in e.properties)t(e.properties[n]);else t(e);if(typeof e.if=="object"&&P(e.if,r),e.allOf&&e.allOf.length>0)for(let n of e.allOf)P(n,r);if(e.anyOf&&e.anyOf.length>0)for(let n of e.anyOf)P(n,r);if(e.oneOf&&e.oneOf.length>0)for(let n of e.oneOf)P(n,r)}function _s(e,r,t){if(typeof e!="object")return;function n(i){return kr(i)?i.replace(/\{\{(.*?)\}\}/g,(a,s)=>{let l=s.trim();return r[l]||`{{${l}}}`}):r[i]}function o(i,a,s,l){if(typeof i!="object")return;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):typeof e=="object"&&o(e,a,s,r)}}function Xr(e,r,t=[]){let n=[],o=ee(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},ws={[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=ws[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=ee(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 ee(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function Cs(e,r,t=[]){let n=ee(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 Rs(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=Se(r["x-jsf-logic"],e);let{validations:d,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=Cs(e,r,n),p.length>0))return p;if(r.required&&v(e)){let d=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 d)l.push({path:[...n,b],validation:"required",schema:r?.properties?.[b]||r,value:e})}return[...l,...Hr(e,r,n),...zr(e,r,n),...Yr(e,r,t,i,n),...Mr(e,r,t,i,n),...rt(e,r,n),...Xr(e,r,n),...Gr(e,r,n),...Ur(e,r,t,i,n),...Dr(e,r,t,i,n),...Br(e,r,t,i,n),...$r(e,r,t,i,n),...tt(e,r,t,i,n),...jr(e,r,t,n),...Rs(e,a,t,n,i),...Wr(r,i,n)]}function De(e,r,t,n,o=[]){return x(e,r,{...t,...typeof r=="boolean"?{allowForbiddenValues:!1}:{}},o,n).length===0}function tt(e,r,t,n,o=[]){if(r.if===void 0)return[];let i=De(e,r.if,t,n,o);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 Be({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Se(e["x-jsf-logic"],r):void 0,o=Lr(e);return re(o,r,t,n),n?.schema.computedValues&&(Kr(o,n.schema.computedValues,r),re(o,r,t,n)),o}function nt(e,r,t,n={},o){let i=De(e,t.if,n,o),a=!1;return i&&t.if?.required&&(a=t.if.required.some(l=>{if(!r.properties||!r.properties[l])return!1;let f=r.properties[l],c=e[l];return x(c,f,n).some(d=>d.validation==="type")})),{rule:t,matches:i&&!a}}function re(e,r={},t={},n){if(!v(r))return;let o=[];typeof e.if<"u"&&o.push(nt(r,e,e,t,n)),(e.allOf??[]).filter(i=>typeof i.if<"u").forEach(i=>{let a=nt(r,e,i,t,n);o.push(a)});for(let{rule:i,matches:a}of o)a&&i.then?(it(e,r,i.then,t,n),delete i.then):!a&&i.else&&(it(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"&&re(s,r[i],t,n),s.items&&re(s.items,r[i],t,n)}}}function it(e,r,t,n={},o){let i=t;re(i,r,n,o),Q(e,i)}function $e(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){ot(o,i),Q(o,i);let a=r.properties?.[o.name];a&&typeof a=="object"&&o.fields&&a.type==="object"&&$e(o.fields,a,t)}}}function ot(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])&&ot(e[t],r[t]):delete e[t]}function js(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 Vs(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=js(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:Nr(t,n,o,i)}})}function Fs(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 Ns(e,r,t={}){let n={},o=x(e,r,t),i=Js(o),a=Fs(i,r),s=Vs(a);return s&&(n.formErrors=s),n}function Ps(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return w({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function Ls(e){Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1")}function Ms(e,r={}){Ls(r);let t=r.initialValues||{},n=r.strictInputType||!1,o=Be({schema:e,values:t,options:r.legacyOptions}),i=Ps({schema:o,originalSchema:e,strictInputType:n});return{fields:i,isError:!1,error:null,handleValidation:l=>{let f=Be({schema:e,values:l,options:r.legacyOptions}),c=Ns(l,f,r.legacyOptions);return $e(i,f,e),c}}}var Ha=I(Ii(),1),k=I(Xi(),1),G=I(no(),1),za=I(Na(),1),hr=I(La(),1),Ve=I(Ua(),1);function Ga(e){return e.replace(".",".properties.")}function ka(e){let{errorMessage:r,presentation:t,properties:n,...o}=e;return{...o,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function Wa(e,r){return Array.isArray(r)?r:void 0}function pm(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=Ga(o),s=(0,k.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,hr.default)(s,{...ka(l)},Wa),l.properties){let f=Ka((0,k.default)(e.properties,a),l.properties);f.warnings&&t.push(...f.warnings)}}),{warnings:t.flat()}}function Xa(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=ka(s);(0,hr.default)((0,k.default)(e.properties,o),{...i,...l},Wa),i.properties&&Xa(i,r,{parent:o})}),{warnings:null}}function dm(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],o=typeof r=="function"?r(n):r,i=(0,Ha.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 Ya(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([o,i])=>{let a=Ga(o);if(!i)return{warnings:null};if(i.properties){let f=(0,k.default)(e.properties,a);if(!f)return{warnings:null};let c=Ya(f,i.properties);c.warnings&&t.push(...c.warnings)}if((0,k.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,Ve.default)({},a,i);(0,za.default)(e.properties,l)}),{warnings:t.flat()}}function hm(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,Ve.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=>pm(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,...dr(a,{fields:r,path:`allOf[${f}].if`}),...dr(s,{fields:r,path:`allOf[${f}].then`}),...dr(l,{fields:r,path:`allOf[${f}].else`})}});let o=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([i])=>{(0,Ve.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 dr(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 mm(e,r){let t=JSON.parse(JSON.stringify(e)),n=Ka(t,r.fields),o=Xa(t,r.allFields),i=Ya(t,r.create),a=hm(t,r.pick),s=a.schema,l=dm(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,mm as modify};
|
|
1
|
+
var us=Object.create;var br=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var cs=Object.getPrototypeOf,ps=Object.prototype.hasOwnProperty;var u=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var ds=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ls(r))!ps.call(e,i)&&i!==t&&br(e,i,{get:()=>r[i],enumerable:!(n=fs(r,i))||n.enumerable});return e};var I=(e,r,t)=>(t=e!=null?us(cs(e)):{},ds(r||!e||!e.__esModule?br(t,"default",{value:e,enumerable:!0}):t,e));var K=u((Lm,xr)=>{"use strict";xr.exports={ROOT:0,GROUP:1,POSITION:2,SET:3,RANGE:4,REPETITION:5,REFERENCE:6,CHAR:7}});var Pe=u(q=>{"use strict";var m=K(),Ne=()=>[{type:m.RANGE,from:48,to:57}],Or=()=>[{type:m.CHAR,value:95},{type:m.RANGE,from:97,to:122},{type:m.RANGE,from:65,to:90}].concat(Ne()),Sr=()=>[{type:m.CHAR,value:9},{type:m.CHAR,value:10},{type:m.CHAR,value:11},{type:m.CHAR,value:12},{type:m.CHAR,value:13},{type:m.CHAR,value:32},{type:m.CHAR,value:160},{type:m.CHAR,value:5760},{type:m.RANGE,from:8192,to:8202},{type:m.CHAR,value:8232},{type:m.CHAR,value:8233},{type:m.CHAR,value:8239},{type:m.CHAR,value:8287},{type:m.CHAR,value:12288},{type:m.CHAR,value:65279}],hs=()=>[{type:m.CHAR,value:10},{type:m.CHAR,value:13},{type:m.CHAR,value:8232},{type:m.CHAR,value:8233}];q.words=()=>({type:m.SET,set:Or(),not:!1});q.notWords=()=>({type:m.SET,set:Or(),not:!0});q.ints=()=>({type:m.SET,set:Ne(),not:!1});q.notInts=()=>({type:m.SET,set:Ne(),not:!0});q.whitespace=()=>({type:m.SET,set:Sr(),not:!1});q.notWhitespace=()=>({type:m.SET,set:Sr(),not:!0});q.anyChar=()=>({type:m.SET,set:hs(),not:!0})});var vr=u(Y=>{"use strict";var Er=K(),J=Pe(),ms="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",gs={0:0,t:9,n:10,v:11,f:12,r:13};Y.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,i,o,a,s,f,l){if(i)return t;var c=n?8:o?parseInt(o,16):a?parseInt(a,16):s?parseInt(s,8):f?ms.indexOf(f):gs[l],p=String.fromCharCode(c);return/[[\]{}^$.|?*+()]/.test(p)&&(p="\\"+p),p}),e};Y.tokenizeClass=(e,r)=>{for(var t=[],n=/\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(?:\\)?([^\]]))|(\])|(?:\\)?([^])/g,i,o;(i=n.exec(e))!=null;)if(i[1])t.push(J.words());else if(i[2])t.push(J.ints());else if(i[3])t.push(J.whitespace());else if(i[4])t.push(J.notWords());else if(i[5])t.push(J.notInts());else if(i[6])t.push(J.notWhitespace());else if(i[7])t.push({type:Er.RANGE,from:(i[8]||i[9]).charCodeAt(0),to:i[10].charCodeAt(0)});else if(o=i[12])t.push({type:Er.CHAR,value:o.charCodeAt(0)});else return[t,n.lastIndex];Y.error(r,"Unterminated character class")};Y.error=(e,r)=>{throw new SyntaxError("Invalid regular expression: /"+e+"/: "+r)}});var Tr=u(X=>{"use strict";var ye=K();X.wordBoundary=()=>({type:ye.POSITION,value:"b"});X.nonWordBoundary=()=>({type:ye.POSITION,value:"B"});X.begin=()=>({type:ye.POSITION,value:"^"});X.end=()=>({type:ye.POSITION,value:"$"})});var Ir=u((Um,Me)=>{"use strict";var F=vr(),S=K(),A=Pe(),be=Tr();Me.exports=e=>{var r=0,t,n,i={type:S.ROOT,stack:[]},o=i,a=i.stack,s=[],f=ss=>{F.error(e,`Nothing to repeat at column ${ss-1}`)},l=F.strToChars(e);for(t=l.length;r<t;)switch(n=l[r++],n){case"\\":switch(n=l[r++],n){case"b":a.push(be.wordBoundary());break;case"B":a.push(be.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:S.REFERENCE,value:parseInt(n,10)}):a.push({type:S.CHAR,value:n.charCodeAt(0)})}break;case"^":a.push(be.begin());break;case"$":a.push(be.end());break;case"[":var c;l[r]==="^"?(c=!0,r++):c=!1;var p=F.tokenizeClass(l.slice(r),e);r+=p[1],a.push({type:S.SET,set:p[0],not:c});break;case".":a.push(A.anyChar());break;case"(":var d={type:S.GROUP,stack:[],remember:!0};n=l[r],n==="?"&&(n=l[r+1],r+=2,n==="="?d.followedBy=!0:n==="!"?d.notFollowedBy=!0:n!==":"&&F.error(e,`Invalid group, character '${n}' after '?' at column ${r-1}`),d.remember=!1),a.push(d),s.push(o),o=d,a=d.stack;break;case")":s.length===0&&F.error(e,`Unmatched ) at column ${r-1}`),o=s.pop(),a=o.options?o.options[o.options.length-1]:o.stack;break;case"|":o.options||(o.options=[o.stack],delete o.stack);var h=[];o.options.push(h),a=h;break;case"{":var g=/^(\d+)(,(\d+)?)?\}/.exec(l.slice(r)),V,yr;g!==null?(a.length===0&&f(r),V=parseInt(g[1],10),yr=g[2]?g[3]?parseInt(g[3],10):1/0:V,r+=g[0].length,a.push({type:S.REPETITION,min:V,max:yr,value:a.pop()})):a.push({type:S.CHAR,value:123});break;case"?":a.length===0&&f(r),a.push({type:S.REPETITION,min:0,max:1,value:a.pop()});break;case"+":a.length===0&&f(r),a.push({type:S.REPETITION,min:1,max:1/0,value:a.pop()});break;case"*":a.length===0&&f(r),a.push({type:S.REPETITION,min:0,max:1/0,value:a.pop()});break;default:a.push({type:S.CHAR,value:n.charCodeAt(0)})}return s.length!==0&&F.error(e,"Unterminated group"),i};Me.exports.types=S});var Ar=u((Hm,qr)=>{"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}},Le=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=i=>{for(var o=0;o<this.ranges.length&&!i.touches(this.ranges[o]);)o++;for(var a=this.ranges.slice(0,o);o<this.ranges.length&&i.touches(this.ranges[o]);)i=i.add(this.ranges[o]),o++;a.push(i),this.ranges=a.concat(this.ranges.slice(o)),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=i=>{for(var o=0;o<this.ranges.length&&!i.overlaps(this.ranges[o]);)o++;for(var a=this.ranges.slice(0,o);o<this.ranges.length&&i.overlaps(this.ranges[o]);)a=a.concat(this.ranges[o].subtract(i)),o++;this.ranges=a.concat(this.ranges.slice(o)),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=[],i=o=>{for(var a=0;a<this.ranges.length&&!o.overlaps(this.ranges[a]);)a++;for(;a<this.ranges.length&&o.overlaps(this.ranges[a]);){var s=Math.max(this.ranges[a].low,o.low),f=Math.min(this.ranges[a].high,o.high);n.push(new N(s,f)),a++}};return r instanceof e?r.ranges.forEach(i):(t==null&&(t=r),i(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}))}};qr.exports=Le});var Cr=u((zm,wr)=>{"use strict";var xe=Ir(),Z=Ar(),w=xe.types;wr.exports=class Q{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=xe(r)}_setDefaults(r){this.max=r.max!=null?r.max:Q.prototype.max!=null?Q.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,i,o,a,s;switch(r.type){case w.ROOT:case w.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,i="",a=0,s=n.length;a<s;a++)i+=this._gen(n[a],t);return r.remember&&(t[r.groupNumber]=i),i;case w.POSITION:return"";case w.SET:var f=this._expand(r);return f.length?String.fromCharCode(this._randSelect(f)):"";case w.REPETITION:for(o=this.randInt(r.min,r.max===1/0?r.min+this.max:r.max),i="",a=0;a<o;a++)i+=this._gen(r.value,t);return i;case w.REFERENCE:return t[r.value-1]||"";case w.CHAR:var l=this.ignoreCase&&this._randBool()?this._toOtherCase(r.value):r.value;return String.fromCharCode(l)}}_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 Z?r.index(this.randInt(0,r.length-1)):r[this.randInt(0,r.length-1)]}_expand(r){if(r.type===xe.types.CHAR)return new Z(r.value);if(r.type===xe.types.RANGE)return new Z(r.from,r.to);{let t=new Z;for(let n=0;n<r.set.length;n++){let i=this._expand(r.set[n]);if(t.add(i),this.ignoreCase)for(let o=0;o<i.length;o++){let a=i.index(o),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 Z(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 Q(r,t),r._randexp=n):(n=r._randexp,n._setDefaults(r)),n.gen()}static sugar(){RegExp.prototype.gen=function(){return Q.randexp(this)}}}});var $r=u((Xm,Br)=>{"use strict";var Ss=function(r){return Es(r)&&!vs(r)};function Es(e){return!!e&&typeof e=="object"}function vs(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||qs(e)}var Ts=typeof Symbol=="function"&&Symbol.for,Is=Ts?Symbol.for("react.element"):60103;function qs(e){return e.$$typeof===Is}function As(e){return Array.isArray(e)?[]:{}}function re(e,r){return r.clone!==!1&&r.isMergeableObject(e)?P(As(e),e,r):e}function ws(e,r,t){return e.concat(r).map(function(n){return re(n,t)})}function Cs(e,r){if(!r.customMerge)return P;var t=r.customMerge(e);return typeof t=="function"?t:P}function _s(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function Lr(e){return Object.keys(e).concat(_s(e))}function Dr(e,r){try{return r in e}catch{return!1}}function js(e,r){return Dr(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function Rs(e,r,t){var n={};return t.isMergeableObject(e)&&Lr(e).forEach(function(i){n[i]=re(e[i],t)}),Lr(r).forEach(function(i){js(e,i)||(Dr(e,i)&&t.isMergeableObject(r[i])?n[i]=Cs(i,t)(e[i],r[i],t):n[i]=re(r[i],t))}),n}function P(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||ws,t.isMergeableObject=t.isMergeableObject||Ss,t.cloneUnlessOtherwiseSpecified=re;var n=Array.isArray(r),i=Array.isArray(e),o=n===i;return o?n?t.arrayMerge(e,r,t):Rs(e,r,t):re(r,t)}P.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(n,i){return P(n,i,t)},{})};var Vs=P;Br.exports=Vs});var ze=u((ty,mt)=>{"use strict";var uu=typeof global=="object"&&global&&global.Object===Object&&global;mt.exports=uu});var _=u((ny,gt)=>{"use strict";var fu=ze(),lu=typeof self=="object"&&self&&self.Object===Object&&self,cu=fu||lu||Function("return this")();gt.exports=cu});var oe=u((iy,yt)=>{"use strict";var pu=_(),du=pu.Symbol;yt.exports=du});var St=u((oy,Ot)=>{"use strict";var bt=oe(),xt=Object.prototype,hu=xt.hasOwnProperty,mu=xt.toString,ae=bt?bt.toStringTag:void 0;function gu(e){var r=hu.call(e,ae),t=e[ae];try{e[ae]=void 0;var n=!0}catch{}var i=mu.call(e);return n&&(r?e[ae]=t:delete e[ae]),i}Ot.exports=gu});var vt=u((ay,Et)=>{"use strict";var yu=Object.prototype,bu=yu.toString;function xu(e){return bu.call(e)}Et.exports=xu});var L=u((sy,qt)=>{"use strict";var Tt=oe(),Ou=St(),Su=vt(),Eu="[object Null]",vu="[object Undefined]",It=Tt?Tt.toStringTag:void 0;function Tu(e){return e==null?e===void 0?vu:Eu:It&&It in Object(e)?Ou(e):Su(e)}qt.exports=Tu});var T=u((uy,At)=>{"use strict";function Iu(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}At.exports=Iu});var ve=u((fy,wt)=>{"use strict";var qu=L(),Au=T(),wu="[object AsyncFunction]",Cu="[object Function]",_u="[object GeneratorFunction]",ju="[object Proxy]";function Ru(e){if(!Au(e))return!1;var r=qu(e);return r==Cu||r==_u||r==wu||r==ju}wt.exports=Ru});var _t=u((ly,Ct)=>{"use strict";var Vu=_(),Ju=Vu["__core-js_shared__"];Ct.exports=Ju});var Vt=u((cy,Rt)=>{"use strict";var Ge=_t(),jt=function(){var e=/[^.]+$/.exec(Ge&&Ge.keys&&Ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Fu(e){return!!jt&&jt in e}Rt.exports=Fu});var Ft=u((py,Jt)=>{"use strict";var Nu=Function.prototype,Pu=Nu.toString;function Mu(e){if(e!=null){try{return Pu.call(e)}catch{}try{return e+""}catch{}}return""}Jt.exports=Mu});var Pt=u((dy,Nt)=>{"use strict";var Lu=ve(),Du=Vt(),Bu=T(),$u=Ft(),Uu=/[\\^$.*+?()[\]{}|]/g,Hu=/^\[object .+?Constructor\]$/,zu=Function.prototype,Gu=Object.prototype,Wu=zu.toString,ku=Gu.hasOwnProperty,Ku=RegExp("^"+Wu.call(ku).replace(Uu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Yu(e){if(!Bu(e)||Du(e))return!1;var r=Lu(e)?Ku:Hu;return r.test($u(e))}Nt.exports=Yu});var Lt=u((hy,Mt)=>{"use strict";function Xu(e,r){return e?.[r]}Mt.exports=Xu});var Te=u((my,Dt)=>{"use strict";var Zu=Pt(),Qu=Lt();function ef(e,r){var t=Qu(e,r);return Zu(t)?t:void 0}Dt.exports=ef});var se=u((gy,Bt)=>{"use strict";var rf=Te(),tf=rf(Object,"create");Bt.exports=tf});var Ht=u((yy,Ut)=>{"use strict";var $t=se();function nf(){this.__data__=$t?$t(null):{},this.size=0}Ut.exports=nf});var Gt=u((by,zt)=>{"use strict";function of(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}zt.exports=of});var kt=u((xy,Wt)=>{"use strict";var af=se(),sf="__lodash_hash_undefined__",uf=Object.prototype,ff=uf.hasOwnProperty;function lf(e){var r=this.__data__;if(af){var t=r[e];return t===sf?void 0:t}return ff.call(r,e)?r[e]:void 0}Wt.exports=lf});var Yt=u((Oy,Kt)=>{"use strict";var cf=se(),pf=Object.prototype,df=pf.hasOwnProperty;function hf(e){var r=this.__data__;return cf?r[e]!==void 0:df.call(r,e)}Kt.exports=hf});var Zt=u((Sy,Xt)=>{"use strict";var mf=se(),gf="__lodash_hash_undefined__";function yf(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=mf&&r===void 0?gf:r,this}Xt.exports=yf});var en=u((Ey,Qt)=>{"use strict";var bf=Ht(),xf=Gt(),Of=kt(),Sf=Yt(),Ef=Zt();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=bf;D.prototype.delete=xf;D.prototype.get=Of;D.prototype.has=Sf;D.prototype.set=Ef;Qt.exports=D});var tn=u((vy,rn)=>{"use strict";function vf(){this.__data__=[],this.size=0}rn.exports=vf});var ue=u((Ty,nn)=>{"use strict";function Tf(e,r){return e===r||e!==e&&r!==r}nn.exports=Tf});var fe=u((Iy,on)=>{"use strict";var If=ue();function qf(e,r){for(var t=e.length;t--;)if(If(e[t][0],r))return t;return-1}on.exports=qf});var sn=u((qy,an)=>{"use strict";var Af=fe(),wf=Array.prototype,Cf=wf.splice;function _f(e){var r=this.__data__,t=Af(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Cf.call(r,t,1),--this.size,!0}an.exports=_f});var fn=u((Ay,un)=>{"use strict";var jf=fe();function Rf(e){var r=this.__data__,t=jf(r,e);return t<0?void 0:r[t][1]}un.exports=Rf});var cn=u((wy,ln)=>{"use strict";var Vf=fe();function Jf(e){return Vf(this.__data__,e)>-1}ln.exports=Jf});var dn=u((Cy,pn)=>{"use strict";var Ff=fe();function Nf(e,r){var t=this.__data__,n=Ff(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}pn.exports=Nf});var le=u((_y,hn)=>{"use strict";var Pf=tn(),Mf=sn(),Lf=fn(),Df=cn(),Bf=dn();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=Pf;B.prototype.delete=Mf;B.prototype.get=Lf;B.prototype.has=Df;B.prototype.set=Bf;hn.exports=B});var We=u((jy,mn)=>{"use strict";var $f=Te(),Uf=_(),Hf=$f(Uf,"Map");mn.exports=Hf});var bn=u((Ry,yn)=>{"use strict";var gn=en(),zf=le(),Gf=We();function Wf(){this.size=0,this.__data__={hash:new gn,map:new(Gf||zf),string:new gn}}yn.exports=Wf});var On=u((Vy,xn)=>{"use strict";function kf(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}xn.exports=kf});var ce=u((Jy,Sn)=>{"use strict";var Kf=On();function Yf(e,r){var t=e.__data__;return Kf(r)?t[typeof r=="string"?"string":"hash"]:t.map}Sn.exports=Yf});var vn=u((Fy,En)=>{"use strict";var Xf=ce();function Zf(e){var r=Xf(this,e).delete(e);return this.size-=r?1:0,r}En.exports=Zf});var In=u((Ny,Tn)=>{"use strict";var Qf=ce();function el(e){return Qf(this,e).get(e)}Tn.exports=el});var An=u((Py,qn)=>{"use strict";var rl=ce();function tl(e){return rl(this,e).has(e)}qn.exports=tl});var Cn=u((My,wn)=>{"use strict";var nl=ce();function il(e,r){var t=nl(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}wn.exports=il});var Ie=u((Ly,_n)=>{"use strict";var ol=bn(),al=vn(),sl=In(),ul=An(),fl=Cn();function $(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])}}$.prototype.clear=ol;$.prototype.delete=al;$.prototype.get=sl;$.prototype.has=ul;$.prototype.set=fl;_n.exports=$});var Rn=u((Dy,jn)=>{"use strict";var ll="__lodash_hash_undefined__";function cl(e){return this.__data__.set(e,ll),this}jn.exports=cl});var Jn=u((By,Vn)=>{"use strict";function pl(e){return this.__data__.has(e)}Vn.exports=pl});var ke=u(($y,Fn)=>{"use strict";var dl=Ie(),hl=Rn(),ml=Jn();function qe(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new dl;++r<t;)this.add(e[r])}qe.prototype.add=qe.prototype.push=hl;qe.prototype.has=ml;Fn.exports=qe});var Pn=u((Uy,Nn)=>{"use strict";function gl(e,r,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o<i;)if(r(e[o],o,e))return o;return-1}Nn.exports=gl});var Ln=u((Hy,Mn)=>{"use strict";function yl(e){return e!==e}Mn.exports=yl});var Bn=u((zy,Dn)=>{"use strict";function bl(e,r,t){for(var n=t-1,i=e.length;++n<i;)if(e[n]===r)return n;return-1}Dn.exports=bl});var Un=u((Gy,$n)=>{"use strict";var xl=Pn(),Ol=Ln(),Sl=Bn();function El(e,r,t){return r===r?Sl(e,r,t):xl(e,Ol,t)}$n.exports=El});var Ke=u((Wy,Hn)=>{"use strict";var vl=Un();function Tl(e,r){var t=e==null?0:e.length;return!!t&&vl(e,r,0)>-1}Hn.exports=Tl});var Ye=u((ky,zn)=>{"use strict";function Il(e,r,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(r,e[n]))return!0;return!1}zn.exports=Il});var pe=u((Ky,Gn)=>{"use strict";function ql(e,r){for(var t=-1,n=e==null?0:e.length,i=Array(n);++t<n;)i[t]=r(e[t],t,e);return i}Gn.exports=ql});var Ae=u((Yy,Wn)=>{"use strict";function Al(e){return function(r){return e(r)}}Wn.exports=Al});var Xe=u((Xy,kn)=>{"use strict";function wl(e,r){return e.has(r)}kn.exports=wl});var Yn=u((Zy,Kn)=>{"use strict";var Cl=ke(),_l=Ke(),jl=Ye(),Rl=pe(),Vl=Ae(),Jl=Xe(),Fl=200;function Nl(e,r,t,n){var i=-1,o=_l,a=!0,s=e.length,f=[],l=r.length;if(!s)return f;t&&(r=Rl(r,Vl(t))),n?(o=jl,a=!1):r.length>=Fl&&(o=Jl,a=!1,r=new Cl(r));e:for(;++i<s;){var c=e[i],p=t==null?c:t(c);if(c=n||c!==0?c:0,a&&p===p){for(var d=l;d--;)if(r[d]===p)continue e;f.push(c)}else o(r,p,n)||f.push(c)}return f}Kn.exports=Nl});var Zn=u((Qy,Xn)=>{"use strict";function Pl(e,r){for(var t=-1,n=r.length,i=e.length;++t<n;)e[i+t]=r[t];return e}Xn.exports=Pl});var j=u((eb,Qn)=>{"use strict";function Ml(e){return e!=null&&typeof e=="object"}Qn.exports=Ml});var ri=u((rb,ei)=>{"use strict";var Ll=L(),Dl=j(),Bl="[object Arguments]";function $l(e){return Dl(e)&&Ll(e)==Bl}ei.exports=$l});var we=u((tb,ii)=>{"use strict";var ti=ri(),Ul=j(),ni=Object.prototype,Hl=ni.hasOwnProperty,zl=ni.propertyIsEnumerable,Gl=ti(function(){return arguments}())?ti:function(e){return Ul(e)&&Hl.call(e,"callee")&&!zl.call(e,"callee")};ii.exports=Gl});var R=u((nb,oi)=>{"use strict";var Wl=Array.isArray;oi.exports=Wl});var fi=u((ib,ui)=>{"use strict";var ai=oe(),kl=we(),Kl=R(),si=ai?ai.isConcatSpreadable:void 0;function Yl(e){return Kl(e)||kl(e)||!!(si&&e&&e[si])}ui.exports=Yl});var pi=u((ob,ci)=>{"use strict";var Xl=Zn(),Zl=fi();function li(e,r,t,n,i){var o=-1,a=e.length;for(t||(t=Zl),i||(i=[]);++o<a;){var s=e[o];r>0&&t(s)?r>1?li(s,r-1,t,n,i):Xl(i,s):n||(i[i.length]=s)}return i}ci.exports=li});var Ze=u((ab,di)=>{"use strict";function Ql(e){return e}di.exports=Ql});var mi=u((sb,hi)=>{"use strict";function ec(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)}hi.exports=ec});var bi=u((ub,yi)=>{"use strict";var rc=mi(),gi=Math.max;function tc(e,r,t){return r=gi(r===void 0?e.length-1:r,0),function(){for(var n=arguments,i=-1,o=gi(n.length-r,0),a=Array(o);++i<o;)a[i]=n[r+i];i=-1;for(var s=Array(r+1);++i<r;)s[i]=n[i];return s[r]=t(a),rc(e,this,s)}}yi.exports=tc});var Oi=u((fb,xi)=>{"use strict";function nc(e){return function(){return e}}xi.exports=nc});var Qe=u((lb,Si)=>{"use strict";var ic=Te(),oc=function(){try{var e=ic(Object,"defineProperty");return e({},"",{}),e}catch{}}();Si.exports=oc});var Ti=u((cb,vi)=>{"use strict";var ac=Oi(),Ei=Qe(),sc=Ze(),uc=Ei?function(e,r){return Ei(e,"toString",{configurable:!0,enumerable:!1,value:ac(r),writable:!0})}:sc;vi.exports=uc});var qi=u((pb,Ii)=>{"use strict";var fc=800,lc=16,cc=Date.now;function pc(e){var r=0,t=0;return function(){var n=cc(),i=lc-(n-t);if(t=n,i>0){if(++r>=fc)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}Ii.exports=pc});var wi=u((db,Ai)=>{"use strict";var dc=Ti(),hc=qi(),mc=hc(dc);Ai.exports=mc});var Ce=u((hb,Ci)=>{"use strict";var gc=Ze(),yc=bi(),bc=wi();function xc(e,r){return bc(yc(e,r,gc),e+"")}Ci.exports=xc});var er=u((mb,_i)=>{"use strict";var Oc=9007199254740991;function Sc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Oc}_i.exports=Sc});var _e=u((gb,ji)=>{"use strict";var Ec=ve(),vc=er();function Tc(e){return e!=null&&vc(e.length)&&!Ec(e)}ji.exports=Tc});var je=u((yb,Ri)=>{"use strict";var Ic=_e(),qc=j();function Ac(e){return qc(e)&&Ic(e)}Ri.exports=Ac});var Fi=u((bb,Ji)=>{"use strict";var wc=Yn(),Cc=pi(),_c=Ce(),Vi=je(),jc=_c(function(e,r){return Vi(e)?wc(e,Cc(r,1,Vi,!0)):[]});Ji.exports=jc});var Re=u((xb,Ni)=>{"use strict";var Rc=L(),Vc=j(),Jc="[object Symbol]";function Fc(e){return typeof e=="symbol"||Vc(e)&&Rc(e)==Jc}Ni.exports=Fc});var Mi=u((Ob,Pi)=>{"use strict";var Nc=R(),Pc=Re(),Mc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lc=/^\w*$/;function Dc(e,r){if(Nc(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Pc(e)?!0:Lc.test(e)||!Mc.test(e)||r!=null&&e in Object(r)}Pi.exports=Dc});var Bi=u((Sb,Di)=>{"use strict";var Li=Ie(),Bc="Expected a function";function rr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Bc);var t=function(){var n=arguments,i=r?r.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return t.cache=o.set(i,a)||o,a};return t.cache=new(rr.Cache||Li),t}rr.Cache=Li;Di.exports=rr});var Ui=u((Eb,$i)=>{"use strict";var $c=Bi(),Uc=500;function Hc(e){var r=$c(e,function(n){return t.size===Uc&&t.clear(),n}),t=r.cache;return r}$i.exports=Hc});var zi=u((vb,Hi)=>{"use strict";var zc=Ui(),Gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wc=/\\(\\)?/g,kc=zc(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Gc,function(t,n,i,o){r.push(i?o.replace(Wc,"$1"):n||t)}),r});Hi.exports=kc});var Xi=u((Tb,Yi)=>{"use strict";var Gi=oe(),Kc=pe(),Yc=R(),Xc=Re(),Zc=1/0,Wi=Gi?Gi.prototype:void 0,ki=Wi?Wi.toString:void 0;function Ki(e){if(typeof e=="string")return e;if(Yc(e))return Kc(e,Ki)+"";if(Xc(e))return ki?ki.call(e):"";var r=e+"";return r=="0"&&1/e==-Zc?"-0":r}Yi.exports=Ki});var Qi=u((Ib,Zi)=>{"use strict";var Qc=Xi();function ep(e){return e==null?"":Qc(e)}Zi.exports=ep});var tr=u((qb,eo)=>{"use strict";var rp=R(),tp=Mi(),np=zi(),ip=Qi();function op(e,r){return rp(e)?e:tp(e,r)?[e]:np(ip(e))}eo.exports=op});var nr=u((Ab,ro)=>{"use strict";var ap=Re(),sp=1/0;function up(e){if(typeof e=="string"||ap(e))return e;var r=e+"";return r=="0"&&1/e==-sp?"-0":r}ro.exports=up});var no=u((wb,to)=>{"use strict";var fp=tr(),lp=nr();function cp(e,r){r=fp(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[lp(r[t++])];return t&&t==n?e:void 0}to.exports=cp});var oo=u((Cb,io)=>{"use strict";var pp=no();function dp(e,r,t){var n=e==null?void 0:pp(e,r);return n===void 0?t:n}io.exports=dp});var uo=u((_b,so)=>{"use strict";var hp=ke(),mp=Ke(),gp=Ye(),yp=pe(),bp=Ae(),ao=Xe(),xp=Math.min;function Op(e,r,t){for(var n=t?gp:mp,i=e[0].length,o=e.length,a=o,s=Array(o),f=1/0,l=[];a--;){var c=e[a];a&&r&&(c=yp(c,bp(r))),f=xp(c.length,f),s[a]=!t&&(r||i>=120&&c.length>=120)?new hp(a&&c):void 0}c=e[0];var p=-1,d=s[0];e:for(;++p<i&&l.length<f;){var h=c[p],g=r?r(h):h;if(h=t||h!==0?h:0,!(d?ao(d,g):n(l,g,t))){for(a=o;--a;){var V=s[a];if(!(V?ao(V,g):n(e[a],g,t)))continue e}d&&d.push(g),l.push(h)}}return l}so.exports=Op});var lo=u((jb,fo)=>{"use strict";var Sp=je();function Ep(e){return Sp(e)?e:[]}fo.exports=Ep});var po=u((Rb,co)=>{"use strict";var vp=pe(),Tp=uo(),Ip=Ce(),qp=lo(),Ap=Ip(function(e){var r=vp(e,qp);return r.length&&r[0]===e[0]?Tp(r):[]});co.exports=Ap});var mo=u((Vb,ho)=>{"use strict";var wp=le();function Cp(){this.__data__=new wp,this.size=0}ho.exports=Cp});var yo=u((Jb,go)=>{"use strict";function _p(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}go.exports=_p});var xo=u((Fb,bo)=>{"use strict";function jp(e){return this.__data__.get(e)}bo.exports=jp});var So=u((Nb,Oo)=>{"use strict";function Rp(e){return this.__data__.has(e)}Oo.exports=Rp});var vo=u((Pb,Eo)=>{"use strict";var Vp=le(),Jp=We(),Fp=Ie(),Np=200;function Pp(e,r){var t=this.__data__;if(t instanceof Vp){var n=t.__data__;if(!Jp||n.length<Np-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Fp(n)}return t.set(e,r),this.size=t.size,this}Eo.exports=Pp});var Io=u((Mb,To)=>{"use strict";var Mp=le(),Lp=mo(),Dp=yo(),Bp=xo(),$p=So(),Up=vo();function U(e){var r=this.__data__=new Mp(e);this.size=r.size}U.prototype.clear=Lp;U.prototype.delete=Dp;U.prototype.get=Bp;U.prototype.has=$p;U.prototype.set=Up;To.exports=U});var Ve=u((Lb,Ao)=>{"use strict";var qo=Qe();function Hp(e,r,t){r=="__proto__"&&qo?qo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}Ao.exports=Hp});var ir=u((Db,wo)=>{"use strict";var zp=Ve(),Gp=ue();function Wp(e,r,t){(t!==void 0&&!Gp(e[r],t)||t===void 0&&!(r in e))&&zp(e,r,t)}wo.exports=Wp});var _o=u((Bb,Co)=>{"use strict";function kp(e){return function(r,t,n){for(var i=-1,o=Object(r),a=n(r),s=a.length;s--;){var f=a[e?s:++i];if(t(o[f],f,o)===!1)break}return r}}Co.exports=kp});var Ro=u(($b,jo)=>{"use strict";var Kp=_o(),Yp=Kp();jo.exports=Yp});var Po=u((de,H)=>{"use strict";var Xp=_(),No=typeof de=="object"&&de&&!de.nodeType&&de,Vo=No&&typeof H=="object"&&H&&!H.nodeType&&H,Zp=Vo&&Vo.exports===No,Jo=Zp?Xp.Buffer:void 0,Fo=Jo?Jo.allocUnsafe:void 0;function Qp(e,r){if(r)return e.slice();var t=e.length,n=Fo?Fo(t):new e.constructor(t);return e.copy(n),n}H.exports=Qp});var Lo=u((Ub,Mo)=>{"use strict";var ed=_(),rd=ed.Uint8Array;Mo.exports=rd});var $o=u((Hb,Bo)=>{"use strict";var Do=Lo();function td(e){var r=new e.constructor(e.byteLength);return new Do(r).set(new Do(e)),r}Bo.exports=td});var Ho=u((zb,Uo)=>{"use strict";var nd=$o();function id(e,r){var t=r?nd(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}Uo.exports=id});var Go=u((Gb,zo)=>{"use strict";function od(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}zo.exports=od});var Ko=u((Wb,ko)=>{"use strict";var ad=T(),Wo=Object.create,sd=function(){function e(){}return function(r){if(!ad(r))return{};if(Wo)return Wo(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();ko.exports=sd});var Xo=u((kb,Yo)=>{"use strict";function ud(e,r){return function(t){return e(r(t))}}Yo.exports=ud});var or=u((Kb,Zo)=>{"use strict";var fd=Xo(),ld=fd(Object.getPrototypeOf,Object);Zo.exports=ld});var ar=u((Yb,Qo)=>{"use strict";var cd=Object.prototype;function pd(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||cd;return e===t}Qo.exports=pd});var ra=u((Xb,ea)=>{"use strict";var dd=Ko(),hd=or(),md=ar();function gd(e){return typeof e.constructor=="function"&&!md(e)?dd(hd(e)):{}}ea.exports=gd});var na=u((Zb,ta)=>{"use strict";function yd(){return!1}ta.exports=yd});var sr=u((he,z)=>{"use strict";var bd=_(),xd=na(),aa=typeof he=="object"&&he&&!he.nodeType&&he,ia=aa&&typeof z=="object"&&z&&!z.nodeType&&z,Od=ia&&ia.exports===aa,oa=Od?bd.Buffer:void 0,Sd=oa?oa.isBuffer:void 0,Ed=Sd||xd;z.exports=Ed});var fa=u((Qb,ua)=>{"use strict";var vd=L(),Td=or(),Id=j(),qd="[object Object]",Ad=Function.prototype,wd=Object.prototype,sa=Ad.toString,Cd=wd.hasOwnProperty,_d=sa.call(Object);function jd(e){if(!Id(e)||vd(e)!=qd)return!1;var r=Td(e);if(r===null)return!0;var t=Cd.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&sa.call(t)==_d}ua.exports=jd});var ca=u((ex,la)=>{"use strict";var Rd=L(),Vd=er(),Jd=j(),Fd="[object Arguments]",Nd="[object Array]",Pd="[object Boolean]",Md="[object Date]",Ld="[object Error]",Dd="[object Function]",Bd="[object Map]",$d="[object Number]",Ud="[object Object]",Hd="[object RegExp]",zd="[object Set]",Gd="[object String]",Wd="[object WeakMap]",kd="[object ArrayBuffer]",Kd="[object DataView]",Yd="[object Float32Array]",Xd="[object Float64Array]",Zd="[object Int8Array]",Qd="[object Int16Array]",eh="[object Int32Array]",rh="[object Uint8Array]",th="[object Uint8ClampedArray]",nh="[object Uint16Array]",ih="[object Uint32Array]",y={};y[Yd]=y[Xd]=y[Zd]=y[Qd]=y[eh]=y[rh]=y[th]=y[nh]=y[ih]=!0;y[Fd]=y[Nd]=y[kd]=y[Pd]=y[Kd]=y[Md]=y[Ld]=y[Dd]=y[Bd]=y[$d]=y[Ud]=y[Hd]=y[zd]=y[Gd]=y[Wd]=!1;function oh(e){return Jd(e)&&Vd(e.length)&&!!y[Rd(e)]}la.exports=oh});var da=u((me,G)=>{"use strict";var ah=ze(),pa=typeof me=="object"&&me&&!me.nodeType&&me,ge=pa&&typeof G=="object"&&G&&!G.nodeType&&G,sh=ge&&ge.exports===pa,ur=sh&&ah.process,uh=function(){try{var e=ge&&ge.require&&ge.require("util").types;return e||ur&&ur.binding&&ur.binding("util")}catch{}}();G.exports=uh});var fr=u((rx,ga)=>{"use strict";var fh=ca(),lh=Ae(),ha=da(),ma=ha&&ha.isTypedArray,ch=ma?lh(ma):fh;ga.exports=ch});var lr=u((tx,ya)=>{"use strict";function ph(e,r){if(!(r==="constructor"&&typeof e[r]=="function")&&r!="__proto__")return e[r]}ya.exports=ph});var cr=u((nx,ba)=>{"use strict";var dh=Ve(),hh=ue(),mh=Object.prototype,gh=mh.hasOwnProperty;function yh(e,r,t){var n=e[r];(!(gh.call(e,r)&&hh(n,t))||t===void 0&&!(r in e))&&dh(e,r,t)}ba.exports=yh});var Oa=u((ix,xa)=>{"use strict";var bh=cr(),xh=Ve();function Oh(e,r,t,n){var i=!t;t||(t={});for(var o=-1,a=r.length;++o<a;){var s=r[o],f=n?n(t[s],e[s],s,t,e):void 0;f===void 0&&(f=e[s]),i?xh(t,s,f):bh(t,s,f)}return t}xa.exports=Oh});var Ea=u((ox,Sa)=>{"use strict";function Sh(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}Sa.exports=Sh});var Je=u((ax,va)=>{"use strict";var Eh=9007199254740991,vh=/^(?:0|[1-9]\d*)$/;function Th(e,r){var t=typeof e;return r=r??Eh,!!r&&(t=="number"||t!="symbol"&&vh.test(e))&&e>-1&&e%1==0&&e<r}va.exports=Th});var Ia=u((sx,Ta)=>{"use strict";var Ih=Ea(),qh=we(),Ah=R(),wh=sr(),Ch=Je(),_h=fr(),jh=Object.prototype,Rh=jh.hasOwnProperty;function Vh(e,r){var t=Ah(e),n=!t&&qh(e),i=!t&&!n&&wh(e),o=!t&&!n&&!i&&_h(e),a=t||n||i||o,s=a?Ih(e.length,String):[],f=s.length;for(var l in e)(r||Rh.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ch(l,f)))&&s.push(l);return s}Ta.exports=Vh});var Aa=u((ux,qa)=>{"use strict";function Jh(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}qa.exports=Jh});var Ca=u((fx,wa)=>{"use strict";var Fh=T(),Nh=ar(),Ph=Aa(),Mh=Object.prototype,Lh=Mh.hasOwnProperty;function Dh(e){if(!Fh(e))return Ph(e);var r=Nh(e),t=[];for(var n in e)n=="constructor"&&(r||!Lh.call(e,n))||t.push(n);return t}wa.exports=Dh});var pr=u((lx,_a)=>{"use strict";var Bh=Ia(),$h=Ca(),Uh=_e();function Hh(e){return Uh(e)?Bh(e,!0):$h(e)}_a.exports=Hh});var Ra=u((cx,ja)=>{"use strict";var zh=Oa(),Gh=pr();function Wh(e){return zh(e,Gh(e))}ja.exports=Wh});var Ma=u((px,Pa)=>{"use strict";var Va=ir(),kh=Po(),Kh=Ho(),Yh=Go(),Xh=ra(),Ja=we(),Fa=R(),Zh=je(),Qh=sr(),em=ve(),rm=T(),tm=fa(),nm=fr(),Na=lr(),im=Ra();function om(e,r,t,n,i,o,a){var s=Na(e,t),f=Na(r,t),l=a.get(f);if(l){Va(e,t,l);return}var c=o?o(s,f,t+"",e,r,a):void 0,p=c===void 0;if(p){var d=Fa(f),h=!d&&Qh(f),g=!d&&!h&&nm(f);c=f,d||h||g?Fa(s)?c=s:Zh(s)?c=Yh(s):h?(p=!1,c=kh(f,!0)):g?(p=!1,c=Kh(f,!0)):c=[]:tm(f)||Ja(f)?(c=s,Ja(s)?c=im(s):(!rm(s)||em(s))&&(c=Xh(f))):p=!1}p&&(a.set(f,c),i(c,f,n,o,a),a.delete(f)),Va(e,t,c)}Pa.exports=om});var dr=u((dx,Da)=>{"use strict";var am=Io(),sm=ir(),um=Ro(),fm=Ma(),lm=T(),cm=pr(),pm=lr();function La(e,r,t,n,i){e!==r&&um(r,function(o,a){if(i||(i=new am),lm(o))fm(e,r,a,t,La,n,i);else{var s=n?n(pm(e,a),o,a+"",e,r,i):void 0;s===void 0&&(s=o),sm(e,a,s)}},cm)}Da.exports=La});var $a=u((hx,Ba)=>{"use strict";var dm=ue(),hm=_e(),mm=Je(),gm=T();function ym(e,r,t){if(!gm(t))return!1;var n=typeof r;return(n=="number"?hm(t)&&mm(r,t.length):n=="string"&&r in t)?dm(t[r],e):!1}Ba.exports=ym});var hr=u((mx,Ua)=>{"use strict";var bm=Ce(),xm=$a();function Om(e){return bm(function(r,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&xm(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),r=Object(r);++n<i;){var s=t[n];s&&e(r,s,n,o)}return r})}Ua.exports=Om});var za=u((gx,Ha)=>{"use strict";var Sm=dr(),Em=hr(),vm=Em(function(e,r,t){Sm(e,r,t)});Ha.exports=vm});var Wa=u((yx,Ga)=>{"use strict";var Tm=dr(),Im=hr(),qm=Im(function(e,r,t,n){Tm(e,r,t,n)});Ga.exports=qm});var Ya=u((bx,Ka)=>{"use strict";var Am=cr(),wm=tr(),Cm=Je(),ka=T(),_m=nr();function jm(e,r,t,n){if(!ka(e))return e;r=wm(r,e);for(var i=-1,o=r.length,a=o-1,s=e;s!=null&&++i<o;){var f=_m(r[i]),l=t;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(i!=a){var c=s[f];l=n?n(c,f,s):void 0,l===void 0&&(l=ka(c)?c:Cm(r[i+1])?[]:{})}Am(s,f,l),s=s[f]}return e}Ka.exports=jm});var Za=u((xx,Xa)=>{"use strict";var Rm=Ya();function Vm(e,r,t){return e==null?e:Rm(e,r,t)}Xa.exports=Vm});var Pr=I(Cr(),1);function jr(e){if(e===0)return 0;let r=e/1024;return Number.parseFloat(r.toFixed(2))}var ys=["if","then","else"];function _r(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ee(e,r){if(!(!e||!r)&&!(typeof e!="object"||typeof r!="object"))for(let[t,n]of Object.entries(r)){if(ys.includes(t))continue;let i=e[t];if(_r(n))_r(i)?ee(i,n):i!==n&&(e[t]=n);else if(i&&Array.isArray(n)){let o=i;for(let a of n)a&&typeof a=="object"?ee(o,n):t==="required"?o.find(s=>s===a)||o.push(a):e[t]=n}else e[t]!==n&&(e[t]=n)}}var Rr="yyyy-MM-dd";function Vr(e,r){let t=new Date(e).getTime(),n=new Date(r).getTime();return t<n?"LESSER":t>n?"GREATER":"EQUAL"}function bs(e,r){let t=Vr(e,r);return t==="GREATER"||t==="EQUAL"}function xs(e,r){let t=Vr(e,r);return t==="LESSER"||t==="EQUAL"}function Jr(e,r,t,n=[]){let i=typeof e=="string",o=e==="",a=e===void 0||e===null&&t.treatNullAsUndefined,s=o||a,f=[];if(!i||s||r["x-jsf-presentation"]===void 0)return f;let{minDate:l,maxDate:c}=r["x-jsf-presentation"];return l&&!bs(e,l)&&f.push({path:n,validation:"minDate",schema:r,value:e}),c&&!xs(e,c)&&f.push({path:n,validation:"maxDate",schema:r,value:e}),f}function Fr(e){return e["x-jsf-presentation"]?.inputType==="checkbox"}var Nr="Please acknowledge this field";function Mr(e,r,t,n){let i=e["x-jsf-presentation"];switch(t){case"type":return Os(e.type);case"required":return Fr(e)?Nr:"Required field";case"forbidden":return"Not allowed";case"const":return Fr(e)&&r===!1?Nr:`The only accepted value is ${JSON.stringify(e.const)}.`;case"enum":return`The option "${De(r)}" is not valid.`;case"oneOf":return`The option "${De(r)}" is not valid.`;case"anyOf":return`The option "${De(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,Pr.randexp)(e.pattern||"")}`;case"format":if(e.format==="email")return"Please enter a valid email address";if(e.format==="date"){let o=new Date().toISOString().split("T")[0];return`Must be a valid date in ${Rr.toLowerCase()} format. e.g. ${o}`}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 ${i?.minDate} or after.`;case"maxDate":return`The date must be ${i?.maxDate} or before.`;case"fileStructure":return"Not a valid file.";case"maxFileSize":{let o=i?.maxFileSize,a=typeof o=="number"?jr(o):void 0;return`File size too large.${a?` The limit is ${a} MB.`:""}`}case"accept":{let o=i?.accept;return`Unsupported file format.${o?` The acceptable formats are ${o}.`:""}`}case"minItems":{let o=e.minItems===1?"item":"items";return`Must have at least ${e.minItems} ${o}`}case"maxItems":{let o=e.maxItems===1?"item":"items";return`Must have at most ${e.maxItems} ${o}`}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 Os(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 De(e){return typeof e=="string"?e:JSON.stringify(e)}var Hr=I($r(),1);function Js(e,r){let t={};return r.forEach((i,o)=>{t[i]=o}),e.sort((i,o)=>{let a=t[i.name]??1/0,s=t[o.name]??1/0;return a!==s?a-s:e.indexOf(i)-e.indexOf(o)})}function Be(e,r){if(typeof e=="boolean")throw new TypeError("Schema must be an object");return e["x-jsf-order"]!==void 0?Js(r,e["x-jsf-order"]):r}function Fs(e,r,t){r.checkboxValue=t.const,t.type==="boolean"&&(r.checkboxValue=!0)}function Ns(e,r){if(e.options===void 0){let t=Ls(r);t&&(e.options=t,r.type==="array"&&(e.multiple=!0))}}function Ps(e,r,t,n){if(e.options===void 0){let i=$s(r,t,n);i&&(e.fields=i)}}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 Ur(e,r,t,n){let i=t["x-jsf-presentation"];if(i?.inputType)return i.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 Oe(e){return e.filter(r=>r!==null&&typeof r=="object"&&r.const!==null).map(r=>{let t=r.title,n=r.const,o=r["x-jsf-presentation"]?.meta,a={label:t||"",value:n};o&&(a.meta=o);let{title:s,const:f,"x-jsf-presentation":l,...c}=r;return{...a,...c}})}function Ls(e){if(e.oneOf)return Oe(e.oneOf||[]);if(e.items?.anyOf)return Oe(e.items.anyOf);if(e.anyOf)return Oe(e.anyOf);if(e.enum){let r=e.enum?.map(t=>({title:typeof t=="string"?t:JSON.stringify(t),const:t}))||[];return Oe(r)}return null}function Ds(e,r,t){let n=[];for(let o in e.properties){let a=e.required?.includes(o)||!1,s=C({schema:e.properties[o],name:o,required:a,originalSchema:r.properties?.[o]||e.properties[o],strictInputType:t});s&&n.push(s)}return Be(e,n)}function Bs(e,r,t){let n=[];if(typeof e.items!="object"||e.items===null)return[];if(e.items?.type==="object"){let o=e.items;for(let a in o.properties){let s=o.required?.includes(a)||!1,f=C({schema:o.properties[a],name:a,required:s,originalSchema:r,strictInputType:t});f&&(f.nameKey=a,n.push(f))}}else{let o=C({schema:e.items,name:"item",required:!1,originalSchema:r,strictInputType:t});o&&n.push(o)}return Be(e.items,n)}function $s(e,r,t){return typeof e.properties=="object"&&e.properties!==null?Ds(e,r,t):typeof e.items=="object"&&e.items!==null?Bs(e,r,t):null}var Us=["title","type","x-jsf-errorMessage","x-jsf-presentation","oneOf","anyOf","properties"];function C({schema:e,name:r,required:t=!1,originalSchema:n,strictInputType:i=!1,type:o=void 0}){if(e===!1){let d=Ur(o,r,n,i),h=["fieldset","group-array"].includes(d);return{type:d,name:r,inputType:d,jsonType:"boolean",required:t,isVisible:!1,...h&&{fields:[]}}}if(typeof e=="boolean")return null;let a=n["x-jsf-presentation"]||{},s=e["x-jsf-presentation"]||{},f=(0,Hr.default)(a,s,{arrayMerge:(d,h,g)=>h}),l=e["x-jsf-errorMessage"],c=Ur(o,r,e,i),p={...Object.entries(e).filter(([d])=>!Us.includes(d)).reduce((d,[h,g])=>({...d,[h]:g}),{}),name:r,inputType:c,type:c,jsonType:o||e.type,required:t,isVisible:!0,...l&&{errorMessage:l}};return c==="checkbox"&&Fs(c,p,e),e.title&&(p.label=e.title),Object.keys(f).length>0&&Object.entries(f).forEach(([d,h])=>{d!=="inputType"&&(p[d]=h)}),r!=="root"&&Ns(p,e),Ps(p,e,n),p}function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function v(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)=>v(t,r[n]));if(E(e)&&E(r)){let t=Object.keys(e).sort(),n=Object.keys(r).sort();return t.length!==n.length||!v(t,n)?!1:t.every(i=>v(e[i],r[i]))}return!1}function zr(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 Gr(e,r,t,n,i){return Array.isArray(e)?[...Hs(r,e,i),...ks(r,e,i),...Ws(e,r,t,n,i),...Gs(r,e,t,n,i),...zs(r,e,t,n,i)]:[]}function Hs(e,r,t){let n=[],i=r.length;return e.maxItems!==void 0&&i>e.maxItems&&n.push({path:t,validation:"maxItems",schema:e,value:r}),e.minItems!==void 0&&i<e.minItems&&n.push({path:t,validation:"minItems",schema:e,value:r}),n}function zs(e,r,t,n,i){if(e.items===void 0)return[];let o=[],a=Array.isArray(e.prefixItems)?e.prefixItems.length:0;for(let[s,f]of r.slice(a).entries())o.push(...x(f,e.items,t,[...i,"items",s+a],n));return o}function Gs(e,r,t,n,i){if(!Array.isArray(e.prefixItems))return[];let o=[];for(let[a,s]of r.entries())a<e.prefixItems.length&&o.push(...x(s,e.prefixItems[a],t,[...i,"prefixItems",a],n));return o}function Ws(e,r,t,n,i){if(!("contains"in r))return[];let o=[],a=e.filter(s=>x(s,r.contains,t,[...i,"contains"],n).length===0).length;return r.minContains===void 0&&r.maxContains===void 0?a<1&&o.push({path:i,validation:"contains",schema:r,value:e}):(r.minContains!==void 0&&a<r.minContains&&o.push({path:i,validation:"minContains",schema:r,value:e}),r.maxContains!==void 0&&a>r.maxContains&&o.push({path:i,validation:"maxContains",schema:r,value:e})),o}function ks(e,r,t){if(e.uniqueItems!==!0)return[];let n=new Map;for(let i=0;i<r.length;i++){for(let o of n.values())if(v(r[i],o))return[{path:t,validation:"uniqueItems",schema:e,value:r[i]}];n.set(i,r[i])}return[]}function Wr(e,r,t,n,i=[]){if(!r.allOf)return[];for(let o=0;o<r.allOf.length;o++){let a=r.allOf[o],s=x(e,a,t,[...i,"allOf",o],n);if(s.length>0)return s}return[]}function kr(e,r,t,n,i=[]){if(!r.anyOf)return[];if(i.length!==0){for(let s of r.anyOf)if(x(e,s,t,i,n).length===0)return[];return[{path:i,validation:"anyOf",schema:r,value:e}]}let o=[];for(let s of r.anyOf){let f=x(e,s,t,i,n);f.length!==0&&o.push(f)}return o.length<r.anyOf.length?[]:o.flat().reverse()}function Kr(e,r,t,n,i=[]){if(!r.oneOf)return[];if(r.oneOf.length===0)return[];let o=0;for(let a=0;a<r.oneOf.length&&!(x(e,r.oneOf[a],t,i,n).length===0&&(o++,o>1));a++);return o===0?[{path:i,validation:"oneOf",schema:r,value:e}]:o>1?[{path:i,validation:"oneOf",schema:r,value:e}]:[]}function Yr(e,r,t,n,i=[]){return r.not===void 0?[]:typeof r.not=="boolean"?r.not?[{path:i,validation:"not",schema:r,value:e}]:[]:x(e,r.not,t,i,n).length===0?[{path:i,validation:"not",schema:r,value:e}]:[]}function Xr(e,r,t=[]){let n=typeof r.const<"u"?r.const:r.value;return n===void 0?[]:v(n,e)?[]:[{path:t,validation:"const",schema:r,value:e}]}function Zr(e,r,t=[]){return r.enum===void 0?[]:r.enum.some(n=>v(n,e))?[]:[{path:t,validation:"enum",schema:r,value:e}]}function Qr(e,r,t=[]){let n=r["x-jsf-presentation"],i=n?.inputType==="file",o=typeof n?.maxFileSize=="number"||typeof n?.accept=="string";if(!(i||o))return[];if(!Array.isArray(e))return[];if(e.length===0)return[];if(!e.every(l=>E(l)&&typeof l.name=="string"&&typeof l.size=="number"))return[{path:t,validation:"fileStructure",schema:r,value:e}];let f=e;if(typeof n?.maxFileSize=="number"){let l=n.maxFileSize*1024;if(f.some(p=>p.size>l))return[{path:t,validation:"maxFileSize",schema:r,value:e}]}if(typeof n?.accept=="string"&&n.accept.trim()!==""){let l=n.accept.toLowerCase().split(",").map(c=>c.trim()).filter(c=>c).map(c=>c.startsWith(".")?c:`.${c}`);if(l.length>0&&!f.some(p=>{let d=p.name.toLowerCase(),h=d.includes(".")?`.${d.split(".").pop()}`:"";return h!==""&&l.includes(h)}))return[{path:t,validation:"accept",schema:r,value:e}]}return[]}import M from"json-logic-js";function Ee(e,r){let{validations:t,computedValues:n}=e;return{schema:{validations:t,computedValues:n},value:r}}function et(e){return/\{\{.*?\}\}/.test(e)}function Se(e={}){return Object.entries(e).reduce((r,[t,n])=>({...r,[t]:n??Number.NaN}),{})}function rt(e,r,t=[]){let n=e["x-jsf-logic-validations"];return!n||n.length===0?[]:n.map(i=>{let o=r?.schema?.validations?.[i],a=r?.value;if(!o)throw new Error(`[json-schema-form] json-logic error: "${e.title}" required validation "${i}" doesn't exist.`);if(M.apply(o.rule,Se(a))===!1){let f=o.errorMessage;return f&&et(f)&&(f=f.replace(/\{\{(.*?)\}\}/g,(l,c)=>{let p=c.trim(),d=r.schema.computedValues?.[p];return d?M.apply(d.rule,Se(a)):M.apply({var:p},Se(a))})),[{path:t,validation:"json-logic",customErrorMessage:f,schema:e,value:a}]}return[]}).flat()}function Ks(e,r,t){if(!r)throw new Error(`[json-schema-form] json-logic error: Computed value "${e}" doesn't exist`);return M.apply(r,Se(t))}function tt(e,r,t){if(r){let n={};Object.entries(r).forEach(([i,o])=>{let a=Ks(i,o.rule,t);n[i]=a}),te(e,n)}return e}function te(e,r){function t(n){if(typeof n!="object")return;let i=n["x-jsf-logic-computedAttrs"];if(i&&Ys(n,r,i),typeof n.properties=="object")for(let o in n.properties)t(n.properties[o]);if(typeof n.if=="object"&&te(n.if,r),n.allOf&&n.allOf.length>0)for(let o of n.allOf)te(o,r);if(n.anyOf&&n.anyOf.length>0)for(let o of n.anyOf)te(o,r);if(n.oneOf&&n.oneOf.length>0)for(let o of n.oneOf)te(o,r);delete n["x-jsf-logic-computedAttrs"]}t(e)}function Ys(e,r,t){if(typeof e!="object")return;function n(o){return et(o)?o.replace(/\{\{(.*?)\}\}/g,(a,s)=>{let f=s.trim();return r[f]||`{{${f}}}`}):r[o]}function i(o,a,s,f){if(typeof o!="object")return;let l=a;o[l]||(o[l]={}),Object.entries(s).forEach(([c,p])=>{typeof p=="string"?o[l][c]=n(p):i(o[l],c,p,f)})}for(let o in t){let a=o,s=t[o];typeof s=="string"?e[a]=n(s):typeof e=="object"&&i(e,a,s,r)}}function nt(e){if(e)for(let[r,t]of Object.entries(e))M.add_operation(r,t)}function it(e){if(e)for(let r of Object.keys(e))M.rm_operation(r)}function ot(e,r,t=[]){let n=[],i=ne(r);return typeof e!="number"?[]:i!==void 0&&!["number","integer"].includes(i)?[]:(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 at(e,r,t,n,i=[]){if(typeof r=="object"&&r.properties&&E(e)){let o=[];for(let[a,s]of Object.entries(r.properties))o.push(...x(e[a],s,t,[...i,a],n));return o}return[]}var st;(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"})(st||(st={}));var b;(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"})(b||(b={}));var ut;(function(e){e.Array="array",e.Boolean="boolean",e.Integer="integer",e.Null="null",e.Number="number",e.Object="object",e.String="string"})(ut||(ut={}));var O={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},Xs={[b.DateTime]:e=>O.DATE_TIME.test(e),[b.Date]:e=>O.DATE.test(e),[b.Time]:e=>O.TIME.test(e),[b.Duration]:e=>O.DURATION.test(e),[b.Email]:e=>e.length<=254&&O.EMAIL.test(e),[b.IDNEmail]:e=>e.length<=254&&O.IDN_EMAIL.test(e),[b.Hostname]:e=>e.length>255?!1:e.split(".").every(t=>O.HOSTNAME.test(t)),[b.IDNHostname]:e=>e.length>255?!1:e.split(".").every(t=>t.length<=63&&O.IDN_HOSTNAME.test(t)),[b.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()})},[b.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):O.IPV6_PART.test(n))},[b.URI]:e=>{try{let r=new URL(e);return r.protocol!==""&&O.PROTOCOL.test(r.protocol)}catch{return!1}},[b.URIReference]:e=>{try{return e.startsWith("//")?O.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.IRI]:e=>{try{let r=new URL(e);return r.protocol!==""&&O.PROTOCOL.test(r.protocol)}catch{return!1}},[b.IRIReference]:e=>{try{return e.startsWith("//")?O.URI_REFERENCE.test(e.slice(2)):(new URL(e,"http://example.com"),!0)}catch{return!1}},[b.RegEx]:e=>{try{return new RegExp(e,"u"),!0}catch{return!1}},[b.UUID]:e=>O.UUID.test(e),[b.JSONPointer]:e=>O.JSON_POINTER.test(e),[b.JSONPointerURIFragment]:e=>O.JSON_POINTER_URI_FRAGMENT.test(e),[b.RelativeJSONPointer]:e=>O.RELATIVE_JSON_POINTER.test(e),[b.URITemplate]:e=>O.URI_TEMPLATE.test(e)};function ft(e,r,t=[]){let n=[];if(typeof e!="string")return n;let i=Xs[r.format];return i&&!i(e)&&n.push({path:t,validation:"format",schema:r,value:e}),n}function lt(e,r,t=[]){let n=[],i=ne(r);if(typeof e!="string")return[];if(i!==void 0&&i!=="string")return[];let o=[...new Intl.Segmenter().segment(e)].length;if(r.minLength!==void 0&&o<r.minLength&&n.push({path:t,validation:"minLength",schema:r,value:e}),r.maxLength!==void 0&&o>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=ft(e,r,t);n.push(...a)}return n}function ne(e){if(typeof e=="boolean")return"boolean";if(e.type!==void 0)return e.type}function Zs(e,r,t=[]){let n=ne(r);if(n===void 0)return[];if(n==="null"&&e===null)return[];let i=e===null?"null":Array.isArray(e)?"array":typeof e;if(Array.isArray(n)){if(e===null&&n.includes("null"))return[];for(let o of n){if(o==="array"&&Array.isArray(e))return[];if(i==="number"&&o==="integer"&&Number.isInteger(e))return[];if(i===o||o==="null"&&e===null)return[]}}else{if(n==="array"&&Array.isArray(e))return[];if(i==="number"&&n==="integer"&&Number.isInteger(e))return[];if(i===n)return[]}return[{path:t,validation:"type",schema:r,value:e}]}function Qs(e,r,t={},n=[],i){return r?x(e,r,t,n,i):[]}function x(e,r,t={},n=[],i){let o=i,a;if(!i&&r["x-jsf-logic"]){o=Ee(r["x-jsf-logic"],e);let{validations:d,computedValues:h,...g}=r["x-jsf-logic"];a=g}let s=e===void 0||e===null&&t.treatNullAsUndefined,f=[];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=Zs(e,r,n),p.length>0))return p;if(r.required&&E(e)){let d=r.required.filter(h=>{let g=e[h];return Array.isArray(g)?g.length===0:E(g)?Object.keys(g).length===0:g===void 0||g===null&&t.treatNullAsUndefined});for(let h of d)f.push({path:[...n,h],validation:"required",schema:r?.properties?.[h]||r,value:e})}return[...f,...Xr(e,r,n),...Zr(e,r,n),...at(e,r,t,o,n),...Gr(e,r,t,o,n),...lt(e,r,n),...ot(e,r,n),...Qr(e,r,n),...Yr(e,r,t,o,n),...Wr(e,r,t,o,n),...kr(e,r,t,o,n),...Kr(e,r,t,o,n),...ct(e,r,t,o,n),...Jr(e,r,t,n),...Qs(e,a,t,n,o),...rt(r,o,n)]}function $e(e,r,t,n,i=[]){return x(e,r,{...t,...typeof r=="boolean"?{allowForbiddenValues:!1}:{}},i,n).length===0}function ct(e,r,t,n,i=[]){if(r.if===void 0)return[];let o=$e(e,r.if,t,n,i);return o&&r.then!==void 0?x(e,r.then,t,[...i,"then"],n):!o&&r.else!==void 0?x(e,r.else,t,[...i,"else"],n):[]}function Ue({schema:e,values:r,options:t={}}){let n=e["x-jsf-logic"]?Ee(e["x-jsf-logic"],r):void 0,i=zr(e);return ie(i,r,t,n),n?.schema.computedValues&&(tt(i,n.schema.computedValues,r),ie(i,r,t,n)),i}function pt(e,r,t,n={},i){let o=$e(e,t.if,n,i),a=!1;return o&&t.if?.required&&(a=t.if.required.some(f=>{if(!r.properties||!r.properties[f])return!1;let l=r.properties[f],c=e[f];return x(c,l,n).some(d=>d.validation==="type")})),{rule:t,matches:o&&!a}}function ie(e,r={},t={},n){if(!E(r))return;let i=[];typeof e.if<"u"&&i.push(pt(r,e,e,t,n)),(e.allOf??[]).filter(o=>typeof o.if<"u").forEach(o=>{let a=pt(r,e,o,t,n);i.push(a)});for(let{rule:o,matches:a}of i)a&&o.then?(dt(e,r,o.then,t,n),delete o.then):!a&&o.else&&(dt(e,r,o.else,t,n),delete o.else);if(e.properties){for(let[o,a]of Object.entries(e.properties))if(typeof a=="object"){let s=a;s.type==="object"&&ie(s,r[o],t,n),s.items&&ie(s.items,r[o],t,n)}}}function dt(e,r,t,n={},i){let o=t;ie(o,r,n,i),ee(e,o)}function He(e,r,t){let n=C({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:!1})?.fields||[];for(let i of e){let o=n.find(a=>a.name===i.name);if(o){ht(i,o),ee(i,o);let a=r.properties?.[i.name];a&&typeof a=="object"&&i.fields&&a.type==="object"&&He(i.fields,a,t)}}}function ht(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])&&ht(e[t],r[t]):delete e[t]}function eu(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 ru(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 i=eu(n),o=r;for(let a=0;a<i.length-1;a++){let s=i[a];if(typeof s=="number"){if(!Array.isArray(o))throw new TypeError(`Expected an array at path: ${i.slice(0,a).join(".")}`);o[s]||(o[s]={}),o=o[s]}else typeof i[a+1]=="number"?s in o||(o[s]=[]):(!(s in o)||typeof o[s]=="string")&&(o[s]={}),o=o[s]}if(i.length>0){let a=i[i.length-1];o[a]=t.message}}return r}function tu(e){return e.map(r=>{let{schema:t,value:n,validation:i,customErrorMessage:o}=r;return{...r,message:Mr(t,n,i,o)}})}function nu(e,r){return typeof r!="object"||!r||!e.length?e:e.map(t=>{let n=t.schema,i=n["x-jsf-errorMessage"]?.[t.validation];return n&&i?{...t,message:i}:t})}function iu(e,r,t={}){let n={},i=x(e,r,t),o=tu(i),a=nu(o,r),s=ru(a);return s&&(n.formErrors=s),n}function ou(e){let{schema:r,originalSchema:t,strictInputType:n}=e;return C({schema:r,name:"root",required:!0,originalSchema:t,strictInputType:n})?.fields||[]}function au(e){if(Object.prototype.hasOwnProperty.call(e,"customProperties")&&console.error("[json-schema-form] `customProperties` is a deprecated option and it's not supported on json-schema-form v1"),e.customJsonLogicOps){if(typeof e.customJsonLogicOps!="object"||e.customJsonLogicOps===null)throw new TypeError("validationOptions.customJsonLogicOps must be an object.");for(let[r,t]of Object.entries(e.customJsonLogicOps))if(typeof t!="function")throw new TypeError(`Custom JSON Logic operator '${r}' must be a function, but received type '${typeof t}'.`)}}function su(e,r={}){au(r);let t=r.initialValues||{},n=r.strictInputType||!1,i=Ue({schema:e,values:t,options:r.legacyOptions}),o=ou({schema:i,originalSchema:e,strictInputType:n});return{fields:o,isError:!1,error:null,handleValidation:f=>{let l=r?.customJsonLogicOps;try{nt(l);let c=Ue({schema:e,values:f,options:r.legacyOptions}),p=iu(f,c,r.legacyOptions);return He(o,c,e),p}finally{it(l)}}}}var Qa=I(Fi(),1),k=I(oo(),1),W=I(po(),1),es=I(za(),1),gr=I(Wa(),1),Fe=I(Za(),1);function rs(e){return e.replace(".",".properties.")}function ts(e){let{errorMessage:r,presentation:t,properties:n,...i}=e;return{...i,...t?{"x-jsf-presentation":t}:{},...r?{"x-jsf-errorMessage":r}:{}}}function ns(e,r){return Array.isArray(r)?r:void 0}function Jm(e,r){let{if:t,then:n,else:i}=e;return(0,W.default)(t?.required||[],r).length>0||((0,W.default)(n?.required||[],r)||(0,W.default)(Object.keys(n?.properties||{}),r)).length>0||((0,W.default)(i?.required||[],r)||(0,W.default)(Object.keys(i?.properties||{}),r)).length>0}function is(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let a=rs(i),s=(0,k.default)(e.properties,a);if(!s){t.push({type:"FIELD_TO_CHANGE_NOT_FOUND",message:`Changing field "${i}" was ignored because it does not exist.`});return}let f=typeof o=="function"?o(s):o;if((0,gr.default)(s,{...ts(f)},ns),f.properties){let l=is((0,k.default)(e.properties,a),f.properties);l.warnings&&t.push(...l.warnings)}}),{warnings:t.flat()}}function os(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(([i,o])=>{let a=n?`${n}.${i}`:i,s=r(a,o),f=ts(s);(0,gr.default)((0,k.default)(e.properties,i),{...o,...f},ns),o.properties&&os(o,r,{parent:i})}),{warnings:null}}function Fm(e,r){if(!r)return{warnings:null};let t=[],n=e["x-jsf-order"]||[],i=typeof r=="function"?r(n):r,o=(0,Qa.default)(n,i);return o.length>0&&t.push({type:"ORDER_MISSING_FIELDS",message:`Some fields got forgotten in the new order. They were automatically appended: ${o.join(", ")}`}),e["x-jsf-order"]=[...i,...o],{warnings:t}}function as(e,r){if(!r)return{warnings:null};let t=[];return Object.entries(r).forEach(([i,o])=>{let a=rs(i);if(!o)return{warnings:null};if(o.properties){let l=(0,k.default)(e.properties,a);if(!l)return{warnings:null};let c=as(l,o.properties);c.warnings&&t.push(...c.warnings)}if((0,k.default)(e.properties,a)){t.push({type:"FIELD_TO_CREATE_EXISTS",message:`Creating field "${i}" was ignored because it already exists.`});return}let f=(0,Fe.default)({},a,o);(0,es.default)(e.properties,f)}),{warnings:t.flat()}}function Nm(e,r){if(!r)return{schema:e,warnings:null};let t={properties:{}};Object.entries(e).forEach(([o,a])=>{switch(o){case"properties":r.forEach(s=>{(0,Fe.default)(t.properties,s,a[s])});break;case"x-jsf-order":case"required":t[o]=a.filter(s=>r.includes(s));break;case"allOf":{let s=e[o]?.filter(f=>Jm(f,r));t[o]=s;break}case"x-jsf-logic":t[o]=a;break}});let n={};t.allOf?.length&&t.allOf.forEach(o=>{let{if:a,then:s,else:f}=o,l=e.allOf?.indexOf(o);n={...n,...mr(a,{fields:r,path:`allOf[${l}].if`}),...mr(s,{fields:r,path:`allOf[${l}].then`}),...mr(f,{fields:r,path:`allOf[${l}].else`})}});let i=[];return Object.keys(n).length>0&&(Object.entries(n).forEach(([o])=>{(0,Fe.default)(t.properties,o,e.properties?.[o])}),i.push({type:"PICK_MISSED_FIELD",message:`The picked fields are in conditionals that refeer other fields. They added automatically: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}. Check "meta" for more details.`,meta:n})),{schema:t,warnings:i}}function mr(e,{fields:r,path:t}){if(!e)return null;let n={};return e.required?.forEach(i=>{r.includes(i)||(n[i]={path:t})}),Object.entries(e.properties||[]).forEach(([i])=>{r.includes(i)||(n[i]={path:t})}),n}function Pm(e,r){let t=JSON.parse(JSON.stringify(e)),n=is(t,r.fields),i=os(t,r.allFields),o=as(t,r.create),a=Nm(t,r.pick),s=a.schema,f=Fm(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 l=[n.warnings,i.warnings,o.warnings,a.warnings,f.warnings].flat().filter(Boolean);return{schema:s,warnings:l}}export{su as createHeadlessForm,Pm as modify};
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|