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