UNPKG

json-merge-resolver

Version:

A rules-based JSON conflict resolver that parses Git conflict markers, reconstructs ours/theirs, and merges with deterministic strategies — beyond line-based merges.

14 lines 312 kB
"use strict";var Nh=Object.create;var Xn=Object.defineProperty;var jh=Object.getOwnPropertyDescriptor;var Rh=Object.getOwnPropertyNames;var Fh=Object.getPrototypeOf,Lh=Object.prototype.hasOwnProperty;var Dh=(e,t,n)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _a=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),qh=(e,t)=>{for(var n in t)Xn(e,n,{get:t[n],enumerable:!0})},Bh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rh(t))!Lh.call(e,i)&&i!==n&&Xn(e,i,{get:()=>t[i],enumerable:!(r=jh(t,i))||r.enumerable});return e};var Zt=(e,t,n)=>(n=e!=null?Nh(Fh(e)):{},Bh(t||!e||!e.__esModule?Xn(n,"default",{value:e,enumerable:!0}):n,e));var J=(e,t,n)=>Dh(e,typeof t!="symbol"?t+"":t,n);var ku=Ht((B0,Pu)=>{"use strict";var Ou,Hr,Zr,Qr,ei,ti,Nn,Ts,Rn,ni,$u,ri,jn,ii,oi,si,Vt,Au,ai,ci,Dg;ii=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;jn=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;Hr=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;si=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;ri=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;Vt=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;ci=/[\t\v\f\ufeff\p{Zs}]+/yu;Rn=/\r?\n|[\r\u2028\u2029]/y;ni=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;oi=/\/\/.*/y;Ou=/^#!.*/;Qr=/[<>.:={}]|\/(?![\/*])/y;Zr=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;ei=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;ti=/[^<>{}]+/y;ai=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;Au=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;Nn=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;Ts=/^(?:return|throw|yield)$/;$u=RegExp(Rn.source);Pu.exports=Dg=function*(e,{jsx:t=!1}={}){var n,r,i,o,s,a,c,l,u,f,p,h,m,d;for({length:a}=e,o=0,s="",d=[{tag:"JS"}],n=[],p=0,h=!1,(c=Ou.exec(e))&&(yield{type:"HashbangComment",value:c[0]},o=c[0].length);o<a;){switch(l=d[d.length-1],l.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(e[o]==="/"&&(ai.test(s)||Nn.test(s))&&(ii.lastIndex=o,c=ii.exec(e))){o=ii.lastIndex,s=c[0],h=!0,yield{type:"RegularExpressionLiteral",value:c[0],closed:c[1]!==void 0&&c[1]!=="\\"};continue}if(jn.lastIndex=o,c=jn.exec(e)){switch(m=c[0],u=jn.lastIndex,f=m,m){case"(":s==="?NonExpressionParenKeyword"&&d.push({tag:"JSNonExpressionParen",nesting:p}),p++,h=!1;break;case")":p--,h=!0,l.tag==="JSNonExpressionParen"&&p===l.nesting&&(d.pop(),f="?NonExpressionParenEnd",h=!1);break;case"{":jn.lastIndex=0,i=!Au.test(s)&&(ai.test(s)||Nn.test(s)),n.push(i),h=!1;break;case"}":switch(l.tag){case"InterpolationInTemplate":if(n.length===l.nesting){Vt.lastIndex=o,c=Vt.exec(e),o=Vt.lastIndex,s=c[0],c[1]==="${"?(s="?InterpolationInTemplate",h=!1,yield{type:"TemplateMiddle",value:c[0]}):(d.pop(),h=!0,yield{type:"TemplateTail",value:c[0],closed:c[1]==="`"});continue}break;case"InterpolationInJSX":if(n.length===l.nesting){d.pop(),o+=1,s="}",yield{type:"JSXPunctuator",value:"}"};continue}}h=n.pop(),f=h?"?ExpressionBraceEnd":"}";break;case"]":h=!0;break;case"++":case"--":f=h?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(t&&(ai.test(s)||Nn.test(s))){d.push({tag:"JSXTag"}),o+=1,s="<",yield{type:"JSXPunctuator",value:m};continue}h=!1;break;default:h=!1}o=u,s=f,yield{type:"Punctuator",value:m};continue}if(Hr.lastIndex=o,c=Hr.exec(e)){switch(o=Hr.lastIndex,f=c[0],c[0]){case"for":case"if":case"while":case"with":s!=="."&&s!=="?."&&(f="?NonExpressionParenKeyword")}s=f,h=!Nn.test(c[0]),yield{type:c[1]==="#"?"PrivateIdentifier":"IdentifierName",value:c[0]};continue}if(si.lastIndex=o,c=si.exec(e)){o=si.lastIndex,s=c[0],h=!0,yield{type:"StringLiteral",value:c[0],closed:c[2]!==void 0};continue}if(ri.lastIndex=o,c=ri.exec(e)){o=ri.lastIndex,s=c[0],h=!0,yield{type:"NumericLiteral",value:c[0]};continue}if(Vt.lastIndex=o,c=Vt.exec(e)){o=Vt.lastIndex,s=c[0],c[1]==="${"?(s="?InterpolationInTemplate",d.push({tag:"InterpolationInTemplate",nesting:n.length}),h=!1,yield{type:"TemplateHead",value:c[0]}):(h=!0,yield{type:"NoSubstitutionTemplate",value:c[0],closed:c[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(Qr.lastIndex=o,c=Qr.exec(e)){switch(o=Qr.lastIndex,f=c[0],c[0]){case"<":d.push({tag:"JSXTag"});break;case">":d.pop(),s==="/"||l.tag==="JSXTagEnd"?(f="?JSX",h=!0):d.push({tag:"JSXChildren"});break;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),f="?InterpolationInJSX",h=!1;break;case"/":s==="<"&&(d.pop(),d[d.length-1].tag==="JSXChildren"&&d.pop(),d.push({tag:"JSXTagEnd"}))}s=f,yield{type:"JSXPunctuator",value:c[0]};continue}if(Zr.lastIndex=o,c=Zr.exec(e)){o=Zr.lastIndex,s=c[0],yield{type:"JSXIdentifier",value:c[0]};continue}if(ei.lastIndex=o,c=ei.exec(e)){o=ei.lastIndex,s=c[0],yield{type:"JSXString",value:c[0],closed:c[2]!==void 0};continue}break;case"JSXChildren":if(ti.lastIndex=o,c=ti.exec(e)){o=ti.lastIndex,s=c[0],yield{type:"JSXText",value:c[0]};continue}switch(e[o]){case"<":d.push({tag:"JSXTag"}),o++,s="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":d.push({tag:"InterpolationInJSX",nesting:n.length}),o++,s="?InterpolationInJSX",h=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(ci.lastIndex=o,c=ci.exec(e)){o=ci.lastIndex,yield{type:"WhiteSpace",value:c[0]};continue}if(Rn.lastIndex=o,c=Rn.exec(e)){o=Rn.lastIndex,h=!1,Ts.test(s)&&(s="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:c[0]};continue}if(ni.lastIndex=o,c=ni.exec(e)){o=ni.lastIndex,$u.test(c[0])&&(h=!1,Ts.test(s)&&(s="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:c[0],closed:c[1]!==void 0};continue}if(oi.lastIndex=o,c=oi.exec(e)){o=oi.lastIndex,h=!1,yield{type:"SingleLineComment",value:c[0]};continue}r=String.fromCodePoint(e.codePointAt(o)),o+=r.length,s=r,h=!1,yield{type:l.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:r}}}});function Ln(e,t,n){let r=t-n;r=r<0?-r<<1|1:r<<1;do{let i=r&31;r>>>=5,r>0&&(i|=32),e.write(ff[i])}while(r>0);return t}function hf(e){let t=new Iy,n=0,r=0,i=0,o=0;for(let s=0;s<e.length;s++){let a=e[s];if(s>0&&t.write(_y),a.length===0)continue;let c=0;for(let l=0;l<a.length;l++){let u=a[l];l>0&&t.write(Ty),c=Ln(t,u[0],c),u.length!==1&&(n=Ln(t,u[1],n),r=Ln(t,u[2],r),i=Ln(t,u[3],i),u.length!==4&&(o=Ln(t,u[4],o)))}}return t.flush()}var Ty,_y,cf,ff,Cy,lf,uf,Iy,df=_a(()=>{"use strict";Ty=44,_y=59,cf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ff=new Uint8Array(64),Cy=new Uint8Array(128);for(let e=0;e<cf.length;e++){let t=cf.charCodeAt(e);ff[e]=t,Cy[t]=e}lf=1024*16,uf=typeof TextDecoder!="undefined"?new TextDecoder:typeof Buffer!="undefined"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}},Iy=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(lf)}write(e){let{buffer:t}=this;t[this.pos++]=e,this.pos===lf&&(this.out+=uf.decode(t),this.pos=0)}flush(){let{buffer:e,out:t,pos:n}=this;return n>0?t+uf.decode(e.subarray(0,n)):t}}});var yf={};qh(yf,{Bundle:()=>Ds,SourceMap:()=>qn,default:()=>Bn});function Oy(){return typeof globalThis!="undefined"&&typeof globalThis.btoa=="function"?e=>globalThis.btoa(unescape(encodeURIComponent(e))):typeof Buffer=="function"?e=>Buffer.from(e,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}function Ay(e){let t=e.split(` `),n=t.filter(o=>/^\t+/.test(o)),r=t.filter(o=>/^ {2,}/.test(o));if(n.length===0&&r.length===0)return null;if(n.length>=r.length)return" ";let i=r.reduce((o,s)=>{let a=/^ +/.exec(s)[0].length;return Math.min(a,o)},1/0);return new Array(i+1).join(" ")}function mf(e,t){let n=e.split(/[/\\]/),r=t.split(/[/\\]/);for(n.pop();n[0]===r[0];)n.shift(),r.shift();if(n.length){let i=n.length;for(;i--;)n[i]=".."}return n.concat(r).join("/")}function gf(e){return Py.call(e)==="[object Object]"}function Ls(e){let t=e.split(` `),n=[];for(let r=0,i=0;r<t.length;r++)n.push(i),i+=t[r].length+1;return function(i){let o=0,s=n.length;for(;o<s;){let l=o+s>>1;i<n[l]?s=l:o=l+1}let a=o-1,c=i-n[a];return{line:a,column:c}}}var yi,bi,$y,qn,Py,ky,wi,Dn,fn,Bn,pf,Ds,bf=_a(()=>{"use strict";df();yi=class e{constructor(t){this.bits=t instanceof e?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}},bi=class e{constructor(t,n,r){this.start=t,this.end=n,this.original=r,this.intro="",this.outro="",this.content=r,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){let t=new e(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start<t&&t<this.end}eachNext(t){let n=this;for(;n;)t(n),n=n.next}eachPrevious(t){let n=this;for(;n;)t(n),n=n.previous}edit(t,n,r){return this.content=t,r||(this.intro="",this.outro=""),this.storeName=n,this.edited=!0,this}prependLeft(t){this.outro=t+this.outro}prependRight(t){this.intro=t+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(t){let n=t-this.start,r=this.original.slice(0,n),i=this.original.slice(n);this.original=r;let o=new e(t,this.end,i);return o.outro=this.outro,this.outro="",this.end=t,this.edited?(o.edit("",!1),this.content=""):this.content=r,o.next=this.next,o.next&&(o.next.previous=o),o.previous=this,this.next=o,o}toString(){return this.intro+this.content+this.outro}trimEnd(t){if(this.outro=this.outro.replace(t,""),this.outro.length)return!0;let n=this.content.replace(t,"");if(n.length)return n!==this.content&&(this.split(this.start+n.length).edit("",void 0,!0),this.edited&&this.edit(n,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(t,""),this.intro.length)return!0}trimStart(t){if(this.intro=this.intro.replace(t,""),this.intro.length)return!0;let n=this.content.replace(t,"");if(n.length){if(n!==this.content){let r=this.split(this.end-n.length);this.edited&&r.edit(n,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(t,""),this.outro.length)return!0}};$y=Oy(),qn=class{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=hf(t.mappings),typeof t.x_google_ignoreList!="undefined"&&(this.x_google_ignoreList=t.x_google_ignoreList),typeof t.debugId!="undefined"&&(this.debugId=t.debugId)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+$y(this.toString())}};Py=Object.prototype.toString;ky=/\w/,wi=class{constructor(t){this.hires=t,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(t,n,r,i){if(n.length){let o=n.length-1,s=n.indexOf(` `,0),a=-1;for(;s>=0&&o>s;){let l=[this.generatedCodeColumn,t,r.line,r.column];i>=0&&l.push(i),this.rawSegments.push(l),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=s,s=n.indexOf(` `,s+1)}let c=[this.generatedCodeColumn,t,r.line,r.column];i>=0&&c.push(i),this.rawSegments.push(c),this.advance(n.slice(a+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(n));this.pending=null}addUneditedChunk(t,n,r,i,o){let s=n.start,a=!0,c=!1;for(;s<n.end;){if(r[s]===` `)i.line+=1,i.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,a=!0,c=!1;else{if(this.hires||a||o.has(s)){let l=[this.generatedCodeColumn,t,i.line,i.column];this.hires==="boundary"?ky.test(r[s])?c||(this.rawSegments.push(l),c=!0):(this.rawSegments.push(l),c=!1):this.rawSegments.push(l)}i.column+=1,this.generatedCodeColumn+=1,a=!1}s+=1}this.pending=null}advance(t){if(!t)return;let n=t.split(` `);if(n.length>1){for(let r=0;r<n.length-1;r++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=n[n.length-1].length}},Dn=` `,fn={insertLeft:!1,insertRight:!1,storeName:!1},Bn=class e{constructor(t,n={}){let r=new bi(0,t.length,t);Object.defineProperties(this,{original:{writable:!0,value:t},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:r},lastChunk:{writable:!0,value:r},lastSearchedChunk:{writable:!0,value:r},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:n.filename},indentExclusionRanges:{writable:!0,value:n.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new yi},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:n.ignoreList},offset:{writable:!0,value:n.offset||0}}),this.byStart[0]=r,this.byEnd[t.length]=r}addSourcemapLocation(t){this.sourcemapLocations.add(t)}append(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.outro+=t,this}appendLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.appendLeft(n):this.intro+=n,this}appendRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.appendRight(n):this.outro+=n,this}clone(){let t=new e(this.original,{filename:this.filename,offset:this.offset}),n=this.firstChunk,r=t.firstChunk=t.lastSearchedChunk=n.clone();for(;n;){t.byStart[r.start]=r,t.byEnd[r.end]=r;let i=n.next,o=i&&i.clone();o&&(r.next=o,o.previous=r,r=o),n=i}return t.lastChunk=r,this.indentExclusionRanges&&(t.indentExclusionRanges=this.indentExclusionRanges.slice()),t.sourcemapLocations=new yi(this.sourcemapLocations),t.intro=this.intro,t.outro=this.outro,t}generateDecodedMap(t){t=t||{};let n=0,r=Object.keys(this.storedNames),i=new wi(t.hires),o=Ls(this.original);return this.intro&&i.advance(this.intro),this.firstChunk.eachNext(s=>{let a=o(s.start);s.intro.length&&i.advance(s.intro),s.edited?i.addEdit(n,s.content,a,s.storeName?r.indexOf(s.original):-1):i.addUneditedChunk(n,s,this.original,a,this.sourcemapLocations),s.outro.length&&i.advance(s.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:[t.source?mf(t.file||"",t.source):t.file||""],sourcesContent:t.includeContent?[this.original]:void 0,names:r,mappings:i.raw,x_google_ignoreList:this.ignoreList?[n]:void 0}}generateMap(t){return new qn(this.generateDecodedMap(t))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=Ay(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(t,n){let r=/^[^\r\n]/gm;if(gf(t)&&(n=t,t=void 0),t===void 0&&(this._ensureindentStr(),t=this.indentStr||" "),t==="")return this;n=n||{};let i={};n.exclude&&(typeof n.exclude[0]=="number"?[n.exclude]:n.exclude).forEach(u=>{for(let f=u[0];f<u[1];f+=1)i[f]=!0});let o=n.indentStart!==!1,s=l=>o?`${t}${l}`:(o=!0,l);this.intro=this.intro.replace(r,s);let a=0,c=this.firstChunk;for(;c;){let l=c.end;if(c.edited)i[a]||(c.content=c.content.replace(r,s),c.content.length&&(o=c.content[c.content.length-1]===` `));else for(a=c.start;a<l;){if(!i[a]){let u=this.original[a];u===` `?o=!0:u!=="\r"&&o&&(o=!1,a===c.start||(this._splitChunk(c,a),c=c.next),c.prependRight(t))}a+=1}a=c.end,c=c.next}return this.outro=this.outro.replace(r,s),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(t,n){return fn.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),fn.insertLeft=!0),this.appendLeft(t,n)}insertRight(t,n){return fn.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),fn.insertRight=!0),this.prependRight(t,n)}move(t,n,r){if(t=t+this.offset,n=n+this.offset,r=r+this.offset,r>=t&&r<=n)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(n),this._split(r);let i=this.byStart[t],o=this.byEnd[n],s=i.previous,a=o.next,c=this.byStart[r];if(!c&&o===this.lastChunk)return this;let l=c?c.previous:this.lastChunk;return s&&(s.next=a),a&&(a.previous=s),l&&(l.next=i),c&&(c.previous=o),i.previous||(this.firstChunk=o.next),o.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=l,o.next=c||null,l||(this.firstChunk=i),c||(this.lastChunk=o),this}overwrite(t,n,r,i){return i=i||{},this.update(t,n,r,{...i,overwrite:!i.contentOnly})}update(t,n,r,i){if(t=t+this.offset,n=n+this.offset,typeof r!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(n>this.original.length)throw new Error("end is out of bounds");if(t===n)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(n),i===!0&&(fn.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),fn.storeName=!0),i={storeName:!0});let o=i!==void 0?i.storeName:!1,s=i!==void 0?i.overwrite:!1;if(o){let l=this.original.slice(t,n);Object.defineProperty(this.storedNames,l,{writable:!0,value:!0,enumerable:!0})}let a=this.byStart[t],c=this.byEnd[n];if(a){let l=a;for(;l!==c;){if(l.next!==this.byStart[l.end])throw new Error("Cannot overwrite across a split point");l=l.next,l.edit("",!1)}a.edit(r,o,!s)}else{let l=new bi(t,n,"").edit(r,o);c.next=l,l.previous=c}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byEnd[t];return r?r.prependLeft(n):this.intro=n+this.intro,this}prependRight(t,n){if(t=t+this.offset,typeof n!="string")throw new TypeError("inserted content must be a string");this._split(t);let r=this.byStart[t];return r?r.prependRight(n):this.outro=n+this.outro,this}remove(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.intro="",r.outro="",r.edit(""),r=n>r.end?this.byStart[r.end]:null;return this}reset(t,n){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}if(t===n)return this;if(t<0||n>this.original.length)throw new Error("Character is out of bounds");if(t>n)throw new Error("end must be greater than start");this._split(t),this._split(n);let r=this.byStart[t];for(;r;)r.reset(),r=n>r.end?this.byStart[r.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(Dn);if(t!==-1)return this.outro.substr(t+1);let n=this.outro,r=this.lastChunk;do{if(r.outro.length>0){if(t=r.outro.lastIndexOf(Dn),t!==-1)return r.outro.substr(t+1)+n;n=r.outro+n}if(r.content.length>0){if(t=r.content.lastIndexOf(Dn),t!==-1)return r.content.substr(t+1)+n;n=r.content+n}if(r.intro.length>0){if(t=r.intro.lastIndexOf(Dn),t!==-1)return r.intro.substr(t+1)+n;n=r.intro+n}}while(r=r.previous);return t=this.intro.lastIndexOf(Dn),t!==-1?this.intro.substr(t+1)+n:this.intro+n}slice(t=0,n=this.original.length-this.offset){if(t=t+this.offset,n=n+this.offset,this.original.length!==0){for(;t<0;)t+=this.original.length;for(;n<0;)n+=this.original.length}let r="",i=this.firstChunk;for(;i&&(i.start>t||i.end<=t);){if(i.start<n&&i.end>=n)return r;i=i.next}if(i&&i.edited&&i.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);let o=i;for(;i;){i.intro&&(o!==i||i.start===t)&&(r+=i.intro);let s=i.start<n&&i.end>=n;if(s&&i.edited&&i.end!==n)throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);let a=o===i?t-i.start:0,c=s?i.content.length+n-i.end:i.content.length;if(r+=i.content.slice(a,c),i.outro&&(!s||i.end===n)&&(r+=i.outro),s)break;i=i.next}return r}snip(t,n){let r=this.clone();return r.remove(0,t),r.remove(n,r.original.length),r}_split(t){if(this.byStart[t]||this.byEnd[t])return;let n=this.lastSearchedChunk,r=n,i=t>n.end;for(;n;){if(n.contains(t))return this._splitChunk(n,t);if(n=i?this.byStart[n.end]:this.byEnd[n.start],n===r)return;r=n}}_splitChunk(t,n){if(t.edited&&t.content.length){let i=Ls(this.original)(n);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} \u2013 "${t.original}")`)}let r=t.split(n);return this.byEnd[n]=t,this.byStart[n]=r,this.byEnd[r.end]=r,t===this.lastChunk&&(this.lastChunk=r),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,n=this.firstChunk;for(;n;)t+=n.toString(),n=n.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,n=0;do n+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return n}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){let n=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(n,""),this.outro.length)return!0;let r=this.lastChunk;do{let i=r.end,o=r.trimEnd(n);if(r.end!==i&&(this.lastChunk===r&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),o)return!0;r=r.previous}while(r);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),this.intro.length)return!0;let r=this.firstChunk;do{let i=r.end,o=r.trimStart(n);if(r.end!==i&&(r===this.lastChunk&&(this.lastChunk=r.next),this.byEnd[r.end]=r,this.byStart[r.next.start]=r.next,this.byEnd[r.next.end]=r.next),o)return!0;r=r.next}while(r);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(t,n){function r(o,s){return typeof n=="string"?n.replace(/\$(\$|&|\d+)/g,(a,c)=>c==="$"?"$":c==="&"?o[0]:+c<o.length?o[+c]:`$${c}`):n(...o,o.index,s,o.groups)}function i(o,s){let a,c=[];for(;a=o.exec(s);)c.push(a);return c}if(t.global)i(t,this.original).forEach(s=>{if(s.index!=null){let a=r(s,this.original);a!==s[0]&&this.overwrite(s.index,s.index+s[0].length,a)}});else{let o=this.original.match(t);if(o&&o.index!=null){let s=r(o,this.original);s!==o[0]&&this.overwrite(o.index,o.index+o[0].length,s)}}return this}_replaceString(t,n){let{original:r}=this,i=r.indexOf(t);return i!==-1&&this.overwrite(i,i+t.length,n),this}replace(t,n){return typeof t=="string"?this._replaceString(t,n):this._replaceRegexp(t,n)}_replaceAllString(t,n){let{original:r}=this,i=t.length;for(let o=r.indexOf(t);o!==-1;o=r.indexOf(t,o+i))r.slice(o,o+i)!==n&&this.overwrite(o,o+i,n);return this}replaceAll(t,n){if(typeof t=="string")return this._replaceAllString(t,n);if(!t.global)throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(t,n)}},pf=Object.prototype.hasOwnProperty,Ds=class e{constructor(t={}){this.intro=t.intro||"",this.separator=t.separator!==void 0?t.separator:` `,this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(t){if(t instanceof Bn)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!gf(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","ignoreList","indentExclusionRanges","separator"].forEach(n=>{pf.call(t,n)||(t[n]=t.content[n])}),t.separator===void 0&&(t.separator=this.separator),t.filename)if(!pf.call(this.uniqueSourceIndexByFilename,t.filename))this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});else{let n=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==n.content)throw new Error(`Illegal source: same filename (${t.filename}), different contents`)}return this.sources.push(t),this}append(t,n){return this.addSource({content:new Bn(t),separator:n&&n.separator||""}),this}clone(){let t=new e({intro:this.intro,separator:this.separator});return this.sources.forEach(n=>{t.addSource({filename:n.filename,content:n.content.clone(),separator:n.separator})}),t}generateDecodedMap(t={}){let n=[],r;this.sources.forEach(o=>{Object.keys(o.content.storedNames).forEach(s=>{~n.indexOf(s)||n.push(s)})});let i=new wi(t.hires);return this.intro&&i.advance(this.intro),this.sources.forEach((o,s)=>{s>0&&i.advance(this.separator);let a=o.filename?this.uniqueSourceIndexByFilename[o.filename]:-1,c=o.content,l=Ls(c.original);c.intro&&i.advance(c.intro),c.firstChunk.eachNext(u=>{let f=l(u.start);u.intro.length&&i.advance(u.intro),o.filename?u.edited?i.addEdit(a,u.content,f,u.storeName?n.indexOf(u.original):-1):i.addUneditedChunk(a,u,c.original,f,c.sourcemapLocations):i.advance(u.content),u.outro.length&&i.advance(u.outro)}),c.outro&&i.advance(c.outro),o.ignoreList&&a!==-1&&(r===void 0&&(r=[]),r.push(a))}),{file:t.file?t.file.split(/[/\\]/).pop():void 0,sources:this.uniqueSources.map(o=>t.file?mf(t.file,o.filename):o.filename),sourcesContent:this.uniqueSources.map(o=>t.includeContent?o.content:null),names:n,mappings:i.raw,x_google_ignoreList:r}}generateMap(t){return new qn(this.generateDecodedMap(t))}getIndentString(){let t={};return this.sources.forEach(n=>{let r=n.content._getRawIndentString();r!==null&&(t[r]||(t[r]=0),t[r]+=1)}),Object.keys(t).sort((n,r)=>t[n]-t[r])[0]||" "}indent(t){if(arguments.length||(t=this.getIndentString()),t==="")return this;let n=!this.intro||this.intro.slice(-1)===` `;return this.sources.forEach((r,i)=>{let o=r.separator!==void 0?r.separator:this.separator,s=n||i>0&&/\r?\n$/.test(o);r.content.indent(t,{exclude:r.indentExclusionRanges,indentStart:s}),n=r.content.lastChar()===` `}),this.intro&&(this.intro=t+this.intro.replace(/^[^\n]/gm,(r,i)=>i>0?t+r:r)),this}prepend(t){return this.intro=t+this.intro,this}toString(){let t=this.sources.map((n,r)=>{let i=n.separator!==void 0?n.separator:this.separator;return(r>0?i:"")+n.content.toString()}).join("");return this.intro+t}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some(t=>!t.content.isEmpty()))}length(){return this.sources.reduce((t,n)=>t+n.content.length(),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimStart(t){let n=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(n,""),!this.intro){let r,i=0;do if(r=this.sources[i++],!r)break;while(!r.content.trimStartAborted(t))}return this}trimEnd(t){let n=new RegExp((t||"\\s")+"+$"),r,i=this.sources.length-1;do if(r=this.sources[i--],!r){this.intro=this.intro.replace(n,"");break}while(!r.content.trimEndAborted(t));return this}}});var Eh=Ht(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0})});var vh=Ht(xh=>{"use strict";Object.defineProperty(xh,"__esModule",{value:!0});var hx=Symbol("inverted"),dx=Symbol("expectNull"),px=Symbol("expectUndefined"),mx=Symbol("expectNumber"),gx=Symbol("expectString"),yx=Symbol("expectBoolean"),bx=Symbol("expectVoid"),wx=Symbol("expectFunction"),Sx=Symbol("expectObject"),Ex=Symbol("expectArray"),xx=Symbol("expectSymbol"),vx=Symbol("expectAny"),Tx=Symbol("expectUnknown"),_x=Symbol("expectNever"),Cx=Symbol("expectNullable"),Ix=Symbol("expectBigInt")});var _h=Ht(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0})});var Ih=Ht(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var Ax=Symbol("secret"),Px=Symbol("mismatch"),kx=Symbol("avalue")});var Oh=Ht(ye=>{"use strict";var Ww=ye&&ye.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),$i=ye&&ye.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Ww(t,e,n)};Object.defineProperty(ye,"__esModule",{value:!0});ye.expectTypeOf=void 0;$i(Eh(),ye);$i(vh(),ye);$i(_h(),ye);$i(Ih(),ye);var be=()=>!0,Uw=e=>{let t=["parameters","returns","resolves","not","items","constructorParameters","thisParameter","instance","guards","asserts","branded"],n={toBeAny:be,toBeUnknown:be,toBeNever:be,toBeFunction:be,toBeObject:be,toBeArray:be,toBeString:be,toBeNumber:be,toBeBoolean:be,toBeVoid:be,toBeSymbol:be,toBeNull:be,toBeUndefined:be,toBeNullable:be,toBeBigInt:be,toMatchTypeOf:be,toEqualTypeOf:be,toBeConstructibleWith:be,toMatchObjectType:be,toExtend:be,map:ye.expectTypeOf,toBeCallableWith:ye.expectTypeOf,extract:ye.expectTypeOf,exclude:ye.expectTypeOf,pick:ye.expectTypeOf,omit:ye.expectTypeOf,toHaveProperty:ye.expectTypeOf,parameter:ye.expectTypeOf};return t.forEach(i=>Object.defineProperty(n,i,{get:()=>(0,ye.expectTypeOf)({})})),n};ye.expectTypeOf=Uw});var zh={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},Wh=Object.entries(zh);function Ni(e){return String(e)}Ni.open="";Ni.close="";function Ca(e=!1){let t=typeof process!="undefined"?process:void 0,n=(t==null?void 0:t.env)||{},r=(t==null?void 0:t.argv)||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||(t==null?void 0:t.platform)==="win32"||e&&n.TERM!=="dumb"||"CI"in n)||typeof window!="undefined"&&!!window.chrome}function Ia(e=!1){let t=Ca(e),n=(s,a,c,l)=>{let u="",f=0;do u+=s.substring(f,l)+c,f=l+a.length,l=s.indexOf(a,f);while(~l);return u+s.substring(f)},r=(s,a,c=s)=>{let l=u=>{let f=String(u),p=f.indexOf(a,s.length);return~p?s+n(f,a,c,p)+a:s+f+a};return l.open=s,l.close=a,l},i={isColorSupported:t},o=s=>`\x1B[${s}m`;for(let[s,a]of Wh)i[s]=t?r(o(a[0]),o(a[1]),a[2]):Ni;return i}var Oa=require("tty"),Uh=process.env.FORCE_TTY!==void 0||(0,Oa.isatty)(1);var fe=Ia(Uh);function Wa(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(e)}function Jh(e,t){let n=Object.keys(e),r=t===null?n:n.sort(t);if(Object.getOwnPropertySymbols)for(let i of Object.getOwnPropertySymbols(e))Object.getOwnPropertyDescriptor(e,i).enumerable&&r.push(i);return r}function yn(e,t,n,r,i,o,s=": "){let a="",c=0,l=e.next();if(!l.done){a+=t.spacingOuter;let u=n+t.indent;for(;!l.done;){if(a+=u,c++===t.maxWidth){a+="\u2026";break}let f=o(l.value[0],t,u,r,i),p=o(l.value[1],t,u,r,i);a+=f+s+p,l=e.next(),l.done?t.min||(a+=","):a+=`,${t.spacingInner}`}a+=t.spacingOuter+n}return a}function Fi(e,t,n,r,i,o){let s="",a=0,c=e.next();if(!c.done){s+=t.spacingOuter;let l=n+t.indent;for(;!c.done;){if(s+=l,a++===t.maxWidth){s+="\u2026";break}s+=o(c.value,t,l,r,i),c=e.next(),c.done?t.min||(s+=","):s+=`,${t.spacingInner}`}s+=t.spacingOuter+n}return s}function Zn(e,t,n,r,i,o){let s="";e=e instanceof ArrayBuffer?new DataView(e):e;let a=l=>l instanceof DataView,c=a(e)?e.byteLength:e.length;if(c>0){s+=t.spacingOuter;let l=n+t.indent;for(let u=0;u<c;u++){if(s+=l,u===t.maxWidth){s+="\u2026";break}(a(e)||u in e)&&(s+=o(a(e)?e.getInt8(u):e[u],t,l,r,i)),u<c-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}function Li(e,t,n,r,i,o){let s="",a=Jh(e,t.compareKeys);if(a.length>0){s+=t.spacingOuter;let c=n+t.indent;for(let l=0;l<a.length;l++){let u=a[l],f=o(u,t,c,r,i),p=o(e[u],t,c,r,i);s+=`${c+f}: ${p}`,l<a.length-1?s+=`,${t.spacingInner}`:t.min||(s+=",")}s+=t.spacingOuter+n}return s}var Vh=typeof Symbol=="function"&&Symbol.for?Symbol.for("jest.asymmetricMatcher"):1267621,Kn=" ",Xh=(e,t,n,r,i,o)=>{let s=e.toString();if(s==="ArrayContaining"||s==="ArrayNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+Kn}[${Zn(e.sample,t,n,r,i,o)}]`;if(s==="ObjectContaining"||s==="ObjectNotContaining")return++r>t.maxDepth?`[${s}]`:`${s+Kn}{${Li(e.sample,t,n,r,i,o)}}`;if(s==="StringMatching"||s==="StringNotMatching"||s==="StringContaining"||s==="StringNotContaining")return s+Kn+o(e.sample,t,n,r,i);if(typeof e.toAsymmetricMatcher!="function")throw new TypeError(`Asymmetric matcher ${e.constructor.name} does not implement toAsymmetricMatcher()`);return e.toAsymmetricMatcher()},Kh=e=>e&&e.$$typeof===Vh,Gh={serialize:Xh,test:Kh},Yh=" ",Ua=new Set(["DOMStringMap","NamedNodeMap"]),Hh=/^(?:HTML\w*Collection|NodeList)$/;function Zh(e){return Ua.has(e)||Hh.test(e)}var Qh=e=>e&&e.constructor&&!!e.constructor.name&&Zh(e.constructor.name);function ed(e){return e.constructor.name==="NamedNodeMap"}var td=(e,t,n,r,i,o)=>{let s=e.constructor.name;return++r>t.maxDepth?`[${s}]`:(t.min?"":s+Yh)+(Ua.has(s)?`{${Li(ed(e)?[...e].reduce((a,c)=>(a[c.name]=c.value,a),{}):{...e},t,n,r,i,o)}}`:`[${Zn([...e],t,n,r,i,o)}]`)},nd={serialize:td,test:Qh};function Ja(e){return e.replaceAll("<","&lt;").replaceAll(">","&gt;")}function Di(e,t,n,r,i,o,s){let a=r+n.indent,c=n.colors;return e.map(l=>{let u=t[l],f=s(u,n,a,i,o);return typeof u!="string"&&(f.includes(` `)&&(f=n.spacingOuter+a+f+n.spacingOuter+r),f=`{${f}}`),`${n.spacingInner+r+c.prop.open+l+c.prop.close}=${c.value.open}${f}${c.value.close}`}).join("")}function qi(e,t,n,r,i,o){return e.map(s=>t.spacingOuter+n+(typeof s=="string"?Va(s,t):o(s,t,n,r,i))).join("")}function Va(e,t){let n=t.colors.content;return n.open+Ja(e)+n.close}function rd(e,t){let n=t.colors.comment;return`${n.open}<!--${Ja(e)}-->${n.close}`}function Bi(e,t,n,r,i){let o=r.colors.tag;return`${o.open}<${e}${t&&o.close+t+r.spacingOuter+i+o.open}${n?`>${o.close}${n}${r.spacingOuter}${i}${o.open}</${e}`:`${t&&!r.min?"":" "}/`}>${o.close}`}function zi(e,t){let n=t.colors.tag;return`${n.open}<${e}${n.close} \u2026${n.open} />${n.close}`}var id=1,Xa=3,Ka=8,Ga=11,od=/^(?:(?:HTML|SVG)\w*)?Element$/;function sd(e){try{return typeof e.hasAttribute=="function"&&e.hasAttribute("is")}catch{return!1}}function ad(e){let t=e.constructor.name,{nodeType:n,tagName:r}=e,i=typeof r=="string"&&r.includes("-")||sd(e);return n===id&&(od.test(t)||i)||n===Xa&&t==="Text"||n===Ka&&t==="Comment"||n===Ga&&t==="DocumentFragment"}var cd=e=>{var t;return(e==null||(t=e.constructor)===null||t===void 0?void 0:t.name)&&ad(e)};function ld(e){return e.nodeType===Xa}function ud(e){return e.nodeType===Ka}function ji(e){return e.nodeType===Ga}var fd=(e,t,n,r,i,o)=>{if(ld(e))return Va(e.data,t);if(ud(e))return rd(e.data,t);let s=ji(e)?"DocumentFragment":e.tagName.toLowerCase();return++r>t.maxDepth?zi(s,t):Bi(s,Di(ji(e)?[]:Array.from(e.attributes,a=>a.name).sort(),ji(e)?{}:[...e.attributes].reduce((a,c)=>(a[c.name]=c.value,a),{}),t,n+t.indent,r,i,o),qi(Array.prototype.slice.call(e.childNodes||e.children),t,n+t.indent,r,i,o),t,n)},hd={serialize:fd,test:cd},dd="@@__IMMUTABLE_ITERABLE__@@",pd="@@__IMMUTABLE_LIST__@@",md="@@__IMMUTABLE_KEYED__@@",gd="@@__IMMUTABLE_MAP__@@",$a="@@__IMMUTABLE_ORDERED__@@",yd="@@__IMMUTABLE_RECORD__@@",bd="@@__IMMUTABLE_SEQ__@@",wd="@@__IMMUTABLE_SET__@@",Sd="@@__IMMUTABLE_STACK__@@",Qt=e=>`Immutable.${e}`,er=e=>`[${e}]`,gn=" ",Aa="\u2026";function Ed(e,t,n,r,i,o,s){return++r>t.maxDepth?er(Qt(s)):`${Qt(s)+gn}{${yn(e.entries(),t,n,r,i,o)}}`}function xd(e){let t=0;return{next(){if(t<e._keys.length){let n=e._keys[t++];return{done:!1,value:[n,e.get(n)]}}return{done:!0,value:void 0}}}}function vd(e,t,n,r,i,o){let s=Qt(e._name||"Record");return++r>t.maxDepth?er(s):`${s+gn}{${yn(xd(e),t,n,r,i,o)}}`}function Td(e,t,n,r,i,o){let s=Qt("Seq");return++r>t.maxDepth?er(s):e[md]?`${s+gn}{${e._iter||e._object?yn(e.entries(),t,n,r,i,o):Aa}}`:`${s+gn}[${e._iter||e._array||e._collection||e._iterable?Fi(e.values(),t,n,r,i,o):Aa}]`}function Ri(e,t,n,r,i,o,s){return++r>t.maxDepth?er(Qt(s)):`${Qt(s)+gn}[${Fi(e.values(),t,n,r,i,o)}]`}var _d=(e,t,n,r,i,o)=>e[gd]?Ed(e,t,n,r,i,o,e[$a]?"OrderedMap":"Map"):e[pd]?Ri(e,t,n,r,i,o,"List"):e[wd]?Ri(e,t,n,r,i,o,e[$a]?"OrderedSet":"Set"):e[Sd]?Ri(e,t,n,r,i,o,"Stack"):e[bd]?Td(e,t,n,r,i,o):vd(e,t,n,r,i,o),Cd=e=>e&&(e[dd]===!0||e[yd]===!0),Id={serialize:_d,test:Cd};function Ya(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gn={exports:{}},ae={};var Pa;function Od(){if(Pa)return ae;Pa=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function m(d){if(typeof d=="object"&&d!==null){var b=d.$$typeof;switch(b){case e:switch(d=d.type,d){case n:case i:case r:case c:case l:case p:return d;default:switch(d=d&&d.$$typeof,d){case s:case a:case f:case u:return d;case o:return d;default:return b}}case t:return b}}}return ae.ContextConsumer=o,ae.ContextProvider=s,ae.Element=e,ae.ForwardRef=a,ae.Fragment=n,ae.Lazy=f,ae.Memo=u,ae.Portal=t,ae.Profiler=i,ae.StrictMode=r,ae.Suspense=c,ae.SuspenseList=l,ae.isContextConsumer=function(d){return m(d)===o},ae.isContextProvider=function(d){return m(d)===s},ae.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===e},ae.isForwardRef=function(d){return m(d)===a},ae.isFragment=function(d){return m(d)===n},ae.isLazy=function(d){return m(d)===f},ae.isMemo=function(d){return m(d)===u},ae.isPortal=function(d){return m(d)===t},ae.isProfiler=function(d){return m(d)===i},ae.isStrictMode=function(d){return m(d)===r},ae.isSuspense=function(d){return m(d)===c},ae.isSuspenseList=function(d){return m(d)===l},ae.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===n||d===i||d===r||d===c||d===l||typeof d=="object"&&d!==null&&(d.$$typeof===f||d.$$typeof===u||d.$$typeof===s||d.$$typeof===o||d.$$typeof===a||d.$$typeof===h||d.getModuleId!==void 0)},ae.typeOf=m,ae}var ce={};var ka;function $d(){return ka||(ka=1,process.env.NODE_ENV!=="production"&&(function(){function e(d){if(typeof d=="object"&&d!==null){var b=d.$$typeof;switch(b){case t:switch(d=d.type,d){case r:case o:case i:case l:case u:case h:return d;default:switch(d=d&&d.$$typeof,d){case a:case c:case p:case f:return d;case s:return d;default:return b}}case n:return b}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");ce.ContextConsumer=s,ce.ContextProvider=a,ce.Element=t,ce.ForwardRef=c,ce.Fragment=r,ce.Lazy=p,ce.Memo=f,ce.Portal=n,ce.Profiler=o,ce.StrictMode=i,ce.Suspense=l,ce.SuspenseList=u,ce.isContextConsumer=function(d){return e(d)===s},ce.isContextProvider=function(d){return e(d)===a},ce.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===t},ce.isForwardRef=function(d){return e(d)===c},ce.isFragment=function(d){return e(d)===r},ce.isLazy=function(d){return e(d)===p},ce.isMemo=function(d){return e(d)===f},ce.isPortal=function(d){return e(d)===n},ce.isProfiler=function(d){return e(d)===o},ce.isStrictMode=function(d){return e(d)===i},ce.isSuspense=function(d){return e(d)===l},ce.isSuspenseList=function(d){return e(d)===u},ce.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===r||d===o||d===i||d===l||d===u||typeof d=="object"&&d!==null&&(d.$$typeof===p||d.$$typeof===f||d.$$typeof===a||d.$$typeof===s||d.$$typeof===c||d.$$typeof===m||d.getModuleId!==void 0)},ce.typeOf=e})()),ce}var Ma;function Ad(){return Ma||(Ma=1,process.env.NODE_ENV==="production"?Gn.exports=Od():Gn.exports=$d()),Gn.exports}var Ha=Ad(),Pd=Ya(Ha),kd=Wa({__proto__:null,default:Pd},[Ha]),Yn={exports:{}},ie={};var Na;function Md(){if(Na)return ie;Na=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m;m=Symbol.for("react.module.reference");function d(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){case e:switch(b=b.type,b){case n:case i:case r:case l:case u:return b;default:switch(b=b&&b.$$typeof,b){case a:case s:case c:case p:case f:case o:return b;default:return S}}case t:return S}}}return ie.ContextConsumer=s,ie.ContextProvider=o,ie.Element=e,ie.ForwardRef=c,ie.Fragment=n,ie.Lazy=p,ie.Memo=f,ie.Portal=t,ie.Profiler=i,ie.StrictMode=r,ie.Suspense=l,ie.SuspenseList=u,ie.isAsyncMode=function(){return!1},ie.isConcurrentMode=function(){return!1},ie.isContextConsumer=function(b){return d(b)===s},ie.isContextProvider=function(b){return d(b)===o},ie.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},ie.isForwardRef=function(b){return d(b)===c},ie.isFragment=function(b){return d(b)===n},ie.isLazy=function(b){return d(b)===p},ie.isMemo=function(b){return d(b)===f},ie.isPortal=function(b){return d(b)===t},ie.isProfiler=function(b){return d(b)===i},ie.isStrictMode=function(b){return d(b)===r},ie.isSuspense=function(b){return d(b)===l},ie.isSuspenseList=function(b){return d(b)===u},ie.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===l||b===u||b===h||typeof b=="object"&&b!==null&&(b.$$typeof===p||b.$$typeof===f||b.$$typeof===o||b.$$typeof===s||b.$$typeof===c||b.$$typeof===m||b.getModuleId!==void 0)},ie.typeOf=d,ie}var oe={};var ja;function Nd(){return ja||(ja=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=!1,d=!1,b=!1,S=!1,T=!1,I;I=Symbol.for("react.module.reference");function $(q){return!!(typeof q=="string"||typeof q=="function"||q===n||q===i||T||q===r||q===l||q===u||S||q===h||m||d||b||typeof q=="object"&&q!==null&&(q.$$typeof===p||q.$$typeof===f||q.$$typeof===o||q.$$typeof===s||q.$$typeof===c||q.$$typeof===I||q.getModuleId!==void 0))}function A(q){if(typeof q=="object"&&q!==null){var x=q.$$typeof;switch(x){case e:var C=q.type;switch(C){case n:case i:case r:case l:case u:return C;default:var k=C&&C.$$typeof;switch(k){case a:case s:case c:case p:case f:case o:return k;default:return x}}case t:return x}}}var j=s,P=o,O=e,M=c,U=n,_=p,z=f,re=t,V=i,Y=r,N=l,K=u,F=!1,ue=!1;function Ee(q){return F||(F=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function We(q){return ue||(ue=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Ce(q){return A(q)===s}function Ae(q){return A(q)===o}function He(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function Le(q){return A(q)===c}function Pe(q){return A(q)===n}function ke(q){return A(q)===p}function wt(q){return A(q)===f}function Ve(q){return A(q)===t}function Nt(q){return A(q)===i}function xe(q){return A(q)===r}function Ze(q){return A(q)===l}function Vn(q){return A(q)===u}oe.ContextConsumer=j,oe.ContextProvider=P,oe.Element=O,oe.ForwardRef=M,oe.Fragment=U,oe.Lazy=_,oe.Memo=z,oe.Portal=re,oe.Profiler=V,oe.StrictMode=Y,oe.Suspense=N,oe.SuspenseList=K,oe.isAsyncMode=Ee,oe.isConcurrentMode=We,oe.isContextConsumer=Ce,oe.isContextProvider=Ae,oe.isElement=He,oe.isForwardRef=Le,oe.isFragment=Pe,oe.isLazy=ke,oe.isMemo=wt,oe.isPortal=Ve,oe.isProfiler=Nt,oe.isStrictMode=xe,oe.isSuspense=Ze,oe.isSuspenseList=Vn,oe.isValidElementType=$,oe.typeOf=A})()),oe}var Ra;function jd(){return Ra||(Ra=1,process.env.NODE_ENV==="production"?Yn.exports=Md():Yn.exports=Nd()),Yn.exports}var Za=jd(),Rd=Ya(Za),Fd=Wa({__proto__:null,default:Rd},[Za]),Ld=["isAsyncMode","isConcurrentMode","isContextConsumer","isContextProvider","isElement","isForwardRef","isFragment","isLazy","isMemo","isPortal","isProfiler","isStrictMode","isSuspense","isSuspenseList","isValidElementType"],jt=Object.fromEntries(Ld.map(e=>[e,t=>Fd[e](t)||kd[e](t)]));function Qa(e,t=[]){if(Array.isArray(e))for(let n of e)Qa(n,t);else e!=null&&e!==!1&&e!==""&&t.push(e);return t}function Fa(e){let t=e.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Unknown";if(jt.isFragment(e))return"React.Fragment";if(jt.isSuspense(e))return"React.Suspense";if(typeof t=="object"&&t!==null){if(jt.isContextProvider(e))return"Context.Provider";if(jt.isContextConsumer(e))return"Context.Consumer";if(jt.isForwardRef(e)){if(t.displayName)return t.displayName;let n=t.render.displayName||t.render.name||"";return n===""?"ForwardRef":`ForwardRef(${n})`}if(jt.isMemo(e)){let n=t.displayName||t.type.displayName||t.type.name||"";return n===""?"Memo":`Memo(${n})`}}return"UNDEFINED"}function Dd(e){let{props:t}=e;return Object.keys(t).filter(n=>n!=="children"&&t[n]!==void 0).sort()}var qd=(e,t,n,r,i,o)=>++r>t.maxDepth?zi(Fa(e),t):Bi(Fa(e),Di(Dd(e),e.props,t,n+t.indent,r,i,o),qi(Qa(e.props.children),t,n+t.indent,r,i,o),t,n),Bd=e=>e!=null&&jt.isElement(e),zd={serialize:qd,test:Bd},Wd=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.test.json"):245830487;function Ud(e){let{props:t}=e;return t?Object.keys(t).filter(n=>t[n]!==void 0).sort():[]}var Jd=(e,t,n,r,i,o)=>++r>t.maxDepth?zi(e.type,t):Bi(e.type,e.props?Di(Ud(e),e.props,t,n+t.indent,r,i,o):"",e.children?qi(e.children,t,n+t.indent,r,i,o):"",t,n),Vd=e=>e&&e.$$typeof===Wd,Xd={serialize:Jd,test:Vd},ec=Object.prototype.toString,Kd=Date.prototype.toISOString,Gd=Error.prototype.toString,La=RegExp.prototype.toString;function Hn(e){return typeof e.constructor=="function"&&e.constructor.name||"Object"}function Yd(e){return typeof window!="undefined"&&e===window}var Hd=/^Symbol\((.*)\)(.*)$/,Zd=/\n/g,Qn=class extends Error{constructor(t,n){super(t),this.stack=n,this.name=this.constructor.name}};function Qd(e){return e==="[object Array]"||e==="[object ArrayBuffer]"||e==="[object DataView]"||e==="[object Float32Array]"||e==="[object Float64Array]"||e==="[object Int8Array]"||e==="[object Int16Array]"||e==="[object Int32Array]"||e==="[object Uint8Array]"||e==="[object Uint8ClampedArray]"||e==="[object Uint16Array]"||e==="[object Uint32Array]"}function ep(e){return Object.is(e,-0)?"-0":String(e)}function tp(e){return`${e}n`}function Da(e,t){return t?`[Function ${e.name||"anonymous"}]`:"[Function]"}function qa(e){return String(e).replace(Hd,"Symbol($1)")}function Ba(e){return`[${Gd.call(e)}]`}function tc(e,t,n,r){if(e===!0||e===!1)return`${e}`;if(e===void 0)return"undefined";if(e===null)return"null";let i=typeof e;if(i==="number")return ep(e);if(i==="bigint")return tp(e);if(i==="string")return r?`"${e.replaceAll(/"|\\/g,"\\$&")}"`:`"${e}"`;if(i==="function")return Da(e,t);if(i==="symbol")return qa(e);let o=ec.call(e);return o==="[object WeakMap]"?"WeakMap {}":o==="[object WeakSet]"?"WeakSet {}":o==="[object Function]"||o==="[object GeneratorFunction]"?Da(e,t):o==="[object Symbol]"?qa(e):o==="[object Date]"?Number.isNaN(+e)?"Date { NaN }":Kd.call(e):o==="[object Error]"?Ba(e):o==="[object RegExp]"?n?La.call(e).replaceAll(/[$()*+.?[\\\]^{|}]/g,"\\$&"