@remoteoss/json-schema-form 1.2.5 → 1.2.6

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