mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-02 03:19:31 +08:00
1 line
No EOL
146 KiB
Text
1 line
No EOL
146 KiB
Text
{"version":3,"file":"plugin.js","sources":["src/lib/elements.ts","src/lib/extractAttributes.ts","src/lib/getText.ts","src/lib/snipTagContent.ts","src/options.ts","src/print/helpers.ts","src/print/doc-helpers.ts","src/print/node-helpers.ts","src/print/index.ts","src/embed.ts","src/index.ts"],"sourcesContent":["export type TagName = keyof HTMLElementTagNameMap | 'svg';\n\n// @see http://xahlee.info/js/html5_non-closing_tag.html\nexport const selfClosingTags = [\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#Elements\nexport const blockElements: TagName[] = [\n 'address',\n 'article',\n 'aside',\n 'blockquote',\n 'details',\n 'dialog',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'ul',\n];\n\n/**\n * HTML attributes that we may safely reformat (trim whitespace, add or remove newlines)\n */\nexport const formattableAttributes: string[] = [\n // None at the moment\n // Prettier HTML does not format attributes at all\n // and to be consistent we leave this array empty for now\n];\n","import { AttributeNode, TextNode } from '../print/nodes';\n\nexport function extractAttributes(html: string): AttributeNode[] {\n const extractAttributesRegex = /<[a-z]+\\s*(.*?)>/i;\n const attributeRegex = /([^\\s=]+)(?:=(\"|')(.*?)\\2)?/gi;\n\n const [, attributesString] = html.match(extractAttributesRegex)!;\n\n const attrs: AttributeNode[] = [];\n\n let match: RegExpMatchArray | null;\n while ((match = attributeRegex.exec(attributesString))) {\n const [all, name, quotes, value] = match;\n const attrStart = match.index!;\n\n let valueNode: AttributeNode['value'];\n if (!value) {\n valueNode = true;\n } else {\n let valueStart = attrStart + name.length;\n if (quotes) {\n valueStart += 2;\n }\n\n valueNode = [\n {\n type: 'Text',\n data: value,\n start: valueStart,\n end: valueStart + value.length,\n } as TextNode,\n ];\n }\n\n attrs.push({\n type: 'Attribute',\n name,\n value: valueNode,\n start: attrStart,\n end: attrStart + all.length,\n });\n }\n\n return attrs;\n}\n","import { ParserOptions } from 'prettier';\nimport { Node } from '../print/nodes';\n\nexport function getText(node: Node, options: ParserOptions) {\n const leadingComments: Node[] = (node as any).leadingComments\n\n return options.originalText.slice(\n options.locStart(\n // if there are comments before the node they are not included \n // in the `start` of the node itself\n leadingComments && leadingComments[0] || node,\n ),\n options.locEnd(node),\n );\n}\n","export const snippedTagContentAttribute = '✂prettier:content✂';\n\nexport function snipScriptAndStyleTagContent(source: string): string {\n let scriptMatchSpans = getMatchIndexes('script');\n let styleMatchSpans = getMatchIndexes('style');\n\n return snipTagContent(\n snipTagContent(source, 'script', '{}', styleMatchSpans),\n 'style',\n '',\n scriptMatchSpans,\n );\n\n function getMatchIndexes(tagName: string) {\n const regex = getRegexp(tagName);\n const indexes: [number, number][] = [];\n let match = null;\n while ((match = regex.exec(source)) != null) {\n if (source.slice(match.index, match.index + 4) !== '<!--') {\n indexes.push([match.index, regex.lastIndex]);\n }\n }\n return indexes;\n }\n\n function snipTagContent(\n _source: string,\n tagName: string,\n placeholder: string,\n otherSpans: [number, number][],\n ) {\n const regex = getRegexp(tagName);\n let newScriptMatchSpans = scriptMatchSpans;\n let newStyleMatchSpans = styleMatchSpans;\n // Replace valid matches\n const newSource = _source.replace(regex, (match, attributes, content, index) => {\n if (match.startsWith('<!--') || withinOtherSpan(index)) {\n return match;\n }\n const encodedContent = Buffer.from(content).toString('base64');\n const newContent = `<${tagName}${attributes} ${snippedTagContentAttribute}=\"${encodedContent}\">${placeholder}</${tagName}>`;\n\n // Adjust the spans because the source now has a different content length\n const lengthDiff = match.length - newContent.length;\n newScriptMatchSpans = adjustSpans(scriptMatchSpans, newScriptMatchSpans);\n newStyleMatchSpans = adjustSpans(styleMatchSpans, newStyleMatchSpans);\n function adjustSpans(\n oldSpans: [number, number][],\n newSpans: [number, number][],\n ): [number, number][] {\n return oldSpans.map((oldSpan, idx) => {\n const newSpan = newSpans[idx];\n // Do the check using the old spans because the replace function works\n // on the old spans. Replace oldSpans with newSpans afterwards.\n if (oldSpan[0] > index) {\n // span is after the match -> adjust start and end\n return [newSpan[0] - lengthDiff, newSpan[1] - lengthDiff];\n } else if (oldSpan[0] === index) {\n // span is the match -> adjust end only\n return [newSpan[0], newSpan[1] - lengthDiff];\n } else {\n // span is before the match -> nothing to adjust\n return newSpan;\n }\n });\n }\n\n return newContent;\n });\n\n // Now that the replacement function ran, we can adjust the spans for the next run\n scriptMatchSpans = newScriptMatchSpans;\n styleMatchSpans = newStyleMatchSpans;\n\n return newSource;\n\n function withinOtherSpan(idx: number) {\n return otherSpans.some((otherSpan) => idx > otherSpan[0] && idx < otherSpan[1]);\n }\n }\n\n function getRegexp(tagName: string) {\n return new RegExp(`<!--[^]*?-->|<${tagName}([^]*?)>([^]*?)<\\/${tagName}>`, 'g');\n }\n}\n\nexport function hasSnippedContent(text: string) {\n return text.includes(snippedTagContentAttribute);\n}\n\nexport function unsnipContent(text: string): string {\n const regex = /(<\\w+.*?)\\s*✂prettier:content✂=\"(.*?)\">.*?(?=<\\/)/gi;\n\n return text.replace(regex, (_, start, encodedContent) => {\n const content = Buffer.from(encodedContent, 'base64').toString('utf8');\n return `${start}>${content}`;\n });\n}\n","import { ParserOptions, SupportOption } from 'prettier';\n\ndeclare module 'prettier' {\n interface RequiredOptions extends PluginOptions {}\n}\n\nexport interface PluginOptions {\n svelteSortOrder: SortOrder;\n svelteStrictMode: boolean;\n svelteBracketNewLine: boolean;\n svelteAllowShorthand: boolean;\n svelteIndentScriptAndStyle: boolean;\n}\n\nfunction makeChoice(choice: string) {\n return { value: choice, description: choice };\n}\n\nexport const options: Record<keyof PluginOptions, SupportOption> = {\n svelteSortOrder: {\n since: '0.6.0',\n category: 'Svelte',\n type: 'choice',\n default: 'options-scripts-markup-styles',\n description: 'Sort order for scripts, markup, and styles',\n choices: [\n makeChoice('options-scripts-markup-styles'),\n makeChoice('options-scripts-styles-markup'),\n makeChoice('options-markup-styles-scripts'),\n makeChoice('options-markup-scripts-styles'),\n makeChoice('options-styles-markup-scripts'),\n makeChoice('options-styles-scripts-markup'),\n makeChoice('scripts-options-markup-styles'),\n makeChoice('scripts-options-styles-markup'),\n makeChoice('markup-options-styles-scripts'),\n makeChoice('markup-options-scripts-styles'),\n makeChoice('styles-options-markup-scripts'),\n makeChoice('styles-options-scripts-markup'),\n makeChoice('scripts-markup-options-styles'),\n makeChoice('scripts-styles-options-markup'),\n makeChoice('markup-styles-options-scripts'),\n makeChoice('markup-scripts-options-styles'),\n makeChoice('styles-markup-options-scripts'),\n makeChoice('styles-scripts-options-markup'),\n makeChoice('scripts-markup-styles-options'),\n makeChoice('scripts-styles-markup-options'),\n makeChoice('markup-styles-scripts-options'),\n makeChoice('markup-scripts-styles-options'),\n makeChoice('styles-markup-scripts-options'),\n makeChoice('styles-scripts-markup-options'),\n // Deprecated, keep in 2.x for backwards-compatibility. svelte:options will be moved to the top\n makeChoice('scripts-markup-styles'),\n makeChoice('scripts-styles-markup'),\n makeChoice('markup-styles-scripts'),\n makeChoice('markup-scripts-styles'),\n makeChoice('styles-markup-scripts'),\n makeChoice('styles-scripts-markup'),\n ],\n },\n svelteStrictMode: {\n since: '0.7.0',\n category: 'Svelte',\n type: 'boolean',\n default: false,\n description: 'More strict HTML syntax: self-closed tags, quotes in attributes',\n },\n svelteBracketNewLine: {\n since: '0.6.0',\n category: 'Svelte',\n type: 'boolean',\n description: 'Put the `>` of a multiline element on a new line',\n deprecated: '2.5.0',\n },\n svelteAllowShorthand: {\n since: '1.0.0',\n category: 'Svelte',\n type: 'boolean',\n default: true,\n description:\n 'Option to enable/disable component attribute shorthand if attribute name and expressions are same',\n },\n svelteIndentScriptAndStyle: {\n since: '1.2.0',\n category: 'Svelte',\n type: 'boolean',\n default: true,\n description:\n 'Whether or not to indent the code inside <script> and <style> tags in Svelte files',\n },\n};\n\nexport type SortOrder =\n | 'options-scripts-markup-styles'\n | 'options-scripts-styles-markup'\n | 'options-markup-styles-scripts'\n | 'options-markup-scripts-styles'\n | 'options-styles-markup-scripts'\n | 'options-styles-scripts-markup'\n | 'scripts-options-markup-styles'\n | 'scripts-options-styles-markup'\n | 'markup-options-styles-scripts'\n | 'markup-options-scripts-styles'\n | 'styles-options-markup-scripts'\n | 'styles-options-scripts-markup'\n | 'scripts-markup-options-styles'\n | 'scripts-styles-options-markup'\n | 'markup-styles-options-scripts'\n | 'markup-scripts-options-styles'\n | 'styles-markup-options-scripts'\n | 'styles-scripts-options-markup'\n | 'scripts-markup-styles-options'\n | 'scripts-styles-markup-options'\n | 'markup-styles-scripts-options'\n | 'markup-scripts-styles-options'\n | 'styles-markup-scripts-options'\n | 'styles-scripts-markup-options'\n | DeprecatedSortOrder;\n\nexport type DeprecatedSortOrder =\n | 'scripts-markup-styles'\n | 'scripts-styles-markup'\n | 'markup-styles-scripts'\n | 'markup-scripts-styles'\n | 'styles-markup-scripts'\n | 'styles-scripts-markup';\n\nexport type SortOrderPart = 'scripts' | 'markup' | 'styles' | 'options';\n\nconst sortOrderSeparator = '-';\n\nexport function parseSortOrder(sortOrder: SortOrder): SortOrderPart[] {\n const order = sortOrder.split(sortOrderSeparator) as SortOrderPart[];\n // For backwards compatibility: Add options to beginning if not present\n if (!order.includes('options')) {\n console.warn(\n 'svelteSortOrder is missing option `options`. This will be an error in prettier-plugin-svelte version 3.',\n );\n order.unshift('options');\n }\n return order;\n}\n\nexport function isBracketSameLine(options: ParserOptions): boolean {\n return options.svelteBracketNewLine != null\n ? !options.svelteBracketNewLine\n : options.bracketSameLine != null\n ? options.bracketSameLine\n : false;\n}\n","import { ASTNode, Node } from './nodes';\nimport { Doc, FastPath } from 'prettier';\nimport { formattableAttributes } from '../lib/elements';\n\n/**\n * Determines whether or not given node\n * is the root of the Svelte AST.\n */\nexport function isASTNode(n: any): n is ASTNode {\n return n && n.__isRoot;\n}\n\nexport function isPreTagContent(path: FastPath): boolean {\n const stack = path.stack as Node[];\n\n return stack.some(\n (node) =>\n (node.type === 'Element' && node.name.toLowerCase() === 'pre') ||\n (node.type === 'Attribute' && !formattableAttributes.includes(node.name)),\n );\n}\n\nexport function flatten<T>(arrays: T[][]): T[] {\n return ([] as T[]).concat.apply([], arrays);\n}\n\nexport function findLastIndex<T>(isMatch: (item: T, idx: number) => boolean, items: T[]) {\n for (let i = items.length - 1; i >= 0; i--) {\n if (isMatch(items[i], i)) {\n return i;\n }\n }\n\n return -1;\n}\n\nexport function replaceEndOfLineWith(text: string, replacement: Doc) {\n const parts: Doc[] = [];\n for (const part of text.split('\\n')) {\n if (parts.length > 0) {\n parts.push(replacement);\n }\n if (part.endsWith('\\r')) {\n parts.push(part.slice(0, -1));\n } else {\n parts.push(part);\n }\n }\n return parts;\n}\n","import { Doc, doc } from 'prettier';\nimport { findLastIndex } from './helpers';\n\n/**\n * Check if doc is a hardline.\n * We can't just rely on a simple equality check because the doc could be created with another\n * runtime version of prettier than what we import, making a reference check fail.\n */\nexport function isHardline(docToCheck: Doc): boolean {\n return docToCheck === doc.builders.hardline || deepEqual(docToCheck, doc.builders.hardline);\n}\n\n/**\n * Simple deep equal function which suits our needs. Only works properly on POJOs without cyclic deps.\n */\nfunction deepEqual(x: any, y: any): boolean {\n if (x === y) {\n return true;\n } else if (typeof x == 'object' && x != null && typeof y == 'object' && y != null) {\n if (Object.keys(x).length != Object.keys(y).length) return false;\n\n for (var prop in x) {\n if (y.hasOwnProperty(prop)) {\n if (!deepEqual(x[prop], y[prop])) return false;\n } else {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nfunction isDocCommand(doc: Doc): doc is doc.builders.DocCommand {\n return typeof doc === 'object' && doc !== null;\n}\n\nexport function isLine(docToCheck: Doc): boolean {\n return (\n isHardline(docToCheck) ||\n (isDocCommand(docToCheck) && docToCheck.type === 'line') ||\n (isDocCommand(docToCheck) &&\n docToCheck.type === 'concat' &&\n docToCheck.parts.every(isLine)) ||\n // Since Prettier 2.3.0, concats are represented as flat arrays\n (Array.isArray(docToCheck) && docToCheck.every(isLine))\n );\n}\n\n/**\n * Check if the doc is empty, i.e. consists of nothing more than empty strings (possibly nested).\n */\nexport function isEmptyDoc(doc: Doc): boolean {\n if (typeof doc === 'string') {\n return doc.length === 0;\n }\n\n if (isDocCommand(doc) && doc.type === 'line') {\n return !doc.keepIfLonely;\n }\n\n // Since Prettier 2.3.0, concats are represented as flat arrays\n if (Array.isArray(doc)) {\n return doc.length === 0;\n }\n\n const { contents } = doc as { contents?: Doc };\n\n if (contents) {\n return isEmptyDoc(contents);\n }\n\n const { parts } = doc as { parts?: Doc[] };\n\n if (parts) {\n return isEmptyGroup(parts);\n }\n\n return false;\n}\n\nexport function isEmptyGroup(group: Doc[]): boolean {\n return !group.find((doc) => !isEmptyDoc(doc));\n}\n\n/**\n * Trims both leading and trailing nodes matching `isWhitespace` independent of nesting level\n * (though all trimmed adjacent nodes need to be a the same level). Modifies the `docs` array.\n */\nexport function trim(docs: Doc[], isWhitespace: (doc: Doc) => boolean): Doc[] {\n trimLeft(docs, isWhitespace);\n trimRight(docs, isWhitespace);\n\n return docs;\n}\n\n/**\n * Trims the leading nodes matching `isWhitespace` independent of nesting level (though all nodes need to be a the same level).\n * If there are empty docs before the first whitespace, they are removed, too.\n */\nexport function trimLeft(group: Doc[], isWhitespace: (doc: Doc) => boolean): void {\n let firstNonWhitespace = group.findIndex((doc) => !isEmptyDoc(doc) && !isWhitespace(doc));\n\n if (firstNonWhitespace < 0 && group.length) {\n firstNonWhitespace = group.length;\n }\n\n if (firstNonWhitespace > 0) {\n const removed = group.splice(0, firstNonWhitespace);\n if (removed.every(isEmptyDoc)) {\n return trimLeft(group, isWhitespace);\n }\n } else {\n const parts = getParts(group[0]);\n\n if (parts) {\n return trimLeft(parts, isWhitespace);\n }\n }\n}\n\n/**\n * Trims the trailing nodes matching `isWhitespace` independent of nesting level (though all nodes need to be a the same level).\n * If there are empty docs after the last whitespace, they are removed, too.\n */\nexport function trimRight(group: Doc[], isWhitespace: (doc: Doc) => boolean): void {\n let lastNonWhitespace = group.length\n ? findLastIndex((doc) => !isEmptyDoc(doc) && !isWhitespace(doc), group)\n : 0;\n\n if (lastNonWhitespace < group.length - 1) {\n const removed = group.splice(lastNonWhitespace + 1);\n if (removed.every(isEmptyDoc)) {\n return trimRight(group, isWhitespace);\n }\n } else {\n const parts = getParts(group[group.length - 1]);\n\n if (parts) {\n return trimRight(parts, isWhitespace);\n }\n }\n}\n\nfunction getParts(doc: Doc): Doc[] | undefined {\n if (typeof doc === 'object') {\n // Since Prettier 2.3.0, concats are represented as flat arrays\n if (Array.isArray(doc)) {\n return doc;\n }\n if (doc.type === 'fill' || doc.type === 'concat') {\n return doc.parts;\n }\n if (doc.type === 'group') {\n return getParts(doc.contents);\n }\n }\n}\n\n/**\n * `(foo = bar)` => `foo = bar`\n */\nexport function removeParentheses(doc: Doc): Doc {\n return trim([doc], (_doc: Doc) => _doc === '(' || _doc === ')')[0];\n}\n","import {\n Node,\n ElementNode,\n TextNode,\n AttributeNode,\n MustacheTagNode,\n AttributeShorthandNode,\n HeadNode,\n InlineComponentNode,\n SlotNode,\n TitleNode,\n WindowNode,\n IfBlockNode,\n AwaitBlockNode,\n CatchBlockNode,\n EachBlockNode,\n ElseBlockNode,\n KeyBlockNode,\n PendingBlockNode,\n ThenBlockNode,\n CommentNode,\n SlotTemplateNode,\n StyleDirectiveNode,\n} from './nodes';\nimport { blockElements, TagName } from '../lib/elements';\nimport { FastPath, ParserOptions } from 'prettier';\nimport { findLastIndex, isASTNode, isPreTagContent } from './helpers';\nimport { isBracketSameLine } from '../options';\n\nconst unsupportedLanguages = ['coffee', 'coffeescript', 'styl', 'stylus', 'sass'];\n\nexport function isInlineElement(path: FastPath, options: ParserOptions, node: Node) {\n return (\n node && node.type === 'Element' && !isBlockElement(node, options) && !isPreTagContent(path)\n );\n}\n\nexport function isBlockElement(node: Node, options: ParserOptions): node is ElementNode {\n return (\n node &&\n node.type === 'Element' &&\n options.htmlWhitespaceSensitivity !== 'strict' &&\n (options.htmlWhitespaceSensitivity === 'ignore' ||\n blockElements.includes(node.name as TagName))\n );\n}\n\nexport function isSvelteBlock(\n node: Node,\n): node is\n | IfBlockNode\n | AwaitBlockNode\n | CatchBlockNode\n | EachBlockNode\n | ElseBlockNode\n | KeyBlockNode\n | PendingBlockNode\n | ThenBlockNode {\n return [\n 'IfBlock',\n 'AwaitBlock',\n 'CatchBlock',\n 'EachBlock',\n 'ElseBlock',\n 'KeyBlock',\n 'PendingBlock',\n 'ThenBlock',\n ].includes(node.type);\n}\n\nexport function isNodeWithChildren(node: Node): node is Node & { children: Node[] } {\n return (node as any).children;\n}\n\nexport function getChildren(node: Node): Node[] {\n return isNodeWithChildren(node) ? node.children : [];\n}\n\n/**\n * Returns siblings, that is, the children of the parent.\n */\nexport function getSiblings(path: FastPath): Node[] {\n let parent: Node = path.getParentNode();\n\n if (isASTNode(parent)) {\n parent = parent.html;\n }\n\n return getChildren(parent);\n}\n\n/**\n * Returns the previous sibling node.\n */\nexport function getPreviousNode(path: FastPath): Node | undefined {\n const node: Node = path.getNode();\n return getSiblings(path).find((child) => child.end === node.start);\n}\n\n/**\n * Returns the next sibling node.\n */\nexport function getNextNode(path: FastPath, node: Node = path.getNode()): Node | undefined {\n return getSiblings(path).find((child) => child.start === node.end);\n}\n\n/**\n * Returns the comment that is above the current node.\n */\nexport function getLeadingComment(path: FastPath): CommentNode | undefined {\n const siblings = getSiblings(path);\n\n let node: Node = path.getNode();\n let prev: Node | undefined = siblings.find((child) => child.end === node.start);\n while (prev) {\n if (\n prev.type === 'Comment' &&\n !isIgnoreStartDirective(prev) &&\n !isIgnoreEndDirective(prev)\n ) {\n return prev;\n } else if (isEmptyTextNode(prev)) {\n node = prev;\n prev = siblings.find((child) => child.end === node.start);\n } else {\n return undefined;\n }\n }\n}\n\n/**\n * Did there use to be any embedded object (that has been snipped out of the AST to be moved)\n * at the specified position?\n */\nexport function doesEmbedStartAfterNode(node: Node, path: FastPath, siblings = getSiblings(path)) {\n // If node is not at the top level of html, an embed cannot start after it,\n // because embeds are only at the top level\n if (!isNodeTopLevelHTML(node, path)) {\n return false;\n }\n\n const position = node.end;\n const root = path.stack[0];\n\n const embeds = [root.css, root.html, root.instance, root.js, root.module] as Node[];\n\n const nextNode = siblings[siblings.indexOf(node) + 1];\n return embeds.find((n) => n && n.start >= position && (!nextNode || n.end <= nextNode.start));\n}\n\nexport function isNodeTopLevelHTML(node: Node, path: FastPath): boolean {\n const root = path.stack[0];\n return !!root.html && !!root.html.children && root.html.children.includes(node);\n}\n\nexport function isEmptyTextNode(node: Node | undefined): node is TextNode {\n return !!node && node.type === 'Text' && getUnencodedText(node).trim() === '';\n}\n\nexport function isIgnoreDirective(node: Node | undefined | null): boolean {\n return !!node && node.type === 'Comment' && node.data.trim() === 'prettier-ignore';\n}\n\nexport function isIgnoreStartDirective(node: Node | undefined | null): boolean {\n return !!node && node.type === 'Comment' && node.data.trim() === 'prettier-ignore-start';\n}\n\nexport function isIgnoreEndDirective(node: Node | undefined | null): boolean {\n return !!node && node.type === 'Comment' && node.data.trim() === 'prettier-ignore-end';\n}\n\nexport function printRaw(\n node:\n | ElementNode\n | InlineComponentNode\n | SlotNode\n | WindowNode\n | HeadNode\n | TitleNode\n | SlotTemplateNode,\n originalText: string,\n stripLeadingAndTrailingNewline: boolean = false,\n): string {\n if (node.children.length === 0) {\n return '';\n }\n\n const firstChild = node.children[0];\n const lastChild = node.children[node.children.length - 1];\n\n let raw = originalText.substring(firstChild.start, lastChild.end);\n\n if (!stripLeadingAndTrailingNewline) {\n return raw;\n }\n\n if (startsWithLinebreak(raw)) {\n raw = raw.substring(raw.indexOf('\\n') + 1);\n }\n if (endsWithLinebreak(raw)) {\n raw = raw.substring(0, raw.lastIndexOf('\\n'));\n if (raw.charAt(raw.length - 1) === '\\r') {\n raw = raw.substring(0, raw.length - 1);\n }\n }\n\n return raw;\n}\n\nfunction isTextNode(node: Node): node is TextNode {\n return node.type === 'Text';\n}\n\nfunction getAttributeValue(attributeName: string, node: Node) {\n const attributes = (node as ElementNode)['attributes'] as AttributeNode[];\n\n const langAttribute = attributes.find(\n (attribute) => attribute.name === attributeName,\n ) as AttributeNode | null;\n\n return langAttribute && langAttribute.value;\n}\n\nexport function getAttributeTextValue(attributeName: string, node: Node): string | null {\n const value = getAttributeValue(attributeName, node);\n\n if (value != null && typeof value === 'object') {\n const textValue = value.find(isTextNode);\n\n if (textValue) {\n return textValue.data;\n }\n }\n\n return null;\n}\n\nfunction getLangAttribute(node: Node): string | null {\n const value = getAttributeTextValue('lang', node) || getAttributeTextValue('type', node);\n\n if (value != null) {\n return value.replace(/^text\\//, '');\n } else {\n return null;\n }\n}\n\n/**\n * Checks whether the node contains a `lang` or `type` attribute with a value corresponding to\n * a language we cannot format. This might for example be `<template lang=\"pug\">`.\n * If the node does not contain a `lang` attribute, the result is true.\n */\nexport function isNodeSupportedLanguage(node: Node) {\n const lang = getLangAttribute(node);\n\n return !(lang && unsupportedLanguages.includes(lang));\n}\n\n/**\n * Checks whether the node contains a `lang` or `type` attribute which indicates that\n * the script contents are written in TypeScript. Note that the absence of the tag\n * does not mean it's not TypeScript, because the user could have set the default\n * to TypeScript in his settings.\n */\nexport function isTypeScript(node: Node) {\n const lang = getLangAttribute(node) || '';\n return ['typescript', 'ts'].includes(lang);\n}\n\nexport function isPugTemplate(node: Node): boolean {\n return node.type === 'Element' && node.name === 'template' && getLangAttribute(node) === 'pug';\n}\n\nexport function isLoneMustacheTag(node: true | Node[]): node is [MustacheTagNode] {\n return node !== true && node.length === 1 && node[0].type === 'MustacheTag';\n}\n\nexport function isAttributeShorthand(node: true | Node[]): node is [AttributeShorthandNode] {\n return node !== true && node.length === 1 && node[0].type === 'AttributeShorthand';\n}\n\n/**\n * True if node is of type `{a}` or `a={a}`\n */\nexport function isOrCanBeConvertedToShorthand(node: AttributeNode | StyleDirectiveNode): boolean {\n if (isAttributeShorthand(node.value)) {\n return true;\n }\n\n if (isLoneMustacheTag(node.value)) {\n const expression = node.value[0].expression;\n return expression.type === 'Identifier' && expression.name === node.name;\n }\n\n return false;\n}\n\nexport function getUnencodedText(node: TextNode) {\n // `raw` will contain HTML entities in unencoded form\n return node.raw || node.data;\n}\n\nexport function isTextNodeStartingWithLinebreak(node: Node, nrLines = 1): node is TextNode {\n return node.type === 'Text' && startsWithLinebreak(getUnencodedText(node), nrLines);\n}\n\nexport function startsWithLinebreak(text: string, nrLines = 1): boolean {\n return new RegExp(`^([\\\\t\\\\f\\\\r ]*\\\\n){${nrLines}}`).test(text);\n}\n\nexport function isTextNodeEndingWithLinebreak(node: Node, nrLines = 1): node is TextNode {\n return node.type === 'Text' && endsWithLinebreak(getUnencodedText(node), nrLines);\n}\n\nexport function endsWithLinebreak(text: string, nrLines = 1): boolean {\n return new RegExp(`(\\\\n[\\\\t\\\\f\\\\r ]*){${nrLines}}$`).test(text);\n}\n\nexport function isTextNodeStartingWithWhitespace(node: Node): node is TextNode {\n return node.type === 'Text' && /^\\s/.test(getUnencodedText(node));\n}\n\nexport function isTextNodeEndingWithWhitespace(node: Node): node is TextNode {\n return node.type === 'Text' && /\\s$/.test(getUnencodedText(node));\n}\n\nexport function trimTextNodeRight(node: TextNode): void {\n node.raw = node.raw && node.raw.trimRight();\n node.data = node.data && node.data.trimRight();\n}\n\nexport function trimTextNodeLeft(node: TextNode): void {\n node.raw = node.raw && node.raw.trimLeft();\n node.data = node.data && node.data.trimLeft();\n}\n\n/**\n * Remove all leading whitespace up until the first non-empty text node,\n * and all trailing whitespace from the last non-empty text node onwards.\n */\nexport function trimChildren(children: Node[], path: FastPath): void {\n let firstNonEmptyNode = children.findIndex(\n (n) => !isEmptyTextNode(n) && !doesEmbedStartAfterNode(n, path),\n );\n firstNonEmptyNode = firstNonEmptyNode === -1 ? children.length - 1 : firstNonEmptyNode;\n\n let lastNonEmptyNode = findLastIndex((n, idx) => {\n // Last node is ok to end at the start of an embedded region,\n // if it's not a comment (which should stick to the region)\n return (\n !isEmptyTextNode(n) &&\n ((idx === children.length - 1 && n.type !== 'Comment') ||\n !doesEmbedStartAfterNode(n, path))\n );\n }, children);\n lastNonEmptyNode = lastNonEmptyNode === -1 ? 0 : lastNonEmptyNode;\n\n for (let i = 0; i <= firstNonEmptyNode; i++) {\n const n = children[i];\n if (n.type === 'Text') {\n trimTextNodeLeft(n);\n }\n }\n\n for (let i = children.length - 1; i >= lastNonEmptyNode; i--) {\n const n = children[i];\n if (n.type === 'Text') {\n trimTextNodeRight(n);\n }\n }\n}\n\n/**\n * Check if given node's start tag should hug its first child. This is the case for inline elements when there's\n * no whitespace between the `>` and the first child.\n */\nexport function shouldHugStart(\n node: Node,\n isSupportedLanguage: boolean,\n options: ParserOptions,\n): boolean {\n if (!isSupportedLanguage) {\n return true;\n }\n\n if (isBlockElement(node, options)) {\n return false;\n }\n\n if (!isNodeWithChildren(node)) {\n return false;\n }\n\n const children: Node[] = node.children;\n if (children.length === 0) {\n return true;\n }\n\n if (options.htmlWhitespaceSensitivity === 'ignore') {\n return false;\n }\n\n const firstChild = children[0];\n return !isTextNodeStartingWithWhitespace(firstChild);\n}\n\n/**\n * Check if given node's end tag should hug its last child. This is the case for inline elements when there's\n * no whitespace between the last child and the `</`.\n */\nexport function shouldHugEnd(\n node: Node,\n isSupportedLanguage: boolean,\n options: ParserOptions,\n): boolean {\n if (!isSupportedLanguage) {\n return true;\n }\n\n if (isBlockElement(node, options)) {\n return false;\n }\n\n if (!isNodeWithChildren(node)) {\n return false;\n }\n\n const children: Node[] = node.children;\n if (children.length === 0) {\n return true;\n }\n\n if (options.htmlWhitespaceSensitivity === 'ignore') {\n return false;\n }\n\n const lastChild = children[children.length - 1];\n return !isTextNodeEndingWithWhitespace(lastChild);\n}\n\n/**\n * Check for a svelte block if there's whitespace at the start and if it's a space or a line.\n */\nexport function checkWhitespaceAtStartOfSvelteBlock(\n node: Node,\n options: ParserOptions,\n): 'none' | 'space' | 'line' {\n if (!isSvelteBlock(node) || !isNodeWithChildren(node)) {\n return 'none';\n }\n\n const children: Node[] = node.children;\n if (children.length === 0) {\n return 'none';\n }\n\n const firstChild = children[0];\n\n if (isTextNodeStartingWithLinebreak(firstChild)) {\n return 'line';\n } else if (isTextNodeStartingWithWhitespace(firstChild)) {\n return 'space';\n }\n\n // This extra check is necessary because the Svelte AST might swallow whitespace between\n // the block's starting end and its first child.\n const parentOpeningEnd = options.originalText.lastIndexOf('}', firstChild.start);\n if (parentOpeningEnd > 0 && firstChild.start > parentOpeningEnd + 1) {\n const textBetween = options.originalText.substring(parentOpeningEnd + 1, firstChild.start);\n if (textBetween.trim() === '') {\n return startsWithLinebreak(textBetween) ? 'line' : 'space';\n }\n }\n\n return 'none';\n}\n\n/**\n * Check for a svelte block if there's whitespace at the end and if it's a space or a line.\n */\nexport function checkWhitespaceAtEndOfSvelteBlock(\n node: Node,\n options: ParserOptions,\n): 'none' | 'space' | 'line' {\n if (!isSvelteBlock(node) || !isNodeWithChildren(node)) {\n return 'none';\n }\n\n const children: Node[] = node.children;\n if (children.length === 0) {\n return 'none';\n }\n\n const lastChild = children[children.length - 1];\n if (isTextNodeEndingWithLinebreak(lastChild)) {\n return 'line';\n } else if (isTextNodeEndingWithWhitespace(lastChild)) {\n return 'space';\n }\n\n // This extra check is necessary because the Svelte AST might swallow whitespace between\n // the last child and the block's ending start.\n const parentClosingStart = options.originalText.indexOf('{', lastChild.end);\n if (parentClosingStart > 0 && lastChild.end < parentClosingStart) {\n const textBetween = options.originalText.substring(lastChild.end, parentClosingStart);\n if (textBetween.trim() === '') {\n return endsWithLinebreak(textBetween) ? 'line' : 'space';\n }\n }\n\n return 'none';\n}\n\nexport function isInsideQuotedAttribute(path: FastPath, options: ParserOptions): boolean {\n const stack = path.stack as Node[];\n\n return stack.some(\n (node) =>\n node.type === 'Attribute' &&\n (!isLoneMustacheTag(node.value) || options.svelteStrictMode),\n );\n}\n\n/**\n * Returns true if the softline between `</tagName` and `>` can be omitted.\n */\nexport function canOmitSoftlineBeforeClosingTag(\n node: Node,\n path: FastPath,\n options: ParserOptions,\n): boolean {\n return (\n isBracketSameLine(options) &&\n (!hugsStartOfNextNode(node, options) || isLastChildWithinParentBlockElement(path, options))\n );\n}\n\n/**\n * Return true if given node does not hug the next node, meaning there's whitespace\n * or the end of the doc afterwards.\n */\nfunction hugsStartOfNextNode(node: Node, options: ParserOptions): boolean {\n if (node.end === options.originalText.length) {\n // end of document\n return false;\n }\n\n return !options.originalText.substring(node.end).match(/^\\s/);\n}\n\nfunction isLastChildWithinParentBlockElement(path: FastPath, options: ParserOptions): boolean {\n const parent = path.getParentNode() as Node | undefined;\n if (!parent || !isBlockElement(parent, options)) {\n return false;\n }\n\n const children = getChildren(parent);\n const lastChild = children[children.length - 1];\n return lastChild === path.getNode();\n}\n","import { Doc, doc, FastPath, ParserOptions } from 'prettier';\nimport { formattableAttributes, selfClosingTags } from '../lib/elements';\nimport { extractAttributes } from '../lib/extractAttributes';\nimport { getText } from '../lib/getText';\nimport { hasSnippedContent, unsnipContent } from '../lib/snipTagContent';\nimport { isBracketSameLine, parseSortOrder, SortOrderPart } from '../options';\nimport { isEmptyDoc, isLine, trim, trimRight } from './doc-helpers';\nimport { flatten, isASTNode, isPreTagContent, replaceEndOfLineWith } from './helpers';\nimport {\n checkWhitespaceAtEndOfSvelteBlock,\n checkWhitespaceAtStartOfSvelteBlock,\n doesEmbedStartAfterNode,\n endsWithLinebreak,\n getUnencodedText,\n isBlockElement,\n isEmptyTextNode,\n isIgnoreDirective,\n isInlineElement,\n isInsideQuotedAttribute,\n isLoneMustacheTag,\n isNodeSupportedLanguage,\n isOrCanBeConvertedToShorthand,\n isTextNodeEndingWithLinebreak,\n isTextNodeEndingWithWhitespace,\n isTextNodeStartingWithLinebreak,\n isTextNodeStartingWithWhitespace,\n printRaw,\n shouldHugEnd,\n shouldHugStart,\n startsWithLinebreak,\n trimChildren,\n trimTextNodeLeft,\n trimTextNodeRight,\n canOmitSoftlineBeforeClosingTag,\n getNextNode,\n isIgnoreStartDirective,\n isIgnoreEndDirective,\n isNodeTopLevelHTML,\n} from './node-helpers';\nimport {\n ASTNode,\n AttributeNode,\n CommentNode,\n IfBlockNode,\n Node,\n OptionsNode,\n StyleDirectiveNode,\n TextNode,\n} from './nodes';\n\nconst {\n concat,\n join,\n line,\n group,\n indent,\n dedent,\n softline,\n hardline,\n fill,\n breakParent,\n literalline,\n} = doc.builders;\n\nexport type PrintFn = (path: FastPath) => Doc;\n\ndeclare module 'prettier' {\n export namespace doc {\n namespace builders {\n interface Line {\n keepIfLonely?: boolean;\n }\n }\n }\n}\n\nlet ignoreNext = false;\nlet ignoreRange = false;\nlet svelteOptionsDoc: Doc | undefined;\n\nfunction groupConcat(contents: doc.builders.Doc[]): doc.builders.Doc {\n return group(concat(contents));\n}\n\nexport function print(path: FastPath, options: ParserOptions, print: PrintFn): Doc {\n const bracketSameLine = isBracketSameLine(options);\n\n const n = path.getValue();\n if (!n) {\n return '';\n }\n\n if (isASTNode(n)) {\n return printTopLevelParts(n, options, path, print);\n }\n\n const [open, close] = options.svelteStrictMode ? ['\"{', '}\"'] : ['{', '}'];\n const printJsExpression = () => [\n open,\n printJS(path, print, options.svelteStrictMode, false, false, 'expression'),\n close,\n ];\n const node = n as Node;\n\n if (\n (ignoreNext || (ignoreRange && !isIgnoreEndDirective(node))) &&\n (node.type !== 'Text' || !isEmptyTextNode(node))\n ) {\n if (ignoreNext) {\n ignoreNext = false;\n }\n return concat(\n flatten(\n options.originalText\n .slice(options.locStart(node), options.locEnd(node))\n .split('\\n')\n .map((o, i) => (i == 0 ? [o] : [literalline, o])),\n ),\n );\n }\n\n switch (node.type) {\n case 'Fragment':\n const children = node.children;\n\n if (children.length === 0 || children.every(isEmptyTextNode)) {\n return '';\n }\n if (!isPreTagContent(path)) {\n trimChildren(node.children, path);\n const output = trim(\n [printChildren(path, print, options)],\n (n) =>\n isLine(n) ||\n (typeof n === 'string' && n.trim() === '') ||\n // Because printChildren may append this at the end and\n // may hide other lines before it\n n === breakParent,\n );\n if (output.every((doc) => isEmptyDoc(doc))) {\n return '';\n }\n return groupConcat([...output, hardline]);\n } else {\n return groupConcat(path.map(print, 'children'));\n }\n case 'Text':\n if (!isPreTagContent(path)) {\n if (isEmptyTextNode(node)) {\n const hasWhiteSpace =\n getUnencodedText(node).trim().length < getUnencodedText(node).length;\n const hasOneOrMoreNewlines = /\\n/.test(getUnencodedText(node));\n const hasTwoOrMoreNewlines = /\\n\\r?\\s*\\n\\r?/.test(getUnencodedText(node));\n if (hasTwoOrMoreNewlines) {\n return concat([hardline, hardline]);\n }\n if (hasOneOrMoreNewlines) {\n return hardline;\n }\n if (hasWhiteSpace) {\n return line;\n }\n return '';\n }\n\n /**\n * For non-empty text nodes each sequence of non-whitespace characters (effectively,\n * each \"word\") is joined by a single `line`, which will be rendered as a single space\n * until this node's current line is out of room, at which `fill` will break at the\n * most convenient instance of `line`.\n */\n return fill(splitTextToDocs(node));\n } else {\n const rawText = getUnencodedText(node);\n if (path.getParentNode().type === 'Attribute') {\n // Direct child of attribute value -> add literallines at end of lines\n // so that other things don't break in unexpected places\n return concat(replaceEndOfLineWith(rawText, literalline));\n }\n return rawText;\n }\n case 'Element':\n case 'InlineComponent':\n case 'Slot':\n case 'SlotTemplate':\n case 'Window':\n case 'Head':\n case 'Title': {\n const isSupportedLanguage = !(\n node.name === 'template' && !isNodeSupportedLanguage(node)\n );\n const isEmpty = node.children.every((child) => isEmptyTextNode(child));\n\n const isSelfClosingTag =\n isEmpty &&\n (!options.svelteStrictMode ||\n node.type !== 'Element' ||\n selfClosingTags.indexOf(node.name) !== -1);\n\n // Order important: print attributes first\n const attributes = path.map((childPath) => childPath.call(print), 'attributes');\n const possibleThisBinding =\n node.type === 'InlineComponent' && node.expression\n ? concat([line, 'this=', ...printJsExpression()])\n : node.type === 'Element' && node.tag\n ? concat([\n line,\n 'this=',\n ...(typeof node.tag === 'string'\n ? [`\"${node.tag}\"`]\n : [\n open,\n printJS(\n path,\n print,\n options.svelteStrictMode,\n false,\n false,\n 'tag',\n ),\n close,\n ]),\n ])\n : '';\n\n if (isSelfClosingTag) {\n return groupConcat([\n '<',\n node.name,\n\n indent(\n groupConcat([\n possibleThisBinding,\n ...attributes,\n bracketSameLine ? '' : dedent(line),\n ]),\n ),\n\n ...[bracketSameLine ? ' ' : '', `/>`],\n ]);\n }\n\n const children = node.children;\n const firstChild = children[0];\n const lastChild = children[children.length - 1];\n\n // Is a function which is invoked later because printChildren will manipulate child nodes\n // which would wrongfully change the other checks about hugging etc done beforehand\n let body: () => Doc;\n\n const hugStart = shouldHugStart(node, isSupportedLanguage, options);\n const hugEnd = shouldHugEnd(node, isSupportedLanguage, options);\n\n if (isEmpty) {\n body =\n isInlineElement(path, options, node) &&\n node.children.length &&\n isTextNodeStartingWithWhitespace(node.children[0]) &&\n !isPreTagContent(path)\n ? () => line\n : () => (bracketSameLine ? softline : '');\n } else if (isPreTagContent(path)) {\n body = () => printPre(node, options.originalText, path, print);\n } else if (!isSupportedLanguage) {\n body = () => printRaw(node, options.originalText, true);\n } else if (isInlineElement(path, options, node) && !isPreTagContent(path)) {\n body = () => printChildren(path, print, options);\n } else {\n body = () => printChildren(path, print, options);\n }\n\n const openingTag = [\n '<',\n node.name,\n\n indent(\n groupConcat([\n possibleThisBinding,\n ...attributes,\n hugStart\n ? ''\n : !bracketSameLine && !isPreTagContent(path)\n ? dedent(softline)\n : '',\n ]),\n ),\n ];\n\n if (!isSupportedLanguage && !isEmpty) {\n // Format template tags so that there's a hardline but no indention.\n // That way the `lang=\"X\"` and the closing `>` of the start tag stay in one line\n // which is the 99% use case.\n return groupConcat([\n ...openingTag,\n '>',\n groupConcat([hardline, body(), hardline]),\n `</${node.name}>`,\n ]);\n }\n\n if (hugStart && hugEnd) {\n const huggedContent = concat([\n softline,\n groupConcat(['>', body(), `</${node.name}`]),\n ]);\n const omitSoftlineBeforeClosingTag =\n (isEmpty && !bracketSameLine) ||\n canOmitSoftlineBeforeClosingTag(node, path, options);\n return groupConcat([\n ...openingTag,\n isEmpty ? group(huggedContent) : group(indent(huggedContent)),\n omitSoftlineBeforeClosingTag ? '' : softline,\n '>',\n ]);\n }\n\n // No hugging of content means it's either a block element and/or there's whitespace at the start/end\n let noHugSeparatorStart: Doc = softline;\n let noHugSeparatorEnd: Doc = softline;\n if (isPreTagContent(path)) {\n noHugSeparatorStart = '';\n noHugSeparatorEnd = '';\n } else {\n let didSetEndSeparator = false;\n\n if (!hugStart && firstChild && firstChild.type === 'Text') {\n if (\n isTextNodeStartingWithLinebreak(firstChild) &&\n firstChild !== lastChild &&\n (!isInlineElement(path, options, node) ||\n isTextNodeEndingWithWhitespace(lastChild))\n ) {\n noHugSeparatorStart = hardline;\n noHugSeparatorEnd = hardline;\n didSetEndSeparator = true;\n } else if (isInlineElement(path, options, node)) {\n noHugSeparatorStart = line;\n }\n trimTextNodeLeft(firstChild);\n }\n if (!hugEnd && lastChild && lastChild.type === 'Text') {\n if (isInlineElement(path, options, node) && !didSetEndSeparator) {\n noHugSeparatorEnd = line;\n }\n trimTextNodeRight(lastChild);\n }\n }\n\n if (hugStart) {\n return groupConcat([\n ...openingTag,\n indent(concat([softline, groupConcat(['>', body()])])),\n noHugSeparatorEnd,\n `</${node.name}>`,\n ]);\n }\n\n if (hugEnd) {\n return groupConcat([\n ...openingTag,\n '>',\n indent(concat([noHugSeparatorStart, groupConcat([body(), `</${node.name}`])])),\n canOmitSoftlineBeforeClosingTag(node, path, options) ? '' : softline,\n '>',\n ]);\n }\n\n if (isEmpty) {\n return groupConcat([...openingTag, '>', body(), `</${node.name}>`]);\n }\n\n return groupConcat([\n ...openingTag,\n '>',\n indent(concat([noHugSeparatorStart, body()])),\n noHugSeparatorEnd,\n `</${node.name}>`,\n ]);\n }\n case 'Options':\n throw new Error('Options tags should have been handled by prepareChildren');\n case 'Body':\n return groupConcat([\n '<',\n node.name,\n\n indent(groupConcat(path.map((childPath) => childPath.call(print), 'attributes'))),\n\n ' />',\n ]);\n case 'Identifier':\n return node.name;\n case 'AttributeShorthand': {\n return (node.expression as any).name;\n }\n case 'Attribute': {\n if (isOrCanBeConvertedToShorthand(node)) {\n if (options.svelteStrictMode) {\n return concat([line, node.name, '=\"{', node.name, '}\"']);\n } else if (options.svelteAllowShorthand) {\n return concat([line, '{', node.name, '}']);\n } else {\n return concat([line, node.name, '={', node.name, '}']);\n }\n } else {\n if (node.value === true) {\n return concat([line, node.name]);\n }\n\n const quotes = !isLoneMustacheTag(node.value) || options.svelteStrictMode;\n const attrNodeValue = printAttributeNodeValue(path, print, quotes, node);\n if (quotes) {\n return concat([line, node.name, '=', '\"', attrNodeValue, '\"']);\n } else {\n return concat([line, node.name, '=', attrNodeValue]);\n }\n }\n }\n case 'MustacheTag':\n return concat([\n '{',\n printJS(\n path,\n print,\n isInsideQuotedAttribute(path, options),\n false,\n false,\n 'expression',\n ),\n '}',\n ]);\n case 'IfBlock': {\n const def: Doc[] = [\n '{#if ',\n printSvelteBlockJS(path, print, 'expression'),\n '}',\n printSvelteBlockChildren(path, print, options),\n ];\n\n if (node.else) {\n def.push(path.call(print, 'else'));\n }\n\n def.push('{/if}');\n\n return concat([groupConcat(def), breakParent]);\n }\n case 'ElseBlock': {\n // Else if\n const parent = path.getParentNode() as Node;\n\n if (\n node.children.length === 1 &&\n node.children[0].type === 'IfBlock' &&\n parent.type !== 'EachBlock'\n ) {\n const ifNode = node.children[0] as IfBlockNode;\n const def: Doc[] = [\n '{:else if ',\n path.map(\n (ifPath) => printSvelteBlockJS(ifPath, print, 'expression'),\n 'children',\n )[0],\n '}',\n path.map(\n (ifPath) => printSvelteBlockChildren(ifPath, print, options),\n 'children',\n )[0],\n ];\n\n if (ifNode.else) {\n def.push(path.map((ifPath) => ifPath.call(print, 'else'), 'children')[0]);\n }\n return concat(def);\n }\n\n return concat(['{:else}', printSvelteBlockChildren(path, print, options)]);\n }\n case 'EachBlock': {\n const def: Doc[] = [\n '{#each ',\n printSvelteBlockJS(path, print, 'expression'),\n ' as',\n expandNode(node.context),\n ];\n\n if (node.index) {\n def.push(', ', node.index);\n }\n\n if (node.key) {\n def.push(' (', printSvelteBlockJS(path, print, 'key'), ')');\n }\n\n def.push('}', printSvelteBlockChildren(path, print, options));\n\n if (node.else) {\n def.push(path.call(print, 'else'));\n }\n\n def.push('{/each}');\n\n return concat([groupConcat(def), breakParent]);\n }\n case 'AwaitBlock': {\n const hasPendingBlock = node.pending.children.some((n) => !isEmptyTextNode(n));\n const hasThenBlock = node.then.children.some((n) => !isEmptyTextNode(n));\n const hasCatchBlock = node.catch.children.some((n) => !isEmptyTextNode(n));\n\n let block = [];\n\n if (!hasPendingBlock && hasThenBlock) {\n block.push(\n groupConcat([\n '{#await ',\n printSvelteBlockJS(path, print, 'expression'),\n ' then',\n expandNode(node.value),\n '}',\n ]),\n path.call(print, 'then'),\n );\n } else {\n block.push(\n groupConcat(['{#await ', printSvelteBlockJS(path, print, 'expression'), '}']),\n );\n\n if (hasPendingBlock) {\n block.push(path.call(print, 'pending'));\n }\n\n if (hasThenBlock) {\n block.push(\n groupConcat(['{:then', expandNode(node.value), '}']),\n path.call(print, 'then'),\n );\n }\n }\n\n if (hasCatchBlock) {\n block.push(\n groupConcat(['{:catch', expandNode(node.error), '}']),\n path.call(print, 'catch'),\n );\n }\n\n block.push('{/await}');\n\n return groupConcat(block);\n }\n case 'KeyBlock': {\n const def: Doc[] = [\n '{#key ',\n printSvelteBlockJS(path, print, 'expression'),\n '}',\n printSvelteBlockChildren(path, print, options),\n ];\n\n def.push('{/key}');\n\n return concat([groupConcat(def), breakParent]);\n }\n case 'ThenBlock':\n case 'PendingBlock':\n case 'CatchBlock':\n return printSvelteBlockChildren(path, print, options);\n case 'EventHandler':\n return concat([\n line,\n 'on:',\n node.name,\n node.modifiers && node.modifiers.length\n ? concat(['|', join('|', node.modifiers)])\n : '',\n node.expression ? concat(['=', ...printJsExpression()]) : '',\n ]);\n case 'Binding':\n return concat([\n line,\n 'bind:',\n node.name,\n node.expression.type === 'Identifier' && node.expression.name === node.name\n ? ''\n : concat(['=', ...printJsExpression()]),\n ]);\n case 'Class':\n return concat([\n line,\n 'class:',\n node.name,\n node.expression.type === 'Identifier' && node.expression.name === node.name\n ? ''\n : concat(['=', ...printJsExpression()]),\n ]);\n case 'StyleDirective':\n if (isOrCanBeConvertedToShorthand(node)) {\n if (options.svelteStrictMode) {\n return concat([line, 'style:', node.name, '=\"{', node.name, '}\"']);\n } else if (options.svelteAllowShorthand) {\n return concat([line, 'style:', node.name]);\n } else {\n return concat([line, 'style:', node.name, '={', node.name, '}']);\n }\n } else {\n if (node.value === true) {\n return concat([line, 'style:', node.name]);\n }\n\n const quotes = !isLoneMustacheTag(node.value) || options.svelteStrictMode;\n const attrNodeValue = printAttributeNodeValue(path, print, quotes, node);\n if (quotes) {\n return concat([line, 'style:', node.name, '=', '\"', attrNodeValue, '\"']);\n } else {\n return concat([line, 'style:', node.name, '=', attrNodeValue]);\n }\n }\n case 'Let':\n return concat([\n line,\n 'let:',\n node.name,\n // shorthand let directives have `null` expressions\n !node.expression ||\n (node.expression.type === 'Identifier' && node.expression.name === node.name)\n ? ''\n : concat(['=', ...printJsExpression()]),\n ]);\n case 'DebugTag':\n return concat([\n '{@debug',\n node.identifiers.length > 0\n ? concat([' ', join(', ', path.map(print, 'identifiers'))])\n : '',\n '}',\n ]);\n case 'Ref':\n return concat([line, 'ref:', node.name]);\n case 'Comment': {\n const nodeAfterComment = getNextNode(path);\n\n if (isIgnoreStartDirective(node) && isNodeTopLevelHTML(node, path)) {\n ignoreRange = true;\n } else if (isIgnoreEndDirective(node) && isNodeTopLevelHTML(node, path)) {\n ignoreRange = false;\n } else if (\n // If there is no sibling node that starts right after us but the parent indicates\n // that there used to be, that means that node was actually an embedded `<style>`\n // or `<script>` node that was cut out.\n // If so, the comment does not refer to the next line we will see.\n // The `embed` function handles printing the comment in the right place.\n doesEmbedStartAfterNode(node, path) ||\n (isEmptyTextNode(nodeAfterComment) &&\n doesEmbedStartAfterNode(nodeAfterComment, path))\n ) {\n return '';\n } else if (isIgnoreDirective(node)) {\n ignoreNext = true;\n }\n\n return printComment(node);\n }\n case 'Transition':\n const kind = node.intro && node.outro ? 'transition' : node.intro ? 'in' : 'out';\n return concat([\n line,\n kind,\n ':',\n node.name,\n node.modifiers && node.modifiers.length\n ? concat(['|', join('|', node.modifiers)])\n : '',\n node.expression ? concat(['=', ...printJsExpression()]) : '',\n ]);\n case 'Action':\n return concat([\n line,\n 'use:',\n node.name,\n node.expression ? concat(['=', ...printJsExpression()]) : '',\n ]);\n case 'Animation':\n return concat([\n line,\n 'animate:',\n node.name,\n node.expression ? concat(['=', ...printJsExpression()]) : '',\n ]);\n case 'RawMustacheTag':\n return concat([\n '{@html ',\n printJS(path, print, false, false, false, 'expression'),\n '}',\n ]);\n case 'Spread':\n return concat([\n line,\n '{...',\n printJS(path, print, false, false, false, 'expression'),\n '}',\n ]);\n case 'ConstTag':\n return concat([\n '{@const ',\n printJS(path, print, false, false, true, 'expression'),\n '}',\n ]);\n }\n\n console.error(JSON.stringify(node, null, 4));\n throw new Error('unknown node type: ' + node.type);\n}\n\nfunction printTopLevelParts(\n n: ASTNode,\n options: ParserOptions,\n path: FastPath<any>,\n print: PrintFn,\n): Doc {\n const parts: Record<SortOrderPart, Doc[]> = {\n options: [],\n scripts: [],\n markup: [],\n styles: [],\n };\n\n // scripts\n if (n.module) {\n n.module.type = 'Script';\n n.module.attributes = extractAttributes(getText(n.module, options));\n parts.scripts.push(path.call(print, 'module'));\n }\n if (n.instance) {\n n.instance.type = 'Script';\n n.instance.attributes = extractAttributes(getText(n.instance, options));\n parts.scripts.push(path.call(print, 'instance'));\n }\n\n // styles\n if (n.css) {\n n.css.type = 'Style';\n n.css.content.type = 'StyleProgram';\n parts.styles.push(path.call(print, 'css'));\n }\n\n // markup\n const htmlDoc = path.call(print, 'html');\n if (htmlDoc) {\n parts.markup.push(htmlDoc);\n }\n if (svelteOptionsDoc) {\n parts.options.push(svelteOptionsDoc);\n }\n\n const docs = flatten(parseSortOrder(options.svelteSortOrder).map((p) => parts[p]));\n\n // Need to reset these because they are global and could affect the next formatting run\n ignoreNext = false;\n ignoreRange = false;\n svelteOptionsDoc = undefined;\n\n // If this is invoked as an embed of markdown, remove the last hardline.\n // The markdown parser tries this, too, but fails because it does not\n // recurse into concats. Doing this will prevent an empty line\n // at the end of the embedded code block.\n if (options.parentParser === 'markdown') {\n const lastDoc = docs[docs.length - 1];\n trimRight([lastDoc], isLine);\n }\n\n return groupConcat([join(hardline, docs)]);\n}\n\nfunction printAttributeNodeValue(\n path: FastPath<any>,\n print: PrintFn,\n quotes: boolean,\n node: AttributeNode | StyleDirectiveNode,\n) {\n const valueDocs = path.map((childPath) => childPath.call(print), 'value');\n\n if (!quotes || !formattableAttributes.includes(node.name)) {\n return concat(valueDocs);\n } else {\n return indent(groupConcat(trim(valueDocs, isLine)));\n }\n}\n\nfunction printSvelteBlockChildren(path: FastPath, print: PrintFn, options: ParserOptions): Doc {\n const node = path.getValue();\n const children = node.children;\n if (!children || children.length === 0) {\n return '';\n }\n\n const whitespaceAtStartOfBlock = checkWhitespaceAtStartOfSvelteBlock(node, options);\n const whitespaceAtEndOfBlock = checkWhitespaceAtEndOfSvelteBlock(node, options);\n const startline =\n whitespaceAtStartOfBlock === 'none'\n ? ''\n : whitespaceAtEndOfBlock === 'line' || whitespaceAtStartOfBlock === 'line'\n ? hardline\n : line;\n const endline =\n whitespaceAtEndOfBlock === 'none'\n ? ''\n : whitespaceAtEndOfBlock === 'line' || whitespaceAtStartOfBlock === 'line'\n ? hardline\n : line;\n\n const firstChild = children[0];\n const lastChild = children[children.length - 1];\n if (isTextNodeStartingWithWhitespace(firstChild)) {\n trimTextNodeLeft(firstChild);\n }\n if (isTextNodeEndingWithWhitespace(lastChild)) {\n trimTextNodeRight(lastChild);\n }\n\n return concat([\n indent(concat([startline, group(printChildren(path, print, options))])),\n endline,\n ]);\n}\n\nfunction printPre(\n node: Parameters<typeof printRaw>[0],\n originalText: string,\n path: FastPath,\n print: PrintFn,\n): Doc {\n const result: Doc = [];\n const length = node.children.length;\n for (let i = 0; i < length; i++) {\n const child = node.children[i];\n if (child.type === 'Text') {\n const lines = originalText.substring(child.start, child.end).split(/\\r?\\n/);\n lines.forEach((line, j) => {\n if (j > 0) result.push(literalline);\n result.push(line);\n });\n } else {\n result.push(path.call(print, 'children', i));\n }\n }\n return concat(result);\n}\n\nfunction printChildren(path: FastPath, print: PrintFn, options: ParserOptions): Doc {\n if (isPreTagContent(path)) {\n return concat(path.map(print, 'children'));\n }\n\n const childNodes: Node[] = prepareChildren(path.getValue().children, path, print);\n // modify original array because it's accessed later through map(print, 'children', idx)\n path.getValue().children = childNodes;\n if (childNodes.length === 0) {\n return '';\n }\n\n const childDocs: Doc[] = [];\n let handleWhitespaceOfPrevTextNode = false;\n\n for (let i = 0; i < childNodes.length; i++) {\n const childNode = childNodes[i];\n if (childNode.type === 'Text') {\n handleTextChild(i, childNode);\n } else if (isBlockElement(childNode, options)) {\n handleBlockChild(i);\n } else if (isInlineElement(path, options, childNode)) {\n handleInlineChild(i);\n } else {\n childDocs.push(printChild(i));\n handleWhitespaceOfPrevTextNode = false;\n }\n }\n\n // If there's at least one block element and more than one node, break content\n const forceBreakContent =\n childNodes.length > 1 && childNodes.some((child) => isBlockElement(child, options));\n if (forceBreakContent) {\n childDocs.push(breakParent);\n }\n\n return concat(childDocs);\n\n function printChild(idx: number): Doc {\n return path.call(print, 'children', idx);\n }\n\n /**\n * Print inline child. Hug whitespace of previous text child if there was one.\n */\n function handleInlineChild(idx: number) {\n if (handleWhitespaceOfPrevTextNode) {\n childDocs.push(groupConcat([line, printChild(idx)]));\n } else {\n childDocs.push(printChild(idx));\n }\n handleWhitespaceOfPrevTextNode = false;\n }\n\n /**\n * Print block element. Add softlines around it if needed\n * so it breaks into a separate line if children are broken up.\n * Don't add lines at the start/end if it's the first/last child because this\n * kind of whitespace handling is done in the parent already.\n */\n function handleBlockChild(idx: number) {\n const prevChild = childNodes[idx - 1];\n if (\n prevChild &&\n !isBlockElement(prevChild, options) &&\n (prevChild.type !== 'Text' ||\n handleWhitespaceOfPrevTextNode ||\n !isTextNodeEndingWithWhitespace(prevChild))\n ) {\n childDocs.push(softline);\n }\n\n childDocs.push(printChild(idx));\n\n const nextChild = childNodes[idx + 1];\n if (\n nextChild &&\n (nextChild.type !== 'Text' ||\n // Only handle text which starts with a whitespace and has text afterwards,\n // or is empty but followed by an inline element. The latter is done\n // so that if the children break, the inline element afterwards is in a separate line.\n ((!isEmptyTextNode(nextChild) ||\n (childNodes[idx + 2] && isInlineElement(path, options, childNodes[idx + 2]))) &&\n !isTextNodeStartingWithLinebreak(nextChild)))\n ) {\n childDocs.push(softline);\n }\n handleWhitespaceOfPrevTextNode = false;\n }\n\n /**\n * Print text child. First/last child white space handling\n * is done in parent already. By definition of the Svelte AST,\n * a text node always is inbetween other tags. Add hardlines\n * if the users wants to have them inbetween.\n * If the text is trimmed right, toggle flag telling\n * subsequent (inline)block element to alter its printing logic\n * to check if they need to hug or print lines themselves.\n */\n function handleTextChild(idx: number, childNode: TextNode) {\n handleWhitespaceOfPrevTextNode = false;\n\n if (idx === 0 || idx === childNodes.length - 1) {\n childDocs.push(printChild(idx));\n return;\n }\n\n const prevNode = childNodes[idx - 1];\n const nextNode = childNodes[idx + 1];\n\n if (\n isTextNodeStartingWithWhitespace(childNode) &&\n // If node is empty, go straight through to checking the right end\n !isEmptyTextNode(childNode)\n ) {\n if (\n isInlineElement(path, options, prevNode) &&\n !isTextNodeStartingWithLinebreak(childNode)\n ) {\n trimTextNodeLeft(childNode);\n const lastChildDoc = childDocs.pop()!;\n childDocs.push(groupConcat([lastChildDoc, line]));\n }\n\n if (isBlockElement(prevNode, options) && !isTextNodeStartingWithLinebreak(childNode)) {\n trimTextNodeLeft(childNode);\n }\n }\n\n if (isTextNodeEndingWithWhitespace(childNode)) {\n if (\n isInlineElement(path, options, nextNode) &&\n !isTextNodeEndingWithLinebreak(childNode)\n ) {\n handleWhitespaceOfPrevTextNode = !prevNode || !isBlockElement(prevNode, options);\n trimTextNodeRight(childNode);\n }\n if (isBlockElement(nextNode, options) && !isTextNodeEndingWithLinebreak(childNode, 2)) {\n handleWhitespaceOfPrevTextNode = !prevNode || !isBlockElement(prevNode, options);\n trimTextNodeRight(childNode);\n }\n }\n\n childDocs.push(printChild(idx));\n }\n}\n\n/**\n * `svelte:options` is part of the html part but needs to be snipped out and handled\n * separately to reorder it as configured. The comment above it should be moved with it.\n * Do that here.\n */\nfunction prepareChildren(children: Node[], path: FastPath, print: PrintFn): Node[] {\n let svelteOptionsComment: Doc | undefined;\n const childrenWithoutOptions = [];\n\n for (let idx = 0; idx < children.length; idx++) {\n const currentChild = children[idx];\n\n if (currentChild.type === 'Text' && getUnencodedText(currentChild) === '') {\n continue;\n }\n\n if (isEmptyTextNode(currentChild) && doesEmbedStartAfterNode(currentChild, path)) {\n continue;\n }\n\n if (isCommentFollowedByOptions(currentChild, idx)) {\n svelteOptionsComment = printComment(currentChild);\n const nextChild = children[idx + 1];\n idx += nextChild && isEmptyTextNode(nextChild) ? 1 : 0;\n continue;\n }\n\n if (currentChild.type === 'Options') {\n printSvelteOptions(currentChild, idx, path, print);\n continue;\n }\n\n childrenWithoutOptions.push(currentChild);\n }\n\n const mergedChildrenWithoutOptions = [];\n\n for (let idx = 0; idx < childrenWithoutOptions.length; idx++) {\n const currentChild = childrenWithoutOptions[idx];\n const nextChild = childrenWithoutOptions[idx + 1];\n\n if (currentChild.type === 'Text' && nextChild && nextChild.type === 'Text') {\n // A tag was snipped out (f.e. svelte:options). Join text\n currentChild.raw += nextChild.raw;\n currentChild.data += nextChild.data;\n idx++;\n }\n\n mergedChildrenWithoutOptions.push(currentChild);\n }\n\n return mergedChildrenWithoutOptions;\n\n function printSvelteOptions(\n node: OptionsNode,\n idx: number,\n path: FastPath,\n print: PrintFn,\n ): void {\n svelteOptionsDoc = groupConcat([\n groupConcat([\n '<',\n node.name,\n\n indent(groupConcat(path.map(print, 'children', idx, 'attributes'))),\n\n ' />',\n ]),\n hardline,\n ]);\n if (svelteOptionsComment) {\n svelteOptionsDoc = groupConcat([svelteOptionsComment, hardline, svelteOptionsDoc]);\n }\n }\n\n function isCommentFollowedByOptions(node: Node, idx: number): node is CommentNode {\n if (node.type !== 'Comment' || isIgnoreEndDirective(node) || isIgnoreStartDirective(node)) {\n return false;\n }\n\n const nextChild = children[idx + 1];\n if (nextChild) {\n if (isEmptyTextNode(nextChild)) {\n const afterNext = children[idx + 2];\n return afterNext && afterNext.type === 'Options';\n }\n return nextChild.type === 'Options';\n }\n\n return false;\n }\n}\n\n/**\n * Split the text into words separated by whitespace. Replace the whitespaces by lines,\n * collapsing multiple whitespaces into a single line.\n *\n * If the text starts or ends with multiple newlines, two of those should be kept.\n */\nfunction splitTextToDocs(node: TextNode): Doc[] {\n const text = getUnencodedText(node);\n let docs: Doc[] = text.split(/[\\t\\n\\f\\r ]+/);\n\n docs = join(line, docs).parts.filter((s) => s !== '');\n\n if (startsWithLinebreak(text)) {\n docs[0] = hardline;\n }\n if (startsWithLinebreak(text, 2)) {\n docs = [hardline, ...docs];\n }\n\n if (endsWithLinebreak(text)) {\n docs[docs.length - 1] = hardline;\n }\n if (endsWithLinebreak(text, 2)) {\n docs = [...docs, hardline];\n }\n\n return docs;\n}\n\nfunction printSvelteBlockJS(path: FastPath, print: PrintFn, name: string) {\n return printJS(path, print, false, true, false, name);\n}\n\nfunction printJS(\n path: FastPath,\n print: PrintFn,\n forceSingleQuote: boolean,\n forceSingleLine: boolean,\n removeParentheses: boolean,\n name: string,\n) {\n path.getValue()[name].isJS = true;\n path.getValue()[name].forceSingleQuote = forceSingleQuote;\n path.getValue()[name].forceSingleLine = forceSingleLine;\n path.getValue()[name].removeParentheses = removeParentheses;\n return path.call(print, name);\n}\n\nfunction expandNode(node: any, parent?: any): string {\n if (node === null) {\n return '';\n }\n\n if (typeof node === 'string') {\n // pre-v3.20 AST\n return ' ' + node;\n }\n\n switch (node.type) {\n case 'ArrayExpression':\n case 'ArrayPattern':\n return ' [' + node.elements.map(expandNode).join(',').slice(1) + ']';\n case 'AssignmentPattern':\n return expandNode(node.left) + ' =' + expandNode(node.right);\n case 'Identifier':\n return ' ' + node.name;\n case 'Literal':\n return ' ' + node.raw;\n case 'ObjectExpression':\n return ' {' + node.properties.map((p: any) => expandNode(p, node)).join(',') + ' }';\n case 'ObjectPattern':\n return ' {' + node.properties.map(expandNode).join(',') + ' }';\n case 'Property':\n if (node.value.type === 'ObjectPattern' || node.value.type === 'ArrayPattern') {\n return ' ' + node.key.name + ':' + expandNode(node.value);\n } else if (\n (node.value.type === 'Identifier' && node.key.name !== node.value.name) ||\n (parent && parent.type === 'ObjectExpression')\n ) {\n return expandNode(node.key) + ':' + expandNode(node.value);\n } else {\n return expandNode(node.value);\n }\n case 'RestElement':\n return ' ...' + node.argument.name;\n }\n\n console.error(JSON.stringify(node, null, 4));\n throw new Error('unknown node type: ' + node.type);\n}\n\nfunction printComment(node: CommentNode) {\n let text = node.data;\n\n if (hasSnippedContent(text)) {\n text = unsnipContent(text);\n }\n\n return groupConcat(['<!--', text, '-->']);\n}\n","import { Doc, doc, FastPath, ParserOptions } from 'prettier';\nimport { getText } from './lib/getText';\nimport { snippedTagContentAttribute } from './lib/snipTagContent';\nimport { PrintFn } from './print';\nimport { isLine, removeParentheses, trimRight } from './print/doc-helpers';\nimport {\n getAttributeTextValue,\n getLeadingComment,\n isIgnoreDirective,\n isNodeSupportedLanguage,\n isPugTemplate,\n isTypeScript,\n printRaw,\n} from './print/node-helpers';\nimport { ElementNode, Node } from './print/nodes';\n\nconst {\n builders: { concat, hardline, group, indent, literalline },\n utils: { removeLines },\n} = doc;\n\nexport function embed(\n path: FastPath,\n print: PrintFn,\n textToDoc: (text: string, options: object) => Doc,\n options: ParserOptions,\n): Doc | null {\n const node: Node = path.getNode();\n\n if (node.isJS) {\n try {\n const embeddedOptions: any = {\n parser: expressionParser,\n };\n if (node.forceSingleQuote) {\n embeddedOptions.singleQuote = true;\n }\n\n let docs = textToDoc(forceIntoExpression(getText(node, options)), embeddedOptions);\n if (node.forceSingleLine) {\n docs = removeLines(docs);\n }\n if (node.removeParentheses) {\n docs = removeParentheses(docs);\n }\n return docs;\n } catch (e) {\n return getText(node, options);\n }\n }\n\n const embedType = (\n tag: 'script' | 'style' | 'template',\n parser: 'typescript' | 'babel-ts' | 'css' | 'pug',\n isTopLevel: boolean,\n ) =>\n embedTag(\n tag,\n options.originalText,\n path,\n (content) => formatBodyContent(content, parser, textToDoc, options),\n print,\n isTopLevel,\n options,\n );\n\n const embedScript = (isTopLevel: boolean) =>\n embedType(\n 'script',\n // Use babel-ts as fallback because the absence does not mean the content is not TS,\n // the user could have set the default language. babel-ts will format things a little\n // bit different though, especially preserving parentheses around dot notation which\n // fixes https://github.com/sveltejs/prettier-plugin-svelte/issues/218\n isTypeScript(node) ? 'typescript' : 'babel-ts',\n isTopLevel,\n );\n const embedStyle = (isTopLevel: boolean) => embedType('style', 'css', isTopLevel);\n const embedPug = () => embedType('template', 'pug', false);\n\n switch (node.type) {\n case 'Script':\n return embedScript(true);\n case 'Style':\n return embedStyle(true);\n case 'Element': {\n if (node.name === 'script') {\n return embedScript(false);\n } else if (node.name === 'style') {\n return embedStyle(false);\n } else if (isPugTemplate(node)) {\n return embedPug();\n }\n }\n }\n\n return null;\n}\n\nfunction forceIntoExpression(statement: string) {\n // note the trailing newline: if the statement ends in a // comment,\n // we can't add the closing bracket right afterwards\n return `(${statement}\\n)`;\n}\n\nfunction expressionParser(text: string, parsers: any, options: any) {\n const ast = parsers.babel(text, parsers, options);\n\n return { ...ast, program: ast.program.body[0].expression };\n}\n\nfunction preformattedBody(str: string): Doc {\n const firstNewline = /^[\\t\\f\\r ]*\\n/;\n const lastNewline = /\\n[\\t\\f\\r ]*$/;\n\n // If we do not start with a new line prettier might try to break the opening tag\n // to keep it together with the string. Use a literal line to skip indentation.\n return concat([literalline, str.replace(firstNewline, '').replace(lastNewline, ''), hardline]);\n}\n\nfunction getSnippedContent(node: Node) {\n const encodedContent = getAttributeTextValue(snippedTagContentAttribute, node);\n\n if (encodedContent) {\n return Buffer.from(encodedContent, 'base64').toString('utf-8');\n } else {\n return '';\n }\n}\n\nfunction formatBodyContent(\n content: string,\n parser: 'typescript' | 'babel-ts' | 'css' | 'pug',\n textToDoc: (text: string, options: object) => Doc,\n options: ParserOptions & { pugTabWidth?: number },\n) {\n try {\n const body = textToDoc(content, { parser });\n\n if (parser === 'pug' && typeof body === 'string') {\n // Pug returns no docs but a final string.\n // Therefore prepend the line offsets\n const whitespace = options.useTabs\n ? '\\t'\n : ' '.repeat(\n options.pugTabWidth && options.pugTabWidth > 0\n ? options.pugTabWidth\n : options.tabWidth,\n );\n const pugBody = body\n .split('\\n')\n .map((line) => (line ? whitespace + line : line))\n .join('\\n');\n return concat([hardline, pugBody]);\n }\n\n const indentIfDesired = (doc: Doc) =>\n options.svelteIndentScriptAndStyle ? indent(doc) : doc;\n trimRight([body], isLine);\n return concat([indentIfDesired(concat([hardline, body])), hardline]);\n } catch (error) {\n if (process.env.PRETTIER_DEBUG) {\n throw error;\n }\n\n // We will wind up here if there is a syntax error in the embedded code. If we throw an error,\n // prettier will try to print the node with the printer. That will fail with a hard-to-interpret\n // error message (e.g. \"Unsupported node type\", referring to `<script>`).\n // Therefore, fall back on just returning the unformatted text.\n console.error(error);\n\n return preformattedBody(content);\n }\n}\n\nfunction embedTag(\n tag: 'script' | 'style' | 'template',\n text: string,\n path: FastPath,\n formatBodyContent: (content: string) => Doc,\n print: PrintFn,\n isTopLevel: boolean,\n options: ParserOptions,\n) {\n const node: Node = path.getNode();\n const content =\n tag === 'template' ? printRaw(node as ElementNode, text) : getSnippedContent(node);\n const previousComment = getLeadingComment(path);\n\n const canFormat =\n isNodeSupportedLanguage(node) &&\n !isIgnoreDirective(previousComment) &&\n (tag !== 'template' ||\n options.plugins.some(\n (plugin) => typeof plugin !== 'string' && plugin.parsers && plugin.parsers.pug,\n ));\n const body: Doc = canFormat\n ? content.trim() !== ''\n ? formatBodyContent(content)\n : content === ''\n ? ''\n : hardline\n : preformattedBody(content);\n\n const attributes = concat(\n path.map(\n (childPath) =>\n childPath.getNode().name !== snippedTagContentAttribute\n ? childPath.call(print)\n : '',\n 'attributes',\n ),\n );\n\n let result: Doc = group(\n concat(['<', tag, indent(group(attributes)), '>', body, '</', tag, '>']),\n );\n\n if (isTopLevel) {\n // top level embedded nodes have been moved from their normal position in the\n // node tree. if there is a comment referring to it, it must be recreated at\n // the new position.\n if (previousComment) {\n result = concat(['<!--', previousComment.data, '-->', hardline, result, hardline]);\n } else {\n result = concat([result, hardline]);\n }\n }\n\n return result;\n}\n","import { SupportLanguage, Parser, Printer } from 'prettier';\nimport { print } from './print';\nimport { ASTNode } from './print/nodes';\nimport { embed } from './embed';\nimport { snipScriptAndStyleTagContent } from './lib/snipTagContent';\n\nfunction locStart(node: any) {\n return node.start;\n}\n\nfunction locEnd(node: any) {\n return node.end;\n}\n\nexport const languages: Partial<SupportLanguage>[] = [\n {\n name: 'svelte',\n parsers: ['svelte'],\n extensions: ['.svelte'],\n vscodeLanguageIds: ['svelte'],\n },\n];\n\nexport const parsers: Record<string, Parser> = {\n svelte: {\n parse: (text) => {\n try {\n return <ASTNode>{ ...require(`svelte/compiler`).parse(text), __isRoot: true };\n } catch (err: any) {\n if (err.start != null && err.end != null) {\n // Prettier expects error objects to have loc.start and loc.end fields.\n // Svelte uses start and end directly on the error.\n err.loc = {\n start: err.start,\n end: err.end,\n };\n }\n\n throw err;\n }\n },\n preprocess: (text, options) => {\n text = snipScriptAndStyleTagContent(text);\n text = text.trim();\n // Prettier sets the preprocessed text as the originalText in case\n // the Svelte formatter is called directly. In case it's called\n // as an embedded parser (for example when there's a Svelte code block\n // inside markdown), the originalText is not updated after preprocessing.\n // Therefore we do it ourselves here.\n options.originalText = text;\n return text;\n },\n locStart,\n locEnd,\n astFormat: 'svelte-ast',\n },\n};\n\nexport const printers: Record<string, Printer> = {\n 'svelte-ast': {\n print,\n embed,\n },\n};\n\nexport { options } from './options';\n"],"names":["doc","concat","hardline","group","indent","literalline"],"mappings":";;;;;;AAEA;AACO,MAAM,eAAe,GAAG;IAC3B,MAAM;IACN,MAAM;IACN,IAAI;IACJ,KAAK;IACL,OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK;CACR,CAAC;AAEF;AACO,MAAM,aAAa,GAAc;IACpC,SAAS;IACT,SAAS;IACT,OAAO;IACP,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,KAAK;IACL,IAAI;IACJ,GAAG;IACH,KAAK;IACL,SAAS;IACT,OAAO;IACP,IAAI;CACP,CAAC;AAEF;;;AAGO,MAAM,qBAAqB,GAAa;AAC3C;AACA;AACA;CACH;;SC9De,iBAAiB,CAAC,IAAY;IAC1C,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;IACnD,MAAM,cAAc,GAAG,+BAA+B,CAAC;IAEvD,MAAM,GAAG,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAE,CAAC;IAEjE,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,IAAI,KAA8B,CAAC;IACnC,QAAQ,KAAK,GAAG,cAAc,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