tildefriends/deps/prettier/estree.mjs

37 lines
195 KiB
JavaScript
Raw Normal View History

var Xa=Object.defineProperty;var Rs=e=>{throw TypeError(e)};var Ar=(e,t)=>{for(var r in t)Xa(e,r,{get:t[r],enumerable:!0})};var Js=(e,t,r)=>t.has(e)||Rs("Cannot "+r);var pt=(e,t,r)=>(Js(e,t,"read from private field"),r?r.call(e):t.get(e)),qs=(e,t,r)=>t.has(e)?Rs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ws=(e,t,r,n)=>(Js(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Os={};Ar(Os,{languages:()=>om,options:()=>Ja,printers:()=>am});var Gs=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}];var Ls={};Ar(Ls,{canAttachComment:()=>Ap,embed:()=>Zu,experimentalFeatures:()=>tm,getCommentChildNodes:()=>Tp,getVisitorKeys:()=>gr,handleComments:()=>$n,insertPragma:()=>ci,isBlockComment:()=>ee,isGap:()=>dp,massageAstNode:()=>Cu,print:()=>Oa,printComment:()=>Pu,willPrintOwnComments:()=>Kn});var Ya=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},Y=Ya;var Ha=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},_=Ha;function Na(e){return e!==null&&typeof e=="object"}var Us=Na;function*Va(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,s=u=>Us(u)&&n(u);for(let u of r(e)){let i=e[u];if(Array.isArray(i))for(let a of i)s(a)&&(yield a);else s(i)&&(yield i)}}function*$a(e,t){let r=[e];for(let n=0;n<r.length;n++){let s=r[n];for(let u of Va(s,t))yield u,r.push(u)}}function Xs(e,{getVisitorKeys:t,predicate:r}){for(let n of $a(e,{getVisitorKeys:t}))if(r(n))return!0;return!1}var Ys=()=>/[#*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\u273
`)return t-2;if(s===`
`||s==="\r"||s==="\u2028"||s==="\u2029")return t-1}else{if(s==="\r"&&e.charAt(t+1)===`
`)return t+2;if(s===`
`||s==="\r"||s==="\u2028"||s==="\u2029")return t+1}return t}var Ge=za;function Za(e,t,r={}){let n=We(e,r.backwards?t-1:t,r),s=Ge(e,n,r);return n!==s}var Z=Za;function eo(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ot=eo;function to(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Ks(e,t):t}var _t=to;function ro(e,t){let r=null,n=t;for(;n!==r;)r=n,n=$s(e,n),n=Ot(e,n),n=We(e,n);return n=_t(e,n),n=Ge(e,n),n!==!1&&Z(e,n)}var jt=ro;function no(e){return Array.isArray(e)&&e.length>0}var O=no;var Qs=new Proxy(()=>{},{get:()=>Qs}),vt=Qs;var dr="'",zs='"';function so(e,t){let r=t===!0||t===dr?dr:zs,n=r===dr?zs:dr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var xr=so;function uo(e,t,r){let n=t==='"'?"'":'"',u=Y(!1,e,/\\(.)|(["'])/gsu,(i,a,p)=>a===n?a:p===t?"\\"+p:p||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a)?a:"\\"+a));return t+u+t}var Zs=uo;function io(e,t){vt(/^(?<quote>["']).*\k<quote>$/su.test(e));let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":xr(r,t.singleQuote);return e.charAt(0)===n?e:Zs(r,n,!1)}var Ze=io;function q(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(q(r),t):t}function k(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function Bt(e,t){let r=q(e);return Number.isInteger(r)&&r===q(t)}function ao(e,t){let r=k(e);return Number.isInteger(r)&&r===k(t)}function eu(e,t){return Bt(e,t)&&ao(e,t)}var Zt=null;function er(e){if(Zt!==null&&typeof Zt.property){let t=Zt;return Zt=er.prototype=null,t}return Zt=er.prototype=e??Object.create(null),new er}var oo=10;for(let e=0;e<=oo;e++)er();function In(e){return er(e)}function po(e,t="type"){In(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var hr=po;var tu={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body","predicate"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParam
`):e.type==="UnaryExpression"?nr(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:kr(e)}function Oe(e,t){return H(t)?kt(t):d(t,h.Leading,r=>Z(e,k(r)))}function nu(e){return e.quasis.some(t=>t.value.raw.includes(`
`))}function Lr(e,t){return(e.type==="TemplateLiteral"&&nu(e)||e.type==="TaggedTemplateExpression"&&nu(e.quasi))&&!Z(t,q(e),{backwards:!0})}function wr(e){if(!d(e))return!1;let t=_(!1,ct(e,h.Dangling),-1);return t&&!ee(t)}function lu(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Mt(r)){if(t+=1,t>1)return!0}else if(L(r)){for(let n of oe(r))if(Mt(n))return!0}return!1}function Or(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&L(t)&&L(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var So=new Set(["!","-","+","~"]);function be(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return be(e.expression,t);let r=n=>be(n,t-1);if(vn(e))return ze(e.pattern??e.regex.pattern)<=5;if(kr(e)||Fo(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(`
`))&&e.expressions.every(r);if(se(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(X(e))return e.elements.every(n=>n===null||r(n));if(lt(e)){if(e.type==="ImportExpression"||be(e.callee,t)){let n=oe(e);return n.length<=t&&n.every(r)}return!1}return W(e)?be(e.object,t)&&be(e.property,t):e.type==="UnaryExpression"&&So.has(e.operator)||e.type==="UpdateExpression"?be(e.argument,t):!1}function fe(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function mu(e){return e}function ae(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ie(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ie(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ie(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ie(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ie(e.callee,t);case"ConditionalExpression":return ie(e.test,t);case"UpdateExpression":return!e.prefix&&ie(e.argument,t);case"BindExpression":return e.object&&ie(e.object,t);case"SequenceExpression":return ie(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ie(e.expression,t);default:return t(e)}}var su={"==":!0,"!=":!0,"===":!0,"!==":!0},br={"*":!0,"/":!0,"%":!0},_n={">>":!0,">>>":!0,"<<":!0};function sr(e,t){return!(tr(t)!==tr(e)||e==="**"||su[e]&&su[t]||t==="%"&&br[e]||e==="%"&&br[t]||t!==e&&br[t]&&br[e]||_n[e]&&_n[t])}var Bo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function tr(e){return Bo.get(e)}function yu(e){return!!_n[e]||e==="|"||e==="^"||e==="&"}function Du(e){var r;if(e.rest)return!0;let t=z(e);return((r=_(!1,t,-1))==null?void 0:r.type)==="RestElement"}var wn=new WeakMap;function z(e){if(wn.has(e))return wn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),wn.set(e,t),t}function fu(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var On=new WeakMap;function oe(e){if(On.has(e))return On.get(e);if(e.type==="ChainExpression")return oe(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.options&&t.push(e.options)),On.set(e,t),t}function qt(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>qt(e,t),"expression");r.type==="ImportExpression"?(e.call(n=>t(n,0),"source"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Rn(e,t){let r=[];if(e.type==="ChainExpression"&&(e=e.expression,r.push("expression")),e.type==="ImportExpression"){if(t===0||t===(e.options?-2:-1))return[...r,"source"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function ur(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function kt(e){return(e==null?void 0:e.prettierIgnore)||d(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},Eu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&h.Leading&&!r.leading||e&h.Trailing&&!r.trailing||e&h.Dangling&&(r.leading||r.trailing)||e&h.Block&&!ee(r)||e&h.Line&&!Ct(r)||e&h.First&&n!==0||e&h.Last&&n!==s.length-1||e&h.PrettierIgnore&&!ur(r)||t&&!t(r))};function d(e,t,r){if(!O(e==null?void 0:e.comments))return!1;let n=Eu(t,r);return n?e.comments.some(n):!0}function ct(e,t,r){if(!Array.isArray(e==null?void 0:e.comments))return[
Expected it to be 'string' or 'object'.`;if(nt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ko([...jr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var Jn=class extends Error{name="InvalidDocError";constructor(t){super(Io(t)),this.doc=t}},Tt=Jn;var Au={};function Lo(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===Au){r(s.pop());continue}r&&s.push(u,Au);let i=nt(u);if(!i)throw new Tt(u);if((t==null?void 0:t(u))!==!1)switch(i){case _e:case Pe:{let a=i===_e?u:u.parts;for(let p=a.length,o=p-1;o>=0;--o)s.push(a[o]);break}case xe:s.push(u.flatContents,u.breakContents);break;case le:if(n&&u.expandedStates)for(let a=u.expandedStates.length,p=a-1;p>=0;--p)s.push(u.expandedStates[p]);else s.push(u.contents);break;case Ye:case Xe:case He:case je:case Ne:s.push(u.contents);break;case et:case tt:case rt:case Ve:case me:case ve:break;default:throw new Tt(u)}}}var qn=Lo;var Tu=()=>{},$e=Tu,vr=Tu;function f(e){return $e(e),{type:Xe,contents:e}}function he(e,t){return $e(t),{type:Ye,contents:t,n:e}}function l(e,t={}){return $e(e),vr(t.expandedStates,!0),{type:le,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function du(e){return he(Number.NEGATIVE_INFINITY,e)}function Mr(e){return he(-1,e)}function Ke(e,t){return l(e[0],{...t,expandedStates:e})}function Rr(e){return vr(e),{type:Pe,parts:e}}function B(e,t="",r={}){return $e(e),t!==""&&$e(t),{type:xe,breakContents:e,flatContents:t,groupId:r.groupId}}function dt(e,t){return $e(e),{type:He,contents:e,groupId:t.groupId,negate:t.negate}}function Wn(e){return $e(e),{type:Ne,contents:e}}var ke={type:Ve},Ee={type:ve};var Gn={type:me,hard:!0},wo={type:me,hard:!0,literal:!0},x={type:me},E={type:me,soft:!0},F=[Gn,Ee],Jr=[wo,Ee],ir={type:tt};function b(e,t){$e(e),vr(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function xu(e,t,r){$e(e);let n=e;if(t>0){for(let s=0;s<Math.floor(t/r);++s)n=f(n);n=he(t%r,n),n=he(Number.NEGATIVE_INFINITY,n)}return n}function st(e,t){return $e(t),e?{type:je,label:e,contents:t}:t}function mt(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(nt(u)){case _e:return t(u.map(n));case Pe:return t({...u,parts:u.parts.map(n)});case xe:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case le:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case Ye:case Xe:case He:case je:case Ne:return t({...u,contents:n(u.contents)});case et:case tt:case rt:case Ve:case me:case ve:return t(u);default:throw new Tt(u)}}}function gu(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return qn(e,u),n}function Oo(e){if(e.type===le&&e.break||e.type===me&&e.hard||e.type===ve)return!0}function re(e){return gu(e,Oo,!1)}function hu(e){if(e.length>0){let t=_(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Su(e){let t=new Set,r=[];function n(u){if(u.type===ve&&hu(r),u.type===le){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===le&&r.pop().break&&hu(r)}qn(e,n,s,!0)}function _o(e){return e.type===me&&!e.hard?e.soft?"":" ":e.type===xe?e.flatContents:e}function ar(e){return mt(e,_o)}function jo(e){switch(nt(e)){case Pe:if(e.parts.every(t=>t===""))return"";break;case le:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===le&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case Ye:case Xe:case He:case Ne:if(!e.contents)return"";break;case xe:if(!e.flatContents&&!e.breakContents)return"";break;case _e:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof _(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case et:case tt:case rt:case Ve:case me:case je:case ve:break;default:throw new Tt(e)}return e}function Gt(e){return mt(e,t=>jo(t))}function Ie(e,t=Jr){return mt(e,r=>typeof r=="string"?b(t,r.split(`
`)):r)}function vo(e){if(e.type===me)return!0}function Bu(e){return gu(e,vo,!1)}function or(e,t){return e.type===je?{...e,contents:t(e.contents)}:t(e)}function Mo(e){let t=`*${e.value}*`.split(`
`);return t.length>1&&t.every(r=>r.trimStart()[0]==="*")}var bu=Mo;function Pu(e,t){let r=e.node;if(Ct(r))return t.originalText.slice(q(r),k(r)).trimEnd();if(ee(r))return bu(r)?Ro(r):["/*",Ie(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function Ro(e){let t=e.value.split(`
`);return["/*",b(F,t.map((r,n)=>n===0?r.trimEnd():" "+(n<t.length-1?r.trim():r.trimStart()))),"*/"]}var $n={};Ar($n,{endOfLine:()=>Yo,ownLine:()=>Xo,remaining:()=>Ho});function Jo(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function Un(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Jo(e)}function ce(e,t){t.leading=!0,t.trailing=!1,Un(e,t)}function Le(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),Un(e,t)}function V(e,t){t.leading=!1,t.trailing=!0,Un(e,t)}function qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=We(e,n),n=Ot(e,n),n=_t(e,n),n=Ge(e,n);return n}var ut=qo;function Wo(e,t){let r=ut(e,t);return r===!1?"":e.charAt(r)}var ge=Wo;function Go(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
`)return!0;return!1}var Te=Go;function Uo(e){return ee(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var ku=Uo;function Xo(e){return[Mu,Lu,_u,np,Vo,Yn,Hn,Iu,wu,ap,up,Vn,vu,op,Ou,ju,Nn,$o,Ep].some(t=>t(e))}function Yo(e){return[No,_u,Lu,vu,Yn,Hn,Iu,wu,ju,sp,ip,Vn,lp,Nn,Dp,fp,Fp].some(t=>t(e))}function Ho(e){return[Mu,Yn,Hn,Ko,rp,Ou,Vn,tp,ep,yp,Nn,mp].some(t=>t(e))}function It(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?ce(r,t):Le(e,t)}function Xn(e,t){e.type==="BlockStatement"?It(e,t):ce(e,t)}function No({comment:e,followingNode:t}){return t&&ku(e)?(ce(t,e),!0):!1}function Yn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(ge(s,k(e))===")")return V(t,e),!0;if(t===r.consequent&&n===r.alternate){let i=ut(s,k(r.consequent));if(q(e)<i||r.alternate.type==="BlockStatement"){if(t.type==="BlockStatement")V(t,e);else{let a=Ct(e)||e.loc.start.line===e.loc.end.line,p=e.loc.start.line===t.loc.start.line;a&&p?V(t,e):Le(r,e)}return!0}}return n.type==="BlockStatement"?(It(n,e),!0):n.type==="IfStatement"?(Xn(n.consequent,e),!0):r.consequent===n?(ce(n,e),!0):!1}function Hn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(r==null?void 0:r.type)!=="WhileStatement"||!n?!1:ge(s,k(e))===")"?(V(t,e),!0):n.type==="BlockStatement"?(It(n,e),!0):r.body===n?(ce(n,e),!0):!1}function Iu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return(r==null?void 0:r.type)!=="TryStatement"&&(r==null?void 0:r.type)!=="CatchClause"||!n?!1:r.type==="CatchClause"&&t?(V(t,e),!0):n.type==="BlockStatement"?(It(n,e),!0):n.type==="TryStatement"?(Xn(n.finalizer,e),!0):n.type==="CatchClause"?(Xn(n.body,e),!0):!1}function Vo({comment:e,enclosingNode:t,followingNode:r}){return W(t)&&(r==null?void 0:r.type)==="Identifier"?(ce(t,e),!0):!1}function $o({comment:e,enclosingNode:t,followingNode:r,options:n}){return!n.experimentalTernaries||!((t==null?void 0:t.type)==="ConditionalExpression"||(t==null?void 0:t.type)==="ConditionalTypeAnnotation"||(t==null?void 0:t.type)==="TSConditionalType")?!1:(r==null?void 0:r.type)==="ConditionalExpression"||(r==null?void 0:r.type)==="ConditionalTypeAnnotation"||(r==null?void 0:r.type)==="TSConditionalType"?(Le(t,e),!0):!1}function Lu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s,options:u}){let i=t&&!Te(s,k(t),q(e));return(!t||!i)&&((r==null?void 0:r.type)==="ConditionalExpression"||(r==null?void 0:r.type)==="ConditionalTypeAnnotation"||(r==null?void 0:r.type)==="TSConditionalType")&&n?u.experimentalTernaries&&r.alternate===n&&!(ee(e)&&!Te(u.originalText,q(e),k(e)))?(Le(r,e),!0):(ce(n,e),!0):!1}function Ko({comment:e,precedingNode:t,enclosingNode:r}){return Ce(r)&&r.shorthand&&r.key===t&&r.value.type==="AssignmentPattern"?(V(r.value.left,e),!0):!1}var Qo=new Set(["ClassDeclaration","ClassExpression","DeclareClass","DeclareInterface","InterfaceDeclaration","TSInterfaceDeclaration"]);function wu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){if(Qo.has(r==null?void 0:r.type)){if(O(r.decorators)&&(n==null?void 0:n.type)!=="Decorator")return V(_(!1,r.decorators,-1),e),!0;if(r.body&&n===r.body)return It(r.body,e),!0;if(n){if(r.superClass&&n===r.superClass&&t&&(t===r.id||t===r.typeParameters))return V(t,e),!0;for(let s of["implements","extends","mixins"])if(r[s]&&n===r[s][0])return t&&(t===r.id||t===r.typeParameters||t===r.superClass)?V(t,e):Le(r,e,s),!0}}return!1}var zo=new Set(["ClassMethod","ClassProperty","PropertyDefinition","TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSDeclareMethod","MethodDefinition","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","TSParameterProperty"]);function Ou({comment:e,precedingNode:t,enclosingNode:r,text:n}){return r&&t&&ge(n,k(e))==="("&&(r.type==="Property"||r.type==="TSDeclareMethod"||r.type==="TSAbstractMethodDefinition")&&t.type==="Identifier"&&r.key===t&&ge(n,k(t))!==":"?(V(t,e),!0):(t==null?void 0:t.type)==="Decorator"&&zo.has(r==null?void 0:r.type)&&Ct(e)?(V(t,e),!0):!1}va
`;default:return`
`}}var Se=Symbol("MODE_BREAK"),it=Symbol("MODE_FLAT"),Ut=Symbol("cursor"),qu=Symbol("DOC_FILL_PRINTED_LENGTH");function Wu(){return{value:"",length:0,queue:[]}}function xp(e,t){return Qn(e,{type:"indent"},t)}function hp(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||Wu():t<0?Qn(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:Qn(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function Qn(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let c of n)switch(c.type){case"indent":m(),r.useTabs?p(1):o(r.tabWidth);break;case"stringAlign":m(),s+=c.n,u+=c.n.length;break;case"numberAlign":i+=1,a+=c.n;break;default:throw new Error(`Unexpected type '${c.type}'`)}return D(),{...e,value:s,length:u,queue:n};function p(c){s+=" ".repeat(c),u+=r.tabWidth*c}function o(c){s+=" ".repeat(c),u+=c}function m(){r.useTabs?y():D()}function y(){i>0&&p(i),C()}function D(){a>0&&o(a),C()}function C(){i=0,a=0}}function zn(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===Ut){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(Ut);return t}function qr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],p=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:o,doc:m}=a.pop(),y=nt(m);switch(y){case et:p.push(m),r-=ze(m);break;case _e:case Pe:{let D=y===_e?m:m.parts;for(let C=D.length-1;C>=0;C--)a.push({mode:o,doc:D[C]});break}case Xe:case Ye:case He:case je:a.push({mode:o,doc:m.contents});break;case rt:r+=zn(p);break;case le:{if(u&&m.break)return!1;let D=m.break?Se:o,C=m.expandedStates&&D===Se?_(!1,m.expandedStates,-1):m.contents;a.push({mode:D,doc:C});break}case xe:{let C=(m.groupId?s[m.groupId]||it:o)===Se?m.breakContents:m.flatContents;C&&a.push({mode:o,doc:C});break}case me:if(o===Se||m.hard)return!0;m.soft||(p.push(" "),r--);break;case Ne:n=!0;break;case Ve:if(n)return!1;break}}return!1}function Zn(e,t){let r={},n=t.printWidth,s=Ju(t.endOfLine),u=0,i=[{ind:Wu(),mode:Se,doc:e}],a=[],p=!1,o=[],m=0;for(Su(e);i.length>0;){let{ind:D,mode:C,doc:c}=i.pop();switch(nt(c)){case et:{let A=s!==`
`?Y(!1,c,`
`,s):c;a.push(A),i.length>0&&(u+=ze(A));break}case _e:for(let A=c.length-1;A>=0;A--)i.push({ind:D,mode:C,doc:c[A]});break;case tt:if(m>=2)throw new Error("There are too many 'cursor' in doc.");a.push(Ut),m++;break;case Xe:i.push({ind:xp(D,t),mode:C,doc:c.contents});break;case Ye:i.push({ind:hp(D,c.n,t),mode:C,doc:c.contents});break;case rt:u-=zn(a);break;case le:switch(C){case it:if(!p){i.push({ind:D,mode:c.break?Se:it,doc:c.contents});break}case Se:{p=!1;let A={ind:D,mode:it,doc:c.contents},T=n-u,S=o.length>0;if(!c.break&&qr(A,i,T,S,r))i.push(A);else if(c.expandedStates){let g=_(!1,c.expandedStates,-1);if(c.break){i.push({ind:D,mode:Se,doc:g});break}else for(let M=1;M<c.expandedStates.length+1;M++)if(M>=c.expandedStates.length){i.push({ind:D,mode:Se,doc:g});break}else{let R=c.expandedStates[M],j={ind:D,mode:it,doc:R};if(qr(j,i,T,S,r)){i.push(j);break}}}else i.push({ind:D,mode:Se,doc:c.contents});break}}c.id&&(r[c.id]=_(!1,i,-1).mode);break;case Pe:{let A=n-u,T=c[qu]??0,{parts:S}=c,g=S.length-T;if(g===0)break;let M=S[T+0],R=S[T+1],j={ind:D,mode:it,doc:M},I={ind:D,mode:Se,doc:M},U=qr(j,[],A,o.length>0,r,!0);if(g===1){U?i.push(j):i.push(I);break}let P={ind:D,mode:it,doc:R},G={ind:D,mode:Se,doc:R};if(g===2){U?i.push(P,j):i.push(G,I);break}let ue=S[T+2],Q={ind:D,mode:C,doc:{...c,[qu]:T+2}};qr({ind:D,mode:it,doc:[M,R,ue]},[],A,o.length>0,r,!0)?i.push(Q,P,j):U?i.push(Q,G,j):i.push(Q,G,I);break}case xe:case He:{let A=c.groupId?r[c.groupId]:C;if(A===Se){let T=c.type===xe?c.breakContents:c.negate?c.contents:f(c.contents);T&&i.push({ind:D,mode:C,doc:T})}if(A===it){let T=c.type===xe?c.flatContents:c.negate?f(c.contents):c.contents;T&&i.push({ind:D,mode:C,doc:T})}break}case Ne:o.push({ind:D,mode:C,doc:c.contents});break;case Ve:o.length>0&&i.push({ind:D,mode:C,doc:Gn});break;case me:switch(C){case it:if(c.hard)p=!0;else{c.soft||(a.push(" "),u+=1);break}case Se:if(o.length>0){i.push({ind:D,mode:C,doc:c},...o.reverse()),o.length=0;break}c.literal?D.root?(a.push(s,D.root.value),u=D.root.length):(a.push(s),u=0):(u-=zn(a),a.push(s+D.value),u=D.length);break}break;case je:i.push({ind:D,mode:C,doc:c.contents});break;case ve:break;default:throw new Tt(c)}i.length===0&&o.length>0&&(i.push(...o.reverse()),o.length=0)}let y=a.indexOf(Ut);if(y!==-1){let D=a.indexOf(Ut,y+1);if(D===-1)return{formatted:a.filter(T=>T!==Ut).join("")};let C=a.slice(0,y).join(""),c=a.slice(y+1,D).join(""),A=a.slice(D+1).join("");return{formatted:C+c+A,cursorNodeStart:C.length,cursorNodeText:c}}return{formatted:a.join("")}}function gp(e,t,r=0){let n=0;for(let s=r;s<e.length;++s)e[s]===" "?n=n+t-n%t:n++;return n}var Gu=gp;function Sp(e,t){let r=e.lastIndexOf(`
`);return r===-1?0:Gu(e.slice(r+1).match(/^[\t ]*/u)[0],t)}var Uu=Sp;function Wr(e,t,r){let{node:n}=e;if(n.type==="TemplateLiteral"&&Pp(e)){let o=Bp(e,r,t);if(o)return o}let u="expressions";n.type==="TSTemplateLiteralType"&&(u="types");let i=[],a=e.map(t,u);i.push(ke,"`");let p=0;return e.each(({index:o,node:m})=>{if(i.push(t()),m.tail)return;let{tabWidth:y}=r,D=m.value.raw,C=D.includes(`
`)?Uu(D,y):p;p=C;let c=a[o],A=n[u][o],T=Te(r.originalText,k(m),q(n.quasis[o+1]));if(!T){let g=Zn(c,{...r,printWidth:Number.POSITIVE_INFINITY}).formatted;g.includes(`
`)?T=!0:c=g}T&&(d(A)||A.type==="Identifier"||W(A)||A.type==="ConditionalExpression"||A.type==="SequenceExpression"||Ae(A)||De(A))&&(c=[f([E,c]),E]);let S=C===0&&D.endsWith(`
`)?he(Number.NEGATIVE_INFINITY,c):xu(c,C,y);i.push(l(["${",S,ke,"}"]))},"quasis"),i.push("`"),i}function Xu(e,t){let r=t("quasi");return st(r.label&&{tagged:!0,...r.label},[t("tag"),t(e.node.typeArguments?"typeArguments":"typeParameters"),ke,r])}function Bp(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(D=>"${"+Zn(D,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),p=[{hasLineBreak:!1,cells:[]}];for(let D=1;D<n.quasis.length;D++){let C=_(!1,p,-1),c=a[D-1];C.cells.push(c),c.includes(`
`)&&(C.hasLineBreak=!0),n.quasis[D].value.raw.includes(`
`)&&p.push({hasLineBreak:!1,cells:[]})}let o=Math.max(s.length,...p.map(D=>D.cells.length)),m=Array.from({length:o}).fill(0),y=[{cells:s},...p.filter(D=>D.cells.length>0)];for(let{cells:D}of y.filter(C=>!C.hasLineBreak))for(let[C,c]of D.entries())m[C]=Math.max(m[C],ze(c));return i.push(ke,"`",f([F,b(F,y.map(D=>b(" | ",D.cells.map((C,c)=>D.hasLineBreak?C:C+" ".repeat(m[c]-ze(C))))))]),F,"`"),i}}function bp(e,t){let{node:r}=e,n=t();return d(r)&&(n=l([f([E,n]),E])),["${",n,ke,"}"]}function Xt(e,t){return e.map(r=>bp(r,t),"expressions")}function Gr(e,t){return mt(e,r=>typeof r=="string"?t?Y(!1,r,/(\\*)`/gu,"$1$1\\`"):es(r):r)}function es(e){return Y(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function Pp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&r.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&r.test(t.tag.object.object.name))}var rs=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function Yu(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Ce(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>X(n)&&s==="elements",r,...rs)||e.match(t,r,...rs)}function Hu(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Ce(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...rs)}function ts(e,t){return d(e,h.Block|h.Leading,({value:r})=>r===` ${t} `)}function Ur({node:e,parent:t},r){return ts(e,r)||kp(t)&&ts(t,r)||t.type==="ExpressionStatement"&&ts(t,r)}function kp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Ip(e,t,r){let{node:n}=r,s=n.quasis.map(m=>m.value.raw),u=0,i=s.reduce((m,y,D)=>D===0?y:m+"@prettier-placeholder-"+u+++"-id"+y,""),a=await e(i,{parser:"scss"}),p=Xt(r,t),o=Lp(a,p);if(!o)throw new Error("Couldn't insert all the expressions");return["`",f([F,o]),E,"`"]}function Lp(e,t){if(!O(t))return e;let r=0,n=mt(Gt(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/u).map((u,i)=>i%2===0?Ie(u):(r++,t[u])));return t.length===r?n:null}function wp({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Xr(e){return e.type==="Identifier"&&e.name==="styled"}function Nu(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function Op({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Xr(t.object)||Nu(t);case"CallExpression":return Xr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Xr(t.callee.object.object)||Nu(t.callee.object))||t.callee.object.type==="CallExpression"&&Xr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function _p({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function jp(e){if(wp(e)||Op(e)||_p(e)||Yu(e))retur
`),C=D.length,c=u[a],A=C>2&&D[0].trim()===""&&D[1].trim()==="",T=C>2&&D[C-1].trim()===""&&D[C-2].trim()==="",S=D.every(M=>/^\s*(?:#[^\n\r]*)?$/u.test(M));if(!m&&/#[^\n\r]*$/u.test(D[C-1]))return null;let g=null;S?g=Mp(D):g=await e(y,{parser:"graphql"}),g?(g=Gr(g,!1),!o&&A&&i.push(""),i.push(g),!m&&T&&i.push("")):!o&&!m&&A&&i.push(""),c&&i.push(c)}return["`",f([F,b(F,i)]),F,"`"]}function Mp(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([F,u]):t.push(u),r=!0);return t.length===0?null:b(F,t)}function Rp({node:e,parent:t}){return Ur({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function Jp(e){if(Rp(e))return vp}var $u=Jp;var ns=0;async function Ku(e,t,r,n,s){let{node:u}=n,i=ns;ns=ns+1>>>0;let a=S=>`PRETTIER_HTML_PLACEHOLDER_${S}_${i}_IN_JS`,p=u.quasis.map((S,g,M)=>g===M.length-1?S.value.cooked:S.value.cooked+a(g)).join(""),o=Xt(n,r),m=new RegExp(a(String.raw`(\d+)`),"gu"),y=0,D=await t(p,{parser:e,__onHtmlRoot(S){y=S.children.length}}),C=mt(D,S=>{if(typeof S!="string")return S;let g=[],M=S.split(m);for(let R=0;R<M.length;R++){let j=M[R];if(R%2===0){j&&(j=es(j),s.__embeddedInHtml&&(j=Y(!1,j,/<\/(?=script\b)/giu,String.raw`<\/`)),g.push(j));continue}let I=Number(j);g.push(o[I])}return g}),c=/^\s/u.test(p)?" ":"",A=/\s$/u.test(p)?" ":"",T=s.htmlWhitespaceSensitivity==="ignore"?F:c&&A?x:null;return T?l(["`",f([T,l(C)]),T,"`"]):st({hug:!1},l(["`",c,y>1?f(l(C)):l(C),A,"`"]))}function qp(e){return Ur(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Wp=Ku.bind(void 0,"html"),Gp=Ku.bind(void 0,"angular");function Up(e){if(qp(e))return Wp;if(Hu(e))return Gp}var Qu=Up;async function Xp(e,t,r){let{node:n}=r,s=Y(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(p,o)=>"\\".repeat(o.length/2)+"`"),u=Yp(s),i=u!=="";i&&(s=Y(!1,s,new RegExp(`^${u}`,"gmu"),""));let a=Gr(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?f([E,a]):[Jr,du(a)],E,"`"]}function Yp(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function Hp(e){if(Np(e))return Xp}function Np({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var zu=Hp;function Vp(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||$p(t))return;let r;for(let n of[Vu,$u,Qu,zu])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&st({embed:!0,...u.label},u)}}function $p({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var Zu=Vp;var Kp=/\*\/$/,Qp=/^\/\*\*?/,ni=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,zp=/(^|\s+)\/\/([^\n\r]*)/g,ei=/^(\r?\n)+/,Zp=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,ti=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ec=/(\r?\n|^) *\* ?/g,si=[];function ui(e){let t=e.match(ni);return t?t[0].trimStart():""}function ii(e){let t=e.match(ni),r=t==null?void 0:t[0];return r==null?e:e.slice(r.length)}function ai(e){let t=`
`;e=Y(!1,e.replace(Qp,"").replace(Kp,""),ec,"$1");let r="";for(;r!==e;)r=e,e=Y(!1,e,Zp,`${t}$1 $2${t}`);e=e.replace(ei,"").trimEnd();let n=Object.create(null),s=Y(!1,e,ti,"").replace(ei,"").trimEnd(),u;for(;u=ti.exec(e);){let i=Y(!1,u[2],zp,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let a=n[u[1]];n[u[1]]=[...si,...Array.isArray(a)?a:[a],i]}else n[u[1]]=i}return{comments:s,pragmas:n}}function oi({comments:e="",pragmas:t={}}){let r=`
`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(o=>ri(o,t[o])).map(o=>`${s} ${o}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let o=t[i[0]];return`${n} ${ri(i[0],o)[0]}${u}`}}let p=e.split(r).map(o=>`${s} ${o}`).join(r)+r;return n+r+(e?p:"")+(e&&i.length>0?s+r:"")+a+u}function ri(e,t){return[...si,...Array.isArray(t)?t:[t]].map(r=>`@${e} ${r}`.trim())}function tc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
`);return t===-1?e:e.slice(0,t)}var pi=tc;function rc(e){let t=pi(e);t&&(e=e.slice(t.length+1));let r=ui(e),{pragmas:n,comments:s}=ai(r);return{shebang:t,text:e,pragmas:n,comments:s}}function ci(e){let{shebang:t,text:r,pragmas:n,comments:s}=rc(e),u=ii(r),i=oi({pragmas:{format:"",...n},comments:s.trimStart()});return(t?`${t}
`:"")+i+(u.startsWith(`
`)?`
`:`
`)+u}function nc(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,p=s(a),o=u(a);for(let m of n)s(m)>=p&&u(m)<=o&&i.add(m);return r.slice(p,o)}var li=nc;function ss(e,t){var u,i,a,p,o,m,y,D,C;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&ac(r)&&pr(e))return!0;if(sc(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(A=>A.type==="ForOfStatement"))==null?void 0:i.left;if(c&&ie(c,A=>A===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(T=>T.type==="ExpressionStatement"||T.type==="ForStatement"||T.type==="ForInStatement"),A=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(A&&ie(A,T=>T===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let c=e.findAncestor(A=>!Ae(A));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(A=>A.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&ie(c,A=>A===r))return!0}if(r.type==="ObjectExpression"){let c=(p=e.findAncestor(A=>A.type==="ArrowFunctionExpression"))==null?void 0:p.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&ie(c,A=>A===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&O(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return mi(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"&&!pc(r))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,A)=>A==="returnType"&&c.type==="ArrowFunctionExpression")&&ic(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(n==="init"&&e.match(void 0,void 0,(c,A)=>A==="declarations"&&c.type==="VariableDeclaration",(c,A)=>A==="left"&&c.type==="ForInStatement"))return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&uc(e))return!0;if(r.operator==="|>"&&((o=r.extra)!=null&&o.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Ae
\r `),ls=e=>e===""||e===x||e===F||e===E;function Dc(e,t,r){var M,R,j,I,U;let{node:n}=e;if(n.type==="JSXElement"&&Pc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(P=>kc(P)?{type:"JSXText",value:" ",raw:" "}:P);let i=n.children.some(H),a=n.children.filter(P=>P.type==="JSXExpressionContainer").length>1,p=n.type==="JSXElement"&&n.openingElement.attributes.length>1,o=re(s)||i||p||a,m=e.parent.rootMarker==="mdx",y=t.singleQuote?"{' '}":'{" "}',D=m?" ":B([y,E]," "),C=((R=(M=n.openingElement)==null?void 0:M.name)==null?void 0:R.name)==="fbt",c=fc(e,t,r,D,C),A=n.children.some(P=>cr(P));for(let P=c.length-2;P>=0;P--){let G=c[P]===""&&c[P+1]==="",ue=c[P]===F&&c[P+1]===""&&c[P+2]===F,Q=(c[P]===E||c[P]===F)&&c[P+1]===""&&c[P+2]===D,gt=c[P]===D&&c[P+1]===""&&(c[P+2]===E||c[P+2]===F),Ft=c[P]===D&&c[P+1]===""&&c[P+2]===D,w=c[P]===E&&c[P+1]===""&&c[P+2]===F||c[P]===F&&c[P+1]===""&&c[P+2]===E;ue&&A||G||Q||Ft||w?c.splice(P,2):gt&&c.splice(P+1,2)}for(;c.length>0&&ls(_(!1,c,-1));)c.pop();for(;c.length>1&&ls(c[0])&&ls(c[1]);)c.shift(),c.shift();let T=[];for(let[P,G]of c.entries()){if(G===D){if(P===1&&c[P-1]===""){if(c.length===2){T.push(y);continue}T.push([y,F]);continue}else if(P===c.length-1){T.push(y);continue}else if(c[P-1]===""&&c[P-2]===F){T.push(y);continue}}T.push(G),re(G)&&(o=!0)}let S=A?Rr(T):l(T,{shouldBreak:!0});if(((j=t.cursorNode)==null?void 0:j.type)==="JSXText"&&n.children.includes(t.cursorNode)?S=[ir,S,ir]:((I=t.nodeBeforeCursor)==null?void 0:I.type)==="JSXText"&&n.children.includes(t.nodeBeforeCursor)?S=[ir,S]:((U=t.nodeAfterCursor)==null?void 0:U.type)==="JSXText"&&n.children.includes(t.nodeAfterCursor)&&(S=[S,ir]),m)return S;let g=l([s,f([F,S]),F,u]);return o?g:Ke([l([s,...c,u]),g])}function fc(e,t,r,n,s){let u=[];return e.each(({node:i,next:a})=>{if(i.type==="JSXText"){let p=fe(i);if(cr(i)){let o=Yr.split(p,!0);o[0]===""&&(u.push(""),o.shift(),/\n/u.test(o[0])?u.push(Ei(s,o[1],i,a)):u.push(n),o.shift());let m;if(_(!1,o,-1)===""&&(o.pop(),m=o.pop()),o.length===0)return;for(let[y,D]of o.entries())y%2===1?u.push(x):u.push(D);m!==void 0?/\n/u.test(m)?u.push(Ei(s,_(!1,u,-1),i,a)):u.push(n):u.push(fi(s,_(!1,u,-1),i,a))}else/\n/u.test(p)?p.match(/\n/gu).length>1&&u.push("",F):u.push("",n)}else{let p=r();if(u.push(p),a&&cr(a)){let m=Yr.trim(fe(a)),[y]=Yr.split(m);u.push(fi(s,y,i,a))}else u.push(F)}},"children"),u}function fi(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?E:F:E}function Ei(e,t,r,n){return e?F:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?F:E:F}var Ec=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function Fc(e,t,r){let{parent:n}=e;if(Ec.has(n.type))return t;let s=e.match(void 0,i=>i.type==="ArrowFunctionExpression",L,i=>i.type==="JSXExpressionContainer"),u=Be(e,r);return l([u?"":B("("),f([E,t]),E,u?"":B(")")],{shouldBreak:s})}function Cc(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(te(n.value)){let i=fe(n.value),a=Y(!1,Y(!1,i.slice(1,-1),"&apos;","'"),"&quot;",'"'),p=xr(a,t.jsxSingleQuote);a=p==='"'?Y(!1,a,'"',"&quot;"):Y(!1,a,"'","&apos;"),u=e.call(()=>ye(e,Ie(p+a+p),t),"value")}else u=r("value");s.push("=",u)}return s}function Ac(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!d(u)&&(X(u)||se(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||L(u)||u.type==="ChainExpression"&&L(u.expression)||u.type==="FunctionE
`)&&!s&&!d(n.attributes[0]))return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(p=n.attributes)==null?void 0:p.some(o=>te(o.value)&&o.value.value.includes(`
`)),i=t.singleAttributePerLine&&n.attributes.length>1?F:x;return l(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),f(e.map(()=>[i,r()],"attributes")),...dc(n,t,s)],{shouldBreak:u})}function dc(e,t,r){return e.selfClosing?[x,"/>"]:xc(e,t,r)?[">"]:[E,">"]}function xc(e,t,r){let n=e.attributes.length>0&&d(_(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function hc(e,t,r){let{node:n}=e,s=[];s.push("</");let u=r("name");return d(n.name,h.Leading|h.Line)?s.push(f([F,u]),F):d(n.name,h.Leading|h.Block)?s.push(" ",u):s.push(u),s.push(">"),s}function gc(e,t){let{node:r}=e,n=d(r),s=d(r,h.Line),u=r.type==="JSXOpeningFragment";return[u?"<":"</",f([s?F:n&&!u?" ":"",J(e,t)]),s?F:"",">"]}function Sc(e,t,r){let n=ye(e,Dc(e,t,r),t);return Fc(e,n,t)}function Bc(e,t){let{node:r}=e,n=d(r,h.Line);return[J(e,t,{indent:n}),n?F:""]}function bc(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!d(s)||!Kn(e)?u:[f([E,ye(e,u,t)]),E]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function Fi(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return Cc(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return b(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return b(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return bc(e,t,r);case"JSXExpressionContainer":return Ac(e,t,r);case"JSXFragment":case"JSXElement":return Sc(e,t,r);case"JSXOpeningElement":return Tc(e,t,r);case"JSXClosingElement":return hc(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return gc(e,t);case"JSXEmptyExpression":return Bc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new Me(n,"JSX")}}function Pc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!cr(t)}function cr(e){return e.type==="JSXText"&&(Yr.hasNonWhitespaceCharacter(fe(e))||!/\n/u.test(fe(e)))}function kc(e){return e.type==="JSXExpressionContainer"&&te(e.expression)&&e.expression.value===" "&&!d(e.expression)}function Ci(e){let{node:t,parent:r}=e;if(!H(t)||!H(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!cr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&kt(u.expression)}function Ic(e){return kt(e.node)||Ci(e)}var Hr=Ic;var Lc=0;function Nr(e,t,r){var R;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),p=n.operator==="|>"&&((R=e.root.extra)==null?void 0:R.__isUsingHackPipeline),o=ms(e,r,t,!1,a);if(a)return o;if(p)return l(o);if(L(s)&&s.callee===n||s.type==="UnaryExpression"||W(s)&&!s.computed)return l([f([E,...o]),E]);let m=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!L(u)||s.type==="TemplateLiteral",y=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Ce(s),D=De(n.left)&&sr(n.operator,n.left.operator);if(m||Yt(n)&&!D||!Yt(n)&&y)return l(o);if(o.length===0)return"";let C=H(n.right),c=o.findIndex(j=>typeof j!="string"&&!Array.isArray(j)&&j.type===le),A=o.slice(0,c===-1?1:c+1),T=o.slice(A.length,C?-1:void 0),S=Symbol("logicalChain-"+ ++Lc),g=l([...A,f(T)],{id:S});if(!C)return g;let M=_(!1,o,-1);return l([g,dt(M,{groupId:S})])}function ms(e,t,r,n,