import{a as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import{w as n,x as r}from"./react-Cthodp0K.js";var i=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),o=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){var e=`day`;return function(t,n,r){var i=function(t){return t.add(4-t.isoWeekday(),e)},a=n.prototype;a.isoWeekYear=function(){return i(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var n,a,o,s,c=i(this),l=(n=this.isoWeekYear(),a=this.$u,o=(a?r.utc:r)().year(n).startOf(`year`),s=4-o.isoWeekday(),o.isoWeekday()>4&&(s+=7),o.add(s,e));return c.diff(l,`week`)+1},a.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var o=a.startOf;a.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):o.bind(this)(e,t)}}}))})),s={silent:-1/0,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:1/0},c={silent:{level:-1},fatal:{level:s.fatal},error:{level:s.error},warn:{level:s.warn},log:{level:s.log},info:{level:s.info},success:{level:s.success},fail:{level:s.fail},ready:{level:s.info},start:{level:s.info},box:{level:s.info},debug:{level:s.debug},trace:{level:s.trace},verbose:{level:s.verbose}};function l(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function u(e,t,n=`.`,r){if(!l(t))return u(e,{},n,r);let i=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:l(a)&&l(i[t])?i[t]=u(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function d(e){return(...t)=>t.reduce((t,n)=>u(t,n,``,e),{})}var f=d();function p(e){return Object.prototype.toString.call(e)===`[object Object]`}function m(e){return!(!p(e)||!e.message&&!e.args||e.stack)}var h=!1,g=[],_=class e{options;_lastLog;_mockFn;constructor(e={}){let t=e.types||c;this.options=f({...e,defaults:{...e.defaults},level:v(e.level,t),reporters:[...e.reporters||[]]},{types:c,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let e in t){let n={type:e,...this.options.defaults,...t[e]};this[e]=this._wrapLogFn(n),this[e].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=v(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw Error(`prompt is not supported!`);return this.options.prompt(e,t)}create(t){let n=new e({...this.options,...t});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+`:`+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let t=this.options.reporters.indexOf(e);if(t!==-1)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console[`__`+e]||(console[`__`+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console[`__`+e]&&(console[e]=console[`__`+e],delete console[`__`+e])}wrapStd(){this._wrapStream(this.options.stdout,`log`),this._wrapStream(this.options.stderr,`log`)}_wrapStream(e,t){e&&(e.__write||=e.write,e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){h=!0}resumeLogs(){h=!1;let e=g.splice(0);for(let t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){let t=e||this.options.mockFn;if(this._mockFn=t,typeof t==`function`)for(let e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...n)=>{if(h){g.push([this,e,n,t]);return}return this._logFn(e,n,t)}}_logFn(e,t,n){if((e.level||0)>this.level)return!1;let r={date:new Date,args:[],...e,level:v(e.level,this.options.types)};!n&&t.length===1&&m(t[0])?Object.assign(r,t[0]):r.args=[...t],r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split(` `)),r.args.push(` `+r.additional.join(` `)),delete r.additional),r.type=typeof r.type==`string`?r.type.toLowerCase():`log`,r.tag=typeof r.tag==`string`?r.tag:``;let i=(e=!1)=>{let t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){let e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=r,this._log(r))};clearTimeout(this._lastLog.timeout);let a=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,athis.options.throttleMin)){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}catch{}i(!0)}_log(e){for(let t of this.options.reporters)t.log(e,{options:this.options})}};function v(e,t={},n=3){return e===void 0?n:typeof e==`number`?e:t[e]&&t[e].level!==void 0?t[e].level:n}_.prototype.add=_.prototype.addReporter,_.prototype.remove=_.prototype.removeReporter,_.prototype.clear=_.prototype.removeReporter,_.prototype.withScope=_.prototype.withTag,_.prototype.mock=_.prototype.mockTypes,_.prototype.pause=_.prototype.pauseLogs,_.prototype.resume=_.prototype.resumeLogs;function y(e={}){return new _(e)}var b=class{options;defaultColor;levelColorMap;typeColorMap;constructor(e){this.options={...e},this.defaultColor=`#7f8c8d`,this.levelColorMap={0:`#c0392b`,1:`#f39c12`,3:`#00BCD4`},this.typeColorMap={success:`#2ecc71`}}_getLogFn(e){return e<1?console.__error||console.error:e===1?console.__warn||console.warn:console.__log||console.log}log(e){let t=this._getLogFn(e.level),n=e.type===`log`?``:e.type,r=e.tag||``,i=` background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor}; border-radius: 0.5em; color: white; font-weight: bold; padding: 2px 0.5em; `,a=`%c${[r,n].filter(Boolean).join(`:`)}`;typeof e.args[0]==`string`?t(`${a}%c ${e.args[0]}`,i,``,...e.args.slice(1)):t(a,i,...e.args)}};function x(e={}){return y({reporters:e.reporters||[new b({})],prompt(e,t={}){return t.type===`confirm`?Promise.resolve(confirm(e)):Promise.resolve(prompt(e))},...e})}var S=x(),C=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),w=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),T=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(e,(function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){e===void 0&&(e=a);var n,r=this.utcOffset(),o=this.toDate(),s=o.toLocaleString(`en-US`,{timeZone:e}),c=Math.round((o-new Date(s))/1e3/60),l=15*-Math.round(o.getTimezoneOffset()/15)-c;if(!Number(l))n=this.utcOffset(0,t);else if(n=i(s,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,r).valueOf(),c,o),u=l[0],d=l[1],f=i(u).utcOffset(d);return f.$x.$timezone=o,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),E=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),D=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(i()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_ru=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r=`января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря`.split(`_`),i=`январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь`.split(`_`),a=`янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.`.split(`_`),o=`янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.`.split(`_`),s=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function c(e,t,n){var r,i;return n===`m`?t?`минута`:`минуту`:e+` `+(r=+e,i={mm:t?`минута_минуты_минут`:`минуту_минуты_минут`,hh:`час_часа_часов`,dd:`день_дня_дней`,MM:`месяц_месяца_месяцев`,yy:`год_года_лет`}[n].split(`_`),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}var l=function(e,t){return s.test(t)?r[e.month()]:i[e.month()]};l.s=i,l.f=r;var u=function(e,t){return s.test(t)?a[e.month()]:o[e.month()]};u.s=o,u.f=a;var d={name:`ru`,weekdays:`воскресенье_понедельник_вторник_среда_четверг_пятница_суббота`.split(`_`),weekdaysShort:`вск_пнд_втр_срд_чтв_птн_сбт`.split(`_`),weekdaysMin:`вс_пн_вт_ср_чт_пт_сб`.split(`_`),months:l,monthsShort:u,weekStart:1,yearStart:4,formats:{LT:`H:mm`,LTS:`H:mm:ss`,L:`DD.MM.YYYY`,LL:`D MMMM YYYY г.`,LLL:`D MMMM YYYY г., H:mm`,LLLL:`dddd, D MMMM YYYY г., H:mm`},relativeTime:{future:`через %s`,past:`%s назад`,s:`несколько секунд`,m:c,mm:c,h:`час`,hh:c,d:`день`,dd:c,M:`месяц`,MM:c,y:`год`,yy:c},ordinal:function(e){return e},meridiem:function(e){return e<4?`ночи`:e<12?`утра`:e<17?`дня`:`вечера`}};return n.default.locale(d,null,!0),d}))})),ee=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(i()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_fa=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`fa`,weekdays:`یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه`.split(`_`),weekdaysShort:`یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه`.split(`_`),weekdaysMin:`ی_د_س_چ_پ_ج_ش`.split(`_`),weekStart:6,months:`ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر`.split(`_`),monthsShort:`ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر`.split(`_`),ordinal:function(e){return e},formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},relativeTime:{future:`در %s`,past:`%s پیش`,s:`چند ثانیه`,m:`یک دقیقه`,mm:`%d دقیقه`,h:`یک ساعت`,hh:`%d ساعت`,d:`یک روز`,dd:`%d روز`,M:`یک ماه`,MM:`%d ماه`,y:`یک سال`,yy:`%d سال`}};return n.default.locale(r,null,!0),r}))})),O=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(i()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_zh=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`zh`,weekdays:`星期日_星期一_星期二_星期三_星期四_星期五_星期六`.split(`_`),weekdaysShort:`周日_周一_周二_周三_周四_周五_周六`.split(`_`),weekdaysMin:`日_一_二_三_四_五_六`.split(`_`),months:`一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e,t){return t===`W`?e+`周`:e+`日`},weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日Ah点mm分`,LLLL:`YYYY年M月D日ddddAh点mm分`,l:`YYYY/M/D`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日dddd HH:mm`},relativeTime:{future:`%s后`,past:`%s前`,s:`几秒`,m:`1 分钟`,mm:`%d 分钟`,h:`1 小时`,hh:`%d 小时`,d:`1 天`,dd:`%d 天`,M:`1 个月`,MM:`%d 个月`,y:`1 年`,yy:`%d 年`},meridiem:function(e,t){var n=100*e+t;return n<600?`凌晨`:n<900?`早上`:n<1100?`上午`:n<1300?`中午`:n<1800?`下午`:`晚上`}};return n.default.locale(r,null,!0),r}))})),k=t(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),A=t(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),j=t(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=k(),a=A();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),M=t(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),te=t(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:er(t,e)}})),N=t(((e,t)=>{var n=A(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=k(),{safeRe:a,t:o}=j(),s=M(),{compareIdentifiers:c}=te(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;tr)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&tt.major?1:this.minort.minor?1:this.patcht.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),P=t(((e,t)=>{var n=N();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),F=t(((e,t)=>{var n=P();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),I=t(((e,t)=>{var n=P();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),L=t(((e,t)=>{var n=N();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),R=t(((e,t)=>{var n=P();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),z=t(((e,t)=>{var n=N();t.exports=(e,t)=>new n(e,t).major})),ne=t(((e,t)=>{var n=N();t.exports=(e,t)=>new n(e,t).minor})),re=t(((e,t)=>{var n=N();t.exports=(e,t)=>new n(e,t).patch})),B=t(((e,t)=>{var n=P();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),V=t(((e,t)=>{var n=N();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),ie=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(t,e,r)})),ae=t(((e,t)=>{var n=V();t.exports=(e,t)=>n(e,t,!0)})),oe=t(((e,t)=>{var n=N();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),se=t(((e,t)=>{var n=oe();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ce=t(((e,t)=>{var n=oe();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),H=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)>0})),U=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)<0})),le=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)===0})),ue=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)!==0})),W=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)>=0})),G=t(((e,t)=>{var n=V();t.exports=(e,t,r)=>n(e,t,r)<=0})),K=t(((e,t)=>{var n=le(),r=ue(),i=H(),a=W(),o=U(),s=G();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),de=t(((e,t)=>{var n=N(),r=P(),{safeRe:i,t:a}=j();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),fe=t(((e,t)=>{var n=P(),r=k(),i=N(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=o(e,n);return i&&s(i,t)},o=(e,t)=>n(e instanceof i?e.version:e,t),s=(e,t)=>{if(c(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0;break}return e.format()},c=e=>e.startsWith(`pre`);t.exports=a})),pe=t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),q=t(((e,t)=>{var n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(g,``);let t=((this.options.includePrerelease&&m)|(this.options.loose&&h))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,s=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(s,P(this.options.includePrerelease)),o(`hyphen replace`,e),e=e.replace(c[u.COMPARATORTRIM],d),o(`comparator trim`,e),e=e.replace(c[u.TILDETRIM],f),o(`tilde trim`,e),e=e.replace(c[u.CARETTRIM],p),o(`caret trim`,e);let l=e.split(` `).map(e=>b(e,this.options)).join(` `).split(/\s+/).map(e=>te(e,this.options));i&&(l=l.filter(e=>(o(`loose invalid filter`,e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),o(`range list`,l);let v=new Map,y=l.map(e=>new a(e,this.options));for(let e of y){if(_(e))return[e];v.set(e.value,e)}v.size>1&&v.has(``)&&v.delete(``);let x=[...v.values()];return r.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>y(e,n)&&t.set.some(t=>y(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new s(e,this.options)}catch{return!1}for(let t=0;te.value===`<0.0.0-0`,v=e=>e.value===``,y=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},b=(e,t)=>(e=e.replace(c[u.BUILD],``),o(`comp`,e,t),e=T(e,t),o(`caret`,e),e=C(e,t),o(`tildes`,e),e=D(e,t),o(`xrange`,e),e=O(e,t),o(`stars`,e),e),x=e=>!e||e.toLowerCase()===`x`||e===`*`,S=(e,t,n)=>x(e)&&!x(t)||x(t)&&n&&!x(n),C=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(` `),w=(e,t)=>{let n=t.loose?c[u.TILDELOOSE]:c[u.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`tilde`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(o(`replaceTilde pr`,s),c=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`):c=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,o(`tilde return`,c),c})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(` `),E=(e,t)=>{o(`caret`,e,t);let n=t.loose?c[u.CARETLOOSE]:c[u.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,s)=>{o(`caret`,e,t,n,i,a,s);let c;return x(n)?c=``:x(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:x(a)?c=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o(`replaceCaret pr`,s),c=n===`0`?i===`0`?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o(`no pr`),c=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o(`caret return`,c),c})},D=(e,t)=>(o(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>ee(e,t)).join(` `)),ee=(e,t)=>{e=e.trim();let n=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(n,r,i,a,s,c)=>{if(o(`xRange`,e,n,r,i,a,s,c),S(i,a,s))return e;let l=x(i),u=l||x(a),d=u||x(s),f=d;return r===`=`&&f&&(r=``),c=t.includePrerelease?`-0`:``,l?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(u&&(a=0),s=0,r===`>`?(r=`>=`,u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):r===`<=`&&(r=`<`,u?i=+i+1:a=+a+1),r===`<`&&(c=`-0`),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o(`xRange return`,n),n})},O=(e,t)=>(o(`replaceStars`,e,t),e.trim().replace(c[u.STAR],``)),te=(e,t)=>(o(`replaceGTE0`,e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],``)),P=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=x(r)?``:x(i)?`>=${r}.0.0${e?`-0`:``}`:x(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=x(l)?``:x(u)?`<${+l+1}.0.0-0`:x(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),F=(e,t,n)=>{for(let n=0;n0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),me=t(((e,t)=>{var n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),s(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.semver===n?this.value=``:this.value=this.operator+this.semver.version,s(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(s(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new c(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new l(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new l(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var r=M(),{safeRe:i,t:a}=j(),o=K(),s=A(),c=N(),l=q()})),he=t(((e,t)=>{var n=q();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ge=t(((e,t)=>{var n=q();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),J=t(((e,t)=>{var n=N(),r=q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),_e=t(((e,t)=>{var n=N(),r=q();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),Y=t(((e,t)=>{var n=N(),r=q(),i=H();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),ve=t(((e,t)=>{var n=q();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),X=t(((e,t)=>{var n=N(),r=me(),{ANY:i}=r,a=q(),o=he(),s=H(),c=U(),l=G(),u=W();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),ye=t(((e,t)=>{var n=X();t.exports=(e,t,r)=>n(e,t,`>`,r)})),be=t(((e,t)=>{var n=X();t.exports=(e,t,r)=>n(e,t,`<`,r)})),xe=t(((e,t)=>{var n=q();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Se=t(((e,t)=>{var n=he(),r=V();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length{var n=q(),r=me(),{ANY:i}=r,a=he(),o=V(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),Ce=t(((e,t)=>{var n=j(),r=k(),i=N(),a=te();t.exports={parse:P(),valid:F(),clean:I(),inc:L(),diff:R(),major:z(),minor:ne(),patch:re(),prerelease:B(),compare:V(),rcompare:ie(),compareLoose:ae(),compareBuild:oe(),sort:se(),rsort:ce(),gt:H(),lt:U(),eq:le(),neq:ue(),gte:W(),lte:G(),cmp:K(),coerce:de(),truncate:fe(),Comparator:me(),Range:q(),satisfies:he(),toComparators:ge(),maxSatisfying:J(),minSatisfying:_e(),minVersion:Y(),validRange:ve(),outside:X(),gtr:ye(),ltr:be(),intersects:xe(),simplifyRange:Se(),subset:Z(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}));String.fromCharCode;var we=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Te=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Ee=/^([/\\]\s*){2,}[^/\\]/;function De(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?we.test(e):Te.test(e)||(t.acceptRelative?Ee.test(e):!1)}var Oe=Symbol.for(`ufo:protocolRelative`);function ke(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!De(e,{acceptRelative:!0}))return t?ke(t+e):Ae(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=Ae(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[Oe]:!r}}function Ae(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}var Q=r(),$=e(n());function je(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);ie.split(/(\.|\[\d+\])/).filter(e=>e!==`.`&&e!==``).map(e=>{let t=/\[(\d+)\]/.exec(e);return t?Number(t[1]):e}),Pe=(e,t,n)=>{let r=Array.isArray(t)?t:Ne(t);if(r.length===0)return e;let i=r[0];if(Array.isArray(e)&&typeof i!=`number`&&e.length>0)return e.map(e=>Pe(e,r,n));if(typeof e!=`object`||!e||!(i in e))return Fe(e,i,n);let a=e[i];return r.length===1?a:Pe(a,r.slice(1),n)},Fe=(e,t,n)=>{if(n===void 0)throw Error(`Unable to extract object property\nLooking for property: ${t}\nIn object: ${JSON.stringify(e)}`);return n},Ie=(e,t,n,r,i)=>{if(!r)throw Error(i??`Invalid property path: ${t}\nCouldn't access "${n}" in ${JSON.stringify(e)}`)},Le=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Re=e=>Array.isArray(e),ze=(e,t)=>e.filter((e,n)=>n!==t),Be=(e,t,n,r={})=>{let{remove:i=!1,createNew:a=!0,noError:o=!1}=r,s=e,c=typeof(l=t)==`string`?l:typeof l==`number`?String(l):l.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:e===``?t:`${e}.${t}`,``);var l;let u=Object.assign(Object.assign({},r),{remove:i,createNew:a,noError:o,fullData:s,fullPath:c}),d=Array.isArray(t)?t:Ne(t);return Re(e)&&i&&d.length===1?ze(e,d[0]):Ve(e,d,n,u)},Ve=(e,t,n,r)=>{let i=Le(e)?Object.assign({},e):null,a=Re(e)?[...e]:null;if(t.length===0)return e;if(!i&&!a)throw Error(`Can't assign property -- invalid input object`);let{createNew:o,remove:s,noError:c,fullData:l,fullPath:u}=r,d=t[0];if(a&&typeof d==`string`)return a.map(e=>Ve(e,t,n,r));if(t.length===1)return i&&typeof d==`string`?He(i,d,n,r)??i:a&&typeof d==`number`?(Ue(a,d,n,r),a):(Ie(l,u,d,c),e);let f=i||a||[];if(s&&t.length===2&&typeof t[1]==`number`){let e=f[d],n=t[1];return Re(e)?f[d]=ze(e,n):Ie(l,u,d,c,`Trying to remove an indexed item from an object that is not an array`),f}let p=t.slice(1);if(d in e){if(m=f[d],!Re(m)&&!Le(m)){if(!o)return Ie(l,u,d,c),f;f[d]={}}return f[d]=Ve(f[d],p,n,r),f}var m;if(o){let e=typeof p[0]==`number`?[]:{};if(i)return f[d]=e,f[d]=Ve(f[d],p,n,r),f;if(a&&Array.isArray(f)){f.push(e);let t=f.length-1;return f[t]=Ve(f[t],p,n,r),f}}return Ie(l,u,d,c),f},He=(e,t,n,r)=>{let{remove:i,createNew:a,noError:o,insertAfter:s,insertBefore:c,fullData:l,fullPath:u}=r;if(c!==void 0||s!==void 0){let r=Object.entries(e),i=1/0;return i=typeof c==`number`?c:typeof s==`number`?s:r.findIndex(([e])=>e===(c??s)),s!==void 0&&i++,r.splice(i,0,[t,n]),Object.fromEntries(r)}let d=t in e;i?d?delete e[t]:Ie(l,u,t,o):a||d?e[t]=n:Ie(l,u,t,o)},Ue=(e,t,n,r)=>{let{noError:i,fullData:a,fullPath:o,createNew:s,insert:c}=r;c&&e.splice(t,0,n),t in e?e[t]=n:s?e.push(n):Ie(a,o,t,i)},We=({className:e,name:t,value:n,setValue:r,handleKeyPress:i,styles:a,textAreaRef:o})=>{if(typeof n!=`string`)return null;let s=n.slice(-1)===` `?n+`.`:n;return(0,Q.jsxs)(`div`,{style:{display:`grid`},children:[(0,Q.jsx)(`textarea`,{id:`${t}_textarea`,ref:o,style:Object.assign({height:`auto`,gridArea:`1 / 1 / 2 / 2`,overflowY:`auto`,whiteSpace:`pre-wrap`},a),rows:1,className:e,name:`${t}_textarea`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,onFocus:e=>{n.length<40&&e.target.select()},onKeyDown:i}),(0,Q.jsx)(`span`,{className:e,style:Object.assign({visibility:`hidden`,height:`auto`,gridArea:`1 / 1 / 2 / 2`,color:`red`,opacity:.9,whiteSpace:`pre-wrap`,overflowY:`auto`,border:`1px solid transparent`},a),children:s})]})},Ge=e=>typeof e==`object`&&!!e,Ke=(e,t,n,r=``)=>{if(!n&&!r)return!0;switch(e){case`collection`:if(n){if(n(t,r))return!0;if(!qe(r,t,n))return!1}if(!n&&r&&!qe(r,t))return!1;break;case`value`:if(n&&!n(t,r)||!n&&r&&!Je(t,r))return!1}return!0},qe=(e=``,t,n=Je)=>{let r=t.value;return Object.entries(r).some(([i,a])=>{let o=[...t.path,i],s=Object.assign(Object.assign({},t),{key:i,path:o,level:t.level+1,value:a,size:o.length,parentData:r});return Ge(a)?qe(e,s,n):n(s,e)})},Je=(e,t=``)=>{let{value:n}=e;if(n===null&&`null`.includes(t.toLowerCase()))return!0;switch(typeof n){case`string`:return n.toLowerCase().includes(t.toLowerCase());case`number`:return!!String(n).includes(t);case`boolean`:return n?`true`.includes(t.toLowerCase())||t===`1`:`false`.includes(t.toLowerCase())||t===`0`;default:return!1}},Ye=({key:e,path:t},n=``)=>!!Je({value:e},n)||!!t.some(e=>Je({value:e},n)),Xe=(e,t)=>(t??``)+e.map(e=>e===``?`\0`:e).join(`.`),Ze=e=>e.shiftKey?`Shift`:e.metaKey?`Meta`:e.ctrlKey?`Control`:e.altKey?`Alt`:void 0,Qe=(e,t,n)=>{let r=e.key,i=Ze(e);if(Array.isArray(t))return!!i&&t.includes(i);let{key:a,modifier:o}=t;return(n!==`stringLineBreak`||r!==`Enter`||i!==`Shift`||a!==`Enter`||!o?.includes(`Shift`))&&r===a&&(o===i||Array.isArray(o)&&o.includes(i))},$e={key:`Enter`},et={confirm:$e,cancel:{key:`Escape`},objectConfirm:Object.assign(Object.assign({},$e),{modifier:[`Meta`,`Shift`,`Control`]}),objectLineBreak:$e,stringConfirm:$e,stringLineBreak:Object.assign(Object.assign({},$e),{modifier:[`Shift`]}),numberConfirm:$e,numberUp:{key:`ArrowUp`},numberDown:{key:`ArrowDown`},tabForward:{key:`Tab`},tabBack:{key:`Tab`,modifier:`Shift`},booleanConfirm:$e,booleanToggle:{key:` `},clipboardModifier:[`Meta`,`Control`],collapseModifier:[`Alt`]},tt=(e,t,n=`next`,r)=>{let i=t.slice(0,t.length-1),a=t.slice(-1)[0];if(a===void 0)return null;let o=Pe(e,i),s=rt(o);Array.isArray(o)||r(s,({key:e,value:t})=>[e,t]);let c=s[s.findIndex(e=>e.key===a)+(n===`next`?1:-1)];return c?Ge(c.value)?Object.keys(c.value).length===0?tt(e,[...i,c.key],n,r):nt(e,[...i,c.key],n,r):[...i,c.key]:i.length===0?null:tt(e,i,n,r)},nt=(e,t,n=`next`,r)=>{let i=Pe(e,t);if(!Ge(i))return t;let a=Array.isArray(i)?i.map((e,t)=>t):Object.keys(i);r(a,e=>[e,i]);let o=n===`next`?a[0]:a[a.length-1];return nt(e,[...t,o],n,r)},rt=e=>Array.isArray(e)?e.map((e,t)=>({index:t,value:e,key:t})):Object.entries(e).map(([e,t],n)=>({key:e,value:t,index:n})),it=(e,t)=>{let n=e.current,r=n?.selectionStart??1/0,i=n?.selectionEnd??1/0,a=(n?.textContent)?.slice(0,r)+t+(n?.textContent)?.slice(i);return n.value=a,n?.setSelectionRange(r+1,r+1),a},at=e=>{if(e!==ot){if(Array.isArray(e))return e.map(e=>at(e));if(e&&typeof e==`object`)for(let t in e)e[t]=at(e[t]);return e}},ot=`__​undefined__`,st={displayName:`Default`,fragments:{edit:`rgb(42, 161, 152)`},styles:{container:{backgroundColor:`#f6f6f6`,fontFamily:`monospace`},collection:{},collectionInner:{},collectionElement:{},dropZone:{},property:`#292929`,bracket:{color:`rgb(0, 43, 54)`,fontWeight:`bold`},itemCount:{color:`rgba(0, 0, 0, 0.3)`,fontStyle:`italic`},string:`rgb(203, 75, 22)`,number:`rgb(38, 139, 210)`,boolean:`green`,null:{color:`rgb(220, 50, 47)`,fontVariant:`small-caps`,fontWeight:`bold`},input:[`#292929`],inputHighlight:`#b3d8ff`,error:{fontSize:`0.8em`,color:`red`,fontWeight:`bold`},iconCollection:`rgb(0, 43, 54)`,iconEdit:`edit`,iconDelete:`rgb(203, 75, 22)`,iconAdd:`edit`,iconCopy:`rgb(38, 139, 210)`,iconOk:`green`,iconCancel:`rgb(203, 75, 22)`}},ct=(0,$.createContext)({getStyles:()=>({}),icons:{}}),lt=({theme:e=st,icons:t={},docRoot:n,children:r})=>{let i=dt(e,n);return(0,Q.jsx)(ct.Provider,{value:{getStyles:(e,t)=>typeof i[e]==`function`?i[e](t):i[e],icons:t},children:r})},ut=()=>(0,$.useContext)(ct),dt=(e,t)=>{var n,r;let i={},a=(Array.isArray(e)?e:[e]).map(e=>pt(e)?ft({fragments:{},styles:e},i):ft(e,i)),o=ft(st,{});Object.keys(o).forEach(e=>{let t=e;a.forEach(e=>{e[t]&&(o[t]=Object.assign(Object.assign({},o[t]),e[t]))})});let s=Object.assign({},o);return Object.entries(i).forEach(([e,t])=>{let n=e;s[n]=e=>{let r=t(e)||{};return Object.assign(Object.assign({},o[n]),r)}}),typeof s?.inputHighlight!=`function`&&(n=s?.inputHighlight)!=null&&n.backgroundColor&&t.style.setProperty(`--jer-highlight-color`,s?.inputHighlight?.backgroundColor),typeof s?.iconCopy!=`function`&&(r=s?.iconCopy)!=null&&r.color&&t.style.setProperty(`--jer-icon-copy-color`,s?.iconCopy?.color),s},ft=(e,t)=>{let{fragments:n,styles:r}=e,i={};return Object.entries(r).forEach(([e,r])=>{i[e]=(Array.isArray(r)?r:[r]).reduce((r,i)=>{if(typeof i==`function`)return t[e]=i,Object.assign({},r);if(typeof i==`string`){let t=n?.[i]??i;return typeof t==`string`?Object.assign(Object.assign({},r),{[mt[e]??`color`]:t}):Object.assign(Object.assign({},r),t)}return Object.assign(Object.assign({},r),i)},{})}),i},pt=e=>!(`styles`in e),mt={container:`backgroundColor`,collection:`backgroundColor`,collectionInner:`backgroundColor`,collectionElement:`backgroundColor`,dropZone:`borderColor`,inputHighlight:`backgroundColor`},ht=(0,$.createContext)(null),gt=({children:e,onEditEvent:t,onCollapse:n})=>{let[r,i]=(0,$.useState)(null),[a,o]=(0,$.useState)(null),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)({path:null,pathString:null}),d=(0,$.useRef)(null),f=(0,$.useRef)(`next`),p=(0,$.useRef)(null);return(0,Q.jsx)(ht.Provider,{value:{collapseState:r,setCollapseState:e=>{i(e),n&&e!==null&&(Array.isArray(e)?e.forEach(e=>n(e)):n(e)),e!==null&&setTimeout(()=>i(null),2e3)},getMatchingCollapseState:e=>{if(Array.isArray(r)){for(let t of r)if(vt(e,t))return t;return null}return vt(e,r)?r:null},currentlyEditingElement:a,setCurrentlyEditingElement:(e,n)=>{let r=typeof e==`string`||e===null?e:Xe(e,n===`key`?`key_`:void 0);a!==null&&r!==null&&d.current!==null&&d.current(),o(r),t&&(Array.isArray(e)||e===null)&&t(e,n===`key`),d.current=typeof n==`function`?n:null},areChildrenBeingEdited:e=>a!==null&&a.includes(e),previouslyEditedElement:p.current,setPreviouslyEditedElement:e=>{p.current=e},tabDirection:f.current,setTabDirection:e=>{f.current=e},previousValue:s,setPreviousValue:c,dragSource:l,setDragSource:u},children:e})},_t=()=>{let e=(0,$.useContext)(ht);if(!e)throw Error(`Missing Context Provider`);return e},vt=(e,t)=>{if(t===null)return!1;if(!t.includeChildren)return t.path.every((t,n)=>e[n]===t)&&t.path.length===e.length;for(let[n,r]of t.path.entries())if(r!==e[n])return!1;return!0},yt=`**INVALID_FUNCTION**`,bt=({nodeData:e,showStringQuotes:t=!0,stringTruncate:n=200,pathString:r,canEdit:i,setIsEditing:a,styles:o,translate:s,value:c,TextWrapper:l=({children:e})=>e})=>{let u=c??e.value,[d,f]=(0,$.useState)(!1),p=t?`"`:``,m=u.length>n,h=()=>{i?a(!0):f(!d)};return(0,Q.jsxs)(`div`,{id:`${r}_display`,onDoubleClick:h,onClick:e=>{(e.getModifierState(`Control`)||e.getModifierState(`Meta`))&&h()},className:`jer-value-string`,style:o,children:[p,m?(0,Q.jsxs)(Q.Fragment,d?{children:[(0,Q.jsx)(l,{children:(0,Q.jsxs)(`span`,{children:[u,p]})}),(0,Q.jsxs)(`span`,{className:`jer-string-expansion jer-show-less`,onClick:()=>f(!1),children:[` `,s(`SHOW_LESS`,e)]})]}:{children:[(0,Q.jsxs)(l,{children:[(0,Q.jsx)(`span`,{children:u.slice(0,n-2).trimEnd()}),` `]}),(0,Q.jsx)(`span`,{className:`jer-string-expansion jer-ellipsis`,onClick:()=>f(!0),children:`...`}),p]}):(0,Q.jsx)(l,{children:`${u}${p}`})]})},xt=({styles:e,pathString:t,value:n,setValue:r,handleEdit:i,handleKeyboard:a,keyboardCommon:o})=>{let s=(0,$.useRef)(null);return(0,Q.jsx)(We,{className:`jer-input-text`,textAreaRef:s,name:t,value:n,setValue:r,handleKeyPress:e=>{a(e,Object.assign({stringConfirm:i,stringLineBreak:()=>{r(it(s,` `))}},o))},styles:e})},St=e=>{var{isEditing:t,path:n,enumType:r}=e,i=je(e,[`isEditing`,`path`,`enumType`]);let{getStyles:a}=ut(),o=Xe(n),{value:s,setValue:c,nodeData:l,handleEdit:u,handleKeyboard:d,keyboardCommon:f}=i;return t&&r?(0,Q.jsxs)(`div`,{className:`jer-select jer-select-enums`,children:[(0,Q.jsx)(`select`,{name:`${o}-value-select`,className:`jer-select-inner`,onChange:e=>c(e.target.value),value:s,autoFocus:!0,onKeyDown:e=>{d(e,Object.assign({stringConfirm:u},f))},children:r.values.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))}),(0,Q.jsx)(`span`,{className:`focus`})]}):t?(0,Q.jsx)(xt,Object.assign({styles:a(`input`,l),pathString:o},i,{setValue:i.setValue})):(0,Q.jsx)(bt,Object.assign({pathString:o,styles:a(`string`,l)},i))},Ct=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:a,nodeData:o,handleKeyboard:s,keyboardCommon:c})=>{let{getStyles:l}=ut();return n?(0,Q.jsx)(`input`,{className:`jer-input-number`,type:`text`,name:Xe(r),value:e,onChange:e=>t(e.target.value.replace(/[^0-9.-]/g,``)),autoFocus:!0,onFocus:e=>setTimeout(()=>e.target.select(),10),onKeyDown:n=>s(n,Object.assign({numberConfirm:a,numberUp:()=>t(Number(e)+1),numberDown:()=>t(Number(e)-1)},c)),style:Object.assign({width:String(e).length/1.5+2+`em`},l(`input`,o))}):(0,Q.jsx)(`span`,{onDoubleClick:()=>i(!0),className:`jer-value-number`,style:l(`number`,o),children:e})},wt=({value:e,setValue:t,isEditing:n,path:r,setIsEditing:i,handleEdit:a,nodeData:o,handleKeyboard:s,keyboardCommon:c})=>{let{getStyles:l}=ut();return typeof e==`boolean`?n?(0,Q.jsx)(`input`,{className:`jer-input-boolean`,type:`checkbox`,name:Xe(r),checked:e,onChange:()=>t(!e),onKeyDown:n=>{n.key===` `&&n.preventDefault(),s(n,Object.assign({booleanConfirm:a,booleanToggle:()=>t(!e)},c))},autoFocus:!0}):(0,Q.jsx)(`span`,{onDoubleClick:()=>i(!0),className:`jer-value-boolean`,style:l(`boolean`,o),children:String(e)}):null},Tt=(e,t)=>{let n=(0,$.useRef)(void 0),r=(0,$.useRef)(t);(0,$.useEffect)(()=>{r.current=t},[t]);let i=e=>{r.current(e)};(0,$.useEffect)(()=>{if(window.clearTimeout(n.current),e)return n.current=window.setTimeout(()=>{window.addEventListener(`keydown`,i)},100),()=>{window.clearTimeout(n.current),window.removeEventListener(`keydown`,i)}},[e])},Et=({value:e,isEditing:t,setIsEditing:n,handleEdit:r,nodeData:i,handleKeyboard:a,keyboardCommon:o})=>{let{getStyles:s}=ut();return Tt(t,e=>a(e,Object.assign({confirm:r},o))),(0,Q.jsx)(`div`,{onDoubleClick:()=>n(!0),className:`jer-value-null`,style:s(`null`,i),children:String(e)})},Dt=({value:e})=>{let t=`Error!`;switch(typeof e){case`string`:e===yt&&(t=`Function`);break;case`undefined`:t=`Undefined`;break;case`symbol`:t=`Symbol`}return(0,Q.jsx)(`span`,{className:`jer-value-invalid`,children:t})},Ot=({size:e,style:t,className:n})=>(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:[(0,Q.jsx)(`path`,{d:`M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z`}),(0,Q.jsx)(`path`,{d:`M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z`})]}),kt=({size:e,style:t,className:n})=>(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,transform:`translate(0, 0.5)`,children:[(0,Q.jsx)(`path`,{d:`M7 17.013l4.413-.015 9.632-9.54c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.756-.756-2.075-.752-2.825-.003L7 12.583v4.43zM18.045 4.458l1.589 1.583-1.597 1.582-1.586-1.585 1.594-1.58zM9 13.417l6.03-5.973 1.586 1.586-6.029 5.971L9 15.006v-1.589z`}),(0,Q.jsx)(`path`,{d:`M5 21h14c1.103 0 2-.897 2-2v-8.668l-2 2V19H8.158c-.026 0-.053.01-.079.01-.033 0-.066-.009-.1-.01H5V5h6.847l2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2z`})]}),At=({size:e,style:t,className:n})=>(0,Q.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,Q.jsx)(`path`,{d:`M6 19a2 2 0 002 2h8a2 2 0 002-2V7H6v12m2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12M15.5 4l-1-1h-5l-1 1H5v2h14V4h-3.5z`})}),jt=({size:e,style:t,className:n})=>(0,Q.jsxs)(`svg`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:e,height:e,className:n,style:t,children:[(0,Q.jsx)(`path`,{d:`M9 2 H15 A1 1 0 0 1 16 3 V5 A1 1 0 0 1 15 6 H9 A1 1 0 0 1 8 5 V3 A1 1 0 0 1 9 2 z`}),(0,Q.jsx)(`path`,{d:`M8 4H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2v-2M16 4h2a2 2 0 012 2v4M21 14H11`}),(0,Q.jsx)(`path`,{d:`M15 10l-4 4 4 4`})]}),Mt=({size:e,style:t,className:n})=>(0,Q.jsxs)(`svg`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:e,height:e,className:n,style:t,children:[(0,Q.jsx)(`path`,{d:`M22 11.08V12a10 10 0 11-5.93-9.14`}),(0,Q.jsx)(`path`,{d:`M22 4L12 14.01l-3-3`})]}),Nt=({size:e,style:t,className:n})=>(0,Q.jsx)(`svg`,{baseProfile:`tiny`,viewBox:`0 0 24 24`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,Q.jsx)(`path`,{d:`M12 4c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm-5 8c0-.832.224-1.604.584-2.295l6.711 6.711A4.943 4.943 0 0112 17c-2.757 0-5-2.243-5-5zm9.416 2.295L9.705 7.584A4.943 4.943 0 0112 7c2.757 0 5 2.243 5 5 0 .832-.224 1.604-.584 2.295z`})}),Pt=({size:e,style:t,className:n})=>(0,Q.jsx)(`svg`,{viewBox:`0 0 512 512`,fill:`currentColor`,width:e,height:e,className:n,style:t,children:(0,Q.jsx)(`path`,{d:`M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z`})}),Ft=({name:e,nodeData:t})=>{let{getStyles:n,icons:r}=ut(),i={size:`1.4em`,className:`jer-icon`};switch(e){case`add`:return r?.add??(0,Q.jsx)(Ot,Object.assign({},i,{style:n(`iconAdd`,t)}));case`edit`:return r?.edit??(0,Q.jsx)(kt,Object.assign({},i,{style:n(`iconEdit`,t)}));case`delete`:return r?.delete??(0,Q.jsx)(At,Object.assign({},i,{style:n(`iconDelete`,t),size:`1.45em`}));case`copy`:return r?.copy??(0,Q.jsx)(jt,Object.assign({},i,{style:n(`iconCopy`,t),size:`1.2em`}));case`ok`:return r?.ok??(0,Q.jsx)(Mt,Object.assign({},i,{style:Object.assign({fontSize:`90%`},n(`iconOk`,t))}));case`cancel`:return r?.cancel??(0,Q.jsx)(Nt,Object.assign({},i,{style:Object.assign({fontSize:`130%`},n(`iconCancel`,t))}));case`chevron`:return r?.chevron??(0,Q.jsx)(Pt,{size:`1em`,style:n(`iconCollection`,t)});default:return(0,Q.jsx)(Q.Fragment,{})}},It=({startEdit:e,handleDelete:t,handleAdd:n,enableClipboard:r,type:i,customButtons:a,nodeData:o,translate:s,keyboardControls:c,handleKeyboard:l,editConfirmRef:u,getNewKeyOptions:d,jsonStringify:f,onEditEvent:p,showIconTooltips:m})=>{let{getStyles:h}=ut(),g=s(`KEY_NEW`,o),[_,v]=(0,$.useState)(g),[y,b]=(0,$.useState)(!1),{key:x,path:S,value:C}=o,w=Array.isArray(y),T=e=>{if(p&&p(e?[...S,null]:null,e),!e)return void b(!1);let t=Object.keys(Pe(o.fullData,S)),n=d?d(o)?.filter(e=>!t.includes(e)):null;n&&v(``),b(n==null||n)};return(0,Q.jsxs)(`div`,{className:`jer-edit-buttons`,style:{opacity:y?1:void 0},onClick:e=>e.stopPropagation(),children:[r&&(0,Q.jsx)(`div`,{onClick:e=>{var t;e.stopPropagation();let n,i,a=`value`,o=``,s=null;if(r){let l=Ze(e);if(l&&c.clipboardModifier.includes(l)?(n=Rt(S),o=n,a=`path`):(n=C,o=typeof n==`object`?f(C):String(n)),!navigator.clipboard)return void(typeof r==`function`&&r({success:!1,value:n,stringValue:o,path:S,key:x,type:a,errorMessage:`Can't access clipboard API`}));(t=navigator.clipboard)==null||t.writeText(o).then(()=>i=!0).catch(e=>{i=!1,s=e.message}).finally(()=>{typeof r==`function`&&r({success:i,errorMessage:s,value:n,stringValue:o,path:S,key:x,type:a})})}},className:`jer-copy-pulse`,title:m?s(`TOOLTIP_COPY`,o):``,children:(0,Q.jsx)(Ft,{name:`copy`,nodeData:o})}),e&&(0,Q.jsx)(`div`,{onClick:e,title:m?s(`TOOLTIP_EDIT`,o):``,children:(0,Q.jsx)(Ft,{name:`edit`,nodeData:o})}),t&&(0,Q.jsx)(`div`,{onClick:t,title:m?s(`TOOLTIP_DELETE`,o):``,children:(0,Q.jsx)(Ft,{name:`delete`,nodeData:o})}),n&&(0,Q.jsx)(`div`,{onClick:()=>{i===`object`?T(!0):n(``)},title:m?s(`TOOLTIP_ADD`,o):``,children:(0,Q.jsx)(Ft,{name:`add`,nodeData:o})}),a?.map(({Element:e,onClick:t},n)=>(0,Q.jsx)(`div`,{onClick:e=>t&&t(o,e),children:(0,Q.jsx)(e,{nodeData:o})},n)),y&&n&&i===`object`&&(0,Q.jsxs)(Q.Fragment,{children:[w?(0,Q.jsxs)(`div`,{className:`jer-select jer-select-keys`,children:[(0,Q.jsxs)(`select`,{name:`new-key-select`,className:`jer-select-inner`,onChange:e=>{n(e.target.value),T(!1)},defaultValue:``,autoFocus:!0,onKeyDown:e=>{l(e,{cancel:()=>T(!1)})},children:[(0,Q.jsx)(`option`,{value:``,disabled:!0,children:y.length>0?s(`KEY_SELECT`,o):s(`NO_KEY_OPTIONS`,o)}),y.map(e=>(0,Q.jsx)(`option`,{value:e,children:e},e))]}),(0,Q.jsx)(`span`,{className:`focus`})]}):(0,Q.jsx)(`input`,{className:`jer-input-new-key`,type:`text`,name:`new-object-key`,value:_,onChange:e=>v(e.target.value),autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>{l(e,{stringConfirm:()=>{n&&(T(!1),n(_),v(g))},cancel:()=>{T(!1),v(g)}})},style:h(`input`,o)}),(0,Q.jsx)(Lt,{onOk:()=>{w&&!_||(T(!1),n(_))},onCancel:()=>{T(!1)},nodeData:o,editConfirmRef:u,hideOk:w})]})]})},Lt=({onOk:e,onCancel:t,nodeData:n,editConfirmRef:r,hideOk:i=!1})=>(0,Q.jsxs)(`div`,{className:`jer-confirm-buttons`,children:[!i&&(0,Q.jsx)(`div`,{onClick:e,ref:r,children:(0,Q.jsx)(Ft,{name:`ok`,nodeData:n})}),(0,Q.jsx)(`div`,{onClick:t,children:(0,Q.jsx)(Ft,{name:`cancel`,nodeData:n})})]}),Rt=e=>e.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:e===``?t:`${e}.${t}`,``),zt=[`string`,`number`,`boolean`,`null`,`object`,`array`],Bt=({props:e,collapsed:t})=>{let{data:n,nodeData:r,parentData:i,onEdit:a,onError:o,showErrorMessages:s,restrictEditFilter:c,restrictDeleteFilter:l,restrictAddFilter:u,restrictDragFilter:d,translate:f,errorMessageTimeout:p}=e,{currentlyEditingElement:m,setCurrentlyEditingElement:h}=_t(),[g,_]=(0,$.useState)(null),v=Object.assign(Object.assign({},r),{collapsed:t}),{path:y,key:b,size:x}=v,S=Xe(y),C=!c(v),w=!l(v),T=!u(v),E=!d(v)&&w&&m===null,D=e=>{s&&(_(e),setTimeout(()=>_(null),p)),console.warn(`Error`,e)},ee=(0,$.useCallback)((e,t)=>{D(e.message),o&&o({currentData:v.fullData,errorValue:t,currentValue:n,name:b,path:y,error:e})},[o,s]),O=m===S,k=m===`key_${S}`,A=typeof y.slice(-1)[0]==`number`;return{pathString:S,nodeData:v,path:y,name:b,size:x,canEdit:C,canDelete:w,canAdd:T,canDrag:E,error:g,showError:D,onError:ee,setError:_,handleEditKey:e=>{if(h(null),b===e||!i)return;let t=y.slice(0,-1);if(Object.keys(i).includes(e))return void ee({code:`KEY_EXISTS`,message:f(`ERROR_KEY_EXISTS`,v)},e);a(Object.fromEntries(Object.entries(i).map(([t,n])=>t===b?[e,n]:[t,n])),t).then(t=>{t&&ee({code:`UPDATE_ERROR`,message:t},e)})},derivedValues:{isEditing:O,isEditingKey:k,isArray:A,canEditKey:i!==null&&C&&T&&w&&!A},emptyStringKey:b===``&&y.length>0?f(`EMPTY_STRING`,v):null}},Vt=({canDrag:e,canDragOnto:t,path:n,nodeData:r,onMove:i,onError:a,translate:o})=>{let{getStyles:s}=ut(),{dragSource:c,setDragSource:l}=_t(),[u,d]=(0,$.useState)(!1),f=Xe(n),p=(0,$.useMemo)(()=>e?{onDragStart:e=>{e.stopPropagation(),l({path:n,pathString:f})},onDragEnd:e=>{e.stopPropagation(),l({path:null,pathString:null})}}:{},[e,f]),m=(0,$.useMemo)(()=>e=>t?{onDragOver:e=>{e.stopPropagation(),e.preventDefault()},onDrop:t=>{t.stopPropagation(),g(e),l({path:null,pathString:null}),d(!1)},onDragEnter:t=>{t.stopPropagation(),f.startsWith(c.pathString??``)||d(e)},onDragExit:e=>{e.stopPropagation(),d(!1)}}:{},[c,t,f]),h=(0,$.useMemo)(()=>t&&c.pathString!==null?(0,Q.jsx)(`div`,Object.assign({className:`jer-drop-target-bottom`,style:{height:`50%`,position:`absolute`,width:`100%`,top:`50%`,zIndex:n.length}},m(`below`))):null,[c,t,n.length]),g=e=>{let t=c.path?.slice(-1)[0],s=c.path?.slice(0,-1).join(`.`),l=n.slice(0,-1).join(``),{parentData:u}=r;typeof t==`string`&&u&&!Array.isArray(u)&&Object.keys(u).includes(t)&&t in u&&s!==l?a({code:`KEY_EXISTS`,message:o(`ERROR_KEY_EXISTS`,r)},t):i(c.path,n,e).then(e=>{e&&a({code:`UPDATE_ERROR`,message:e},r.value)})};return{dragSourceProps:p,getDropTargetProps:m,BottomDropTarget:h,DropTargetPadding:({position:e,nodeData:t})=>u===e?(0,Q.jsx)(`div`,{className:`jer-drag-n-drop-padding`,style:s(`dropZone`,t)}):null,handleDrop:g}},Ht=(e,t,n,r)=>{if(!t.current)return 0;let i=parseInt(getComputedStyle(n.current).getPropertyValue(`line-height`)??`16px`),a=(t.current?.offsetWidth??0)/(.5*i),o=r(e).replace(/\\n/g,` `).split(` `).map(e=>Math.ceil(e.length/a)).reduce((e,t)=>e+t,0)*i;return Math.min(o+30,window.innerHeight-50)},Ut=({isEditingKey:e,canEditKey:t,pathString:n,path:r,name:i,arrayIndexFromOne:a,handleKeyboard:o,handleEditKey:s,handleCancel:c,handleClick:l,keyValueArray:u,styles:d,getNextOrPrevious:f,emptyStringKey:p,nodeData:m,customNodeData:h,getStyles:g})=>{let{setCurrentlyEditingElement:_}=_t(),v=typeof i==`number`?String(i+ +!!a):i;if(!e){let e=Object.assign(Object.assign({},d),{minWidth:`${Math.min(v.length+1,5)}ch`,flexShrink:+(v.length>10)});if(h?.CustomKey&&m&&g){let{CustomKey:n,customNodeProps:i}=h;return(0,Q.jsx)(n,{nodeData:m,name:p??v,path:r,canEditKey:t,handleEditKey:e=>{t&&s(e)},setIsEditingKey:()=>{t&&_(r,`key`)},handleClick:l,styles:e,customNodeProps:i,getStyles:g})}return(0,Q.jsxs)(`span`,{className:`jer-key-text`,style:e,onDoubleClick:()=>t&&_(r,`key`),onClick:l,children:[p?(0,Q.jsx)(`span`,{className:`jer-empty-string`,children:p}):v,v!==``||p?(0,Q.jsx)(`span`,{className:`jer-key-colon`,children:`:`}):null]})}return(0,Q.jsx)(`input`,{className:`jer-input-text jer-key-edit`,type:`text`,name:n,defaultValue:v,autoFocus:!0,onFocus:e=>e.target.select(),onKeyDown:e=>o(e,{stringConfirm:()=>s(e.target.value),cancel:c,tabForward:()=>{if(s(e.target.value),u){let e=u?.[0][0];_(e?[...r,e]:f(`next`))}else _(r)},tabBack:()=>{s(e.target.value),_(f(`prev`))}}),style:{width:v.length/1.5+.5+`em`}})},Wt=e=>{let{data:t,parentData:n,onEdit:r,onDelete:i,onChange:a,onMove:o,enableClipboard:s,canDragOnto:c,restrictTypeSelection:l,searchFilter:u,searchText:d,showLabel:f,stringTruncate:p,showStringQuotes:m,arrayIndexFromOne:h,indent:g,translate:_,customNodeDefinitions:v,customNodeData:y,handleKeyboard:b,keyboardControls:x,sort:S,editConfirmRef:C,jsonStringify:w,showIconTooltips:T}=e,{getStyles:E}=ut(),{setCurrentlyEditingElement:D,setCollapseState:ee,previouslyEditedElement:O,setPreviouslyEditedElement:k,tabDirection:A,setTabDirection:j,previousValue:M,setPreviousValue:te}=_t(),[N,P]=(0,$.useState)(typeof t==`function`?yt:t),{pathString:F,nodeData:I,path:L,name:R,canEdit:z,canDelete:ne,canDrag:re,error:B,onError:V,handleEditKey:ie,emptyStringKey:ae,derivedValues:oe}=Bt({props:e}),{dragSourceProps:se,getDropTargetProps:ce,BottomDropTarget:H,DropTargetPadding:U}=Vt({canDrag:re,canDragOnto:c,path:L,nodeData:I,onMove:o,onError:V,translate:_}),[le,ue]=(0,$.useState)(Gt(t,y)),W=(0,$.useCallback)(e=>{if(!a)return void P(e);P(a({currentData:I.fullData,newValue:e,currentValue:N,name:R,path:L}))},[a]);(0,$.useEffect)(()=>{P(typeof t==`function`?yt:t),ue(Gt(t,y))},[t,B]);let{CustomNode:G,customNodeProps:K,hideKey:de,showEditTools:fe=!0,showOnEdit:pe,showOnView:q,passOriginalNode:me}=y,he=[...zt,...v.filter(({showInTypesSelector:e=!1,name:t})=>e&&!!t).map(({name:e})=>e)],ge=(0,$.useMemo)(()=>{if(typeof l==`boolean`)return l?[]:he;if(Array.isArray(l))return l;let e=l(I);return typeof e==`boolean`?e?[]:he:e},[I,l]),[J,_e]=(0,$.useState)(((e,t)=>{if(typeof e!=`string`)return null;let n=t.filter(t=>t instanceof Object&&t.enum&&t.values.includes(e)&&t.matchPriority);return n.sort((e,t)=>(t.matchPriority??0)-(e.matchPriority??0)),n[0]??null})(N,ge)),{isEditing:Y}=oe,ve=Ke(`value`,I,u,d);if(Y&&(!ve||!z)&&D(tt(I.fullData,L,A,S)||O),!ve)return null;let X=e=>{let t;if(D(null),te(null),e===void 0||(e=>e&&typeof e==`object`&&`type`in e&&`target`in e&&`preventDefault`in e&&typeof e.preventDefault==`function`)(e))switch(le){case`object`:t={[_(`DEFAULT_NEW_KEY`,I)]:N};break;case`array`:t=N??[];break;case`number`:{let e=Number(N);t=isNaN(e)?0:e;break}default:t=N}else t=e;r(t,L).then(e=>{e&&V({code:`UPDATE_ERROR`,message:e},t)})},ye=()=>{D(null),M===null?(P(t),te(null)):r(M,L)},{isEditingKey:be,canEditKey:xe}=oe,Se=!Y&&B,Z=Y&&ge.length>1,Ce=(le!==`invalid`||G)&&!B&&fe,we=f&&!de,Te=G&&(Y&&pe||!Y&&q),Ee={value:N,parentData:n,setValue:W,isEditing:Y,canEdit:z,setIsEditing:z?()=>D(L):()=>{},handleEdit:X,handleCancel:ye,path:L,stringTruncate:p,showStringQuotes:m,nodeData:I,enumType:J,translate:_,handleKeyboard:b,keyboardCommon:{cancel:ye,tabForward:()=>{j(`next`),k(F);let e=tt(I.fullData,L,`next`,S);e&&(X(),D(e))},tabBack:()=>{j(`prev`),k(F);let e=tt(I.fullData,L,`prev`,S);e&&(X(),D(e))}}},De={canEditKey:xe,isEditingKey:be,pathString:F,path:L,name:R,arrayIndexFromOne:h,handleKeyboard:b,handleEditKey:ie,handleCancel:ye,styles:E(`property`,I),getNextOrPrevious:e=>tt(I.fullData,L,e,S),emptyStringKey:ae,nodeData:I,customNodeData:y,getStyles:E},Oe=Te?(0,Q.jsx)(G,Object.assign({},e,{value:N,customNodeProps:K,setValue:W,handleEdit:X,handleCancel:ye,handleKeyPress:e=>b(e,{stringConfirm:X,cancel:ye}),isEditing:Y,setIsEditing:()=>D(L),getStyles:E,originalNode:me?Kt(t,Ee):void 0,originalNodeKey:me?(0,Q.jsx)(Ut,Object.assign({},De,{customNodeData:void 0})):void 0,canEdit:z,keyboardCommon:Ee.keyboardCommon,onError:V})):Kt(t,Ee);return(0,Q.jsxs)(`div`,Object.assign({className:`jer-component jer-value-component`,style:{marginLeft:n===null?0:g/2+`em`,position:`relative`},draggable:re},se,ce(`above`),{children:[H,(0,Q.jsx)(U,{position:`above`,nodeData:I}),(0,Q.jsxs)(`div`,{className:`jer-value-main-row`,style:{flexWrap:R.length>10?`wrap`:`nowrap`},children:[we&&(0,Q.jsx)(Ut,Object.assign({},De)),(0,Q.jsxs)(`div`,{className:`jer-value-and-buttons`,children:[(0,Q.jsx)(`div`,{className:`jer-input-component`,children:Oe}),Y?(0,Q.jsx)(Lt,{onOk:X,onCancel:ye,nodeData:I,editConfirmRef:C}):Ce&&(0,Q.jsx)(It,{startEdit:z?()=>{te(M),D(L,ye)}:void 0,handleDelete:ne?()=>{i(N,L).then(e=>{e&&V({code:`DELETE_ERROR`,message:e},N)})}:void 0,enableClipboard:s,translate:_,customButtons:e.customButtons,nodeData:I,handleKeyboard:b,keyboardControls:x,editConfirmRef:C,jsonStringify:w,showIconTooltips:T}),Z&&(0,Q.jsxs)(`div`,{className:`jer-select jer-select-types`,children:[(0,Q.jsx)(`select`,{name:`${R}-type-select`,className:`jer-select-inner`,onChange:e=>(e=>{let t=v.find(t=>t.name===e);if(t)return r(t.defaultValue,L),ue(e),_e(null),D(null),void ee({path:L,collapsed:!1,includeChildren:!1});let n=ge.find(t=>t instanceof Object&&t.enum===e);if(n)return typeof N==`string`&&n.values.includes(N)||r(n.values[0],L).then(e=>{e&&(V({code:`UPDATE_ERROR`,message:e},i),D(null))}),void _e(n);let i=qt(N,e,_(`DEFAULT_NEW_KEY`,I),y?.CustomNode?_(`DEFAULT_STRING`,I):void 0);[`string`,`number`,`boolean`].includes(e)||D(null),r(i,L).then(e=>{e?(V({code:`UPDATE_ERROR`,message:e},i),D(null)):_e(null)})})(e.target.value),value:J?J.enum:le,children:ge.map(e=>e instanceof Object&&`enum`in e?(0,Q.jsx)(`option`,{value:e.enum,children:e.enum},e.enum):(0,Q.jsx)(`option`,{value:e,children:e},e))}),(0,Q.jsx)(`span`,{className:`focus`})]}),Se&&(0,Q.jsx)(`span`,{className:`jer-error-slug`,style:E(`error`,I),children:B})]})]}),(0,Q.jsx)(U,{position:`below`,nodeData:I})]}))},Gt=(e,t)=>t?.CustomNode&&t?.name&&t.showInTypesSelector?t.name:typeof e==`string`?`string`:typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:e===null?`null`:`invalid`,Kt=(e,t)=>{let n=Gt(e),{value:r}=t;switch(n){case`string`:return(0,Q.jsx)(St,Object.assign({},t,{value:r}));case`number`:return(0,Q.jsx)(Ct,Object.assign({},t,{value:r}));case`boolean`:return(0,Q.jsx)(wt,Object.assign({},t,{value:r}));case`null`:return(0,Q.jsx)(Et,Object.assign({},t));default:return(0,Q.jsx)(Dt,Object.assign({},t))}},qt=(e,t,n,r)=>{switch(t){case`string`:return r??String(e);case`number`:{let t=Number(e);return isNaN(t)?0:t}case`boolean`:return!!e;case`null`:return null;case`object`:return{[n]:e};case`array`:return[e];default:return String(e)}},Jt=(e=[],t)=>{let n=e.filter(({condition:e})=>e(t));if(n.length===0)return{};let r=n[0],{element:i,wrapperElement:a,customKey:o,customNodeProps:s,wrapperProps:c,hideKey:l=!1,showEditTools:u=!0,showOnEdit:d=!1,showOnView:f=!0,showCollectionWrapper:p=!0}=r,m=je(r,[`element`,`wrapperElement`,`customKey`,`customNodeProps`,`wrapperProps`,`hideKey`,`showEditTools`,`showOnEdit`,`showOnView`,`showCollectionWrapper`]);return Object.assign({CustomNode:i,CustomWrapper:a,CustomKey:o,customNodeProps:s,wrapperProps:c,hideKey:l,showEditTools:u,showOnEdit:d,showOnView:f,showCollectionWrapper:p},m)},Yt=e=>{let{getStyles:t}=ut(),{collapseState:n,setCollapseState:r,getMatchingCollapseState:i,currentlyEditingElement:a,setCurrentlyEditingElement:o,areChildrenBeingEdited:s,previousValue:c,setPreviousValue:l}=_t(),{mainContainerRef:u,data:d,nodeData:f,parentData:p,showCollectionCount:m,onEdit:h,onAdd:g,onDelete:_,canDragOnto:v,collapseFilter:y,collapseAnimationTime:b,onMove:x,enableClipboard:S,onEditEvent:C,showIconTooltips:w,searchFilter:T,searchText:E,indent:D,sort:ee,showArrayIndices:O,arrayIndexFromOne:k,defaultValue:A,newKeyOptions:j,translate:M,customNodeDefinitions:te,customNodeData:N,jsonParse:P,jsonStringify:F,TextEditor:I,keyboardControls:L,handleKeyboard:R,insertAtTop:z,onCollapse:ne,editConfirmRef:re,collapseClickZones:B}=e,[V,ie]=(0,$.useState)(F(d)),ae=y(f),{contentRef:oe,isAnimating:se,maxHeight:ce,collapsed:H,animateCollapse:U,cssTransitionValue:le}=((e,t,n,r,i)=>{let[a,o]=(0,$.useState)(n?0:void 0),[s,c]=(0,$.useState)(n),l=(0,$.useRef)(!1),u=(0,$.useRef)(null),d=(0,$.useRef)(0),f=(0,$.useRef)(0),p=t/1e3+`s`,m=(0,$.useCallback)(n=>{if(s!==n){switch(window.clearTimeout(f.current),l.current=!0,n){case!0:{let e=u.current?.offsetHeight??0;d.current=e,o(e),setTimeout(()=>{o(0)},5);break}case!1:o(d.current||Ht(e,u,r,i))}c(!s),f.current=window.setTimeout(()=>{l.current=!1,n||o(void 0)},t)}},[t,s,e,r,i]);return{contentRef:u,isAnimating:l.current,animateCollapse:m,maxHeight:a,collapsed:s,cssTransitionValue:p}})(d,b,ae,u,F),{pathString:ue,nodeData:W,path:G,name:K,size:de,canEdit:fe,canDelete:pe,canAdd:q,canDrag:me,error:he,setError:ge,onError:J,handleEditKey:_e,emptyStringKey:Y,derivedValues:ve}=Bt({props:e,collapsed:H}),{dragSourceProps:X,getDropTargetProps:ye,BottomDropTarget:be,DropTargetPadding:xe}=Vt({canDrag:me,canDragOnto:v,path:G,nodeData:W,onMove:x,onError:J,translate:M}),Se=(0,$.useRef)(!ae),{isEditing:Z,isEditingKey:Ce,isArray:we,canEditKey:Te}=ve;(0,$.useEffect)(()=>{ie(F(d))},[d]),(0,$.useEffect)(()=>{let e=y(W)&&!Z;Se.current=!e,U(e)},[y]),(0,$.useEffect)(()=>{if(n!==null){let e=i(G);e&&(Se.current=!0,U(e.collapsed))}},[n]);let Ee=(0,$.useRef)(null),De=(0,$.useCallback)((e,t)=>{if(typeof A!=`function`)return A;let n=A(e,t);return n===void 0?null:n},[A]),Oe=(0,$.useCallback)(e=>j?typeof j==`function`?j(e):j:null,[j]),{CustomNode:ke,customNodeProps:Ae,CustomWrapper:je,wrapperProps:Ne={},hideKey:Pe,showEditTools:Fe=!0,showOnEdit:Ie,showOnView:Le,showCollectionWrapper:Re=!0}=N,ze=s(ue);if(ze&&H&&U(!1),!(Ke(`collection`,W,T,E)||W.level===0)&&!ze)return null;let Be=Array.isArray(d)?`array`:`object`,Ve=Be===`array`?{open:`[`,close:`]`}:{open:`{`,close:`}`},He=e=>{if(e.key===`Tab`&&!e.getModifierState(`Shift`)){e.preventDefault(),ie(it(Ee,` `));return}R(e,{objectConfirm:qe,cancel:Ye})},Ue=e=>{e.stopPropagation();let t=Ze(e);if(t&&L.collapseModifier.includes(t))return Se.current=!0,void r({collapsed:!H,path:G,includeChildren:!0});a&&a.includes(ue)||(Se.current=!0,r(null),ne&&ne({path:G,collapsed:!H,includeChildren:!1}),U(!H))},qe=()=>{try{let e=P(V);if(o(null),l(null),ge(null),F(e)===F(d))return;h(e,G).then(t=>{t&&J({code:`UPDATE_ERROR`,message:t},e)})}catch{J({code:`INVALID_JSON`,message:M(`ERROR_INVALID_JSON`,W)},V)}},Je=G.length>0?()=>{_(d,G).then(e=>{e&&J({code:`DELETE_ERROR`,message:e},d)})}:void 0,Ye=()=>{o(null),c===null?(ge(null),ie(F(d)),l(null)):h(c,G)},Xe=m===`when-closed`?H:m,Qe=!Z&&Fe,$e=(O||!we)&&!Pe&&K!==void 0,et=ke&&(Z&&Ie||!Z&&Le),nt=Object.entries(d).map(([e,t])=>[Be===`array`?Number(e):e,t]);Be===`object`&&ee(nt,e=>e);let rt=Se.current?Z?(0,Q.jsxs)(`div`,{className:`jer-collection-text-edit`,children:[I?(0,Q.jsx)(I,{value:V,onChange:ie,onKeyDown:e=>R(e,{objectConfirm:qe,cancel:Ye})}):(0,Q.jsx)(We,{textAreaRef:Ee,className:`jer-collection-text-area`,name:ue,value:V,setValue:ie,handleKeyPress:He,styles:t(`input`,W)}),(0,Q.jsx)(`div`,{className:`jer-collection-input-button-row`,children:(0,Q.jsx)(Lt,{onOk:qe,onCancel:Ye,nodeData:W,editConfirmRef:re})})]}):nt.map(([n,r],i)=>{let a={key:n,value:r,path:[...G,n],level:G.length+1,index:i,size:Ge(r)?Object.keys(r).length:null,parentData:d,fullData:W.fullData},o=Jt(te,a);return(0,Q.jsx)(`div`,{className:`jer-collection-element`,style:t(`collectionElement`,a),children:Ge(r)&&!o?.renderCollectionAsValue?(0,Q.jsx)(Yt,Object.assign({},e,{data:r,parentData:d,nodeData:a,showCollectionCount:m,canDragOnto:fe,customNodeData:o}),n):(0,Q.jsx)(Wt,Object.assign({},e,{data:r,parentData:d,nodeData:a,canDragOnto:fe,showLabel:Be===`object`||O,customNodeData:o}),n)},n)}):null,at=!!Re&&H&&!ze;at||(Se.current=!0);let ot=Object.assign(Object.assign({},e),{data:d,value:d,parentData:p,nodeData:W,setValue:e=>Me(void 0,void 0,void 0,function*(){return yield h(e,G)}),handleEdit:qe,handleCancel:Ye,handleKeyPress:He,isEditing:Z,setIsEditing:()=>o(G),getStyles:t,canDragOnto:fe,canEdit:fe,keyboardCommon:{},onError:J}),st=et?(0,Q.jsx)(ke,Object.assign({customNodeProps:Ae},ot,{children:rt})):rt,ct=Qe&&(0,Q.jsx)(It,{startEdit:fe?()=>{Se.current=!0,l(null),o(G)}:void 0,handleAdd:q?e=>{U(!1);let t=De(W,e);if(Be===`array`){let e=z.array?0:d.length,n=z.array?{insert:!0}:{};g(t,[...G,e],n).then(e=>{e&&J({code:`ADD_ERROR`,message:e},t)})}else if(e in d)J({code:`KEY_EXISTS`,message:M(`ERROR_KEY_EXISTS`,W)},e);else{let n=z.object?{insertBefore:0}:{};g(t,[...G,e],n).then(e=>{e&&J({code:`ADD_ERROR`,message:e},t)})}}:void 0,handleDelete:pe?Je:void 0,enableClipboard:S,type:Be,nodeData:W,translate:M,customButtons:e.customButtons,keyboardControls:L,handleKeyboard:R,getNewKeyOptions:Oe,editConfirmRef:re,jsonStringify:F,onEditEvent:C,showIconTooltips:w}),lt={canEditKey:Te,isEditingKey:Ce,pathString:ue,path:G,name:K,arrayIndexFromOne:k,handleKeyboard:R,handleEditKey:_e,handleCancel:Ye,keyValueArray:nt,styles:t(`property`,W),getNextOrPrevious:e=>tt(W.fullData,G,e,ee),handleClick:B.includes(`property`)?Ue:e=>e.stopPropagation(),emptyStringKey:Y,nodeData:W,customNodeData:N,getStyles:t},dt=(0,Q.jsxs)(`div`,Object.assign({className:`jer-component jer-collection-component`,style:Object.assign(Object.assign({marginLeft:(G.length===0?0:D/2)+`em`},t(`collection`,W)),{position:`relative`}),draggable:me},X,ye(`above`),{children:[(0,Q.jsx)(`div`,{className:`jer-clickzone`,style:{width:D/2+1+`em`,zIndex:10+2*W.level},onClick:B.includes(`left`)?Ue:void 0}),!Z&&be,(0,Q.jsx)(xe,{position:`above`,nodeData:W}),Re?(0,Q.jsxs)(`div`,{className:`jer-collection-header-row`,style:{position:`relative`},onClick:B.includes(`header`)?Ue:void 0,children:[(0,Q.jsxs)(`div`,{className:`jer-collection-name`,children:[(0,Q.jsx)(`div`,{className:`jer-collapse-icon jer-accordion-icon`+(H?` jer-rotate-90`:``),style:{zIndex:11+2*W.level,transition:le},onClick:Ue,children:(0,Q.jsx)(Ft,{name:`chevron`,rotate:H,nodeData:W})}),$e&&(0,Q.jsx)(Ut,Object.assign({},lt)),!Z&&(0,Q.jsx)(`span`,{className:`jer-brackets jer-bracket-open`,style:t(`bracket`,W),children:Ve.open})]}),!Z&&Xe&&(0,Q.jsx)(`div`,{className:`jer-collection-item-count`+(Xe?` jer-visible`:` jer-hidden`),style:Object.assign(Object.assign({},t(`itemCount`,W)),{transition:le}),children:de===1?M(`ITEM_SINGLE`,Object.assign(Object.assign({},W),{size:1}),1):M(`ITEMS_MULTIPLE`,W,de)}),(0,Q.jsx)(`div`,{className:`jer-brackets`+(at?` jer-visible`:` jer-hidden`),style:Object.assign(Object.assign({},t(`bracket`,W)),{transition:le}),children:Ve.close}),ct]}):Pe?(0,Q.jsx)(Q.Fragment,{}):(0,Q.jsxs)(`div`,{className:`jer-collection-header-row`,style:{position:`relative`},children:[(0,Q.jsx)(Ut,Object.assign({},lt)),ct]}),(0,Q.jsxs)(`div`,{className:`jer-collection-inner`,style:Object.assign(Object.assign({overflowY:at||se?`clip`:`visible`,maxHeight:ze?void 0:ce},t(`collectionInner`,W)),{transition:le}),ref:oe,children:[st,(0,Q.jsx)(`div`,{className:Z?`jer-collection-error-row`:`jer-collection-error-row-edit`,children:he&&(0,Q.jsx)(`span`,{className:`jer-error-slug`,style:t(`error`,W),children:he})}),!Z&&Re&&(0,Q.jsx)(`div`,{className:`jer-brackets jer-bracket-outside`,style:t(`bracket`,W),children:Ve.close})]}),(0,Q.jsx)(xe,{position:`below`,nodeData:W})]}));return je?(0,Q.jsx)(je,Object.assign({customNodeProps:Ne},ot,{children:dt})):dt},Xt={ITEM_SINGLE:`{{count}} item`,ITEMS_MULTIPLE:`{{count}} items`,KEY_NEW:`Enter new key`,KEY_SELECT:`Select key`,NO_KEY_OPTIONS:`No key options`,ERROR_KEY_EXISTS:`Key already exists`,ERROR_INVALID_JSON:`Invalid JSON`,ERROR_UPDATE:`Update unsuccessful`,ERROR_DELETE:`Delete unsuccessful`,ERROR_ADD:`Adding node unsuccessful`,DEFAULT_STRING:`New data!`,DEFAULT_NEW_KEY:`key`,SHOW_LESS:`(Show less)`,EMPTY_STRING:``,TOOLTIP_COPY:`Copy to clipboard`,TOOLTIP_EDIT:`Edit`,TOOLTIP_DELETE:`Delete`,TOOLTIP_ADD:`Add`},Zt=(e,t)=>(n,r,i)=>((e,t,n,r,i)=>{if(t[r]){let e=t[r](n);if(e!==null)return e}let a=r in e?e[r]:Xt[r];return i===void 0?a:a?.replace(`{{count}}`,String(i))})(e,t,r,n,i),Qt=[],$t=[];(function(e,t){if(e&&typeof document<`u`){var n,r=!0===t.prepend?`prepend`:`append`,i=!0===t.singleTag,a=typeof t.container==`string`?document.querySelector(t.container):document.getElementsByTagName(`head`)[0];if(i){var o=Qt.indexOf(a);o===-1&&(o=Qt.push(a)-1,$t[o]={}),n=$t[o]&&$t[o][r]?$t[o][r]:$t[o][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var e=document.createElement(`style`);if(e.setAttribute(`type`,`text/css`),t.attributes)for(var n=Object.keys(t.attributes),i=0;i.jer-edit-buttons,.jer-value-and-buttons:hover>.jer-edit-buttons,.jer-value-main-row:hover>.jer-edit-buttons{opacity:1}.jer-copy-pulse{position:relative;transition:.3s}.jer-copy-pulse:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-copy-pulse:after{border-radius:50%;box-shadow:0 0 15px 5px var(--jer-icon-copy-color);content:"";display:block;height:100%;left:0;opacity:0;position:absolute;top:0;transition:all .5s;width:100%}.jer-copy-pulse:active:after{border-radius:4em;box-shadow:0 0 0 0 var(--jer-icon-copy-color);left:0;opacity:1;position:absolute;top:0;transition:0s}.jer-copy-pulse:active{top:.07em}.jer-rotate-90{transform:rotate(-90deg)}.jer-icon:hover{opacity:.85;transform:scale(1.2);transition:.3s}.jer-empty-string{font-size:90%;font-style:italic}.jer-drag-n-drop-padding{border:1px dashed #e0e0e0;border-radius:.3em;height:.5em}.jer-clickzone{height:calc(100% - .8em);left:-1em;position:absolute;top:1.2em}`,{});var en=(e,t)=>JSON.stringify(e,t,2),tn=({data:e,setData:t,rootName:n=`root`,onUpdate:r=()=>{},onEdit:i=r,onDelete:a=r,onAdd:o=r,onChange:s,onError:c,onEditEvent:l,showErrorMessages:u=!0,enableClipboard:d=!0,indent:f=2,collapse:p=!1,collapseAnimationTime:m=300,showCollectionCount:h=!0,restrictEdit:g=!1,restrictDelete:_=!1,restrictAdd:v=!1,restrictTypeSelection:y=!1,restrictDrag:b=!0,viewOnly:x,searchFilter:S,searchText:C,searchDebounceTime:w=350,keySort:T=!1,showArrayIndices:E=!0,arrayIndexFromOne:D=!1,showStringQuotes:ee=!0,showIconTooltips:O=!1,defaultValue:k=null,newKeyOptions:A,minWidth:j=250,maxWidth:M=`min(600px, 90vw)`,rootFontSize:te,stringTruncate:N=250,translations:P={},className:F,id:I,customText:L={},customNodeDefinitions:R=[],customButtons:z=[],jsonParse:ne=JSON.parse,jsonStringify:re=en,TextEditor:B,errorMessageTimeout:V=2500,keyboardControls:ie={},externalTriggers:ae,insertAtTop:oe=!1,onCollapse:se,collapseClickZones:ce=[`header`,`left`]})=>{let{getStyles:H}=ut(),{setCurrentlyEditingElement:U}=_t(),le=(0,$.useMemo)(()=>an(p),[p]),ue=(0,$.useMemo)(()=>Zt(P,L),[P,L]),[W,G]=(0,$.useState)(C),[K,de]=(({setData:e,data:t})=>{let[n,r]=(0,$.useState)(e?void 0:t),i=(0,$.useCallback)(t=>{e?e(t):r(t)},[e]);return(0,$.useEffect)(()=>{e||r(t)},[t]),[e?t:n,i]})({setData:t,data:e}),fe=(0,$.useRef)(null);(0,$.useEffect)(()=>{U(null);let e=setTimeout(()=>G(C),w);return()=>clearTimeout(e)},[C,w]);let pe={key:n,path:[],level:0,index:0,value:K,size:typeof K==`object`&&K?Object.keys(K).length:1,parentData:null,fullData:K},q=(e,t)=>Me(void 0,void 0,void 0,function*(){let n=yield e(t);if(!0===n||n===void 0)return void de(t.newData);let[r,i]=sn(n)?n:[`error`,n];if(r===`error`)return de(t.currentData),!1===i?ue(`ERROR_UPDATE`,pe):String(i);de(i)}),me=(0,$.useMemo)(()=>an(g,x),[g,x]),he=(0,$.useMemo)(()=>an(_,x),[_,x]),ge=(0,$.useMemo)(()=>an(v,x),[v,x]),J=(0,$.useMemo)(()=>an(b,x),[b,x]),_e=(0,$.useMemo)(()=>on(S),[S]),Y=(0,$.useMemo)(()=>(e=>{let t=Object.assign({},et);for(let n of Object.keys(et)){let r=n;if(e[r]){let i=e[r];t[r]=[`clipboardModifier`,`collapseModifier`].includes(n)?Array.isArray(i)?i:[i]:typeof i==`string`?{key:i}:i,[`stringConfirm`,`numberConfirm`,`booleanConfirm`].forEach(n=>{!e[n]&&e.confirm&&(t[n]=t.confirm)})}}return t})(ie),[ie]),ve=(0,$.useCallback)((e,t)=>((e,t,n)=>{let r=Object.entries(t);for(let[t,i]of r)if(Qe(n,e[t],t)){n.preventDefault(),i();break}})(Y,t,e),[Y]),X=(0,$.useMemo)(()=>{let e=cn(R,`stringifyReplacer`);return t=>re(t,e)},[R,re]),ye=(0,$.useMemo)(()=>{let e=cn(R,`parseReviver`);return t=>at(ne(t,e))},[R,ne]),be=(0,$.useRef)(null);((e,t)=>{let{setCurrentlyEditingElement:n,currentlyEditingElement:r,setCollapseState:i}=_t();(0,$.useEffect)(()=>{if(!e)return;let{collapse:a,edit:o}=e;a&&i(a);let s=!o?.path||Xe(o.path)===r;switch(o?.action){case`accept`:s&&(t.current&&t.current.click(),n(null));break;case`cancel`:s&&n(null);break;default:o!=null&&o.path&&n(o.path)}},[e])})(ae,be);let xe=(0,$.useCallback)((e,t)=>{!1!==T&&(typeof T==`function`?e.sort((e,n)=>T(t(e),t(n))):e.sort((e,n)=>{let r=t(e)[0],i=t(n)[0];return ri)}))},[T]),Se=Jt(R,pe),Z={mainContainerRef:fe,name:n,nodeData:pe,onEdit:(e,t)=>Me(void 0,void 0,void 0,function*(){let{currentData:n,newData:r,currentValue:a,newValue:o}=rn(K,t,e,`update`);if(a!==o)return yield q(i,{currentData:n,newData:r,currentValue:a,newValue:o,name:t.slice(-1)[0],path:t})}),onDelete:(e,t)=>Me(void 0,void 0,void 0,function*(){let{currentData:n,newData:r,currentValue:i,newValue:o}=rn(K,t,e,`delete`);return yield q(a,{currentData:n,newData:r,currentValue:i,newValue:o,name:t.slice(-1)[0],path:t})}),onAdd:(e,t,n)=>Me(void 0,void 0,void 0,function*(){let{currentData:r,newData:i,currentValue:a,newValue:s}=rn(K,t,e,`add`,n);return yield q(o,{currentData:r,newData:i,currentValue:a,newValue:s,name:t.slice(-1)[0],path:t})}),onChange:s,onError:c,onEditEvent:l,showErrorMessages:u,onMove:(e,t,n)=>Me(void 0,void 0,void 0,function*(){if(e===null)return;let{currentData:r,newData:a,currentValue:o}=rn(K,e,``,`delete`),s=e.slice(-1)[0],c=t.slice(0,-1),l=t.slice(-1)[0],u=typeof l==`number`?n===`above`?l:l+1:typeof s==`number`?`arr_${s}`:s;e.slice(0,-1).join(`.`)===t.slice(0,-1).join(`.`)&&typeof s==`number`&&typeof u==`number`&&s{let[t,n]=(0,$.useState)();return(0,$.useEffect)(()=>{let e=document.documentElement;n(e)},[]),t?(0,Q.jsx)(lt,{theme:e.theme??st,icons:e.icons,docRoot:t,children:(0,Q.jsx)(gt,{onEditEvent:e.onEditEvent,onCollapse:e.onCollapse,children:(0,Q.jsx)(tn,Object.assign({},e))})}):null},rn=(e,t,n,r,i={})=>{if(t.length===0)return{currentData:e,newData:n,currentValue:e,newValue:n};let a=Object.assign({remove:r===`delete`},i),o=r===`add`?void 0:Pe(e,t);return{currentData:e,newData:Be(e,t,n,a),currentValue:o,newValue:r===`delete`?void 0:n}},an=(e,t)=>t?()=>!0:typeof e==`boolean`?()=>e:typeof e==`number`?({level:t})=>t>=e:e,on=e=>{if(e!==void 0)return e===`value`?Je:e===`key`?Ye:e===`all`?(e,t)=>Je(e,t)||Ye(e,t):e},sn=e=>Array.isArray(e)&&e.length===2&&[`error`,`value`].includes(e[0]),cn=(e,t)=>{let n=t===`stringifyReplacer`?[e=>e===void 0?ot:e]:[];if(n.push(...e.map(e=>e[t]).filter(e=>!!e)),n.length!==0)return(e,t)=>{let r=t;for(let e of n)r=e(r);return r}},ln={displayName:`Github Dark`,styles:{container:{backgroundColor:`#0d1117`,color:`white`},dropZone:`rgba(165, 214, 255, 0.17)`,property:`#E6EDF3`,bracket:`#56d364`,itemCount:`#8B949E`,string:`#A5D6FF`,number:`#D2A8FF`,boolean:{color:`#FF7B72`,fontSize:`90%`,fontWeight:`bold`},null:`green`,iconCollection:`#D2A8FF`,iconEdit:`#D2A8FF`,iconDelete:`rgb(203, 75, 22)`,iconAdd:`rgb(203, 75, 22)`,iconCopy:`#A5D6FF`,iconOk:`#56d364`,iconCancel:`rgb(203, 75, 22)`}},un=t(((e,t)=>{t.exports={}})),dn=e(t((e=>{(function(e){e.parser=function(e,t){return new n(e,t)},e.SAXParser=n,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var t=[`comment`,`sgmlDecl`,`textNode`,`tagName`,`doctype`,`procInstName`,`procInstBody`,`entity`,`attribName`,`attribValue`,`cdata`,`script`];e.EVENTS=[`text`,`processinginstruction`,`sgmldeclaration`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`opencdata`,`cdata`,`closecdata`,`error`,`end`,`ready`,`script`,`opennamespace`,`closenamespace`];function n(t,r){if(!(this instanceof n))return new n(t,r);var a=this;i(a),a.q=a.c=``,a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.encoding=null,a.opt=r||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?`toLowerCase`:`toUpperCase`,a.opt.maxEntityCount=a.opt.maxEntityCount||512,a.opt.maxEntityDepth=a.opt.maxEntityDepth||4,a.entityCount=a.entityDepth=0,a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!!(t||a.opt.noscript),a.state=T.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(h)),a.opt.unquotedAttributeValues===void 0&&(a.opt.unquotedAttributeValues=!t),a.trackPosition=a.opt.position!==!1,a.trackPosition&&(a.position=a.line=a.column=0),D(a,`onready`)}Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});function r(n){for(var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,o=t.length;ar)switch(t[a]){case`textNode`:M(n);break;case`cdata`:j(n,`oncdata`,n.cdata),n.cdata=``;break;case`script`:j(n,`onscript`,n.script),n.script=``;break;default:N(n,`Max buffer length exceeded: `+t[a])}i=Math.max(i,s)}n.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+n.position}function i(e){for(var n=0,r=t.length;n=2){if(e[0]===255&&e[1]===254)return`utf-16le`;if(e[0]===254&&e[1]===255)return`utf-16be`}return e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191?`utf8`:e.length>=4?e[0]===60&&e[1]===0&&e[2]===63&&e[3]===0?`utf-16le`:e[0]===0&&e[1]===60&&e[2]===0&&e[3]===63?`utf-16be`:`utf8`:t?`utf8`:null}function u(e,t){if(!(this instanceof u))return new u(e,t);o.apply(this),this._parser=new n(e,t),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit(`end`)},this._parser.onerror=function(e){r.emit(`error`,e),r._parser.error=null},this._decoder=null,this._decoderBuffer=null,s.forEach(function(e){Object.defineProperty(r,`on`+e,{get:function(){return r._parser[`on`+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser[`on`+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})})}u.prototype=Object.create(o.prototype,{constructor:{value:u}}),u.prototype._decodeBuffer=function(e,t){if(this._decoderBuffer&&=(e=Buffer.concat([this._decoderBuffer,e]),null),!this._decoder){var n=l(e,t);if(!n)return this._decoderBuffer=e,``;this._parser.encoding=n,this._decoder=new TextDecoder(n)}return this._decoder.decode(e,{stream:!t})},u.prototype.write=function(e){if(typeof Buffer==`function`&&typeof Buffer.isBuffer==`function`&&Buffer.isBuffer(e))e=this._decodeBuffer(e,!1);else if(this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit(`data`,t))}return this._parser.write(e.toString()),this.emit(`data`,e),!0},u.prototype.end=function(e){if(e&&e.length&&this.write(e),this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit(`data`,t))}else if(this._decoder){var n=this._decoder.decode();n&&(this._parser.write(n),this.emit(`data`,n))}return this._parser.end(),!0},u.prototype.on=function(e,t){var n=this;return!n._parser[`on`+e]&&s.indexOf(e)!==-1&&(n._parser[`on`+e]=function(){var t=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),o.prototype.on.call(n,e,t)};var d=`[CDATA[`,f=`DOCTYPE`,p=`http://www.w3.org/XML/1998/namespace`,m=`http://www.w3.org/2000/xmlns/`,h={xml:p,xmlns:m},g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function b(e){return e===` `||e===` `||e===`\r`||e===` `}function x(e){return e===`"`||e===`'`}function S(e){return e===`>`||b(e)}function C(e,t){return e.test(t)}function w(e,t){return!C(e,t)}var T=0;for(var E in e.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},e.XML_ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},e.ENTITIES={amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`,AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(t){var n=e.ENTITIES[t],r=typeof n==`number`?String.fromCharCode(n):n;e.ENTITIES[t]=r}),e.STATE)e.STATE[e.STATE[E]]=E;T=e.STATE;function D(e,t,n){e[t]&&e[t](n)}function ee(e){var t=e&&e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return t?t[2]:null}function O(e){return e?e.toLowerCase().replace(/[^a-z0-9]/g,``):null}function k(e,t){let n=O(e),r=O(t);return!n||!r?!0:r===`utf16`?n===`utf16le`||n===`utf16be`:n===r}function A(e,t){if(!(!e.strict||!e.encoding||!t||t.name!==`xml`)){var n=ee(t.body);n&&!k(e.encoding,n)&&F(e,`XML declaration encoding `+n+` does not match detected stream encoding `+e.encoding.toUpperCase())}}function j(e,t,n){e.textNode&&M(e),D(e,t,n)}function M(e){e.textNode=te(e.opt,e.textNode),e.textNode&&D(e,`ontext`,e.textNode),e.textNode=``}function te(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g,` `)),t}function N(e,t){return M(e),e.trackPosition&&(t+=` Line: `+e.line+` Column: `+e.column+` Char: `+e.c),t=Error(t),e.error=t,D(e,`onerror`,t),e}function P(e){return e.sawRoot&&!e.closedRoot&&F(e,`Unclosed root tag`),e.state!==T.BEGIN&&e.state!==T.BEGIN_WHITESPACE&&e.state!==T.TEXT&&N(e,`Unexpected end`),M(e),e.c=``,e.closed=!0,D(e,`onend`),n.call(e,e.strict,e.opt),e}function F(e,t){if(typeof e!=`object`||!(e instanceof n))throw Error(`bad call to strictFail`);e.strict&&N(e,t)}function I(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,j(e,`onopentagstart`,n)}function L(e,t){var n=e.indexOf(`:`)<0?[``,e]:e.split(`:`),r=n[0],i=n[1];return t&&e===`xmlns`&&(r=`xmlns`,i=``),{prefix:r,local:i}}function R(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue=``;return}if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.prefix,r=t.local;if(n===`xmlns`)if(r===`xml`&&e.attribValue!==p)F(e,`xml: prefix must be bound to `+p+` Actual: `+e.attribValue);else if(r===`xmlns`&&e.attribValue!==m)F(e,`xmlns: prefix must be bound to `+m+` Actual: `+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,j(e,`onattribute`,{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=``}function z(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||``,n.prefix&&!n.uri&&(F(e,`Unbound namespace prefix: `+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(t){j(e,`onopennamespace`,{prefix:t,uri:n.ns[t]})});for(var a=0,o=e.attribList.length;a`,e.state=T.TEXT;return}if(e.script){if(e.tagName!==`script`){e.script+=``,e.tagName=``,e.state=T.SCRIPT;return}j(e,`onscript`,e.script),e.script=``}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)F(e,`Unexpected close tag`);if(t<0){F(e,`Unmatched closing tag: `+e.tagName),e.textNode+=``,e.state=T.TEXT;return}e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,j(e,`onclosetag`,e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var c=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==c.ns&&Object.keys(a.ns).forEach(function(t){var n=a.ns[t];j(e,`onclosenamespace`,{prefix:t,uri:n})})}t===0&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName=``,e.attribList.length=0,e.state=T.TEXT}function re(e){var t=e.entity,n=t.toLowerCase(),r,i=``;return e.ENTITIES[t]?e.ENTITIES[t]:e.ENTITIES[n]?e.ENTITIES[n]:(t=n,t.charAt(0)===`#`&&(t.charAt(1)===`x`?(t=t.slice(2),r=parseInt(t,16),i=r.toString(16)):(t=t.slice(1),r=parseInt(t,10),i=r.toString(10))),t=t.replace(/^0+/,``),isNaN(r)||i.toLowerCase()!==t||r<0||r>1114111?(F(e,`Invalid character entity`),`&`+e.entity+`;`):String.fromCodePoint(r))}function B(e,t){t===`<`?(e.state=T.OPEN_WAKA,e.startTagPosition=e.position):b(t)||(F(e,`Non-whitespace before first tag.`),e.textNode=t,e.state=T.TEXT)}function V(e,t){var n=``;return t`?(j(n,`onsgmldeclaration`,n.sgmlDecl),n.sgmlDecl=``,n.state=T.TEXT):(x(a)&&(n.state=T.SGML_DECL_QUOTED),n.sgmlDecl+=a);continue;case T.SGML_DECL_QUOTED:a===n.q&&(n.state=T.SGML_DECL,n.q=``),n.sgmlDecl+=a;continue;case T.DOCTYPE:a===`>`?(n.state=T.TEXT,j(n,`ondoctype`,n.doctype),n.doctype=!0):(n.doctype+=a,a===`[`?n.state=T.DOCTYPE_DTD:x(a)&&(n.state=T.DOCTYPE_QUOTED,n.q=a));continue;case T.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q=``,n.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:a===`]`?(n.doctype+=a,n.state=T.DOCTYPE):a===`<`?(n.state=T.OPEN_WAKA,n.startTagPosition=n.position):x(a)?(n.doctype+=a,n.state=T.DOCTYPE_DTD_QUOTED,n.q=a):n.doctype+=a;continue;case T.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=T.DOCTYPE_DTD,n.q=``);continue;case T.COMMENT:a===`-`?n.state=T.COMMENT_ENDING:n.comment+=a;continue;case T.COMMENT_ENDING:a===`-`?(n.state=T.COMMENT_ENDED,n.comment=te(n.opt,n.comment),n.comment&&j(n,`oncomment`,n.comment),n.comment=``):(n.comment+=`-`+a,n.state=T.COMMENT);continue;case T.COMMENT_ENDED:a===`>`?n.doctype&&n.doctype!==!0?n.state=T.DOCTYPE_DTD:n.state=T.TEXT:(F(n,`Malformed comment`),n.comment+=`--`+a,n.state=T.COMMENT);continue;case T.CDATA:for(var o=i-1;a&&a!==`]`;)a=V(t,i++),a&&n.trackPosition&&(n.position++,a===` `?(n.line++,n.column=0):n.column++);n.cdata+=t.substring(o,i-1),a===`]`&&(n.state=T.CDATA_ENDING);continue;case T.CDATA_ENDING:a===`]`?n.state=T.CDATA_ENDING_2:(n.cdata+=`]`+a,n.state=T.CDATA);continue;case T.CDATA_ENDING_2:a===`>`?(n.cdata&&j(n,`oncdata`,n.cdata),j(n,`onclosecdata`),n.cdata=``,n.state=T.TEXT):a===`]`?n.cdata+=`]`:(n.cdata+=`]]`+a,n.state=T.CDATA);continue;case T.PROC_INST:a===`?`?n.state=T.PROC_INST_ENDING:b(a)?n.state=T.PROC_INST_BODY:n.procInstName+=a;continue;case T.PROC_INST_BODY:if(!n.procInstBody&&b(a))continue;a===`?`?n.state=T.PROC_INST_ENDING:n.procInstBody+=a;continue;case T.PROC_INST_ENDING:if(a===`>`){let e={name:n.procInstName,body:n.procInstBody};A(n,e),j(n,`onprocessinginstruction`,e),n.procInstName=n.procInstBody=``,n.state=T.TEXT}else n.procInstBody+=`?`+a,n.state=T.PROC_INST_BODY;continue;case T.OPEN_TAG:C(_,a)?n.tagName+=a:(I(n),a===`>`?z(n):a===`/`?n.state=T.OPEN_TAG_SLASH:(b(a)||F(n,`Invalid character in tag name`),n.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:a===`>`?(z(n,!0),ne(n)):(F(n,`Forward-slash in opening tag not followed by >`),n.state=T.ATTRIB);continue;case T.ATTRIB:if(b(a))continue;a===`>`?z(n):a===`/`?n.state=T.OPEN_TAG_SLASH:C(g,a)?(n.attribName=a,n.attribValue=``,n.state=T.ATTRIB_NAME):F(n,`Invalid attribute name`);continue;case T.ATTRIB_NAME:a===`=`?n.state=T.ATTRIB_VALUE:a===`>`?(F(n,`Attribute without value`),n.attribValue=n.attribName,R(n),z(n)):b(a)?n.state=T.ATTRIB_NAME_SAW_WHITE:C(_,a)?n.attribName+=a:F(n,`Invalid attribute name`);continue;case T.ATTRIB_NAME_SAW_WHITE:if(a===`=`)n.state=T.ATTRIB_VALUE;else if(b(a))continue;else F(n,`Attribute without value`),n.tag.attributes[n.attribName]=``,n.attribValue=``,j(n,`onattribute`,{name:n.attribName,value:``}),n.attribName=``,a===`>`?z(n):C(g,a)?(n.attribName=a,n.state=T.ATTRIB_NAME):(F(n,`Invalid attribute name`),n.state=T.ATTRIB);continue;case T.ATTRIB_VALUE:if(b(a))continue;x(a)?(n.q=a,n.state=T.ATTRIB_VALUE_QUOTED):(n.opt.unquotedAttributeValues||N(n,`Unquoted attribute value`),n.state=T.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case T.ATTRIB_VALUE_QUOTED:if(a!==n.q){a===`&`?n.state=T.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}R(n),n.q=``,n.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:b(a)?n.state=T.ATTRIB:a===`>`?z(n):a===`/`?n.state=T.OPEN_TAG_SLASH:C(g,a)?(F(n,`No whitespace between attributes`),n.attribName=a,n.attribValue=``,n.state=T.ATTRIB_NAME):F(n,`Invalid attribute name`);continue;case T.ATTRIB_VALUE_UNQUOTED:if(!S(a)){a===`&`?n.state=T.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}R(n),a===`>`?z(n):n.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(n.tagName)a===`>`?ne(n):C(_,a)?n.tagName+=a:n.script?(n.script+=``?ne(n):F(n,`Invalid characters in closing tag`);continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var c,l;switch(n.state){case T.TEXT_ENTITY:c=T.TEXT,l=`textNode`;break;case T.ATTRIB_VALUE_ENTITY_Q:c=T.ATTRIB_VALUE_QUOTED,l=`attribValue`;break;case T.ATTRIB_VALUE_ENTITY_U:c=T.ATTRIB_VALUE_UNQUOTED,l=`attribValue`;break}if(a===`;`){var u=re(n);n.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(u)?((n.entityCount+=1)>n.opt.maxEntityCount&&N(n,`Parsed entity count exceeds max entity count`),(n.entityDepth+=1)>n.opt.maxEntityDepth&&N(n,`Parsed entity depth exceeds max entity depth`),n.entity=``,n.state=c,n.write(u),--n.entityDepth):(n[l]+=u,n.entity=``,n.state=c)}else C(n.entity.length?y:v,a)?n.entity+=a:(F(n,`Invalid character in entity name`),n[l]+=`&`+n.entity+a,n.entity=``,n.state=c);continue;default:throw Error(n,`Unknown state: `+n.state)}return n.position>=n.bufferCheckPosition&&r(n),n}String.fromCodePoint||(function(){var e=String.fromCharCode,t=Math.floor,n=function(){var n=16384,r=[],i,a,o=-1,s=arguments.length;if(!s)return``;for(var c=``;++o1114111||t(l)!==l)throw RangeError(`Invalid code point: `+l);l<=65535?r.push(l):(l-=65536,i=(l>>10)+55296,a=l%1024+56320,r.push(i,a)),(o+1===s||r.length>n)&&(c+=e.apply(null,r),r.length=0)}return c};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:n,configurable:!0,writable:!0}):String.fromCodePoint=n})()})(e===void 0?e.sax={}:e)}))(),1),fn={"http://www.w3.org/2000/svg":{ext:`svg`,mime:`image/svg+xml`},"http://www.w3.org/1999/xhtml":{ext:`xhtml`,mime:`application/xhtml+xml`},"http://www.opengis.net/kml/2.2":{ext:`kml`,mime:`application/vnd.google-earth.kml+xml`},"http://www.opengis.net/gml":{ext:`gml`,mime:`application/gml+xml`}},pn={rss:{ext:`rss`,mime:`application/rss+xml`},"score-partwise":{ext:`musicxml`,mime:`application/vnd.recordare.musicxml+xml`},svg:{ext:`svg`,mime:`image/svg+xml`}},mn=class{constructor(e){this.options=e??{},this.firstTag=!0,this.onEnd=!1,this.parser=dn.default.parser(!0,{xmlns:!0}),this.nesting=0,this.parser.onerror=e=>{e.message.startsWith(`Invalid character entity`)||(this.fileType=void 0,this.onEnd=!0)},this.parser.onopentag=e=>{++this.nesting,!(!this.firstTag||this.onEnd)&&(this.firstTag=!1,e.uri?this.fileType=fn[e.uri]:e.name&&(this.fileType=pn[e.name.toLowerCase()]),this.fileType&&!this.options.fullScan&&(this.onEnd=!0))},this.parser.onclosetag=()=>{--this.nesting}}write(e){this.parser.write(e)}close(){this.parser.close(),this.onEnd=!0}isValid(){return this.nesting===0}};function hn(e,{validate:t=!0}={}){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);if(e=e.trim(),e.length===0)return!1;let n=new mn({fullScan:t});if(t){if(n.write(e),!n.isValid())return!1}else{let t=0;for(;e.length>t&&!n.onEnd;)n.write(e.slice(t,Math.min(t+128,e.length))),t+=128}return n.fileType?.ext===`svg`}function gn(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=` `;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(vn(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(_n(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(_n(t));return o=15}if(vn(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=` `),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function _n(e){return e===32||e===9}function vn(e){return e===10||e===13}function yn(e){return e>=48&&e<=57}var bn;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(bn||={}),Array(20).fill(0).map((e,t)=>` `.repeat(t));var xn=200;Array(xn).fill(0).map((e,t)=>` `+` `.repeat(t)),Array(xn).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(xn).fill(0).map((e,t)=>`\r `+` `.repeat(t)),Array(xn).fill(0).map((e,t)=>` `+` `.repeat(t)),Array(xn).fill(0).map((e,t)=>`\r`+` `.repeat(t)),Array(xn).fill(0).map((e,t)=>`\r `+` `.repeat(t));var Sn;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Sn||={});function Cn(e,t=[],n=Sn.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return Dn(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function wn(e){switch(e.type){case`array`:return e.children.map(wn);case`object`:let t=Object.create(null);for(let n of e.children){let e=n.children[1];e&&(t[n.children[0].value]=wn(e))}return t;case`null`:case`string`:case`number`:case`boolean`:return e.value;default:return}}function Tn(e,t,n=!1){return t>=e.offset&&ta===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),O()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function D(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function ee(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,O()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function O(){switch(r.getToken()){case 3:return ee();case 1:return D();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):O()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}var On;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(On||={});var kn;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(kn||={});var An=Cn,jn=En,Mn=wn,Nn;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Nn||={});export{o as _,nn as a,Ce as c,D as d,E as f,S as g,C as h,hn as i,O as l,w as m,Mn as n,ln as o,T as p,An as r,ke as s,jn as t,ee as u,a as v,i as y};