var Ru=Object.defineProperty;var yt=(t,e)=>{for(var r in e)Ru(t,r,{get:e[r],enumerable:!0})};var Su={};yt(Su,{__debug:()=>$i,check:()=>Vi,doc:()=>ar,format:()=>Pu,formatWithCursor:()=>Ou,getSupportInfo:()=>Wi,util:()=>fr,version:()=>gu});var X=(t,e)=>(r,n,...u)=>r|1&&n==null?void 0:(e.call(n)??n[t]).apply(n,u);var vu=String.prototype.replaceAll??function(t,e){return t.global?this.replace(t,e):this.split(t).join(e)},Lu=X("replaceAll",function(){if(typeof this=="string")return vu}),ne=Lu;var Ne=class{diff(e,r,n={}){let u;typeof n=="function"?(u=n,n={}):"callback"in n&&(u=n.callback);let o=this.castInput(e,n),i=this.castInput(r,n),D=this.removeEmpty(this.tokenize(o,n)),s=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(D,s,n,u)}diffWithOptionsObj(e,r,n,u){var o;let i=C=>{if(C=this.postProcess(C,n),u){setTimeout(function(){u(C)},0);return}else return C},D=r.length,s=e.length,a=1,c=D+s;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let p=(o=n.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,e,0,n);if(m[0].oldPos+1>=s&&f+1>=D)return i(this.buildValues(m[0].lastComponent,r,e));let F=-1/0,d=1/0,E=()=>{for(let C=Math.max(F,-a);C<=Math.min(d,a);C+=2){let h,_=m[C-1],P=m[C+1];_&&(m[C-1]=void 0);let A=!1;if(P){let J=P.oldPos-C;A=P&&0<=J&&J=s&&f+1>=D)return i(this.buildValues(h.lastComponent,r,e))||!0;m[C]=h,h.oldPos+1>=s&&(d=Math.min(d,C-1)),f+1>=D&&(F=Math.max(F,C+1))}a++};if(u)(function C(){setTimeout(function(){if(a>c||Date.now()>l)return u(void 0);E()||C()},0)})();else for(;a<=c&&Date.now()<=l;){let C=E();if(C)return C}}addToPath(e,r,n,u,o){let i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:e.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(e,r,n,u,o){let i=r.length,D=n.length,s=e.oldPos,a=s-u,c=0;for(;a+1l.length?f:l}),c.value=this.join(p)}else c.value=this.join(r.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}return u}};var At=class extends Ne{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}},pr=new At;function xt(t,e,r){return pr.diff(t,e,r)}var Mu=()=>{},k=Mu;var dr="cr",Fr="crlf",Yu="lf",ju=Yu,Bt="\r",Er=`\r `,ze=` `,Uu=ze;function Cr(t){let e=t.indexOf(Bt);return e!==-1?t.charAt(e+1)===ze?Fr:dr:ju}function we(t){return t===dr?Bt:t===Fr?Er:Uu}var Vu=new Map([[ze,/\n/g],[Bt,/\r/g],[Er,/\r\n/g]]);function Tt(t,e){let r=Vu.get(e);return t.match(r)?.length??0}var Wu=/\r\n?/g;function hr(t){return ne(0,t,Wu,ze)}var ue=Symbol.for("comments");function $u(t){return this[t<0?this.length+t:t]}var zu=X("at",function(){if(Array.isArray(this)||typeof this=="string")return $u}),y=zu;var G="string",U="array",V="cursor",I="indent",R="align",v="trim",x="group",S="fill",T="if-break",L="indent-if-break",M="line-suffix",Y="line-suffix-boundary",g="line",b="label",N="break-parent",Ge=new Set([V,I,R,v,x,S,T,L,M,Y,g,b,N]);function gr(t){let e=t.length;for(;e>0&&(t[e-1]==="\r"||t[e-1]===` `);)e--;return enew Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Hu(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(q(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=Ku([...Ge].map(u=>`'${u}'`));return`Unexpected doc.type '${t.type}'. Expected it to be ${n}.`}var Nt=class extends Error{name="InvalidDocError";constructor(e){super(Hu(e)),this.doc=e}},Z=Nt;var _r={};function Ju(t,e,r,n){let u=[t];for(;u.length>0;){let o=u.pop();if(o===_r){r(u.pop());continue}r&&u.push(o,_r);let i=q(o);if(!i)throw new Z(o);if(e?.(o)!==!1)switch(i){case U:case S:{let D=i===U?o:o.parts;for(let s=D.length,a=s-1;a>=0;--a)u.push(D[a]);break}case T:u.push(o.flatContents,o.breakContents);break;case x:if(n&&o.expandedStates)for(let D=o.expandedStates.length,s=D-1;s>=0;--s)u.push(o.expandedStates[s]);else u.push(o.contents);break;case R:case I:case L:case b:case M:u.push(o.contents);break;case G:case V:case v:case Y:case g:case N:break;default:throw new Z(o)}}}var Oe=Ju;function Se(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(o){return Fe(r,o,u)}function u(o){switch(q(o)){case U:return e(o.map(n));case S:return e({...o,parts:o.parts.map(n)});case T:return e({...o,breakContents:n(o.breakContents),flatContents:n(o.flatContents)});case x:{let{expandedStates:i,contents:D}=o;return i?(i=i.map(n),D=i[0]):D=n(D),e({...o,contents:D,expandedStates:i})}case R:case I:case L:case b:case M:return e({...o,contents:n(o.contents)});case G:case V:case v:case Y:case g:case N:return e(o);default:throw new Z(o)}}}function Ke(t,e,r){let n=r,u=!1;function o(i){if(u)return!1;let D=e(i);D!==void 0&&(u=!0,n=D)}return Oe(t,o),n}function qu(t){if(t.type===x&&t.break||t.type===g&&t.hard||t.type===N)return!0}function xr(t){return Ke(t,qu,!1)}function yr(t){if(t.length>0){let e=y(0,t,-1);!e.expandedStates&&!e.break&&(e.break="propagated")}return null}function Br(t){let e=new Set,r=[];function n(o){if(o.type===N&&yr(r),o.type===x){if(r.push(o),e.has(o))return!1;e.add(o)}}function u(o){o.type===x&&r.pop().break&&yr(r)}Oe(t,n,u,!0)}function Xu(t){return t.type===g&&!t.hard?t.soft?"":" ":t.type===T?t.flatContents:t}function Tr(t){return Se(t,Xu)}function Ar(t){for(t=[...t];t.length>=2&&y(0,t,-2).type===g&&y(0,t,-1).type===N;)t.length-=2;if(t.length>0){let e=Pe(y(0,t,-1));t[t.length-1]=e}return t}function Pe(t){switch(q(t)){case I:case L:case x:case M:case b:{let e=Pe(t.contents);return{...t,contents:e}}case T:return{...t,breakContents:Pe(t.breakContents),flatContents:Pe(t.flatContents)};case S:return{...t,parts:Ar(t.parts)};case U:return Ar(t);case G:return gr(t);case R:case V:case v:case Y:case g:case N:break;default:throw new Z(t)}return t}function He(t){return Pe(Zu(t))}function Qu(t){switch(q(t)){case S:{let{parts:e}=t;if(e.every(r=>r===""))return"";if(e.length===1)return e[0];break}case x:if(!t.contents&&!t.id&&!t.break&&!t.expandedStates)return"";if(t.contents.type===x&&t.contents.id===t.id&&t.contents.break===t.break&&t.contents.expandedStates===t.expandedStates)return t.contents;break;case R:case I:case L:case M:if(!t.contents)return"";break;case T:if(!t.flatContents&&!t.breakContents)return"";break;case U:{let e=[];for(let r of t){if(!r)continue;let[n,...u]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof y(0,e,-1)=="string"?e[e.length-1]+=n:e.push(n),e.push(...u)}return e.length===0?"":e.length===1?e[0]:e}case G:case V:case v:case Y:case g:case b:case N:break;default:throw new Z(t)}return t}function Zu(t){return Se(t,e=>Qu(e))}function Nr(t,e=Je){return Se(t,r=>typeof r=="string"?be(e,r.split(` `)):r)}function eo(t){if(t.type===g)return!0}function wr(t){return Ke(t,eo,!1)}function Ee(t,e){return t.type===b?{...t,contents:e(t.contents)}:e(t)}var w=k,qe=k,Or=k,Pr=k;function oe(t){return w(t),{type:I,contents:t}}function De(t,e){return Pr(t),w(e),{type:R,contents:e,n:t}}function Sr(t){return De(Number.NEGATIVE_INFINITY,t)}function Xe(t){return De({type:"root"},t)}function br(t){return De(-1,t)}function Qe(t,e,r){w(t);let n=t;if(e>0){for(let u=0;u0?`, { ${s.join(", ")} }`:"";return`indentIfBreak(${n(o.contents)}${a})`}if(o.type===x){let s=[];o.break&&o.break!=="propagated"&&s.push("shouldBreak: true"),o.id&&s.push(`id: ${u(o.id)}`);let a=s.length>0?`, { ${s.join(", ")} }`:"";return o.expandedStates?`conditionalGroup([${o.expandedStates.map(c=>n(c)).join(",")}]${a})`:`group(${n(o.contents)}${a})`}if(o.type===S)return`fill([${o.parts.map(s=>n(s)).join(", ")}])`;if(o.type===M)return"lineSuffix("+n(o.contents)+")";if(o.type===Y)return"lineSuffixBoundary";if(o.type===b)return`label(${JSON.stringify(o.label)}, ${n(o.contents)})`;if(o.type===V)return"cursor";throw new Error("Unknown doc type "+o.type)}function u(o){if(typeof o!="symbol")return JSON.stringify(String(o));if(o in e)return e[o];let i=o.description||"symbol";for(let D=0;;D++){let s=i+(D>0?` #${D}`:"");if(!r.has(s))return r.add(s),e[o]=`Symbol.for(${JSON.stringify(s)})`}}}var Vr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;var Wr=12288,$r=65510,zr=[12288,12288,65281,65376,65504,65510];var Gr=4352,Kr=262141,Pt=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var St=(t,e)=>{let r=0,n=Math.floor(t.length/2)-1;for(;r<=n;){let u=Math.floor((r+n)/2),o=u*2;if(et[o+1])r=u+1;else return!0}return!1};var Hr=19968,[to,ro]=no(Pt);function no(t){let e=t[0],r=t[1];for(let n=0;n=u&&Hr<=o)return[u,o];o-u>r-e&&(e=u,r=o)}return[e,r]}var bt=t=>t$r?!1:St(zr,t);var kt=t=>t>=to&&t<=ro?!0:tKr?!1:St(Pt,t);var uo=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u2764\u27A1\u2934\u2935\u2B05-\u2B07]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF3\uDFF5\uDFF7]|\uD83D[\uDC3F\uDC41\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])$/,Jr=t=>uo.test(t);var oo=/[^\x20-\x7F]/;function io(t){if(!t)return 0;if(!oo.test(t))return t.length;let e=0;t=t.replace(Vr(),r=>(e+=Jr(r)?1:2,""));for(let r of t){let n=r.codePointAt(0);n<=31||n>=127&&n<=159||n>=768&&n<=879||n>=65024&&n<=65039||(e+=bt(n)||kt(n)?2:1)}return e}var Re=io;var so={type:0},Do={type:1},It={value:"",length:0,queue:[],get root(){return It}};function qr(t,e,r){let n=e.type===1?t.queue.slice(0,-1):[...t.queue,e],u="",o=0,i=0,D=0;for(let f of n)switch(f.type){case 0:c(),r.useTabs?s(1):a(r.tabWidth);break;case 3:{let{string:F}=f;c(),u+=F,o+=F.length;break}case 2:{let{width:F}=f;i+=1,D+=F;break}default:throw new Error(`Unexpected indent comment '${f.type}'.`)}return l(),{...t,value:u,length:o,queue:n};function s(f){u+=" ".repeat(f),o+=r.tabWidth*f}function a(f){u+=" ".repeat(f),o+=f}function c(){r.useTabs?p():l()}function p(){i>0&&s(i),m()}function l(){D>0&&a(D),m()}function m(){i=0,D=0}}function Xr(t,e,r){if(!e)return t;if(e.type==="root")return{...t,root:t};if(e===Number.NEGATIVE_INFINITY)return t.root;let n;return typeof e=="number"?e<0?n=Do:n={type:2,width:e}:n={type:3,string:e},qr(t,n,r)}function Qr(t,e){return qr(t,so,e)}function ao(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];if(n===" "||n===" ")e++;else break}return e}function et(t){let e=ao(t);return{text:e===0?t:t.slice(0,t.length-e),count:e}}var Rt=class{#t=[];#e="";#n=0;#u=[];#r=[];#o(){let e=this.#e;e!==""&&(this.#t.push(e),this.#n+=e.length,this.#e="");for(let r of this.#r)this.#u.push(Math.min(r,this.#n));this.#r.length=0}markPosition(){if(this.#u.length+this.#r.length>=2)throw new Error("There are too many 'cursor' in doc.");this.#r.push(this.#n+this.#e.length)}write(e){this.#e+=e}trim(){let{text:e,count:r}=et(this.#e);return this.#e=e,this.#o(),r}finish(){return this.#o(),{text:this.#t.join(""),positions:this.#u}}},Zr=Rt;var K=Symbol("MODE_BREAK"),Q=Symbol("MODE_FLAT"),vt=Symbol("DOC_FILL_PRINTED_LENGTH");function tt(t,e,r,n,u,o){if(r===Number.POSITIVE_INFINITY)return!0;let i=e.length,D=!1,s=[t],a="";for(;r>=0;){if(s.length===0){if(i===0)return!0;s.push(e[--i]);continue}let{mode:c,doc:p}=s.pop(),l=q(p);switch(l){case G:p&&(D&&(a+=" ",r-=1,D=!1),a+=p,r-=Re(p));break;case U:case S:{let m=l===U?p:p.parts,f=p[vt]??0;for(let F=m.length-1;F>=f;F--)s.push({mode:c,doc:m[F]});break}case I:case R:case L:case b:s.push({mode:c,doc:p.contents});break;case v:{let{text:m,count:f}=et(a);a=m,r+=f;break}case x:{if(o&&p.break)return!1;let m=p.break?K:c,f=p.expandedStates&&m===K?y(0,p.expandedStates,-1):p.contents;s.push({mode:m,doc:f});break}case T:{let f=(p.groupId?u[p.groupId]||Q:c)===K?p.breakContents:p.flatContents;f&&s.push({mode:c,doc:f});break}case g:if(c===K||p.hard)return!0;p.soft||(D=!0);break;case M:n=!0;break;case Y:if(n)return!1;break}}return!1}function Ce(t,e){let r=Object.create(null),n=e.printWidth,u=we(e.endOfLine),o=0,i=[{indent:It,mode:K,doc:t}],D=!1,s=[],a=new Zr;for(Br(t);i.length>0;){let{indent:f,mode:F,doc:d}=i.pop();switch(q(d)){case G:{let E=u!==` `?ne(0,d,` `,u):d;E&&(a.write(E),i.length>0&&(o+=Re(E)));break}case U:for(let E=d.length-1;E>=0;E--)i.push({indent:f,mode:F,doc:d[E]});break;case V:a.markPosition();break;case I:i.push({indent:Qr(f,e),mode:F,doc:d.contents});break;case R:i.push({indent:Xr(f,d.n,e),mode:F,doc:d.contents});break;case v:o-=a.trim();break;case x:{let E=(function(){if(F===Q&&!D)return{indent:f,mode:d.break?K:Q,doc:d.contents};D=!1;let h=n-o,_=s.length>0,P={indent:f,mode:Q,doc:d.contents};if(!d.break&&tt(P,i,h,_,r))return P;if(!d.expandedStates)return{indent:f,mode:K,doc:d.contents};if(!d.break)for(let A=1;A0,r,!0);if(_===1){$e?i.push(B):i.push(J);break}let lr={indent:f,mode:Q,doc:A},_t={indent:f,mode:K,doc:A};if(_===2){$e?i.push(lr,B):i.push(_t,J);break}let bu=h[C+2],ku={indent:f,mode:F,doc:{...d,[vt]:C+2}},Iu=tt({indent:f,mode:Q,doc:[P,A,bu]},[],E,s.length>0,r,!0);i.push(ku),Iu?i.push(lr,B):$e?i.push(_t,B):i.push(_t,J);break}case T:case L:{let E=d.groupId?r[d.groupId]:F;if(E===K){let C=d.type===T?d.breakContents:d.negate?d.contents:oe(d.contents);C&&i.push({indent:f,mode:F,doc:C})}if(E===Q){let C=d.type===T?d.flatContents:d.negate?oe(d.contents):d.contents;C&&i.push({indent:f,mode:F,doc:C})}break}case M:s.push({indent:f,mode:F,doc:d.contents});break;case Y:s.length>0&&i.push({indent:f,mode:F,doc:ke});break;case g:switch(F){case Q:if(!d.hard){d.soft||(a.write(" "),o+=1);break}D=!0;case K:if(s.length>0){i.push({indent:f,mode:F,doc:d},...s.reverse()),s.length=0;break}d.literal?(a.write(u),o=0,f.root&&(f.root.value&&a.write(f.root.value),o=f.root.length)):(a.trim(),a.write(u+f.value),o=f.length);break}break;case b:i.push({indent:f,mode:F,doc:d.contents});break;case N:break;default:throw new Z(d)}i.length===0&&s.length>0&&(i.push(...s.reverse()),s.length=0)}let{text:c,positions:p}=a.finish();if(p.length!==2)return{formatted:c};let[l,m]=p;return{formatted:c,cursorNodeStart:l,cursorNodeText:c.slice(l,m)}}function co(t,e,r=0){let n=0;for(let u=r;u1?y(0,e,-2):null}getValue(){return y(0,this.stack,-1)}getNode(e=0){let r=this.#t(e);return r===-1?null:this.stack[r]}getParentNode(e=0){return this.getNode(e+1)}#t(e){let{stack:r}=this;for(let n=r.length-1;n>=0;n-=2)if(!Array.isArray(r[n])&&--e<0)return n;return-1}call(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o?.[i],n.push(i,o);try{return e(this)}finally{n.length=u}}callParent(e,r=0){let n=this.#t(r+1),u=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...u)}}each(e,...r){let{stack:n}=this,{length:u}=n,o=y(0,n,-1);for(let i of r)o=o[i],n.push(i,o);try{for(let i=0;i{n[o]=e(u,o,i)},...r),n}match(...e){let r=this.stack.length-1,n=null,u=this.stack[r--];for(let o of e){if(u===void 0)return!1;let i=null;if(typeof n=="number"&&(i=n,n=this.stack[r--],u=this.stack[r--]),o&&!o(u,n,i))return!1;n=this.stack[r--],u=this.stack[r--]}return!0}findAncestor(e){for(let r of this.#e())if(e(r))return r}hasAncestor(e){for(let r of this.#e())if(e(r))return!0;return!1}*#e(){let{stack:e}=this;for(let r=e.length-3;r>=0;r-=2){let n=e[r];Array.isArray(n)||(yield n)}}},en=Lt;function fo(t){return Array.isArray(t)&&t.length>0}var rt=fo;function lo(t){return t!==null&&typeof t=="object"}var ge=lo;function _e(t){return(e,r,n)=>{if(r===!1)return!1;let u=!!n?.backwards,{length:o}=e,i=r;for(;i>=0&&it===` `||t==="\r"||t==="\u2028"||t==="\u2029";function po(t,e,r){if(e===!1)return!1;let n=!!r?.backwards,u=t.charAt(e);if(n){if(t.charAt(e-1)==="\r"&&u===` `)return e-2;if(rn(u))return e-1}else{if(u==="\r"&&t.charAt(e+1)===` `)return e+2;if(rn(u))return e+1}return e}var $=po;function mo(t,e,r={}){let n=j(t,r.backwards?e-1:e,r),u=$(t,n,r);return n!==u}var H=mo;function*ye(t,e){let{getVisitorKeys:r,filter:n=()=>!0}=e,u=o=>ge(o)&&n(o);for(let o of r(t)){let i=t[o];if(Array.isArray(i))for(let D of i)u(D)&&(yield D);else u(i)&&(yield i)}}function*nn(t,e){let r=[t];for(let n=0;n(u??(u=[t,...e]),n(s,u)?[s]:on(s,u,r))),{locStart:i,locEnd:D}=r;return o.sort((s,a)=>i(s)-i(a)||D(s)-D(a)),o}function on(t,e,r){return Fe(r.cache,t,n=>Fo(n,e,r))}var ot=on;function Eo(t){let e=t.type||t.kind||"(unknown type)",r=String(t.name||t.id&&(typeof t.id=="object"?t.id.name:t.id)||t.key&&(typeof t.key=="object"?t.key.name:t.key)||t.value&&(typeof t.value=="object"?"":String(t.value))||t.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),e+(r?" "+r:"")}function Mt(t,e){(t.comments??(t.comments=[])).push(e),e.printed=!1,e.nodeDescription=Eo(t)}function ce(t,e){e.leading=!0,e.trailing=!1,Mt(t,e)}function re(t,e,r){e.leading=!1,e.trailing=!1,r&&(e.marker=r),Mt(t,e)}function fe(t,e){e.leading=!1,e.trailing=!0,Mt(t,e)}var Ut=new WeakMap;function Dn(t,e,r,n,u=[]){let{locStart:o,locEnd:i}=r,D=o(e),s=i(e),a=ot(t,u,{cache:Ut,locStart:o,locEnd:i,getVisitorKeys:r.getVisitorKeys,filter:r.printer.canAttachComment,getChildren:r.printer.getCommentChildNodes}),c,p,l=0,m=a.length;for(;l>1,F=a[f],d=o(F),E=i(F);if(d<=D&&s<=E)return Dn(F,e,r,F,[F,...u]);if(E<=D){c=F,l=f+1;continue}if(s<=d){p=F,m=f;continue}throw new Error("Comment location overlaps with node location")}if(n?.type==="TemplateLiteral"){let{quasis:f}=n,F=jt(f,e,r);c&&jt(f,c,r)!==F&&(c=null),p&&jt(f,p,r)!==F&&(p=null)}return{enclosingNode:n,precedingNode:c,followingNode:p}}var Yt=()=>!1;function an(t,e){let{comments:r}=t;if(delete t.comments,!rt(r)||!e.printer.canAttachComment)return;let n=[],{printer:{features:{experimental_avoidAstMutation:u},handleComments:o={}},originalText:i}=e,{ownLine:D=Yt,endOfLine:s=Yt,remaining:a=Yt}=o,c=r.map((l,m)=>({...Dn(t,l,e),comment:l,text:i,options:e,ast:t,isLastComment:r.length-1===m,placement:void 0})),p=!u;for(let[l,m]of c.entries()){let{comment:f,precedingNode:F,enclosingNode:d,followingNode:E,text:C,options:h,ast:_,isLastComment:P}=m,A=Co(C,h,c,l)?"ownLine":ho(C,h,c,l)?"endOfLine":"remaining",B;if(u?(m.placement=A,B=[m]):B=[f,C,h,_,P],p&&(f.placement=A,f.enclosingNode=d,f.precedingNode=F,f.followingNode=E),A==="ownLine")D(...B)||(E?ce(E,f):F?fe(F,f):d?re(d,f):re(_,f));else if(A==="endOfLine")s(...B)||(F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f));else if(!a(...B))if(F&&E){let J=n.length;J>0&&n[J-1].followingNode!==E&&sn(n,h),n.push(m)}else F?fe(F,f):E?ce(E,f):d?re(d,f):re(_,f)}if(sn(n,e),p)for(let l of r)delete l.precedingNode,delete l.enclosingNode,delete l.followingNode,delete l.placement}var cn=t=>!/[\S\n\u2028\u2029]/.test(t);function Co(t,e,r,n){let{comment:u,precedingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=i(u);if(o)for(let a=n-1;a>=0;a--){let{comment:c,precedingNode:p}=r[a];if(p!==o||!cn(t.slice(D(c),s)))break;s=i(c)}return H(t,s,{backwards:!0})}function ho(t,e,r,n){let{comment:u,followingNode:o}=r[n],{locStart:i,locEnd:D}=e,s=D(u);if(o)for(let a=n+1;a0;--i){let{comment:D,precedingNode:s,followingNode:a}=t[i-1];k(s,n),k(a,u);let c=e.originalText.slice(e.locEnd(D),o);if(e.printer.isGap?.(c,e)??/^[\s(]*$/.test(c))o=e.locStart(D);else break}for(let[D,{comment:s}]of t.entries())D1&&D.comments.sort((s,a)=>e.locStart(s)-e.locStart(a));t.length=0}function jt(t,e,r){let n=r.locStart(e)-1;for(let u=1;u!0;function ln(t,e){let r=t.node;return r.printed=!0,e.printer.printComment(t,e)}function _o(t,e){let r=t.node,n=[ln(t,e)],{printer:u,originalText:o,locStart:i,locEnd:D}=e;if(u.isBlockComment?.(r)){let c=" ";H(o,D(r))&&(H(o,i(r),{backwards:!0})?c=W:c=Ze),n.push(c)}else n.push(W);let a=$(o,j(o,D(r)));return a!==!1&&H(o,a)&&n.push(W),n}function yo(t,e,r){let n=t.node,u=ln(t,e),{printer:o,originalText:i,locStart:D}=e,s=o.isBlockComment?.(n);if(r?.hasLineSuffix&&!r?.isBlock||H(i,D(n),{backwards:!0})){let a=ve(i,D(n));return{doc:Ie([W,a?W:"",u]),isBlock:s,hasLineSuffix:!0}}return!s||r?.hasLineSuffix?{doc:[Ie([" ",u]),ae],isBlock:s,hasLineSuffix:!0}:{doc:[" ",u],isBlock:s,hasLineSuffix:!1}}function Ao(t,e,r){let n=e[Symbol.for("printedComments")],u=r?.filter??fn,o=new Set(t.node?.comments?.filter(i=>!n?.has(i)&&i.leading&&u(i)));return o.size===0?"":t.map(({node:i})=>o.has(i)?_o(t,e):"","comments").filter(Boolean)}function xo(t,e,r){let n=t.node?.comments,u=new Set(n?.filter(c=>c.trailing)),o=e[Symbol.for("printedComments")],i=r?.filter??fn,D=new Set(n?.filter(c=>u.has(c)&&!o?.has(c)&&i(c)));if(D.size===0)return"";let s=[],a;return t.each(({node:c})=>{u.has(c)&&(a=yo(t,e,a),D.has(c)&&s.push(a.doc))},"comments"),s}function pn(t,e,r,n){let u=Ao(t,r,n),o=xo(t,r,n);return u||o?Ee(e,i=>[u,i,o]):e}function mn(t){let{[ue]:e,[Symbol.for("printedComments")]:r}=t;for(let n of e){if(!n.printed&&!r.has(n))throw new Error('Comment "'+n.value.trim()+'" was not printed. Please report this error!');delete n.printed}}var dn=()=>k;var Le=class extends Error{name="ConfigError"},Me=class extends Error{name="UndefinedParserError"};var Bo=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),le=Bo;var Fn={checkIgnorePragma:{category:"Special",type:"boolean",default:!1,description:"Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.",cliCategory:"Other"},cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing (mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:t=>typeof t=="string"||typeof t=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"},{value:"mjml",description:"MJML"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:t=>typeof t=="string"||typeof t=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:"Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.",cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function it({plugins:t=[],showDeprecated:e=!1}={}){let r=t.flatMap(u=>u.languages??[]),n=[];for(let u of No(Object.assign({},...t.map(({options:o})=>o),Fn)))!e&&u.deprecated||(Array.isArray(u.choices)&&(e||(u.choices=u.choices.filter(o=>!o.deprecated)),u.name==="parser"&&(u.choices=[...u.choices,...To(u.choices,r,t)])),u.pluginDefaults=Object.fromEntries(t.filter(o=>o.defaultOptions?.[u.name]!==void 0).map(o=>[o.name,o.defaultOptions[u.name]])),n.push(u));return{languages:r,options:n}}function*To(t,e,r){let n=new Set(t.map(u=>u.value));for(let u of e)if(u.parsers){for(let o of u.parsers)if(!n.has(o)){n.add(o);let i=r.find(s=>s.parsers&&le(s.parsers,o)),D=u.name;i?.name&&(D+=` (plugin: ${i.name})`),yield{value:o,description:D}}}}function No(t){let e=[];for(let[r,n]of Object.entries(t)){let u={name:r,...n};Array.isArray(u.default)&&(u.default=y(0,u.default,-1).value),e.push(u)}return e}var wo=Array.prototype.toReversed??function(){return[...this].reverse()},Oo=X("toReversed",function(){if(Array.isArray(this))return wo}),En=Oo;function Po(){let t=globalThis,e=t.process?.platform;if(typeof e=="string")return e.startsWith("win");let r=t.Deno?.build?.os;return typeof r=="string"?r==="windows":t.navigator?.platform?.startsWith("Win")??!1}var So=Po();function Cn(t){if(t=t instanceof URL?t:new URL(t),t.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${t.protocol}"`);return t}function bo(t){return t=Cn(t),decodeURIComponent(t.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function ko(t){t=Cn(t);let e=decodeURIComponent(t.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return t.hostname!==""&&(e=`\\\\${t.hostname}${e}`),e}function Vt(t){return So?ko(t):bo(t)}var hn=t=>String(t).split(/[/\\]/).pop(),gn=t=>String(t).startsWith("file:");function _n(t,e){if(!e)return;let r=hn(e).toLowerCase();return t.find(({filenames:n})=>n?.some(u=>u.toLowerCase()===r))??t.find(({extensions:n})=>n?.some(u=>r.endsWith(u)))}function Io(t,e){if(e)return t.find(({name:r})=>r.toLowerCase()===e)??t.find(({aliases:r})=>r?.includes(e))??t.find(({extensions:r})=>r?.includes(`.${e}`))}var Ro=void 0;function yn(t,e){if(e){if(gn(e))try{e=Vt(e)}catch{return}if(typeof e=="string")return t.find(({isSupported:r})=>r?.({filepath:e}))}}function vo(t,e){let r=En(0,t.plugins).flatMap(u=>u.languages??[]);return(Io(r,e.language)??_n(r,e.physicalFile)??_n(r,e.file)??yn(r,e.physicalFile)??yn(r,e.file)??Ro?.(r,e.physicalFile))?.parsers[0]}var st=vo;var ie={key:t=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(t)?t:JSON.stringify(t),value(t){if(t===null||typeof t!="object")return JSON.stringify(t);if(Array.isArray(t))return`[${t.map(r=>ie.value(r)).join(", ")}]`;let e=Object.keys(t);return e.length===0?"{}":`{ ${e.map(r=>`${ie.key(r)}: ${ie.value(t[r])}`).join(", ")} }`},pair:({key:t,value:e})=>ie.value({[t]:e})};var An=new Proxy(String,{get:()=>An}),z=An;var xn=(t,e,{descriptor:r})=>{let n=[`${z.yellow(typeof t=="string"?r.key(t):r.pair(t))} is deprecated`];return e&&n.push(`we now treat it as ${z.blue(typeof e=="string"?r.key(e):r.pair(e))}`),n.join("; ")+"."};var Dt=Symbol.for("vnopts.VALUE_NOT_EXIST"),Ae=Symbol.for("vnopts.VALUE_UNCHANGED");var Bn=" ".repeat(2),Nn=(t,e,r)=>{let{text:n,list:u}=r.normalizeExpectedResult(r.schemas[t].expected(r)),o=[];return n&&o.push(Tn(t,e,n,r.descriptor)),u&&o.push([Tn(t,e,u.title,r.descriptor)].concat(u.values.map(i=>wn(i,r.loggerPrintWidth))).join(` `)),On(o,r.loggerPrintWidth)};function Tn(t,e,r,n){return[`Invalid ${z.red(n.key(t))} value.`,`Expected ${z.blue(r)},`,`but received ${e===Dt?z.gray("nothing"):z.red(n.value(e))}.`].join(" ")}function wn({text:t,list:e},r){let n=[];return t&&n.push(`- ${z.blue(t)}`),e&&n.push([`- ${z.blue(e.title)}:`].concat(e.values.map(u=>wn(u,r-Bn.length).replace(/^|\n/g,`$&${Bn}`))).join(` `)),On(n,r)}function On(t,e){if(t.length===1)return t[0];let[r,n]=t,[u,o]=t.map(i=>i.split(` `,1)[0].length);return u>e&&u>o?n:r}var xe=[],Wt=[];function at(t,e,r){if(t===e)return 0;let n=r?.maxDistance,u=t;t.length>e.length&&(t=e,e=u);let o=t.length,i=e.length;for(;o>0&&t.charCodeAt(~-o)===e.charCodeAt(~-i);)o--,i--;let D=0;for(;Dn)return n;if(o===0)return n!==void 0&&i>n?n:i;let s,a,c,p,l=0,m=0;for(;la?p>a?a+1:p:p>c?c+1:p;if(n!==void 0){let f=a;for(l=0;ln)return n}}return xe.length=o,Wt.length=o,n!==void 0&&a>n?n:a}function Pn(t,e,r){if(!Array.isArray(e)||e.length===0)return;let n=r?.maxDistance,u=t.length;for(let s of e)if(s===t)return s;if(n===0)return;let o,i=Number.POSITIVE_INFINITY,D=new Set;for(let s of e){if(D.has(s))continue;D.add(s);let a=Math.abs(s.length-u);if(a>=i||n!==void 0&&a>n)continue;let c=Number.isFinite(i)?n===void 0?i:Math.min(i,n):n,p=c===void 0?at(t,s):at(t,s,{maxDistance:c});if(n!==void 0&&p>n)continue;let l=p;if(c!==void 0&&p===c&&c===n&&(l=at(t,s)),ln))return o}var ct=(t,e,{descriptor:r,logger:n,schemas:u})=>{let o=[`Ignored unknown option ${z.yellow(r.pair({key:t,value:e}))}.`],i=Pn(t,Object.keys(u),{maxDistance:3});i&&o.push(`Did you mean ${z.blue(r.key(i))}?`),n.warn(o.join(" "))};var Lo=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function Mo(t,e){let r=new t(e),n=Object.create(r);for(let u of Lo)u in e&&(n[u]=Yo(e[u],r,O.prototype[u].length));return n}var O=class{static create(e){return Mo(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,r){return!1}deprecated(e,r){return!1}forward(e,r){}redirect(e,r){}overlap(e,r,n){return e}preprocess(e,r){return e}postprocess(e,r){return Ae}};function Yo(t,e,r){return typeof t=="function"?(...n)=>t(...n.slice(0,r-1),e,...n.slice(r-1)):()=>t}var ft=class extends O{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,r){return r.schemas[this._sourceName].validate(e,r)}redirect(e,r){return this._sourceName}};var lt=class extends O{expected(){return"anything"}validate(){return!0}};var pt=class extends O{constructor({valueSchema:e,name:r=e.name,...n}){super({...n,name:r}),this._valueSchema=e}expected(e){let{text:r,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:r&&`an array of ${r}`,list:n&&{title:"an array of the following values",values:[{list:n}]}}}validate(e,r){if(!Array.isArray(e))return!1;let n=[];for(let u of e){let o=r.normalizeValidateResult(this._valueSchema.validate(u,r),u);o!==!0&&n.push(o.value)}return n.length===0?!0:{value:n}}deprecated(e,r){let n=[];for(let u of e){let o=r.normalizeDeprecatedResult(this._valueSchema.deprecated(u,r),u);o!==!1&&n.push(...o.map(({value:i})=>({value:[i]})))}return n}forward(e,r){let n=[];for(let u of e){let o=r.normalizeForwardResult(this._valueSchema.forward(u,r),u);n.push(...o.map(Sn))}return n}redirect(e,r){let n=[],u=[];for(let o of e){let i=r.normalizeRedirectResult(this._valueSchema.redirect(o,r),o);"remain"in i&&n.push(i.remain),u.push(...i.redirect.map(Sn))}return n.length===0?{redirect:u}:{redirect:u,remain:n}}overlap(e,r){return e.concat(r)}};function Sn({from:t,to:e}){return{from:[t],to:e}}var mt=class extends O{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function kn(t,e){let r=Object.create(null);for(let n of t){let u=n[e];if(r[u])throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r[u]=n}return r}function In(t,e){let r=new Map;for(let n of t){let u=n[e];if(r.has(u))throw new Error(`Duplicate ${e} ${JSON.stringify(u)}`);r.set(u,n)}return r}function Rn(){let t=Object.create(null);return e=>{let r=JSON.stringify(e);return t[r]?!0:(t[r]=!0,!1)}}function vn(t,e){let r=[],n=[];for(let u of t)e(u)?r.push(u):n.push(u);return[r,n]}function Ln(t){return t===Math.floor(t)}function Mn(t,e){if(t===e)return 0;let r=typeof t,n=typeof e,u=["undefined","object","boolean","number","string"];return r!==n?u.indexOf(r)-u.indexOf(n):r!=="string"?Number(t)-Number(e):t.localeCompare(e)}function Yn(t){return(...e)=>{let r=t(...e);return typeof r=="string"?new Error(r):r}}function $t(t){return t===void 0?{}:t}function zt(t){if(typeof t=="string")return{text:t};let{text:e,list:r}=t;return jo((e||r)!==void 0,"Unexpected `expected` result, there should be at least one field."),r?{text:e,list:{title:r.title,values:r.values.map(zt)}}:{text:e}}function Gt(t,e){return t===!0?!0:t===!1?{value:e}:t}function Kt(t,e,r=!1){return t===!1?!1:t===!0?r?!0:[{value:e}]:"value"in t?[t]:t.length===0?!1:t}function bn(t,e){return typeof t=="string"||"key"in t?{from:e,to:t}:"from"in t?{from:t.from,to:t.to}:{from:e,to:t.to}}function dt(t,e){return t===void 0?[]:Array.isArray(t)?t.map(r=>bn(r,e)):[bn(t,e)]}function Ht(t,e){let r=dt(typeof t=="object"&&"redirect"in t?t.redirect:t,e);return r.length===0?{remain:e,redirect:r}:typeof t=="object"&&"remain"in t?{remain:t.remain,redirect:r}:{redirect:r}}function jo(t,e){if(!t)throw new Error(e)}var Ft=class extends O{constructor(e){super(e),this._choices=In(e.choices.map(r=>r&&typeof r=="object"?r:{value:r}),"value")}expected({descriptor:e}){let r=Array.from(this._choices.keys()).map(i=>this._choices.get(i)).filter(({hidden:i})=>!i).map(i=>i.value).sort(Mn).map(e.value),n=r.slice(0,-2),u=r.slice(-2);return{text:n.concat(u.join(" or ")).join(", "),list:{title:"one of the following values",values:r}}}validate(e){return this._choices.has(e)}deprecated(e){let r=this._choices.get(e);return r&&r.deprecated?{value:e}:!1}forward(e){let r=this._choices.get(e);return r?r.forward:void 0}redirect(e){let r=this._choices.get(e);return r?r.redirect:void 0}};var Et=class extends O{expected(){return"a number"}validate(e,r){return typeof e=="number"}};var Ct=class extends Et{expected(){return"an integer"}validate(e,r){return r.normalizeValidateResult(super.validate(e,r),e)===!0&&Ln(e)}};var Ye=class extends O{expected(){return"a string"}validate(e){return typeof e=="string"}};var jn=ie,Un=ct,Vn=Nn,Wn=xn;var ht=class{constructor(e,r){let{logger:n=console,loggerPrintWidth:u=80,descriptor:o=jn,unknown:i=Un,invalid:D=Vn,deprecated:s=Wn,missing:a=()=>!1,required:c=()=>!1,preprocess:p=m=>m,postprocess:l=()=>Ae}=r||{};this._utils={descriptor:o,logger:n||{warn:()=>{}},loggerPrintWidth:u,schemas:kn(e,"name"),normalizeDefaultResult:$t,normalizeExpectedResult:zt,normalizeDeprecatedResult:Kt,normalizeForwardResult:dt,normalizeRedirectResult:Ht,normalizeValidateResult:Gt},this._unknownHandler=i,this._invalidHandler=Yn(D),this._deprecatedHandler=s,this._identifyMissing=(m,f)=>!(m in f)||a(m,f),this._identifyRequired=c,this._preprocess=p,this._postprocess=l,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=Rn()}normalize(e){let r={},u=[this._preprocess(e,this._utils)],o=()=>{for(;u.length!==0;){let i=u.shift(),D=this._applyNormalization(i,r);u.push(...D)}};o();for(let i of Object.keys(this._utils.schemas)){let D=this._utils.schemas[i];if(!(i in r)){let s=$t(D.default(this._utils));"value"in s&&u.push({[i]:s.value})}}o();for(let i of Object.keys(this._utils.schemas)){if(!(i in r))continue;let D=this._utils.schemas[i],s=r[i],a=D.postprocess(s,this._utils);a!==Ae&&(this._applyValidation(a,i,D),r[i]=a)}return this._applyPostprocess(r),this._applyRequiredCheck(r),r}_applyNormalization(e,r){let n=[],{knownKeys:u,unknownKeys:o}=this._partitionOptionKeys(e);for(let i of u){let D=this._utils.schemas[i],s=D.preprocess(e[i],this._utils);this._applyValidation(s,i,D);let a=({from:m,to:f})=>{n.push(typeof f=="string"?{[f]:m}:{[f.key]:f.value})},c=({value:m,redirectTo:f})=>{let F=Kt(D.deprecated(m,this._utils),s,!0);if(F!==!1)if(F===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,f,this._utils));else for(let{value:d}of F){let E={key:i,value:d};if(!this._hasDeprecationWarned(E)){let C=typeof f=="string"?{key:f,value:d}:f;this._utils.logger.warn(this._deprecatedHandler(E,C,this._utils))}}};dt(D.forward(s,this._utils),s).forEach(a);let l=Ht(D.redirect(s,this._utils),s);if(l.redirect.forEach(a),"remain"in l){let m=l.remain;r[i]=i in r?D.overlap(r[i],m,this._utils):m,c({value:m})}for(let{from:m,to:f}of l.redirect)c({value:m,redirectTo:f})}for(let i of o){let D=e[i];this._applyUnknownHandler(i,D,r,(s,a)=>{n.push({[s]:a})})}return n}_applyRequiredCheck(e){for(let r of Object.keys(this._utils.schemas))if(this._identifyMissing(r,e)&&this._identifyRequired(r))throw this._invalidHandler(r,Dt,this._utils)}_partitionOptionKeys(e){let[r,n]=vn(Object.keys(e).filter(u=>!this._identifyMissing(u,e)),u=>u in this._utils.schemas);return{knownKeys:r,unknownKeys:n}}_applyValidation(e,r,n){let u=Gt(n.validate(e,this._utils),e);if(u!==!0)throw this._invalidHandler(r,u.value,this._utils)}_applyUnknownHandler(e,r,n,u){let o=this._unknownHandler(e,r,this._utils);if(o)for(let i of Object.keys(o)){if(this._identifyMissing(i,o))continue;let D=o[i];i in this._utils.schemas?u(i,D):n[i]=D}}_applyPostprocess(e){let r=this._postprocess(e,this._utils);if(r!==Ae){if(r.delete)for(let n of r.delete)delete e[n];if(r.override){let{knownKeys:n,unknownKeys:u}=this._partitionOptionKeys(r.override);for(let o of n){let i=r.override[o];this._applyValidation(i,o,this._utils.schemas[o]),e[o]=i}for(let o of u){let i=r.override[o];this._applyUnknownHandler(o,i,e,(D,s)=>{let a=this._utils.schemas[D];this._applyValidation(s,D,a),e[D]=s})}}}}};var Jt;function Uo(t,e,{logger:r=!1,isCLI:n=!1,passThrough:u=!1,FlagSchema:o,descriptor:i}={}){if(n){if(!o)throw new Error("'FlagSchema' option is required.");if(!i)throw new Error("'descriptor' option is required.")}else i=ie;let D=u?Array.isArray(u)?(l,m)=>u.includes(l)?{[l]:m}:void 0:(l,m)=>({[l]:m}):(l,m,f)=>{let{_:F,...d}=f.schemas;return ct(l,m,{...f,schemas:d})},s=Vo(e,{isCLI:n,FlagSchema:o}),a=new ht(s,{logger:r,unknown:D,descriptor:i}),c=r!==!1;c&&Jt&&(a._hasDeprecationWarned=Jt);let p=a.normalize(t);return c&&(Jt=a._hasDeprecationWarned),p}function Vo(t,{isCLI:e,FlagSchema:r}){let n=[];e&&n.push(lt.create({name:"_"}));for(let u of t)n.push(Wo(u,{isCLI:e,optionInfos:t,FlagSchema:r})),u.alias&&e&&n.push(ft.create({name:u.alias,sourceName:u.name}));return n}function Wo(t,{isCLI:e,optionInfos:r,FlagSchema:n}){let{name:u}=t,o={name:u},i,D={};switch(t.type){case"int":i=Ct,e&&(o.preprocess=Number);break;case"string":i=Ye;break;case"choice":i=Ft,o.choices=t.choices.map(s=>s?.redirect?{...s,redirect:{to:{key:t.name,value:s.redirect}}}:s);break;case"boolean":i=mt;break;case"flag":i=n,o.flags=r.flatMap(s=>[s.alias,s.description&&s.name,s.oppositeDescription&&`no-${s.name}`].filter(Boolean));break;case"path":i=Ye;break;default:throw new Error(`Unexpected type ${t.type}`)}if(t.exception?o.validate=(s,a,c)=>t.exception(s)||a.validate(s,c):o.validate=(s,a,c)=>s===void 0||a.validate(s,c),t.redirect&&(D.redirect=s=>s?{to:typeof t.redirect=="string"?t.redirect:{key:t.redirect.option,value:t.redirect.value}}:void 0),t.deprecated&&(D.deprecated=!0),e&&!t.array){let s=o.preprocess||(a=>a);o.preprocess=(a,c,p)=>c.preprocess(s(Array.isArray(a)?y(0,a,-1):a),p)}return t.array?pt.create({...e?{preprocess:s=>Array.isArray(s)?s:[s]}:{},...D,valueSchema:i.create(o)}):i.create({...o,...D})}var $n=Uo;var $o=Array.prototype.findLast??function(t){for(let e=this.length-1;e>=0;e--){let r=this[e];if(t(r,e,this))return r}},zo=X("findLast",function(){if(Array.isArray(this))return $o}),qt=zo;var zn=Symbol.for("PRETTIER_IS_FRONT_MATTER"),Xt=[];function Go(t){return!!t?.[zn]}var pe=Go;var Gn=new Set(["yaml","toml"]),je=({node:t})=>pe(t)&&Gn.has(t.language);async function Qt(t,e,r,n){let{node:u}=r,{language:o}=u;if(!Gn.has(o))return;let i=u.value.trim(),D;if(i){let s=o==="yaml"?o:st(n,{language:o});if(!s)return;D=i?await t(i,{parser:s}):""}else D=i;return Xe([u.startDelimiter,u.explicitLanguage??"",W,D,D?W:"",u.endDelimiter])}function Ko(t,e){return je({node:t})&&(delete e.end,delete e.raw,delete e.value),e}var Zt=Ko;function Ho({node:t}){return t.raw}var er=Ho;var Kn=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Jo=t=>Object.keys(t).filter(e=>!Kn.has(e));function qo(t,e){let r=t?n=>t(n,Kn):Jo;return e?new Proxy(r,{apply:(n,u,o)=>pe(o[0])?Xt:Reflect.apply(n,u,o)}):r}var tr=qo;function rr(t,e){if(!e)throw new Error("parserName is required.");let r=qt(0,t,u=>u.parsers&&le(u.parsers,e));if(r)return r;let n=`Couldn't resolve parser "${e}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Le(n)}function Hn(t,e){if(!e)throw new Error("astFormat is required.");let r=qt(0,t,u=>u.printers&&le(u.printers,e));if(r)return r;let n=`Couldn't find plugin for AST format "${e}".`;throw n+=" Plugins must be explicitly added to the standalone bundle.",new Le(n)}function Ue({plugins:t,parser:e}){let r=rr(t,e);return nr(r,e)}function nr(t,e){let r=t.parsers[e];return typeof r=="function"?r():r}async function Jn(t,e){let r=t.printers[e],n=typeof r=="function"?await r():r;return Zo(n)}function Xo(t){let{features:e,getVisitorKeys:r,embed:n,massageAstNode:u,print:o,...i}=t;e=ni(e);let D=e.experimental_frontMatterSupport;r=tr(r,D.massageAstNode||D.embed||D.print);let s=u;u&&D.massageAstNode&&(s=new Proxy(u,{apply(l,m,f){return Zt(...f),Reflect.apply(l,m,f)}}));let a=n;if(n){let l;a=new Proxy(n,{get(m,f,F){return f==="getVisitorKeys"?(l??(l=n.getVisitorKeys?tr(n.getVisitorKeys,D.massageAstNode||D.embed):r),l):Reflect.get(m,f,F)},apply:(m,f,F)=>D.embed&&je(...F)?Qt:Reflect.apply(m,f,F)})}let c=o;return D.print&&(c=new Proxy(o,{apply(l,m,f){let[F]=f;return pe(F.node)?er(F):Reflect.apply(l,m,f)}})),{features:e,getVisitorKeys:r,embed:a,massageAstNode:s,print:c,...i}}var Qo=new WeakMap;function Zo(t){return Fe(Qo,t,Xo)}var ei=["clean","embed","print"],ti=Object.fromEntries(ei.map(t=>[t,!1]));function ri(t){return{...ti,...t}}function ni(t){return{experimental_avoidAstMutation:!1,...t,experimental_frontMatterSupport:ri(t?.experimental_frontMatterSupport)}}var qn={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function ui(t,e={}){let r={...t};if(!r.parser){if(!r.filepath)throw new Me("No parser and no file path given, couldn't infer a parser.");if(r.parser=st(r,{physicalFile:r.filepath}),!r.parser)throw new Me(`No parser could be inferred for file "${r.filepath}".`)}let n=it({plugins:t.plugins,showDeprecated:!0}).options,u={...qn,...Object.fromEntries(n.filter(p=>p.default!==void 0).map(p=>[p.name,p.default]))},o=rr(r.plugins,r.parser),i=await nr(o,r.parser);r.astFormat=i.astFormat,r.locEnd=i.locEnd,r.locStart=i.locStart;let D=o.printers?.[i.astFormat]?o:Hn(r.plugins,i.astFormat),s=await Jn(D,i.astFormat);r.printer=s,r.getVisitorKeys=s.getVisitorKeys;let a=D.defaultOptions?Object.fromEntries(Object.entries(D.defaultOptions).filter(([,p])=>p!==void 0)):{},c={...u,...a};for(let[p,l]of Object.entries(c))r[p]??(r[p]=l);return r.parser==="json"&&(r.trailingComma="none"),$n(r,n,{passThrough:Object.keys(qn),...e})}var se=ui;var Xn=/\r\n|[\n\r\u2028\u2029]/;function oi(t,e,r,n){let u={column:null,line:-1,...t.start},o={...u,...t.end},{linesAbove:i=2,linesBelow:D=3}=r||{},s=u.line-n,a=u.column,c=o.line-n,p=o.column,l=Math.max(s-(i+1),0),m=Math.min(e.length,c+D);s===-1&&(l=0),c===-1&&(m=e.length);let f=c-s,F={};if(f)for(let d=0;d<=f;d++){let E=d+s;if(a==null)F[E]=!0;else if(d===0){let C=e[E-1].length;F[E]=[a,C-a]}else if(d===f)F[E]=[0,p];else{let C=e[E-1].length;F[E]=[0,C]}}else if(a===p)a!=null?F[s]=[a,0]:F[s]=!0;else{let d=a??0,E=p??d;F[s]=[d,E-d]}return{start:l,end:m,markerLines:F}}function Qn(t,e,r={},n){let{defs:u,highlight:o}=n||{defs:{gutter:String,marker:String,message:String,reset:String},highlight:String},i=(r.startLine||1)-1,D=t.split(Xn),{start:s,end:a,markerLines:c}=oi(e,D,r,i),p=e.start&&typeof e.start.column=="number",l=String(a+i).length,f=o(t).split(Xn,a).slice(s,a).map((F,d)=>{let E=s+1+d,h=` ${` ${E+i}`.slice(-l)} |`,_=c[E],P=!c[E+1];if(_){let A="";if(Array.isArray(_)){let B=F.slice(0,_[0]).replace(/[^\t]/g," "),J=_[1]||1;A=[` `,u.gutter(h.replace(/\d/g," "))," ",B,u.marker("^").repeat(J)].join(""),P&&r.message&&(A+=" "+u.message(r.message))}return[u.marker(">"),u.gutter(h),F.length>0?` ${F}`:"",A].join("")}else return` ${u.gutter(h)}${F.length>0?` ${F}`:""}`}).join(` `);return r.message&&!p&&(f=`${" ".repeat(l+1)}${r.message} ${f}`),u.reset(f)}function Zn(t,e,r={}){return Qn(t,e,r)}async function ii(t,e){let r=await Ue(e),n=r.preprocess?await r.preprocess(t,e):t;e.originalText=n;let u;try{u=await r.parse(n,e,e)}catch(o){si(o,t)}return{text:n,ast:u}}function si(t,e){let{loc:r}=t;if(r){let{start:n,end:u}=r;n&&(n={line:n.line,column:n.column-1}),u&&(u={line:u.line,column:u.column-1});let o=Zn(e,{start:n,end:u},{highlightCode:!0});t.message+=` `+o,t.codeFrame=o}throw t}var me=ii;async function eu(t,e,r,n,u){if(r.embeddedLanguageFormatting!=="auto")return;let{printer:o}=r,{embed:i}=o;if(!i)return;if(i.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed");let{hasPrettierIgnore:D}=o,{getVisitorKeys:s}=i,a=[];l();let c=t.stack;for(let{print:m,node:f,pathStack:F}of a)try{t.stack=F;let d=await m(p,e,t,r);d&&u.set(f,d)}catch(d){if(globalThis.PRETTIER_DEBUG)throw d}t.stack=c;function p(m,f){return Di(m,f,r,n)}function l(){let{node:m}=t;if(m===null||typeof m!="object"||D?.(t))return;for(let F of s(m))Array.isArray(m[F])?t.each(l,F):t.call(l,F);let f=i(t,r);if(f){if(typeof f=="function"){a.push({print:f,node:m,pathStack:[...t.stack]});return}u.set(m,f)}}}async function Di(t,e,r,n){let u=await se({...r,...e,parentParser:r.parser,originalText:t,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:o}=await me(t,u),i=await n(o,u);return He(i)}function ai(t,e,r,n){let{originalText:u,[ue]:o,locStart:i,locEnd:D,[Symbol.for("printedComments")]:s}=e,{node:a}=t,c=i(a),p=D(a);for(let m of o)i(m)>=c&&D(m)<=p&&s.add(m);let{printPrettierIgnored:l}=e.printer;return l?l(t,e,r,n):u.slice(c,p)}var tu=ai;async function Ve(t,e){({ast:t}=await ur(t,e));let r=new Map,n=new en(t),u=dn(e),o=new Map;await eu(n,D,e,Ve,o);let i=await ru(n,e,D,void 0,o);if(mn(e),e.cursorOffset>=0){if(e.nodeAfterCursor&&!e.nodeBeforeCursor)return[ee,i];if(e.nodeBeforeCursor&&!e.nodeAfterCursor)return[i,ee]}return i;function D(a,c){return a===void 0||a===n?s(c):Array.isArray(a)?n.call(()=>s(c),...a):n.call(()=>s(c),a)}function s(a){u(n);let c=n.node;if(c==null)return"";let p=ge(c)&&a===void 0;if(p&&r.has(c))return r.get(c);let l=ru(n,e,D,a,o);return p&&r.set(c,l),l}}function ru(t,e,r,n,u){let{node:o}=t,{printer:i}=e,D;switch(i.hasPrettierIgnore?.(t)?D=tu(t,e,r,n):u.has(o)?D=u.get(o):D=i.print(t,e,r,n),o){case e.cursorNode:D=Ee(D,s=>[ee,s,ee]);break;case e.nodeBeforeCursor:D=Ee(D,s=>[s,ee]);break;case e.nodeAfterCursor:D=Ee(D,s=>[ee,s]);break}return i.printComment&&rt(o.comments)&&!i.willPrintOwnComments?.(t,e)&&(D=pn(t,D,e)),D}async function ur(t,e){let r=t.comments??[];e[ue]=r,e[Symbol.for("printedComments")]=new Set,an(t,e);let{printer:{preprocess:n}}=e;return t=n?await n(t,e):t,{ast:t,comments:r}}function ci(t,e){let{cursorOffset:r,locStart:n,locEnd:u,getVisitorKeys:o}=e,i=m=>n(m)<=r&&u(m)>=r,D=t,s=[t];for(let m of nn(t,{getVisitorKeys:o,filter:i}))s.push(m),D=m;if(un(D,{getVisitorKeys:o}))return{cursorNode:D};let a,c,p=-1,l=Number.POSITIVE_INFINITY;for(;s.length>0&&(a===void 0||c===void 0);){D=s.pop();let m=a!==void 0,f=c!==void 0;for(let F of ye(D,{getVisitorKeys:o})){if(!m){let d=u(F);d<=r&&d>p&&(a=F,p=d)}if(!f){let d=n(F);d>=r&&di(l,s)).filter(Boolean);let a={},c=new Set(u(D));for(let l in D)!le(D,l)||o?.has(l)||(c.has(l)?a[l]=i(D[l],D):a[l]=D[l]);let p=n(D,a,s);if(p!==null)return p??a}}var nu=fi;var li=Array.prototype.findLastIndex??function(t){for(let e=this.length-1;e>=0;e--){let r=this[e];if(t(r,e,this))return e}return-1},pi=X("findLastIndex",function(){if(Array.isArray(this))return li}),uu=pi;function mi(t,e){return e=new Set(e),t.find(r=>su.has(r.type)&&e.has(r))}function ou(t){let e=uu(0,t,r=>r.type!=="Program"&&r.type!=="File");return e===-1?t:t.slice(0,e+1)}function di(t,e,{locStart:r,locEnd:n}){let[u,...o]=t,[i,...D]=e;if(u===i)return[u,i];let s=r(u);for(let c of ou(D))if(r(c)>=s)i=c;else break;let a=n(i);for(let c of ou(o)){if(n(c)<=a)u=c;else break;if(u===i)break}return[u,i]}function ir(t,e,r,n,u=[],o,i){let{locStart:D,locEnd:s}=i,a=D(t),c=s(t);if(e>c||en);let o=t.slice(n,u).search(/\S/),i=o===-1;if(!i)for(n+=o;u>n&&!/\S/.test(t[u-1]);--u);let D=e.printer.features?.experimental_locForRangeFormat??e,s=ir(r,n,e,(f,F)=>iu(e,f,F),[],"rangeStart",D);if(!s)return;let a=i?s:ir(r,u,e,f=>iu(e,f),[],"rangeEnd",D);if(!a)return;let c,p;if(r.type==="JsonRoot"){let f=mi(s,a);c=f,p=f}else[c,p]=di(s,a,e);let{locStart:l,locEnd:m}=D;return[Math.min(l(c),l(p)),Math.max(m(c),m(p))]}var lu="\uFEFF",au=Symbol("cursor");async function pu(t,e,r=0){if(!t||t.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:n,text:u}=await me(t,e);e.cursorOffset>=0&&(e={...e,...or(n,e)});let o=await Ve(n,e,r);r>0&&(o=Qe([W,o],r,e.tabWidth));let i=Ce(o,e);if(r>0){let s=i.formatted.trim();i.cursorNodeStart!==void 0&&(i.cursorNodeStart-=i.formatted.indexOf(s),i.cursorNodeStart<0&&(i.cursorNodeStart=0,i.cursorNodeText=i.cursorNodeText.trimStart()),i.cursorNodeStart+i.cursorNodeText.length>s.length&&(i.cursorNodeText=i.cursorNodeText.trimEnd())),i.formatted=s+we(e.endOfLine)}let D=e[ue];if(e.cursorOffset>=0){let s,a,c,p;if((e.cursorNode||e.nodeBeforeCursor||e.nodeAfterCursor)&&i.cursorNodeText)if(c=i.cursorNodeStart,p=i.cursorNodeText,e.cursorNode)s=e.locStart(e.cursorNode),a=u.slice(s,e.locEnd(e.cursorNode));else{if(!e.nodeBeforeCursor&&!e.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");s=e.nodeBeforeCursor?e.locEnd(e.nodeBeforeCursor):0;let E=e.nodeAfterCursor?e.locStart(e.nodeAfterCursor):u.length;a=u.slice(s,E)}else s=0,a=u,c=0,p=i.formatted;let l=e.cursorOffset-s;if(a===p)return{formatted:i.formatted,cursorOffset:c+l,comments:D};let m=a.split("");m.splice(l,0,au);let f=p.split(""),F=xt(m,f),d=c;for(let E of F)if(E.removed){if(E.value.includes(au))break}else d+=E.count;return{formatted:i.formatted,cursorOffset:d,comments:D}}return{formatted:i.formatted,cursorOffset:-1,comments:D}}async function Ci(t,e){let{ast:r,text:n}=await me(t,e),[u,o]=Du(n,e,r)??[0,0],i=n.slice(u,o),D=Math.min(u,n.lastIndexOf(` `,u)+1),s=n.slice(D,u).match(/^\s*/)[0],a=he(s,e.tabWidth),c=await pu(i,{...e,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:e.cursorOffset>u&&e.cursorOffset<=o?e.cursorOffset-u:-1,endOfLine:"lf"},a),p=c.formatted.trimEnd(),{cursorOffset:l}=e;l>o?l+=p.length-i.length:c.cursorOffset>=0&&(l=c.cursorOffset+u);let m=n.slice(0,u)+p+n.slice(o);if(e.endOfLine!=="lf"){let f=we(e.endOfLine);l>=0&&f===`\r `&&(l+=Tt(m.slice(0,l),` `)),m=ne(0,m,` `,f)}return{formatted:m,cursorOffset:l,comments:c.comments}}function sr(t,e,r){return typeof e!="number"||Number.isNaN(e)||e<0||e>t.length?r:e}function cu(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u}=e;return r=sr(t,r,-1),n=sr(t,n,0),u=sr(t,u,t.length),{...e,cursorOffset:r,rangeStart:n,rangeEnd:u}}function mu(t,e){let{cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o}=cu(t,e),i=t.charAt(0)===lu;if(i&&(t=t.slice(1),r--,n--,u--),o==="auto"&&(o=Cr(t)),t.includes("\r")){let D=s=>Tt(t.slice(0,Math.max(s,0)),`\r `);r-=D(r),n-=D(n),u-=D(u),t=hr(t)}return{hasBOM:i,text:t,options:cu(t,{...e,cursorOffset:r,rangeStart:n,rangeEnd:u,endOfLine:o})}}async function fu(t,e){let r=await Ue(e);return!r.hasPragma||r.hasPragma(t)}async function hi(t,e){return(await Ue(e)).hasIgnorePragma?.(t)}async function Dr(t,e){let{hasBOM:r,text:n,options:u}=mu(t,await se(e));if(u.rangeStart>=u.rangeEnd&&n!==""||u.requirePragma&&!await fu(n,u)||u.checkIgnorePragma&&await hi(n,u))return{formatted:t,cursorOffset:e.cursorOffset,comments:[]};let o;return u.rangeStart>0||u.rangeEnd=0&&o.cursorOffset++),o}async function du(t,e,r){let{text:n,options:u}=mu(t,await se(e)),o=await me(n,u);return r&&(r.preprocessForPrint&&(o.ast=await ur(o.ast,u)),r.massage&&(o.ast=nu(o.ast,u))),o}async function Fu(t,e){e=await se(e);let r=await Ve(t,e);return Ce(r,e)}async function Eu(t,e){let r=Ur(t),{formatted:n}=await Dr(r,{...e,parser:"__js_expression"});return n}async function Cu(t,e){e=await se(e);let{ast:r}=await me(t,e);return e.cursorOffset>=0&&(e={...e,...or(r,e)}),Ve(r,e)}async function hu(t,e){return Ce(t,await se(e))}var ar={};yt(ar,{builders:()=>_i,printer:()=>yi,utils:()=>Ai});var _i={join:be,line:Ze,softline:Mr,hardline:W,literalline:Je,group:wt,conditionalGroup:Ir,fill:kr,lineSuffix:Ie,lineSuffixBoundary:Yr,cursor:ee,breakParent:ae,ifBreak:Rr,trim:jr,indent:oe,indentIfBreak:vr,align:De,addAlignmentToDoc:Qe,markAsRoot:Xe,dedentToRoot:Sr,dedent:br,hardlineWithoutBreakParent:ke,literallineWithoutBreakParent:Ot,label:Lr,concat:t=>t},yi={printDocToString:Ce},Ai={willBreak:xr,traverseDoc:Oe,findInDoc:Ke,mapDoc:Se,removeLines:Tr,stripTrailingHardline:He,replaceEndOfLine:Nr,canBreak:wr};var gu="3.9.4";var fr={};yt(fr,{addDanglingComment:()=>re,addLeadingComment:()=>ce,addTrailingComment:()=>fe,getAlignmentSize:()=>he,getIndentSize:()=>_u,getMaxContinuousCount:()=>yu,getNextNonSpaceNonCommentCharacter:()=>Au,getNextNonSpaceNonCommentCharacterIndex:()=>vi,getPreferredQuote:()=>Tu,getStringWidth:()=>Re,hasNewline:()=>H,hasNewlineInRange:()=>Nu,hasSpaces:()=>wu,isNextLineEmpty:()=>Ui,isNextLineEmptyAfterIndex:()=>gt,isPreviousLineEmpty:()=>Mi,makeString:()=>ji,skip:()=>_e,skipEverythingButNewLine:()=>ut,skipInlineComment:()=>Be,skipNewline:()=>$,skipSpaces:()=>j,skipToLineEnd:()=>nt,skipTrailingComment:()=>Te,skipWhitespace:()=>tn});function xi(t,e){if(e===!1)return!1;if(t.charAt(e)==="/"&&t.charAt(e+1)==="*"){for(let r=e+2;rMath.max(n,u.length),0)/e.length}var yu=Oi;function Pi(t,e){let r=We(t,e);return r===!1?"":t.charAt(r)}var Au=Pi;var xu=Object.freeze({character:"'",codePoint:39}),Bu=Object.freeze({character:'"',codePoint:34}),Si=Object.freeze({preferred:xu,alternate:Bu}),bi=Object.freeze({preferred:Bu,alternate:xu});function Tu(t,e){let{preferred:r,alternate:n}=e===!0||e==="'"?Si:bi,{length:u}=t,o=0,i=0;for(let D=0;Di?n:r).character}function ki(t,e,r){for(let n=e;nD===n?D:s===e?"\\"+s:s||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(D)?D:"\\"+D));return e+o+e}function Ui(t,e){return arguments.length===2||typeof e=="number"?gt(t,e):Yi(...arguments)}function de(t,e=1){return async(...r)=>{let n=r[e]??{},u=n.plugins??[];return r[e]={...n,plugins:Array.isArray(u)?u:Object.values(u)},await t(...r)}}var Ou=de(Dr);async function Pu(t,e){let{formatted:r}=await Ou(t,{...e,cursorOffset:-1});return r}async function Vi(t,e){return await Pu(t,e)===t}var Wi=de(it,0),$i={parse:de(du),formatAST:de(Fu),formatDoc:de(Eu),printToDoc:de(Cu),printDocToString:de(hu)};export{$i as __debug,Vi as check,Su as default,ar as doc,Pu as format,Ou as formatWithCursor,Wi as getSupportInfo,fr as util,gu as version};