@remoteoss/json-schema-form 1.0.0-dev.20260713153543 → 1.0.0-dev.20260807093222

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