Files
client/node_modules/prettier/plugins/angular.mjs
T

6 lines
129 KiB
JavaScript
Raw Normal View History

2026-10-07 18:56:27 +02:00
var lr=Object.defineProperty;var cr=Object.getPrototypeOf;var ur=Reflect.get;var kn=t=>{throw TypeError(t)};var _n=(t,e)=>{for(var n in e)lr(t,n,{get:e[n],enumerable:!0})};var vt=(t,e,n)=>e.has(t)||kn("Cannot "+n);var z=(t,e,n)=>(vt(t,e,"read from private field"),n?n.call(t):e.get(t)),De=(t,e,n)=>e.has(t)?kn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),wt=(t,e,n,s)=>(vt(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),w=(t,e,n)=>(vt(t,e,"access private method"),n);var In=(t,e,n)=>ur(cr(t),n,e);var or={};_n(or,{parsers:()=>Cn});var Cn={};_n(Cn,{__ng_action:()=>Ko,__ng_binding:()=>Zo,__ng_directive:()=>ta,__ng_interpolation:()=>ea});function pr(t){return typeof t=="string"?e=>e===t:e=>t.test(e)}function An(t,e,n){let s=pr(e);for(let i=n;i<t.length;i++){let r=t[i];if(s(r))return i}throw new Error(`Cannot find character ${e} from index ${n} in ${JSON.stringify(t)}`)}function Pn(t){return t.slice(0,1).toLowerCase()+t.slice(1)}function Be(t){let{start:e,end:n}=t;return{start:e,end:n,range:[e,n]}}function Nn(t){return!!t.extra?.parenthesized}function ye(t){return t.type==="TSNonNullExpression"&&!Nn(t)?ye(t.expression):(t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression")&&!Nn(t)}var ra=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var x;(function(t){t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t[t.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING"})(x||(x={}));var K,Ln="svg",hr="math",Bs="",$n="*",yt=()=>Object.create(null);function fr(){return K||(K=yt(),B(x.HTML,void 0,[["iframe",["srcdoc"]],["*",["innerHTML","outerHTML"]]]),B(x.STYLE,void 0,[["*",["style"]]]),B(x.URL,void 0,[["*",["formAction"]],["area",["href"]],["a",["href","xlink:href"]],["form",["action"]],["img",["src"]],["video",["src"]]]),B(x.URL,hr,[["*",["href","xlink:href"]]]),B(x.RESOURCE_URL,void 0,[["base",["href"]],["embed",["src"]],["frame",["src"]],["iframe",["src"]],["link",["href"]],["object",["codebase","data"]]]),B(x.URL,Ln,[["a",["href","xlink:href"]]]),B(x.ATTRIBUTE_NO_BINDING,Ln,[["animate",["attributeName","values","to","from"]],["set",["to","attributeName"]],["animateMotion",["attributeName"]],["animateTransform",["attributeName"]]]),B(x.ATTRIBUTE_NO_BINDING,void 0,[["unknown",["attributeName","values","to","from","sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]],["iframe",["sandbox","allow","allowFullscreen","referrerPolicy","csp","fetchPriority","credentialless"]]]),K)}function B(t,e,n){let s=e??Bs;for(let[i,r]of n){let a=i.toLowerCase();for(let u of r){let h=u.toLowerCase(),d=K[h]??(K[h]=yt()),g=d[s]??(d[s]=yt());g[a]=t}}}function dr(t,e,n){let i=fr()[e.toLowerCase()];if(!i)return x.NONE;let r=t.toLowerCase(),a;if(n){let u=i[n];u&&(a=u[r]??u[$n])}if(a===void 0){let u=i[Bs];u&&(a=u[r]??u[$n])}return a??x.NONE}var Mn;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(Mn||(Mn={}));var Rn;(function(t){t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t[t.Eager=1]="Eager"})(Rn||(Rn={}));var On;(function(t){t[t.None=0]="None",t[t.SignalBased=1]="SignalBased",t[t.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(On||(On={}));var Dn={name:"custom-elements"},Bn={name:"no-errors-schema"};var Fn;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Ignore=2]="Ignore"})(Fn||(Fn={}));var Vn;(function(t){t[t.Directive=0]="Directive",t[t.Component=1]="Component",t[t.Injectable=2]="Injectable",t[t.Pipe=3]="Pipe",t[t.NgModule=4]="NgModule",t[t.Service=5]="Service"})(Vn||(Vn={}));var Hn;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(Hn||(Hn={}));var Un;(function(t){t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t[t.ExperimentalIsolatedShadowDom=4]="ExperimentalIsolatedShadowDom"})(Un||(Un={}))
`&&++u==n)););for(a=0,u=0;a<e&&r<s.length-1&&(r++,a++,!(s[r]==`
`&&++u==n)););return{before:s.substring(i,this.offset),after:s.substring(this.offset,r+1)}}return null}},et=class{content;url;constructor(e,n){this.content=e,this.url=n}},tt=class{start;end;fullStart;details;constructor(e,n,s=e,i=null){this.start=e,this.end=n,this.fullStart=s,this.details=i}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},nt;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(nt||(nt={}));var Re=class extends Error{span;msg;level;relatedError;constructor(e,n,s=nt.ERROR,i){super(n),this.span=e,this.msg=n,this.level=s,this.relatedError=i,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${nt[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var os;(function(t){t[t.Inline=0]="Inline",t[t.SideEffect=1]="SideEffect",t[t.Omit=2]="Omit"})(os||(os={}));var as;(function(t){t[t.Global=0]="Global",t[t.Local=1]="Local",t[t.Isolated=2]="Isolated"})(as||(as={}));var ls;(function(t){t[t.Directive=0]="Directive",t[t.Pipe=1]="Pipe",t[t.NgModule=2]="NgModule"})(ls||(ls={}));var Vr="(:(where|is)\\()?";var Xs="-shadowcsshost",Hr="-shadowcsscontext",tn="[^)(]*",Ur=`(?:\\(${tn}\\)|${tn})+?`,Wr=`(?:\\(${Ur}\\)|${tn})+?`,fn=`(?:\\((${Wr})\\))`,ca=new RegExp("(:nth-[-\\w]+)"+fn,"g"),ua=new RegExp(Xs+fn+"?([^,{]*)","gim"),qr=Hr+fn+"([^{]*)",pa=new RegExp(`${Vr}(${qr})`,"gim"),jr=Xs+"-no-combinator",ha=new RegExp(`${jr}(?![^(]*\\))`,"g");var Qs="%COMMENT%",fa=new RegExp(Qs,"g");var da=new RegExp(`(\\s*(?:${Qs}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`,"g");var zr="%COMMA_IN_PLACEHOLDER%",Gr="%SEMI_IN_PLACEHOLDER%",Xr="%COLON_IN_PLACEHOLDER%",ma=new RegExp(zr,"g"),ga=new RegExp(Gr,"g"),va=new RegExp(Xr,"g");var l;(function(t){t[t.ListEnd=0]="ListEnd",t[t.Statement=1]="Statement",t[t.Variable=2]="Variable",t[t.ElementStart=3]="ElementStart",t[t.Element=4]="Element",t[t.Template=5]="Template",t[t.ElementEnd=6]="ElementEnd",t[t.ContainerStart=7]="ContainerStart",t[t.Container=8]="Container",t[t.ContainerEnd=9]="ContainerEnd",t[t.DisableBindings=10]="DisableBindings",t[t.ConditionalCreate=11]="ConditionalCreate",t[t.ConditionalBranchCreate=12]="ConditionalBranchCreate",t[t.Conditional=13]="Conditional",t[t.EnableBindings=14]="EnableBindings",t[t.Text=15]="Text",t[t.Listener=16]="Listener",t[t.InterpolateText=17]="InterpolateText",t[t.Binding=18]="Binding",t[t.Property=19]="Property",t[t.StyleProp=20]="StyleProp",t[t.ClassProp=21]="ClassProp",t[t.StyleMap=22]="StyleMap",t[t.ClassMap=23]="ClassMap",t[t.Advance=24]="Advance",t[t.Pipe=25]="Pipe",t[t.Attribute=26]="Attribute",t[t.ExtractedAttribute=27]="ExtractedAttribute",t[t.Defer=28]="Defer",t[t.DeferOn=29]="DeferOn",t[t.DeferWhen=30]="DeferWhen",t[t.I18nMessage=31]="I18nMessage",t[t.DomProperty=32]="DomProperty",t[t.Namespace=33]="Namespace",t[t.ProjectionDef=34]="ProjectionDef",t[t.EnableIncrementalHydrationRuntime=35]="EnableIncrementalHydrationRuntime",t[t.Projection=36]="Projection",t[t.RepeaterCreate=37]="RepeaterCreate",t[t.Repeater=38]="Repeater",t[t.TwoWayProperty=39]="TwoWayProperty",t[t.TwoWayListener=40]="TwoWayListener",t[t.DeclareLet=41]="DeclareLet",t[t.StoreLet=42]="StoreLet",t[t.I18nStart=43]="I18nStart",t[t.I18n=44]="I18n",t[t.I18nEnd=45]="I18nEnd",t[t.I18nExpression=46]="I18nExpression",t[t.I18nApply=47]="I18nApply",t[t.IcuStart=48]="IcuStart",t[t.IcuEnd=49]="IcuEnd",t[t.IcuPlaceholder=50]="IcuPlaceholder",t[t.I18nContext=51]="I18nContext",t[t.I18nAttributes=52]="I18nAttributes",t[t.SourceLocation=53]="SourceLocation",t[t.Animation=54]="Animation",t[t.AnimationString=55]="AnimationString",t[t.AnimationBinding=56]="AnimationBinding",t[t.AnimationListener=57]="AnimationListener",t[t.Control=58]="Control",t[t.ControlCreate=59]="ControlCreate"})(l||(l={}));var te;(function(t){t[t.LexicalRead=0]="LexicalRead",t[t.Context=1]="Context",t[t.TrackContext=2]="TrackContext",t[t.ReadVariable=3]="ReadVariable"
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,Na=new RegExp(`[^${Ys}]`),Aa=new RegExp(`[${Ys}]{2,}`,"g");var f;(function(t){t[t.Character=0]="Character",t[t.Identifier=1]="Identifier",t[t.PrivateIdentifier=2]="PrivateIdentifier",t[t.Keyword=3]="Keyword",t[t.String=4]="String",t[t.Operator=5]="Operator",t[t.Number=6]="Number",t[t.RegExpBody=7]="RegExpBody",t[t.RegExpFlags=8]="RegExpFlags",t[t.Error=9]="Error"})(f||(f={}));var W;(function(t){t[t.Plain=0]="Plain",t[t.TemplateLiteralPart=1]="TemplateLiteralPart",t[t.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(W||(W={}));var to=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in","instanceof"],Oe=class{tokenize(e){return new rn(e).scan()}},I=class{index;end;type;numValue;strValue;constructor(e,n,s,i,r){this.index=e,this.end=n,this.type=s,this.numValue=i,this.strValue=r}isCharacter(e){return this.type===f.Character&&this.numValue===e}isNumber(){return this.type===f.Number}isString(){return this.type===f.String}isOperator(e){return this.type===f.Operator&&this.strValue===e}isIdentifier(){return this.type===f.Identifier}isPrivateIdentifier(){return this.type===f.PrivateIdentifier}isKeyword(){return this.type===f.Keyword}isKeywordLet(){return this.type===f.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===f.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===f.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===f.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===f.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===f.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===f.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===f.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===f.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===f.Keyword&&this.strValue==="in"}isKeywordInstanceOf(){return this.type===f.Keyword&&this.strValue==="instanceof"}isError(){return this.type===f.Error}isRegExpBody(){return this.type===f.RegExpBody}isRegExpFlags(){return this.type===f.RegExpFlags}toNumber(){return this.type===f.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===W.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===W.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}toString(){switch(this.type){case f.Character:case f.Identifier:case f.Keyword:case f.Operator:case f.PrivateIdentifier:case f.String:case f.Error:case f.RegExpBody:case f.RegExpFlags:return this.strValue;case f.Number:return this.numValue.toString();default:return null}}},Ae=class extends I{kind;constructor(e,n,s,i){super(e,n,f.String,0,s),this.kind=i}};function Ce(t,e,n){return new I(t,e,f.Character,n,String.fromCharCode(n))}function no(t,e,n){return new I(t,e,f.Identifier,0,n)}function so(t,e,n){return new I(t,e,f.PrivateIdentifier,0,n)}function io(t,e,n){return new I(t,e,f.Keyword,0,n)}function F(t,e,n){return new I(t,e,f.Operator,0,n)}function ro(t,e,n){return new I(t,e,f.Number,n,"")}function oo(t,e,n){return new I(t,e,f.Error,0,n)}function ao(t,e,n){return new I(t,e,f.RegExpBody,0,n)}function lo(t,e,n){return new I(t,e,f.RegExpFlags,0,n)}var be=new I(-1,-1,f.Character,0,""),rn=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(e){this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Ee:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,n=this.length,s=this.peek,i=this.index;for(;s<=Vs;)if(++i>=n){s=Ee;break}else s=e.charCodeAt(i);if(this.peek=s,this.index=i,i>=n)return null;if(Ts(s))return this.scanIdentifier();if(X(s))return this.scanNumber(i);let r=i;switch(s){case G:return this.advance(),X(this.peek)?this.scanNumber(r):this.peek!==G?Ce(r,this.index,G):(this.advance(),this.peek===G?(this.advance(),F(r,this.index,"...")):this.error(`Unexpected chara
If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let n=Fe(e),s=this._schema.get(n)||this._schema.get("unknown");return Array.from(s.keys()).map(i=>Eo.get(i)??i)}allKnownEventsOfElement(e){let n=Fe(e);return Array.from(this._eventSchema.get(n)??[])}normalizeAnimationStyleProperty(e){return wr(e)}normalizeAnimationStyleValue(e,n,s){let i="",r=s.toString().trim(),a=null;if(Co(e)&&s!==0&&s!=="0")if(typeof s=="number")i="px";else{let u=s.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&(a=`Please provide a CSS unit value for ${n}:${s}`)}return{error:a,value:r+i}}};function Co(t){switch(t){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var Pa=new ge(new Oe);function $(t){return e=>e.kind===t}function Pe(t,e){return n=>n.kind===t&&e===n.expression instanceof me}function bo(t){return(t.kind===l.Property||t.kind===l.TwoWayProperty)&&!(t.expression instanceof me)}var La=[{test:$(l.StyleMap),transform:rt},{test:$(l.ClassMap),transform:rt},{test:$(l.StyleProp)},{test:$(l.ClassProp)},{test:Pe(l.Attribute,!0)},{test:Pe(l.Property,!0)},{test:bo},{test:Pe(l.Attribute,!1)},{test:$(l.Control)}],$a=[{test:Pe(l.DomProperty,!0)},{test:Pe(l.DomProperty,!1)},{test:$(l.Attribute)},{test:$(l.StyleMap),transform:rt},{test:$(l.ClassMap),transform:rt},{test:$(l.StyleProp)},{test:$(l.ClassProp)}],Ma=new Set([l.Listener,l.TwoWayListener,l.AnimationListener,l.StyleMap,l.ClassMap,l.StyleProp,l.ClassProp,l.Property,l.TwoWayProperty,l.DomProperty,l.Attribute,l.Animation,l.Control]);function rt(t){return t.slice(t.length-1)}var Ra=new Map([[O.Idle,{none:c.deferOnIdle,prefetch:c.deferPrefetchOnIdle,hydrate:c.deferHydrateOnIdle}],[O.Immediate,{none:c.deferOnImmediate,prefetch:c.deferPrefetchOnImmediate,hydrate:c.deferHydrateOnImmediate}],[O.Timer,{none:c.deferOnTimer,prefetch:c.deferPrefetchOnTimer,hydrate:c.deferHydrateOnTimer}],[O.Hover,{none:c.deferOnHover,prefetch:c.deferPrefetchOnHover,hydrate:c.deferHydrateOnHover}],[O.Interaction,{none:c.deferOnInteraction,prefetch:c.deferPrefetchOnInteraction,hydrate:c.deferHydrateOnInteraction}],[O.Viewport,{none:c.deferOnViewport,prefetch:c.deferPrefetchOnViewport,hydrate:c.deferHydrateOnViewport}],[O.Never,{none:c.deferHydrateNever,prefetch:c.deferHydrateNever,hydrate:c.deferHydrateNever}]]);var Oa=[c.pipeBind1,c.pipeBind2,c.pipeBind3,c.pipeBind4];var Da={constant:[c.interpolate,c.interpolate1,c.interpolate2,c.interpolate3,c.interpolate4,c.interpolate5,c.interpolate6,c.interpolate7,c.interpolate8],variable:c.interpolateV,mapping:t=>{if(t%2===0)throw new Error("Expected odd number of arguments");return(t-1)/2}};var Ba=new Map([["window",c.resolveWindow],["document",c.resolveDocument],["body",c.resolveBody]]);var Fa=new Map([[x.HTML,c.sanitizeHtml],[x.RESOURCE_URL,c.sanitizeResourceUrl],[x.SCRIPT,c.sanitizeScript],[x.STYLE,c.sanitizeStyle],[x.URL,c.sanitizeUrl],[x.ATTRIBUTE_NO_BINDING,c.validateAttribute]]),Va=new Map([[x.HTML,c.trustConstantHtml],[x.RESOURCE_URL,c.trustConstantResourceUrl]]);var Is;(function(t){t[t.None=0]="None",t[t.ViewContextRead=1]="ViewContextRead",t[t.ViewContextWrite=2]="ViewContextWrite",t[t.SideEffectful=4]="SideEffectful"})(Is||(Is={}));var Ha=new Map([[M.Property,R.Property],[M.TwoWay,R.TwoWayProperty],[M.Attribute,R.Attribute],[M.Class,R.ClassName],[M.Style,R.StyleProperty],[M.LegacyAnimation,R.LegacyAnim