From 0822953782a9f7551be83add42e2ace7c394380b Mon Sep 17 00:00:00 2001 From: Miguel Camba Date: Fri, 8 Nov 2024 10:18:11 +0100 Subject: [PATCH] Stop tracking beacon_live_admin files --- priv/static/beacon_live_admin.js | 32690 -------------------- priv/static/beacon_live_admin.js.map | 7 - priv/static/beacon_live_admin.min.css | 3 - priv/static/beacon_live_admin.min.css.map | 1 - 4 files changed, 32701 deletions(-) delete mode 100644 priv/static/beacon_live_admin.js delete mode 100644 priv/static/beacon_live_admin.js.map delete mode 100644 priv/static/beacon_live_admin.min.css delete mode 100644 priv/static/beacon_live_admin.min.css.map diff --git a/priv/static/beacon_live_admin.js b/priv/static/beacon_live_admin.js deleted file mode 100644 index 45de6757..00000000 --- a/priv/static/beacon_live_admin.js +++ /dev/null @@ -1,32690 +0,0 @@ -var BeaconLiveAdmin = (() => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2; - var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; - }; - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var __publicField = (obj, key, value2) => { - __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2); - return value2; - }; - - // vendor/topbar.js - var require_topbar = __commonJS({ - "vendor/topbar.js"(exports, module) { - (function(window2, document3) { - "use strict"; - (function() { - var lastTime = 0; - var vendors = ["ms", "moz", "webkit", "o"]; - for (var x = 0; x < vendors.length && !window2.requestAnimationFrame; ++x) { - window2.requestAnimationFrame = window2[vendors[x] + "RequestAnimationFrame"]; - window2.cancelAnimationFrame = window2[vendors[x] + "CancelAnimationFrame"] || window2[vendors[x] + "CancelRequestAnimationFrame"]; - } - if (!window2.requestAnimationFrame) - window2.requestAnimationFrame = function(callback, element2) { - var currTime = (/* @__PURE__ */ new Date()).getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window2.setTimeout(function() { - callback(currTime + timeToCall); - }, timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - if (!window2.cancelAnimationFrame) - window2.cancelAnimationFrame = function(id) { - clearTimeout(id); - }; - })(); - var canvas, currentProgress, showing, progressTimerId = null, fadeTimerId = null, delayTimerId = null, addEvent = function(elem, type, handler) { - if (elem.addEventListener) - elem.addEventListener(type, handler, false); - else if (elem.attachEvent) - elem.attachEvent("on" + type, handler); - else - elem["on" + type] = handler; - }, options = { - autoRun: true, - barThickness: 3, - barColors: { - 0: "rgba(26, 188, 156, .9)", - ".25": "rgba(52, 152, 219, .9)", - ".50": "rgba(241, 196, 15, .9)", - ".75": "rgba(230, 126, 34, .9)", - "1.0": "rgba(211, 84, 0, .9)" - }, - shadowBlur: 10, - shadowColor: "rgba(0, 0, 0, .6)", - className: null - }, repaint = function() { - canvas.width = window2.innerWidth; - canvas.height = options.barThickness * 5; - var ctx = canvas.getContext("2d"); - ctx.shadowBlur = options.shadowBlur; - ctx.shadowColor = options.shadowColor; - var lineGradient = ctx.createLinearGradient(0, 0, canvas.width, 0); - for (var stop in options.barColors) - lineGradient.addColorStop(stop, options.barColors[stop]); - ctx.lineWidth = options.barThickness; - ctx.beginPath(); - ctx.moveTo(0, options.barThickness / 2); - ctx.lineTo(Math.ceil(currentProgress * canvas.width), options.barThickness / 2); - ctx.strokeStyle = lineGradient; - ctx.stroke(); - }, createCanvas = function() { - canvas = document3.createElement("canvas"); - var style = canvas.style; - style.position = "fixed"; - style.top = style.left = style.right = style.margin = style.padding = 0; - style.zIndex = 100001; - style.display = "none"; - if (options.className) - canvas.classList.add(options.className); - document3.body.appendChild(canvas); - addEvent(window2, "resize", repaint); - }, topbar2 = { - config: function(opts) { - for (var key in opts) - if (options.hasOwnProperty(key)) - options[key] = opts[key]; - }, - show: function(delay) { - if (showing) - return; - if (delay) { - if (delayTimerId) - return; - delayTimerId = setTimeout(() => topbar2.show(), delay); - } else { - showing = true; - if (fadeTimerId !== null) - window2.cancelAnimationFrame(fadeTimerId); - if (!canvas) - createCanvas(); - canvas.style.opacity = 1; - canvas.style.display = "block"; - topbar2.progress(0); - if (options.autoRun) { - ; - (function loop2() { - progressTimerId = window2.requestAnimationFrame(loop2); - topbar2.progress("+" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2)); - })(); - } - } - }, - progress: function(to) { - if (typeof to === "undefined") - return currentProgress; - if (typeof to === "string") { - to = (to.indexOf("+") >= 0 || to.indexOf("-") >= 0 ? currentProgress : 0) + parseFloat(to); - } - currentProgress = to > 1 ? 1 : to; - repaint(); - return currentProgress; - }, - hide: function() { - clearTimeout(delayTimerId); - delayTimerId = null; - if (!showing) - return; - showing = false; - if (progressTimerId != null) { - window2.cancelAnimationFrame(progressTimerId); - progressTimerId = null; - } - ; - (function loop2() { - if (topbar2.progress("+.1") >= 1) { - canvas.style.opacity -= 0.05; - if (canvas.style.opacity <= 0.05) { - canvas.style.display = "none"; - fadeTimerId = null; - return; - } - } - fadeTimerId = window2.requestAnimationFrame(loop2); - })(); - } - }; - if (typeof module === "object" && typeof module.exports === "object") { - module.exports = topbar2; - } else if (typeof define === "function" && define.amd) { - define(function() { - return topbar2; - }); - } else { - this.topbar = topbar2; - } - }).call(exports, window, document); - } - }); - - // node_modules/picocolors/picocolors.browser.js - var require_picocolors_browser = __commonJS({ - "node_modules/picocolors/picocolors.browser.js"(exports, module) { - var x = String; - var create3 = function() { - return { isColorSupported: false, reset: x, bold: x, dim: x, italic: x, underline: x, inverse: x, hidden: x, strikethrough: x, black: x, red: x, green: x, yellow: x, blue: x, magenta: x, cyan: x, white: x, gray: x, bgBlack: x, bgRed: x, bgGreen: x, bgYellow: x, bgBlue: x, bgMagenta: x, bgCyan: x, bgWhite: x }; - }; - module.exports = create3(); - module.exports.createColors = create3; - } - }); - - // (disabled):node_modules/postcss/lib/terminal-highlight - var require_terminal_highlight = __commonJS({ - "(disabled):node_modules/postcss/lib/terminal-highlight"() { - } - }); - - // node_modules/postcss/lib/css-syntax-error.js - var require_css_syntax_error = __commonJS({ - "node_modules/postcss/lib/css-syntax-error.js"(exports, module) { - "use strict"; - var pico = require_picocolors_browser(); - var terminalHighlight = require_terminal_highlight(); - var CssSyntaxError2 = class _CssSyntaxError extends Error { - constructor(message, line, column, source, file15, plugin2) { - super(message); - this.name = "CssSyntaxError"; - this.reason = message; - if (file15) { - this.file = file15; - } - if (source) { - this.source = source; - } - if (plugin2) { - this.plugin = plugin2; - } - if (typeof line !== "undefined" && typeof column !== "undefined") { - if (typeof line === "number") { - this.line = line; - this.column = column; - } else { - this.line = line.line; - this.column = line.column; - this.endLine = column.line; - this.endColumn = column.column; - } - } - this.setMessage(); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, _CssSyntaxError); - } - } - setMessage() { - this.message = this.plugin ? this.plugin + ": " : ""; - this.message += this.file ? this.file : ""; - if (typeof this.line !== "undefined") { - this.message += ":" + this.line + ":" + this.column; - } - this.message += ": " + this.reason; - } - showSourceCode(color2) { - if (!this.source) - return ""; - let css = this.source; - if (color2 == null) - color2 = pico.isColorSupported; - let aside = (text2) => text2; - let mark = (text2) => text2; - let highlight = (text2) => text2; - if (color2) { - let { bold, gray, red } = pico.createColors(true); - mark = (text2) => bold(red(text2)); - aside = (text2) => gray(text2); - if (terminalHighlight) { - highlight = (text2) => terminalHighlight(text2); - } - } - let lines = css.split(/\r?\n/); - let start = Math.max(this.line - 3, 0); - let end = Math.min(this.line + 2, lines.length); - let maxWidth = String(end).length; - return lines.slice(start, end).map((line, index4) => { - let number2 = start + 1 + index4; - let gutter = " " + (" " + number2).slice(-maxWidth) + " | "; - if (number2 === this.line) { - if (line.length > 160) { - let padding = 20; - let subLineStart = Math.max(0, this.column - padding); - let subLineEnd = Math.max( - this.column + padding, - this.endColumn + padding - ); - let subLine = line.slice(subLineStart, subLineEnd); - let spacing2 = aside(gutter.replace(/\d/g, " ")) + line.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, " "); - return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing2 + mark("^"); - } - let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " "); - return mark(">") + aside(gutter) + highlight(line) + "\n " + spacing + mark("^"); - } - return " " + aside(gutter) + highlight(line); - }).join("\n"); - } - toString() { - let code = this.showSourceCode(); - if (code) { - code = "\n\n" + code + "\n"; - } - return this.name + ": " + this.message + code; - } - }; - module.exports = CssSyntaxError2; - CssSyntaxError2.default = CssSyntaxError2; - } - }); - - // node_modules/postcss/lib/stringifier.js - var require_stringifier = __commonJS({ - "node_modules/postcss/lib/stringifier.js"(exports, module) { - "use strict"; - var DEFAULT_RAW = { - after: "\n", - beforeClose: "\n", - beforeComment: "\n", - beforeDecl: "\n", - beforeOpen: " ", - beforeRule: "\n", - colon: ": ", - commentLeft: " ", - commentRight: " ", - emptyBody: "", - indent: " ", - semicolon: false - }; - function capitalize(str) { - return str[0].toUpperCase() + str.slice(1); - } - var Stringifier = class { - constructor(builder) { - this.builder = builder; - } - atrule(node, semicolon) { - let name = "@" + node.name; - let params = node.params ? this.rawValue(node, "params") : ""; - if (typeof node.raws.afterName !== "undefined") { - name += node.raws.afterName; - } else if (params) { - name += " "; - } - if (node.nodes) { - this.block(node, name + params); - } else { - let end = (node.raws.between || "") + (semicolon ? ";" : ""); - this.builder(name + params + end, node); - } - } - beforeAfter(node, detect) { - let value2; - if (node.type === "decl") { - value2 = this.raw(node, null, "beforeDecl"); - } else if (node.type === "comment") { - value2 = this.raw(node, null, "beforeComment"); - } else if (detect === "before") { - value2 = this.raw(node, null, "beforeRule"); - } else { - value2 = this.raw(node, null, "beforeClose"); - } - let buf = node.parent; - let depth = 0; - while (buf && buf.type !== "root") { - depth += 1; - buf = buf.parent; - } - if (value2.includes("\n")) { - let indent = this.raw(node, null, "indent"); - if (indent.length) { - for (let step = 0; step < depth; step++) - value2 += indent; - } - } - return value2; - } - block(node, start) { - let between = this.raw(node, "between", "beforeOpen"); - this.builder(start + between + "{", node, "start"); - let after; - if (node.nodes && node.nodes.length) { - this.body(node); - after = this.raw(node, "after"); - } else { - after = this.raw(node, "after", "emptyBody"); - } - if (after) - this.builder(after); - this.builder("}", node, "end"); - } - body(node) { - let last = node.nodes.length - 1; - while (last > 0) { - if (node.nodes[last].type !== "comment") - break; - last -= 1; - } - let semicolon = this.raw(node, "semicolon"); - for (let i = 0; i < node.nodes.length; i++) { - let child = node.nodes[i]; - let before = this.raw(child, "before"); - if (before) - this.builder(before); - this.stringify(child, last !== i || semicolon); - } - } - comment(node) { - let left = this.raw(node, "left", "commentLeft"); - let right = this.raw(node, "right", "commentRight"); - this.builder("/*" + left + node.text + right + "*/", node); - } - decl(node, semicolon) { - let between = this.raw(node, "between", "colon"); - let string = node.prop + between + this.rawValue(node, "value"); - if (node.important) { - string += node.raws.important || " !important"; - } - if (semicolon) - string += ";"; - this.builder(string, node); - } - document(node) { - this.body(node); - } - raw(node, own, detect) { - let value2; - if (!detect) - detect = own; - if (own) { - value2 = node.raws[own]; - if (typeof value2 !== "undefined") - return value2; - } - let parent = node.parent; - if (detect === "before") { - if (!parent || parent.type === "root" && parent.first === node) { - return ""; - } - if (parent && parent.type === "document") { - return ""; - } - } - if (!parent) - return DEFAULT_RAW[detect]; - let root2 = node.root(); - if (!root2.rawCache) - root2.rawCache = {}; - if (typeof root2.rawCache[detect] !== "undefined") { - return root2.rawCache[detect]; - } - if (detect === "before" || detect === "after") { - return this.beforeAfter(node, detect); - } else { - let method = "raw" + capitalize(detect); - if (this[method]) { - value2 = this[method](root2, node); - } else { - root2.walk((i) => { - value2 = i.raws[own]; - if (typeof value2 !== "undefined") - return false; - }); - } - } - if (typeof value2 === "undefined") - value2 = DEFAULT_RAW[detect]; - root2.rawCache[detect] = value2; - return value2; - } - rawBeforeClose(root2) { - let value2; - root2.walk((i) => { - if (i.nodes && i.nodes.length > 0) { - if (typeof i.raws.after !== "undefined") { - value2 = i.raws.after; - if (value2.includes("\n")) { - value2 = value2.replace(/[^\n]+$/, ""); - } - return false; - } - } - }); - if (value2) - value2 = value2.replace(/\S/g, ""); - return value2; - } - rawBeforeComment(root2, node) { - let value2; - root2.walkComments((i) => { - if (typeof i.raws.before !== "undefined") { - value2 = i.raws.before; - if (value2.includes("\n")) { - value2 = value2.replace(/[^\n]+$/, ""); - } - return false; - } - }); - if (typeof value2 === "undefined") { - value2 = this.raw(node, null, "beforeDecl"); - } else if (value2) { - value2 = value2.replace(/\S/g, ""); - } - return value2; - } - rawBeforeDecl(root2, node) { - let value2; - root2.walkDecls((i) => { - if (typeof i.raws.before !== "undefined") { - value2 = i.raws.before; - if (value2.includes("\n")) { - value2 = value2.replace(/[^\n]+$/, ""); - } - return false; - } - }); - if (typeof value2 === "undefined") { - value2 = this.raw(node, null, "beforeRule"); - } else if (value2) { - value2 = value2.replace(/\S/g, ""); - } - return value2; - } - rawBeforeOpen(root2) { - let value2; - root2.walk((i) => { - if (i.type !== "decl") { - value2 = i.raws.between; - if (typeof value2 !== "undefined") - return false; - } - }); - return value2; - } - rawBeforeRule(root2) { - let value2; - root2.walk((i) => { - if (i.nodes && (i.parent !== root2 || root2.first !== i)) { - if (typeof i.raws.before !== "undefined") { - value2 = i.raws.before; - if (value2.includes("\n")) { - value2 = value2.replace(/[^\n]+$/, ""); - } - return false; - } - } - }); - if (value2) - value2 = value2.replace(/\S/g, ""); - return value2; - } - rawColon(root2) { - let value2; - root2.walkDecls((i) => { - if (typeof i.raws.between !== "undefined") { - value2 = i.raws.between.replace(/[^\s:]/g, ""); - return false; - } - }); - return value2; - } - rawEmptyBody(root2) { - let value2; - root2.walk((i) => { - if (i.nodes && i.nodes.length === 0) { - value2 = i.raws.after; - if (typeof value2 !== "undefined") - return false; - } - }); - return value2; - } - rawIndent(root2) { - if (root2.raws.indent) - return root2.raws.indent; - let value2; - root2.walk((i) => { - let p = i.parent; - if (p && p !== root2 && p.parent && p.parent === root2) { - if (typeof i.raws.before !== "undefined") { - let parts = i.raws.before.split("\n"); - value2 = parts[parts.length - 1]; - value2 = value2.replace(/\S/g, ""); - return false; - } - } - }); - return value2; - } - rawSemicolon(root2) { - let value2; - root2.walk((i) => { - if (i.nodes && i.nodes.length && i.last.type === "decl") { - value2 = i.raws.semicolon; - if (typeof value2 !== "undefined") - return false; - } - }); - return value2; - } - rawValue(node, prop) { - let value2 = node[prop]; - let raw = node.raws[prop]; - if (raw && raw.value === value2) { - return raw.raw; - } - return value2; - } - root(node) { - this.body(node); - if (node.raws.after) - this.builder(node.raws.after); - } - rule(node) { - this.block(node, this.rawValue(node, "selector")); - if (node.raws.ownSemicolon) { - this.builder(node.raws.ownSemicolon, node, "end"); - } - } - stringify(node, semicolon) { - if (!this[node.type]) { - throw new Error( - "Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier." - ); - } - this[node.type](node, semicolon); - } - }; - module.exports = Stringifier; - Stringifier.default = Stringifier; - } - }); - - // node_modules/postcss/lib/stringify.js - var require_stringify = __commonJS({ - "node_modules/postcss/lib/stringify.js"(exports, module) { - "use strict"; - var Stringifier = require_stringifier(); - function stringify2(node, builder) { - let str = new Stringifier(builder); - str.stringify(node); - } - module.exports = stringify2; - stringify2.default = stringify2; - } - }); - - // node_modules/postcss/lib/symbols.js - var require_symbols = __commonJS({ - "node_modules/postcss/lib/symbols.js"(exports, module) { - "use strict"; - module.exports.isClean = Symbol("isClean"); - module.exports.my = Symbol("my"); - } - }); - - // node_modules/postcss/lib/node.js - var require_node = __commonJS({ - "node_modules/postcss/lib/node.js"(exports, module) { - "use strict"; - var CssSyntaxError2 = require_css_syntax_error(); - var Stringifier = require_stringifier(); - var stringify2 = require_stringify(); - var { isClean, my } = require_symbols(); - function cloneNode(obj, parent) { - let cloned = new obj.constructor(); - for (let i in obj) { - if (!Object.prototype.hasOwnProperty.call(obj, i)) { - continue; - } - if (i === "proxyCache") - continue; - let value2 = obj[i]; - let type = typeof value2; - if (i === "parent" && type === "object") { - if (parent) - cloned[i] = parent; - } else if (i === "source") { - cloned[i] = value2; - } else if (Array.isArray(value2)) { - cloned[i] = value2.map((j) => cloneNode(j, cloned)); - } else { - if (type === "object" && value2 !== null) - value2 = cloneNode(value2); - cloned[i] = value2; - } - } - return cloned; - } - var Node2 = class { - constructor(defaults3 = {}) { - this.raws = {}; - this[isClean] = false; - this[my] = true; - for (let name in defaults3) { - if (name === "nodes") { - this.nodes = []; - for (let node of defaults3[name]) { - if (typeof node.clone === "function") { - this.append(node.clone()); - } else { - this.append(node); - } - } - } else { - this[name] = defaults3[name]; - } - } - } - addToError(error) { - error.postcssNode = this; - if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { - let s = this.source; - error.stack = error.stack.replace( - /\n\s{4}at /, - `$&${s.input.from}:${s.start.line}:${s.start.column}$&` - ); - } - return error; - } - after(add) { - this.parent.insertAfter(this, add); - return this; - } - assign(overrides = {}) { - for (let name in overrides) { - this[name] = overrides[name]; - } - return this; - } - before(add) { - this.parent.insertBefore(this, add); - return this; - } - cleanRaws(keepBetween) { - delete this.raws.before; - delete this.raws.after; - if (!keepBetween) - delete this.raws.between; - } - clone(overrides = {}) { - let cloned = cloneNode(this); - for (let name in overrides) { - cloned[name] = overrides[name]; - } - return cloned; - } - cloneAfter(overrides = {}) { - let cloned = this.clone(overrides); - this.parent.insertAfter(this, cloned); - return cloned; - } - cloneBefore(overrides = {}) { - let cloned = this.clone(overrides); - this.parent.insertBefore(this, cloned); - return cloned; - } - error(message, opts = {}) { - if (this.source) { - let { end, start } = this.rangeBy(opts); - return this.source.input.error( - message, - { column: start.column, line: start.line }, - { column: end.column, line: end.line }, - opts - ); - } - return new CssSyntaxError2(message); - } - getProxyProcessor() { - return { - get(node, prop) { - if (prop === "proxyOf") { - return node; - } else if (prop === "root") { - return () => node.root().toProxy(); - } else { - return node[prop]; - } - }, - set(node, prop, value2) { - if (node[prop] === value2) - return true; - node[prop] = value2; - if (prop === "prop" || prop === "value" || prop === "name" || prop === "params" || prop === "important" || /* c8 ignore next */ - prop === "text") { - node.markDirty(); - } - return true; - } - }; - } - markClean() { - this[isClean] = true; - } - markDirty() { - if (this[isClean]) { - this[isClean] = false; - let next = this; - while (next = next.parent) { - next[isClean] = false; - } - } - } - next() { - if (!this.parent) - return void 0; - let index4 = this.parent.index(this); - return this.parent.nodes[index4 + 1]; - } - positionBy(opts, stringRepresentation) { - let pos = this.source.start; - if (opts.index) { - pos = this.positionInside(opts.index, stringRepresentation); - } else if (opts.word) { - stringRepresentation = this.toString(); - let index4 = stringRepresentation.indexOf(opts.word); - if (index4 !== -1) - pos = this.positionInside(index4, stringRepresentation); - } - return pos; - } - positionInside(index4, stringRepresentation) { - let string = stringRepresentation || this.toString(); - let column = this.source.start.column; - let line = this.source.start.line; - for (let i = 0; i < index4; i++) { - if (string[i] === "\n") { - column = 1; - line += 1; - } else { - column += 1; - } - } - return { column, line }; - } - prev() { - if (!this.parent) - return void 0; - let index4 = this.parent.index(this); - return this.parent.nodes[index4 - 1]; - } - rangeBy(opts) { - let start = { - column: this.source.start.column, - line: this.source.start.line - }; - let end = this.source.end ? { - column: this.source.end.column + 1, - line: this.source.end.line - } : { - column: start.column + 1, - line: start.line - }; - if (opts.word) { - let stringRepresentation = this.toString(); - let index4 = stringRepresentation.indexOf(opts.word); - if (index4 !== -1) { - start = this.positionInside(index4, stringRepresentation); - end = this.positionInside(index4 + opts.word.length, stringRepresentation); - } - } else { - if (opts.start) { - start = { - column: opts.start.column, - line: opts.start.line - }; - } else if (opts.index) { - start = this.positionInside(opts.index); - } - if (opts.end) { - end = { - column: opts.end.column, - line: opts.end.line - }; - } else if (typeof opts.endIndex === "number") { - end = this.positionInside(opts.endIndex); - } else if (opts.index) { - end = this.positionInside(opts.index + 1); - } - } - if (end.line < start.line || end.line === start.line && end.column <= start.column) { - end = { column: start.column + 1, line: start.line }; - } - return { end, start }; - } - raw(prop, defaultType) { - let str = new Stringifier(); - return str.raw(this, prop, defaultType); - } - remove() { - if (this.parent) { - this.parent.removeChild(this); - } - this.parent = void 0; - return this; - } - replaceWith(...nodes) { - if (this.parent) { - let bookmark = this; - let foundSelf = false; - for (let node of nodes) { - if (node === this) { - foundSelf = true; - } else if (foundSelf) { - this.parent.insertAfter(bookmark, node); - bookmark = node; - } else { - this.parent.insertBefore(bookmark, node); - } - } - if (!foundSelf) { - this.remove(); - } - } - return this; - } - root() { - let result = this; - while (result.parent && result.parent.type !== "document") { - result = result.parent; - } - return result; - } - toJSON(_, inputs) { - let fixed = {}; - let emitInputs = inputs == null; - inputs = inputs || /* @__PURE__ */ new Map(); - let inputsNextIndex = 0; - for (let name in this) { - if (!Object.prototype.hasOwnProperty.call(this, name)) { - continue; - } - if (name === "parent" || name === "proxyCache") - continue; - let value2 = this[name]; - if (Array.isArray(value2)) { - fixed[name] = value2.map((i) => { - if (typeof i === "object" && i.toJSON) { - return i.toJSON(null, inputs); - } else { - return i; - } - }); - } else if (typeof value2 === "object" && value2.toJSON) { - fixed[name] = value2.toJSON(null, inputs); - } else if (name === "source") { - let inputId = inputs.get(value2.input); - if (inputId == null) { - inputId = inputsNextIndex; - inputs.set(value2.input, inputsNextIndex); - inputsNextIndex++; - } - fixed[name] = { - end: value2.end, - inputId, - start: value2.start - }; - } else { - fixed[name] = value2; - } - } - if (emitInputs) { - fixed.inputs = [...inputs.keys()].map((input) => input.toJSON()); - } - return fixed; - } - toProxy() { - if (!this.proxyCache) { - this.proxyCache = new Proxy(this, this.getProxyProcessor()); - } - return this.proxyCache; - } - toString(stringifier = stringify2) { - if (stringifier.stringify) - stringifier = stringifier.stringify; - let result = ""; - stringifier(this, (i) => { - result += i; - }); - return result; - } - warn(result, text2, opts) { - let data = { node: this }; - for (let i in opts) - data[i] = opts[i]; - return result.warn(text2, data); - } - get proxyOf() { - return this; - } - }; - module.exports = Node2; - Node2.default = Node2; - } - }); - - // node_modules/postcss/lib/comment.js - var require_comment = __commonJS({ - "node_modules/postcss/lib/comment.js"(exports, module) { - "use strict"; - var Node2 = require_node(); - var Comment2 = class extends Node2 { - constructor(defaults3) { - super(defaults3); - this.type = "comment"; - } - }; - module.exports = Comment2; - Comment2.default = Comment2; - } - }); - - // node_modules/postcss/lib/declaration.js - var require_declaration = __commonJS({ - "node_modules/postcss/lib/declaration.js"(exports, module) { - "use strict"; - var Node2 = require_node(); - var Declaration2 = class extends Node2 { - constructor(defaults3) { - if (defaults3 && typeof defaults3.value !== "undefined" && typeof defaults3.value !== "string") { - defaults3 = { ...defaults3, value: String(defaults3.value) }; - } - super(defaults3); - this.type = "decl"; - } - get variable() { - return this.prop.startsWith("--") || this.prop[0] === "$"; - } - }; - module.exports = Declaration2; - Declaration2.default = Declaration2; - } - }); - - // node_modules/postcss/lib/container.js - var require_container = __commonJS({ - "node_modules/postcss/lib/container.js"(exports, module) { - "use strict"; - var Comment2 = require_comment(); - var Declaration2 = require_declaration(); - var Node2 = require_node(); - var { isClean, my } = require_symbols(); - var AtRule2; - var parse3; - var Root2; - var Rule2; - function cleanSource(nodes) { - return nodes.map((i) => { - if (i.nodes) - i.nodes = cleanSource(i.nodes); - delete i.source; - return i; - }); - } - function markTreeDirty(node) { - node[isClean] = false; - if (node.proxyOf.nodes) { - for (let i of node.proxyOf.nodes) { - markTreeDirty(i); - } - } - } - var Container2 = class _Container extends Node2 { - append(...children2) { - for (let child of children2) { - let nodes = this.normalize(child, this.last); - for (let node of nodes) - this.proxyOf.nodes.push(node); - } - this.markDirty(); - return this; - } - cleanRaws(keepBetween) { - super.cleanRaws(keepBetween); - if (this.nodes) { - for (let node of this.nodes) - node.cleanRaws(keepBetween); - } - } - each(callback) { - if (!this.proxyOf.nodes) - return void 0; - let iterator = this.getIterator(); - let index4, result; - while (this.indexes[iterator] < this.proxyOf.nodes.length) { - index4 = this.indexes[iterator]; - result = callback(this.proxyOf.nodes[index4], index4); - if (result === false) - break; - this.indexes[iterator] += 1; - } - delete this.indexes[iterator]; - return result; - } - every(condition) { - return this.nodes.every(condition); - } - getIterator() { - if (!this.lastEach) - this.lastEach = 0; - if (!this.indexes) - this.indexes = {}; - this.lastEach += 1; - let iterator = this.lastEach; - this.indexes[iterator] = 0; - return iterator; - } - getProxyProcessor() { - return { - get(node, prop) { - if (prop === "proxyOf") { - return node; - } else if (!node[prop]) { - return node[prop]; - } else if (prop === "each" || typeof prop === "string" && prop.startsWith("walk")) { - return (...args) => { - return node[prop]( - ...args.map((i) => { - if (typeof i === "function") { - return (child, index4) => i(child.toProxy(), index4); - } else { - return i; - } - }) - ); - }; - } else if (prop === "every" || prop === "some") { - return (cb) => { - return node[prop]( - (child, ...other) => cb(child.toProxy(), ...other) - ); - }; - } else if (prop === "root") { - return () => node.root().toProxy(); - } else if (prop === "nodes") { - return node.nodes.map((i) => i.toProxy()); - } else if (prop === "first" || prop === "last") { - return node[prop].toProxy(); - } else { - return node[prop]; - } - }, - set(node, prop, value2) { - if (node[prop] === value2) - return true; - node[prop] = value2; - if (prop === "name" || prop === "params" || prop === "selector") { - node.markDirty(); - } - return true; - } - }; - } - index(child) { - if (typeof child === "number") - return child; - if (child.proxyOf) - child = child.proxyOf; - return this.proxyOf.nodes.indexOf(child); - } - insertAfter(exist, add) { - let existIndex = this.index(exist); - let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse(); - existIndex = this.index(exist); - for (let node of nodes) - this.proxyOf.nodes.splice(existIndex + 1, 0, node); - let index4; - for (let id in this.indexes) { - index4 = this.indexes[id]; - if (existIndex < index4) { - this.indexes[id] = index4 + nodes.length; - } - } - this.markDirty(); - return this; - } - insertBefore(exist, add) { - let existIndex = this.index(exist); - let type = existIndex === 0 ? "prepend" : false; - let nodes = this.normalize( - add, - this.proxyOf.nodes[existIndex], - type - ).reverse(); - existIndex = this.index(exist); - for (let node of nodes) - this.proxyOf.nodes.splice(existIndex, 0, node); - let index4; - for (let id in this.indexes) { - index4 = this.indexes[id]; - if (existIndex <= index4) { - this.indexes[id] = index4 + nodes.length; - } - } - this.markDirty(); - return this; - } - normalize(nodes, sample) { - if (typeof nodes === "string") { - nodes = cleanSource(parse3(nodes).nodes); - } else if (typeof nodes === "undefined") { - nodes = []; - } else if (Array.isArray(nodes)) { - nodes = nodes.slice(0); - for (let i of nodes) { - if (i.parent) - i.parent.removeChild(i, "ignore"); - } - } else if (nodes.type === "root" && this.type !== "document") { - nodes = nodes.nodes.slice(0); - for (let i of nodes) { - if (i.parent) - i.parent.removeChild(i, "ignore"); - } - } else if (nodes.type) { - nodes = [nodes]; - } else if (nodes.prop) { - if (typeof nodes.value === "undefined") { - throw new Error("Value field is missed in node creation"); - } else if (typeof nodes.value !== "string") { - nodes.value = String(nodes.value); - } - nodes = [new Declaration2(nodes)]; - } else if (nodes.selector || nodes.selectors) { - nodes = [new Rule2(nodes)]; - } else if (nodes.name) { - nodes = [new AtRule2(nodes)]; - } else if (nodes.text) { - nodes = [new Comment2(nodes)]; - } else { - throw new Error("Unknown node type in node creation"); - } - let processed = nodes.map((i) => { - if (!i[my] || !i.markClean) - _Container.rebuild(i); - i = i.proxyOf; - if (i.parent) - i.parent.removeChild(i); - if (i[isClean]) - markTreeDirty(i); - if (typeof i.raws.before === "undefined") { - if (sample && typeof sample.raws.before !== "undefined") { - i.raws.before = sample.raws.before.replace(/\S/g, ""); - } - } - i.parent = this.proxyOf; - return i; - }); - return processed; - } - prepend(...children2) { - children2 = children2.reverse(); - for (let child of children2) { - let nodes = this.normalize(child, this.first, "prepend").reverse(); - for (let node of nodes) - this.proxyOf.nodes.unshift(node); - for (let id in this.indexes) { - this.indexes[id] = this.indexes[id] + nodes.length; - } - } - this.markDirty(); - return this; - } - push(child) { - child.parent = this; - this.proxyOf.nodes.push(child); - return this; - } - removeAll() { - for (let node of this.proxyOf.nodes) - node.parent = void 0; - this.proxyOf.nodes = []; - this.markDirty(); - return this; - } - removeChild(child) { - child = this.index(child); - this.proxyOf.nodes[child].parent = void 0; - this.proxyOf.nodes.splice(child, 1); - let index4; - for (let id in this.indexes) { - index4 = this.indexes[id]; - if (index4 >= child) { - this.indexes[id] = index4 - 1; - } - } - this.markDirty(); - return this; - } - replaceValues(pattern2, opts, callback) { - if (!callback) { - callback = opts; - opts = {}; - } - this.walkDecls((decl2) => { - if (opts.props && !opts.props.includes(decl2.prop)) - return; - if (opts.fast && !decl2.value.includes(opts.fast)) - return; - decl2.value = decl2.value.replace(pattern2, callback); - }); - this.markDirty(); - return this; - } - some(condition) { - return this.nodes.some(condition); - } - walk(callback) { - return this.each((child, i) => { - let result; - try { - result = callback(child, i); - } catch (e) { - throw child.addToError(e); - } - if (result !== false && child.walk) { - result = child.walk(callback); - } - return result; - }); - } - walkAtRules(name, callback) { - if (!callback) { - callback = name; - return this.walk((child, i) => { - if (child.type === "atrule") { - return callback(child, i); - } - }); - } - if (name instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === "atrule" && name.test(child.name)) { - return callback(child, i); - } - }); - } - return this.walk((child, i) => { - if (child.type === "atrule" && child.name === name) { - return callback(child, i); - } - }); - } - walkComments(callback) { - return this.walk((child, i) => { - if (child.type === "comment") { - return callback(child, i); - } - }); - } - walkDecls(prop, callback) { - if (!callback) { - callback = prop; - return this.walk((child, i) => { - if (child.type === "decl") { - return callback(child, i); - } - }); - } - if (prop instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === "decl" && prop.test(child.prop)) { - return callback(child, i); - } - }); - } - return this.walk((child, i) => { - if (child.type === "decl" && child.prop === prop) { - return callback(child, i); - } - }); - } - walkRules(selector, callback) { - if (!callback) { - callback = selector; - return this.walk((child, i) => { - if (child.type === "rule") { - return callback(child, i); - } - }); - } - if (selector instanceof RegExp) { - return this.walk((child, i) => { - if (child.type === "rule" && selector.test(child.selector)) { - return callback(child, i); - } - }); - } - return this.walk((child, i) => { - if (child.type === "rule" && child.selector === selector) { - return callback(child, i); - } - }); - } - get first() { - if (!this.proxyOf.nodes) - return void 0; - return this.proxyOf.nodes[0]; - } - get last() { - if (!this.proxyOf.nodes) - return void 0; - return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; - } - }; - Container2.registerParse = (dependant) => { - parse3 = dependant; - }; - Container2.registerRule = (dependant) => { - Rule2 = dependant; - }; - Container2.registerAtRule = (dependant) => { - AtRule2 = dependant; - }; - Container2.registerRoot = (dependant) => { - Root2 = dependant; - }; - module.exports = Container2; - Container2.default = Container2; - Container2.rebuild = (node) => { - if (node.type === "atrule") { - Object.setPrototypeOf(node, AtRule2.prototype); - } else if (node.type === "rule") { - Object.setPrototypeOf(node, Rule2.prototype); - } else if (node.type === "decl") { - Object.setPrototypeOf(node, Declaration2.prototype); - } else if (node.type === "comment") { - Object.setPrototypeOf(node, Comment2.prototype); - } else if (node.type === "root") { - Object.setPrototypeOf(node, Root2.prototype); - } - node[my] = true; - if (node.nodes) { - node.nodes.forEach((child) => { - Container2.rebuild(child); - }); - } - }; - } - }); - - // node_modules/postcss/lib/at-rule.js - var require_at_rule = __commonJS({ - "node_modules/postcss/lib/at-rule.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var AtRule2 = class extends Container2 { - constructor(defaults3) { - super(defaults3); - this.type = "atrule"; - } - append(...children2) { - if (!this.proxyOf.nodes) - this.nodes = []; - return super.append(...children2); - } - prepend(...children2) { - if (!this.proxyOf.nodes) - this.nodes = []; - return super.prepend(...children2); - } - }; - module.exports = AtRule2; - AtRule2.default = AtRule2; - Container2.registerAtRule(AtRule2); - } - }); - - // node_modules/postcss/lib/document.js - var require_document = __commonJS({ - "node_modules/postcss/lib/document.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var LazyResult; - var Processor2; - var Document2 = class extends Container2 { - constructor(defaults3) { - super({ type: "document", ...defaults3 }); - if (!this.nodes) { - this.nodes = []; - } - } - toResult(opts = {}) { - let lazy = new LazyResult(new Processor2(), this, opts); - return lazy.stringify(); - } - }; - Document2.registerLazyResult = (dependant) => { - LazyResult = dependant; - }; - Document2.registerProcessor = (dependant) => { - Processor2 = dependant; - }; - module.exports = Document2; - Document2.default = Document2; - } - }); - - // node_modules/nanoid/non-secure/index.cjs - var require_non_secure = __commonJS({ - "node_modules/nanoid/non-secure/index.cjs"(exports, module) { - var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; - var customAlphabet = (alphabet, defaultSize = 21) => { - return (size = defaultSize) => { - let id = ""; - let i = size; - while (i--) { - id += alphabet[Math.random() * alphabet.length | 0]; - } - return id; - }; - }; - var nanoid = (size = 21) => { - let id = ""; - let i = size; - while (i--) { - id += urlAlphabet[Math.random() * 64 | 0]; - } - return id; - }; - module.exports = { nanoid, customAlphabet }; - } - }); - - // (disabled):path - var require_path = __commonJS({ - "(disabled):path"() { - } - }); - - // (disabled):node_modules/source-map-js/source-map.js - var require_source_map = __commonJS({ - "(disabled):node_modules/source-map-js/source-map.js"() { - } - }); - - // (disabled):url - var require_url = __commonJS({ - "(disabled):url"() { - } - }); - - // (disabled):fs - var require_fs = __commonJS({ - "(disabled):fs"() { - } - }); - - // node_modules/postcss/lib/previous-map.js - var require_previous_map = __commonJS({ - "node_modules/postcss/lib/previous-map.js"(exports, module) { - "use strict"; - var { existsSync, readFileSync } = require_fs(); - var { dirname, join: join2 } = require_path(); - var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); - function fromBase64(str) { - if (Buffer) { - return Buffer.from(str, "base64").toString(); - } else { - return window.atob(str); - } - } - var PreviousMap = class { - constructor(css, opts) { - if (opts.map === false) - return; - this.loadAnnotation(css); - this.inline = this.startWith(this.annotation, "data:"); - let prev = opts.map ? opts.map.prev : void 0; - let text2 = this.loadMap(opts.from, prev); - if (!this.mapFile && opts.from) { - this.mapFile = opts.from; - } - if (this.mapFile) - this.root = dirname(this.mapFile); - if (text2) - this.text = text2; - } - consumer() { - if (!this.consumerCache) { - this.consumerCache = new SourceMapConsumer(this.text); - } - return this.consumerCache; - } - decodeInline(text2) { - let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/; - let baseUri = /^data:application\/json;base64,/; - let charsetUri = /^data:application\/json;charset=utf-?8,/; - let uri = /^data:application\/json,/; - let uriMatch = text2.match(charsetUri) || text2.match(uri); - if (uriMatch) { - return decodeURIComponent(text2.substr(uriMatch[0].length)); - } - let baseUriMatch = text2.match(baseCharsetUri) || text2.match(baseUri); - if (baseUriMatch) { - return fromBase64(text2.substr(baseUriMatch[0].length)); - } - let encoding = text2.match(/data:application\/json;([^,]+),/)[1]; - throw new Error("Unsupported source map encoding " + encoding); - } - getAnnotationURL(sourceMapString) { - return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, "").trim(); - } - isMap(map) { - if (typeof map !== "object") - return false; - return typeof map.mappings === "string" || typeof map._mappings === "string" || Array.isArray(map.sections); - } - loadAnnotation(css) { - let comments = css.match(/\/\*\s*# sourceMappingURL=/g); - if (!comments) - return; - let start = css.lastIndexOf(comments.pop()); - let end = css.indexOf("*/", start); - if (start > -1 && end > -1) { - this.annotation = this.getAnnotationURL(css.substring(start, end)); - } - } - loadFile(path) { - this.root = dirname(path); - if (existsSync(path)) { - this.mapFile = path; - return readFileSync(path, "utf-8").toString().trim(); - } - } - loadMap(file15, prev) { - if (prev === false) - return false; - if (prev) { - if (typeof prev === "string") { - return prev; - } else if (typeof prev === "function") { - let prevPath = prev(file15); - if (prevPath) { - let map = this.loadFile(prevPath); - if (!map) { - throw new Error( - "Unable to load previous source map: " + prevPath.toString() - ); - } - return map; - } - } else if (prev instanceof SourceMapConsumer) { - return SourceMapGenerator.fromSourceMap(prev).toString(); - } else if (prev instanceof SourceMapGenerator) { - return prev.toString(); - } else if (this.isMap(prev)) { - return JSON.stringify(prev); - } else { - throw new Error( - "Unsupported previous source map format: " + prev.toString() - ); - } - } else if (this.inline) { - return this.decodeInline(this.annotation); - } else if (this.annotation) { - let map = this.annotation; - if (file15) - map = join2(dirname(file15), map); - return this.loadFile(map); - } - } - startWith(string, start) { - if (!string) - return false; - return string.substr(0, start.length) === start; - } - withContent() { - return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0); - } - }; - module.exports = PreviousMap; - PreviousMap.default = PreviousMap; - } - }); - - // node_modules/postcss/lib/input.js - var require_input = __commonJS({ - "node_modules/postcss/lib/input.js"(exports, module) { - "use strict"; - var { nanoid } = require_non_secure(); - var { isAbsolute, resolve } = require_path(); - var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); - var { fileURLToPath, pathToFileURL } = require_url(); - var CssSyntaxError2 = require_css_syntax_error(); - var PreviousMap = require_previous_map(); - var terminalHighlight = require_terminal_highlight(); - var fromOffsetCache = Symbol("fromOffsetCache"); - var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); - var pathAvailable = Boolean(resolve && isAbsolute); - var Input2 = class { - constructor(css, opts = {}) { - if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) { - throw new Error(`PostCSS received ${css} instead of CSS string`); - } - this.css = css.toString(); - if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") { - this.hasBOM = true; - this.css = this.css.slice(1); - } else { - this.hasBOM = false; - } - if (opts.from) { - if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) { - this.file = opts.from; - } else { - this.file = resolve(opts.from); - } - } - if (pathAvailable && sourceMapAvailable) { - let map = new PreviousMap(this.css, opts); - if (map.text) { - this.map = map; - let file15 = map.consumer().file; - if (!this.file && file15) - this.file = this.mapResolve(file15); - } - } - if (!this.file) { - this.id = ""; - } - if (this.map) - this.map.file = this.from; - } - error(message, line, column, opts = {}) { - let endColumn, endLine, result; - if (line && typeof line === "object") { - let start = line; - let end = column; - if (typeof start.offset === "number") { - let pos = this.fromOffset(start.offset); - line = pos.line; - column = pos.col; - } else { - line = start.line; - column = start.column; - } - if (typeof end.offset === "number") { - let pos = this.fromOffset(end.offset); - endLine = pos.line; - endColumn = pos.col; - } else { - endLine = end.line; - endColumn = end.column; - } - } else if (!column) { - let pos = this.fromOffset(line); - line = pos.line; - column = pos.col; - } - let origin = this.origin(line, column, endLine, endColumn); - if (origin) { - result = new CssSyntaxError2( - message, - origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line }, - origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine }, - origin.source, - origin.file, - opts.plugin - ); - } else { - result = new CssSyntaxError2( - message, - endLine === void 0 ? line : { column, line }, - endLine === void 0 ? column : { column: endColumn, line: endLine }, - this.css, - this.file, - opts.plugin - ); - } - result.input = { column, endColumn, endLine, line, source: this.css }; - if (this.file) { - if (pathToFileURL) { - result.input.url = pathToFileURL(this.file).toString(); - } - result.input.file = this.file; - } - return result; - } - fromOffset(offset) { - let lastLine, lineToIndex; - if (!this[fromOffsetCache]) { - let lines = this.css.split("\n"); - lineToIndex = new Array(lines.length); - let prevIndex = 0; - for (let i = 0, l = lines.length; i < l; i++) { - lineToIndex[i] = prevIndex; - prevIndex += lines[i].length + 1; - } - this[fromOffsetCache] = lineToIndex; - } else { - lineToIndex = this[fromOffsetCache]; - } - lastLine = lineToIndex[lineToIndex.length - 1]; - let min = 0; - if (offset >= lastLine) { - min = lineToIndex.length - 1; - } else { - let max2 = lineToIndex.length - 2; - let mid; - while (min < max2) { - mid = min + (max2 - min >> 1); - if (offset < lineToIndex[mid]) { - max2 = mid - 1; - } else if (offset >= lineToIndex[mid + 1]) { - min = mid + 1; - } else { - min = mid; - break; - } - } - } - return { - col: offset - lineToIndex[min] + 1, - line: min + 1 - }; - } - mapResolve(file15) { - if (/^\w+:\/\//.test(file15)) { - return file15; - } - return resolve(this.map.consumer().sourceRoot || this.map.root || ".", file15); - } - origin(line, column, endLine, endColumn) { - if (!this.map) - return false; - let consumer = this.map.consumer(); - let from = consumer.originalPositionFor({ column, line }); - if (!from.source) - return false; - let to; - if (typeof endLine === "number") { - to = consumer.originalPositionFor({ column: endColumn, line: endLine }); - } - let fromUrl; - if (isAbsolute(from.source)) { - fromUrl = pathToFileURL(from.source); - } else { - fromUrl = new URL( - from.source, - this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) - ); - } - let result = { - column: from.column, - endColumn: to && to.column, - endLine: to && to.line, - line: from.line, - url: fromUrl.toString() - }; - if (fromUrl.protocol === "file:") { - if (fileURLToPath) { - result.file = fileURLToPath(fromUrl); - } else { - throw new Error(`file: protocol is not available in this PostCSS build`); - } - } - let source = consumer.sourceContentFor(from.source); - if (source) - result.source = source; - return result; - } - toJSON() { - let json = {}; - for (let name of ["hasBOM", "css", "file", "id"]) { - if (this[name] != null) { - json[name] = this[name]; - } - } - if (this.map) { - json.map = { ...this.map }; - if (json.map.consumerCache) { - json.map.consumerCache = void 0; - } - } - return json; - } - get from() { - return this.file || this.id; - } - }; - module.exports = Input2; - Input2.default = Input2; - if (terminalHighlight && terminalHighlight.registerInput) { - terminalHighlight.registerInput(Input2); - } - } - }); - - // node_modules/postcss/lib/root.js - var require_root = __commonJS({ - "node_modules/postcss/lib/root.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var LazyResult; - var Processor2; - var Root2 = class extends Container2 { - constructor(defaults3) { - super(defaults3); - this.type = "root"; - if (!this.nodes) - this.nodes = []; - } - normalize(child, sample, type) { - let nodes = super.normalize(child); - if (sample) { - if (type === "prepend") { - if (this.nodes.length > 1) { - sample.raws.before = this.nodes[1].raws.before; - } else { - delete sample.raws.before; - } - } else if (this.first !== sample) { - for (let node of nodes) { - node.raws.before = sample.raws.before; - } - } - } - return nodes; - } - removeChild(child, ignore) { - let index4 = this.index(child); - if (!ignore && index4 === 0 && this.nodes.length > 1) { - this.nodes[1].raws.before = this.nodes[index4].raws.before; - } - return super.removeChild(child); - } - toResult(opts = {}) { - let lazy = new LazyResult(new Processor2(), this, opts); - return lazy.stringify(); - } - }; - Root2.registerLazyResult = (dependant) => { - LazyResult = dependant; - }; - Root2.registerProcessor = (dependant) => { - Processor2 = dependant; - }; - module.exports = Root2; - Root2.default = Root2; - Container2.registerRoot(Root2); - } - }); - - // node_modules/postcss/lib/list.js - var require_list = __commonJS({ - "node_modules/postcss/lib/list.js"(exports, module) { - "use strict"; - var list3 = { - comma(string) { - return list3.split(string, [","], true); - }, - space(string) { - let spaces = [" ", "\n", " "]; - return list3.split(string, spaces); - }, - split(string, separators, last) { - let array = []; - let current = ""; - let split = false; - let func = 0; - let inQuote = false; - let prevQuote = ""; - let escape2 = false; - for (let letter of string) { - if (escape2) { - escape2 = false; - } else if (letter === "\\") { - escape2 = true; - } else if (inQuote) { - if (letter === prevQuote) { - inQuote = false; - } - } else if (letter === '"' || letter === "'") { - inQuote = true; - prevQuote = letter; - } else if (letter === "(") { - func += 1; - } else if (letter === ")") { - if (func > 0) - func -= 1; - } else if (func === 0) { - if (separators.includes(letter)) - split = true; - } - if (split) { - if (current !== "") - array.push(current.trim()); - current = ""; - split = false; - } else { - current += letter; - } - } - if (last || current !== "") - array.push(current.trim()); - return array; - } - }; - module.exports = list3; - list3.default = list3; - } - }); - - // node_modules/postcss/lib/rule.js - var require_rule = __commonJS({ - "node_modules/postcss/lib/rule.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var list3 = require_list(); - var Rule2 = class extends Container2 { - constructor(defaults3) { - super(defaults3); - this.type = "rule"; - if (!this.nodes) - this.nodes = []; - } - get selectors() { - return list3.comma(this.selector); - } - set selectors(values) { - let match = this.selector ? this.selector.match(/,\s*/) : null; - let sep = match ? match[0] : "," + this.raw("between", "beforeOpen"); - this.selector = values.join(sep); - } - }; - module.exports = Rule2; - Rule2.default = Rule2; - Container2.registerRule(Rule2); - } - }); - - // node_modules/postcss/lib/fromJSON.js - var require_fromJSON = __commonJS({ - "node_modules/postcss/lib/fromJSON.js"(exports, module) { - "use strict"; - var AtRule2 = require_at_rule(); - var Comment2 = require_comment(); - var Declaration2 = require_declaration(); - var Input2 = require_input(); - var PreviousMap = require_previous_map(); - var Root2 = require_root(); - var Rule2 = require_rule(); - function fromJSON2(json, inputs) { - if (Array.isArray(json)) - return json.map((n) => fromJSON2(n)); - let { inputs: ownInputs, ...defaults3 } = json; - if (ownInputs) { - inputs = []; - for (let input of ownInputs) { - let inputHydrated = { ...input, __proto__: Input2.prototype }; - if (inputHydrated.map) { - inputHydrated.map = { - ...inputHydrated.map, - __proto__: PreviousMap.prototype - }; - } - inputs.push(inputHydrated); - } - } - if (defaults3.nodes) { - defaults3.nodes = json.nodes.map((n) => fromJSON2(n, inputs)); - } - if (defaults3.source) { - let { inputId, ...source } = defaults3.source; - defaults3.source = source; - if (inputId != null) { - defaults3.source.input = inputs[inputId]; - } - } - if (defaults3.type === "root") { - return new Root2(defaults3); - } else if (defaults3.type === "decl") { - return new Declaration2(defaults3); - } else if (defaults3.type === "rule") { - return new Rule2(defaults3); - } else if (defaults3.type === "comment") { - return new Comment2(defaults3); - } else if (defaults3.type === "atrule") { - return new AtRule2(defaults3); - } else { - throw new Error("Unknown node type: " + json.type); - } - } - module.exports = fromJSON2; - fromJSON2.default = fromJSON2; - } - }); - - // node_modules/postcss/lib/map-generator.js - var require_map_generator = __commonJS({ - "node_modules/postcss/lib/map-generator.js"(exports, module) { - "use strict"; - var { dirname, relative, resolve, sep } = require_path(); - var { SourceMapConsumer, SourceMapGenerator } = require_source_map(); - var { pathToFileURL } = require_url(); - var Input2 = require_input(); - var sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); - var pathAvailable = Boolean(dirname && resolve && relative && sep); - var MapGenerator = class { - constructor(stringify2, root2, opts, cssString) { - this.stringify = stringify2; - this.mapOpts = opts.map || {}; - this.root = root2; - this.opts = opts; - this.css = cssString; - this.originalCSS = cssString; - this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute; - this.memoizedFileURLs = /* @__PURE__ */ new Map(); - this.memoizedPaths = /* @__PURE__ */ new Map(); - this.memoizedURLs = /* @__PURE__ */ new Map(); - } - addAnnotation() { - let content; - if (this.isInline()) { - content = "data:application/json;base64," + this.toBase64(this.map.toString()); - } else if (typeof this.mapOpts.annotation === "string") { - content = this.mapOpts.annotation; - } else if (typeof this.mapOpts.annotation === "function") { - content = this.mapOpts.annotation(this.opts.to, this.root); - } else { - content = this.outputFile() + ".map"; - } - let eol = "\n"; - if (this.css.includes("\r\n")) - eol = "\r\n"; - this.css += eol + "/*# sourceMappingURL=" + content + " */"; - } - applyPrevMaps() { - for (let prev of this.previous()) { - let from = this.toUrl(this.path(prev.file)); - let root2 = prev.root || dirname(prev.file); - let map; - if (this.mapOpts.sourcesContent === false) { - map = new SourceMapConsumer(prev.text); - if (map.sourcesContent) { - map.sourcesContent = null; - } - } else { - map = prev.consumer(); - } - this.map.applySourceMap(map, from, this.toUrl(this.path(root2))); - } - } - clearAnnotation() { - if (this.mapOpts.annotation === false) - return; - if (this.root) { - let node; - for (let i = this.root.nodes.length - 1; i >= 0; i--) { - node = this.root.nodes[i]; - if (node.type !== "comment") - continue; - if (node.text.startsWith("# sourceMappingURL=")) { - this.root.removeChild(i); - } - } - } else if (this.css) { - this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, ""); - } - } - generate() { - this.clearAnnotation(); - if (pathAvailable && sourceMapAvailable && this.isMap()) { - return this.generateMap(); - } else { - let result = ""; - this.stringify(this.root, (i) => { - result += i; - }); - return [result]; - } - } - generateMap() { - if (this.root) { - this.generateString(); - } else if (this.previous().length === 1) { - let prev = this.previous()[0].consumer(); - prev.file = this.outputFile(); - this.map = SourceMapGenerator.fromSourceMap(prev, { - ignoreInvalidMapping: true - }); - } else { - this.map = new SourceMapGenerator({ - file: this.outputFile(), - ignoreInvalidMapping: true - }); - this.map.addMapping({ - generated: { column: 0, line: 1 }, - original: { column: 0, line: 1 }, - source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "" - }); - } - if (this.isSourcesContent()) - this.setSourcesContent(); - if (this.root && this.previous().length > 0) - this.applyPrevMaps(); - if (this.isAnnotation()) - this.addAnnotation(); - if (this.isInline()) { - return [this.css]; - } else { - return [this.css, this.map]; - } - } - generateString() { - this.css = ""; - this.map = new SourceMapGenerator({ - file: this.outputFile(), - ignoreInvalidMapping: true - }); - let line = 1; - let column = 1; - let noSource = ""; - let mapping = { - generated: { column: 0, line: 0 }, - original: { column: 0, line: 0 }, - source: "" - }; - let last, lines; - this.stringify(this.root, (str, node, type) => { - this.css += str; - if (node && type !== "end") { - mapping.generated.line = line; - mapping.generated.column = column - 1; - if (node.source && node.source.start) { - mapping.source = this.sourcePath(node); - mapping.original.line = node.source.start.line; - mapping.original.column = node.source.start.column - 1; - this.map.addMapping(mapping); - } else { - mapping.source = noSource; - mapping.original.line = 1; - mapping.original.column = 0; - this.map.addMapping(mapping); - } - } - lines = str.match(/\n/g); - if (lines) { - line += lines.length; - last = str.lastIndexOf("\n"); - column = str.length - last; - } else { - column += str.length; - } - if (node && type !== "start") { - let p = node.parent || { raws: {} }; - let childless = node.type === "decl" || node.type === "atrule" && !node.nodes; - if (!childless || node !== p.last || p.raws.semicolon) { - if (node.source && node.source.end) { - mapping.source = this.sourcePath(node); - mapping.original.line = node.source.end.line; - mapping.original.column = node.source.end.column - 1; - mapping.generated.line = line; - mapping.generated.column = column - 2; - this.map.addMapping(mapping); - } else { - mapping.source = noSource; - mapping.original.line = 1; - mapping.original.column = 0; - mapping.generated.line = line; - mapping.generated.column = column - 1; - this.map.addMapping(mapping); - } - } - } - }); - } - isAnnotation() { - if (this.isInline()) { - return true; - } - if (typeof this.mapOpts.annotation !== "undefined") { - return this.mapOpts.annotation; - } - if (this.previous().length) { - return this.previous().some((i) => i.annotation); - } - return true; - } - isInline() { - if (typeof this.mapOpts.inline !== "undefined") { - return this.mapOpts.inline; - } - let annotation = this.mapOpts.annotation; - if (typeof annotation !== "undefined" && annotation !== true) { - return false; - } - if (this.previous().length) { - return this.previous().some((i) => i.inline); - } - return true; - } - isMap() { - if (typeof this.opts.map !== "undefined") { - return !!this.opts.map; - } - return this.previous().length > 0; - } - isSourcesContent() { - if (typeof this.mapOpts.sourcesContent !== "undefined") { - return this.mapOpts.sourcesContent; - } - if (this.previous().length) { - return this.previous().some((i) => i.withContent()); - } - return true; - } - outputFile() { - if (this.opts.to) { - return this.path(this.opts.to); - } else if (this.opts.from) { - return this.path(this.opts.from); - } else { - return "to.css"; - } - } - path(file15) { - if (this.mapOpts.absolute) - return file15; - if (file15.charCodeAt(0) === 60) - return file15; - if (/^\w+:\/\//.test(file15)) - return file15; - let cached = this.memoizedPaths.get(file15); - if (cached) - return cached; - let from = this.opts.to ? dirname(this.opts.to) : "."; - if (typeof this.mapOpts.annotation === "string") { - from = dirname(resolve(from, this.mapOpts.annotation)); - } - let path = relative(from, file15); - this.memoizedPaths.set(file15, path); - return path; - } - previous() { - if (!this.previousMaps) { - this.previousMaps = []; - if (this.root) { - this.root.walk((node) => { - if (node.source && node.source.input.map) { - let map = node.source.input.map; - if (!this.previousMaps.includes(map)) { - this.previousMaps.push(map); - } - } - }); - } else { - let input = new Input2(this.originalCSS, this.opts); - if (input.map) - this.previousMaps.push(input.map); - } - } - return this.previousMaps; - } - setSourcesContent() { - let already = {}; - if (this.root) { - this.root.walk((node) => { - if (node.source) { - let from = node.source.input.from; - if (from && !already[from]) { - already[from] = true; - let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from)); - this.map.setSourceContent(fromUrl, node.source.input.css); - } - } - }); - } else if (this.css) { - let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : ""; - this.map.setSourceContent(from, this.css); - } - } - sourcePath(node) { - if (this.mapOpts.from) { - return this.toUrl(this.mapOpts.from); - } else if (this.usesFileUrls) { - return this.toFileUrl(node.source.input.from); - } else { - return this.toUrl(this.path(node.source.input.from)); - } - } - toBase64(str) { - if (Buffer) { - return Buffer.from(str).toString("base64"); - } else { - return window.btoa(unescape(encodeURIComponent(str))); - } - } - toFileUrl(path) { - let cached = this.memoizedFileURLs.get(path); - if (cached) - return cached; - if (pathToFileURL) { - let fileURL = pathToFileURL(path).toString(); - this.memoizedFileURLs.set(path, fileURL); - return fileURL; - } else { - throw new Error( - "`map.absolute` option is not available in this PostCSS build" - ); - } - } - toUrl(path) { - let cached = this.memoizedURLs.get(path); - if (cached) - return cached; - if (sep === "\\") { - path = path.replace(/\\/g, "/"); - } - let url2 = encodeURI(path).replace(/[#?]/g, encodeURIComponent); - this.memoizedURLs.set(path, url2); - return url2; - } - }; - module.exports = MapGenerator; - } - }); - - // node_modules/postcss/lib/tokenize.js - var require_tokenize = __commonJS({ - "node_modules/postcss/lib/tokenize.js"(exports, module) { - "use strict"; - var SINGLE_QUOTE = "'".charCodeAt(0); - var DOUBLE_QUOTE = '"'.charCodeAt(0); - var BACKSLASH = "\\".charCodeAt(0); - var SLASH = "/".charCodeAt(0); - var NEWLINE = "\n".charCodeAt(0); - var SPACE3 = " ".charCodeAt(0); - var FEED = "\f".charCodeAt(0); - var TAB = " ".charCodeAt(0); - var CR = "\r".charCodeAt(0); - var OPEN_SQUARE = "[".charCodeAt(0); - var CLOSE_SQUARE = "]".charCodeAt(0); - var OPEN_PARENTHESES = "(".charCodeAt(0); - var CLOSE_PARENTHESES = ")".charCodeAt(0); - var OPEN_CURLY = "{".charCodeAt(0); - var CLOSE_CURLY = "}".charCodeAt(0); - var SEMICOLON = ";".charCodeAt(0); - var ASTERISK = "*".charCodeAt(0); - var COLON = ":".charCodeAt(0); - var AT = "@".charCodeAt(0); - var RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g; - var RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g; - var RE_BAD_BRACKET = /.[\r\n"'(/\\]/; - var RE_HEX_ESCAPE = /[\da-f]/i; - module.exports = function tokenizer(input, options = {}) { - let css = input.css.valueOf(); - let ignore = options.ignoreErrors; - let code, content, escape2, next, quote; - let currentToken, escaped, escapePos, n, prev; - let length2 = css.length; - let pos = 0; - let buffer = []; - let returned = []; - function position2() { - return pos; - } - function unclosed(what) { - throw input.error("Unclosed " + what, pos); - } - function endOfFile() { - return returned.length === 0 && pos >= length2; - } - function nextToken(opts) { - if (returned.length) - return returned.pop(); - if (pos >= length2) - return; - let ignoreUnclosed = opts ? opts.ignoreUnclosed : false; - code = css.charCodeAt(pos); - switch (code) { - case NEWLINE: - case SPACE3: - case TAB: - case CR: - case FEED: { - next = pos; - do { - next += 1; - code = css.charCodeAt(next); - } while (code === SPACE3 || code === NEWLINE || code === TAB || code === CR || code === FEED); - currentToken = ["space", css.slice(pos, next)]; - pos = next - 1; - break; - } - case OPEN_SQUARE: - case CLOSE_SQUARE: - case OPEN_CURLY: - case CLOSE_CURLY: - case COLON: - case SEMICOLON: - case CLOSE_PARENTHESES: { - let controlChar = String.fromCharCode(code); - currentToken = [controlChar, controlChar, pos]; - break; - } - case OPEN_PARENTHESES: { - prev = buffer.length ? buffer.pop()[1] : ""; - n = css.charCodeAt(pos + 1); - if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE3 && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) { - next = pos; - do { - escaped = false; - next = css.indexOf(")", next + 1); - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos; - break; - } else { - unclosed("bracket"); - } - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped); - currentToken = ["brackets", css.slice(pos, next + 1), pos, next]; - pos = next; - } else { - next = css.indexOf(")", pos + 1); - content = css.slice(pos, next + 1); - if (next === -1 || RE_BAD_BRACKET.test(content)) { - currentToken = ["(", "(", pos]; - } else { - currentToken = ["brackets", content, pos, next]; - pos = next; - } - } - break; - } - case SINGLE_QUOTE: - case DOUBLE_QUOTE: { - quote = code === SINGLE_QUOTE ? "'" : '"'; - next = pos; - do { - escaped = false; - next = css.indexOf(quote, next + 1); - if (next === -1) { - if (ignore || ignoreUnclosed) { - next = pos + 1; - break; - } else { - unclosed("string"); - } - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === BACKSLASH) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped); - currentToken = ["string", css.slice(pos, next + 1), pos, next]; - pos = next; - break; - } - case AT: { - RE_AT_END.lastIndex = pos + 1; - RE_AT_END.test(css); - if (RE_AT_END.lastIndex === 0) { - next = css.length - 1; - } else { - next = RE_AT_END.lastIndex - 2; - } - currentToken = ["at-word", css.slice(pos, next + 1), pos, next]; - pos = next; - break; - } - case BACKSLASH: { - next = pos; - escape2 = true; - while (css.charCodeAt(next + 1) === BACKSLASH) { - next += 1; - escape2 = !escape2; - } - code = css.charCodeAt(next + 1); - if (escape2 && code !== SLASH && code !== SPACE3 && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) { - next += 1; - if (RE_HEX_ESCAPE.test(css.charAt(next))) { - while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { - next += 1; - } - if (css.charCodeAt(next + 1) === SPACE3) { - next += 1; - } - } - } - currentToken = ["word", css.slice(pos, next + 1), pos, next]; - pos = next; - break; - } - default: { - if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { - next = css.indexOf("*/", pos + 2) + 1; - if (next === 0) { - if (ignore || ignoreUnclosed) { - next = css.length; - } else { - unclosed("comment"); - } - } - currentToken = ["comment", css.slice(pos, next + 1), pos, next]; - pos = next; - } else { - RE_WORD_END.lastIndex = pos + 1; - RE_WORD_END.test(css); - if (RE_WORD_END.lastIndex === 0) { - next = css.length - 1; - } else { - next = RE_WORD_END.lastIndex - 2; - } - currentToken = ["word", css.slice(pos, next + 1), pos, next]; - buffer.push(currentToken); - pos = next; - } - break; - } - } - pos++; - return currentToken; - } - function back(token) { - returned.push(token); - } - return { - back, - endOfFile, - nextToken, - position: position2 - }; - }; - } - }); - - // node_modules/postcss/lib/parser.js - var require_parser = __commonJS({ - "node_modules/postcss/lib/parser.js"(exports, module) { - "use strict"; - var AtRule2 = require_at_rule(); - var Comment2 = require_comment(); - var Declaration2 = require_declaration(); - var Root2 = require_root(); - var Rule2 = require_rule(); - var tokenizer = require_tokenize(); - var SAFE_COMMENT_NEIGHBOR = { - empty: true, - space: true - }; - function findLastWithPosition(tokens) { - for (let i = tokens.length - 1; i >= 0; i--) { - let token = tokens[i]; - let pos = token[3] || token[2]; - if (pos) - return pos; - } - } - var Parser = class { - constructor(input) { - this.input = input; - this.root = new Root2(); - this.current = this.root; - this.spaces = ""; - this.semicolon = false; - this.createTokenizer(); - this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }; - } - atrule(token) { - let node = new AtRule2(); - node.name = token[1].slice(1); - if (node.name === "") { - this.unnamedAtrule(node, token); - } - this.init(node, token[2]); - let type; - let prev; - let shift; - let last = false; - let open = false; - let params = []; - let brackets = []; - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken(); - type = token[0]; - if (type === "(" || type === "[") { - brackets.push(type === "(" ? ")" : "]"); - } else if (type === "{" && brackets.length > 0) { - brackets.push("}"); - } else if (type === brackets[brackets.length - 1]) { - brackets.pop(); - } - if (brackets.length === 0) { - if (type === ";") { - node.source.end = this.getPosition(token[2]); - node.source.end.offset++; - this.semicolon = true; - break; - } else if (type === "{") { - open = true; - break; - } else if (type === "}") { - if (params.length > 0) { - shift = params.length - 1; - prev = params[shift]; - while (prev && prev[0] === "space") { - prev = params[--shift]; - } - if (prev) { - node.source.end = this.getPosition(prev[3] || prev[2]); - node.source.end.offset++; - } - } - this.end(token); - break; - } else { - params.push(token); - } - } else { - params.push(token); - } - if (this.tokenizer.endOfFile()) { - last = true; - break; - } - } - node.raws.between = this.spacesAndCommentsFromEnd(params); - if (params.length) { - node.raws.afterName = this.spacesAndCommentsFromStart(params); - this.raw(node, "params", params); - if (last) { - token = params[params.length - 1]; - node.source.end = this.getPosition(token[3] || token[2]); - node.source.end.offset++; - this.spaces = node.raws.between; - node.raws.between = ""; - } - } else { - node.raws.afterName = ""; - node.params = ""; - } - if (open) { - node.nodes = []; - this.current = node; - } - } - checkMissedSemicolon(tokens) { - let colon = this.colon(tokens); - if (colon === false) - return; - let founded = 0; - let token; - for (let j = colon - 1; j >= 0; j--) { - token = tokens[j]; - if (token[0] !== "space") { - founded += 1; - if (founded === 2) - break; - } - } - throw this.input.error( - "Missed semicolon", - token[0] === "word" ? token[3] + 1 : token[2] - ); - } - colon(tokens) { - let brackets = 0; - let prev, token, type; - for (let [i, element2] of tokens.entries()) { - token = element2; - type = token[0]; - if (type === "(") { - brackets += 1; - } - if (type === ")") { - brackets -= 1; - } - if (brackets === 0 && type === ":") { - if (!prev) { - this.doubleColon(token); - } else if (prev[0] === "word" && prev[1] === "progid") { - continue; - } else { - return i; - } - } - prev = token; - } - return false; - } - comment(token) { - let node = new Comment2(); - this.init(node, token[2]); - node.source.end = this.getPosition(token[3] || token[2]); - node.source.end.offset++; - let text2 = token[1].slice(2, -2); - if (/^\s*$/.test(text2)) { - node.text = ""; - node.raws.left = text2; - node.raws.right = ""; - } else { - let match = text2.match(/^(\s*)([^]*\S)(\s*)$/); - node.text = match[2]; - node.raws.left = match[1]; - node.raws.right = match[3]; - } - } - createTokenizer() { - this.tokenizer = tokenizer(this.input); - } - decl(tokens, customProperty) { - let node = new Declaration2(); - this.init(node, tokens[0][2]); - let last = tokens[tokens.length - 1]; - if (last[0] === ";") { - this.semicolon = true; - tokens.pop(); - } - node.source.end = this.getPosition( - last[3] || last[2] || findLastWithPosition(tokens) - ); - node.source.end.offset++; - while (tokens[0][0] !== "word") { - if (tokens.length === 1) - this.unknownWord(tokens); - node.raws.before += tokens.shift()[1]; - } - node.source.start = this.getPosition(tokens[0][2]); - node.prop = ""; - while (tokens.length) { - let type = tokens[0][0]; - if (type === ":" || type === "space" || type === "comment") { - break; - } - node.prop += tokens.shift()[1]; - } - node.raws.between = ""; - let token; - while (tokens.length) { - token = tokens.shift(); - if (token[0] === ":") { - node.raws.between += token[1]; - break; - } else { - if (token[0] === "word" && /\w/.test(token[1])) { - this.unknownWord([token]); - } - node.raws.between += token[1]; - } - } - if (node.prop[0] === "_" || node.prop[0] === "*") { - node.raws.before += node.prop[0]; - node.prop = node.prop.slice(1); - } - let firstSpaces = []; - let next; - while (tokens.length) { - next = tokens[0][0]; - if (next !== "space" && next !== "comment") - break; - firstSpaces.push(tokens.shift()); - } - this.precheckMissedSemicolon(tokens); - for (let i = tokens.length - 1; i >= 0; i--) { - token = tokens[i]; - if (token[1].toLowerCase() === "!important") { - node.important = true; - let string = this.stringFrom(tokens, i); - string = this.spacesFromEnd(tokens) + string; - if (string !== " !important") - node.raws.important = string; - break; - } else if (token[1].toLowerCase() === "important") { - let cache2 = tokens.slice(0); - let str = ""; - for (let j = i; j > 0; j--) { - let type = cache2[j][0]; - if (str.trim().startsWith("!") && type !== "space") { - break; - } - str = cache2.pop()[1] + str; - } - if (str.trim().startsWith("!")) { - node.important = true; - node.raws.important = str; - tokens = cache2; - } - } - if (token[0] !== "space" && token[0] !== "comment") { - break; - } - } - let hasWord = tokens.some((i) => i[0] !== "space" && i[0] !== "comment"); - if (hasWord) { - node.raws.between += firstSpaces.map((i) => i[1]).join(""); - firstSpaces = []; - } - this.raw(node, "value", firstSpaces.concat(tokens), customProperty); - if (node.value.includes(":") && !customProperty) { - this.checkMissedSemicolon(tokens); - } - } - doubleColon(token) { - throw this.input.error( - "Double colon", - { offset: token[2] }, - { offset: token[2] + token[1].length } - ); - } - emptyRule(token) { - let node = new Rule2(); - this.init(node, token[2]); - node.selector = ""; - node.raws.between = ""; - this.current = node; - } - end(token) { - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon; - } - this.semicolon = false; - this.current.raws.after = (this.current.raws.after || "") + this.spaces; - this.spaces = ""; - if (this.current.parent) { - this.current.source.end = this.getPosition(token[2]); - this.current.source.end.offset++; - this.current = this.current.parent; - } else { - this.unexpectedClose(token); - } - } - endFile() { - if (this.current.parent) - this.unclosedBlock(); - if (this.current.nodes && this.current.nodes.length) { - this.current.raws.semicolon = this.semicolon; - } - this.current.raws.after = (this.current.raws.after || "") + this.spaces; - this.root.source.end = this.getPosition(this.tokenizer.position()); - } - freeSemicolon(token) { - this.spaces += token[1]; - if (this.current.nodes) { - let prev = this.current.nodes[this.current.nodes.length - 1]; - if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) { - prev.raws.ownSemicolon = this.spaces; - this.spaces = ""; - } - } - } - // Helpers - getPosition(offset) { - let pos = this.input.fromOffset(offset); - return { - column: pos.col, - line: pos.line, - offset - }; - } - init(node, offset) { - this.current.push(node); - node.source = { - input: this.input, - start: this.getPosition(offset) - }; - node.raws.before = this.spaces; - this.spaces = ""; - if (node.type !== "comment") - this.semicolon = false; - } - other(start) { - let end = false; - let type = null; - let colon = false; - let bracket = null; - let brackets = []; - let customProperty = start[1].startsWith("--"); - let tokens = []; - let token = start; - while (token) { - type = token[0]; - tokens.push(token); - if (type === "(" || type === "[") { - if (!bracket) - bracket = token; - brackets.push(type === "(" ? ")" : "]"); - } else if (customProperty && colon && type === "{") { - if (!bracket) - bracket = token; - brackets.push("}"); - } else if (brackets.length === 0) { - if (type === ";") { - if (colon) { - this.decl(tokens, customProperty); - return; - } else { - break; - } - } else if (type === "{") { - this.rule(tokens); - return; - } else if (type === "}") { - this.tokenizer.back(tokens.pop()); - end = true; - break; - } else if (type === ":") { - colon = true; - } - } else if (type === brackets[brackets.length - 1]) { - brackets.pop(); - if (brackets.length === 0) - bracket = null; - } - token = this.tokenizer.nextToken(); - } - if (this.tokenizer.endOfFile()) - end = true; - if (brackets.length > 0) - this.unclosedBracket(bracket); - if (end && colon) { - if (!customProperty) { - while (tokens.length) { - token = tokens[tokens.length - 1][0]; - if (token !== "space" && token !== "comment") - break; - this.tokenizer.back(tokens.pop()); - } - } - this.decl(tokens, customProperty); - } else { - this.unknownWord(tokens); - } - } - parse() { - let token; - while (!this.tokenizer.endOfFile()) { - token = this.tokenizer.nextToken(); - switch (token[0]) { - case "space": - this.spaces += token[1]; - break; - case ";": - this.freeSemicolon(token); - break; - case "}": - this.end(token); - break; - case "comment": - this.comment(token); - break; - case "at-word": - this.atrule(token); - break; - case "{": - this.emptyRule(token); - break; - default: - this.other(token); - break; - } - } - this.endFile(); - } - precheckMissedSemicolon() { - } - raw(node, prop, tokens, customProperty) { - let token, type; - let length2 = tokens.length; - let value2 = ""; - let clean = true; - let next, prev; - for (let i = 0; i < length2; i += 1) { - token = tokens[i]; - type = token[0]; - if (type === "space" && i === length2 - 1 && !customProperty) { - clean = false; - } else if (type === "comment") { - prev = tokens[i - 1] ? tokens[i - 1][0] : "empty"; - next = tokens[i + 1] ? tokens[i + 1][0] : "empty"; - if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { - if (value2.slice(-1) === ",") { - clean = false; - } else { - value2 += token[1]; - } - } else { - clean = false; - } - } else { - value2 += token[1]; - } - } - if (!clean) { - let raw = tokens.reduce((all, i) => all + i[1], ""); - node.raws[prop] = { raw, value: value2 }; - } - node[prop] = value2; - } - rule(tokens) { - tokens.pop(); - let node = new Rule2(); - this.init(node, tokens[0][2]); - node.raws.between = this.spacesAndCommentsFromEnd(tokens); - this.raw(node, "selector", tokens); - this.current = node; - } - spacesAndCommentsFromEnd(tokens) { - let lastTokenType; - let spaces = ""; - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0]; - if (lastTokenType !== "space" && lastTokenType !== "comment") - break; - spaces = tokens.pop()[1] + spaces; - } - return spaces; - } - // Errors - spacesAndCommentsFromStart(tokens) { - let next; - let spaces = ""; - while (tokens.length) { - next = tokens[0][0]; - if (next !== "space" && next !== "comment") - break; - spaces += tokens.shift()[1]; - } - return spaces; - } - spacesFromEnd(tokens) { - let lastTokenType; - let spaces = ""; - while (tokens.length) { - lastTokenType = tokens[tokens.length - 1][0]; - if (lastTokenType !== "space") - break; - spaces = tokens.pop()[1] + spaces; - } - return spaces; - } - stringFrom(tokens, from) { - let result = ""; - for (let i = from; i < tokens.length; i++) { - result += tokens[i][1]; - } - tokens.splice(from, tokens.length - from); - return result; - } - unclosedBlock() { - let pos = this.current.source.start; - throw this.input.error("Unclosed block", pos.line, pos.column); - } - unclosedBracket(bracket) { - throw this.input.error( - "Unclosed bracket", - { offset: bracket[2] }, - { offset: bracket[2] + 1 } - ); - } - unexpectedClose(token) { - throw this.input.error( - "Unexpected }", - { offset: token[2] }, - { offset: token[2] + 1 } - ); - } - unknownWord(tokens) { - throw this.input.error( - "Unknown word", - { offset: tokens[0][2] }, - { offset: tokens[0][2] + tokens[0][1].length } - ); - } - unnamedAtrule(node, token) { - throw this.input.error( - "At-rule without name", - { offset: token[2] }, - { offset: token[2] + token[1].length } - ); - } - }; - module.exports = Parser; - } - }); - - // node_modules/postcss/lib/parse.js - var require_parse = __commonJS({ - "node_modules/postcss/lib/parse.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var Input2 = require_input(); - var Parser = require_parser(); - function parse3(css, opts) { - let input = new Input2(css, opts); - let parser5 = new Parser(input); - try { - parser5.parse(); - } catch (e) { - if (true) { - if (e.name === "CssSyntaxError" && opts && opts.from) { - if (/\.scss$/i.test(opts.from)) { - e.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser"; - } else if (/\.sass/i.test(opts.from)) { - e.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser"; - } else if (/\.less$/i.test(opts.from)) { - e.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser"; - } - } - } - throw e; - } - return parser5.root; - } - module.exports = parse3; - parse3.default = parse3; - Container2.registerParse(parse3); - } - }); - - // node_modules/postcss/lib/warning.js - var require_warning = __commonJS({ - "node_modules/postcss/lib/warning.js"(exports, module) { - "use strict"; - var Warning2 = class { - constructor(text2, opts = {}) { - this.type = "warning"; - this.text = text2; - if (opts.node && opts.node.source) { - let range = opts.node.rangeBy(opts); - this.line = range.start.line; - this.column = range.start.column; - this.endLine = range.end.line; - this.endColumn = range.end.column; - } - for (let opt in opts) - this[opt] = opts[opt]; - } - toString() { - if (this.node) { - return this.node.error(this.text, { - index: this.index, - plugin: this.plugin, - word: this.word - }).message; - } - if (this.plugin) { - return this.plugin + ": " + this.text; - } - return this.text; - } - }; - module.exports = Warning2; - Warning2.default = Warning2; - } - }); - - // node_modules/postcss/lib/result.js - var require_result = __commonJS({ - "node_modules/postcss/lib/result.js"(exports, module) { - "use strict"; - var Warning2 = require_warning(); - var Result2 = class { - constructor(processor, root2, opts) { - this.processor = processor; - this.messages = []; - this.root = root2; - this.opts = opts; - this.css = void 0; - this.map = void 0; - } - toString() { - return this.css; - } - warn(text2, opts = {}) { - if (!opts.plugin) { - if (this.lastPlugin && this.lastPlugin.postcssPlugin) { - opts.plugin = this.lastPlugin.postcssPlugin; - } - } - let warning = new Warning2(text2, opts); - this.messages.push(warning); - return warning; - } - warnings() { - return this.messages.filter((i) => i.type === "warning"); - } - get content() { - return this.css; - } - }; - module.exports = Result2; - Result2.default = Result2; - } - }); - - // node_modules/postcss/lib/warn-once.js - var require_warn_once = __commonJS({ - "node_modules/postcss/lib/warn-once.js"(exports, module) { - "use strict"; - var printed = {}; - module.exports = function warnOnce(message) { - if (printed[message]) - return; - printed[message] = true; - if (typeof console !== "undefined" && console.warn) { - console.warn(message); - } - }; - } - }); - - // node_modules/postcss/lib/lazy-result.js - var require_lazy_result = __commonJS({ - "node_modules/postcss/lib/lazy-result.js"(exports, module) { - "use strict"; - var Container2 = require_container(); - var Document2 = require_document(); - var MapGenerator = require_map_generator(); - var parse3 = require_parse(); - var Result2 = require_result(); - var Root2 = require_root(); - var stringify2 = require_stringify(); - var { isClean, my } = require_symbols(); - var warnOnce = require_warn_once(); - var TYPE_TO_CLASS_NAME = { - atrule: "AtRule", - comment: "Comment", - decl: "Declaration", - document: "Document", - root: "Root", - rule: "Rule" - }; - var PLUGIN_PROPS = { - AtRule: true, - AtRuleExit: true, - Comment: true, - CommentExit: true, - Declaration: true, - DeclarationExit: true, - Document: true, - DocumentExit: true, - Once: true, - OnceExit: true, - postcssPlugin: true, - prepare: true, - Root: true, - RootExit: true, - Rule: true, - RuleExit: true - }; - var NOT_VISITORS = { - Once: true, - postcssPlugin: true, - prepare: true - }; - var CHILDREN = 0; - function isPromise(obj) { - return typeof obj === "object" && typeof obj.then === "function"; - } - function getEvents(node) { - let key = false; - let type = TYPE_TO_CLASS_NAME[node.type]; - if (node.type === "decl") { - key = node.prop.toLowerCase(); - } else if (node.type === "atrule") { - key = node.name.toLowerCase(); - } - if (key && node.append) { - return [ - type, - type + "-" + key, - CHILDREN, - type + "Exit", - type + "Exit-" + key - ]; - } else if (key) { - return [type, type + "-" + key, type + "Exit", type + "Exit-" + key]; - } else if (node.append) { - return [type, CHILDREN, type + "Exit"]; - } else { - return [type, type + "Exit"]; - } - } - function toStack(node) { - let events; - if (node.type === "document") { - events = ["Document", CHILDREN, "DocumentExit"]; - } else if (node.type === "root") { - events = ["Root", CHILDREN, "RootExit"]; - } else { - events = getEvents(node); - } - return { - eventIndex: 0, - events, - iterator: 0, - node, - visitorIndex: 0, - visitors: [] - }; - } - function cleanMarks(node) { - node[isClean] = false; - if (node.nodes) - node.nodes.forEach((i) => cleanMarks(i)); - return node; - } - var postcss2 = {}; - var LazyResult = class _LazyResult { - constructor(processor, css, opts) { - this.stringified = false; - this.processed = false; - let root2; - if (typeof css === "object" && css !== null && (css.type === "root" || css.type === "document")) { - root2 = cleanMarks(css); - } else if (css instanceof _LazyResult || css instanceof Result2) { - root2 = cleanMarks(css.root); - if (css.map) { - if (typeof opts.map === "undefined") - opts.map = {}; - if (!opts.map.inline) - opts.map.inline = false; - opts.map.prev = css.map; - } - } else { - let parser5 = parse3; - if (opts.syntax) - parser5 = opts.syntax.parse; - if (opts.parser) - parser5 = opts.parser; - if (parser5.parse) - parser5 = parser5.parse; - try { - root2 = parser5(css, opts); - } catch (error) { - this.processed = true; - this.error = error; - } - if (root2 && !root2[my]) { - Container2.rebuild(root2); - } - } - this.result = new Result2(processor, root2, opts); - this.helpers = { ...postcss2, postcss: postcss2, result: this.result }; - this.plugins = this.processor.plugins.map((plugin2) => { - if (typeof plugin2 === "object" && plugin2.prepare) { - return { ...plugin2, ...plugin2.prepare(this.result) }; - } else { - return plugin2; - } - }); - } - async() { - if (this.error) - return Promise.reject(this.error); - if (this.processed) - return Promise.resolve(this.result); - if (!this.processing) { - this.processing = this.runAsync(); - } - return this.processing; - } - catch(onRejected) { - return this.async().catch(onRejected); - } - finally(onFinally) { - return this.async().then(onFinally, onFinally); - } - getAsyncError() { - throw new Error("Use process(css).then(cb) to work with async plugins"); - } - handleError(error, node) { - let plugin2 = this.result.lastPlugin; - try { - if (node) - node.addToError(error); - this.error = error; - if (error.name === "CssSyntaxError" && !error.plugin) { - error.plugin = plugin2.postcssPlugin; - error.setMessage(); - } else if (plugin2.postcssVersion) { - if (true) { - let pluginName = plugin2.postcssPlugin; - let pluginVer = plugin2.postcssVersion; - let runtimeVer = this.result.processor.version; - let a = pluginVer.split("."); - let b = runtimeVer.split("."); - if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) { - console.error( - "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below." - ); - } - } - } - } catch (err) { - if (console && console.error) - console.error(err); - } - return error; - } - prepareVisitors() { - this.listeners = {}; - let add = (plugin2, type, cb) => { - if (!this.listeners[type]) - this.listeners[type] = []; - this.listeners[type].push([plugin2, cb]); - }; - for (let plugin2 of this.plugins) { - if (typeof plugin2 === "object") { - for (let event in plugin2) { - if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { - throw new Error( - `Unknown event ${event} in ${plugin2.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).` - ); - } - if (!NOT_VISITORS[event]) { - if (typeof plugin2[event] === "object") { - for (let filter in plugin2[event]) { - if (filter === "*") { - add(plugin2, event, plugin2[event][filter]); - } else { - add( - plugin2, - event + "-" + filter.toLowerCase(), - plugin2[event][filter] - ); - } - } - } else if (typeof plugin2[event] === "function") { - add(plugin2, event, plugin2[event]); - } - } - } - } - } - this.hasListener = Object.keys(this.listeners).length > 0; - } - async runAsync() { - this.plugin = 0; - for (let i = 0; i < this.plugins.length; i++) { - let plugin2 = this.plugins[i]; - let promise2 = this.runOnRoot(plugin2); - if (isPromise(promise2)) { - try { - await promise2; - } catch (error) { - throw this.handleError(error); - } - } - } - this.prepareVisitors(); - if (this.hasListener) { - let root2 = this.result.root; - while (!root2[isClean]) { - root2[isClean] = true; - let stack = [toStack(root2)]; - while (stack.length > 0) { - let promise2 = this.visitTick(stack); - if (isPromise(promise2)) { - try { - await promise2; - } catch (e) { - let node = stack[stack.length - 1].node; - throw this.handleError(e, node); - } - } - } - } - if (this.listeners.OnceExit) { - for (let [plugin2, visitor] of this.listeners.OnceExit) { - this.result.lastPlugin = plugin2; - try { - if (root2.type === "document") { - let roots = root2.nodes.map( - (subRoot) => visitor(subRoot, this.helpers) - ); - await Promise.all(roots); - } else { - await visitor(root2, this.helpers); - } - } catch (e) { - throw this.handleError(e); - } - } - } - } - this.processed = true; - return this.stringify(); - } - runOnRoot(plugin2) { - this.result.lastPlugin = plugin2; - try { - if (typeof plugin2 === "object" && plugin2.Once) { - if (this.result.root.type === "document") { - let roots = this.result.root.nodes.map( - (root2) => plugin2.Once(root2, this.helpers) - ); - if (isPromise(roots[0])) { - return Promise.all(roots); - } - return roots; - } - return plugin2.Once(this.result.root, this.helpers); - } else if (typeof plugin2 === "function") { - return plugin2(this.result.root, this.result); - } - } catch (error) { - throw this.handleError(error); - } - } - stringify() { - if (this.error) - throw this.error; - if (this.stringified) - return this.result; - this.stringified = true; - this.sync(); - let opts = this.result.opts; - let str = stringify2; - if (opts.syntax) - str = opts.syntax.stringify; - if (opts.stringifier) - str = opts.stringifier; - if (str.stringify) - str = str.stringify; - let map = new MapGenerator(str, this.result.root, this.result.opts); - let data = map.generate(); - this.result.css = data[0]; - this.result.map = data[1]; - return this.result; - } - sync() { - if (this.error) - throw this.error; - if (this.processed) - return this.result; - this.processed = true; - if (this.processing) { - throw this.getAsyncError(); - } - for (let plugin2 of this.plugins) { - let promise2 = this.runOnRoot(plugin2); - if (isPromise(promise2)) { - throw this.getAsyncError(); - } - } - this.prepareVisitors(); - if (this.hasListener) { - let root2 = this.result.root; - while (!root2[isClean]) { - root2[isClean] = true; - this.walkSync(root2); - } - if (this.listeners.OnceExit) { - if (root2.type === "document") { - for (let subRoot of root2.nodes) { - this.visitSync(this.listeners.OnceExit, subRoot); - } - } else { - this.visitSync(this.listeners.OnceExit, root2); - } - } - } - return this.result; - } - then(onFulfilled, onRejected) { - if (true) { - if (!("from" in this.opts)) { - warnOnce( - "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." - ); - } - } - return this.async().then(onFulfilled, onRejected); - } - toString() { - return this.css; - } - visitSync(visitors, node) { - for (let [plugin2, visitor] of visitors) { - this.result.lastPlugin = plugin2; - let promise2; - try { - promise2 = visitor(node, this.helpers); - } catch (e) { - throw this.handleError(e, node.proxyOf); - } - if (node.type !== "root" && node.type !== "document" && !node.parent) { - return true; - } - if (isPromise(promise2)) { - throw this.getAsyncError(); - } - } - } - visitTick(stack) { - let visit = stack[stack.length - 1]; - let { node, visitors } = visit; - if (node.type !== "root" && node.type !== "document" && !node.parent) { - stack.pop(); - return; - } - if (visitors.length > 0 && visit.visitorIndex < visitors.length) { - let [plugin2, visitor] = visitors[visit.visitorIndex]; - visit.visitorIndex += 1; - if (visit.visitorIndex === visitors.length) { - visit.visitors = []; - visit.visitorIndex = 0; - } - this.result.lastPlugin = plugin2; - try { - return visitor(node.toProxy(), this.helpers); - } catch (e) { - throw this.handleError(e, node); - } - } - if (visit.iterator !== 0) { - let iterator = visit.iterator; - let child; - while (child = node.nodes[node.indexes[iterator]]) { - node.indexes[iterator] += 1; - if (!child[isClean]) { - child[isClean] = true; - stack.push(toStack(child)); - return; - } - } - visit.iterator = 0; - delete node.indexes[iterator]; - } - let events = visit.events; - while (visit.eventIndex < events.length) { - let event = events[visit.eventIndex]; - visit.eventIndex += 1; - if (event === CHILDREN) { - if (node.nodes && node.nodes.length) { - node[isClean] = true; - visit.iterator = node.getIterator(); - } - return; - } else if (this.listeners[event]) { - visit.visitors = this.listeners[event]; - return; - } - } - stack.pop(); - } - walkSync(node) { - node[isClean] = true; - let events = getEvents(node); - for (let event of events) { - if (event === CHILDREN) { - if (node.nodes) { - node.each((child) => { - if (!child[isClean]) - this.walkSync(child); - }); - } - } else { - let visitors = this.listeners[event]; - if (visitors) { - if (this.visitSync(visitors, node.toProxy())) - return; - } - } - } - } - warnings() { - return this.sync().warnings(); - } - get content() { - return this.stringify().content; - } - get css() { - return this.stringify().css; - } - get map() { - return this.stringify().map; - } - get messages() { - return this.sync().messages; - } - get opts() { - return this.result.opts; - } - get processor() { - return this.result.processor; - } - get root() { - return this.sync().root; - } - get [Symbol.toStringTag]() { - return "LazyResult"; - } - }; - LazyResult.registerPostcss = (dependant) => { - postcss2 = dependant; - }; - module.exports = LazyResult; - LazyResult.default = LazyResult; - Root2.registerLazyResult(LazyResult); - Document2.registerLazyResult(LazyResult); - } - }); - - // node_modules/postcss/lib/no-work-result.js - var require_no_work_result = __commonJS({ - "node_modules/postcss/lib/no-work-result.js"(exports, module) { - "use strict"; - var MapGenerator = require_map_generator(); - var parse3 = require_parse(); - var Result2 = require_result(); - var stringify2 = require_stringify(); - var warnOnce = require_warn_once(); - var NoWorkResult = class { - constructor(processor, css, opts) { - css = css.toString(); - this.stringified = false; - this._processor = processor; - this._css = css; - this._opts = opts; - this._map = void 0; - let root2; - let str = stringify2; - this.result = new Result2(this._processor, root2, this._opts); - this.result.css = css; - let self = this; - Object.defineProperty(this.result, "root", { - get() { - return self.root; - } - }); - let map = new MapGenerator(str, root2, this._opts, css); - if (map.isMap()) { - let [generatedCSS, generatedMap] = map.generate(); - if (generatedCSS) { - this.result.css = generatedCSS; - } - if (generatedMap) { - this.result.map = generatedMap; - } - } else { - map.clearAnnotation(); - this.result.css = map.css; - } - } - async() { - if (this.error) - return Promise.reject(this.error); - return Promise.resolve(this.result); - } - catch(onRejected) { - return this.async().catch(onRejected); - } - finally(onFinally) { - return this.async().then(onFinally, onFinally); - } - sync() { - if (this.error) - throw this.error; - return this.result; - } - then(onFulfilled, onRejected) { - if (true) { - if (!("from" in this._opts)) { - warnOnce( - "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." - ); - } - } - return this.async().then(onFulfilled, onRejected); - } - toString() { - return this._css; - } - warnings() { - return []; - } - get content() { - return this.result.css; - } - get css() { - return this.result.css; - } - get map() { - return this.result.map; - } - get messages() { - return []; - } - get opts() { - return this.result.opts; - } - get processor() { - return this.result.processor; - } - get root() { - if (this._root) { - return this._root; - } - let root2; - let parser5 = parse3; - try { - root2 = parser5(this._css, this._opts); - } catch (error) { - this.error = error; - } - if (this.error) { - throw this.error; - } else { - this._root = root2; - return root2; - } - } - get [Symbol.toStringTag]() { - return "NoWorkResult"; - } - }; - module.exports = NoWorkResult; - NoWorkResult.default = NoWorkResult; - } - }); - - // node_modules/postcss/lib/processor.js - var require_processor = __commonJS({ - "node_modules/postcss/lib/processor.js"(exports, module) { - "use strict"; - var Document2 = require_document(); - var LazyResult = require_lazy_result(); - var NoWorkResult = require_no_work_result(); - var Root2 = require_root(); - var Processor2 = class { - constructor(plugins = []) { - this.version = "8.4.44"; - this.plugins = this.normalize(plugins); - } - normalize(plugins) { - let normalized = []; - for (let i of plugins) { - if (i.postcss === true) { - i = i(); - } else if (i.postcss) { - i = i.postcss; - } - if (typeof i === "object" && Array.isArray(i.plugins)) { - normalized = normalized.concat(i.plugins); - } else if (typeof i === "object" && i.postcssPlugin) { - normalized.push(i); - } else if (typeof i === "function") { - normalized.push(i); - } else if (typeof i === "object" && (i.parse || i.stringify)) { - if (true) { - throw new Error( - "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation." - ); - } - } else { - throw new Error(i + " is not a PostCSS plugin"); - } - } - return normalized; - } - process(css, opts = {}) { - if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) { - return new NoWorkResult(this, css, opts); - } else { - return new LazyResult(this, css, opts); - } - } - use(plugin2) { - this.plugins = this.plugins.concat(this.normalize([plugin2])); - return this; - } - }; - module.exports = Processor2; - Processor2.default = Processor2; - Root2.registerProcessor(Processor2); - Document2.registerProcessor(Processor2); - } - }); - - // node_modules/postcss/lib/postcss.js - var require_postcss = __commonJS({ - "node_modules/postcss/lib/postcss.js"(exports, module) { - "use strict"; - var AtRule2 = require_at_rule(); - var Comment2 = require_comment(); - var Container2 = require_container(); - var CssSyntaxError2 = require_css_syntax_error(); - var Declaration2 = require_declaration(); - var Document2 = require_document(); - var fromJSON2 = require_fromJSON(); - var Input2 = require_input(); - var LazyResult = require_lazy_result(); - var list3 = require_list(); - var Node2 = require_node(); - var parse3 = require_parse(); - var Processor2 = require_processor(); - var Result2 = require_result(); - var Root2 = require_root(); - var Rule2 = require_rule(); - var stringify2 = require_stringify(); - var Warning2 = require_warning(); - function postcss2(...plugins) { - if (plugins.length === 1 && Array.isArray(plugins[0])) { - plugins = plugins[0]; - } - return new Processor2(plugins); - } - postcss2.plugin = function plugin2(name, initializer) { - let warningPrinted = false; - function creator(...args) { - if (console && console.warn && !warningPrinted) { - warningPrinted = true; - console.warn( - name + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration" - ); - if (process.env.LANG && process.env.LANG.startsWith("cn")) { - console.warn( - name + ": \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226" - ); - } - } - let transformer = initializer(...args); - transformer.postcssPlugin = name; - transformer.postcssVersion = new Processor2().version; - return transformer; - } - let cache2; - Object.defineProperty(creator, "postcss", { - get() { - if (!cache2) - cache2 = creator(); - return cache2; - } - }); - creator.process = function(css, processOpts, pluginOpts) { - return postcss2([creator(pluginOpts)]).process(css, processOpts); - }; - return creator; - }; - postcss2.stringify = stringify2; - postcss2.parse = parse3; - postcss2.fromJSON = fromJSON2; - postcss2.list = list3; - postcss2.comment = (defaults3) => new Comment2(defaults3); - postcss2.atRule = (defaults3) => new AtRule2(defaults3); - postcss2.decl = (defaults3) => new Declaration2(defaults3); - postcss2.rule = (defaults3) => new Rule2(defaults3); - postcss2.root = (defaults3) => new Root2(defaults3); - postcss2.document = (defaults3) => new Document2(defaults3); - postcss2.CssSyntaxError = CssSyntaxError2; - postcss2.Declaration = Declaration2; - postcss2.Container = Container2; - postcss2.Processor = Processor2; - postcss2.Document = Document2; - postcss2.Comment = Comment2; - postcss2.Warning = Warning2; - postcss2.AtRule = AtRule2; - postcss2.Result = Result2; - postcss2.Input = Input2; - postcss2.Rule = Rule2; - postcss2.Root = Root2; - postcss2.Node = Node2; - LazyResult.registerPostcss(postcss2); - module.exports = postcss2; - postcss2.default = postcss2; - } - }); - - // node_modules/postcss-selector-parser/dist/util/unesc.js - var require_unesc = __commonJS({ - "node_modules/postcss-selector-parser/dist/util/unesc.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = unesc; - function gobbleHex(str) { - var lower = str.toLowerCase(); - var hex = ""; - var spaceTerminated = false; - for (var i = 0; i < 6 && lower[i] !== void 0; i++) { - var code = lower.charCodeAt(i); - var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57; - spaceTerminated = code === 32; - if (!valid) { - break; - } - hex += lower[i]; - } - if (hex.length === 0) { - return void 0; - } - var codePoint = parseInt(hex, 16); - var isSurrogate = codePoint >= 55296 && codePoint <= 57343; - if (isSurrogate || codePoint === 0 || codePoint > 1114111) { - return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)]; - } - return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)]; - } - var CONTAINS_ESCAPE = /\\/; - function unesc(str) { - var needToProcess = CONTAINS_ESCAPE.test(str); - if (!needToProcess) { - return str; - } - var ret = ""; - for (var i = 0; i < str.length; i++) { - if (str[i] === "\\") { - var gobbled = gobbleHex(str.slice(i + 1, i + 7)); - if (gobbled !== void 0) { - ret += gobbled[0]; - i += gobbled[1]; - continue; - } - if (str[i + 1] === "\\") { - ret += "\\"; - i++; - continue; - } - if (str.length === i + 1) { - ret += str[i]; - } - continue; - } - ret += str[i]; - } - return ret; - } - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/util/getProp.js - var require_getProp = __commonJS({ - "node_modules/postcss-selector-parser/dist/util/getProp.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = getProp; - function getProp(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - while (props.length > 0) { - var prop = props.shift(); - if (!obj[prop]) { - return void 0; - } - obj = obj[prop]; - } - return obj; - } - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/util/ensureObject.js - var require_ensureObject = __commonJS({ - "node_modules/postcss-selector-parser/dist/util/ensureObject.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = ensureObject; - function ensureObject(obj) { - for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - props[_key - 1] = arguments[_key]; - } - while (props.length > 0) { - var prop = props.shift(); - if (!obj[prop]) { - obj[prop] = {}; - } - obj = obj[prop]; - } - } - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/util/stripComments.js - var require_stripComments = __commonJS({ - "node_modules/postcss-selector-parser/dist/util/stripComments.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = stripComments; - function stripComments(str) { - var s = ""; - var commentStart = str.indexOf("/*"); - var lastEnd = 0; - while (commentStart >= 0) { - s = s + str.slice(lastEnd, commentStart); - var commentEnd = str.indexOf("*/", commentStart + 2); - if (commentEnd < 0) { - return s; - } - lastEnd = commentEnd + 2; - commentStart = str.indexOf("/*", lastEnd); - } - s = s + str.slice(lastEnd); - return s; - } - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/util/index.js - var require_util = __commonJS({ - "node_modules/postcss-selector-parser/dist/util/index.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0; - var _unesc = _interopRequireDefault(require_unesc()); - exports.unesc = _unesc["default"]; - var _getProp = _interopRequireDefault(require_getProp()); - exports.getProp = _getProp["default"]; - var _ensureObject = _interopRequireDefault(require_ensureObject()); - exports.ensureObject = _ensureObject["default"]; - var _stripComments = _interopRequireDefault(require_stripComments()); - exports.stripComments = _stripComments["default"]; - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/node.js - var require_node2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/node.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _util = require_util(); - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - var cloneNode = function cloneNode2(obj, parent) { - if (typeof obj !== "object" || obj === null) { - return obj; - } - var cloned = new obj.constructor(); - for (var i in obj) { - if (!obj.hasOwnProperty(i)) { - continue; - } - var value2 = obj[i]; - var type = typeof value2; - if (i === "parent" && type === "object") { - if (parent) { - cloned[i] = parent; - } - } else if (value2 instanceof Array) { - cloned[i] = value2.map(function(j) { - return cloneNode2(j, cloned); - }); - } else { - cloned[i] = cloneNode2(value2, cloned); - } - } - return cloned; - }; - var Node2 = /* @__PURE__ */ function() { - function Node3(opts) { - if (opts === void 0) { - opts = {}; - } - Object.assign(this, opts); - this.spaces = this.spaces || {}; - this.spaces.before = this.spaces.before || ""; - this.spaces.after = this.spaces.after || ""; - } - var _proto = Node3.prototype; - _proto.remove = function remove() { - if (this.parent) { - this.parent.removeChild(this); - } - this.parent = void 0; - return this; - }; - _proto.replaceWith = function replaceWith() { - if (this.parent) { - for (var index4 in arguments) { - this.parent.insertBefore(this, arguments[index4]); - } - this.remove(); - } - return this; - }; - _proto.next = function next() { - return this.parent.at(this.parent.index(this) + 1); - }; - _proto.prev = function prev() { - return this.parent.at(this.parent.index(this) - 1); - }; - _proto.clone = function clone(overrides) { - if (overrides === void 0) { - overrides = {}; - } - var cloned = cloneNode(this); - for (var name in overrides) { - cloned[name] = overrides[name]; - } - return cloned; - }; - _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value2, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - var originalValue = this[name]; - var originalEscaped = this.raws[name]; - this[name] = originalValue + value2; - if (originalEscaped || valueEscaped !== value2) { - this.raws[name] = (originalEscaped || originalValue) + valueEscaped; - } else { - delete this.raws[name]; - } - }; - _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value2, valueEscaped) { - if (!this.raws) { - this.raws = {}; - } - this[name] = value2; - this.raws[name] = valueEscaped; - }; - _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value2) { - this[name] = value2; - if (this.raws) { - delete this.raws[name]; - } - }; - _proto.isAtPosition = function isAtPosition(line, column) { - if (this.source && this.source.start && this.source.end) { - if (this.source.start.line > line) { - return false; - } - if (this.source.end.line < line) { - return false; - } - if (this.source.start.line === line && this.source.start.column > column) { - return false; - } - if (this.source.end.line === line && this.source.end.column < column) { - return false; - } - return true; - } - return void 0; - }; - _proto.stringifyProperty = function stringifyProperty(name) { - return this.raws && this.raws[name] || this[name]; - }; - _proto.valueToString = function valueToString() { - return String(this.stringifyProperty("value")); - }; - _proto.toString = function toString() { - return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join(""); - }; - _createClass(Node3, [{ - key: "rawSpaceBefore", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before; - if (rawSpace === void 0) { - rawSpace = this.spaces && this.spaces.before; - } - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.before = raw; - } - }, { - key: "rawSpaceAfter", - get: function get() { - var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after; - if (rawSpace === void 0) { - rawSpace = this.spaces.after; - } - return rawSpace || ""; - }, - set: function set(raw) { - (0, _util.ensureObject)(this, "raws", "spaces"); - this.raws.spaces.after = raw; - } - }]); - return Node3; - }(); - exports["default"] = Node2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/types.js - var require_types = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/types.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0; - var TAG = "tag"; - exports.TAG = TAG; - var STRING = "string"; - exports.STRING = STRING; - var SELECTOR = "selector"; - exports.SELECTOR = SELECTOR; - var ROOT = "root"; - exports.ROOT = ROOT; - var PSEUDO = "pseudo"; - exports.PSEUDO = PSEUDO; - var NESTING = "nesting"; - exports.NESTING = NESTING; - var ID = "id"; - exports.ID = ID; - var COMMENT = "comment"; - exports.COMMENT = COMMENT; - var COMBINATOR = "combinator"; - exports.COMBINATOR = COMBINATOR; - var CLASS = "class"; - exports.CLASS = CLASS; - var ATTRIBUTE = "attribute"; - exports.ATTRIBUTE = ATTRIBUTE; - var UNIVERSAL = "universal"; - exports.UNIVERSAL = UNIVERSAL; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/container.js - var require_container2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/container.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var types2 = _interopRequireWildcard(require_types()); - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") - return null; - var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); - var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) { - return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { "default": obj }; - } - var cache2 = _getRequireWildcardCache(nodeInterop); - if (cache2 && cache2.has(obj)) { - return cache2.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj["default"] = obj; - if (cache2) { - cache2.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) - return (it = it.call(o)).next.bind(it); - if (Array.isArray(o) || (it = _unsupportedIterableToArray3(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) - o = it; - var i = 0; - return function() { - if (i >= o.length) - return { done: true }; - return { done: false, value: o[i++] }; - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray3(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray3(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray3(o, minLen); - } - function _arrayLikeToArray3(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Container2 = /* @__PURE__ */ function(_Node) { - _inheritsLoose(Container3, _Node); - function Container3(opts) { - var _this; - _this = _Node.call(this, opts) || this; - if (!_this.nodes) { - _this.nodes = []; - } - return _this; - } - var _proto = Container3.prototype; - _proto.append = function append2(selector) { - selector.parent = this; - this.nodes.push(selector); - return this; - }; - _proto.prepend = function prepend(selector) { - selector.parent = this; - this.nodes.unshift(selector); - return this; - }; - _proto.at = function at(index4) { - return this.nodes[index4]; - }; - _proto.index = function index4(child) { - if (typeof child === "number") { - return child; - } - return this.nodes.indexOf(child); - }; - _proto.removeChild = function removeChild(child) { - child = this.index(child); - this.at(child).parent = void 0; - this.nodes.splice(child, 1); - var index4; - for (var id in this.indexes) { - index4 = this.indexes[id]; - if (index4 >= child) { - this.indexes[id] = index4 - 1; - } - } - return this; - }; - _proto.removeAll = function removeAll() { - for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done; ) { - var node = _step.value; - node.parent = void 0; - } - this.nodes = []; - return this; - }; - _proto.empty = function empty2() { - return this.removeAll(); - }; - _proto.insertAfter = function insertAfter(oldNode, newNode) { - newNode.parent = this; - var oldIndex = this.index(oldNode); - this.nodes.splice(oldIndex + 1, 0, newNode); - newNode.parent = this; - var index4; - for (var id in this.indexes) { - index4 = this.indexes[id]; - if (oldIndex <= index4) { - this.indexes[id] = index4 + 1; - } - } - return this; - }; - _proto.insertBefore = function insertBefore(oldNode, newNode) { - newNode.parent = this; - var oldIndex = this.index(oldNode); - this.nodes.splice(oldIndex, 0, newNode); - newNode.parent = this; - var index4; - for (var id in this.indexes) { - index4 = this.indexes[id]; - if (index4 <= oldIndex) { - this.indexes[id] = index4 + 1; - } - } - return this; - }; - _proto._findChildAtPosition = function _findChildAtPosition(line, col) { - var found = void 0; - this.each(function(node) { - if (node.atPosition) { - var foundChild = node.atPosition(line, col); - if (foundChild) { - found = foundChild; - return false; - } - } else if (node.isAtPosition(line, col)) { - found = node; - return false; - } - }); - return found; - }; - _proto.atPosition = function atPosition(line, col) { - if (this.isAtPosition(line, col)) { - return this._findChildAtPosition(line, col) || this; - } else { - return void 0; - } - }; - _proto._inferEndPosition = function _inferEndPosition() { - if (this.last && this.last.source && this.last.source.end) { - this.source = this.source || {}; - this.source.end = this.source.end || {}; - Object.assign(this.source.end, this.last.source.end); - } - }; - _proto.each = function each(callback) { - if (!this.lastEach) { - this.lastEach = 0; - } - if (!this.indexes) { - this.indexes = {}; - } - this.lastEach++; - var id = this.lastEach; - this.indexes[id] = 0; - if (!this.length) { - return void 0; - } - var index4, result; - while (this.indexes[id] < this.length) { - index4 = this.indexes[id]; - result = callback(this.at(index4), index4); - if (result === false) { - break; - } - this.indexes[id] += 1; - } - delete this.indexes[id]; - if (result === false) { - return false; - } - }; - _proto.walk = function walk(callback) { - return this.each(function(node, i) { - var result = callback(node, i); - if (result !== false && node.length) { - result = node.walk(callback); - } - if (result === false) { - return false; - } - }); - }; - _proto.walkAttributes = function walkAttributes(callback) { - var _this2 = this; - return this.walk(function(selector) { - if (selector.type === types2.ATTRIBUTE) { - return callback.call(_this2, selector); - } - }); - }; - _proto.walkClasses = function walkClasses(callback) { - var _this3 = this; - return this.walk(function(selector) { - if (selector.type === types2.CLASS) { - return callback.call(_this3, selector); - } - }); - }; - _proto.walkCombinators = function walkCombinators(callback) { - var _this4 = this; - return this.walk(function(selector) { - if (selector.type === types2.COMBINATOR) { - return callback.call(_this4, selector); - } - }); - }; - _proto.walkComments = function walkComments(callback) { - var _this5 = this; - return this.walk(function(selector) { - if (selector.type === types2.COMMENT) { - return callback.call(_this5, selector); - } - }); - }; - _proto.walkIds = function walkIds(callback) { - var _this6 = this; - return this.walk(function(selector) { - if (selector.type === types2.ID) { - return callback.call(_this6, selector); - } - }); - }; - _proto.walkNesting = function walkNesting(callback) { - var _this7 = this; - return this.walk(function(selector) { - if (selector.type === types2.NESTING) { - return callback.call(_this7, selector); - } - }); - }; - _proto.walkPseudos = function walkPseudos(callback) { - var _this8 = this; - return this.walk(function(selector) { - if (selector.type === types2.PSEUDO) { - return callback.call(_this8, selector); - } - }); - }; - _proto.walkTags = function walkTags(callback) { - var _this9 = this; - return this.walk(function(selector) { - if (selector.type === types2.TAG) { - return callback.call(_this9, selector); - } - }); - }; - _proto.walkUniversals = function walkUniversals(callback) { - var _this10 = this; - return this.walk(function(selector) { - if (selector.type === types2.UNIVERSAL) { - return callback.call(_this10, selector); - } - }); - }; - _proto.split = function split(callback) { - var _this11 = this; - var current = []; - return this.reduce(function(memo, node, index4) { - var split2 = callback.call(_this11, node); - current.push(node); - if (split2) { - memo.push(current); - current = []; - } else if (index4 === _this11.length - 1) { - memo.push(current); - } - return memo; - }, []); - }; - _proto.map = function map(callback) { - return this.nodes.map(callback); - }; - _proto.reduce = function reduce(callback, memo) { - return this.nodes.reduce(callback, memo); - }; - _proto.every = function every(callback) { - return this.nodes.every(callback); - }; - _proto.some = function some(callback) { - return this.nodes.some(callback); - }; - _proto.filter = function filter(callback) { - return this.nodes.filter(callback); - }; - _proto.sort = function sort(callback) { - return this.nodes.sort(callback); - }; - _proto.toString = function toString() { - return this.map(String).join(""); - }; - _createClass(Container3, [{ - key: "first", - get: function get() { - return this.at(0); - } - }, { - key: "last", - get: function get() { - return this.at(this.length - 1); - } - }, { - key: "length", - get: function get() { - return this.nodes.length; - } - }]); - return Container3; - }(_node["default"]); - exports["default"] = Container2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/root.js - var require_root2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/root.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _container = _interopRequireDefault(require_container2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Root2 = /* @__PURE__ */ function(_Container) { - _inheritsLoose(Root3, _Container); - function Root3(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.ROOT; - return _this; - } - var _proto = Root3.prototype; - _proto.toString = function toString() { - var str = this.reduce(function(memo, selector) { - memo.push(String(selector)); - return memo; - }, []).join(","); - return this.trailingComma ? str + "," : str; - }; - _proto.error = function error(message, options) { - if (this._error) { - return this._error(message, options); - } else { - return new Error(message); - } - }; - _createClass(Root3, [{ - key: "errorGenerator", - set: function set(handler) { - this._error = handler; - } - }]); - return Root3; - }(_container["default"]); - exports["default"] = Root2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/selector.js - var require_selector = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/selector.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _container = _interopRequireDefault(require_container2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Selector = /* @__PURE__ */ function(_Container) { - _inheritsLoose(Selector2, _Container); - function Selector2(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.SELECTOR; - return _this; - } - return Selector2; - }(_container["default"]); - exports["default"] = Selector; - module.exports = exports.default; - } - }); - - // node_modules/cssesc/cssesc.js - var require_cssesc = __commonJS({ - "node_modules/cssesc/cssesc.js"(exports, module) { - "use strict"; - var object = {}; - var hasOwnProperty3 = object.hasOwnProperty; - var merge3 = function merge4(options, defaults3) { - if (!options) { - return defaults3; - } - var result = {}; - for (var key in defaults3) { - result[key] = hasOwnProperty3.call(options, key) ? options[key] : defaults3[key]; - } - return result; - }; - var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; - var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; - var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; - var cssesc = function cssesc2(string, options) { - options = merge3(options, cssesc2.options); - if (options.quotes != "single" && options.quotes != "double") { - options.quotes = "single"; - } - var quote = options.quotes == "double" ? '"' : "'"; - var isIdentifier = options.isIdentifier; - var firstChar = string.charAt(0); - var output = ""; - var counter = 0; - var length2 = string.length; - while (counter < length2) { - var character = string.charAt(counter++); - var codePoint = character.charCodeAt(); - var value2 = void 0; - if (codePoint < 32 || codePoint > 126) { - if (codePoint >= 55296 && codePoint <= 56319 && counter < length2) { - var extra = string.charCodeAt(counter++); - if ((extra & 64512) == 56320) { - codePoint = ((codePoint & 1023) << 10) + (extra & 1023) + 65536; - } else { - counter--; - } - } - value2 = "\\" + codePoint.toString(16).toUpperCase() + " "; - } else { - if (options.escapeEverything) { - if (regexAnySingleEscape.test(character)) { - value2 = "\\" + character; - } else { - value2 = "\\" + codePoint.toString(16).toUpperCase() + " "; - } - } else if (/[\t\n\f\r\x0B]/.test(character)) { - value2 = "\\" + codePoint.toString(16).toUpperCase() + " "; - } else if (character == "\\" || !isIdentifier && (character == '"' && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) { - value2 = "\\" + character; - } else { - value2 = character; - } - } - output += value2; - } - if (isIdentifier) { - if (/^-[-\d]/.test(output)) { - output = "\\-" + output.slice(1); - } else if (/\d/.test(firstChar)) { - output = "\\3" + firstChar + " " + output.slice(1); - } - } - output = output.replace(regexExcessiveSpaces, function($0, $1, $2) { - if ($1 && $1.length % 2) { - return $0; - } - return ($1 || "") + $2; - }); - if (!isIdentifier && options.wrap) { - return quote + output + quote; - } - return output; - }; - cssesc.options = { - "escapeEverything": false, - "isIdentifier": false, - "quotes": "single", - "wrap": false - }; - cssesc.version = "3.0.0"; - module.exports = cssesc; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/className.js - var require_className = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/className.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _cssesc = _interopRequireDefault(require_cssesc()); - var _util = require_util(); - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var ClassName = /* @__PURE__ */ function(_Node) { - _inheritsLoose(ClassName2, _Node); - function ClassName2(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.CLASS; - _this._constructed = true; - return _this; - } - var _proto = ClassName2.prototype; - _proto.valueToString = function valueToString() { - return "." + _Node.prototype.valueToString.call(this); - }; - _createClass(ClassName2, [{ - key: "value", - get: function get() { - return this._value; - }, - set: function set(v) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - if (escaped !== v) { - (0, _util.ensureObject)(this, "raws"); - this.raws.value = escaped; - } else if (this.raws) { - delete this.raws.value; - } - } - this._value = v; - } - }]); - return ClassName2; - }(_node["default"]); - exports["default"] = ClassName; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/comment.js - var require_comment2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/comment.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Comment2 = /* @__PURE__ */ function(_Node) { - _inheritsLoose(Comment3, _Node); - function Comment3(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.COMMENT; - return _this; - } - return Comment3; - }(_node["default"]); - exports["default"] = Comment2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/id.js - var require_id = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/id.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var ID = /* @__PURE__ */ function(_Node) { - _inheritsLoose(ID2, _Node); - function ID2(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.ID; - return _this; - } - var _proto = ID2.prototype; - _proto.valueToString = function valueToString() { - return "#" + _Node.prototype.valueToString.call(this); - }; - return ID2; - }(_node["default"]); - exports["default"] = ID; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/namespace.js - var require_namespace = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/namespace.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _cssesc = _interopRequireDefault(require_cssesc()); - var _util = require_util(); - var _node = _interopRequireDefault(require_node2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Namespace = /* @__PURE__ */ function(_Node) { - _inheritsLoose(Namespace2, _Node); - function Namespace2() { - return _Node.apply(this, arguments) || this; - } - var _proto = Namespace2.prototype; - _proto.qualifiedName = function qualifiedName(value2) { - if (this.namespace) { - return this.namespaceString + "|" + value2; - } else { - return value2; - } - }; - _proto.valueToString = function valueToString() { - return this.qualifiedName(_Node.prototype.valueToString.call(this)); - }; - _createClass(Namespace2, [{ - key: "namespace", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - if (namespace === true || namespace === "*" || namespace === "&") { - this._namespace = namespace; - if (this.raws) { - delete this.raws.namespace; - } - return; - } - var escaped = (0, _cssesc["default"])(namespace, { - isIdentifier: true - }); - this._namespace = namespace; - if (escaped !== namespace) { - (0, _util.ensureObject)(this, "raws"); - this.raws.namespace = escaped; - } else if (this.raws) { - delete this.raws.namespace; - } - } - }, { - key: "ns", - get: function get() { - return this._namespace; - }, - set: function set(namespace) { - this.namespace = namespace; - } - }, { - key: "namespaceString", - get: function get() { - if (this.namespace) { - var ns = this.stringifyProperty("namespace"); - if (ns === true) { - return ""; - } else { - return ns; - } - } else { - return ""; - } - } - }]); - return Namespace2; - }(_node["default"]); - exports["default"] = Namespace; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/tag.js - var require_tag = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/tag.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _namespace = _interopRequireDefault(require_namespace()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Tag = /* @__PURE__ */ function(_Namespace) { - _inheritsLoose(Tag2, _Namespace); - function Tag2(opts) { - var _this; - _this = _Namespace.call(this, opts) || this; - _this.type = _types.TAG; - return _this; - } - return Tag2; - }(_namespace["default"]); - exports["default"] = Tag; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/string.js - var require_string = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/string.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var String2 = /* @__PURE__ */ function(_Node) { - _inheritsLoose(String3, _Node); - function String3(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.STRING; - return _this; - } - return String3; - }(_node["default"]); - exports["default"] = String2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/pseudo.js - var require_pseudo = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/pseudo.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _container = _interopRequireDefault(require_container2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Pseudo = /* @__PURE__ */ function(_Container) { - _inheritsLoose(Pseudo2, _Container); - function Pseudo2(opts) { - var _this; - _this = _Container.call(this, opts) || this; - _this.type = _types.PSEUDO; - return _this; - } - var _proto = Pseudo2.prototype; - _proto.toString = function toString() { - var params = this.length ? "(" + this.map(String).join(",") + ")" : ""; - return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join(""); - }; - return Pseudo2; - }(_container["default"]); - exports["default"] = Pseudo; - module.exports = exports.default; - } - }); - - // node_modules/util-deprecate/browser.js - var require_browser = __commonJS({ - "node_modules/util-deprecate/browser.js"(exports, module) { - module.exports = deprecate; - function deprecate(fn, msg) { - if (config5("noDeprecation")) { - return fn; - } - var warned = false; - function deprecated() { - if (!warned) { - if (config5("throwDeprecation")) { - throw new Error(msg); - } else if (config5("traceDeprecation")) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - return deprecated; - } - function config5(name) { - try { - if (!global.localStorage) - return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) - return false; - return String(val).toLowerCase() === "true"; - } - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/attribute.js - var require_attribute = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/attribute.js"(exports) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - exports.unescapeValue = unescapeValue; - var _cssesc = _interopRequireDefault(require_cssesc()); - var _unesc = _interopRequireDefault(require_unesc()); - var _namespace = _interopRequireDefault(require_namespace()); - var _types = require_types(); - var _CSSESC_QUOTE_OPTIONS; - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var deprecate = require_browser(); - var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/; - var warnOfDeprecatedValueAssignment = deprecate(function() { - }, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead."); - var warnOfDeprecatedQuotedAssignment = deprecate(function() { - }, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead."); - var warnOfDeprecatedConstructor = deprecate(function() { - }, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now."); - function unescapeValue(value2) { - var deprecatedUsage = false; - var quoteMark = null; - var unescaped = value2; - var m = unescaped.match(WRAPPED_IN_QUOTES); - if (m) { - quoteMark = m[1]; - unescaped = m[2]; - } - unescaped = (0, _unesc["default"])(unescaped); - if (unescaped !== value2) { - deprecatedUsage = true; - } - return { - deprecatedUsage, - unescaped, - quoteMark - }; - } - function handleDeprecatedContructorOpts(opts) { - if (opts.quoteMark !== void 0) { - return opts; - } - if (opts.value === void 0) { - return opts; - } - warnOfDeprecatedConstructor(); - var _unescapeValue = unescapeValue(opts.value), quoteMark = _unescapeValue.quoteMark, unescaped = _unescapeValue.unescaped; - if (!opts.raws) { - opts.raws = {}; - } - if (opts.raws.value === void 0) { - opts.raws.value = opts.value; - } - opts.value = unescaped; - opts.quoteMark = quoteMark; - return opts; - } - var Attribute = /* @__PURE__ */ function(_Namespace) { - _inheritsLoose(Attribute2, _Namespace); - function Attribute2(opts) { - var _this; - if (opts === void 0) { - opts = {}; - } - _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this; - _this.type = _types.ATTRIBUTE; - _this.raws = _this.raws || {}; - Object.defineProperty(_this.raws, "unquoted", { - get: deprecate(function() { - return _this.value; - }, "attr.raws.unquoted is deprecated. Call attr.value instead."), - set: deprecate(function() { - return _this.value; - }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.") - }); - _this._constructed = true; - return _this; - } - var _proto = Attribute2.prototype; - _proto.getQuotedValue = function getQuotedValue(options) { - if (options === void 0) { - options = {}; - } - var quoteMark = this._determineQuoteMark(options); - var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark]; - var escaped = (0, _cssesc["default"])(this._value, cssescopts); - return escaped; - }; - _proto._determineQuoteMark = function _determineQuoteMark(options) { - return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options); - }; - _proto.setValue = function setValue(value2, options) { - if (options === void 0) { - options = {}; - } - this._value = value2; - this._quoteMark = this._determineQuoteMark(options); - this._syncRawValue(); - }; - _proto.smartQuoteMark = function smartQuoteMark(options) { - var v = this.value; - var numSingleQuotes = v.replace(/[^']/g, "").length; - var numDoubleQuotes = v.replace(/[^"]/g, "").length; - if (numSingleQuotes + numDoubleQuotes === 0) { - var escaped = (0, _cssesc["default"])(v, { - isIdentifier: true - }); - if (escaped === v) { - return Attribute2.NO_QUOTE; - } else { - var pref = this.preferredQuoteMark(options); - if (pref === Attribute2.NO_QUOTE) { - var quote = this.quoteMark || options.quoteMark || Attribute2.DOUBLE_QUOTE; - var opts = CSSESC_QUOTE_OPTIONS[quote]; - var quoteValue = (0, _cssesc["default"])(v, opts); - if (quoteValue.length < escaped.length) { - return quote; - } - } - return pref; - } - } else if (numDoubleQuotes === numSingleQuotes) { - return this.preferredQuoteMark(options); - } else if (numDoubleQuotes < numSingleQuotes) { - return Attribute2.DOUBLE_QUOTE; - } else { - return Attribute2.SINGLE_QUOTE; - } - }; - _proto.preferredQuoteMark = function preferredQuoteMark(options) { - var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark; - if (quoteMark === void 0) { - quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark; - } - if (quoteMark === void 0) { - quoteMark = Attribute2.DOUBLE_QUOTE; - } - return quoteMark; - }; - _proto._syncRawValue = function _syncRawValue() { - var rawValue = (0, _cssesc["default"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]); - if (rawValue === this._value) { - if (this.raws) { - delete this.raws.value; - } - } else { - this.raws.value = rawValue; - } - }; - _proto._handleEscapes = function _handleEscapes(prop, value2) { - if (this._constructed) { - var escaped = (0, _cssesc["default"])(value2, { - isIdentifier: true - }); - if (escaped !== value2) { - this.raws[prop] = escaped; - } else { - delete this.raws[prop]; - } - } - }; - _proto._spacesFor = function _spacesFor(name) { - var attrSpaces = { - before: "", - after: "" - }; - var spaces = this.spaces[name] || {}; - var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {}; - return Object.assign(attrSpaces, spaces, rawSpaces); - }; - _proto._stringFor = function _stringFor(name, spaceName, concat) { - if (spaceName === void 0) { - spaceName = name; - } - if (concat === void 0) { - concat = defaultAttrConcat; - } - var attrSpaces = this._spacesFor(spaceName); - return concat(this.stringifyProperty(name), attrSpaces); - }; - _proto.offsetOf = function offsetOf(name) { - var count = 1; - var attributeSpaces = this._spacesFor("attribute"); - count += attributeSpaces.before.length; - if (name === "namespace" || name === "ns") { - return this.namespace ? count : -1; - } - if (name === "attributeNS") { - return count; - } - count += this.namespaceString.length; - if (this.namespace) { - count += 1; - } - if (name === "attribute") { - return count; - } - count += this.stringifyProperty("attribute").length; - count += attributeSpaces.after.length; - var operatorSpaces = this._spacesFor("operator"); - count += operatorSpaces.before.length; - var operator = this.stringifyProperty("operator"); - if (name === "operator") { - return operator ? count : -1; - } - count += operator.length; - count += operatorSpaces.after.length; - var valueSpaces = this._spacesFor("value"); - count += valueSpaces.before.length; - var value2 = this.stringifyProperty("value"); - if (name === "value") { - return value2 ? count : -1; - } - count += value2.length; - count += valueSpaces.after.length; - var insensitiveSpaces = this._spacesFor("insensitive"); - count += insensitiveSpaces.before.length; - if (name === "insensitive") { - return this.insensitive ? count : -1; - } - return -1; - }; - _proto.toString = function toString() { - var _this2 = this; - var selector = [this.rawSpaceBefore, "["]; - selector.push(this._stringFor("qualifiedAttribute", "attribute")); - if (this.operator && (this.value || this.value === "")) { - selector.push(this._stringFor("operator")); - selector.push(this._stringFor("value")); - selector.push(this._stringFor("insensitiveFlag", "insensitive", function(attrValue, attrSpaces) { - if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) { - attrSpaces.before = " "; - } - return defaultAttrConcat(attrValue, attrSpaces); - })); - } - selector.push("]"); - selector.push(this.rawSpaceAfter); - return selector.join(""); - }; - _createClass(Attribute2, [{ - key: "quoted", - get: function get() { - var qm = this.quoteMark; - return qm === "'" || qm === '"'; - }, - set: function set(value2) { - warnOfDeprecatedQuotedAssignment(); - } - /** - * returns a single (`'`) or double (`"`) quote character if the value is quoted. - * returns `null` if the value is not quoted. - * returns `undefined` if the quotation state is unknown (this can happen when - * the attribute is constructed without specifying a quote mark.) - */ - }, { - key: "quoteMark", - get: function get() { - return this._quoteMark; - }, - set: function set(quoteMark) { - if (!this._constructed) { - this._quoteMark = quoteMark; - return; - } - if (this._quoteMark !== quoteMark) { - this._quoteMark = quoteMark; - this._syncRawValue(); - } - } - }, { - key: "qualifiedAttribute", - get: function get() { - return this.qualifiedName(this.raws.attribute || this.attribute); - } - }, { - key: "insensitiveFlag", - get: function get() { - return this.insensitive ? "i" : ""; - } - }, { - key: "value", - get: function get() { - return this._value; - }, - set: ( - /** - * Before 3.0, the value had to be set to an escaped value including any wrapped - * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value - * is unescaped during parsing and any quote marks are removed. - * - * Because the ambiguity of this semantic change, if you set `attr.value = newValue`, - * a deprecation warning is raised when the new value contains any characters that would - * require escaping (including if it contains wrapped quotes). - * - * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe - * how the new value is quoted. - */ - function set(v) { - if (this._constructed) { - var _unescapeValue2 = unescapeValue(v), deprecatedUsage = _unescapeValue2.deprecatedUsage, unescaped = _unescapeValue2.unescaped, quoteMark = _unescapeValue2.quoteMark; - if (deprecatedUsage) { - warnOfDeprecatedValueAssignment(); - } - if (unescaped === this._value && quoteMark === this._quoteMark) { - return; - } - this._value = unescaped; - this._quoteMark = quoteMark; - this._syncRawValue(); - } else { - this._value = v; - } - } - ) - }, { - key: "insensitive", - get: function get() { - return this._insensitive; - }, - set: function set(insensitive) { - if (!insensitive) { - this._insensitive = false; - if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) { - this.raws.insensitiveFlag = void 0; - } - } - this._insensitive = insensitive; - } - }, { - key: "attribute", - get: function get() { - return this._attribute; - }, - set: function set(name) { - this._handleEscapes("attribute", name); - this._attribute = name; - } - }]); - return Attribute2; - }(_namespace["default"]); - exports["default"] = Attribute; - Attribute.NO_QUOTE = null; - Attribute.SINGLE_QUOTE = "'"; - Attribute.DOUBLE_QUOTE = '"'; - var CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = { - "'": { - quotes: "single", - wrap: true - }, - '"': { - quotes: "double", - wrap: true - } - }, _CSSESC_QUOTE_OPTIONS[null] = { - isIdentifier: true - }, _CSSESC_QUOTE_OPTIONS); - function defaultAttrConcat(attrValue, attrSpaces) { - return "" + attrSpaces.before + attrValue + attrSpaces.after; - } - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/universal.js - var require_universal = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/universal.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _namespace = _interopRequireDefault(require_namespace()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Universal = /* @__PURE__ */ function(_Namespace) { - _inheritsLoose(Universal2, _Namespace); - function Universal2(opts) { - var _this; - _this = _Namespace.call(this, opts) || this; - _this.type = _types.UNIVERSAL; - _this.value = "*"; - return _this; - } - return Universal2; - }(_namespace["default"]); - exports["default"] = Universal; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/combinator.js - var require_combinator = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/combinator.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Combinator = /* @__PURE__ */ function(_Node) { - _inheritsLoose(Combinator2, _Node); - function Combinator2(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.COMBINATOR; - return _this; - } - return Combinator2; - }(_node["default"]); - exports["default"] = Combinator; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/nesting.js - var require_nesting = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/nesting.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _node = _interopRequireDefault(require_node2()); - var _types = require_types(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) { - o2.__proto__ = p2; - return o2; - }; - return _setPrototypeOf(o, p); - } - var Nesting = /* @__PURE__ */ function(_Node) { - _inheritsLoose(Nesting2, _Node); - function Nesting2(opts) { - var _this; - _this = _Node.call(this, opts) || this; - _this.type = _types.NESTING; - _this.value = "&"; - return _this; - } - return Nesting2; - }(_node["default"]); - exports["default"] = Nesting; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/sortAscending.js - var require_sortAscending = __commonJS({ - "node_modules/postcss-selector-parser/dist/sortAscending.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = sortAscending; - function sortAscending(list3) { - return list3.sort(function(a, b) { - return a - b; - }); - } - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/tokenTypes.js - var require_tokenTypes = __commonJS({ - "node_modules/postcss-selector-parser/dist/tokenTypes.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0; - var ampersand = 38; - exports.ampersand = ampersand; - var asterisk = 42; - exports.asterisk = asterisk; - var at = 64; - exports.at = at; - var comma = 44; - exports.comma = comma; - var colon = 58; - exports.colon = colon; - var semicolon = 59; - exports.semicolon = semicolon; - var openParenthesis = 40; - exports.openParenthesis = openParenthesis; - var closeParenthesis = 41; - exports.closeParenthesis = closeParenthesis; - var openSquare = 91; - exports.openSquare = openSquare; - var closeSquare = 93; - exports.closeSquare = closeSquare; - var dollar = 36; - exports.dollar = dollar; - var tilde = 126; - exports.tilde = tilde; - var caret = 94; - exports.caret = caret; - var plus = 43; - exports.plus = plus; - var equals = 61; - exports.equals = equals; - var pipe = 124; - exports.pipe = pipe; - var greaterThan = 62; - exports.greaterThan = greaterThan; - var space2 = 32; - exports.space = space2; - var singleQuote = 39; - exports.singleQuote = singleQuote; - var doubleQuote = 34; - exports.doubleQuote = doubleQuote; - var slash = 47; - exports.slash = slash; - var bang = 33; - exports.bang = bang; - var backslash = 92; - exports.backslash = backslash; - var cr = 13; - exports.cr = cr; - var feed = 12; - exports.feed = feed; - var newline = 10; - exports.newline = newline; - var tab = 9; - exports.tab = tab; - var str = singleQuote; - exports.str = str; - var comment2 = -1; - exports.comment = comment2; - var word = -2; - exports.word = word; - var combinator = -3; - exports.combinator = combinator; - } - }); - - // node_modules/postcss-selector-parser/dist/tokenize.js - var require_tokenize2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/tokenize.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.FIELDS = void 0; - exports["default"] = tokenize; - var t = _interopRequireWildcard(require_tokenTypes()); - var _unescapable; - var _wordDelimiters; - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") - return null; - var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); - var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) { - return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { "default": obj }; - } - var cache2 = _getRequireWildcardCache(nodeInterop); - if (cache2 && cache2.has(obj)) { - return cache2.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj["default"] = obj; - if (cache2) { - cache2.set(obj, newObj); - } - return newObj; - } - var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable); - var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters); - var hex = {}; - var hexChars = "0123456789abcdefABCDEF"; - for (i = 0; i < hexChars.length; i++) { - hex[hexChars.charCodeAt(i)] = true; - } - var i; - function consumeWord(css, start) { - var next = start; - var code; - do { - code = css.charCodeAt(next); - if (wordDelimiters[code]) { - return next - 1; - } else if (code === t.backslash) { - next = consumeEscape(css, next) + 1; - } else { - next++; - } - } while (next < css.length); - return next - 1; - } - function consumeEscape(css, start) { - var next = start; - var code = css.charCodeAt(next + 1); - if (unescapable[code]) { - } else if (hex[code]) { - var hexDigits = 0; - do { - next++; - hexDigits++; - code = css.charCodeAt(next + 1); - } while (hex[code] && hexDigits < 6); - if (hexDigits < 6 && code === t.space) { - next++; - } - } else { - next++; - } - return next; - } - var FIELDS = { - TYPE: 0, - START_LINE: 1, - START_COL: 2, - END_LINE: 3, - END_COL: 4, - START_POS: 5, - END_POS: 6 - }; - exports.FIELDS = FIELDS; - function tokenize(input) { - var tokens = []; - var css = input.css.valueOf(); - var _css = css, length2 = _css.length; - var offset = -1; - var line = 1; - var start = 0; - var end = 0; - var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType; - function unclosed(what, fix) { - if (input.safe) { - css += fix; - next = css.length - 1; - } else { - throw input.error("Unclosed " + what, line, start - offset, start); - } - } - while (start < length2) { - code = css.charCodeAt(start); - if (code === t.newline) { - offset = start; - line += 1; - } - switch (code) { - case t.space: - case t.tab: - case t.newline: - case t.cr: - case t.feed: - next = start; - do { - next += 1; - code = css.charCodeAt(next); - if (code === t.newline) { - offset = next; - line += 1; - } - } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed); - tokenType = t.space; - endLine = line; - endColumn = next - offset - 1; - end = next; - break; - case t.plus: - case t.greaterThan: - case t.tilde: - case t.pipe: - next = start; - do { - next += 1; - code = css.charCodeAt(next); - } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe); - tokenType = t.combinator; - endLine = line; - endColumn = start - offset; - end = next; - break; - case t.asterisk: - case t.ampersand: - case t.bang: - case t.comma: - case t.equals: - case t.dollar: - case t.caret: - case t.openSquare: - case t.closeSquare: - case t.colon: - case t.semicolon: - case t.openParenthesis: - case t.closeParenthesis: - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - case t.singleQuote: - case t.doubleQuote: - quote = code === t.singleQuote ? "'" : '"'; - next = start; - do { - escaped = false; - next = css.indexOf(quote, next + 1); - if (next === -1) { - unclosed("quote", quote); - } - escapePos = next; - while (css.charCodeAt(escapePos - 1) === t.backslash) { - escapePos -= 1; - escaped = !escaped; - } - } while (escaped); - tokenType = t.str; - endLine = line; - endColumn = start - offset; - end = next + 1; - break; - default: - if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) { - next = css.indexOf("*/", start + 2) + 1; - if (next === 0) { - unclosed("comment", "*/"); - } - content = css.slice(start, next + 1); - lines = content.split("\n"); - last = lines.length - 1; - if (last > 0) { - nextLine = line + last; - nextOffset = next - lines[last].length; - } else { - nextLine = line; - nextOffset = offset; - } - tokenType = t.comment; - line = nextLine; - endLine = nextLine; - endColumn = next - nextOffset; - } else if (code === t.slash) { - next = start; - tokenType = code; - endLine = line; - endColumn = start - offset; - end = next + 1; - } else { - next = consumeWord(css, start); - tokenType = t.word; - endLine = line; - endColumn = next - offset; - } - end = next + 1; - break; - } - tokens.push([ - tokenType, - // [0] Token type - line, - // [1] Starting line - start - offset, - // [2] Starting column - endLine, - // [3] Ending line - endColumn, - // [4] Ending column - start, - // [5] Start position / Source index - end - // [6] End position - ]); - if (nextOffset) { - offset = nextOffset; - nextOffset = null; - } - start = end; - } - return tokens; - } - } - }); - - // node_modules/postcss-selector-parser/dist/parser.js - var require_parser2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/parser.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _root = _interopRequireDefault(require_root2()); - var _selector = _interopRequireDefault(require_selector()); - var _className = _interopRequireDefault(require_className()); - var _comment = _interopRequireDefault(require_comment2()); - var _id = _interopRequireDefault(require_id()); - var _tag = _interopRequireDefault(require_tag()); - var _string = _interopRequireDefault(require_string()); - var _pseudo = _interopRequireDefault(require_pseudo()); - var _attribute = _interopRequireWildcard(require_attribute()); - var _universal = _interopRequireDefault(require_universal()); - var _combinator = _interopRequireDefault(require_combinator()); - var _nesting = _interopRequireDefault(require_nesting()); - var _sortAscending = _interopRequireDefault(require_sortAscending()); - var _tokenize = _interopRequireWildcard(require_tokenize2()); - var tokens = _interopRequireWildcard(require_tokenTypes()); - var types2 = _interopRequireWildcard(require_types()); - var _util = require_util(); - var _WHITESPACE_TOKENS; - var _Object$assign; - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") - return null; - var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); - var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) { - return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { "default": obj }; - } - var cache2 = _getRequireWildcardCache(nodeInterop); - if (cache2 && cache2.has(obj)) { - return cache2.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj["default"] = obj; - if (cache2) { - cache2.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS); - var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign)); - function tokenStart(token) { - return { - line: token[_tokenize.FIELDS.START_LINE], - column: token[_tokenize.FIELDS.START_COL] - }; - } - function tokenEnd(token) { - return { - line: token[_tokenize.FIELDS.END_LINE], - column: token[_tokenize.FIELDS.END_COL] - }; - } - function getSource(startLine, startColumn, endLine, endColumn) { - return { - start: { - line: startLine, - column: startColumn - }, - end: { - line: endLine, - column: endColumn - } - }; - } - function getTokenSource(token) { - return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]); - } - function getTokenSourceSpan(startToken, endToken) { - if (!startToken) { - return void 0; - } - return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]); - } - function unescapeProp(node, prop) { - var value2 = node[prop]; - if (typeof value2 !== "string") { - return; - } - if (value2.indexOf("\\") !== -1) { - (0, _util.ensureObject)(node, "raws"); - node[prop] = (0, _util.unesc)(value2); - if (node.raws[prop] === void 0) { - node.raws[prop] = value2; - } - } - return node; - } - function indexesOf(array, item) { - var i = -1; - var indexes = []; - while ((i = array.indexOf(item, i + 1)) !== -1) { - indexes.push(i); - } - return indexes; - } - function uniqs() { - var list3 = Array.prototype.concat.apply([], arguments); - return list3.filter(function(item, i) { - return i === list3.indexOf(item); - }); - } - var Parser = /* @__PURE__ */ function() { - function Parser2(rule2, options) { - if (options === void 0) { - options = {}; - } - this.rule = rule2; - this.options = Object.assign({ - lossy: false, - safe: false - }, options); - this.position = 0; - this.css = typeof this.rule === "string" ? this.rule : this.rule.selector; - this.tokens = (0, _tokenize["default"])({ - css: this.css, - error: this._errorGenerator(), - safe: this.options.safe - }); - var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]); - this.root = new _root["default"]({ - source: rootSource - }); - this.root.errorGenerator = this._errorGenerator(); - var selector = new _selector["default"]({ - source: { - start: { - line: 1, - column: 1 - } - } - }); - this.root.append(selector); - this.current = selector; - this.loop(); - } - var _proto = Parser2.prototype; - _proto._errorGenerator = function _errorGenerator() { - var _this = this; - return function(message, errorOptions) { - if (typeof _this.rule === "string") { - return new Error(message); - } - return _this.rule.error(message, errorOptions); - }; - }; - _proto.attribute = function attribute() { - var attr2 = []; - var startingToken = this.currToken; - this.position++; - while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - attr2.push(this.currToken); - this.position++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) { - return this.expected("closing square bracket", this.currToken[_tokenize.FIELDS.START_POS]); - } - var len = attr2.length; - var node = { - source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - }; - if (len === 1 && !~[tokens.word].indexOf(attr2[0][_tokenize.FIELDS.TYPE])) { - return this.expected("attribute", attr2[0][_tokenize.FIELDS.START_POS]); - } - var pos = 0; - var spaceBefore = ""; - var commentBefore = ""; - var lastAdded = null; - var spaceAfterMeaningfulToken = false; - while (pos < len) { - var token = attr2[pos]; - var content = this.content(token); - var next = attr2[pos + 1]; - switch (token[_tokenize.FIELDS.TYPE]) { - case tokens.space: - spaceAfterMeaningfulToken = true; - if (this.options.lossy) { - break; - } - if (lastAdded) { - (0, _util.ensureObject)(node, "spaces", lastAdded); - var prevContent = node.spaces[lastAdded].after || ""; - node.spaces[lastAdded].after = prevContent + content; - var existingComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || null; - if (existingComment) { - node.raws.spaces[lastAdded].after = existingComment + content; - } - } else { - spaceBefore = spaceBefore + content; - commentBefore = commentBefore + content; - } - break; - case tokens.asterisk: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = "operator"; - } else if ((!node.namespace || lastAdded === "namespace" && !spaceAfterMeaningfulToken) && next) { - if (spaceBefore) { - (0, _util.ensureObject)(node, "spaces", "attribute"); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ""; - } - if (commentBefore) { - (0, _util.ensureObject)(node, "raws", "spaces", "attribute"); - node.raws.spaces.attribute.before = spaceBefore; - commentBefore = ""; - } - node.namespace = (node.namespace || "") + content; - var rawValue = (0, _util.getProp)(node, "raws", "namespace") || null; - if (rawValue) { - node.raws.namespace += content; - } - lastAdded = "namespace"; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.dollar: - if (lastAdded === "value") { - var oldRawValue = (0, _util.getProp)(node, "raws", "value"); - node.value += "$"; - if (oldRawValue) { - node.raws.value = oldRawValue + "$"; - } - break; - } - case tokens.caret: - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = "operator"; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.combinator: - if (content === "~" && next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = "operator"; - } - if (content !== "|") { - spaceAfterMeaningfulToken = false; - break; - } - if (next[_tokenize.FIELDS.TYPE] === tokens.equals) { - node.operator = content; - lastAdded = "operator"; - } else if (!node.namespace && !node.attribute) { - node.namespace = true; - } - spaceAfterMeaningfulToken = false; - break; - case tokens.word: - if (next && this.content(next) === "|" && attr2[pos + 2] && attr2[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved. - !node.operator && !node.namespace) { - node.namespace = content; - lastAdded = "namespace"; - } else if (!node.attribute || lastAdded === "attribute" && !spaceAfterMeaningfulToken) { - if (spaceBefore) { - (0, _util.ensureObject)(node, "spaces", "attribute"); - node.spaces.attribute.before = spaceBefore; - spaceBefore = ""; - } - if (commentBefore) { - (0, _util.ensureObject)(node, "raws", "spaces", "attribute"); - node.raws.spaces.attribute.before = commentBefore; - commentBefore = ""; - } - node.attribute = (node.attribute || "") + content; - var _rawValue = (0, _util.getProp)(node, "raws", "attribute") || null; - if (_rawValue) { - node.raws.attribute += content; - } - lastAdded = "attribute"; - } else if (!node.value && node.value !== "" || lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark)) { - var _unescaped = (0, _util.unesc)(content); - var _oldRawValue = (0, _util.getProp)(node, "raws", "value") || ""; - var oldValue = node.value || ""; - node.value = oldValue + _unescaped; - node.quoteMark = null; - if (_unescaped !== content || _oldRawValue) { - (0, _util.ensureObject)(node, "raws"); - node.raws.value = (_oldRawValue || oldValue) + content; - } - lastAdded = "value"; - } else { - var insensitive = content === "i" || content === "I"; - if ((node.value || node.value === "") && (node.quoteMark || spaceAfterMeaningfulToken)) { - node.insensitive = insensitive; - if (!insensitive || content === "I") { - (0, _util.ensureObject)(node, "raws"); - node.raws.insensitiveFlag = content; - } - lastAdded = "insensitive"; - if (spaceBefore) { - (0, _util.ensureObject)(node, "spaces", "insensitive"); - node.spaces.insensitive.before = spaceBefore; - spaceBefore = ""; - } - if (commentBefore) { - (0, _util.ensureObject)(node, "raws", "spaces", "insensitive"); - node.raws.spaces.insensitive.before = commentBefore; - commentBefore = ""; - } - } else if (node.value || node.value === "") { - lastAdded = "value"; - node.value += content; - if (node.raws.value) { - node.raws.value += content; - } - } - } - spaceAfterMeaningfulToken = false; - break; - case tokens.str: - if (!node.attribute || !node.operator) { - return this.error("Expected an attribute followed by an operator preceding the string.", { - index: token[_tokenize.FIELDS.START_POS] - }); - } - var _unescapeValue = (0, _attribute.unescapeValue)(content), unescaped = _unescapeValue.unescaped, quoteMark = _unescapeValue.quoteMark; - node.value = unescaped; - node.quoteMark = quoteMark; - lastAdded = "value"; - (0, _util.ensureObject)(node, "raws"); - node.raws.value = content; - spaceAfterMeaningfulToken = false; - break; - case tokens.equals: - if (!node.attribute) { - return this.expected("attribute", token[_tokenize.FIELDS.START_POS], content); - } - if (node.value) { - return this.error('Unexpected "=" found; an operator was already defined.', { - index: token[_tokenize.FIELDS.START_POS] - }); - } - node.operator = node.operator ? node.operator + content : content; - lastAdded = "operator"; - spaceAfterMeaningfulToken = false; - break; - case tokens.comment: - if (lastAdded) { - if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") { - var lastComment = (0, _util.getProp)(node, "spaces", lastAdded, "after") || ""; - var rawLastComment = (0, _util.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment; - (0, _util.ensureObject)(node, "raws", "spaces", lastAdded); - node.raws.spaces[lastAdded].after = rawLastComment + content; - } else { - var lastValue = node[lastAdded] || ""; - var rawLastValue = (0, _util.getProp)(node, "raws", lastAdded) || lastValue; - (0, _util.ensureObject)(node, "raws"); - node.raws[lastAdded] = rawLastValue + content; - } - } else { - commentBefore = commentBefore + content; - } - break; - default: - return this.error('Unexpected "' + content + '" found.', { - index: token[_tokenize.FIELDS.START_POS] - }); - } - pos++; - } - unescapeProp(node, "attribute"); - unescapeProp(node, "namespace"); - this.newNode(new _attribute["default"](node)); - this.position++; - }; - _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) { - if (stopPosition < 0) { - stopPosition = this.tokens.length; - } - var startPosition = this.position; - var nodes = []; - var space2 = ""; - var lastComment = void 0; - do { - if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { - if (!this.options.lossy) { - space2 += this.content(); - } - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) { - var spaces = {}; - if (space2) { - spaces.before = space2; - space2 = ""; - } - lastComment = new _comment["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - spaces - }); - nodes.push(lastComment); - } - } while (++this.position < stopPosition); - if (space2) { - if (lastComment) { - lastComment.spaces.after = space2; - } else if (!this.options.lossy) { - var firstToken = this.tokens[startPosition]; - var lastToken = this.tokens[this.position - 1]; - nodes.push(new _string["default"]({ - value: "", - source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces: { - before: space2, - after: "" - } - })); - } - } - return nodes; - }; - _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) { - var _this2 = this; - if (requiredSpace === void 0) { - requiredSpace = false; - } - var space2 = ""; - var rawSpace = ""; - nodes.forEach(function(n) { - var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace); - var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace); - space2 += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0); - rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0); - }); - if (rawSpace === space2) { - rawSpace = void 0; - } - var result = { - space: space2, - rawSpace - }; - return result; - }; - _proto.isNamedCombinator = function isNamedCombinator(position2) { - if (position2 === void 0) { - position2 = this.position; - } - return this.tokens[position2 + 0] && this.tokens[position2 + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position2 + 1] && this.tokens[position2 + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position2 + 2] && this.tokens[position2 + 2][_tokenize.FIELDS.TYPE] === tokens.slash; - }; - _proto.namedCombinator = function namedCombinator() { - if (this.isNamedCombinator()) { - var nameRaw = this.content(this.tokens[this.position + 1]); - var name = (0, _util.unesc)(nameRaw).toLowerCase(); - var raws = {}; - if (name !== nameRaw) { - raws.value = "/" + nameRaw + "/"; - } - var node = new _combinator["default"]({ - value: "/" + name + "/", - source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS], - raws - }); - this.position = this.position + 3; - return node; - } else { - this.unexpected(); - } - }; - _proto.combinator = function combinator() { - var _this3 = this; - if (this.content() === "|") { - return this.namespace(); - } - var nextSigTokenPos = this.locateNextMeaningfulToken(this.position); - if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) { - var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - if (nodes.length > 0) { - var last = this.current.last; - if (last) { - var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes), space2 = _this$convertWhitespa.space, rawSpace = _this$convertWhitespa.rawSpace; - if (rawSpace !== void 0) { - last.rawSpaceAfter += rawSpace; - } - last.spaces.after += space2; - } else { - nodes.forEach(function(n) { - return _this3.newNode(n); - }); - } - } - return; - } - var firstToken = this.currToken; - var spaceOrDescendantSelectorNodes = void 0; - if (nextSigTokenPos > this.position) { - spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos); - } - var node; - if (this.isNamedCombinator()) { - node = this.namedCombinator(); - } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) { - node = new _combinator["default"]({ - value: this.content(), - source: getTokenSource(this.currToken), - sourceIndex: this.currToken[_tokenize.FIELDS.START_POS] - }); - this.position++; - } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) { - } else if (!spaceOrDescendantSelectorNodes) { - this.unexpected(); - } - if (node) { - if (spaceOrDescendantSelectorNodes) { - var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), _space = _this$convertWhitespa2.space, _rawSpace = _this$convertWhitespa2.rawSpace; - node.spaces.before = _space; - node.rawSpaceBefore = _rawSpace; - } - } else { - var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), _space2 = _this$convertWhitespa3.space, _rawSpace2 = _this$convertWhitespa3.rawSpace; - if (!_rawSpace2) { - _rawSpace2 = _space2; - } - var spaces = {}; - var raws = { - spaces: {} - }; - if (_space2.endsWith(" ") && _rawSpace2.endsWith(" ")) { - spaces.before = _space2.slice(0, _space2.length - 1); - raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1); - } else if (_space2.startsWith(" ") && _rawSpace2.startsWith(" ")) { - spaces.after = _space2.slice(1); - raws.spaces.after = _rawSpace2.slice(1); - } else { - raws.value = _rawSpace2; - } - node = new _combinator["default"]({ - value: " ", - source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]), - sourceIndex: firstToken[_tokenize.FIELDS.START_POS], - spaces, - raws - }); - } - if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) { - node.spaces.after = this.optionalSpace(this.content()); - this.position++; - } - return this.newNode(node); - }; - _proto.comma = function comma() { - if (this.position === this.tokens.length - 1) { - this.root.trailingComma = true; - this.position++; - return; - } - this.current._inferEndPosition(); - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position + 1]) - } - }); - this.current.parent.append(selector); - this.current = selector; - this.position++; - }; - _proto.comment = function comment2() { - var current = this.currToken; - this.newNode(new _comment["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.error = function error(message, opts) { - throw this.root.error(message, opts); - }; - _proto.missingBackslash = function missingBackslash() { - return this.error("Expected a backslash preceding the semicolon.", { - index: this.currToken[_tokenize.FIELDS.START_POS] - }); - }; - _proto.missingParenthesis = function missingParenthesis() { - return this.expected("opening parenthesis", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.missingSquareBracket = function missingSquareBracket() { - return this.expected("opening square bracket", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.unexpected = function unexpected() { - return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.unexpectedPipe = function unexpectedPipe() { - return this.error("Unexpected '|'.", this.currToken[_tokenize.FIELDS.START_POS]); - }; - _proto.namespace = function namespace() { - var before = this.prevToken && this.content(this.prevToken) || true; - if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.position++; - return this.word(before); - } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) { - this.position++; - return this.universal(before); - } - this.unexpectedPipe(); - }; - _proto.nesting = function nesting() { - if (this.nextToken) { - var nextContent = this.content(this.nextToken); - if (nextContent === "|") { - this.position++; - return; - } - } - var current = this.currToken; - this.newNode(new _nesting["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.parentheses = function parentheses() { - var last = this.current.last; - var unbalanced = 1; - this.position++; - if (last && last.type === types2.PSEUDO) { - var selector = new _selector["default"]({ - source: { - start: tokenStart(this.tokens[this.position - 1]) - } - }); - var cache2 = this.current; - last.append(selector); - this.current = selector; - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - if (unbalanced) { - this.parse(); - } else { - this.current.source.end = tokenEnd(this.currToken); - this.current.parent.source.end = tokenEnd(this.currToken); - this.position++; - } - } - this.current = cache2; - } else { - var parenStart = this.currToken; - var parenValue = "("; - var parenEnd; - while (this.position < this.tokens.length && unbalanced) { - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - unbalanced++; - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - unbalanced--; - } - parenEnd = this.currToken; - parenValue += this.parseParenthesisToken(this.currToken); - this.position++; - } - if (last) { - last.appendToPropertyAndEscape("value", parenValue, parenValue); - } else { - this.newNode(new _string["default"]({ - value: parenValue, - source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]), - sourceIndex: parenStart[_tokenize.FIELDS.START_POS] - })); - } - } - if (unbalanced) { - return this.expected("closing parenthesis", this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - _proto.pseudo = function pseudo() { - var _this4 = this; - var pseudoStr = ""; - var startingToken = this.currToken; - while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) { - pseudoStr += this.content(); - this.position++; - } - if (!this.currToken) { - return this.expected(["pseudo-class", "pseudo-element"], this.position - 1); - } - if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) { - this.splitWord(false, function(first, length2) { - pseudoStr += first; - _this4.newNode(new _pseudo["default"]({ - value: pseudoStr, - source: getTokenSourceSpan(startingToken, _this4.currToken), - sourceIndex: startingToken[_tokenize.FIELDS.START_POS] - })); - if (length2 > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) { - _this4.error("Misplaced parenthesis.", { - index: _this4.nextToken[_tokenize.FIELDS.START_POS] - }); - } - }); - } else { - return this.expected(["pseudo-class", "pseudo-element"], this.currToken[_tokenize.FIELDS.START_POS]); - } - }; - _proto.space = function space2() { - var content = this.content(); - if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function(node) { - return node.type === "comment"; - })) { - this.spaces = this.optionalSpace(content); - this.position++; - } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) { - this.current.last.spaces.after = this.optionalSpace(content); - this.position++; - } else { - this.combinator(); - } - }; - _proto.string = function string() { - var current = this.currToken; - this.newNode(new _string["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - })); - this.position++; - }; - _proto.universal = function universal(namespace) { - var nextToken = this.nextToken; - if (nextToken && this.content(nextToken) === "|") { - this.position++; - return this.namespace(); - } - var current = this.currToken; - this.newNode(new _universal["default"]({ - value: this.content(), - source: getTokenSource(current), - sourceIndex: current[_tokenize.FIELDS.START_POS] - }), namespace); - this.position++; - }; - _proto.splitWord = function splitWord(namespace, firstCallback) { - var _this5 = this; - var nextToken = this.nextToken; - var word = this.content(); - while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) { - this.position++; - var current = this.content(); - word += current; - if (current.lastIndexOf("\\") === current.length - 1) { - var next = this.nextToken; - if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) { - word += this.requiredSpace(this.content(next)); - this.position++; - } - } - nextToken = this.nextToken; - } - var hasClass = indexesOf(word, ".").filter(function(i) { - var escapedDot = word[i - 1] === "\\"; - var isKeyframesPercent = /^\d+\.\d+%$/.test(word); - return !escapedDot && !isKeyframesPercent; - }); - var hasId = indexesOf(word, "#").filter(function(i) { - return word[i - 1] !== "\\"; - }); - var interpolations = indexesOf(word, "#{"); - if (interpolations.length) { - hasId = hasId.filter(function(hashIndex) { - return !~interpolations.indexOf(hashIndex); - }); - } - var indices = (0, _sortAscending["default"])(uniqs([0].concat(hasClass, hasId))); - indices.forEach(function(ind, i) { - var index4 = indices[i + 1] || word.length; - var value2 = word.slice(ind, index4); - if (i === 0 && firstCallback) { - return firstCallback.call(_this5, value2, indices.length); - } - var node; - var current2 = _this5.currToken; - var sourceIndex = current2[_tokenize.FIELDS.START_POS] + indices[i]; - var source = getSource(current2[1], current2[2] + ind, current2[3], current2[2] + (index4 - 1)); - if (~hasClass.indexOf(ind)) { - var classNameOpts = { - value: value2.slice(1), - source, - sourceIndex - }; - node = new _className["default"](unescapeProp(classNameOpts, "value")); - } else if (~hasId.indexOf(ind)) { - var idOpts = { - value: value2.slice(1), - source, - sourceIndex - }; - node = new _id["default"](unescapeProp(idOpts, "value")); - } else { - var tagOpts = { - value: value2, - source, - sourceIndex - }; - unescapeProp(tagOpts, "value"); - node = new _tag["default"](tagOpts); - } - _this5.newNode(node, namespace); - namespace = null; - }); - this.position++; - }; - _proto.word = function word(namespace) { - var nextToken = this.nextToken; - if (nextToken && this.content(nextToken) === "|") { - this.position++; - return this.namespace(); - } - return this.splitWord(namespace); - }; - _proto.loop = function loop2() { - while (this.position < this.tokens.length) { - this.parse(true); - } - this.current._inferEndPosition(); - return this.root; - }; - _proto.parse = function parse3(throwOnParenthesis) { - switch (this.currToken[_tokenize.FIELDS.TYPE]) { - case tokens.space: - this.space(); - break; - case tokens.comment: - this.comment(); - break; - case tokens.openParenthesis: - this.parentheses(); - break; - case tokens.closeParenthesis: - if (throwOnParenthesis) { - this.missingParenthesis(); - } - break; - case tokens.openSquare: - this.attribute(); - break; - case tokens.dollar: - case tokens.caret: - case tokens.equals: - case tokens.word: - this.word(); - break; - case tokens.colon: - this.pseudo(); - break; - case tokens.comma: - this.comma(); - break; - case tokens.asterisk: - this.universal(); - break; - case tokens.ampersand: - this.nesting(); - break; - case tokens.slash: - case tokens.combinator: - this.combinator(); - break; - case tokens.str: - this.string(); - break; - case tokens.closeSquare: - this.missingSquareBracket(); - case tokens.semicolon: - this.missingBackslash(); - default: - this.unexpected(); - } - }; - _proto.expected = function expected(description, index4, found) { - if (Array.isArray(description)) { - var last = description.pop(); - description = description.join(", ") + " or " + last; - } - var an = /^[aeiou]/.test(description[0]) ? "an" : "a"; - if (!found) { - return this.error("Expected " + an + " " + description + ".", { - index: index4 - }); - } - return this.error("Expected " + an + " " + description + ', found "' + found + '" instead.', { - index: index4 - }); - }; - _proto.requiredSpace = function requiredSpace(space2) { - return this.options.lossy ? " " : space2; - }; - _proto.optionalSpace = function optionalSpace(space2) { - return this.options.lossy ? "" : space2; - }; - _proto.lossySpace = function lossySpace(space2, required) { - if (this.options.lossy) { - return required ? " " : ""; - } else { - return space2; - } - }; - _proto.parseParenthesisToken = function parseParenthesisToken(token) { - var content = this.content(token); - if (token[_tokenize.FIELDS.TYPE] === tokens.space) { - return this.requiredSpace(content); - } else { - return content; - } - }; - _proto.newNode = function newNode(node, namespace) { - if (namespace) { - if (/^ +$/.test(namespace)) { - if (!this.options.lossy) { - this.spaces = (this.spaces || "") + namespace; - } - namespace = true; - } - node.namespace = namespace; - unescapeProp(node, "namespace"); - } - if (this.spaces) { - node.spaces.before = this.spaces; - this.spaces = ""; - } - return this.current.append(node); - }; - _proto.content = function content(token) { - if (token === void 0) { - token = this.currToken; - } - return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]); - }; - _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) { - if (startPosition === void 0) { - startPosition = this.position + 1; - } - var searchPosition = startPosition; - while (searchPosition < this.tokens.length) { - if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) { - searchPosition++; - continue; - } else { - return searchPosition; - } - } - return -1; - }; - _createClass(Parser2, [{ - key: "currToken", - get: function get() { - return this.tokens[this.position]; - } - }, { - key: "nextToken", - get: function get() { - return this.tokens[this.position + 1]; - } - }, { - key: "prevToken", - get: function get() { - return this.tokens[this.position - 1]; - } - }]); - return Parser2; - }(); - exports["default"] = Parser; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/processor.js - var require_processor2 = __commonJS({ - "node_modules/postcss-selector-parser/dist/processor.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _parser = _interopRequireDefault(require_parser2()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var Processor2 = /* @__PURE__ */ function() { - function Processor3(func, options) { - this.func = func || function noop3() { - }; - this.funcRes = null; - this.options = options; - } - var _proto = Processor3.prototype; - _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule2, options) { - if (options === void 0) { - options = {}; - } - var merged = Object.assign({}, this.options, options); - if (merged.updateSelector === false) { - return false; - } else { - return typeof rule2 !== "string"; - } - }; - _proto._isLossy = function _isLossy(options) { - if (options === void 0) { - options = {}; - } - var merged = Object.assign({}, this.options, options); - if (merged.lossless === false) { - return true; - } else { - return false; - } - }; - _proto._root = function _root(rule2, options) { - if (options === void 0) { - options = {}; - } - var parser5 = new _parser["default"](rule2, this._parseOptions(options)); - return parser5.root; - }; - _proto._parseOptions = function _parseOptions(options) { - return { - lossy: this._isLossy(options) - }; - }; - _proto._run = function _run(rule2, options) { - var _this = this; - if (options === void 0) { - options = {}; - } - return new Promise(function(resolve, reject) { - try { - var root2 = _this._root(rule2, options); - Promise.resolve(_this.func(root2)).then(function(transform) { - var string = void 0; - if (_this._shouldUpdateSelector(rule2, options)) { - string = root2.toString(); - rule2.selector = string; - } - return { - transform, - root: root2, - string - }; - }).then(resolve, reject); - } catch (e) { - reject(e); - return; - } - }); - }; - _proto._runSync = function _runSync(rule2, options) { - if (options === void 0) { - options = {}; - } - var root2 = this._root(rule2, options); - var transform = this.func(root2); - if (transform && typeof transform.then === "function") { - throw new Error("Selector processor returned a promise to a synchronous call."); - } - var string = void 0; - if (options.updateSelector && typeof rule2 !== "string") { - string = root2.toString(); - rule2.selector = string; - } - return { - transform, - root: root2, - string - }; - }; - _proto.ast = function ast(rule2, options) { - return this._run(rule2, options).then(function(result) { - return result.root; - }); - }; - _proto.astSync = function astSync(rule2, options) { - return this._runSync(rule2, options).root; - }; - _proto.transform = function transform(rule2, options) { - return this._run(rule2, options).then(function(result) { - return result.transform; - }); - }; - _proto.transformSync = function transformSync(rule2, options) { - return this._runSync(rule2, options).transform; - }; - _proto.process = function process2(rule2, options) { - return this._run(rule2, options).then(function(result) { - return result.string || result.root.toString(); - }); - }; - _proto.processSync = function processSync(rule2, options) { - var result = this._runSync(rule2, options); - return result.string || result.root.toString(); - }; - return Processor3; - }(); - exports["default"] = Processor2; - module.exports = exports.default; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/constructors.js - var require_constructors = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/constructors.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0; - var _attribute = _interopRequireDefault(require_attribute()); - var _className = _interopRequireDefault(require_className()); - var _combinator = _interopRequireDefault(require_combinator()); - var _comment = _interopRequireDefault(require_comment2()); - var _id = _interopRequireDefault(require_id()); - var _nesting = _interopRequireDefault(require_nesting()); - var _pseudo = _interopRequireDefault(require_pseudo()); - var _root = _interopRequireDefault(require_root2()); - var _selector = _interopRequireDefault(require_selector()); - var _string = _interopRequireDefault(require_string()); - var _tag = _interopRequireDefault(require_tag()); - var _universal = _interopRequireDefault(require_universal()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var attribute = function attribute2(opts) { - return new _attribute["default"](opts); - }; - exports.attribute = attribute; - var className = function className2(opts) { - return new _className["default"](opts); - }; - exports.className = className; - var combinator = function combinator2(opts) { - return new _combinator["default"](opts); - }; - exports.combinator = combinator; - var comment2 = function comment3(opts) { - return new _comment["default"](opts); - }; - exports.comment = comment2; - var id = function id2(opts) { - return new _id["default"](opts); - }; - exports.id = id; - var nesting = function nesting2(opts) { - return new _nesting["default"](opts); - }; - exports.nesting = nesting; - var pseudo = function pseudo2(opts) { - return new _pseudo["default"](opts); - }; - exports.pseudo = pseudo; - var root2 = function root3(opts) { - return new _root["default"](opts); - }; - exports.root = root2; - var selector = function selector2(opts) { - return new _selector["default"](opts); - }; - exports.selector = selector; - var string = function string2(opts) { - return new _string["default"](opts); - }; - exports.string = string; - var tag = function tag2(opts) { - return new _tag["default"](opts); - }; - exports.tag = tag; - var universal = function universal2(opts) { - return new _universal["default"](opts); - }; - exports.universal = universal; - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/guards.js - var require_guards = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/guards.js"(exports) { - "use strict"; - exports.__esModule = true; - exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0; - exports.isContainer = isContainer; - exports.isIdentifier = void 0; - exports.isNamespace = isNamespace; - exports.isNesting = void 0; - exports.isNode = isNode; - exports.isPseudo = void 0; - exports.isPseudoClass = isPseudoClass; - exports.isPseudoElement = isPseudoElement2; - exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0; - var _types = require_types(); - var _IS_TYPE; - var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE); - function isNode(node) { - return typeof node === "object" && IS_TYPE[node.type]; - } - function isNodeType(type, node) { - return isNode(node) && node.type === type; - } - var isAttribute = isNodeType.bind(null, _types.ATTRIBUTE); - exports.isAttribute = isAttribute; - var isClassName = isNodeType.bind(null, _types.CLASS); - exports.isClassName = isClassName; - var isCombinator = isNodeType.bind(null, _types.COMBINATOR); - exports.isCombinator = isCombinator; - var isComment = isNodeType.bind(null, _types.COMMENT); - exports.isComment = isComment; - var isIdentifier = isNodeType.bind(null, _types.ID); - exports.isIdentifier = isIdentifier; - var isNesting = isNodeType.bind(null, _types.NESTING); - exports.isNesting = isNesting; - var isPseudo = isNodeType.bind(null, _types.PSEUDO); - exports.isPseudo = isPseudo; - var isRoot2 = isNodeType.bind(null, _types.ROOT); - exports.isRoot = isRoot2; - var isSelector = isNodeType.bind(null, _types.SELECTOR); - exports.isSelector = isSelector; - var isString = isNodeType.bind(null, _types.STRING); - exports.isString = isString; - var isTag = isNodeType.bind(null, _types.TAG); - exports.isTag = isTag; - var isUniversal = isNodeType.bind(null, _types.UNIVERSAL); - exports.isUniversal = isUniversal; - function isPseudoElement2(node) { - return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value.toLowerCase() === ":before" || node.value.toLowerCase() === ":after" || node.value.toLowerCase() === ":first-letter" || node.value.toLowerCase() === ":first-line"); - } - function isPseudoClass(node) { - return isPseudo(node) && !isPseudoElement2(node); - } - function isContainer(node) { - return !!(isNode(node) && node.walk); - } - function isNamespace(node) { - return isAttribute(node) || isTag(node); - } - } - }); - - // node_modules/postcss-selector-parser/dist/selectors/index.js - var require_selectors = __commonJS({ - "node_modules/postcss-selector-parser/dist/selectors/index.js"(exports) { - "use strict"; - exports.__esModule = true; - var _types = require_types(); - Object.keys(_types).forEach(function(key) { - if (key === "default" || key === "__esModule") - return; - if (key in exports && exports[key] === _types[key]) - return; - exports[key] = _types[key]; - }); - var _constructors = require_constructors(); - Object.keys(_constructors).forEach(function(key) { - if (key === "default" || key === "__esModule") - return; - if (key in exports && exports[key] === _constructors[key]) - return; - exports[key] = _constructors[key]; - }); - var _guards = require_guards(); - Object.keys(_guards).forEach(function(key) { - if (key === "default" || key === "__esModule") - return; - if (key in exports && exports[key] === _guards[key]) - return; - exports[key] = _guards[key]; - }); - } - }); - - // node_modules/postcss-selector-parser/dist/index.js - var require_dist = __commonJS({ - "node_modules/postcss-selector-parser/dist/index.js"(exports, module) { - "use strict"; - exports.__esModule = true; - exports["default"] = void 0; - var _processor = _interopRequireDefault(require_processor2()); - var selectors = _interopRequireWildcard(require_selectors()); - function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") - return null; - var cacheBabelInterop = /* @__PURE__ */ new WeakMap(); - var cacheNodeInterop = /* @__PURE__ */ new WeakMap(); - return (_getRequireWildcardCache = function _getRequireWildcardCache2(nodeInterop2) { - return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - function _interopRequireWildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) { - return obj; - } - if (obj === null || typeof obj !== "object" && typeof obj !== "function") { - return { "default": obj }; - } - var cache2 = _getRequireWildcardCache(nodeInterop); - if (cache2 && cache2.has(obj)) { - return cache2.get(obj); - } - var newObj = {}; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } - } - } - newObj["default"] = obj; - if (cache2) { - cache2.set(obj, newObj); - } - return newObj; - } - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var parser5 = function parser6(processor) { - return new _processor["default"](processor); - }; - Object.assign(parser5, selectors); - delete parser5.__esModule; - var _default = parser5; - exports["default"] = _default; - module.exports = exports.default; - } - }); - - // node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/postcss-nested/index.js - var require_postcss_nested = __commonJS({ - "node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/postcss-nested/index.js"(exports, module) { - var parser5 = require_dist(); - function parse3(str, rule2) { - let nodes; - let saver = parser5((parsed) => { - nodes = parsed; - }); - try { - saver.processSync(str); - } catch (e) { - if (str.includes(":")) { - throw rule2 ? rule2.error("Missed semicolon") : e; - } else { - throw rule2 ? rule2.error(e.message) : e; - } - } - return nodes.at(0); - } - function replace(nodes, parent) { - let replaced = false; - nodes.each((i) => { - if (i.type === "nesting") { - let clonedParent = parent.clone(); - if (i.value !== "&") { - i.replaceWith(parse3(i.value.replace("&", clonedParent.toString()))); - } else { - i.replaceWith(clonedParent); - } - replaced = true; - } else if (i.nodes) { - if (replace(i, parent)) { - replaced = true; - } - } - }); - return replaced; - } - function selectors(parent, child) { - let result = []; - parent.selectors.forEach((i) => { - let parentNode = parse3(i, parent); - child.selectors.forEach((j) => { - if (j.length) { - let node = parse3(j, child); - let replaced = replace(node, parentNode); - if (!replaced) { - node.prepend(parser5.combinator({ value: " " })); - node.prepend(parentNode.clone()); - } - result.push(node.toString()); - } - }); - }); - return result; - } - function pickComment(comment2, after) { - if (comment2 && comment2.type === "comment") { - after.after(comment2); - return comment2; - } else { - return after; - } - } - function createFnAtruleChilds(bubble) { - return function atruleChilds(rule2, atrule, bubbling) { - let children2 = []; - atrule.each((child) => { - if (child.type === "comment") { - children2.push(child); - } else if (child.type === "decl") { - children2.push(child); - } else if (child.type === "rule" && bubbling) { - child.selectors = selectors(rule2, child); - } else if (child.type === "atrule") { - if (child.nodes && bubble[child.name]) { - atruleChilds(rule2, child, true); - } else { - children2.push(child); - } - } - }); - if (bubbling) { - if (children2.length) { - let clone = rule2.clone({ nodes: [] }); - for (let child of children2) { - clone.append(child); - } - atrule.prepend(clone); - } - } - }; - } - function pickDeclarations(selector, declarations, after, Rule2) { - let parent = new Rule2({ - selector, - nodes: [] - }); - for (let declaration of declarations) { - parent.append(declaration); - } - after.after(parent); - return parent; - } - function atruleNames(defaults3, custom) { - let list3 = {}; - for (let i of defaults3) { - list3[i] = true; - } - if (custom) { - for (let i of custom) { - let name = i.replace(/^@/, ""); - list3[name] = true; - } - } - return list3; - } - module.exports = (opts = {}) => { - let bubble = atruleNames(["media", "supports"], opts.bubble); - let atruleChilds = createFnAtruleChilds(bubble); - let unwrap = atruleNames( - [ - "document", - "font-face", - "keyframes", - "-webkit-keyframes", - "-moz-keyframes" - ], - opts.unwrap - ); - let preserveEmpty = opts.preserveEmpty; - return { - postcssPlugin: "postcss-nested", - Rule(rule2, { Rule: Rule2 }) { - let unwrapped = false; - let after = rule2; - let copyDeclarations = false; - let declarations = []; - rule2.each((child) => { - if (child.type === "rule") { - if (declarations.length) { - after = pickDeclarations(rule2.selector, declarations, after, Rule2); - declarations = []; - } - copyDeclarations = true; - unwrapped = true; - child.selectors = selectors(rule2, child); - after = pickComment(child.prev(), after); - after.after(child); - after = child; - } else if (child.type === "atrule") { - if (declarations.length) { - after = pickDeclarations(rule2.selector, declarations, after, Rule2); - declarations = []; - } - if (child.name === "at-root") { - unwrapped = true; - atruleChilds(rule2, child, false); - let nodes = child.nodes; - if (child.params) { - nodes = new Rule2({ selector: child.params, nodes }); - } - after.after(nodes); - after = nodes; - child.remove(); - } else if (bubble[child.name]) { - copyDeclarations = true; - unwrapped = true; - atruleChilds(rule2, child, true); - after = pickComment(child.prev(), after); - after.after(child); - after = child; - } else if (unwrap[child.name]) { - copyDeclarations = true; - unwrapped = true; - atruleChilds(rule2, child, false); - after = pickComment(child.prev(), after); - after.after(child); - after = child; - } else if (copyDeclarations) { - declarations.push(child); - } - } else if (child.type === "decl" && copyDeclarations) { - declarations.push(child); - } - }); - if (declarations.length) { - after = pickDeclarations(rule2.selector, declarations, after, Rule2); - } - if (unwrapped && preserveEmpty !== true) { - rule2.raws.semicolon = true; - if (rule2.nodes.length === 0) - rule2.remove(); - } - } - }; - }; - module.exports.postcss = true; - } - }); - - // node_modules/camelcase-css/index-es5.js - var require_index_es5 = __commonJS({ - "node_modules/camelcase-css/index-es5.js"(exports, module) { - "use strict"; - var pattern2 = /-(\w|$)/g; - var callback = function callback2(dashChar, char) { - return char.toUpperCase(); - }; - var camelCaseCSS = function camelCaseCSS2(property) { - property = property.toLowerCase(); - if (property === "float") { - return "cssFloat"; - } else if (property.charCodeAt(0) === 45 && property.charCodeAt(1) === 109 && property.charCodeAt(2) === 115 && property.charCodeAt(3) === 45) { - return property.substr(1).replace(pattern2, callback); - } else { - return property.replace(pattern2, callback); - } - }; - module.exports = camelCaseCSS; - } - }); - - // node_modules/postcss-js/objectifier.js - var require_objectifier = __commonJS({ - "node_modules/postcss-js/objectifier.js"(exports, module) { - var camelcase = require_index_es5(); - var UNITLESS = { - boxFlex: true, - boxFlexGroup: true, - columnCount: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - fillOpacity: true, - strokeDashoffset: true, - strokeOpacity: true, - strokeWidth: true - }; - function atRule2(node) { - if (typeof node.nodes === "undefined") { - return true; - } else { - return process2(node); - } - } - function process2(node) { - let name; - let result = {}; - node.each((child) => { - if (child.type === "atrule") { - name = "@" + child.name; - if (child.params) - name += " " + child.params; - if (typeof result[name] === "undefined") { - result[name] = atRule2(child); - } else if (Array.isArray(result[name])) { - result[name].push(atRule2(child)); - } else { - result[name] = [result[name], atRule2(child)]; - } - } else if (child.type === "rule") { - let body = process2(child); - if (result[child.selector]) { - for (let i in body) { - result[child.selector][i] = body[i]; - } - } else { - result[child.selector] = body; - } - } else if (child.type === "decl") { - if (child.prop[0] === "-" && child.prop[1] === "-") { - name = child.prop; - } else if (child.parent && child.parent.selector === ":export") { - name = child.prop; - } else { - name = camelcase(child.prop); - } - let value2 = child.value; - if (!isNaN(child.value) && UNITLESS[name]) { - value2 = parseFloat(child.value); - } - if (child.important) - value2 += " !important"; - if (typeof result[name] === "undefined") { - result[name] = value2; - } else if (Array.isArray(result[name])) { - result[name].push(value2); - } else { - result[name] = [result[name], value2]; - } - } - }); - return result; - } - module.exports = process2; - } - }); - - // node_modules/postcss-js/parser.js - var require_parser3 = __commonJS({ - "node_modules/postcss-js/parser.js"(exports, module) { - var postcss2 = require_postcss(); - var IMPORTANT = /\s*!important\s*$/i; - var UNITLESS = { - "box-flex": true, - "box-flex-group": true, - "column-count": true, - "flex": true, - "flex-grow": true, - "flex-positive": true, - "flex-shrink": true, - "flex-negative": true, - "font-weight": true, - "line-clamp": true, - "line-height": true, - "opacity": true, - "order": true, - "orphans": true, - "tab-size": true, - "widows": true, - "z-index": true, - "zoom": true, - "fill-opacity": true, - "stroke-dashoffset": true, - "stroke-opacity": true, - "stroke-width": true - }; - function dashify(str) { - return str.replace(/([A-Z])/g, "-$1").replace(/^ms-/, "-ms-").toLowerCase(); - } - function decl2(parent, name, value2) { - if (value2 === false || value2 === null) - return; - if (!name.startsWith("--")) { - name = dashify(name); - } - if (typeof value2 === "number") { - if (value2 === 0 || UNITLESS[name]) { - value2 = value2.toString(); - } else { - value2 += "px"; - } - } - if (name === "css-float") - name = "float"; - if (IMPORTANT.test(value2)) { - value2 = value2.replace(IMPORTANT, ""); - parent.push(postcss2.decl({ prop: name, value: value2, important: true })); - } else { - parent.push(postcss2.decl({ prop: name, value: value2 })); - } - } - function atRule2(parent, parts, value2) { - let node = postcss2.atRule({ name: parts[1], params: parts[3] || "" }); - if (typeof value2 === "object") { - node.nodes = []; - parse3(value2, node); - } - parent.push(node); - } - function parse3(obj, parent) { - let name, value2, node; - for (name in obj) { - value2 = obj[name]; - if (value2 === null || typeof value2 === "undefined") { - continue; - } else if (name[0] === "@") { - let parts = name.match(/@(\S+)(\s+([\W\w]*)\s*)?/); - if (Array.isArray(value2)) { - for (let i of value2) { - atRule2(parent, parts, i); - } - } else { - atRule2(parent, parts, value2); - } - } else if (Array.isArray(value2)) { - for (let i of value2) { - decl2(parent, name, i); - } - } else if (typeof value2 === "object") { - node = postcss2.rule({ selector: name }); - parse3(value2, node); - parent.push(node); - } else { - decl2(parent, name, value2); - } - } - } - module.exports = function(obj) { - let root2 = postcss2.root(); - parse3(obj, root2); - return root2; - }; - } - }); - - // node_modules/postcss-js/process-result.js - var require_process_result = __commonJS({ - "node_modules/postcss-js/process-result.js"(exports, module) { - var objectify2 = require_objectifier(); - module.exports = function processResult(result) { - if (console && console.warn) { - result.warnings().forEach((warn2) => { - let source = warn2.plugin || "PostCSS"; - console.warn(source + ": " + warn2.text); - }); - } - return objectify2(result.root); - }; - } - }); - - // node_modules/postcss-js/async.js - var require_async = __commonJS({ - "node_modules/postcss-js/async.js"(exports, module) { - var postcss2 = require_postcss(); - var processResult = require_process_result(); - var parse3 = require_parser3(); - module.exports = function async2(plugins) { - let processor = postcss2(plugins); - return async (input) => { - let result = await processor.process(input, { - parser: parse3, - from: void 0 - }); - return processResult(result); - }; - }; - } - }); - - // node_modules/postcss-js/sync.js - var require_sync = __commonJS({ - "node_modules/postcss-js/sync.js"(exports, module) { - var postcss2 = require_postcss(); - var processResult = require_process_result(); - var parse3 = require_parser3(); - module.exports = function(plugins) { - let processor = postcss2(plugins); - return (input) => { - let result = processor.process(input, { parser: parse3, from: void 0 }); - return processResult(result); - }; - }; - } - }); - - // node_modules/postcss-js/index.js - var require_postcss_js = __commonJS({ - "node_modules/postcss-js/index.js"(exports, module) { - var objectify2 = require_objectifier(); - var parse3 = require_parser3(); - var async2 = require_async(); - var sync2 = require_sync(); - module.exports = { - objectify: objectify2, - parse: parse3, - async: async2, - sync: sync2 - }; - } - }); - - // node_modules/dlv/dist/dlv.umd.js - var require_dlv_umd = __commonJS({ - "node_modules/dlv/dist/dlv.umd.js"(exports, module) { - !function(t, n) { - "object" == typeof exports && "undefined" != typeof module ? module.exports = function(t2, n2, e, i, o) { - for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) - t2 = t2 ? t2[n2[i]] : o; - return t2 === o ? e : t2; - } : "function" == typeof define && define.amd ? define(function() { - return function(t2, n2, e, i, o) { - for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) - t2 = t2 ? t2[n2[i]] : o; - return t2 === o ? e : t2; - }; - }) : t.dlv = function(t2, n2, e, i, o) { - for (n2 = n2.split ? n2.split(".") : n2, i = 0; i < n2.length; i++) - t2 = t2 ? t2[n2[i]] : o; - return t2 === o ? e : t2; - }; - }(exports); - } - }); - - // node_modules/didyoumean/didYouMean-1.2.1.js - var require_didYouMean_1_2_1 = __commonJS({ - "node_modules/didyoumean/didYouMean-1.2.1.js"(exports, module) { - (function() { - "use strict"; - function didYouMean2(str, list3, key) { - if (!str) - return null; - if (!didYouMean2.caseSensitive) { - str = str.toLowerCase(); - } - var thresholdRelative = didYouMean2.threshold === null ? null : didYouMean2.threshold * str.length, thresholdAbsolute = didYouMean2.thresholdAbsolute, winningVal; - if (thresholdRelative !== null && thresholdAbsolute !== null) - winningVal = Math.min(thresholdRelative, thresholdAbsolute); - else if (thresholdRelative !== null) - winningVal = thresholdRelative; - else if (thresholdAbsolute !== null) - winningVal = thresholdAbsolute; - else - winningVal = null; - var winner, candidate, testCandidate, val, i, len = list3.length; - for (i = 0; i < len; i++) { - candidate = list3[i]; - if (key) { - candidate = candidate[key]; - } - if (!candidate) { - continue; - } - if (!didYouMean2.caseSensitive) { - testCandidate = candidate.toLowerCase(); - } else { - testCandidate = candidate; - } - val = getEditDistance(str, testCandidate, winningVal); - if (winningVal === null || val < winningVal) { - winningVal = val; - if (key && didYouMean2.returnWinningObject) - winner = list3[i]; - else - winner = candidate; - if (didYouMean2.returnFirstMatch) - return winner; - } - } - return winner || didYouMean2.nullResultValue; - } - didYouMean2.threshold = 0.4; - didYouMean2.thresholdAbsolute = 20; - didYouMean2.caseSensitive = false; - didYouMean2.nullResultValue = null; - didYouMean2.returnWinningObject = null; - didYouMean2.returnFirstMatch = false; - if (typeof module !== "undefined" && module.exports) { - module.exports = didYouMean2; - } else { - window.didYouMean = didYouMean2; - } - var MAX_INT = Math.pow(2, 32) - 1; - function getEditDistance(a, b, max2) { - max2 = max2 || max2 === 0 ? max2 : MAX_INT; - var lena = a.length; - var lenb = b.length; - if (lena === 0) - return Math.min(max2 + 1, lenb); - if (lenb === 0) - return Math.min(max2 + 1, lena); - if (Math.abs(lena - lenb) > max2) - return max2 + 1; - var matrix = [], i, j, colMin, minJ, maxJ; - for (i = 0; i <= lenb; i++) { - matrix[i] = [i]; - } - for (j = 0; j <= lena; j++) { - matrix[0][j] = j; - } - for (i = 1; i <= lenb; i++) { - colMin = MAX_INT; - minJ = 1; - if (i > max2) - minJ = i - max2; - maxJ = lenb + 1; - if (maxJ > max2 + i) - maxJ = max2 + i; - for (j = 1; j <= lena; j++) { - if (j < minJ || j > maxJ) { - matrix[i][j] = max2 + 1; - } else { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min( - matrix[i - 1][j - 1] + 1, - // Substitute - Math.min( - matrix[i][j - 1] + 1, - // Insert - matrix[i - 1][j] + 1 - ) - ); - } - } - if (matrix[i][j] < colMin) - colMin = matrix[i][j]; - } - if (colMin > max2) - return max2 + 1; - } - return matrix[lenb][lena]; - } - })(); - } - }); - - // js/beacon_live_admin.js - var import_topbar = __toESM(require_topbar()); - - // ../deps/live_monaco_editor/priv/static/live_monaco_editor.esm.js - function _defineProperty(obj, key, value2) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value2, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value2; - } - return obj; - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - return target; - } - function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) - return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) - continue; - target[key] = source[key]; - } - return target; - } - function _objectWithoutProperties(source, excluded) { - if (source == null) - return {}; - var target = _objectWithoutPropertiesLoose(source, excluded); - var key, i; - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) - continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) - continue; - target[key] = source[key]; - } - } - return target; - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) - return; - var _arr = []; - var _n = true; - var _d = false; - var _e = void 0; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) - arr2[i] = arr[i]; - return arr2; - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _defineProperty2(obj, key, value2) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value2, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value2; - } - return obj; - } - function ownKeys2(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread22(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys2(Object(source), true).forEach(function(key) { - _defineProperty2(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys2(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - return target; - } - function compose() { - for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { - fns[_key] = arguments[_key]; - } - return function(x) { - return fns.reduceRight(function(y, f) { - return f(y); - }, x); - }; - } - function curry(fn) { - return function curried() { - var _this = this; - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return args.length >= fn.length ? fn.apply(this, args) : function() { - for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - nextArgs[_key3] = arguments[_key3]; - } - return curried.apply(_this, [].concat(args, nextArgs)); - }; - }; - } - function isObject(value2) { - return {}.toString.call(value2).includes("Object"); - } - function isEmpty(obj) { - return !Object.keys(obj).length; - } - function isFunction(value2) { - return typeof value2 === "function"; - } - function hasOwnProperty(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - } - function validateChanges(initial, changes) { - if (!isObject(changes)) - errorHandler("changeType"); - if (Object.keys(changes).some(function(field) { - return !hasOwnProperty(initial, field); - })) - errorHandler("changeField"); - return changes; - } - function validateSelector(selector) { - if (!isFunction(selector)) - errorHandler("selectorType"); - } - function validateHandler(handler) { - if (!(isFunction(handler) || isObject(handler))) - errorHandler("handlerType"); - if (isObject(handler) && Object.values(handler).some(function(_handler) { - return !isFunction(_handler); - })) - errorHandler("handlersType"); - } - function validateInitial(initial) { - if (!initial) - errorHandler("initialIsRequired"); - if (!isObject(initial)) - errorHandler("initialType"); - if (isEmpty(initial)) - errorHandler("initialContent"); - } - function throwError(errorMessages32, type) { - throw new Error(errorMessages32[type] || errorMessages32["default"]); - } - var errorMessages = { - initialIsRequired: "initial state is required", - initialType: "initial state should be an object", - initialContent: "initial state shouldn't be an empty object", - handlerType: "handler should be an object or a function", - handlersType: "all handlers should be a functions", - selectorType: "selector should be a function", - changeType: "provided value of changes should be an object", - changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state', - "default": "an unknown error accured in `state-local` package" - }; - var errorHandler = curry(throwError)(errorMessages); - var validators = { - changes: validateChanges, - selector: validateSelector, - handler: validateHandler, - initial: validateInitial - }; - function create(initial) { - var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - validators.initial(initial); - validators.handler(handler); - var state = { - current: initial - }; - var didUpdate = curry(didStateUpdate)(state, handler); - var update2 = curry(updateState)(state); - var validate = curry(validators.changes)(initial); - var getChanges = curry(extractChanges)(state); - function getState22() { - var selector = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) { - return state2; - }; - validators.selector(selector); - return selector(state.current); - } - function setState22(causedChanges) { - compose(didUpdate, update2, validate, getChanges)(causedChanges); - } - return [getState22, setState22]; - } - function extractChanges(state, causedChanges) { - return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges; - } - function updateState(state, changes) { - state.current = _objectSpread22(_objectSpread22({}, state.current), changes); - return changes; - } - function didStateUpdate(state, handler, changes) { - isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function(field) { - var _handler$field; - return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]); - }); - return changes; - } - var index = { - create - }; - var state_local_default = index; - var config = { - paths: { - vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs" - } - }; - var config_default = config; - function curry2(fn) { - return function curried() { - var _this = this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.length >= fn.length ? fn.apply(this, args) : function() { - for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - nextArgs[_key2] = arguments[_key2]; - } - return curried.apply(_this, [].concat(args, nextArgs)); - }; - }; - } - var curry_default = curry2; - function isObject2(value2) { - return {}.toString.call(value2).includes("Object"); - } - var isObject_default = isObject2; - function validateConfig(config32) { - if (!config32) - errorHandler2("configIsRequired"); - if (!isObject_default(config32)) - errorHandler2("configType"); - if (config32.urls) { - informAboutDeprecation(); - return { - paths: { - vs: config32.urls.monacoBase - } - }; - } - return config32; - } - function informAboutDeprecation() { - console.warn(errorMessages2.deprecation); - } - function throwError2(errorMessages32, type) { - throw new Error(errorMessages32[type] || errorMessages32["default"]); - } - var errorMessages2 = { - configIsRequired: "the configuration object is required", - configType: "the configuration object should be an object", - "default": "an unknown error accured in `@monaco-editor/loader` package", - deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n " - }; - var errorHandler2 = curry_default(throwError2)(errorMessages2); - var validators2 = { - config: validateConfig - }; - var validators_default = validators2; - var compose2 = function compose3() { - for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { - fns[_key] = arguments[_key]; - } - return function(x) { - return fns.reduceRight(function(y, f) { - return f(y); - }, x); - }; - }; - var compose_default = compose2; - function merge(target, source) { - Object.keys(source).forEach(function(key) { - if (source[key] instanceof Object) { - if (target[key]) { - Object.assign(source[key], merge(target[key], source[key])); - } - } - }); - return _objectSpread2(_objectSpread2({}, target), source); - } - var deepMerge_default = merge; - var CANCELATION_MESSAGE = { - type: "cancelation", - msg: "operation is manually canceled" - }; - function makeCancelable(promise2) { - var hasCanceled_ = false; - var wrappedPromise = new Promise(function(resolve, reject) { - promise2.then(function(val) { - return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val); - }); - promise2["catch"](reject); - }); - return wrappedPromise.cancel = function() { - return hasCanceled_ = true; - }, wrappedPromise; - } - var makeCancelable_default = makeCancelable; - var _state$create = state_local_default.create({ - config: config_default, - isInitialized: false, - resolve: null, - reject: null, - monaco: null - }); - var _state$create2 = _slicedToArray(_state$create, 2); - var getState = _state$create2[0]; - var setState = _state$create2[1]; - function config2(globalConfig) { - var _validators$config = validators_default.config(globalConfig), monaco = _validators$config.monaco, config32 = _objectWithoutProperties(_validators$config, ["monaco"]); - setState(function(state) { - return { - config: deepMerge_default(state.config, config32), - monaco - }; - }); - } - function init() { - var state = getState(function(_ref) { - var monaco = _ref.monaco, isInitialized = _ref.isInitialized, resolve = _ref.resolve; - return { - monaco, - isInitialized, - resolve - }; - }); - if (!state.isInitialized) { - setState({ - isInitialized: true - }); - if (state.monaco) { - state.resolve(state.monaco); - return makeCancelable_default(wrapperPromise); - } - if (window.monaco && window.monaco.editor) { - storeMonacoInstance(window.monaco); - state.resolve(window.monaco); - return makeCancelable_default(wrapperPromise); - } - compose_default(injectScripts, getMonacoLoaderScript)(configureLoader); - } - return makeCancelable_default(wrapperPromise); - } - function injectScripts(script) { - return document.body.appendChild(script); - } - function createScript(src) { - var script = document.createElement("script"); - return src && (script.src = src), script; - } - function getMonacoLoaderScript(configureLoader22) { - var state = getState(function(_ref2) { - var config32 = _ref2.config, reject = _ref2.reject; - return { - config: config32, - reject - }; - }); - var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js")); - loaderScript.onload = function() { - return configureLoader22(); - }; - loaderScript.onerror = state.reject; - return loaderScript; - } - function configureLoader() { - var state = getState(function(_ref3) { - var config32 = _ref3.config, resolve = _ref3.resolve, reject = _ref3.reject; - return { - config: config32, - resolve, - reject - }; - }); - var require2 = window.require; - require2.config(state.config); - require2(["vs/editor/editor.main"], function(monaco) { - storeMonacoInstance(monaco); - state.resolve(monaco); - }, function(error) { - state.reject(error); - }); - } - function storeMonacoInstance(monaco) { - if (!getState().monaco) { - setState({ - monaco - }); - } - } - function __getMonacoInstance() { - return getState(function(_ref4) { - var monaco = _ref4.monaco; - return monaco; - }); - } - var wrapperPromise = new Promise(function(resolve, reject) { - return setState({ - resolve, - reject - }); - }); - var loader = { - config: config2, - init, - __getMonacoInstance - }; - var loader_default = loader; - var colors = { - background: "#282c34", - default: "#c4cad6", - lightRed: "#e06c75", - blue: "#61afef", - gray: "#8c92a3", - green: "#98c379", - purple: "#c678dd", - red: "#be5046", - teal: "#56b6c2", - peach: "#d19a66" - }; - var rules = (colors2) => [ - { token: "", foreground: colors2.default }, - { token: "variable", foreground: colors2.lightRed }, - { token: "constant", foreground: colors2.blue }, - { token: "constant.character.escape", foreground: colors2.blue }, - { token: "comment", foreground: colors2.gray }, - { token: "number", foreground: colors2.blue }, - { token: "regexp", foreground: colors2.lightRed }, - { token: "type", foreground: colors2.lightRed }, - { token: "string", foreground: colors2.green }, - { token: "keyword", foreground: colors2.purple }, - { token: "operator", foreground: colors2.peach }, - { token: "delimiter.bracket.embed", foreground: colors2.red }, - { token: "sigil", foreground: colors2.teal }, - { token: "function", foreground: colors2.blue }, - { token: "function.call", foreground: colors2.default }, - // Markdown specific - { token: "emphasis", fontStyle: "italic" }, - { token: "strong", fontStyle: "bold" }, - { token: "keyword.md", foreground: colors2.lightRed }, - { token: "keyword.table", foreground: colors2.lightRed }, - { token: "string.link.md", foreground: colors2.blue }, - { token: "variable.md", foreground: colors2.teal }, - { token: "string.md", foreground: colors2.default }, - { token: "variable.source.md", foreground: colors2.default }, - // XML specific - { token: "tag", foreground: colors2.lightRed }, - { token: "metatag", foreground: colors2.lightRed }, - { token: "attribute.name", foreground: colors2.peach }, - { token: "attribute.value", foreground: colors2.green }, - // JSON specific - { token: "string.key", foreground: colors2.lightRed }, - { token: "keyword.json", foreground: colors2.blue }, - // SQL specific - { token: "operator.sql", foreground: colors2.purple } - ]; - var theme = { - base: "vs-dark", - inherit: false, - rules: rules(colors), - colors: { - "editor.background": colors.background, - "editor.foreground": colors.default, - "editorLineNumber.foreground": "#636d83", - "editorCursor.foreground": "#636d83", - "editor.selectionBackground": "#3e4451", - "editor.findMatchHighlightBackground": "#528bff3d", - "editorSuggestWidget.background": "#21252b", - "editorSuggestWidget.border": "#181a1f", - "editorSuggestWidget.selectedBackground": "#2c313a", - "input.background": "#1b1d23", - "input.border": "#181a1f", - "editorBracketMatch.border": "#282c34", - "editorBracketMatch.background": "#3e4451" - } - }; - var CodeEditor = class { - constructor(el, path, value2, opts) { - this.el = el; - this.path = path; - this.value = value2; - this.opts = opts; - this.standalone_code_editor = null; - this._onMount = []; - } - isMounted() { - return !!this.standalone_code_editor; - } - mount() { - if (this.isMounted()) { - throw new Error("The monaco editor is already mounted"); - } - this._mountEditor(); - } - onMount(callback) { - this._onMount.push(callback); - } - dispose() { - if (this.isMounted()) { - const model = this.standalone_code_editor.getModel(); - if (model) { - model.dispose(); - } - this.standalone_code_editor.dispose(); - } - } - _mountEditor() { - this.opts.value = this.value; - loader_default.config({ - paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs" } - }); - loader_default.init().then((monaco) => { - monaco.editor.defineTheme("default", theme); - let modelUri = monaco.Uri.parse(this.path); - let language = this.opts.language; - let model = monaco.editor.createModel(this.value, language, modelUri); - this.opts.language = void 0; - this.opts.model = model; - this.standalone_code_editor = monaco.editor.create(this.el, this.opts); - this._onMount.forEach((callback) => callback(monaco)); - this._setScreenDependantEditorOptions(); - this.standalone_code_editor.addAction({ - contextMenuGroupId: "word-wrapping", - id: "enable-word-wrapping", - label: "Enable word wrapping", - precondition: "config.editor.wordWrap == off", - keybindings: [monaco.KeyMod.Alt | monaco.KeyCode.KeyZ], - run: (editor) => editor.updateOptions({ wordWrap: "on" }) - }); - this.standalone_code_editor.addAction({ - contextMenuGroupId: "word-wrapping", - id: "disable-word-wrapping", - label: "Disable word wrapping", - precondition: "config.editor.wordWrap == on", - keybindings: [monaco.KeyMod.Alt | monaco.KeyCode.KeyZ], - run: (editor) => editor.updateOptions({ wordWrap: "off" }) - }); - const resizeObserver = new ResizeObserver((entries) => { - entries.forEach(() => { - if (this.el.offsetHeight > 0) { - this._setScreenDependantEditorOptions(); - this.standalone_code_editor.layout(); - } - }); - }); - resizeObserver.observe(this.el); - this.standalone_code_editor.onDidContentSizeChange(() => { - const contentHeight = this.standalone_code_editor.getContentHeight(); - this.el.style.height = `${contentHeight}px`; - }); - }); - } - _setScreenDependantEditorOptions() { - if (window.screen.width < 768) { - this.standalone_code_editor.updateOptions({ - folding: false, - lineDecorationsWidth: 16, - lineNumbersMinChars: Math.floor( - Math.log10(this.standalone_code_editor.getModel().getLineCount()) - ) + 3 - }); - } else { - this.standalone_code_editor.updateOptions({ - folding: true, - lineDecorationsWidth: 10, - lineNumbersMinChars: 5 - }); - } - } - }; - var code_editor_default = CodeEditor; - var CodeEditorHook = { - mounted() { - const opts = JSON.parse(this.el.dataset.opts); - this.codeEditor = new code_editor_default( - this.el, - this.el.dataset.path, - this.el.dataset.value, - opts - ); - this.codeEditor.onMount((monaco) => { - if (this.el.dataset.changeEvent && this.el.dataset.changeEvent !== "") { - this.codeEditor.standalone_code_editor.onDidChangeModelContent(() => { - if (this.el.dataset.target && this.el.dataset.target !== "") { - this.pushEventTo( - this.el.dataset.target, - this.el.dataset.changeEvent, - { - value: this.codeEditor.standalone_code_editor.getValue() - } - ); - } else { - this.pushEvent(this.el.dataset.changeEvent, { - value: this.codeEditor.standalone_code_editor.getValue() - }); - } - }); - } - this.handleEvent( - "lme:change_language:" + this.el.dataset.path, - (data) => { - const model = this.codeEditor.standalone_code_editor.getModel(); - if (model.getLanguageId() !== data.mimeTypeOrLanguageId) { - monaco.editor.setModelLanguage(model, data.mimeTypeOrLanguageId); - } - } - ); - this.handleEvent("lme:set_value:" + this.el.dataset.path, (data) => { - this.codeEditor.standalone_code_editor.setValue(data.value); - }); - this.el.querySelectorAll("textarea").forEach((textarea) => { - textarea.setAttribute( - "name", - "live_monaco_editor[" + this.el.dataset.path + "]" - ); - }); - this.el.removeAttribute("data-value"); - this.el.removeAttribute("data-opts"); - this.el.dispatchEvent( - new CustomEvent("lme:editor_mounted", { - detail: { hook: this, editor: this.codeEditor }, - bubbles: true - }) - ); - }); - if (!this.codeEditor.isMounted()) { - this.codeEditor.mount(); - } - }, - destroyed() { - if (this.codeEditor) { - this.codeEditor.dispose(); - } - } - }; - - // ../deps/live_svelte/priv/static/live_svelte.esm.js - function normalizeComponents(components) { - if (!Array.isArray(components.default) || !Array.isArray(components.filenames)) - return components; - const normalized = {}; - for (const [index4, module] of components.default.entries()) { - const Component = module.default; - const name = components.filenames[index4].replace("../svelte/", "").replace(".svelte", ""); - normalized[name] = Component; - } - return normalized; - } - function getAttributeJson(ref, attributeName) { - const data = ref.el.getAttribute(attributeName); - return data ? JSON.parse(data) : {}; - } - function detach(node) { - node.parentNode?.removeChild(node); - } - function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); - } - function noop() { - } - function getSlots(ref) { - const slots = {}; - for (const slotName in getAttributeJson(ref, "data-slots")) { - const slot = () => { - return { - getElement() { - const base64 = getAttributeJson(ref, "data-slots")[slotName]; - const element2 = document.createElement("div"); - element2.innerHTML = atob(base64).trim(); - return element2; - }, - update() { - detach(this.savedElement); - this.savedElement = this.getElement(); - insert(this.savedTarget, this.savedElement, this.savedAnchor); - }, - c: noop, - m(target, anchor) { - this.savedTarget = target; - this.savedAnchor = anchor; - this.savedElement = this.getElement(); - insert(this.savedTarget, this.savedElement, this.savedAnchor); - }, - d(detaching) { - if (detaching) - detach(this.savedElement); - }, - l: noop - }; - }; - slots[slotName] = [slot]; - } - return slots; - } - function getLiveJsonProps(ref) { - const json = getAttributeJson(ref, "data-live-json"); - if (!Array.isArray(json)) - return json; - const liveJsonData = {}; - for (const liveJsonVariable of json) { - const data = window[liveJsonVariable]; - if (data) - liveJsonData[liveJsonVariable] = data; - } - return liveJsonData; - } - function getProps(ref) { - return { - ...getAttributeJson(ref, "data-props"), - ...getLiveJsonProps(ref), - live: ref, - $$slots: getSlots(ref), - $$scope: {} - }; - } - function findSlotCtx(component) { - return component.$$.ctx.find((ctxElement) => ctxElement?.default); - } - function getHooks(components) { - components = normalizeComponents(components); - const SvelteHook = { - mounted() { - const componentName = this.el.getAttribute("data-name"); - if (!componentName) { - throw new Error("Component name must be provided"); - } - const Component = components[componentName]; - if (!Component) { - throw new Error(`Unable to find ${componentName} component.`); - } - for (const liveJsonElement of Object.keys(getAttributeJson(this, "data-live-json"))) { - window.addEventListener(`${liveJsonElement}_initialized`, (event) => this._instance.$set(getProps(this)), false); - window.addEventListener(`${liveJsonElement}_patched`, (event) => this._instance.$set(getProps(this)), false); - } - this._instance = new Component({ - target: this.el, - props: getProps(this), - hydrate: this.el.hasAttribute("data-ssr") - }); - }, - updated() { - this._instance.$set(getProps(this)); - const slotCtx = findSlotCtx(this._instance); - for (const key in slotCtx) { - slotCtx[key][0]().update(); - } - }, - destroyed() { - if (this._instance) { - window.addEventListener("phx:page-loading-stop", () => this._instance.$destroy(), { once: true }); - } - } - }; - return { - SvelteHook - }; - } - - // import-glob:../svelte/**/*.svelte - var __exports = {}; - __export(__exports, { - default: () => __default, - filenames: () => filenames - }); - - // svelte/components/Backdrop.svelte - var Backdrop_exports = {}; - __export(Backdrop_exports, { - backdropVisible: () => backdropVisible, - default: () => Backdrop_default - }); - - // node_modules/svelte/src/runtime/internal/utils.js - function noop2() { - } - var identity = (x) => x; - function assign(tar, src) { - for (const k in src) - tar[k] = src[k]; - return ( - /** @type {T & S} */ - tar - ); - } - function add_location(element2, file15, line, column, char) { - element2.__svelte_meta = { - loc: { file: file15, line, column, char } - }; - } - function run(fn) { - return fn(); - } - function blank_object() { - return /* @__PURE__ */ Object.create(null); - } - function run_all(fns) { - fns.forEach(run); - } - function is_function(thing) { - return typeof thing === "function"; - } - function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; - } - var src_url_equal_anchor; - function src_url_equal(element_src, url2) { - if (element_src === url2) - return true; - if (!src_url_equal_anchor) { - src_url_equal_anchor = document.createElement("a"); - } - src_url_equal_anchor.href = url2; - return element_src === src_url_equal_anchor.href; - } - function is_empty(obj) { - return Object.keys(obj).length === 0; - } - function validate_store(store, name) { - if (store != null && typeof store.subscribe !== "function") { - throw new Error(`'${name}' is not a store with a 'subscribe' method`); - } - } - function subscribe(store, ...callbacks) { - if (store == null) { - for (const callback of callbacks) { - callback(void 0); - } - return noop2; - } - const unsub = store.subscribe(...callbacks); - return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; - } - function get_store_value(store) { - let value2; - subscribe(store, (_) => value2 = _)(); - return value2; - } - function component_subscribe(component, store, callback) { - component.$$.on_destroy.push(subscribe(store, callback)); - } - function create_slot(definition, ctx, $$scope, fn) { - if (definition) { - const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); - return definition[0](slot_ctx); - } - } - function get_slot_context(definition, ctx, $$scope, fn) { - return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; - } - function get_slot_changes(definition, $$scope, dirty, fn) { - if (definition[2] && fn) { - const lets = definition[2](fn(dirty)); - if ($$scope.dirty === void 0) { - return lets; - } - if (typeof lets === "object") { - const merged = []; - const len = Math.max($$scope.dirty.length, lets.length); - for (let i = 0; i < len; i += 1) { - merged[i] = $$scope.dirty[i] | lets[i]; - } - return merged; - } - return $$scope.dirty | lets; - } - return $$scope.dirty; - } - function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) { - if (slot_changes) { - const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); - slot.p(slot_context, slot_changes); - } - } - function get_all_dirty_from_scope($$scope) { - if ($$scope.ctx.length > 32) { - const dirty = []; - const length2 = $$scope.ctx.length / 32; - for (let i = 0; i < length2; i++) { - dirty[i] = -1; - } - return dirty; - } - return -1; - } - function compute_slots(slots) { - const result = {}; - for (const key in slots) { - result[key] = true; - } - return result; - } - function set_store_value(store, ret, value2) { - store.set(value2); - return ret; - } - function action_destroyer(action_result) { - return action_result && is_function(action_result.destroy) ? action_result.destroy : noop2; - } - - // node_modules/svelte/src/runtime/internal/environment.js - var is_client = typeof window !== "undefined"; - var now = is_client ? () => window.performance.now() : () => Date.now(); - var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop2; - - // node_modules/svelte/src/runtime/internal/loop.js - var tasks = /* @__PURE__ */ new Set(); - function run_tasks(now2) { - tasks.forEach((task) => { - if (!task.c(now2)) { - tasks.delete(task); - task.f(); - } - }); - if (tasks.size !== 0) - raf(run_tasks); - } - function loop(callback) { - let task; - if (tasks.size === 0) - raf(run_tasks); - return { - promise: new Promise((fulfill) => { - tasks.add(task = { c: callback, f: fulfill }); - }), - abort() { - tasks.delete(task); - } - }; - } - - // node_modules/svelte/src/runtime/internal/globals.js - var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : ( - // @ts-ignore Node typings have this - global - ); - - // node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js - var ResizeObserverSingleton = class _ResizeObserverSingleton { - /** @param {ResizeObserverOptions} options */ - constructor(options) { - /** - * @private - * @readonly - * @type {WeakMap} - */ - __publicField(this, "_listeners", "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0); - /** - * @private - * @type {ResizeObserver} - */ - __publicField(this, "_observer"); - /** @type {ResizeObserverOptions} */ - __publicField(this, "options"); - this.options = options; - } - /** - * @param {Element} element - * @param {import('./private.js').Listener} listener - * @returns {() => void} - */ - observe(element2, listener) { - this._listeners.set(element2, listener); - this._getObserver().observe(element2, this.options); - return () => { - this._listeners.delete(element2); - this._observer.unobserve(element2); - }; - } - /** - * @private - */ - _getObserver() { - return this._observer ?? (this._observer = new ResizeObserver((entries) => { - for (const entry of entries) { - _ResizeObserverSingleton.entries.set(entry.target, entry); - this._listeners.get(entry.target)?.(entry); - } - })); - } - }; - ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0; - - // node_modules/svelte/src/runtime/internal/dom.js - var is_hydrating = false; - function start_hydrating() { - is_hydrating = true; - } - function end_hydrating() { - is_hydrating = false; - } - function upper_bound(low, high, key, value2) { - while (low < high) { - const mid = low + (high - low >> 1); - if (key(mid) <= value2) { - low = mid + 1; - } else { - high = mid; - } - } - return low; - } - function init_hydrate(target) { - if (target.hydrate_init) - return; - target.hydrate_init = true; - let children2 = ( - /** @type {ArrayLike} */ - target.childNodes - ); - if (target.nodeName === "HEAD") { - const my_children = []; - for (let i = 0; i < children2.length; i++) { - const node = children2[i]; - if (node.claim_order !== void 0) { - my_children.push(node); - } - } - children2 = my_children; - } - const m = new Int32Array(children2.length + 1); - const p = new Int32Array(children2.length); - m[0] = -1; - let longest = 0; - for (let i = 0; i < children2.length; i++) { - const current = children2[i].claim_order; - const seq_len = (longest > 0 && children2[m[longest]].claim_order <= current ? longest + 1 : upper_bound(1, longest, (idx) => children2[m[idx]].claim_order, current)) - 1; - p[i] = m[seq_len] + 1; - const new_len = seq_len + 1; - m[new_len] = i; - longest = Math.max(new_len, longest); - } - const lis = []; - const to_move = []; - let last = children2.length - 1; - for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) { - lis.push(children2[cur - 1]); - for (; last >= cur; last--) { - to_move.push(children2[last]); - } - last--; - } - for (; last >= 0; last--) { - to_move.push(children2[last]); - } - lis.reverse(); - to_move.sort((a, b) => a.claim_order - b.claim_order); - for (let i = 0, j = 0; i < to_move.length; i++) { - while (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) { - j++; - } - const anchor = j < lis.length ? lis[j] : null; - target.insertBefore(to_move[i], anchor); - } - } - function append(target, node) { - target.appendChild(node); - } - function append_styles(target, style_sheet_id, styles) { - const append_styles_to = get_root_for_style(target); - if (!append_styles_to.getElementById(style_sheet_id)) { - const style = element("style"); - style.id = style_sheet_id; - style.textContent = styles; - append_stylesheet(append_styles_to, style); - } - } - function get_root_for_style(node) { - if (!node) - return document; - const root2 = node.getRootNode ? node.getRootNode() : node.ownerDocument; - if (root2 && /** @type {ShadowRoot} */ - root2.host) { - return ( - /** @type {ShadowRoot} */ - root2 - ); - } - return node.ownerDocument; - } - function append_empty_stylesheet(node) { - const style_element = element("style"); - style_element.textContent = "/* empty */"; - append_stylesheet(get_root_for_style(node), style_element); - return style_element.sheet; - } - function append_stylesheet(node, style) { - append( - /** @type {Document} */ - node.head || node, - style - ); - return style.sheet; - } - function append_hydration(target, node) { - if (is_hydrating) { - init_hydrate(target); - if (target.actual_end_child === void 0 || target.actual_end_child !== null && target.actual_end_child.parentNode !== target) { - target.actual_end_child = target.firstChild; - } - while (target.actual_end_child !== null && target.actual_end_child.claim_order === void 0) { - target.actual_end_child = target.actual_end_child.nextSibling; - } - if (node !== target.actual_end_child) { - if (node.claim_order !== void 0 || node.parentNode !== target) { - target.insertBefore(node, target.actual_end_child); - } - } else { - target.actual_end_child = node.nextSibling; - } - } else if (node.parentNode !== target || node.nextSibling !== null) { - target.appendChild(node); - } - } - function insert2(target, node, anchor) { - target.insertBefore(node, anchor || null); - } - function insert_hydration(target, node, anchor) { - if (is_hydrating && !anchor) { - append_hydration(target, node); - } else if (node.parentNode !== target || node.nextSibling != anchor) { - target.insertBefore(node, anchor || null); - } - } - function detach2(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } - } - function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } - } - function element(name) { - return document.createElement(name); - } - function svg_element(name) { - return document.createElementNS("http://www.w3.org/2000/svg", name); - } - function text(data) { - return document.createTextNode(data); - } - function space() { - return text(" "); - } - function empty() { - return text(""); - } - function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); - } - function prevent_default(fn) { - return function(event) { - event.preventDefault(); - return fn.call(this, event); - }; - } - function stop_propagation(fn) { - return function(event) { - event.stopPropagation(); - return fn.call(this, event); - }; - } - function attr(node, attribute, value2) { - if (value2 == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value2) - node.setAttribute(attribute, value2); - } - var always_set_through_set_attribute = ["width", "height"]; - function set_attributes(node, attributes) { - const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); - for (const key in attributes) { - if (attributes[key] == null) { - node.removeAttribute(key); - } else if (key === "style") { - node.style.cssText = attributes[key]; - } else if (key === "__value") { - node.value = node[key] = attributes[key]; - } else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) { - node[key] = attributes[key]; - } else { - attr(node, key, attributes[key]); - } - } - } - function set_custom_element_data_map(node, data_map) { - Object.keys(data_map).forEach((key) => { - set_custom_element_data(node, key, data_map[key]); - }); - } - function set_custom_element_data(node, prop, value2) { - const lower = prop.toLowerCase(); - if (lower in node) { - node[lower] = typeof node[lower] === "boolean" && value2 === "" ? true : value2; - } else if (prop in node) { - node[prop] = typeof node[prop] === "boolean" && value2 === "" ? true : value2; - } else { - attr(node, prop, value2); - } - } - function set_dynamic_element_data(tag) { - return /-/.test(tag) ? set_custom_element_data_map : set_attributes; - } - function get_svelte_dataset(node) { - return node.dataset.svelteH; - } - function children(element2) { - return Array.from(element2.childNodes); - } - function init_claim_info(nodes) { - if (nodes.claim_info === void 0) { - nodes.claim_info = { last_index: 0, total_claimed: 0 }; - } - } - function claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) { - init_claim_info(nodes); - const result_node = (() => { - for (let i = nodes.claim_info.last_index; i < nodes.length; i++) { - const node = nodes[i]; - if (predicate(node)) { - const replacement = process_node(node); - if (replacement === void 0) { - nodes.splice(i, 1); - } else { - nodes[i] = replacement; - } - if (!dont_update_last_index) { - nodes.claim_info.last_index = i; - } - return node; - } - } - for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) { - const node = nodes[i]; - if (predicate(node)) { - const replacement = process_node(node); - if (replacement === void 0) { - nodes.splice(i, 1); - } else { - nodes[i] = replacement; - } - if (!dont_update_last_index) { - nodes.claim_info.last_index = i; - } else if (replacement === void 0) { - nodes.claim_info.last_index--; - } - return node; - } - } - return create_node(); - })(); - result_node.claim_order = nodes.claim_info.total_claimed; - nodes.claim_info.total_claimed += 1; - return result_node; - } - function claim_element_base(nodes, name, attributes, create_element) { - return claim_node( - nodes, - /** @returns {node is Element | SVGElement} */ - (node) => node.nodeName === name, - /** @param {Element} node */ - (node) => { - const remove = []; - for (let j = 0; j < node.attributes.length; j++) { - const attribute = node.attributes[j]; - if (!attributes[attribute.name]) { - remove.push(attribute.name); - } - } - remove.forEach((v) => node.removeAttribute(v)); - return void 0; - }, - () => create_element(name) - ); - } - function claim_element(nodes, name, attributes) { - return claim_element_base(nodes, name, attributes, element); - } - function claim_svg_element(nodes, name, attributes) { - return claim_element_base(nodes, name, attributes, svg_element); - } - function claim_text(nodes, data) { - return claim_node( - nodes, - /** @returns {node is Text} */ - (node) => node.nodeType === 3, - /** @param {Text} node */ - (node) => { - const data_str = "" + data; - if (node.data.startsWith(data_str)) { - if (node.data.length !== data_str.length) { - return node.splitText(data_str.length); - } - } else { - node.data = data_str; - } - }, - () => text(data), - true - // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements - ); - } - function claim_space(nodes) { - return claim_text(nodes, " "); - } - function get_comment_idx(nodes, text2, start) { - for (let i = start; i < nodes.length; i += 1) { - const node = nodes[i]; - if (node.nodeType === 8 && node.textContent.trim() === text2) { - return i; - } - } - return -1; - } - function claim_html_tag(nodes, is_svg) { - const start_index = get_comment_idx(nodes, "HTML_TAG_START", 0); - const end_index = get_comment_idx(nodes, "HTML_TAG_END", start_index + 1); - if (start_index === -1 || end_index === -1) { - return new HtmlTagHydration(is_svg); - } - init_claim_info(nodes); - const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1); - detach2(html_tag_nodes[0]); - detach2(html_tag_nodes[html_tag_nodes.length - 1]); - const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1); - if (claimed_nodes.length === 0) { - return new HtmlTagHydration(is_svg); - } - for (const n of claimed_nodes) { - n.claim_order = nodes.claim_info.total_claimed; - nodes.claim_info.total_claimed += 1; - } - return new HtmlTagHydration(is_svg, claimed_nodes); - } - function set_input_value(input, value2) { - input.value = value2 == null ? "" : value2; - } - function set_style(node, key, value2, important) { - if (value2 == null) { - node.style.removeProperty(key); - } else { - node.style.setProperty(key, value2, important ? "important" : ""); - } - } - function toggle_class(element2, name, toggle) { - element2.classList.toggle(name, !!toggle); - } - function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { - return new CustomEvent(type, { detail, bubbles, cancelable }); - } - var HtmlTag = class { - constructor(is_svg = false) { - /** - * @private - * @default false - */ - __publicField(this, "is_svg", false); - /** parent for creating node */ - __publicField(this, "e"); - /** html tag nodes */ - __publicField(this, "n"); - /** target */ - __publicField(this, "t"); - /** anchor */ - __publicField(this, "a"); - this.is_svg = is_svg; - this.e = this.n = null; - } - /** - * @param {string} html - * @returns {void} - */ - c(html) { - this.h(html); - } - /** - * @param {string} html - * @param {HTMLElement | SVGElement} target - * @param {HTMLElement | SVGElement} anchor - * @returns {void} - */ - m(html, target, anchor = null) { - if (!this.e) { - if (this.is_svg) - this.e = svg_element( - /** @type {keyof SVGElementTagNameMap} */ - target.nodeName - ); - else - this.e = element( - /** @type {keyof HTMLElementTagNameMap} */ - target.nodeType === 11 ? "TEMPLATE" : target.nodeName - ); - this.t = target.tagName !== "TEMPLATE" ? target : ( - /** @type {HTMLTemplateElement} */ - target.content - ); - this.c(html); - } - this.i(anchor); - } - /** - * @param {string} html - * @returns {void} - */ - h(html) { - this.e.innerHTML = html; - this.n = Array.from( - this.e.nodeName === "TEMPLATE" ? this.e.content.childNodes : this.e.childNodes - ); - } - /** - * @returns {void} */ - i(anchor) { - for (let i = 0; i < this.n.length; i += 1) { - insert2(this.t, this.n[i], anchor); - } - } - /** - * @param {string} html - * @returns {void} - */ - p(html) { - this.d(); - this.h(html); - this.i(this.a); - } - /** - * @returns {void} */ - d() { - this.n.forEach(detach2); - } - }; - var HtmlTagHydration = class extends HtmlTag { - constructor(is_svg = false, claimed_nodes) { - super(is_svg); - /** @type {Element[]} hydration claimed nodes */ - __publicField(this, "l"); - this.e = this.n = null; - this.l = claimed_nodes; - } - /** - * @param {string} html - * @returns {void} - */ - c(html) { - if (this.l) { - this.n = this.l; - } else { - super.c(html); - } - } - /** - * @returns {void} */ - i(anchor) { - for (let i = 0; i < this.n.length; i += 1) { - insert_hydration(this.t, this.n[i], anchor); - } - } - }; - function get_custom_elements_slots(element2) { - const result = {}; - element2.childNodes.forEach( - /** @param {Element} node */ - (node) => { - result[node.slot || "default"] = true; - } - ); - return result; - } - - // node_modules/svelte/src/runtime/internal/style_manager.js - var managed_styles = /* @__PURE__ */ new Map(); - var active = 0; - function hash(str) { - let hash2 = 5381; - let i = str.length; - while (i--) - hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i); - return hash2 >>> 0; - } - function create_style_information(doc, node) { - const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; - managed_styles.set(doc, info); - return info; - } - function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { - const step = 16.666 / duration; - let keyframes = "{\n"; - for (let p = 0; p <= 1; p += step) { - const t = a + (b - a) * ease(p); - keyframes += p * 100 + `%{${fn(t, 1 - t)}} -`; - } - const rule2 = keyframes + `100% {${fn(b, 1 - b)}} -}`; - const name = `__svelte_${hash(rule2)}_${uid}`; - const doc = get_root_for_style(node); - const { stylesheet, rules: rules2 } = managed_styles.get(doc) || create_style_information(doc, node); - if (!rules2[name]) { - rules2[name] = true; - stylesheet.insertRule(`@keyframes ${name} ${rule2}`, stylesheet.cssRules.length); - } - const animation = node.style.animation || ""; - node.style.animation = `${animation ? `${animation}, ` : ""}${name} ${duration}ms linear ${delay}ms 1 both`; - active += 1; - return name; - } - function delete_rule(node, name) { - const previous = (node.style.animation || "").split(", "); - const next = previous.filter( - name ? (anim) => anim.indexOf(name) < 0 : (anim) => anim.indexOf("__svelte") === -1 - // remove all Svelte animations - ); - const deleted = previous.length - next.length; - if (deleted) { - node.style.animation = next.join(", "); - active -= deleted; - if (!active) - clear_rules(); - } - } - function clear_rules() { - raf(() => { - if (active) - return; - managed_styles.forEach((info) => { - const { ownerNode } = info.stylesheet; - if (ownerNode) - detach2(ownerNode); - }); - managed_styles.clear(); - }); - } - - // node_modules/svelte/src/runtime/internal/lifecycle.js - var current_component; - function set_current_component(component) { - current_component = component; - } - function get_current_component() { - if (!current_component) - throw new Error("Function called outside component initialization"); - return current_component; - } - function onMount(fn) { - get_current_component().$$.on_mount.push(fn); - } - function onDestroy(fn) { - get_current_component().$$.on_destroy.push(fn); - } - function createEventDispatcher() { - const component = get_current_component(); - return (type, detail, { cancelable = false } = {}) => { - const callbacks = component.$$.callbacks[type]; - if (callbacks) { - const event = custom_event( - /** @type {string} */ - type, - detail, - { cancelable } - ); - callbacks.slice().forEach((fn) => { - fn.call(component, event); - }); - return !event.defaultPrevented; - } - return true; - }; - } - - // node_modules/svelte/src/runtime/internal/scheduler.js - var dirty_components = []; - var binding_callbacks = []; - var render_callbacks = []; - var flush_callbacks = []; - var resolved_promise = /* @__PURE__ */ Promise.resolve(); - var update_scheduled = false; - function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } - } - function tick() { - schedule_update(); - return resolved_promise; - } - function add_render_callback(fn) { - render_callbacks.push(fn); - } - var seen_callbacks = /* @__PURE__ */ new Set(); - var flushidx = 0; - function flush() { - if (flushidx !== 0) { - return; - } - const saved_component = current_component; - do { - try { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); - } - } catch (e) { - dirty_components.length = 0; - flushidx = 0; - throw e; - } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); - } - function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } - } - function flush_render_callbacks(fns) { - const filtered = []; - const targets = []; - render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); - targets.forEach((c) => c()); - render_callbacks = filtered; - } - - // node_modules/svelte/src/runtime/internal/transitions.js - var promise; - function wait() { - if (!promise) { - promise = Promise.resolve(); - promise.then(() => { - promise = null; - }); - } - return promise; - } - function dispatch(node, direction, kind) { - node.dispatchEvent(custom_event(`${direction ? "intro" : "outro"}${kind}`)); - } - var outroing = /* @__PURE__ */ new Set(); - var outros; - function group_outros() { - outros = { - r: 0, - c: [], - p: outros - // parent group - }; - } - function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; - } - function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } - } - function transition_out(block, local, detach3, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach3) - block.d(1); - callback(); - } - }); - block.o(local); - } else if (callback) { - callback(); - } - } - var null_transition = { duration: 0 }; - function create_bidirectional_transition(node, fn, params, intro) { - const options = { direction: "both" }; - let config5 = fn(node, params, options); - let t = intro ? 0 : 1; - let running_program = null; - let pending_program = null; - let animation_name = null; - let original_inert_value; - function clear_animation() { - if (animation_name) - delete_rule(node, animation_name); - } - function init4(program, duration) { - const d = ( - /** @type {Program['d']} */ - program.b - t - ); - duration *= Math.abs(d); - return { - a: t, - b: program.b, - d, - duration, - start: program.start, - end: program.start + duration, - group: program.group - }; - } - function go(b) { - const { - delay = 0, - duration = 300, - easing = identity, - tick: tick2 = noop2, - css - } = config5 || null_transition; - const program = { - start: now() + delay, - b - }; - if (!b) { - program.group = outros; - outros.r += 1; - } - if ("inert" in node) { - if (b) { - if (original_inert_value !== void 0) { - node.inert = original_inert_value; - } - } else { - original_inert_value = /** @type {HTMLElement} */ - node.inert; - node.inert = true; - } - } - if (running_program || pending_program) { - pending_program = program; - } else { - if (css) { - clear_animation(); - animation_name = create_rule(node, t, b, duration, delay, easing, css); - } - if (b) - tick2(0, 1); - running_program = init4(program, duration); - add_render_callback(() => dispatch(node, b, "start")); - loop((now2) => { - if (pending_program && now2 > pending_program.start) { - running_program = init4(pending_program, duration); - pending_program = null; - dispatch(node, running_program.b, "start"); - if (css) { - clear_animation(); - animation_name = create_rule( - node, - t, - running_program.b, - running_program.duration, - 0, - easing, - config5.css - ); - } - } - if (running_program) { - if (now2 >= running_program.end) { - tick2(t = running_program.b, 1 - t); - dispatch(node, running_program.b, "end"); - if (!pending_program) { - if (running_program.b) { - clear_animation(); - } else { - if (!--running_program.group.r) - run_all(running_program.group.c); - } - } - running_program = null; - } else if (now2 >= running_program.start) { - const p = now2 - running_program.start; - t = running_program.a + running_program.d * easing(p / running_program.duration); - tick2(t, 1 - t); - } - } - return !!(running_program || pending_program); - }); - } - } - return { - run(b) { - if (is_function(config5)) { - wait().then(() => { - const opts = { direction: b ? "in" : "out" }; - config5 = config5(opts); - go(b); - }); - } else { - go(b); - } - }, - end() { - clear_animation(); - running_program = pending_program = null; - } - }; - } - - // node_modules/svelte/src/runtime/internal/each.js - function ensure_array_like(array_like_or_iterator) { - return array_like_or_iterator?.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); - } - function destroy_block(block, lookup) { - block.d(1); - lookup.delete(block.key); - } - function outro_and_destroy_block(block, lookup) { - transition_out(block, 1, 1, () => { - lookup.delete(block.key); - }); - } - function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list3, lookup, node, destroy, create_each_block7, next, get_context) { - let o = old_blocks.length; - let n = list3.length; - let i = o; - const old_indexes = {}; - while (i--) - old_indexes[old_blocks[i].key] = i; - const new_blocks = []; - const new_lookup = /* @__PURE__ */ new Map(); - const deltas = /* @__PURE__ */ new Map(); - const updates = []; - i = n; - while (i--) { - const child_ctx = get_context(ctx, list3, i); - const key = get_key(child_ctx); - let block = lookup.get(key); - if (!block) { - block = create_each_block7(key, child_ctx); - block.c(); - } else if (dynamic) { - updates.push(() => block.p(child_ctx, dirty)); - } - new_lookup.set(key, new_blocks[i] = block); - if (key in old_indexes) - deltas.set(key, Math.abs(i - old_indexes[key])); - } - const will_move = /* @__PURE__ */ new Set(); - const did_move = /* @__PURE__ */ new Set(); - function insert3(block) { - transition_in(block, 1); - block.m(node, next); - lookup.set(block.key, block); - next = block.first; - n--; - } - while (o && n) { - const new_block = new_blocks[n - 1]; - const old_block = old_blocks[o - 1]; - const new_key = new_block.key; - const old_key = old_block.key; - if (new_block === old_block) { - next = new_block.first; - o--; - n--; - } else if (!new_lookup.has(old_key)) { - destroy(old_block, lookup); - o--; - } else if (!lookup.has(new_key) || will_move.has(new_key)) { - insert3(new_block); - } else if (did_move.has(old_key)) { - o--; - } else if (deltas.get(new_key) > deltas.get(old_key)) { - did_move.add(new_key); - insert3(new_block); - } else { - will_move.add(old_key); - o--; - } - } - while (o--) { - const old_block = old_blocks[o]; - if (!new_lookup.has(old_block.key)) - destroy(old_block, lookup); - } - while (n) - insert3(new_blocks[n - 1]); - run_all(updates); - return new_blocks; - } - function validate_each_keys(ctx, list3, get_context, get_key) { - const keys = /* @__PURE__ */ new Map(); - for (let i = 0; i < list3.length; i++) { - const key = get_key(get_context(ctx, list3, i)); - if (keys.has(key)) { - let value2 = ""; - try { - value2 = `with value '${String(key)}' `; - } catch (e) { - } - throw new Error( - `Cannot have duplicate keys in a keyed each: Keys at index ${keys.get( - key - )} and ${i} ${value2}are duplicates` - ); - } - keys.set(key, i); - } - } - - // node_modules/svelte/src/runtime/internal/spread.js - function get_spread_update(levels, updates) { - const update2 = {}; - const to_null_out = {}; - const accounted_for = { $$scope: 1 }; - let i = levels.length; - while (i--) { - const o = levels[i]; - const n = updates[i]; - if (n) { - for (const key in o) { - if (!(key in n)) - to_null_out[key] = 1; - } - for (const key in n) { - if (!accounted_for[key]) { - update2[key] = n[key]; - accounted_for[key] = 1; - } - } - levels[i] = n; - } else { - for (const key in o) { - accounted_for[key] = 1; - } - } - } - for (const key in to_null_out) { - if (!(key in update2)) - update2[key] = void 0; - } - return update2; - } - - // node_modules/svelte/src/shared/boolean_attributes.js - var _boolean_attributes = ( - /** @type {const} */ - [ - "allowfullscreen", - "allowpaymentrequest", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "formnovalidate", - "hidden", - "inert", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" - ] - ); - var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]); - - // node_modules/svelte/src/shared/utils/names.js - var void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/; - function is_void(name) { - return void_element_names.test(name) || name.toLowerCase() === "!doctype"; - } - - // node_modules/svelte/src/runtime/internal/Component.js - function create_component(block) { - block && block.c(); - } - function claim_component(block, parent_nodes) { - block && block.l(parent_nodes); - } - function mount_component(component, target, anchor) { - const { fragment, after_update } = component.$$; - fragment && fragment.m(target, anchor); - add_render_callback(() => { - const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); - if (component.$$.on_destroy) { - component.$$.on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - after_update.forEach(add_render_callback); - } - function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - flush_render_callbacks($$.after_update); - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } - } - function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; - } - function init2(component, options, instance15, create_fragment15, not_equal, props, append_styles2 = null, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: [], - // state - props, - update: noop2, - not_equal, - bound: blank_object(), - // lifecycle - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - // everything else - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root - }; - append_styles2 && append_styles2($$.root); - let ready = false; - $$.ctx = instance15 ? instance15(component, options.props || {}, (i, ret, ...rest) => { - const value2 = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value2)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value2); - if (ready) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment15 ? create_fragment15($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - start_hydrating(); - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach2); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor); - end_hydrating(); - flush(); - } - set_current_component(parent_component); - } - var SvelteElement; - if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor($$componentCtor, $$slots, use_shadow_dom) { - super(); - /** The Svelte component constructor */ - __publicField(this, "$$ctor"); - /** Slots */ - __publicField(this, "$$s"); - /** The Svelte component instance */ - __publicField(this, "$$c"); - /** Whether or not the custom element is connected */ - __publicField(this, "$$cn", false); - /** Component props data */ - __publicField(this, "$$d", {}); - /** `true` if currently in the process of reflecting component props back to attributes */ - __publicField(this, "$$r", false); - /** @type {Record} Props definition (name, reflected, type etc) */ - __publicField(this, "$$p_d", {}); - /** @type {Record} Event listeners */ - __publicField(this, "$$l", {}); - /** @type {Map} Event listener unsubscribe functions */ - __publicField(this, "$$l_u", /* @__PURE__ */ new Map()); - this.$$ctor = $$componentCtor; - this.$$s = $$slots; - if (use_shadow_dom) { - this.attachShadow({ mode: "open" }); - } - } - addEventListener(type, listener, options) { - this.$$l[type] = this.$$l[type] || []; - this.$$l[type].push(listener); - if (this.$$c) { - const unsub = this.$$c.$on(type, listener); - this.$$l_u.set(listener, unsub); - } - super.addEventListener(type, listener, options); - } - removeEventListener(type, listener, options) { - super.removeEventListener(type, listener, options); - if (this.$$c) { - const unsub = this.$$l_u.get(listener); - if (unsub) { - unsub(); - this.$$l_u.delete(listener); - } - } - } - async connectedCallback() { - this.$$cn = true; - if (!this.$$c) { - let create_slot2 = function(name) { - return () => { - let node; - const obj = { - c: function create3() { - node = element("slot"); - if (name !== "default") { - attr(node, "name", name); - } - }, - /** - * @param {HTMLElement} target - * @param {HTMLElement} [anchor] - */ - m: function mount(target, anchor) { - insert2(target, node, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach2(node); - } - } - }; - return obj; - }; - }; - await Promise.resolve(); - if (!this.$$cn || this.$$c) { - return; - } - const $$slots = {}; - const existing_slots = get_custom_elements_slots(this); - for (const name of this.$$s) { - if (name in existing_slots) { - $$slots[name] = [create_slot2(name)]; - } - } - for (const attribute of this.attributes) { - const name = this.$$g_p(attribute.name); - if (!(name in this.$$d)) { - this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); - } - } - for (const key in this.$$p_d) { - if (!(key in this.$$d) && this[key] !== void 0) { - this.$$d[key] = this[key]; - delete this[key]; - } - } - this.$$c = new this.$$ctor({ - target: this.shadowRoot || this, - props: { - ...this.$$d, - $$slots, - $$scope: { - ctx: [] - } - } - }); - const reflect_attributes = () => { - this.$$r = true; - for (const key in this.$$p_d) { - this.$$d[key] = this.$$c.$$.ctx[this.$$c.$$.props[key]]; - if (this.$$p_d[key].reflect) { - const attribute_value = get_custom_element_value( - key, - this.$$d[key], - this.$$p_d, - "toAttribute" - ); - if (attribute_value == null) { - this.removeAttribute(this.$$p_d[key].attribute || key); - } else { - this.setAttribute(this.$$p_d[key].attribute || key, attribute_value); - } - } - } - this.$$r = false; - }; - this.$$c.$$.after_update.push(reflect_attributes); - reflect_attributes(); - for (const type in this.$$l) { - for (const listener of this.$$l[type]) { - const unsub = this.$$c.$on(type, listener); - this.$$l_u.set(listener, unsub); - } - } - this.$$l = {}; - } - } - // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte - // and setting attributes through setAttribute etc, this is helpful - attributeChangedCallback(attr2, _oldValue, newValue) { - if (this.$$r) - return; - attr2 = this.$$g_p(attr2); - this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp"); - this.$$c?.$set({ [attr2]: this.$$d[attr2] }); - } - disconnectedCallback() { - this.$$cn = false; - Promise.resolve().then(() => { - if (!this.$$cn) { - this.$$c.$destroy(); - this.$$c = void 0; - } - }); - } - $$g_p(attribute_name) { - return Object.keys(this.$$p_d).find( - (key) => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name - ) || attribute_name; - } - }; - } - function get_custom_element_value(prop, value2, props_definition, transform) { - const type = props_definition[prop]?.type; - value2 = type === "Boolean" && typeof value2 !== "boolean" ? value2 != null : value2; - if (!transform || !props_definition[prop]) { - return value2; - } else if (transform === "toAttribute") { - switch (type) { - case "Object": - case "Array": - return value2 == null ? null : JSON.stringify(value2); - case "Boolean": - return value2 ? "" : null; - case "Number": - return value2 == null ? null : value2; - default: - return value2; - } - } else { - switch (type) { - case "Object": - case "Array": - return value2 && JSON.parse(value2); - case "Boolean": - return value2; - case "Number": - return value2 != null ? +value2 : value2; - default: - return value2; - } - } - } - function create_custom_element(Component, props_definition, slots, accessors, use_shadow_dom, extend) { - let Class = class extends SvelteElement { - constructor() { - super(Component, slots, use_shadow_dom); - this.$$p_d = props_definition; - } - static get observedAttributes() { - return Object.keys(props_definition).map( - (key) => (props_definition[key].attribute || key).toLowerCase() - ); - } - }; - Object.keys(props_definition).forEach((prop) => { - Object.defineProperty(Class.prototype, prop, { - get() { - return this.$$c && prop in this.$$c ? this.$$c[prop] : this.$$d[prop]; - }, - set(value2) { - value2 = get_custom_element_value(prop, value2, props_definition); - this.$$d[prop] = value2; - this.$$c?.$set({ [prop]: value2 }); - } - }); - }); - accessors.forEach((accessor) => { - Object.defineProperty(Class.prototype, accessor, { - get() { - return this.$$c?.[accessor]; - } - }); - }); - if (extend) { - Class = extend(Class); - } - Component.element = /** @type {any} */ - Class; - return Class; - } - var SvelteComponent = class { - constructor() { - /** - * ### PRIVATE API - * - * Do not use, may change at any time - * - * @type {any} - */ - __publicField(this, "$$"); - /** - * ### PRIVATE API - * - * Do not use, may change at any time - * - * @type {any} - */ - __publicField(this, "$$set"); - } - /** @returns {void} */ - $destroy() { - destroy_component(this, 1); - this.$destroy = noop2; - } - /** - * @template {Extract} K - * @param {K} type - * @param {((e: Events[K]) => void) | null | undefined} callback - * @returns {() => void} - */ - $on(type, callback) { - if (!is_function(callback)) { - return noop2; - } - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index4 = callbacks.indexOf(callback); - if (index4 !== -1) - callbacks.splice(index4, 1); - }; - } - /** - * @param {Partial} props - * @returns {void} - */ - $set(props) { - if (this.$$set && !is_empty(props)) { - this.$$.skip_bound = true; - this.$$set(props); - this.$$.skip_bound = false; - } - } - }; - - // node_modules/svelte/src/shared/version.js - var VERSION = "4.2.12"; - var PUBLIC_VERSION = "4"; - - // node_modules/svelte/src/runtime/internal/dev.js - function dispatch_dev(type, detail) { - document.dispatchEvent(custom_event(type, { version: VERSION, ...detail }, { bubbles: true })); - } - function append_hydration_dev(target, node) { - dispatch_dev("SvelteDOMInsert", { target, node }); - append_hydration(target, node); - } - function insert_hydration_dev(target, node, anchor) { - dispatch_dev("SvelteDOMInsert", { target, node, anchor }); - insert_hydration(target, node, anchor); - } - function detach_dev(node) { - dispatch_dev("SvelteDOMRemove", { node }); - detach2(node); - } - function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) { - const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; - if (has_prevent_default) - modifiers.push("preventDefault"); - if (has_stop_propagation) - modifiers.push("stopPropagation"); - if (has_stop_immediate_propagation) - modifiers.push("stopImmediatePropagation"); - dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); - const dispose = listen(node, event, handler, options); - return () => { - dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); - dispose(); - }; - } - function attr_dev(node, attribute, value2) { - attr(node, attribute, value2); - if (value2 == null) - dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); - else - dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value: value2 }); - } - function prop_dev(node, property, value2) { - node[property] = value2; - dispatch_dev("SvelteDOMSetProperty", { node, property, value: value2 }); - } - function set_data_dev(text2, data) { - data = "" + data; - if (text2.data === data) - return; - dispatch_dev("SvelteDOMSetData", { node: text2, data }); - text2.data = /** @type {string} */ - data; - } - function ensure_array_like_dev(arg) { - if (typeof arg !== "string" && !(arg && typeof arg === "object" && "length" in arg) && !(typeof Symbol === "function" && arg && Symbol.iterator in arg)) { - throw new Error("{#each} only works with iterable values."); - } - return ensure_array_like(arg); - } - function validate_slots(name, slot, keys) { - for (const slot_key of Object.keys(slot)) { - if (!~keys.indexOf(slot_key)) { - console.warn(`<${name}> received an unexpected slot "${slot_key}".`); - } - } - } - function validate_dynamic_element(tag) { - const is_string = typeof tag === "string"; - if (tag && !is_string) { - throw new Error(' expects "this" attribute to be a string.'); - } - } - function validate_void_dynamic_element(tag) { - if (tag && is_void(tag)) { - console.warn(` is self-closing and cannot have content.`); - } - } - var SvelteComponentDev = class extends SvelteComponent { - /** @param {import('./public.js').ComponentConstructorOptions} options */ - constructor(options) { - if (!options || !options.target && !options.$$inline) { - throw new Error("'target' is a required option"); - } - super(); - /** - * For type checking capabilities only. - * Does not exist at runtime. - * ### DO NOT USE! - * - * @type {Props} - */ - __publicField(this, "$$prop_def"); - /** - * For type checking capabilities only. - * Does not exist at runtime. - * ### DO NOT USE! - * - * @type {Events} - */ - __publicField(this, "$$events_def"); - /** - * For type checking capabilities only. - * Does not exist at runtime. - * ### DO NOT USE! - * - * @type {Slots} - */ - __publicField(this, "$$slot_def"); - } - /** @returns {void} */ - $destroy() { - super.$destroy(); - this.$destroy = () => { - console.warn("Component was already destroyed"); - }; - } - /** @returns {void} */ - $capture_state() { - } - /** @returns {void} */ - $inject_state() { - } - }; - - // node_modules/svelte/src/runtime/internal/disclose-version/index.js - if (typeof window !== "undefined") - (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION); - - // node_modules/svelte/src/runtime/transition/index.js - function fade(node, { delay = 0, duration = 400, easing = identity } = {}) { - const o = +getComputedStyle(node).opacity; - return { - delay, - duration, - easing, - css: (t) => `opacity: ${t * o}` - }; - } - - // node_modules/svelte/src/runtime/store/index.js - var subscriber_queue = []; - function readable(value2, start) { - return { - subscribe: writable(value2, start).subscribe - }; - } - function writable(value2, start = noop2) { - let stop; - const subscribers = /* @__PURE__ */ new Set(); - function set(new_value) { - if (safe_not_equal(value2, new_value)) { - value2 = new_value; - if (stop) { - const run_queue = !subscriber_queue.length; - for (const subscriber of subscribers) { - subscriber[1](); - subscriber_queue.push(subscriber, value2); - } - if (run_queue) { - for (let i = 0; i < subscriber_queue.length; i += 2) { - subscriber_queue[i][0](subscriber_queue[i + 1]); - } - subscriber_queue.length = 0; - } - } - } - } - function update2(fn) { - set(fn(value2)); - } - function subscribe2(run2, invalidate = noop2) { - const subscriber = [run2, invalidate]; - subscribers.add(subscriber); - if (subscribers.size === 1) { - stop = start(set, update2) || noop2; - } - run2(value2); - return () => { - subscribers.delete(subscriber); - if (subscribers.size === 0 && stop) { - stop(); - stop = null; - } - }; - } - return { set, update: update2, subscribe: subscribe2 }; - } - function derived(stores, fn, initial_value) { - const single = !Array.isArray(stores); - const stores_array = single ? [stores] : stores; - if (!stores_array.every(Boolean)) { - throw new Error("derived() expects stores as input, got a falsy value"); - } - const auto = fn.length < 2; - return readable(initial_value, (set, update2) => { - let started = false; - const values = []; - let pending = 0; - let cleanup = noop2; - const sync2 = () => { - if (pending) { - return; - } - cleanup(); - const result = fn(single ? values[0] : values, set, update2); - if (auto) { - set(result); - } else { - cleanup = is_function(result) ? result : noop2; - } - }; - const unsubscribers = stores_array.map( - (store, i) => subscribe( - store, - (value2) => { - values[i] = value2; - pending &= ~(1 << i); - if (started) { - sync2(); - } - }, - () => { - pending |= 1 << i; - } - ) - ); - started = true; - sync2(); - return function stop() { - run_all(unsubscribers); - cleanup(); - started = false; - }; - }); - } - - // svelte/components/Backdrop.svelte - var file = "svelte/components/Backdrop.svelte"; - function create_if_block(ctx) { - let div; - let div_transition; - let current; - const block = { - c: function create3() { - div = element("div"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, "data-test-id": true }); - children(div).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "bg-black/50 absolute inset-0 z-30"); - attr_dev(div, "data-test-id", "backdrop"); - add_location(div, file, 8, 2, 202); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - current = true; - }, - i: function intro(local) { - if (current) - return; - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, fade, {}, true); - div_transition.run(1); - }); - } - current = true; - }, - o: function outro(local) { - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, fade, {}, false); - div_transition.run(0); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - if (detaching && div_transition) - div_transition.end(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block.name, - type: "if", - source: "(6:0) {#if $backdropVisible}", - ctx - }); - return block; - } - function create_fragment(ctx) { - let if_block_anchor; - let if_block = ( - /*$backdropVisible*/ - ctx[0] && create_if_block(ctx) - ); - const block = { - c: function create3() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - }, - p: function update2(ctx2, [dirty]) { - if ( - /*$backdropVisible*/ - ctx2[0] - ) { - if (if_block) { - if (dirty & /*$backdropVisible*/ - 1) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i: function intro(local) { - transition_in(if_block); - }, - o: function outro(local) { - transition_out(if_block); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if (if_block) - if_block.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment.name, - type: "component", - source: "", - ctx - }); - return block; - } - var backdropVisible = writable(false); - function instance($$self, $$props, $$invalidate) { - let $backdropVisible, $$unsubscribe_backdropVisible = noop2, $$subscribe_backdropVisible = () => ($$unsubscribe_backdropVisible(), $$unsubscribe_backdropVisible = subscribe(backdropVisible, ($$value) => $$invalidate(0, $backdropVisible = $$value)), backdropVisible); - validate_store(backdropVisible, "backdropVisible"); - component_subscribe($$self, backdropVisible, ($$value) => $$invalidate(0, $backdropVisible = $$value)); - $$self.$$.on_destroy.push(() => $$unsubscribe_backdropVisible()); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Backdrop", slots, []); - const writable_props = []; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - $$self.$capture_state = () => ({ - writable, - fade, - backdropVisible, - $backdropVisible - }); - return [$backdropVisible]; - } - var Backdrop = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance, create_fragment, safe_not_equal, {}); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Backdrop", - options, - id: create_fragment.name - }); - } - }; - create_custom_element(Backdrop, {}, [], [], true); - var Backdrop_default = Backdrop; - - // svelte/components/BrowserFrame.svelte - var BrowserFrame_exports = {}; - __export(BrowserFrame_exports, { - default: () => BrowserFrame_default - }); - var file2 = "svelte/components/BrowserFrame.svelte"; - function create_fragment2(ctx) { - let div5; - let div4; - let div0; - let span0; - let t0; - let span1; - let t1; - let span2; - let t2; - let div2; - let div1; - let span3; - let t3_value = getPageName( - /*page*/ - ctx[0] - ) + ""; - let t3; - let t4; - let div3; - let textContent = ``; - let t5; - let current; - const default_slot_template = ( - /*#slots*/ - ctx[2].default - ); - const default_slot = create_slot( - default_slot_template, - ctx, - /*$$scope*/ - ctx[1], - null - ); - const block = { - c: function create3() { - div5 = element("div"); - div4 = element("div"); - div0 = element("div"); - span0 = element("span"); - t0 = space(); - span1 = element("span"); - t1 = space(); - span2 = element("span"); - t2 = space(); - div2 = element("div"); - div1 = element("div"); - span3 = element("span"); - t3 = text(t3_value); - t4 = space(); - div3 = element("div"); - div3.innerHTML = textContent; - t5 = space(); - if (default_slot) - default_slot.c(); - this.h(); - }, - l: function claim(nodes) { - div5 = claim_element(nodes, "DIV", { class: true, "data-test-id": true }); - var div5_nodes = children(div5); - div4 = claim_element(div5_nodes, "DIV", { class: true, "data-test-id": true }); - var div4_nodes = children(div4); - div0 = claim_element(div4_nodes, "DIV", { class: true }); - var div0_nodes = children(div0); - span0 = claim_element(div0_nodes, "SPAN", { class: true }); - children(span0).forEach(detach_dev); - t0 = claim_space(div0_nodes); - span1 = claim_element(div0_nodes, "SPAN", { class: true }); - children(span1).forEach(detach_dev); - t1 = claim_space(div0_nodes); - span2 = claim_element(div0_nodes, "SPAN", { class: true }); - children(span2).forEach(detach_dev); - div0_nodes.forEach(detach_dev); - t2 = claim_space(div4_nodes); - div2 = claim_element(div4_nodes, "DIV", { class: true }); - var div2_nodes = children(div2); - div1 = claim_element(div2_nodes, "DIV", { class: true }); - var div1_nodes = children(div1); - span3 = claim_element(div1_nodes, "SPAN", { "data-test-id": true }); - var span3_nodes = children(span3); - t3 = claim_text(span3_nodes, t3_value); - span3_nodes.forEach(detach_dev); - div1_nodes.forEach(detach_dev); - div2_nodes.forEach(detach_dev); - t4 = claim_space(div4_nodes); - div3 = claim_element(div4_nodes, "DIV", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(div3) !== "svelte-1czp51h") - div3.innerHTML = textContent; - div4_nodes.forEach(detach_dev); - t5 = claim_space(div5_nodes); - if (default_slot) - default_slot.l(div5_nodes); - div5_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span0, "class", "inline-block h-2 w-2 ml-2 rounded-full bg-red-800"); - add_location(span0, file2, 16, 6, 367); - attr_dev(span1, "class", "inline-block h-2 w-2 ml-2 rounded-full bg-amber-400"); - add_location(span1, file2, 17, 6, 445); - attr_dev(span2, "class", "inline-block h-2 w-2 ml-2 rounded-full bg-lime-600"); - add_location(span2, file2, 18, 6, 525); - attr_dev(div0, "class", "py-2"); - add_location(div0, file2, 15, 4, 342); - attr_dev(span3, "data-test-id", "url-box"); - add_location(span3, file2, 22, 8, 782); - attr_dev(div1, "class", "rounded bg-gray-50 border-b border-gray-200 shadow max-w-xs mx-auto text-center py-0.5 relative"); - add_location(div1, file2, 21, 6, 664); - attr_dev(div2, "class", "flex-1 py-2.5 overflow-visible"); - add_location(div2, file2, 20, 4, 613); - attr_dev(div3, "class", "py-3"); - add_location(div3, file2, 25, 4, 866); - attr_dev(div4, "class", "bg-gray-50 border-b border-gray-200 border-solid rounded-t-xl h-12 px-3.5 flex"); - attr_dev(div4, "data-test-id", "address-bar"); - add_location(div4, file2, 11, 2, 207); - attr_dev(div5, "class", "flex-1 flex flex-col"); - attr_dev(div5, "data-test-id", "fake-browser"); - add_location(div5, file2, 10, 0, 142); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div5, anchor); - append_hydration_dev(div5, div4); - append_hydration_dev(div4, div0); - append_hydration_dev(div0, span0); - append_hydration_dev(div0, t0); - append_hydration_dev(div0, span1); - append_hydration_dev(div0, t1); - append_hydration_dev(div0, span2); - append_hydration_dev(div4, t2); - append_hydration_dev(div4, div2); - append_hydration_dev(div2, div1); - append_hydration_dev(div1, span3); - append_hydration_dev(span3, t3); - append_hydration_dev(div4, t4); - append_hydration_dev(div4, div3); - append_hydration_dev(div5, t5); - if (default_slot) { - default_slot.m(div5, null); - } - current = true; - }, - p: function update2(ctx2, [dirty]) { - if ((!current || dirty & /*page*/ - 1) && t3_value !== (t3_value = getPageName( - /*page*/ - ctx2[0] - ) + "")) - set_data_dev(t3, t3_value); - if (default_slot) { - if (default_slot.p && (!current || dirty & /*$$scope*/ - 2)) { - update_slot_base( - default_slot, - default_slot_template, - ctx2, - /*$$scope*/ - ctx2[1], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[1] - ) : get_slot_changes( - default_slot_template, - /*$$scope*/ - ctx2[1], - dirty, - null - ), - null - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(default_slot, local); - current = true; - }, - o: function outro(local) { - transition_out(default_slot, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div5); - } - if (default_slot) - default_slot.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment2.name, - type: "component", - source: "", - ctx - }); - return block; - } - function getPageName(page2) { - return !page2.path || page2.path === "" ? "index" : page2.path; - } - function instance2($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("BrowserFrame", slots, ["default"]); - let { page: page2 } = $$props; - $$self.$$.on_mount.push(function() { - if (page2 === void 0 && !("page" in $$props || $$self.$$.bound[$$self.$$.props["page"]])) { - console.warn(" was created without expected prop 'page'"); - } - }); - const writable_props = ["page"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - $$self.$$set = ($$props2) => { - if ("page" in $$props2) - $$invalidate(0, page2 = $$props2.page); - if ("$$scope" in $$props2) - $$invalidate(1, $$scope = $$props2.$$scope); - }; - $$self.$capture_state = () => ({ page: page2, getPageName }); - $$self.$inject_state = ($$props2) => { - if ("page" in $$props2) - $$invalidate(0, page2 = $$props2.page); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - return [page2, $$scope, slots]; - } - var BrowserFrame = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance2, create_fragment2, safe_not_equal, { page: 0 }); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "BrowserFrame", - options, - id: create_fragment2.name - }); - } - get page() { - return this.$$.ctx[0]; - } - set page(page2) { - this.$$set({ page: page2 }); - flush(); - } - }; - create_custom_element(BrowserFrame, { "page": {} }, ["default"], [], true); - var BrowserFrame_default = BrowserFrame; - - // svelte/components/CodeEditor.svelte - var CodeEditor_exports = {}; - __export(CodeEditor_exports, { - default: () => CodeEditor_default - }); - - // node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js - function _defineProperty3(obj, key, value2) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value2, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value2; - } - return obj; - } - function ownKeys3(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread23(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys3(Object(source), true).forEach(function(key) { - _defineProperty3(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys3(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - return target; - } - function _objectWithoutPropertiesLoose2(source, excluded) { - if (source == null) - return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) - continue; - target[key] = source[key]; - } - return target; - } - function _objectWithoutProperties2(source, excluded) { - if (source == null) - return {}; - var target = _objectWithoutPropertiesLoose2(source, excluded); - var key, i; - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) - continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) - continue; - target[key] = source[key]; - } - } - return target; - } - function _slicedToArray2(arr, i) { - return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2(); - } - function _arrayWithHoles2(arr) { - if (Array.isArray(arr)) - return arr; - } - function _iterableToArrayLimit2(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) - return; - var _arr = []; - var _n = true; - var _d = false; - var _e = void 0; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - function _unsupportedIterableToArray2(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray2(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray2(o, minLen); - } - function _arrayLikeToArray2(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) - arr2[i] = arr[i]; - return arr2; - } - function _nonIterableRest2() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - - // node_modules/state-local/lib/es/state-local.js - function _defineProperty4(obj, key, value2) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value2, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value2; - } - return obj; - } - function ownKeys4(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) - symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread24(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys4(Object(source), true).forEach(function(key) { - _defineProperty4(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys4(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - return target; - } - function compose4() { - for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { - fns[_key] = arguments[_key]; - } - return function(x) { - return fns.reduceRight(function(y, f) { - return f(y); - }, x); - }; - } - function curry3(fn) { - return function curried() { - var _this = this; - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - return args.length >= fn.length ? fn.apply(this, args) : function() { - for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - nextArgs[_key3] = arguments[_key3]; - } - return curried.apply(_this, [].concat(args, nextArgs)); - }; - }; - } - function isObject3(value2) { - return {}.toString.call(value2).includes("Object"); - } - function isEmpty2(obj) { - return !Object.keys(obj).length; - } - function isFunction2(value2) { - return typeof value2 === "function"; - } - function hasOwnProperty2(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - } - function validateChanges2(initial, changes) { - if (!isObject3(changes)) - errorHandler3("changeType"); - if (Object.keys(changes).some(function(field) { - return !hasOwnProperty2(initial, field); - })) - errorHandler3("changeField"); - return changes; - } - function validateSelector2(selector) { - if (!isFunction2(selector)) - errorHandler3("selectorType"); - } - function validateHandler2(handler) { - if (!(isFunction2(handler) || isObject3(handler))) - errorHandler3("handlerType"); - if (isObject3(handler) && Object.values(handler).some(function(_handler) { - return !isFunction2(_handler); - })) - errorHandler3("handlersType"); - } - function validateInitial2(initial) { - if (!initial) - errorHandler3("initialIsRequired"); - if (!isObject3(initial)) - errorHandler3("initialType"); - if (isEmpty2(initial)) - errorHandler3("initialContent"); - } - function throwError3(errorMessages5, type) { - throw new Error(errorMessages5[type] || errorMessages5["default"]); - } - var errorMessages3 = { - initialIsRequired: "initial state is required", - initialType: "initial state should be an object", - initialContent: "initial state shouldn't be an empty object", - handlerType: "handler should be an object or a function", - handlersType: "all handlers should be a functions", - selectorType: "selector should be a function", - changeType: "provided value of changes should be an object", - changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state', - "default": "an unknown error accured in `state-local` package" - }; - var errorHandler3 = curry3(throwError3)(errorMessages3); - var validators3 = { - changes: validateChanges2, - selector: validateSelector2, - handler: validateHandler2, - initial: validateInitial2 - }; - function create2(initial) { - var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - validators3.initial(initial); - validators3.handler(handler); - var state = { - current: initial - }; - var didUpdate = curry3(didStateUpdate2)(state, handler); - var update2 = curry3(updateState2)(state); - var validate = curry3(validators3.changes)(initial); - var getChanges = curry3(extractChanges2)(state); - function getState3() { - var selector = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state2) { - return state2; - }; - validators3.selector(selector); - return selector(state.current); - } - function setState3(causedChanges) { - compose4(didUpdate, update2, validate, getChanges)(causedChanges); - } - return [getState3, setState3]; - } - function extractChanges2(state, causedChanges) { - return isFunction2(causedChanges) ? causedChanges(state.current) : causedChanges; - } - function updateState2(state, changes) { - state.current = _objectSpread24(_objectSpread24({}, state.current), changes); - return changes; - } - function didStateUpdate2(state, handler, changes) { - isFunction2(handler) ? handler(state.current) : Object.keys(changes).forEach(function(field) { - var _handler$field; - return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]); - }); - return changes; - } - var index2 = { - create: create2 - }; - var state_local_default2 = index2; - - // node_modules/@monaco-editor/loader/lib/es/config/index.js - var config3 = { - paths: { - vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs" - } - }; - var config_default2 = config3; - - // node_modules/@monaco-editor/loader/lib/es/utils/curry.js - function curry4(fn) { - return function curried() { - var _this = this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.length >= fn.length ? fn.apply(this, args) : function() { - for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - nextArgs[_key2] = arguments[_key2]; - } - return curried.apply(_this, [].concat(args, nextArgs)); - }; - }; - } - var curry_default2 = curry4; - - // node_modules/@monaco-editor/loader/lib/es/utils/isObject.js - function isObject4(value2) { - return {}.toString.call(value2).includes("Object"); - } - var isObject_default2 = isObject4; - - // node_modules/@monaco-editor/loader/lib/es/validators/index.js - function validateConfig2(config5) { - if (!config5) - errorHandler4("configIsRequired"); - if (!isObject_default2(config5)) - errorHandler4("configType"); - if (config5.urls) { - informAboutDeprecation2(); - return { - paths: { - vs: config5.urls.monacoBase - } - }; - } - return config5; - } - function informAboutDeprecation2() { - console.warn(errorMessages4.deprecation); - } - function throwError4(errorMessages5, type) { - throw new Error(errorMessages5[type] || errorMessages5["default"]); - } - var errorMessages4 = { - configIsRequired: "the configuration object is required", - configType: "the configuration object should be an object", - "default": "an unknown error accured in `@monaco-editor/loader` package", - deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n " - }; - var errorHandler4 = curry_default2(throwError4)(errorMessages4); - var validators4 = { - config: validateConfig2 - }; - var validators_default2 = validators4; - - // node_modules/@monaco-editor/loader/lib/es/utils/compose.js - var compose5 = function compose6() { - for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { - fns[_key] = arguments[_key]; - } - return function(x) { - return fns.reduceRight(function(y, f) { - return f(y); - }, x); - }; - }; - var compose_default2 = compose5; - - // node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js - function merge2(target, source) { - Object.keys(source).forEach(function(key) { - if (source[key] instanceof Object) { - if (target[key]) { - Object.assign(source[key], merge2(target[key], source[key])); - } - } - }); - return _objectSpread23(_objectSpread23({}, target), source); - } - var deepMerge_default2 = merge2; - - // node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js - var CANCELATION_MESSAGE2 = { - type: "cancelation", - msg: "operation is manually canceled" - }; - function makeCancelable2(promise2) { - var hasCanceled_ = false; - var wrappedPromise = new Promise(function(resolve, reject) { - promise2.then(function(val) { - return hasCanceled_ ? reject(CANCELATION_MESSAGE2) : resolve(val); - }); - promise2["catch"](reject); - }); - return wrappedPromise.cancel = function() { - return hasCanceled_ = true; - }, wrappedPromise; - } - var makeCancelable_default2 = makeCancelable2; - - // node_modules/@monaco-editor/loader/lib/es/loader/index.js - var _state$create3 = state_local_default2.create({ - config: config_default2, - isInitialized: false, - resolve: null, - reject: null, - monaco: null - }); - var _state$create22 = _slicedToArray2(_state$create3, 2); - var getState2 = _state$create22[0]; - var setState2 = _state$create22[1]; - function config4(globalConfig) { - var _validators$config = validators_default2.config(globalConfig), monaco = _validators$config.monaco, config5 = _objectWithoutProperties2(_validators$config, ["monaco"]); - setState2(function(state) { - return { - config: deepMerge_default2(state.config, config5), - monaco - }; - }); - } - function init3() { - var state = getState2(function(_ref) { - var monaco = _ref.monaco, isInitialized = _ref.isInitialized, resolve = _ref.resolve; - return { - monaco, - isInitialized, - resolve - }; - }); - if (!state.isInitialized) { - setState2({ - isInitialized: true - }); - if (state.monaco) { - state.resolve(state.monaco); - return makeCancelable_default2(wrapperPromise2); - } - if (window.monaco && window.monaco.editor) { - storeMonacoInstance2(window.monaco); - state.resolve(window.monaco); - return makeCancelable_default2(wrapperPromise2); - } - compose_default2(injectScripts2, getMonacoLoaderScript2)(configureLoader2); - } - return makeCancelable_default2(wrapperPromise2); - } - function injectScripts2(script) { - return document.body.appendChild(script); - } - function createScript2(src) { - var script = document.createElement("script"); - return src && (script.src = src), script; - } - function getMonacoLoaderScript2(configureLoader3) { - var state = getState2(function(_ref2) { - var config5 = _ref2.config, reject = _ref2.reject; - return { - config: config5, - reject - }; - }); - var loaderScript = createScript2("".concat(state.config.paths.vs, "/loader.js")); - loaderScript.onload = function() { - return configureLoader3(); - }; - loaderScript.onerror = state.reject; - return loaderScript; - } - function configureLoader2() { - var state = getState2(function(_ref3) { - var config5 = _ref3.config, resolve = _ref3.resolve, reject = _ref3.reject; - return { - config: config5, - resolve, - reject - }; - }); - var require2 = window.require; - require2.config(state.config); - require2(["vs/editor/editor.main"], function(monaco) { - storeMonacoInstance2(monaco); - state.resolve(monaco); - }, function(error) { - state.reject(error); - }); - } - function storeMonacoInstance2(monaco) { - if (!getState2().monaco) { - setState2({ - monaco - }); - } - } - function __getMonacoInstance2() { - return getState2(function(_ref4) { - var monaco = _ref4.monaco; - return monaco; - }); - } - var wrapperPromise2 = new Promise(function(resolve, reject) { - return setState2({ - resolve, - reject - }); - }); - var loader2 = { - config: config4, - init: init3, - __getMonacoInstance: __getMonacoInstance2 - }; - var loader_default2 = loader2; - - // svelte/components/CodeEditor.svelte - var file3 = "svelte/components/CodeEditor.svelte"; - function create_fragment3(ctx) { - let div; - const block = { - c: function create3() { - div = element("div"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - children(div).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "w-52 h-24 py-0.5 px-0.5 bg-gray-100"); - add_location(div, file3, 39, 0, 892); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - ctx[2](div); - }, - p: noop2, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - ctx[2](null); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment3.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance3($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("CodeEditor", slots, []); - let { value: value2 } = $$props; - let dispatch2 = createEventDispatcher(); - let editor; - let monaco; - let editorContainer; - onMount(async () => { - loader_default2.config({ - paths: { vs: "/node_modules/monaco-editor/min/vs" } - }); - monaco = await loader_default2.init(); - const editor2 = monaco.editor.create(editorContainer, { - value: value2, - language: "elixir", - minimap: { enabled: false }, - lineNumbers: "off", - automaticLayout: true - }); - editor2.onDidBlurEditorWidget((e) => { - let content = editor2.getValue(); - dispatch2("change", content); - }); - }); - onDestroy(() => { - monaco?.editor.getModels().forEach((model) => model.dispose()); - }); - $$self.$$.on_mount.push(function() { - if (value2 === void 0 && !("value" in $$props || $$self.$$.bound[$$self.$$.props["value"]])) { - console.warn(" was created without expected prop 'value'"); - } - }); - const writable_props = ["value"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - editorContainer = $$value; - $$invalidate(0, editorContainer); - }); - } - $$self.$$set = ($$props2) => { - if ("value" in $$props2) - $$invalidate(1, value2 = $$props2.value); - }; - $$self.$capture_state = () => ({ - loader: loader_default2, - onDestroy, - onMount, - value: value2, - createEventDispatcher, - dispatch: dispatch2, - editor, - monaco, - editorContainer - }); - $$self.$inject_state = ($$props2) => { - if ("value" in $$props2) - $$invalidate(1, value2 = $$props2.value); - if ("dispatch" in $$props2) - dispatch2 = $$props2.dispatch; - if ("editor" in $$props2) - $$invalidate(5, editor = $$props2.editor); - if ("monaco" in $$props2) - monaco = $$props2.monaco; - if ("editorContainer" in $$props2) - $$invalidate(0, editorContainer = $$props2.editorContainer); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*value*/ - 2) { - $: { - if (editor) { - editor.setValue(value2); - } - } - } - }; - return [editorContainer, value2, div_binding]; - } - var CodeEditor2 = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance3, create_fragment3, safe_not_equal, { value: 1 }); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "CodeEditor", - options, - id: create_fragment3.name - }); - } - get value() { - return this.$$.ctx[1]; - } - set value(value2) { - this.$$set({ value: value2 }); - flush(); - } - }; - create_custom_element(CodeEditor2, { "value": {} }, [], [], true); - var CodeEditor_default = CodeEditor2; - - // svelte/components/ComponentsSidebar.svelte - var ComponentsSidebar_exports = {}; - __export(ComponentsSidebar_exports, { - default: () => ComponentsSidebar_default - }); - - // svelte/utils/animations.ts - function translate(_node, { delay = 0, duration = 300, x = 0, y = 0 }) { - return { - delay, - duration, - css: (t) => `transform: translate(${x * t}px, ${y * t}px)` - }; - } - - // svelte/stores/currentComponentCategory.ts - var currentComponentCategory = writable(null); - - // svelte/stores/dragAndDrop.ts - var draggedComponentDefinition = writable(null); - var resetDrag = () => { - draggedComponentDefinition.update(() => null); - }; - - // svelte/components/ComponentsSidebar.svelte - var file4 = "svelte/components/ComponentsSidebar.svelte"; - function add_css(target) { - append_styles(target, "svelte-uvq63b", "#left-sidebar.svelte-uvq63b{z-index:1000}#backdrop.svelte-uvq63b{z-index:999}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ29tcG9uZW50c1NpZGViYXIuc3ZlbHRlIiwibWFwcGluZ3MiOiJBQXFKRSwyQkFBYyxDQUNaLE9BQU8sQ0FBRSxJQUNYLENBQ0EsdUJBQVUsQ0FDUixPQUFPLENBQUUsR0FDWCIsIm5hbWVzIjpbXSwic291cmNlcyI6WyJDb21wb25lbnRzU2lkZWJhci5zdmVsdGUiXX0= */"); - } - function get_each_context(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[18] = list3[i]; - return child_ctx; - } - function get_each_context_1(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[21] = list3[i]; - return child_ctx; - } - function get_each_context_2(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[24] = list3[i]; - return child_ctx; - } - function create_if_block_2(ctx) { - let li; - let h3; - let t_value = ( - /*category*/ - ctx[21].name + "" - ); - let t; - const block = { - c: function create3() { - li = element("li"); - h3 = element("h3"); - t = text(t_value); - this.h(); - }, - l: function claim(nodes) { - li = claim_element(nodes, "LI", { class: true, "data-test-id": true }); - var li_nodes = children(li); - h3 = claim_element(li_nodes, "H3", { class: true }); - var h3_nodes = children(h3); - t = claim_text(h3_nodes, t_value); - h3_nodes.forEach(detach_dev); - li_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(h3, "class", "text-xs font-bold uppercase"); - add_location(h3, file4, 86, 12, 2545); - attr_dev(li, "class", "mb-1 px-4"); - attr_dev(li, "data-test-id", "nav-item"); - add_location(li, file4, 85, 10, 2486); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, li, anchor); - append_hydration_dev(li, h3); - append_hydration_dev(h3, t); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*menuCategories*/ - 2 && t_value !== (t_value = /*category*/ - ctx2[21].name + "")) - set_data_dev(t, t_value); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(li); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_2.name, - type: "if", - source: "(75:8) {#if menuCategories.length > 1}", - ctx - }); - return block; - } - function create_each_block_2(ctx) { - let li; - let div; - let t0_value = ( - /*sectionTitles*/ - ctx[4][ - /*item*/ - ctx[24].name - ] + "" - ); - let t0; - let t1; - let mounted; - let dispose; - function mouseenter_handler() { - return ( - /*mouseenter_handler*/ - ctx[13]( - /*item*/ - ctx[24] - ) - ); - } - const block = { - c: function create3() { - li = element("li"); - div = element("div"); - t0 = text(t0_value); - t1 = space(); - this.h(); - }, - l: function claim(nodes) { - li = claim_element(nodes, "LI", { class: true, "data-test-id": true }); - var li_nodes = children(li); - div = claim_element(li_nodes, "DIV", {}); - var div_nodes = children(div); - t0 = claim_text(div_nodes, t0_value); - div_nodes.forEach(detach_dev); - t1 = claim_space(li_nodes); - li_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - add_location(div, file4, 96, 12, 2925); - attr_dev(li, "class", "p-2 pl-6 hover:bg-slate-50 hover:cursor-pointer"); - attr_dev(li, "data-test-id", "nav-item"); - add_location(li, file4, 90, 10, 2685); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, li, anchor); - append_hydration_dev(li, div); - append_hydration_dev(div, t0); - append_hydration_dev(li, t1); - if (!mounted) { - dispose = [ - listen_dev(li, "mouseenter", mouseenter_handler, false, false, false, false), - listen_dev( - li, - "mouseleave", - /*collapseCategoryMenu*/ - ctx[5], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty & /*menuCategories*/ - 2 && t0_value !== (t0_value = /*sectionTitles*/ - ctx[4][ - /*item*/ - ctx[24].name - ] + "")) - set_data_dev(t0, t0_value); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(li); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_2.name, - type: "each", - source: "(80:8) {#each category.items as item}", - ctx - }); - return block; - } - function create_each_block_1(ctx) { - let t; - let each_1_anchor; - let if_block = ( - /*menuCategories*/ - ctx[1].length > 1 && create_if_block_2(ctx) - ); - let each_value_2 = ensure_array_like_dev( - /*category*/ - ctx[21].items - ); - let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); - } - const block = { - c: function create3() { - if (if_block) - if_block.c(); - t = space(); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - t = claim_space(nodes); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, t, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, each_1_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if ( - /*menuCategories*/ - ctx2[1].length > 1 - ) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_2(ctx2); - if_block.c(); - if_block.m(t.parentNode, t); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & /*expandCategoryMenu, menuCategories, collapseCategoryMenu, sectionTitles*/ - 178) { - each_value_2 = ensure_array_like_dev( - /*category*/ - ctx2[21].items - ); - let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_2(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value_2.length; - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - detach_dev(each_1_anchor); - } - if (if_block) - if_block.d(detaching); - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_1.name, - type: "each", - source: "(74:6) {#each menuCategories as category}", - ctx - }); - return block; - } - function create_if_block_1(ctx) { - let each_1_anchor; - let each_value = ensure_array_like_dev( - /*currentDefinitions*/ - ctx[3] - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } - const block = { - c: function create3() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - l: function claim(nodes) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, each_1_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*dragStart, currentDefinitions, dragEnd*/ - 776) { - each_value = ensure_array_like_dev( - /*currentDefinitions*/ - ctx2[3] - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value.length; - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_1.name, - type: "if", - source: "(106:6) {#if currentDefinitions}", - ctx - }); - return block; - } - function create_each_block(ctx) { - let div; - let p; - let t0_value = ( - /*example*/ - ctx[18].name + "" - ); - let t0; - let t1; - let img; - let img_src_value; - let img_alt_value; - let t2; - let mounted; - let dispose; - function dragstart_handler(...args) { - return ( - /*dragstart_handler*/ - ctx[14]( - /*example*/ - ctx[18], - ...args - ) - ); - } - const block = { - c: function create3() { - div = element("div"); - p = element("p"); - t0 = text(t0_value); - t1 = space(); - img = element("img"); - t2 = space(); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { - draggable: true, - class: true, - "data-test-id": true - }); - var div_nodes = children(div); - p = claim_element(div_nodes, "P", { class: true }); - var p_nodes = children(p); - t0 = claim_text(p_nodes, t0_value); - p_nodes.forEach(detach_dev); - t1 = claim_space(div_nodes); - img = claim_element(div_nodes, "IMG", { class: true, src: true, alt: true }); - t2 = claim_space(div_nodes); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(p, "class", "mb-1 text-xs font-bold uppercase tracking-wider"); - add_location(p, file4, 125, 12, 4137); - attr_dev(img, "class", "w-full h-auto rounded ring-offset-2 ring-blue-500 transition hover:cursor-grab hover:ring-2"); - if (!src_url_equal(img.src, img_src_value = /*example*/ - ctx[18].thumbnail ? ( - /*example*/ - ctx[18].thumbnail - ) : `https://placehold.co/400x75?text=${/*example*/ - ctx[18].name}`)) - attr_dev(img, "src", img_src_value); - attr_dev(img, "alt", img_alt_value = /*example*/ - ctx[18].name); - add_location(img, file4, 127, 12, 4300); - attr_dev(div, "draggable", "true"); - attr_dev(div, "class", "pt-6"); - attr_dev(div, "data-test-id", "component-preview-card"); - add_location(div, file4, 118, 10, 3915); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - append_hydration_dev(div, p); - append_hydration_dev(p, t0); - append_hydration_dev(div, t1); - append_hydration_dev(div, img); - append_hydration_dev(div, t2); - if (!mounted) { - dispose = [ - listen_dev(div, "dragstart", dragstart_handler, false, false, false, false), - listen_dev( - div, - "dragend", - /*dragEnd*/ - ctx[9], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty & /*currentDefinitions*/ - 8 && t0_value !== (t0_value = /*example*/ - ctx[18].name + "")) - set_data_dev(t0, t0_value); - if (dirty & /*currentDefinitions*/ - 8 && !src_url_equal(img.src, img_src_value = /*example*/ - ctx[18].thumbnail ? ( - /*example*/ - ctx[18].thumbnail - ) : `https://placehold.co/400x75?text=${/*example*/ - ctx[18].name}`)) { - attr_dev(img, "src", img_src_value); - } - if (dirty & /*currentDefinitions*/ - 8 && img_alt_value !== (img_alt_value = /*example*/ - ctx[18].name)) { - attr_dev(img, "alt", img_alt_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block.name, - type: "each", - source: "(107:8) {#each currentDefinitions as example}", - ctx - }); - return block; - } - function create_if_block2(ctx) { - let div; - let div_transition; - let current; - const block = { - c: function create3() { - div = element("div"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { - class: true, - id: true, - "data-test-id": true - }); - children(div).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "bg-black/50 absolute inset-0 z-50 svelte-uvq63b"); - attr_dev(div, "id", "backdrop"); - attr_dev(div, "data-test-id", "backdrop"); - add_location(div, file4, 140, 2, 4672); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - current = true; - }, - i: function intro(local) { - if (current) - return; - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, fade, { duration: 300 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o: function outro(local) { - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, fade, { duration: 300 }, false); - div_transition.run(0); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - if (detaching && div_transition) - div_transition.end(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block2.name, - type: "if", - source: "(130:0) {#if showExamples}", - ctx - }); - return block; - } - function create_fragment4(ctx) { - let div3; - let div2; - let div0; - let h2; - let textContent = "Components"; - let t1; - let ul; - let t2; - let div1; - let h4; - let t3_value = ( - /*sectionTitles*/ - ctx[4][ - /*$currentComponentCategory*/ - ctx[0]?.name - ] + "" - ); - let t3; - let t4; - let p; - let textContent_1 = "Drag and drop an element into the page"; - let t6; - let div1_transition; - let t7; - let if_block1_anchor; - let current; - let mounted; - let dispose; - let each_value_1 = ensure_array_like_dev( - /*menuCategories*/ - ctx[1] - ); - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); - } - let if_block0 = ( - /*currentDefinitions*/ - ctx[3] && create_if_block_1(ctx) - ); - let if_block1 = ( - /*showExamples*/ - ctx[2] && create_if_block2(ctx) - ); - const block = { - c: function create3() { - div3 = element("div"); - div2 = element("div"); - div0 = element("div"); - h2 = element("h2"); - h2.textContent = textContent; - t1 = space(); - ul = element("ul"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t2 = space(); - div1 = element("div"); - h4 = element("h4"); - t3 = text(t3_value); - t4 = space(); - p = element("p"); - p.textContent = textContent_1; - t6 = space(); - if (if_block0) - if_block0.c(); - t7 = space(); - if (if_block1) - if_block1.c(); - if_block1_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - div3 = claim_element(nodes, "DIV", { - class: true, - id: true, - "data-test-id": true - }); - var div3_nodes = children(div3); - div2 = claim_element(div3_nodes, "DIV", { class: true }); - var div2_nodes = children(div2); - div0 = claim_element(div2_nodes, "DIV", { class: true, "data-test-id": true }); - var div0_nodes = children(div0); - h2 = claim_element(div0_nodes, "H2", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(h2) !== "svelte-1ke8ds1") - h2.textContent = textContent; - div0_nodes.forEach(detach_dev); - t1 = claim_space(div2_nodes); - ul = claim_element(div2_nodes, "UL", { class: true, "data-test-id": true }); - var ul_nodes = children(ul); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(ul_nodes); - } - ul_nodes.forEach(detach_dev); - t2 = claim_space(div2_nodes); - div1 = claim_element(div2_nodes, "DIV", { - class: true, - id: true, - "data-test-id": true - }); - var div1_nodes = children(div1); - h4 = claim_element(div1_nodes, "H4", { class: true }); - var h4_nodes = children(h4); - t3 = claim_text(h4_nodes, t3_value); - h4_nodes.forEach(detach_dev); - t4 = claim_space(div1_nodes); - p = claim_element(div1_nodes, "P", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(p) !== "svelte-1hipn4t") - p.textContent = textContent_1; - t6 = claim_space(div1_nodes); - if (if_block0) - if_block0.l(div1_nodes); - div1_nodes.forEach(detach_dev); - div2_nodes.forEach(detach_dev); - div3_nodes.forEach(detach_dev); - t7 = claim_space(nodes); - if (if_block1) - if_block1.l(nodes); - if_block1_anchor = empty(); - this.h(); - }, - h: function hydrate() { - attr_dev(h2, "class", "text-lg font-bold"); - add_location(h2, file4, 80, 6, 2247); - attr_dev(div0, "class", "border-b border-slate-100 border-solid py-4 px-4"); - attr_dev(div0, "data-test-id", "logo"); - add_location(div0, file4, 79, 4, 2158); - attr_dev(ul, "class", "py-4 h-[calc(100vh_-_61px)] overflow-y-auto"); - attr_dev(ul, "data-test-id", "component-tree"); - add_location(ul, file4, 82, 4, 2308); - attr_dev(h4, "class", "mb-4 font-bold text-2xl"); - add_location(h4, file4, 113, 6, 3597); - attr_dev(p, "class", "font-medium"); - add_location(p, file4, 114, 6, 3693); - attr_dev(div1, "class", "absolute w-96 left-0 bg-slate-50 inset-y-0 shadow-sm z-50 pt-3 pb-4 px-5 transition-transform duration-500 opacity-0 invisible overflow-y-auto min-h-screen"); - attr_dev(div1, "id", "component-previews"); - attr_dev(div1, "data-test-id", "component-previews"); - toggle_class( - div1, - "translate-x-[255px]", - /*showExamples*/ - ctx[2] - ); - toggle_class( - div1, - "!opacity-100", - /*showExamples*/ - ctx[2] - ); - toggle_class( - div1, - "!visible", - /*showExamples*/ - ctx[2] - ); - add_location(div1, file4, 102, 4, 3086); - attr_dev(div2, "class", "sticky top-0"); - add_location(div2, file4, 78, 2, 2127); - attr_dev(div3, "class", "w-64 bg-white border-slate-100 border-solid border-r svelte-uvq63b"); - attr_dev(div3, "id", "left-sidebar"); - attr_dev(div3, "data-test-id", "left-sidebar"); - add_location(div3, file4, 77, 0, 2012); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div3, anchor); - append_hydration_dev(div3, div2); - append_hydration_dev(div2, div0); - append_hydration_dev(div0, h2); - append_hydration_dev(div2, t1); - append_hydration_dev(div2, ul); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(ul, null); - } - } - append_hydration_dev(div2, t2); - append_hydration_dev(div2, div1); - append_hydration_dev(div1, h4); - append_hydration_dev(h4, t3); - append_hydration_dev(div1, t4); - append_hydration_dev(div1, p); - append_hydration_dev(div1, t6); - if (if_block0) - if_block0.m(div1, null); - insert_hydration_dev(target, t7, anchor); - if (if_block1) - if_block1.m(target, anchor); - insert_hydration_dev(target, if_block1_anchor, anchor); - current = true; - if (!mounted) { - dispose = [ - listen_dev( - div1, - "mouseenter", - /*abortCollapseCategoryMenu*/ - ctx[6], - false, - false, - false, - false - ), - listen_dev( - div1, - "mouseleave", - /*collapseCategoryMenu*/ - ctx[5], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(ctx2, [dirty]) { - if (dirty & /*menuCategories, expandCategoryMenu, collapseCategoryMenu, sectionTitles*/ - 178) { - each_value_1 = ensure_array_like_dev( - /*menuCategories*/ - ctx2[1] - ); - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(ul, null); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value_1.length; - } - if ((!current || dirty & /*$currentComponentCategory*/ - 1) && t3_value !== (t3_value = /*sectionTitles*/ - ctx2[4][ - /*$currentComponentCategory*/ - ctx2[0]?.name - ] + "")) - set_data_dev(t3, t3_value); - if ( - /*currentDefinitions*/ - ctx2[3] - ) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_1(ctx2); - if_block0.c(); - if_block0.m(div1, null); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (!current || dirty & /*showExamples*/ - 4) { - toggle_class( - div1, - "translate-x-[255px]", - /*showExamples*/ - ctx2[2] - ); - } - if (!current || dirty & /*showExamples*/ - 4) { - toggle_class( - div1, - "!opacity-100", - /*showExamples*/ - ctx2[2] - ); - } - if (!current || dirty & /*showExamples*/ - 4) { - toggle_class( - div1, - "!visible", - /*showExamples*/ - ctx2[2] - ); - } - if ( - /*showExamples*/ - ctx2[2] - ) { - if (if_block1) { - if (dirty & /*showExamples*/ - 4) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block2(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div1_transition) - div1_transition = create_bidirectional_transition(div1, translate, { x: 384 }, true); - div1_transition.run(1); - }); - } - transition_in(if_block1); - current = true; - }, - o: function outro(local) { - if (local) { - if (!div1_transition) - div1_transition = create_bidirectional_transition(div1, translate, { x: 384 }, false); - div1_transition.run(0); - } - transition_out(if_block1); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div3); - detach_dev(t7); - detach_dev(if_block1_anchor); - } - destroy_each(each_blocks, detaching); - if (if_block0) - if_block0.d(); - if (detaching && div1_transition) - div1_transition.end(); - if (if_block1) - if_block1.d(detaching); - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment4.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance4($$self, $$props, $$invalidate) { - let componentDefinitions; - let componentDefinitionsByCategory; - let currentDefinitions; - let $draggedComponentDefinition; - let $currentComponentCategory; - validate_store(draggedComponentDefinition, "draggedComponentDefinition"); - component_subscribe($$self, draggedComponentDefinition, ($$value) => $$invalidate(17, $draggedComponentDefinition = $$value)); - validate_store(currentComponentCategory, "currentComponentCategory"); - component_subscribe($$self, currentComponentCategory, ($$value) => $$invalidate(0, $currentComponentCategory = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("ComponentsSidebar", slots, []); - let { components } = $$props; - let menuCategories = []; - const sectionTitles = { - basic: "Basics", - html_tag: "HTML Tags", - data: "Data", - element: "Elements", - media: "Media", - section: "Section" - }; - let showExamples = false; - let hideComponentTimer; - let changeCategoryTimer; - function collapseCategoryMenu() { - clearTimeout(changeCategoryTimer); - hideComponentTimer = setTimeout( - () => { - $$invalidate(2, showExamples = false); - }, - 400 - ); - } - function abortCollapseCategoryMenu() { - clearTimeout(hideComponentTimer); - } - function expandCategoryMenu(componentCategory) { - if ($draggedComponentDefinition) - return; - clearTimeout(hideComponentTimer); - if (showExamples) { - changeCategoryTimer = setTimeout( - () => { - set_store_value(currentComponentCategory, $currentComponentCategory = componentCategory, $currentComponentCategory); - $$invalidate(2, showExamples = true); - }, - 100 - ); - } else { - set_store_value(currentComponentCategory, $currentComponentCategory = componentCategory, $currentComponentCategory); - $$invalidate(2, showExamples = true); - } - } - function dragStart(componentDefinition, e) { - setTimeout( - () => { - set_store_value(draggedComponentDefinition, $draggedComponentDefinition = componentDefinition, $draggedComponentDefinition); - $$invalidate(2, showExamples = false); - }, - 100 - ); - } - function dragEnd() { - resetDrag(); - } - $$self.$$.on_mount.push(function() { - if (components === void 0 && !("components" in $$props || $$self.$$.bound[$$self.$$.props["components"]])) { - console.warn(" was created without expected prop 'components'"); - } - }); - const writable_props = ["components"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - const mouseenter_handler = (item) => expandCategoryMenu(item); - const dragstart_handler = (example, e) => dragStart(example, e); - $$self.$$set = ($$props2) => { - if ("components" in $$props2) - $$invalidate(10, components = $$props2.components); - }; - $$self.$capture_state = () => ({ - fade, - translate, - currentComponentCategory, - draggedComponentDefinition, - resetDrag, - components, - menuCategories, - sectionTitles, - showExamples, - hideComponentTimer, - changeCategoryTimer, - collapseCategoryMenu, - abortCollapseCategoryMenu, - expandCategoryMenu, - dragStart, - dragEnd, - componentDefinitionsByCategory, - currentDefinitions, - componentDefinitions, - $draggedComponentDefinition, - $currentComponentCategory - }); - $$self.$inject_state = ($$props2) => { - if ("components" in $$props2) - $$invalidate(10, components = $$props2.components); - if ("menuCategories" in $$props2) - $$invalidate(1, menuCategories = $$props2.menuCategories); - if ("showExamples" in $$props2) - $$invalidate(2, showExamples = $$props2.showExamples); - if ("hideComponentTimer" in $$props2) - hideComponentTimer = $$props2.hideComponentTimer; - if ("changeCategoryTimer" in $$props2) - changeCategoryTimer = $$props2.changeCategoryTimer; - if ("componentDefinitionsByCategory" in $$props2) - $$invalidate(11, componentDefinitionsByCategory = $$props2.componentDefinitionsByCategory); - if ("currentDefinitions" in $$props2) - $$invalidate(3, currentDefinitions = $$props2.currentDefinitions); - if ("componentDefinitions" in $$props2) - $$invalidate(12, componentDefinitions = $$props2.componentDefinitions); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*components*/ - 1024) { - $: - $$invalidate(12, componentDefinitions = components); - } - if ($$self.$$.dirty & /*componentDefinitions*/ - 4096) { - $: - $$invalidate(1, menuCategories = [ - { - name: "Base", - items: Array.from(new Set(componentDefinitions.map((d) => d.category))).map((id) => ({ id, name: id })) - } - ]); - } - if ($$self.$$.dirty & /*componentDefinitions*/ - 4096) { - $: - $$invalidate(11, componentDefinitionsByCategory = (componentDefinitions || []).reduce( - (acc, comp) => { - var _a; - acc[_a = comp.category] || (acc[_a] = []); - acc[comp.category].push(comp); - return acc; - }, - {} - )); - } - if ($$self.$$.dirty & /*$currentComponentCategory, componentDefinitionsByCategory*/ - 2049) { - $: - $$invalidate(3, currentDefinitions = $currentComponentCategory ? componentDefinitionsByCategory[$currentComponentCategory.id] : []); - } - }; - return [ - $currentComponentCategory, - menuCategories, - showExamples, - currentDefinitions, - sectionTitles, - collapseCategoryMenu, - abortCollapseCategoryMenu, - expandCategoryMenu, - dragStart, - dragEnd, - components, - componentDefinitionsByCategory, - componentDefinitions, - mouseenter_handler, - dragstart_handler - ]; - } - var ComponentsSidebar = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance4, create_fragment4, safe_not_equal, { components: 10 }, add_css); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "ComponentsSidebar", - options, - id: create_fragment4.name - }); - } - get components() { - return this.$$.ctx[10]; - } - set components(components) { - this.$$set({ components }); - flush(); - } - }; - create_custom_element(ComponentsSidebar, { "components": {} }, [], [], true); - var ComponentsSidebar_default = ComponentsSidebar; - - // svelte/components/LayoutAstNode.svelte - var LayoutAstNode_exports = {}; - __export(LayoutAstNode_exports, { - default: () => LayoutAstNode_default - }); - - // svelte/stores/page.ts - var page = writable(); - var selectedAstElementId = writable(); - var highlightedAstElement = writable(); - var slotTargetElement = writable(); - var rootAstElement = derived([page], ([$page]) => { - if ($page) { - return { tag: "root", attrs: {}, content: $page.ast }; - } - }); - var selectedAstElement = derived( - [page, selectedAstElementId], - ([$page, $selectedAstElementId]) => { - if ($page && $selectedAstElementId) { - if ($selectedAstElementId === "root") - return get_store_value(rootAstElement); - return findAstElement($page.ast, $selectedAstElementId); - } - } - ); - var parentOfSelectedAstElement = derived( - [page, selectedAstElementId], - ([$page, $selectedAstElementId]) => { - if ($page && $selectedAstElementId) { - if ($selectedAstElementId === "root") - return null; - let levels = $selectedAstElementId.split("."); - if (levels.length === 1) - return get_store_value(rootAstElement); - levels.pop(); - return findAstElement($page.ast, levels.join(".")); - } - } - ); - var selectedDomElement = writable(null); - function setSelection(selectedId) { - selectedAstElementId.update(() => selectedId); - } - function setSelectedDom(selectedDom) { - selectedDomElement.update(() => selectedDom); - } - function resetSelection() { - selectedAstElementId.update(() => null); - selectedDomElement.update(() => null); - } - function isAstElement(maybeNode) { - return typeof maybeNode !== "string"; - } - function findAstElement(ast, id) { - let indexes = id.split(".").map((s) => parseInt(s, 10)); - let node = ast[indexes[0]]; - ast = node.content; - for (let i = 1; i < indexes.length; i++) { - node = ast[indexes[i]]; - ast = node.content; - } - return node; - } - function findAstElementId(astNode) { - let $page = get_store_value(page); - return _findAstElementId($page.ast, astNode, ""); - } - function _findAstElementId(ast, astNode, id) { - for (let i = 0; i < ast.length; i++) { - let currentNode = ast[i]; - if (currentNode === astNode) { - return id + i; - } else if (isAstElement(currentNode)) { - let result = currentNode.content && _findAstElementId(currentNode.content, astNode, id + i + "."); - if (result) { - return result; - } - } - } - } - function resetStores() { - page.set(null); - selectedAstElementId.set(null); - highlightedAstElement.set(null); - slotTargetElement.set(null); - selectedDomElement.set(null); - } - - // svelte/components/LayoutAstNode.svelte - var file5 = "svelte/components/LayoutAstNode.svelte"; - function get_each_context2(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[3] = list3[i]; - child_ctx[5] = i; - return child_ctx; - } - function create_else_block_1(ctx) { - let t; - const block = { - c: function create3() { - t = text( - /*node*/ - ctx[0] - ); - }, - l: function claim(nodes) { - t = claim_text( - nodes, - /*node*/ - ctx[0] - ); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1) - set_data_dev( - t, - /*node*/ - ctx2[0] - ); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block_1.name, - type: "else", - source: "(25:0) {:else}", - ctx - }); - return block; - } - function create_if_block3(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [ - create_if_block_12, - create_if_block_22, - create_if_block_3, - create_if_block_4, - create_if_block_5, - create_else_block - ]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].tag === "html_comment" - ) - return 0; - if ( - /*node*/ - ctx2[0].tag === "eex_comment" - ) - return 1; - if ( - /*node*/ - ctx2[0].tag === "eex" && /*node*/ - ctx2[0].content[0] === "@inner_content" - ) - return 2; - if ( - /*node*/ - ctx2[0].rendered_html - ) - return 3; - if ( - /*node*/ - ctx2[0].attrs?.selfClose - ) - return 4; - return 5; - } - current_block_type_index = select_block_type_1(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const block = { - c: function create3() { - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block3.name, - type: "if", - source: "(5:0) {#if isAstElement(node)}", - ctx - }); - return block; - } - function create_else_block(ctx) { - let previous_tag = ( - /*node*/ - ctx[0].tag - ); - let svelte_element_anchor; - let current; - validate_dynamic_element( - /*node*/ - ctx[0].tag - ); - validate_void_dynamic_element( - /*node*/ - ctx[0].tag - ); - let svelte_element = ( - /*node*/ - ctx[0].tag && create_dynamic_element_1(ctx) - ); - const block = { - c: function create3() { - if (svelte_element) - svelte_element.c(); - svelte_element_anchor = empty(); - }, - l: function claim(nodes) { - if (svelte_element) - svelte_element.l(nodes); - svelte_element_anchor = empty(); - }, - m: function mount(target, anchor) { - if (svelte_element) - svelte_element.m(target, anchor); - insert_hydration_dev(target, svelte_element_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].tag - ) { - if (!previous_tag) { - svelte_element = create_dynamic_element_1(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else if (safe_not_equal( - previous_tag, - /*node*/ - ctx2[0].tag - )) { - svelte_element.d(1); - validate_dynamic_element( - /*node*/ - ctx2[0].tag - ); - validate_void_dynamic_element( - /*node*/ - ctx2[0].tag - ); - svelte_element = create_dynamic_element_1(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else { - svelte_element.p(ctx2, dirty); - } - } else if (previous_tag) { - svelte_element.d(1); - svelte_element = null; - previous_tag = /*node*/ - ctx2[0].tag; - } - }, - i: noop2, - o: function outro(local) { - transition_out(svelte_element, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element_anchor); - } - if (svelte_element) - svelte_element.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block.name, - type: "else", - source: "(16:2) {:else}", - ctx - }); - return block; - } - function create_if_block_5(ctx) { - let previous_tag = ( - /*node*/ - ctx[0].tag - ); - let svelte_element_anchor; - validate_dynamic_element( - /*node*/ - ctx[0].tag - ); - let svelte_element = ( - /*node*/ - ctx[0].tag && create_dynamic_element(ctx) - ); - const block = { - c: function create3() { - if (svelte_element) - svelte_element.c(); - svelte_element_anchor = empty(); - }, - l: function claim(nodes) { - if (svelte_element) - svelte_element.l(nodes); - svelte_element_anchor = empty(); - }, - m: function mount(target, anchor) { - if (svelte_element) - svelte_element.m(target, anchor); - insert_hydration_dev(target, svelte_element_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].tag - ) { - if (!previous_tag) { - svelte_element = create_dynamic_element(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else if (safe_not_equal( - previous_tag, - /*node*/ - ctx2[0].tag - )) { - svelte_element.d(1); - validate_dynamic_element( - /*node*/ - ctx2[0].tag - ); - svelte_element = create_dynamic_element(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else { - svelte_element.p(ctx2, dirty); - } - } else if (previous_tag) { - svelte_element.d(1); - svelte_element = null; - previous_tag = /*node*/ - ctx2[0].tag; - } - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element_anchor); - } - if (svelte_element) - svelte_element.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_5.name, - type: "if", - source: "(14:34) ", - ctx - }); - return block; - } - function create_if_block_4(ctx) { - let html_tag; - let raw_value = ( - /*node*/ - ctx[0].rendered_html + "" - ); - let html_anchor; - const block = { - c: function create3() { - html_tag = new HtmlTagHydration(false); - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_tag = claim_html_tag(nodes, false); - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag.a = html_anchor; - }, - m: function mount(target, anchor) { - html_tag.m(raw_value, target, anchor); - insert_hydration_dev(target, html_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = /*node*/ - ctx2[0].rendered_html + "")) - html_tag.p(raw_value); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(html_anchor); - html_tag.d(); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_4.name, - type: "if", - source: "(12:31) ", - ctx - }); - return block; - } - function create_if_block_3(ctx) { - let current; - const default_slot_template = ( - /*#slots*/ - ctx[2].default - ); - const default_slot = create_slot( - default_slot_template, - ctx, - /*$$scope*/ - ctx[1], - null - ); - const block = { - c: function create3() { - if (default_slot) - default_slot.c(); - }, - l: function claim(nodes) { - if (default_slot) - default_slot.l(nodes); - }, - m: function mount(target, anchor) { - if (default_slot) { - default_slot.m(target, anchor); - } - current = true; - }, - p: function update2(ctx2, dirty) { - if (default_slot) { - if (default_slot.p && (!current || dirty & /*$$scope*/ - 2)) { - update_slot_base( - default_slot, - default_slot_template, - ctx2, - /*$$scope*/ - ctx2[1], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[1] - ) : get_slot_changes( - default_slot_template, - /*$$scope*/ - ctx2[1], - dirty, - null - ), - null - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(default_slot, local); - current = true; - }, - o: function outro(local) { - transition_out(default_slot, local); - current = false; - }, - d: function destroy(detaching) { - if (default_slot) - default_slot.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_3.name, - type: "if", - source: "(10:71) ", - ctx - }); - return block; - } - function create_if_block_22(ctx) { - let html_tag; - let raw_value = ""; - let html_anchor; - const block = { - c: function create3() { - html_tag = new HtmlTagHydration(false); - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_tag = claim_html_tag(nodes, false); - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag.a = html_anchor; - }, - m: function mount(target, anchor) { - html_tag.m(raw_value, target, anchor); - insert_hydration_dev(target, html_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = "")) - html_tag.p(raw_value); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(html_anchor); - html_tag.d(); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_22.name, - type: "if", - source: "(8:39) ", - ctx - }); - return block; - } - function create_if_block_12(ctx) { - let html_tag; - let raw_value = ""; - let html_anchor; - const block = { - c: function create3() { - html_tag = new HtmlTagHydration(false); - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_tag = claim_html_tag(nodes, false); - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag.a = html_anchor; - }, - m: function mount(target, anchor) { - html_tag.m(raw_value, target, anchor); - insert_hydration_dev(target, html_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = "")) - html_tag.p(raw_value); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(html_anchor); - html_tag.d(); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_12.name, - type: "if", - source: '(6:2) {#if node.tag === \\"html_comment\\"}', - ctx - }); - return block; - } - function create_if_block_6(ctx) { - let each_1_anchor; - let current; - let each_value = ensure_array_like_dev( - /*node*/ - ctx[0].content - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - const block = { - c: function create3() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - l: function claim(nodes) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, each_1_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1) { - each_value = ensure_array_like_dev( - /*node*/ - ctx2[0].content - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_6.name, - type: "if", - source: "(18:6) {#if node.content}", - ctx - }); - return block; - } - function create_each_block2(ctx) { - let layoutastnode; - let current; - layoutastnode = new LayoutAstNode({ - props: { node: ( - /*subnode*/ - ctx[3] - ) }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(layoutastnode.$$.fragment); - }, - l: function claim(nodes) { - claim_component(layoutastnode.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(layoutastnode, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const layoutastnode_changes = {}; - if (dirty & /*node*/ - 1) - layoutastnode_changes.node = /*subnode*/ - ctx2[3]; - layoutastnode.$set(layoutastnode_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(layoutastnode.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(layoutastnode.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(layoutastnode, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block2.name, - type: "each", - source: "(19:8) {#each node.content as subnode, index}", - ctx - }); - return block; - } - function create_dynamic_element_1(ctx) { - let svelte_element; - let current; - let if_block = ( - /*node*/ - ctx[0].content && create_if_block_6(ctx) - ); - let svelte_element_levels = [ - /*node*/ - ctx[0].attrs - ]; - let svelte_element_data = {}; - for (let i = 0; i < svelte_element_levels.length; i += 1) { - svelte_element_data = assign(svelte_element_data, svelte_element_levels[i]); - } - const block = { - c: function create3() { - svelte_element = element( - /*node*/ - ctx[0].tag - ); - if (if_block) - if_block.c(); - this.h(); - }, - l: function claim(nodes) { - svelte_element = claim_element( - nodes, - /*node*/ - (ctx[0].tag || "null").toUpperCase(), - {} - ); - var svelte_element_nodes = children(svelte_element); - if (if_block) - if_block.l(svelte_element_nodes); - svelte_element_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - set_dynamic_element_data( - /*node*/ - ctx[0].tag - )(svelte_element, svelte_element_data); - add_location(svelte_element, file5, 18, 4, 532); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, svelte_element, anchor); - if (if_block) - if_block.m(svelte_element, null); - current = true; - }, - p: function update2(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].content - ) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty & /*node*/ - 1) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_6(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(svelte_element, null); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - set_dynamic_element_data( - /*node*/ - ctx2[0].tag - )(svelte_element, svelte_element_data = get_spread_update(svelte_element_levels, [dirty & /*node*/ - 1 && /*node*/ - ctx2[0].attrs])); - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element); - } - if (if_block) - if_block.d(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_dynamic_element_1.name, - type: "child_dynamic_element", - source: "(17:4) ", - ctx - }); - return block; - } - function create_dynamic_element(ctx) { - let svelte_element; - let svelte_element_levels = [ - /*node*/ - ctx[0].attrs - ]; - let svelte_element_data = {}; - for (let i = 0; i < svelte_element_levels.length; i += 1) { - svelte_element_data = assign(svelte_element_data, svelte_element_levels[i]); - } - const block = { - c: function create3() { - svelte_element = element( - /*node*/ - ctx[0].tag - ); - this.h(); - }, - l: function claim(nodes) { - svelte_element = claim_element( - nodes, - /*node*/ - (ctx[0].tag || "null").toUpperCase(), - {} - ); - children(svelte_element).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - set_dynamic_element_data( - /*node*/ - ctx[0].tag - )(svelte_element, svelte_element_data); - add_location(svelte_element, file5, 16, 4, 467); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, svelte_element, anchor); - }, - p: function update2(ctx2, dirty) { - set_dynamic_element_data( - /*node*/ - ctx2[0].tag - )(svelte_element, svelte_element_data = get_spread_update(svelte_element_levels, [dirty & /*node*/ - 1 && /*node*/ - ctx2[0].attrs])); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_dynamic_element.name, - type: "child_dynamic_element", - source: "(15:4) ", - ctx - }); - return block; - } - function create_fragment5(ctx) { - let show_if; - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block3, create_else_block_1]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if (dirty & /*node*/ - 1) - show_if = null; - if (show_if == null) - show_if = !!isAstElement( - /*node*/ - ctx2[0] - ); - if (show_if) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const block = { - c: function create3() { - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, [dirty]) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment5.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance5($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("LayoutAstNode", slots, ["default"]); - let { node } = $$props; - $$self.$$.on_mount.push(function() { - if (node === void 0 && !("node" in $$props || $$self.$$.bound[$$self.$$.props["node"]])) { - console.warn(" was created without expected prop 'node'"); - } - }); - const writable_props = ["node"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - $$self.$$set = ($$props2) => { - if ("node" in $$props2) - $$invalidate(0, node = $$props2.node); - if ("$$scope" in $$props2) - $$invalidate(1, $$scope = $$props2.$$scope); - }; - $$self.$capture_state = () => ({ isAstElement, node }); - $$self.$inject_state = ($$props2) => { - if ("node" in $$props2) - $$invalidate(0, node = $$props2.node); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - return [node, $$scope, slots]; - } - var LayoutAstNode = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance5, create_fragment5, safe_not_equal, { node: 0 }); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "LayoutAstNode", - options, - id: create_fragment5.name - }); - } - get node() { - return this.$$.ctx[0]; - } - set node(node) { - this.$$set({ node }); - flush(); - } - }; - create_custom_element(LayoutAstNode, { "node": {} }, ["default"], [], true); - var LayoutAstNode_default = LayoutAstNode; - - // svelte/components/PageAstNode.svelte - var PageAstNode_exports = {}; - __export(PageAstNode_exports, { - default: () => PageAstNode_default - }); - - // svelte/stores/live.ts - var live = writable(); - - // svelte/utils/ast-helpers.ts - function getParentNodeId(astElementId = null) { - if (astElementId) { - let parts = astElementId.split("."); - if (parts.length === 1) - return "root"; - return parts.slice(0, -1).join("."); - } - } - - // svelte/utils/ast-manipulation.ts - function updateNodeContent(node, text2) { - if (node && isAstElement(node)) { - node.content = [text2]; - updateAst(); - } - } - function updateAst() { - let currentPage = get_store_value(page); - let live2 = get_store_value(live); - live2.pushEvent("update_page_ast", { id: currentPage.id, ast: currentPage.ast }); - } - function deleteAstNode(astElementId) { - let currentPage = get_store_value(page); - let live2 = get_store_value(live); - let astElement = findAstElement(currentPage.ast, astElementId); - let parentId = getParentNodeId(astElementId); - let content = parentId && parentId !== "root" ? findAstElement(currentPage.ast, parentId)?.content : currentPage.ast; - if (content) { - let targetIndex = content.indexOf(astElement); - content.splice(targetIndex, 1); - updateAst(); - } - } - - // svelte/utils/drag-helpers.ts - function elementCanBeDroppedInTarget(draggedComponentDefinition2) { - return true; - } - function detectFlow(rects) { - let horizontal = false; - let vertical = false; - const threshold = 5; - for (let i = 1; i < rects.length; i++) { - let prevRect = rects[i - 1]; - let currentRect = rects[i]; - let xChange = Math.abs(currentRect.x - prevRect.x); - let yChange = Math.abs(currentRect.y - prevRect.y); - if (xChange > threshold && yChange < threshold) { - horizontal = true; - } - if (yChange > threshold) { - vertical = true; - } - } - if (horizontal && vertical) { - return "both"; - } else if (horizontal) { - return "horizontal"; - } else { - return "vertical"; - } - } - function getDragDirection(element2) { - let parentEl = element2.parentElement; - if (parentEl === null) { - return "vertical"; - } - let rects = Array.from(parentEl.children).map((child) => child.getBoundingClientRect()); - return detectFlow(rects); - } - function getBoundingRect(el) { - if (window.getComputedStyle(el).display === "contents") { - if (el.children.length === 1) { - return el.children[0].getBoundingClientRect(); - } - const rects = Array.from(el.children).map((e) => e.getBoundingClientRect()); - let top = Math.min(...rects.map((r) => r.top)); - let bottom = Math.max(...rects.map((r) => r.bottom)); - let left = Math.min(...rects.map((r) => r.left)); - let right = Math.max(...rects.map((r) => r.right)); - return { - x: Math.min(...rects.map((r) => r.x)), - y: Math.min(...rects.map((r) => r.y)), - top, - right, - bottom, - left, - width: right - left, - height: bottom - top - }; - } - return el.getBoundingClientRect(); - } - function findHoveredSiblingIndex(dragDirection, mouseDiff, siblingRects, selectedIndex) { - const currentRect = offsetRect(siblingRects[selectedIndex], mouseDiff); - let bestMatchIndex = selectedIndex; - let bestOverlapScore = 0; - for (let i = 0; i < siblingRects.length; i++) { - if (i !== selectedIndex) { - const rect = siblingRects[i]; - const overlap = calculateOverlap(rect, currentRect, dragDirection); - if (overlap === 0) { - continue; - } - if (overlap > bestOverlapScore) { - bestOverlapScore = overlap; - bestMatchIndex = i; - continue; - } - if (overlap === bestOverlapScore) { - let currentMatch = siblingRects[bestMatchIndex]; - if (calculateCenterDistance(rect, currentMatch) < calculateCenterDistance(currentRect, currentMatch)) { - bestMatchIndex = i; - } - } - } - } - return bestMatchIndex; - } - function calculateOverlap(rect, draggedRect, dragDirection) { - if (dragDirection === "horizontal") { - const xOverlap = Math.max(0, Math.min(rect.right, draggedRect.right) - Math.max(rect.left, draggedRect.left)); - return 100 * xOverlap / Math.min(rect.width, draggedRect.width); - } else if (dragDirection === "vertical") { - const yOverlap = Math.max(0, Math.min(rect.bottom, draggedRect.bottom) - Math.max(rect.top, draggedRect.top)); - return 100 * yOverlap / Math.min(rect.height, draggedRect.height); - } else { - alert("Bidirational drag not supported yet"); - } - } - function calculateCenterDistance(rect1, rect2) { - return calculateDistance(calculateCenter(rect1), calculateCenter(rect2)); - } - function calculateCenter(rect) { - return { - x: rect.left + rect.width / 2, - y: rect.top + rect.height / 2 - }; - } - function calculateDistance(point1, point2) { - return Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2)); - } - function offsetRect(rect, mouseDiff) { - const newRect = { ...rect }; - newRect.x += mouseDiff.x; - newRect.left += mouseDiff.x; - newRect.right += mouseDiff.x; - newRect.y += mouseDiff.y; - newRect.top += mouseDiff.y; - newRect.bottom += mouseDiff.y; - return newRect; - } - - // svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte - var DragMenuOption_exports = {}; - __export(DragMenuOption_exports, { - default: () => DragMenuOption_default, - initSelectedElementDragMenuPosition: () => initSelectedElementDragMenuPosition, - isDragging: () => isDragging - }); - var file6 = "svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte"; - function create_if_block4(ctx) { - let t; - let button; - let svg; - let path0; - let path1; - let path2; - let mounted; - let dispose; - let if_block = ( - /*placeholderStyle*/ - ctx[1] && create_if_block_13(ctx) - ); - const block = { - c: function create3() { - if (if_block) - if_block.c(); - t = space(); - button = element("button"); - svg = svg_element("svg"); - path0 = svg_element("path"); - path1 = svg_element("path"); - path2 = svg_element("path"); - this.h(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - t = claim_space(nodes); - button = claim_element(nodes, "BUTTON", { class: true, style: true }); - var button_nodes = children(button); - svg = claim_svg_element(button_nodes, "svg", { xmlns: true, width: true, height: true }); - var svg_nodes = children(svg); - path0 = claim_svg_element(svg_nodes, "path", { d: true, fill: true }); - children(path0).forEach(detach_dev); - path1 = claim_svg_element(svg_nodes, "path", { d: true, fill: true }); - children(path1).forEach(detach_dev); - path2 = claim_svg_element(svg_nodes, "path", { d: true, fill: true }); - children(path2).forEach(detach_dev); - svg_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(path0, "d", "M 1 2.5 C 1 1.948 1.448 1.5 2 1.5 L 10 1.5 C 10.552 1.5 11 1.948 11 2.5 L 11 2.5 C 11 3.052 10.552 3.5 10 3.5 L 2 3.5 C 1.448 3.5 1 3.052 1 2.5 Z"); - attr_dev(path0, "fill", "currentColor"); - add_location(path0, file6, 374, 7, 13510); - attr_dev(path1, "d", "M 1 6 C 1 5.448 1.448 5 2 5 L 10 5 C 10.552 5 11 5.448 11 6 L 11 6 C 11 6.552 10.552 7 10 7 L 2 7 C 1.448 7 1 6.552 1 6 Z"); - attr_dev(path1, "fill", "currentColor"); - add_location(path1, file6, 377, 14, 13716); - attr_dev(path2, "d", "M 1 9.5 C 1 8.948 1.448 8.5 2 8.5 L 10 8.5 C 10.552 8.5 11 8.948 11 9.5 L 11 9.5 C 11 10.052 10.552 10.5 10 10.5 L 2 10.5 C 1.448 10.5 1 10.052 1 9.5 Z"); - attr_dev(path2, "fill", "currentColor"); - add_location(path2, file6, 380, 14, 13898); - attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg, "width", "12"); - attr_dev(svg, "height", "12"); - add_location(svg, file6, 373, 4, 13440); - attr_dev(button, "class", "rounded-full w-6 h-6 flex justify-center items-center absolute bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus-visible:ring-4 focus-visible:ring-blue-200 active:bg-blue-800 transform"); - attr_dev( - button, - "style", - /*$dragHandleStyle*/ - ctx[4] - ); - toggle_class( - button, - "rotate-90", - /*rotated*/ - ctx[2] - ); - add_location(button, file6, 366, 2, 13083); - }, - m: function mount(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, t, anchor); - insert_hydration_dev(target, button, anchor); - append_hydration_dev(button, svg); - append_hydration_dev(svg, path0); - append_hydration_dev(svg, path1); - append_hydration_dev(svg, path2); - ctx[8](button); - if (!mounted) { - dispose = listen_dev( - button, - "mousedown", - /*handleMousedown*/ - ctx[5], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if ( - /*placeholderStyle*/ - ctx2[1] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_13(ctx2); - if_block.c(); - if_block.m(t.parentNode, t); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & /*$dragHandleStyle*/ - 16) { - attr_dev( - button, - "style", - /*$dragHandleStyle*/ - ctx2[4] - ); - } - if (dirty & /*rotated*/ - 4) { - toggle_class( - button, - "rotate-90", - /*rotated*/ - ctx2[2] - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - detach_dev(button); - } - if (if_block) - if_block.d(detaching); - ctx[8](null); - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block4.name, - type: "if", - source: "(292:0) {#if canBeDragged}", - ctx - }); - return block; - } - function create_if_block_13(ctx) { - let div; - let div_style_value; - const block = { - c: function create3() { - div = element("div"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, style: true }); - children(div).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "absolute transition-all"); - attr_dev(div, "style", div_style_value = "background-color:aqua; opacity: 0.5; " + /*placeholderStyle*/ - ctx[1]); - add_location(div, file6, 364, 4, 12965); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*placeholderStyle*/ - 2 && div_style_value !== (div_style_value = "background-color:aqua; opacity: 0.5; " + /*placeholderStyle*/ - ctx2[1])) { - attr_dev(div, "style", div_style_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_13.name, - type: "if", - source: "(293:2) {#if placeholderStyle}", - ctx - }); - return block; - } - function create_fragment6(ctx) { - let if_block_anchor; - let if_block = ( - /*canBeDragged*/ - ctx[3] && create_if_block4(ctx) - ); - const block = { - c: function create3() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - }, - p: function update2(ctx2, [dirty]) { - if ( - /*canBeDragged*/ - ctx2[3] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block4(ctx2); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if (if_block) - if_block.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment6.name, - type: "component", - source: "", - ctx - }); - return block; - } - var currentHandleCoords; - var relativeWrapperRect; - var dragHandleStyle = writable(""); - var isDragging = writable(false); - var dragElementInfo; - function initSelectedElementDragMenuPosition(selectedDomEl, mouseDiff) { - let rect = dragElementInfo ? dragElementInfo.siblingLocationInfos[dragElementInfo.selectedIndex] : getBoundingRect(selectedDomEl); - updateHandleCoords(rect, mouseDiff); - let styles = []; - if (currentHandleCoords?.y) { - styles.push(`top: ${currentHandleCoords.y}px`); - } - if (currentHandleCoords?.x) { - styles.push(`left: ${currentHandleCoords.x}px`); - } - dragHandleStyle.set(styles.join(";")); - } - function updateHandleCoords(currentRect, movement = { x: 0, y: 0 }) { - relativeWrapperRect = document.getElementById("ui-builder-app-container").closest(".relative").getBoundingClientRect(); - currentHandleCoords = { - x: currentRect.x - relativeWrapperRect.x + movement.x + currentRect.width / 2 - 5, - y: currentRect.y - relativeWrapperRect.y + movement.y + currentRect.height + 5 - }; - } - function getGhostElement() { - return dragElementInfo.parentElementClone.children.item(dragElementInfo.selectedIndex); - } - function findSwappedIndexes(dragDirection, mouseDiff, e) { - let hoveredElementIndex = findHoveredSiblingIndex(dragDirection, mouseDiff, dragElementInfo.siblingLocationInfos, dragElementInfo.selectedIndex); - if (hoveredElementIndex === -1) { - return { - currentIndex: dragElementInfo.selectedIndex, - destinationIndex: dragElementInfo.selectedIndex - }; - } - return { - currentIndex: dragElementInfo.selectedIndex, - destinationIndex: hoveredElementIndex - }; - } - function sortedLocationInfos(infos, draggedElementIndex, destinationIndex) { - let newInfos = [...infos]; - let info = newInfos.splice(draggedElementIndex, 1)[0]; - newInfos.splice(destinationIndex, 0, info); - return newInfos; - } - function calculateNewDistance(dragDirection, index4, draggedElementIndex, destinationIndex, newInfos) { - if (index4 < destinationIndex && index4 < draggedElementIndex || index4 > destinationIndex && index4 > draggedElementIndex) - return; - let newIndex; - if (index4 === draggedElementIndex) { - newIndex = destinationIndex; - } else { - if (draggedElementIndex > destinationIndex) { - newIndex = index4 < draggedElementIndex && index4 >= destinationIndex ? index4 + 1 : index4; - } else { - newIndex = index4 > draggedElementIndex && index4 <= destinationIndex ? index4 - 1 : index4; - } - } - let distance = 0; - let i = 0; - if (dragDirection === "vertical") { - while (i < newInfos.length && i < newIndex) { - let gap2 = 0; - if (i > 0) { - gap2 = dragElementInfo.siblingLocationInfos[i].top - dragElementInfo.siblingLocationInfos[i - 1].bottom; - } - distance += newInfos[i].height + gap2; - i++; - } - let gap = 0; - if (newIndex > 0) { - dragElementInfo.siblingLocationInfos; - gap = dragElementInfo.siblingLocationInfos[newIndex].top - dragElementInfo.siblingLocationInfos[newIndex - 1].bottom; - } - distance += gap + dragElementInfo.siblingLocationInfos[0].top; - } else { - while (i < newInfos.length && i < newIndex) { - let gap2 = 0; - if (i > 0) { - gap2 = dragElementInfo.siblingLocationInfos[i].left - dragElementInfo.siblingLocationInfos[i - 1].right; - } - distance += newInfos[i].width + gap2; - i++; - } - let gap = 0; - if (newIndex > 0) { - dragElementInfo.siblingLocationInfos; - gap = dragElementInfo.siblingLocationInfos[newIndex].left - dragElementInfo.siblingLocationInfos[newIndex - 1].right; - } - distance += gap + dragElementInfo.siblingLocationInfos[0].left; - } - return distance; - } - function instance6($$self, $$props, $$invalidate) { - let canBeDragged; - let rotated; - let $isDragging, $$unsubscribe_isDragging = noop2, $$subscribe_isDragging = () => ($$unsubscribe_isDragging(), $$unsubscribe_isDragging = subscribe(isDragging, ($$value) => $$invalidate(12, $isDragging = $$value)), isDragging); - let $page; - let $live; - let $selectedAstElementId; - let $parentOfSelectedAstElement; - let $dragHandleStyle; - validate_store(isDragging, "isDragging"); - component_subscribe($$self, isDragging, ($$value) => $$invalidate(12, $isDragging = $$value)); - validate_store(page, "page"); - component_subscribe($$self, page, ($$value) => $$invalidate(13, $page = $$value)); - validate_store(live, "live"); - component_subscribe($$self, live, ($$value) => $$invalidate(14, $live = $$value)); - validate_store(selectedAstElementId, "selectedAstElementId"); - component_subscribe($$self, selectedAstElementId, ($$value) => $$invalidate(15, $selectedAstElementId = $$value)); - validate_store(parentOfSelectedAstElement, "parentOfSelectedAstElement"); - component_subscribe($$self, parentOfSelectedAstElement, ($$value) => $$invalidate(16, $parentOfSelectedAstElement = $$value)); - validate_store(dragHandleStyle, "dragHandleStyle"); - component_subscribe($$self, dragHandleStyle, ($$value) => $$invalidate(4, $dragHandleStyle = $$value)); - $$self.$$.on_destroy.push(() => $$unsubscribe_isDragging()); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("DragMenuOption", slots, []); - let { element: element2 } = $$props; - let { isParent = false } = $$props; - let originalSiblings; - let dragHandleElement; - function snapshotSelectedElementSiblings() { - let siblings = Array.from(element2.parentElement.children); - let selectedIndex = siblings.indexOf(element2); - let el = element2.parentElement.cloneNode(true); - let elChildren = Array.from(el.children); - for (let i = 0; i < elChildren.length; i++) { - elChildren[i].setAttribute("data-is-clone", "true"); - } - dragElementInfo = { - parentElementClone: el, - selectedIndex, - siblingLocationInfos: siblings.map((el2, i) => { - let { x, y, width, height, top, right, bottom, left } = getBoundingRect(el2); - return { - x, - y, - width, - height, - top, - right, - bottom, - left - }; - }) - }; - $$invalidate(6, element2.parentElement.style.display = "none", element2); - element2.parentElement.parentNode.insertBefore(el, element2.parentElement); - originalSiblings = Array.from(dragElementInfo.parentElementClone.children); - } - let mouseDownEvent; - async function handleMousedown(e) { - set_store_value(isDragging, $isDragging = true, $isDragging); - mouseDownEvent = e; - document.addEventListener("mousemove", handleMousemove); - document.addEventListener("mouseup", handleMouseup); - snapshotSelectedElementSiblings(); - } - function applyNewOrder() { - if (newIndex !== dragElementInfo.selectedIndex) { - let parent = $parentOfSelectedAstElement; - const selectedAstElement2 = parent.content.splice(dragElementInfo.selectedIndex, 1)[0]; - parent.content.splice(newIndex, 0, selectedAstElement2); - set_store_value(page, $page.ast = [...$page.ast], $page); - let parts = $selectedAstElementId.split("."); - parts[parts.length - 1] = newIndex.toString(); - set_store_value(selectedAstElementId, $selectedAstElementId = parts.join("."), $selectedAstElementId); - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - function resetDragElementHandle() { - $$invalidate(0, dragHandleElement.style.transform = null, dragHandleElement); - dragHandleElement.style.setProperty("--tw-translate-y", null); - dragHandleElement.style.setProperty("--tw-translate-x", null); - } - async function handleMouseup(e) { - document.removeEventListener("mousemove", handleMousemove); - document.removeEventListener("mouseup", handleMouseup); - applyNewOrder(); - if (dragElementInfo) { - $$invalidate(6, element2.parentElement.style.display = null, element2); - dragElementInfo.parentElementClone.remove(); - dragElementInfo = null; - } - mouseDownEvent = null; - await tick(); - set_store_value(isDragging, $isDragging = false, $isDragging); - resetDragElementHandle(); - $$invalidate(1, placeholderStyle = null); - originalSiblings = null; - } - function repositionChildren(currentIndex, destinationIndex) { - const newChildren = [...originalSiblings]; - const element3 = newChildren.splice(currentIndex, 1)[0]; - newChildren.splice(destinationIndex, 0, element3); - dragElementInfo.parentElementClone.replaceChildren(...newChildren); - } - function repositionGhosts(currentIndex, destinationIndex) { - let parentElement = dragElementInfo.parentElementClone; - const children2 = Array.from(parentElement.children); - const firstRects = children2.map((child) => child.getBoundingClientRect()); - repositionChildren(currentIndex, destinationIndex); - const lastRects = children2.map((child) => child.getBoundingClientRect()); - children2.forEach((child, i) => { - const firstRect = firstRects[i]; - const lastRect = lastRects[i]; - const deltaX = firstRect.left - lastRect.left; - const deltaY = firstRect.top - lastRect.top; - child.style.transform = `translate(${deltaX}px, ${deltaY}px)`; - child.style.transition = "transform 0s"; - }); - requestAnimationFrame(() => { - children2.forEach((child) => { - child.style.transition = "transform 0.15s"; - child.style.transform = ""; - }); - }); - } - function calculatePlaceholderPosition(dragDirection, currentIndex, destinationIndex, locationInfos, mouseDiff) { - const currentRect = dragElementInfo.siblingLocationInfos[currentIndex]; - const destinationRect = dragElementInfo.siblingLocationInfos[destinationIndex]; - $$invalidate(1, placeholderStyle = `top: ${destinationRect.top - relativeWrapperRect.top}px; left: ${destinationRect.left - relativeWrapperRect.left}px; height: ${currentRect.height}px; width: ${currentRect.width}px;`); - } - let placeholderStyle = null; - let newIndex = null; - function updateSiblingsPositioning(dragDirection, mouseDiff, e) { - if (!relativeWrapperRect) { - relativeWrapperRect = document.getElementById("ui-builder-app-container").closest(".relative").getBoundingClientRect(); - } - let { currentIndex, destinationIndex } = findSwappedIndexes(dragDirection, mouseDiff, e); - if (newIndex !== destinationIndex) { - repositionGhosts(currentIndex, destinationIndex); - calculatePlaceholderPosition(dragDirection, currentIndex, destinationIndex, dragElementInfo.siblingLocationInfos, mouseDiff); - newIndex = destinationIndex; - } - } - function handleMousemove(e) { - let ghostElement = getGhostElement(); - let dragDirection = getDragDirection(ghostElement); - let mouseDiff = { - x: e.x - mouseDownEvent.x, - y: e.y - mouseDownEvent.y - }; - if (dragDirection === "vertical") { - dragHandleElement.style.setProperty("--tw-translate-y", `${mouseDiff.y}px`); - } else { - dragHandleElement.style.setProperty( - "--tw-translate-x", - `${mouseDiff.x}px` - ); - } - updateSiblingsPositioning(dragDirection, mouseDiff, e); - } - $$self.$$.on_mount.push(function() { - if (element2 === void 0 && !("element" in $$props || $$self.$$.bound[$$self.$$.props["element"]])) { - console.warn(" was created without expected prop 'element'"); - } - }); - const writable_props = ["element", "isParent"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - function button_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - dragHandleElement = $$value; - $$invalidate(0, dragHandleElement); - }); - } - $$self.$$set = ($$props2) => { - if ("element" in $$props2) - $$invalidate(6, element2 = $$props2.element); - if ("isParent" in $$props2) - $$invalidate(7, isParent = $$props2.isParent); - }; - $$self.$capture_state = () => ({ - writable, - page, - selectedAstElementId, - parentOfSelectedAstElement, - findHoveredSiblingIndex, - getBoundingRect, - getDragDirection, - live, - currentHandleCoords, - relativeWrapperRect, - dragHandleStyle, - isDragging, - dragElementInfo, - initSelectedElementDragMenuPosition, - updateHandleCoords, - tick, - element: element2, - isParent, - originalSiblings, - dragHandleElement, - snapshotSelectedElementSiblings, - mouseDownEvent, - handleMousedown, - applyNewOrder, - resetDragElementHandle, - handleMouseup, - getGhostElement, - findSwappedIndexes, - sortedLocationInfos, - calculateNewDistance, - repositionChildren, - repositionGhosts, - calculatePlaceholderPosition, - placeholderStyle, - newIndex, - updateSiblingsPositioning, - handleMousemove, - rotated, - canBeDragged, - $isDragging, - $page, - $live, - $selectedAstElementId, - $parentOfSelectedAstElement, - $dragHandleStyle - }); - $$self.$inject_state = ($$props2) => { - if ("element" in $$props2) - $$invalidate(6, element2 = $$props2.element); - if ("isParent" in $$props2) - $$invalidate(7, isParent = $$props2.isParent); - if ("originalSiblings" in $$props2) - originalSiblings = $$props2.originalSiblings; - if ("dragHandleElement" in $$props2) - $$invalidate(0, dragHandleElement = $$props2.dragHandleElement); - if ("mouseDownEvent" in $$props2) - mouseDownEvent = $$props2.mouseDownEvent; - if ("placeholderStyle" in $$props2) - $$invalidate(1, placeholderStyle = $$props2.placeholderStyle); - if ("newIndex" in $$props2) - newIndex = $$props2.newIndex; - if ("rotated" in $$props2) - $$invalidate(2, rotated = $$props2.rotated); - if ("canBeDragged" in $$props2) - $$invalidate(3, canBeDragged = $$props2.canBeDragged); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*element*/ - 64) { - $: - $$invalidate(3, canBeDragged = element2?.parentElement?.children?.length > 1); - } - if ($$self.$$.dirty & /*element*/ - 64) { - $: - $$invalidate(2, rotated = !!element2 && getDragDirection(element2) === "horizontal"); - } - if ($$self.$$.dirty & /*element*/ - 64) { - $: { - !!element2 && initSelectedElementDragMenuPosition(element2); - } - } - }; - return [ - dragHandleElement, - placeholderStyle, - rotated, - canBeDragged, - $dragHandleStyle, - handleMousedown, - element2, - isParent, - button_binding - ]; - } - var DragMenuOption = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance6, create_fragment6, safe_not_equal, { element: 6, isParent: 7 }); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "DragMenuOption", - options, - id: create_fragment6.name - }); - } - get element() { - return this.$$.ctx[6]; - } - set element(element2) { - this.$$set({ element: element2 }); - flush(); - } - get isParent() { - return this.$$.ctx[7]; - } - set isParent(isParent) { - this.$$set({ isParent }); - flush(); - } - }; - create_custom_element(DragMenuOption, { "element": {}, "isParent": { "type": "Boolean" } }, [], [], true); - var DragMenuOption_default = DragMenuOption; - - // svelte/components/PageAstNode.svelte - var file7 = "svelte/components/PageAstNode.svelte"; - function add_css2(target) { - append_styles(target, "svelte-fu018p", ".dragged-element-placeholder.svelte-fu018p{outline:2px dashed red;pointer-events:none}.embedded-iframe{display:inline}.embedded-iframe > iframe{pointer-events:none}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGFnZUFzdE5vZGUuc3ZlbHRlIiwibWFwcGluZ3MiOiJBQWtNRSwwQ0FBNkIsQ0FDM0IsT0FBTyxDQUFFLEdBQUcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUd2QixjQUFjLENBQUUsSUFDbEIsQ0FFUSxnQkFBa0IsQ0FDeEIsT0FBTyxDQUFFLE1BQ1gsQ0FFUSx5QkFBMkIsQ0FDakMsY0FBYyxDQUFFLElBQ2xCIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIlBhZ2VBc3ROb2RlLnN2ZWx0ZSJdfQ== */"); - } - function get_each_context3(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[27] = list3[i]; - child_ctx[29] = i; - return child_ctx; - } - function create_else_block_12(ctx) { - let t; - const block = { - c: function create3() { - t = text( - /*node*/ - ctx[0] - ); - }, - l: function claim(nodes) { - t = claim_text( - nodes, - /*node*/ - ctx[0] - ); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1) - set_data_dev( - t, - /*node*/ - ctx2[0] - ); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block_12.name, - type: "else", - source: "(171:0) {:else}", - ctx - }); - return block; - } - function create_if_block5(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [ - create_if_block_14, - create_if_block_23, - create_if_block_32, - create_if_block_42, - create_else_block2 - ]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].tag === "html_comment" - ) - return 0; - if ( - /*node*/ - ctx2[0].tag === "eex_comment" - ) - return 1; - if ( - /*node*/ - ctx2[0].tag === "eex" && /*node*/ - ctx2[0].content[0] === "@inner_content" - ) - return 2; - if ( - /*node*/ - ctx2[0].rendered_html - ) - return 3; - return 4; - } - current_block_type_index = select_block_type_1(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const block = { - c: function create3() { - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block5.name, - type: "if", - source: "(121:0) {#if isAstElement(node)}", - ctx - }); - return block; - } - function create_else_block2(ctx) { - let previous_tag = ( - /*node*/ - ctx[0].tag - ); - let svelte_element_anchor; - let current; - validate_dynamic_element( - /*node*/ - ctx[0].tag - ); - validate_void_dynamic_element( - /*node*/ - ctx[0].tag - ); - let svelte_element = ( - /*node*/ - ctx[0].tag && create_dynamic_element2(ctx) - ); - const block = { - c: function create3() { - if (svelte_element) - svelte_element.c(); - svelte_element_anchor = empty(); - }, - l: function claim(nodes) { - if (svelte_element) - svelte_element.l(nodes); - svelte_element_anchor = empty(); - }, - m: function mount(target, anchor) { - if (svelte_element) - svelte_element.m(target, anchor); - insert_hydration_dev(target, svelte_element_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if ( - /*node*/ - ctx2[0].tag - ) { - if (!previous_tag) { - svelte_element = create_dynamic_element2(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else if (safe_not_equal( - previous_tag, - /*node*/ - ctx2[0].tag - )) { - svelte_element.d(1); - validate_dynamic_element( - /*node*/ - ctx2[0].tag - ); - validate_void_dynamic_element( - /*node*/ - ctx2[0].tag - ); - svelte_element = create_dynamic_element2(ctx2); - previous_tag = /*node*/ - ctx2[0].tag; - svelte_element.c(); - svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor); - } else { - svelte_element.p(ctx2, dirty); - } - } else if (previous_tag) { - svelte_element.d(1); - svelte_element = null; - previous_tag = /*node*/ - ctx2[0].tag; - } - }, - i: noop2, - o: function outro(local) { - transition_out(svelte_element, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element_anchor); - } - if (svelte_element) - svelte_element.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block2.name, - type: "else", - source: "(141:2) {:else}", - ctx - }); - return block; - } - function create_if_block_42(ctx) { - let div; - let html_tag; - let raw_value = ( - /*node*/ - ctx[0].rendered_html + "" - ); - let highlightContent_action; - let mounted; - let dispose; - const block = { - c: function create3() { - div = element("div"); - html_tag = new HtmlTagHydration(false); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { "data-selected": true }); - var div_nodes = children(div); - html_tag = claim_html_tag(div_nodes, false); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - html_tag.a = null; - attr_dev( - div, - "data-selected", - /*isSelectedNode*/ - ctx[4] - ); - toggle_class( - div, - "contents", - /*htmlWrapperHasMultipleElements*/ - ctx[7] - ); - toggle_class( - div, - "embedded-iframe", - /*htmlWrapperHasIframe*/ - ctx[6] - ); - add_location(div, file7, 147, 4, 4888); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - html_tag.m(raw_value, div); - ctx[25](div); - if (!mounted) { - dispose = [ - listen_dev(div, "mouseover", stop_propagation( - /*handleMouseOver*/ - ctx[16] - ), false, false, true, false), - listen_dev(div, "mouseout", stop_propagation( - /*handleMouseOut*/ - ctx[17] - ), false, false, true, false), - listen_dev(div, "click", stop_propagation(prevent_default( - /*handleClick*/ - ctx[18] - )), false, true, true, false), - action_destroyer(highlightContent_action = highlightContent.call(null, div, { - selected: ( - /*isSelectedNode*/ - ctx[4] - ), - highlighted: ( - /*isHighlightedNode*/ - ctx[10] - ) - })) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = /*node*/ - ctx2[0].rendered_html + "")) - html_tag.p(raw_value); - if (dirty & /*isSelectedNode*/ - 16) { - attr_dev( - div, - "data-selected", - /*isSelectedNode*/ - ctx2[4] - ); - } - if (highlightContent_action && is_function(highlightContent_action.update) && dirty & /*isSelectedNode, isHighlightedNode*/ - 1040) - highlightContent_action.update.call(null, { - selected: ( - /*isSelectedNode*/ - ctx2[4] - ), - highlighted: ( - /*isHighlightedNode*/ - ctx2[10] - ) - }); - if (dirty & /*htmlWrapperHasMultipleElements*/ - 128) { - toggle_class( - div, - "contents", - /*htmlWrapperHasMultipleElements*/ - ctx2[7] - ); - } - if (dirty & /*htmlWrapperHasIframe*/ - 64) { - toggle_class( - div, - "embedded-iframe", - /*htmlWrapperHasIframe*/ - ctx2[6] - ); - } - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - ctx[25](null); - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_42.name, - type: "if", - source: "(128:31) ", - ctx - }); - return block; - } - function create_if_block_32(ctx) { - let current; - const default_slot_template = ( - /*#slots*/ - ctx[24].default - ); - const default_slot = create_slot( - default_slot_template, - ctx, - /*$$scope*/ - ctx[23], - null - ); - const block = { - c: function create3() { - if (default_slot) - default_slot.c(); - }, - l: function claim(nodes) { - if (default_slot) - default_slot.l(nodes); - }, - m: function mount(target, anchor) { - if (default_slot) { - default_slot.m(target, anchor); - } - current = true; - }, - p: function update2(ctx2, dirty) { - if (default_slot) { - if (default_slot.p && (!current || dirty & /*$$scope*/ - 8388608)) { - update_slot_base( - default_slot, - default_slot_template, - ctx2, - /*$$scope*/ - ctx2[23], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[23] - ) : get_slot_changes( - default_slot_template, - /*$$scope*/ - ctx2[23], - dirty, - null - ), - null - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(default_slot, local); - current = true; - }, - o: function outro(local) { - transition_out(default_slot, local); - current = false; - }, - d: function destroy(detaching) { - if (default_slot) - default_slot.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_32.name, - type: "if", - source: "(126:71) ", - ctx - }); - return block; - } - function create_if_block_23(ctx) { - let html_tag; - let raw_value = ""; - let html_anchor; - const block = { - c: function create3() { - html_tag = new HtmlTagHydration(false); - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_tag = claim_html_tag(nodes, false); - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag.a = html_anchor; - }, - m: function mount(target, anchor) { - html_tag.m(raw_value, target, anchor); - insert_hydration_dev(target, html_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = "")) - html_tag.p(raw_value); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(html_anchor); - html_tag.d(); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_23.name, - type: "if", - source: "(124:39) ", - ctx - }); - return block; - } - function create_if_block_14(ctx) { - let html_tag; - let raw_value = ""; - let html_anchor; - const block = { - c: function create3() { - html_tag = new HtmlTagHydration(false); - html_anchor = empty(); - this.h(); - }, - l: function claim(nodes) { - html_tag = claim_html_tag(nodes, false); - html_anchor = empty(); - this.h(); - }, - h: function hydrate() { - html_tag.a = html_anchor; - }, - m: function mount(target, anchor) { - html_tag.m(raw_value, target, anchor); - insert_hydration_dev(target, html_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*node*/ - 1 && raw_value !== (raw_value = "")) - html_tag.p(raw_value); - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(html_anchor); - html_tag.d(); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_14.name, - type: "if", - source: '(122:2) {#if node.tag === \\"html_comment\\"}', - ctx - }); - return block; - } - function create_if_block_52(ctx) { - let t; - let if_block_anchor; - let current; - let each_value = ensure_array_like_dev( - /*children*/ - ctx[5] - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block3(get_each_context3(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - function select_block_type_2(ctx2, dirty) { - if ( - /*isDragTarget*/ - ctx2[11] && /*$draggedComponentDefinition*/ - ctx2[12] - ) - return create_if_block_62; - if ( - /*previewDropInside*/ - ctx2[13] - ) - return create_if_block_7; - } - let current_block_type = select_block_type_2(ctx, -1); - let if_block = current_block_type && current_block_type(ctx); - const block = { - c: function create3() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t = space(); - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - t = claim_space(nodes); - if (if_block) - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, t, anchor); - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if (dirty & /*children, nodeId*/ - 34) { - each_value = ensure_array_like_dev( - /*children*/ - ctx2[5] - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context3(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block3(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(t.parentNode, t); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - if (current_block_type === (current_block_type = select_block_type_2(ctx2, dirty)) && if_block) { - if_block.p(ctx2, dirty); - } else { - if (if_block) - if_block.d(1); - if_block = current_block_type && current_block_type(ctx2); - if (if_block) { - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } - }, - i: function intro(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - detach_dev(if_block_anchor); - } - destroy_each(each_blocks, detaching); - if (if_block) { - if_block.d(detaching); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_52.name, - type: "if", - source: "(159:6) {#if !node.attrs?.selfClose}", - ctx - }); - return block; - } - function create_each_block3(ctx) { - let pageastnode; - let current; - pageastnode = new PageAstNode({ - props: { - node: ( - /*child*/ - ctx[27] - ), - nodeId: ( - /*nodeId*/ - ctx[1] + "." + /*childIndex*/ - ctx[29] - ) - }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(pageastnode.$$.fragment); - }, - l: function claim(nodes) { - claim_component(pageastnode.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(pageastnode, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const pageastnode_changes = {}; - if (dirty & /*children*/ - 32) - pageastnode_changes.node = /*child*/ - ctx2[27]; - if (dirty & /*nodeId*/ - 2) - pageastnode_changes.nodeId = /*nodeId*/ - ctx2[1] + "." + /*childIndex*/ - ctx2[29]; - pageastnode.$set(pageastnode_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(pageastnode.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(pageastnode.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(pageastnode, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block3.name, - type: "each", - source: "(160:8) {#each children as child, childIndex}", - ctx - }); - return block; - } - function create_if_block_7(ctx) { - let div; - let textContent = "Preview"; - const block = { - c: function create3() { - div = element("div"); - div.textContent = textContent; - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(div) !== "svelte-1nqhpsa") - div.textContent = textContent; - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "dragged-element-placeholder svelte-fu018p"); - add_location(div, file7, 184, 10, 6385); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - }, - p: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_7.name, - type: "if", - source: "(165:36) ", - ctx - }); - return block; - } - function create_if_block_62(ctx) { - let div; - let html_tag; - let raw_value = ( - /*$draggedComponentDefinition*/ - ctx[12].example + "" - ); - const block = { - c: function create3() { - div = element("div"); - html_tag = new HtmlTagHydration(false); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - html_tag = claim_html_tag(div_nodes, false); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - html_tag.a = null; - attr_dev(div, "class", "dragged-element-placeholder svelte-fu018p"); - add_location(div, file7, 182, 10, 6247); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - html_tag.m(raw_value, div); - }, - p: function update2(ctx2, dirty) { - if (dirty & /*$draggedComponentDefinition*/ - 4096 && raw_value !== (raw_value = /*$draggedComponentDefinition*/ - ctx2[12].example + "")) - html_tag.p(raw_value); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_62.name, - type: "if", - source: "(163:8) {#if isDragTarget && $draggedComponentDefinition}", - ctx - }); - return block; - } - function create_dynamic_element2(ctx) { - let svelte_element; - let current; - let mounted; - let dispose; - let if_block = !/*node*/ - ctx[0].attrs?.selfClose && create_if_block_52(ctx); - let svelte_element_levels = [ - { class: "relative" }, - /*node*/ - ctx[0].attrs, - { - "data-selected": ( - /*isSelectedNode*/ - ctx[4] - ) - }, - { - "data-selected-parent": ( - /*isParentOfSelectedNode*/ - ctx[8] - ) - }, - { - "data-highlighted": ( - /*isHighlightedNode*/ - ctx[10] - ) - }, - { - "data-slot-target": ( - /*isDragTarget*/ - ctx[11] - ) - }, - { contenteditable: ( - /*isEditable*/ - ctx[9] - ) } - ]; - let svelte_element_data = {}; - for (let i = 0; i < svelte_element_levels.length; i += 1) { - svelte_element_data = assign(svelte_element_data, svelte_element_levels[i]); - } - const block = { - c: function create3() { - svelte_element = element( - /*node*/ - ctx[0].tag - ); - if (if_block) - if_block.c(); - this.h(); - }, - l: function claim(nodes) { - svelte_element = claim_element( - nodes, - /*node*/ - (ctx[0].tag || "null").toUpperCase(), - { - class: true, - "data-selected": true, - "data-selected-parent": true, - "data-highlighted": true, - "data-slot-target": true, - contenteditable: true - } - ); - var svelte_element_nodes = children(svelte_element); - if (if_block) - if_block.l(svelte_element_nodes); - svelte_element_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - set_dynamic_element_data( - /*node*/ - ctx[0].tag - )(svelte_element, svelte_element_data); - toggle_class(svelte_element, "svelte-fu018p", true); - add_location(svelte_element, file7, 160, 4, 5383); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, svelte_element, anchor); - if (if_block) - if_block.m(svelte_element, null); - ctx[26](svelte_element); - current = true; - if (!mounted) { - dispose = [ - listen_dev( - svelte_element, - "blur", - /*handleContentEdited*/ - ctx[19], - false, - false, - false, - false - ), - listen_dev(svelte_element, "dragenter", stop_propagation( - /*handleDragEnter*/ - ctx[14] - ), false, false, true, false), - listen_dev(svelte_element, "dragleave", stop_propagation( - /*handleDragLeave*/ - ctx[15] - ), false, false, true, false), - listen_dev(svelte_element, "mouseover", stop_propagation( - /*handleMouseOver*/ - ctx[16] - ), false, false, true, false), - listen_dev(svelte_element, "mouseout", stop_propagation( - /*handleMouseOut*/ - ctx[17] - ), false, false, true, false), - listen_dev(svelte_element, "click", stop_propagation(prevent_default( - /*handleClick*/ - ctx[18] - )), false, true, true, false) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (!/*node*/ - ctx2[0].attrs?.selfClose) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty & /*node*/ - 1) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_52(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(svelte_element, null); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - set_dynamic_element_data( - /*node*/ - ctx2[0].tag - )(svelte_element, svelte_element_data = get_spread_update(svelte_element_levels, [ - { class: "relative" }, - dirty & /*node*/ - 1 && /*node*/ - ctx2[0].attrs, - (!current || dirty & /*isSelectedNode*/ - 16) && { - "data-selected": ( - /*isSelectedNode*/ - ctx2[4] - ) - }, - (!current || dirty & /*isParentOfSelectedNode*/ - 256) && { - "data-selected-parent": ( - /*isParentOfSelectedNode*/ - ctx2[8] - ) - }, - (!current || dirty & /*isHighlightedNode*/ - 1024) && { - "data-highlighted": ( - /*isHighlightedNode*/ - ctx2[10] - ) - }, - (!current || dirty & /*isDragTarget*/ - 2048) && { - "data-slot-target": ( - /*isDragTarget*/ - ctx2[11] - ) - }, - (!current || dirty & /*isEditable*/ - 512) && { contenteditable: ( - /*isEditable*/ - ctx2[9] - ) } - ])); - toggle_class(svelte_element, "svelte-fu018p", true); - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(svelte_element); - } - if (if_block) - if_block.d(); - ctx[26](null); - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_dynamic_element2.name, - type: "child_dynamic_element", - source: '(142:4) ', - ctx - }); - return block; - } - function create_fragment7(ctx) { - let show_if; - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block5, create_else_block_12]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if (dirty & /*node*/ - 1) - show_if = null; - if (show_if == null) - show_if = !!isAstElement( - /*node*/ - ctx2[0] - ); - if (show_if) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const block = { - c: function create3() { - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, [dirty]) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment7.name, - type: "component", - source: "", - ctx - }); - return block; - } - function highlightContent(wrapperDiv, { selected, highlighted }) { - let startsWithOneChildren = wrapperDiv.children.length === 1; - if (startsWithOneChildren) { - let child = wrapperDiv.children[0]; - child.setAttribute("data-selected", String(selected)); - child.setAttribute("data-highlighted", String(highlighted)); - } - return { - update({ selected: selected2, highlighted: highlighted2 }) { - if (wrapperDiv.children.length === 1) { - let child = wrapperDiv.children[0]; - child.setAttribute("data-selected", String(selected2)); - child.setAttribute("data-highlighted", String(highlighted2)); - } else if (wrapperDiv.children.length === 0 && wrapperDiv.childNodes.length === 1) { - wrapperDiv.setAttribute("data-nochildren", "true"); - wrapperDiv.setAttribute("data-selected", String(selected2)); - wrapperDiv.setAttribute("data-highlighted", String(highlighted2)); - } else if (startsWithOneChildren) { - Array.from(wrapperDiv.children).forEach((child) => { - child.removeAttribute("data-selected"); - child.removeAttribute("data-highlighted"); - }); - } - }, - destroy() { - } - // noop - // noop - }; - } - function instance7($$self, $$props, $$invalidate) { - let isDragTarget; - let isSelectedNode; - let isHighlightedNode; - let isEditable; - let isParentOfSelectedNode; - let htmlWrapperHasMultipleElements; - let htmlWrapperHasIframe; - let $highlightedAstElement; - let $selectedAstElement; - let $slotTargetElement; - let $draggedComponentDefinition; - validate_store(highlightedAstElement, "highlightedAstElement"); - component_subscribe($$self, highlightedAstElement, ($$value) => $$invalidate(20, $highlightedAstElement = $$value)); - validate_store(selectedAstElement, "selectedAstElement"); - component_subscribe($$self, selectedAstElement, ($$value) => $$invalidate(21, $selectedAstElement = $$value)); - validate_store(slotTargetElement, "slotTargetElement"); - component_subscribe($$self, slotTargetElement, ($$value) => $$invalidate(22, $slotTargetElement = $$value)); - validate_store(draggedComponentDefinition, "draggedComponentDefinition"); - component_subscribe($$self, draggedComponentDefinition, ($$value) => $$invalidate(12, $draggedComponentDefinition = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("PageAstNode", slots, ["default"]); - let { node } = $$props; - let { nodeId } = $$props; - let htmlWrapper; - let domElement; - let previewDropInside; - let children2; - function handleDragEnter() { - if ($draggedComponentDefinition) { - if (isAstElement(node) && elementCanBeDroppedInTarget($draggedComponentDefinition)) { - set_store_value(slotTargetElement, $slotTargetElement = node, $slotTargetElement); - } - } - } - function handleDragLeave() { - if (isAstElement(node) && elementCanBeDroppedInTarget($draggedComponentDefinition) && $slotTargetElement === node) { - set_store_value(slotTargetElement, $slotTargetElement = void 0, $slotTargetElement); - } - } - function handleMouseOver() { - if (!$selectedAstElement) { - isAstElement(node) && set_store_value(highlightedAstElement, $highlightedAstElement = node, $highlightedAstElement); - } - } - function handleMouseOut() { - set_store_value(highlightedAstElement, $highlightedAstElement = void 0, $highlightedAstElement); - } - function handleClick({ currentTarget }) { - setSelection(nodeId); - setSelectedDom(currentTarget); - initSelectedElementDragMenuPosition(currentTarget); - } - function handleContentEdited({ target }) { - let children3 = target.children; - if (!isAstElement(node)) { - return; - } - if (children3.length === 0) { - if (target.innerText !== node.content) { - updateNodeContent(node, target.innerText); - } - } else { - let tmpClone = target.cloneNode(true); - Array.from(tmpClone.children).forEach((c) => tmpClone.removeChild(c)); - let stringChildIndex = node.content.findIndex((e) => typeof e === "string"); - let newText = tmpClone.textContent.trim(); - if (node.content[stringChildIndex] !== newText) { - $$invalidate(0, node.content[stringChildIndex] = newText, node); - updateAst(); - } - } - } - $$self.$$.on_mount.push(function() { - if (node === void 0 && !("node" in $$props || $$self.$$.bound[$$self.$$.props["node"]])) { - console.warn(" was created without expected prop 'node'"); - } - if (nodeId === void 0 && !("nodeId" in $$props || $$self.$$.bound[$$self.$$.props["nodeId"]])) { - console.warn(" was created without expected prop 'nodeId'"); - } - }); - const writable_props = ["node", "nodeId"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - htmlWrapper = $$value; - $$invalidate(2, htmlWrapper); - }); - } - function svelte_element_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - domElement = $$value; - $$invalidate(3, domElement); - }); - } - $$self.$$set = ($$props2) => { - if ("node" in $$props2) - $$invalidate(0, node = $$props2.node); - if ("nodeId" in $$props2) - $$invalidate(1, nodeId = $$props2.nodeId); - if ("$$scope" in $$props2) - $$invalidate(23, $$scope = $$props2.$$scope); - }; - $$self.$capture_state = () => ({ - selectedAstElement, - slotTargetElement, - highlightedAstElement, - isAstElement, - setSelection, - setSelectedDom, - draggedComponentDefinition, - updateNodeContent, - updateAst, - elementCanBeDroppedInTarget, - initSelectedElementDragMenuPosition, - node, - nodeId, - htmlWrapper, - domElement, - previewDropInside, - children: children2, - handleDragEnter, - handleDragLeave, - handleMouseOver, - handleMouseOut, - handleClick, - handleContentEdited, - highlightContent, - isSelectedNode, - htmlWrapperHasIframe, - htmlWrapperHasMultipleElements, - isParentOfSelectedNode, - isEditable, - isHighlightedNode, - isDragTarget, - $highlightedAstElement, - $selectedAstElement, - $slotTargetElement, - $draggedComponentDefinition - }); - $$self.$inject_state = ($$props2) => { - if ("node" in $$props2) - $$invalidate(0, node = $$props2.node); - if ("nodeId" in $$props2) - $$invalidate(1, nodeId = $$props2.nodeId); - if ("htmlWrapper" in $$props2) - $$invalidate(2, htmlWrapper = $$props2.htmlWrapper); - if ("domElement" in $$props2) - $$invalidate(3, domElement = $$props2.domElement); - if ("previewDropInside" in $$props2) - $$invalidate(13, previewDropInside = $$props2.previewDropInside); - if ("children" in $$props2) - $$invalidate(5, children2 = $$props2.children); - if ("isSelectedNode" in $$props2) - $$invalidate(4, isSelectedNode = $$props2.isSelectedNode); - if ("htmlWrapperHasIframe" in $$props2) - $$invalidate(6, htmlWrapperHasIframe = $$props2.htmlWrapperHasIframe); - if ("htmlWrapperHasMultipleElements" in $$props2) - $$invalidate(7, htmlWrapperHasMultipleElements = $$props2.htmlWrapperHasMultipleElements); - if ("isParentOfSelectedNode" in $$props2) - $$invalidate(8, isParentOfSelectedNode = $$props2.isParentOfSelectedNode); - if ("isEditable" in $$props2) - $$invalidate(9, isEditable = $$props2.isEditable); - if ("isHighlightedNode" in $$props2) - $$invalidate(10, isHighlightedNode = $$props2.isHighlightedNode); - if ("isDragTarget" in $$props2) - $$invalidate(11, isDragTarget = $$props2.isDragTarget); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$slotTargetElement, node*/ - 4194305) { - $: - $$invalidate(11, isDragTarget = $slotTargetElement === node); - } - if ($$self.$$.dirty & /*$selectedAstElement, node*/ - 2097153) { - $: - $$invalidate(4, isSelectedNode = $selectedAstElement === node); - } - if ($$self.$$.dirty & /*$highlightedAstElement, node*/ - 1048577) { - $: - $$invalidate(10, isHighlightedNode = $highlightedAstElement === node); - } - if ($$self.$$.dirty & /*isSelectedNode, node*/ - 17) { - $: - $$invalidate(9, isEditable = isSelectedNode && isAstElement(node) && Array.isArray(node.content) && node.content.filter((e) => typeof e === "string").length === 1 && !node.attrs?.selfClose); - } - if ($$self.$$.dirty & /*node, $selectedAstElement*/ - 2097153) { - $: - $$invalidate(8, isParentOfSelectedNode = isAstElement(node) && Array.isArray(node.content) ? node.content.includes($selectedAstElement) : false); - } - if ($$self.$$.dirty & /*node*/ - 1) { - $: { - if (isAstElement(node)) { - $$invalidate(5, children2 = node.content); - } - } - } - if ($$self.$$.dirty & /*htmlWrapper*/ - 4) { - $: - $$invalidate(7, htmlWrapperHasMultipleElements = (() => { - return !!htmlWrapper && htmlWrapper.childElementCount > 1; - })()); - } - if ($$self.$$.dirty & /*htmlWrapper*/ - 4) { - $: - $$invalidate(6, htmlWrapperHasIframe = (() => { - return !!htmlWrapper && htmlWrapper.getElementsByTagName("iframe").length > 0; - })()); - } - if ($$self.$$.dirty & /*isSelectedNode, domElement, htmlWrapper*/ - 28) { - $: { - if (isSelectedNode) { - setSelectedDom(domElement || htmlWrapper); - } - } - } - }; - return [ - node, - nodeId, - htmlWrapper, - domElement, - isSelectedNode, - children2, - htmlWrapperHasIframe, - htmlWrapperHasMultipleElements, - isParentOfSelectedNode, - isEditable, - isHighlightedNode, - isDragTarget, - $draggedComponentDefinition, - previewDropInside, - handleDragEnter, - handleDragLeave, - handleMouseOver, - handleMouseOut, - handleClick, - handleContentEdited, - $highlightedAstElement, - $selectedAstElement, - $slotTargetElement, - $$scope, - slots, - div_binding, - svelte_element_binding - ]; - } - var PageAstNode = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance7, create_fragment7, safe_not_equal, { node: 0, nodeId: 1 }, add_css2); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "PageAstNode", - options, - id: create_fragment7.name - }); - } - get node() { - return this.$$.ctx[0]; - } - set node(node) { - this.$$set({ node }); - flush(); - } - get nodeId() { - return this.$$.ctx[1]; - } - set nodeId(nodeId) { - this.$$set({ nodeId }); - flush(); - } - }; - create_custom_element(PageAstNode, { "node": {}, "nodeId": {} }, ["default"], [], true); - var PageAstNode_default = PageAstNode; - - // svelte/components/PagePreview.svelte - var PagePreview_exports = {}; - __export(PagePreview_exports, { - default: () => PagePreview_default - }); - var file8 = "svelte/components/PagePreview.svelte"; - function add_css3(target) { - append_styles(target, "svelte-r4h6jy", '.contents[data-nochildren="true"], .contents[data-nochildren="true"]{display:inline}[data-slot-target="true"]{outline-color:red;outline-width:2px;outline-style:dashed}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGFnZVByZXZpZXcuc3ZlbHRlIiwibWFwcGluZ3MiOiJBQXFGVSxvRUFBc0UsQ0FJNUUsT0FBTyxDQUFFLE1BQ1gsQ0FDUSx5QkFBMkIsQ0FDakMsYUFBYSxDQUFFLEdBQUcsQ0FDbEIsYUFBYSxDQUFFLEdBQUcsQ0FDbEIsYUFBYSxDQUFFLE1BQ2pCIiwibmFtZXMiOltdLCJzb3VyY2VzIjpbIlBhZ2VQcmV2aWV3LnN2ZWx0ZSJdfQ== */'); - } - function create_if_block6(ctx) { - let browserframe; - let current; - browserframe = new BrowserFrame_default({ - props: { - page: ( - /*$page*/ - ctx[1] - ), - $$slots: { default: [create_default_slot] }, - $$scope: { ctx } - }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(browserframe.$$.fragment); - }, - l: function claim(nodes) { - claim_component(browserframe.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(browserframe, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const browserframe_changes = {}; - if (dirty & /*$page*/ - 2) - browserframe_changes.page = /*$page*/ - ctx2[1]; - if (dirty & /*$$scope, isDraggingOver, $selectedAstElementId*/ - 2053) { - browserframe_changes.$$scope = { dirty, ctx: ctx2 }; - } - browserframe.$set(browserframe_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(browserframe.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(browserframe.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(browserframe, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block6.name, - type: "if", - source: "(52:2) {#if $page}", - ctx - }); - return block; - } - function create_default_slot(ctx) { - let div1; - let div0; - let page_wrapper; - let div0_data_selected_value; - let div1_class_value; - let mounted; - let dispose; - const block = { - c: function create3() { - div1 = element("div"); - div0 = element("div"); - page_wrapper = element("page-wrapper"); - this.h(); - }, - l: function claim(nodes) { - div1 = claim_element(nodes, "DIV", { - role: true, - style: true, - id: true, - class: true, - "data-test-id": true - }); - var div1_nodes = children(div1); - div0 = claim_element(div1_nodes, "DIV", { - id: true, - class: true, - "data-selected": true - }); - var div0_nodes = children(div0); - page_wrapper = claim_element(div0_nodes, "PAGE-WRAPPER", { class: true }); - children(page_wrapper).forEach(detach_dev); - div0_nodes.forEach(detach_dev); - div1_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - set_custom_element_data(page_wrapper, "class", "relative"); - add_location(page_wrapper, file8, 77, 10, 2653); - attr_dev(div0, "id", "page-wrapper"); - attr_dev(div0, "class", "p-1 m-1"); - attr_dev(div0, "data-selected", div0_data_selected_value = /*$selectedAstElementId*/ - ctx[2] === "root"); - add_location(div0, file8, 76, 8, 2554); - attr_dev(div1, "role", "document"); - set_style(div1, "--outlined-id", "title-1"); - attr_dev(div1, "id", "fake-browser-content"); - attr_dev(div1, "class", div1_class_value = "bg-white rounded-b-xl relative overflow-hidden flex-1 " + /*isDraggingOver*/ - (ctx[0] && "border-dashed border-blue-500 border-2")); - attr_dev(div1, "data-test-id", "browser-content"); - add_location(div1, file8, 66, 6, 2162); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div1, anchor); - append_hydration_dev(div1, div0); - append_hydration_dev(div0, page_wrapper); - if (!mounted) { - dispose = [ - listen_dev(div1, "drop", prevent_default( - /*handleDragDrop*/ - ctx[3] - ), false, true, false, false), - listen_dev(div1, "dragover", prevent_default( - /*dragOver*/ - ctx[4] - ), false, true, false, false) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty & /*$selectedAstElementId*/ - 4 && div0_data_selected_value !== (div0_data_selected_value = /*$selectedAstElementId*/ - ctx2[2] === "root")) { - attr_dev(div0, "data-selected", div0_data_selected_value); - } - if (dirty & /*isDraggingOver*/ - 1 && div1_class_value !== (div1_class_value = "bg-white rounded-b-xl relative overflow-hidden flex-1 " + /*isDraggingOver*/ - (ctx2[0] && "border-dashed border-blue-500 border-2"))) { - attr_dev(div1, "class", div1_class_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div1); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_default_slot.name, - type: "slot", - source: "(53:4) ", - ctx - }); - return block; - } - function create_fragment8(ctx) { - let div; - let current; - let if_block = ( - /*$page*/ - ctx[1] && create_if_block6(ctx) - ); - const block = { - c: function create3() { - div = element("div"); - if (if_block) - if_block.c(); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, "data-test-id": true }); - var div_nodes = children(div); - if (if_block) - if_block.l(div_nodes); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "flex-1 px-8 pb-4 flex max-h-full"); - attr_dev(div, "data-test-id", "main"); - add_location(div, file8, 63, 0, 2043); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - if (if_block) - if_block.m(div, null); - current = true; - }, - p: function update2(ctx2, [dirty]) { - if ( - /*$page*/ - ctx2[1] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty & /*$page*/ - 2) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block6(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div, null); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - if (if_block) - if_block.d(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment8.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance8($$self, $$props, $$invalidate) { - let $page; - let $live; - let $slotTargetElement; - let $draggedComponentDefinition; - let $currentComponentCategory; - let $selectedAstElementId; - validate_store(page, "page"); - component_subscribe($$self, page, ($$value) => $$invalidate(1, $page = $$value)); - validate_store(live, "live"); - component_subscribe($$self, live, ($$value) => $$invalidate(5, $live = $$value)); - validate_store(slotTargetElement, "slotTargetElement"); - component_subscribe($$self, slotTargetElement, ($$value) => $$invalidate(6, $slotTargetElement = $$value)); - validate_store(draggedComponentDefinition, "draggedComponentDefinition"); - component_subscribe($$self, draggedComponentDefinition, ($$value) => $$invalidate(7, $draggedComponentDefinition = $$value)); - validate_store(currentComponentCategory, "currentComponentCategory"); - component_subscribe($$self, currentComponentCategory, ($$value) => $$invalidate(8, $currentComponentCategory = $$value)); - validate_store(selectedAstElementId, "selectedAstElementId"); - component_subscribe($$self, selectedAstElementId, ($$value) => $$invalidate(2, $selectedAstElementId = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("PagePreview", slots, []); - let isDraggingOver = false; - async function handleDragDrop(e) { - let { target } = e; - set_store_value(currentComponentCategory, $currentComponentCategory = null, $currentComponentCategory); - if (!$draggedComponentDefinition) - return; - let draggedObj = $draggedComponentDefinition; - if (target.id !== "fake-browser-content" && elementCanBeDroppedInTarget(draggedObj)) { - if (!(target instanceof HTMLElement) || !$slotTargetElement || $slotTargetElement.attrs.selfClose) { - resetDragDrop(); - return; - } - addBasicComponentToTarget2($slotTargetElement); - } else { - $live.pushEvent( - "render_component_in_page", - { - component_id: draggedObj.id, - page_id: $page.id - }, - ({ ast }) => { - $live.pushEvent("update_page_ast", { - id: $page.id, - ast: [...$page.ast, ...ast] - }); - } - ); - } - resetDragDrop(); - } - async function addBasicComponentToTarget2(astElement) { - if (!$draggedComponentDefinition) - return; - let componentDefinition = $draggedComponentDefinition; - set_store_value(draggedComponentDefinition, $draggedComponentDefinition = null, $draggedComponentDefinition); - let targetNode = astElement; - $live.pushEvent( - "render_component_in_page", - { - component_id: componentDefinition.id, - page_id: $page.id - }, - ({ ast }) => { - targetNode?.content.push(...ast); - set_store_value(slotTargetElement, $slotTargetElement = void 0, $slotTargetElement); - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - ); - } - function dragOver() { - $$invalidate(0, isDraggingOver = true); - } - function resetDragDrop() { - resetDrag(); - $$invalidate(0, isDraggingOver = false); - } - const writable_props = []; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - $$self.$capture_state = () => ({ - BrowserFrame: BrowserFrame_default, - selectedAstElementId, - currentComponentCategory, - page, - slotTargetElement, - draggedComponentDefinition, - resetDrag, - live, - elementCanBeDroppedInTarget, - isDraggingOver, - handleDragDrop, - addBasicComponentToTarget: addBasicComponentToTarget2, - dragOver, - resetDragDrop, - $page, - $live, - $slotTargetElement, - $draggedComponentDefinition, - $currentComponentCategory, - $selectedAstElementId - }); - $$self.$inject_state = ($$props2) => { - if ("isDraggingOver" in $$props2) - $$invalidate(0, isDraggingOver = $$props2.isDraggingOver); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - return [isDraggingOver, $page, $selectedAstElementId, handleDragDrop, dragOver]; - } - var PagePreview = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance8, create_fragment8, safe_not_equal, {}, add_css3); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "PagePreview", - options, - id: create_fragment8.name - }); - } - }; - create_custom_element(PagePreview, {}, [], [], true); - var PagePreview_default = PagePreview; - - // svelte/components/PageWrapper.svelte - var PageWrapper_exports = {}; - __export(PageWrapper_exports, { - default: () => PageWrapper_default - }); - - // svelte/stores/tailwindConfig.ts - var tailwindConfig = writable(); - - // svelte/stores/tailwindInput.ts - var tailwindInput = writable(); - - // node_modules/postcss/lib/postcss.mjs - var import_postcss = __toESM(require_postcss(), 1); - var postcss_default = import_postcss.default; - var stringify = import_postcss.default.stringify; - var fromJSON = import_postcss.default.fromJSON; - var plugin = import_postcss.default.plugin; - var parse = import_postcss.default.parse; - var list = import_postcss.default.list; - var document2 = import_postcss.default.document; - var comment = import_postcss.default.comment; - var atRule = import_postcss.default.atRule; - var rule = import_postcss.default.rule; - var decl = import_postcss.default.decl; - var root = import_postcss.default.root; - var CssSyntaxError = import_postcss.default.CssSyntaxError; - var Declaration = import_postcss.default.Declaration; - var Container = import_postcss.default.Container; - var Processor = import_postcss.default.Processor; - var Document = import_postcss.default.Document; - var Comment = import_postcss.default.Comment; - var Warning = import_postcss.default.Warning; - var AtRule = import_postcss.default.AtRule; - var Result = import_postcss.default.Result; - var Input = import_postcss.default.Input; - var Rule = import_postcss.default.Rule; - var Root = import_postcss.default.Root; - var Node = import_postcss.default.Node; - - // node_modules/@mhsdesign/jit-browser-tailwindcss/dist/module.esm.js - var import_postcss_selector_parser = __toESM(require_dist(), 1); - var import_postcss_nested = __toESM(require_postcss_nested(), 1); - - // node_modules/postcss-js/index.mjs - var import_index = __toESM(require_postcss_js(), 1); - var postcss_js_default = import_index.default; - var objectify = import_index.default.objectify; - var parse2 = import_index.default.parse; - var async = import_index.default.async; - var sync = import_index.default.sync; - - // node_modules/@mhsdesign/jit-browser-tailwindcss/dist/module.esm.js - var import_postcss_selector_parser2 = __toESM(require_dist(), 1); - var import_postcss_selector_parser3 = __toESM(require_dist(), 1); - var import_unesc = __toESM(require_unesc(), 1); - var import_postcss_selector_parser4 = __toESM(require_dist(), 1); - var import_dlv = __toESM(require_dlv_umd(), 1); - var import_postcss_selector_parser5 = __toESM(require_dist(), 1); - var import_postcss_selector_parser6 = __toESM(require_dist(), 1); - var import_postcss_selector_parser7 = __toESM(require_dist(), 1); - var import_dlv2 = __toESM(require_dlv_umd(), 1); - var import_didyoumean = __toESM(require_didYouMean_1_2_1(), 1); - var import_postcss_selector_parser8 = __toESM(require_dist(), 1); - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __commonJS2 = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( - isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var require_quick_lru = __commonJS2({ - "node_modules/@alloc/quick-lru/index.js"(exports, module) { - "use strict"; - var QuickLRU = class { - constructor(options = {}) { - if (!(options.maxSize && options.maxSize > 0)) { - throw new TypeError("`maxSize` must be a number greater than 0"); - } - if (typeof options.maxAge === "number" && options.maxAge === 0) { - throw new TypeError("`maxAge` must be a number greater than 0"); - } - this.maxSize = options.maxSize; - this.maxAge = options.maxAge || Infinity; - this.onEviction = options.onEviction; - this.cache = /* @__PURE__ */ new Map(); - this.oldCache = /* @__PURE__ */ new Map(); - this._size = 0; - } - _emitEvictions(cache2) { - if (typeof this.onEviction !== "function") { - return; - } - for (const [key, item] of cache2) { - this.onEviction(key, item.value); - } - } - _deleteIfExpired(key, item) { - if (typeof item.expiry === "number" && item.expiry <= Date.now()) { - if (typeof this.onEviction === "function") { - this.onEviction(key, item.value); - } - return this.delete(key); - } - return false; - } - _getOrDeleteIfExpired(key, item) { - const deleted = this._deleteIfExpired(key, item); - if (deleted === false) { - return item.value; - } - } - _getItemValue(key, item) { - return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value; - } - _peek(key, cache2) { - const item = cache2.get(key); - return this._getItemValue(key, item); - } - _set(key, value2) { - this.cache.set(key, value2); - this._size++; - if (this._size >= this.maxSize) { - this._size = 0; - this._emitEvictions(this.oldCache); - this.oldCache = this.cache; - this.cache = /* @__PURE__ */ new Map(); - } - } - _moveToRecent(key, item) { - this.oldCache.delete(key); - this._set(key, item); - } - *_entriesAscending() { - for (const item of this.oldCache) { - const [key, value2] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield item; - } - } - } - for (const item of this.cache) { - const [key, value2] = item; - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield item; - } - } - } - get(key) { - if (this.cache.has(key)) { - const item = this.cache.get(key); - return this._getItemValue(key, item); - } - if (this.oldCache.has(key)) { - const item = this.oldCache.get(key); - if (this._deleteIfExpired(key, item) === false) { - this._moveToRecent(key, item); - return item.value; - } - } - } - set(key, value2, { maxAge = this.maxAge === Infinity ? void 0 : Date.now() + this.maxAge } = {}) { - if (this.cache.has(key)) { - this.cache.set(key, { - value: value2, - maxAge - }); - } else { - this._set(key, { value: value2, expiry: maxAge }); - } - } - has(key) { - if (this.cache.has(key)) { - return !this._deleteIfExpired(key, this.cache.get(key)); - } - if (this.oldCache.has(key)) { - return !this._deleteIfExpired(key, this.oldCache.get(key)); - } - return false; - } - peek(key) { - if (this.cache.has(key)) { - return this._peek(key, this.cache); - } - if (this.oldCache.has(key)) { - return this._peek(key, this.oldCache); - } - } - delete(key) { - const deleted = this.cache.delete(key); - if (deleted) { - this._size--; - } - return this.oldCache.delete(key) || deleted; - } - clear() { - this.cache.clear(); - this.oldCache.clear(); - this._size = 0; - } - resize(newSize) { - if (!(newSize && newSize > 0)) { - throw new TypeError("`maxSize` must be a number greater than 0"); - } - const items = [...this._entriesAscending()]; - const removeCount = items.length - newSize; - if (removeCount < 0) { - this.cache = new Map(items); - this.oldCache = /* @__PURE__ */ new Map(); - this._size = items.length; - } else { - if (removeCount > 0) { - this._emitEvictions(items.slice(0, removeCount)); - } - this.oldCache = new Map(items.slice(removeCount)); - this.cache = /* @__PURE__ */ new Map(); - this._size = 0; - } - this.maxSize = newSize; - } - *keys() { - for (const [key] of this) { - yield key; - } - } - *values() { - for (const [, value2] of this) { - yield value2; - } - } - *[Symbol.iterator]() { - for (const item of this.cache) { - const [key, value2] = item; - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield [key, value2.value]; - } - } - for (const item of this.oldCache) { - const [key, value2] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield [key, value2.value]; - } - } - } - } - *entriesDescending() { - let items = [...this.cache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value2] = item; - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield [key, value2.value]; - } - } - items = [...this.oldCache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value2] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value2); - if (deleted === false) { - yield [key, value2.value]; - } - } - } - } - *entriesAscending() { - for (const [key, value2] of this._entriesAscending()) { - yield [key, value2.value]; - } - } - get size() { - if (!this._size) { - return this.oldCache.size; - } - let oldCacheSize = 0; - for (const key of this.oldCache.keys()) { - if (!this.cache.has(key)) { - oldCacheSize++; - } - } - return Math.min(this._size + oldCacheSize, this.maxSize); - } - }; - module.exports = QuickLRU; - } - }); - var require_parse2 = __commonJS2({ - "node_modules/tailwindcss/src/value-parser/parse.js"(exports, module) { - var openParentheses = "(".charCodeAt(0); - var closeParentheses = ")".charCodeAt(0); - var singleQuote = "'".charCodeAt(0); - var doubleQuote = '"'.charCodeAt(0); - var backslash = "\\".charCodeAt(0); - var slash = "/".charCodeAt(0); - var comma = ",".charCodeAt(0); - var colon = ":".charCodeAt(0); - var star = "*".charCodeAt(0); - var uLower = "u".charCodeAt(0); - var uUpper = "U".charCodeAt(0); - var plus = "+".charCodeAt(0); - var isUnicodeRange = /^[a-f0-9?-]+$/i; - module.exports = function(input) { - var tokens = []; - var value2 = input; - var next, quote, prev, token, escape2, escapePos, whitespacePos, parenthesesOpenPos; - var pos = 0; - var code = value2.charCodeAt(pos); - var max2 = value2.length; - var stack = [{ nodes: tokens }]; - var balanced = 0; - var parent; - var name = ""; - var before = ""; - var after = ""; - while (pos < max2) { - if (code <= 32) { - next = pos; - do { - next += 1; - code = value2.charCodeAt(next); - } while (code <= 32); - token = value2.slice(pos, next); - prev = tokens[tokens.length - 1]; - if (code === closeParentheses && balanced) { - after = token; - } else if (prev && prev.type === "div") { - prev.after = token; - prev.sourceEndIndex += token.length; - } else if (code === comma || code === colon || code === slash && value2.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && false)) { - before = token; - } else { - tokens.push({ - type: "space", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } - pos = next; - } else if (code === singleQuote || code === doubleQuote) { - next = pos; - quote = code === singleQuote ? "'" : '"'; - token = { - type: "string", - sourceIndex: pos, - quote - }; - do { - escape2 = false; - next = value2.indexOf(quote, next + 1); - if (~next) { - escapePos = next; - while (value2.charCodeAt(escapePos - 1) === backslash) { - escapePos -= 1; - escape2 = !escape2; - } - } else { - value2 += quote; - next = value2.length - 1; - token.unclosed = true; - } - } while (escape2); - token.value = value2.slice(pos + 1, next); - token.sourceEndIndex = token.unclosed ? next : next + 1; - tokens.push(token); - pos = next + 1; - code = value2.charCodeAt(pos); - } else if (code === slash && value2.charCodeAt(pos + 1) === star) { - next = value2.indexOf("*/", pos); - token = { - type: "comment", - sourceIndex: pos, - sourceEndIndex: next + 2 - }; - if (next === -1) { - token.unclosed = true; - next = value2.length; - token.sourceEndIndex = next; - } - token.value = value2.slice(pos + 2, next); - tokens.push(token); - pos = next + 2; - code = value2.charCodeAt(pos); - } else if ((code === slash || code === star) && parent && parent.type === "function" && true) { - token = value2[pos]; - tokens.push({ - type: "word", - sourceIndex: pos - before.length, - sourceEndIndex: pos + token.length, - value: token - }); - pos += 1; - code = value2.charCodeAt(pos); - } else if (code === slash || code === comma || code === colon) { - token = value2[pos]; - tokens.push({ - type: "div", - sourceIndex: pos - before.length, - sourceEndIndex: pos + token.length, - value: token, - before, - after: "" - }); - before = ""; - pos += 1; - code = value2.charCodeAt(pos); - } else if (openParentheses === code) { - next = pos; - do { - next += 1; - code = value2.charCodeAt(next); - } while (code <= 32); - parenthesesOpenPos = pos; - token = { - type: "function", - sourceIndex: pos - name.length, - value: name, - before: value2.slice(parenthesesOpenPos + 1, next) - }; - pos = next; - if (name === "url" && code !== singleQuote && code !== doubleQuote) { - next -= 1; - do { - escape2 = false; - next = value2.indexOf(")", next + 1); - if (~next) { - escapePos = next; - while (value2.charCodeAt(escapePos - 1) === backslash) { - escapePos -= 1; - escape2 = !escape2; - } - } else { - value2 += ")"; - next = value2.length - 1; - token.unclosed = true; - } - } while (escape2); - whitespacePos = next; - do { - whitespacePos -= 1; - code = value2.charCodeAt(whitespacePos); - } while (code <= 32); - if (parenthesesOpenPos < whitespacePos) { - if (pos !== whitespacePos + 1) { - token.nodes = [ - { - type: "word", - sourceIndex: pos, - sourceEndIndex: whitespacePos + 1, - value: value2.slice(pos, whitespacePos + 1) - } - ]; - } else { - token.nodes = []; - } - if (token.unclosed && whitespacePos + 1 !== next) { - token.after = ""; - token.nodes.push({ - type: "space", - sourceIndex: whitespacePos + 1, - sourceEndIndex: next, - value: value2.slice(whitespacePos + 1, next) - }); - } else { - token.after = value2.slice(whitespacePos + 1, next); - token.sourceEndIndex = next; - } - } else { - token.after = ""; - token.nodes = []; - } - pos = next + 1; - token.sourceEndIndex = token.unclosed ? next : pos; - code = value2.charCodeAt(pos); - tokens.push(token); - } else { - balanced += 1; - token.after = ""; - token.sourceEndIndex = pos + 1; - tokens.push(token); - stack.push(token); - tokens = token.nodes = []; - parent = token; - } - name = ""; - } else if (closeParentheses === code && balanced) { - pos += 1; - code = value2.charCodeAt(pos); - parent.after = after; - parent.sourceEndIndex += after.length; - after = ""; - balanced -= 1; - stack[stack.length - 1].sourceEndIndex = pos; - stack.pop(); - parent = stack[balanced]; - tokens = parent.nodes; - } else { - next = pos; - do { - if (code === backslash) { - next += 1; - } - next += 1; - code = value2.charCodeAt(next); - } while (next < max2 && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && true || code === slash && parent.type === "function" && true || code === closeParentheses && balanced)); - token = value2.slice(pos, next); - if (openParentheses === code) { - name = token; - } else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) { - tokens.push({ - type: "unicode-range", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } else { - tokens.push({ - type: "word", - sourceIndex: pos, - sourceEndIndex: next, - value: token - }); - } - pos = next; - } - } - for (pos = stack.length - 1; pos; pos -= 1) { - stack[pos].unclosed = true; - stack[pos].sourceEndIndex = value2.length; - } - return stack[0].nodes; - }; - } - }); - var require_walk = __commonJS2({ - "node_modules/tailwindcss/src/value-parser/walk.js"(exports, module) { - module.exports = function walk(nodes, cb, bubble) { - var i, max2, node, result; - for (i = 0, max2 = nodes.length; i < max2; i += 1) { - node = nodes[i]; - if (!bubble) { - result = cb(node, i, nodes); - } - if (result !== false && node.type === "function" && Array.isArray(node.nodes)) { - walk(node.nodes, cb, bubble); - } - if (bubble) { - cb(node, i, nodes); - } - } - }; - } - }); - var require_stringify2 = __commonJS2({ - "node_modules/tailwindcss/src/value-parser/stringify.js"(exports, module) { - function stringifyNode(node, custom) { - var type = node.type; - var value2 = node.value; - var buf; - var customResult; - if (custom && (customResult = custom(node)) !== void 0) { - return customResult; - } else if (type === "word" || type === "space") { - return value2; - } else if (type === "string") { - buf = node.quote || ""; - return buf + value2 + (node.unclosed ? "" : buf); - } else if (type === "comment") { - return "/*" + value2 + (node.unclosed ? "" : "*/"); - } else if (type === "div") { - return (node.before || "") + value2 + (node.after || ""); - } else if (Array.isArray(node.nodes)) { - buf = stringify2(node.nodes, custom); - if (type !== "function") { - return buf; - } - return value2 + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")"); - } - return value2; - } - function stringify2(nodes, custom) { - var result, i; - if (Array.isArray(nodes)) { - result = ""; - for (i = nodes.length - 1; ~i; i -= 1) { - result = stringifyNode(nodes[i], custom) + result; - } - return result; - } - return stringifyNode(nodes, custom); - } - module.exports = stringify2; - } - }); - var require_unit = __commonJS2({ - "node_modules/tailwindcss/src/value-parser/unit.js"(exports, module) { - var minus = "-".charCodeAt(0); - var plus = "+".charCodeAt(0); - var dot = ".".charCodeAt(0); - var exp = "e".charCodeAt(0); - var EXP = "E".charCodeAt(0); - function likeNumber(value2) { - var code = value2.charCodeAt(0); - var nextCode; - if (code === plus || code === minus) { - nextCode = value2.charCodeAt(1); - if (nextCode >= 48 && nextCode <= 57) { - return true; - } - var nextNextCode = value2.charCodeAt(2); - if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { - return true; - } - return false; - } - if (code === dot) { - nextCode = value2.charCodeAt(1); - if (nextCode >= 48 && nextCode <= 57) { - return true; - } - return false; - } - if (code >= 48 && code <= 57) { - return true; - } - return false; - } - module.exports = function(value2) { - var pos = 0; - var length2 = value2.length; - var code; - var nextCode; - var nextNextCode; - if (length2 === 0 || !likeNumber(value2)) { - return false; - } - code = value2.charCodeAt(pos); - if (code === plus || code === minus) { - pos++; - } - while (pos < length2) { - code = value2.charCodeAt(pos); - if (code < 48 || code > 57) { - break; - } - pos += 1; - } - code = value2.charCodeAt(pos); - nextCode = value2.charCodeAt(pos + 1); - if (code === dot && nextCode >= 48 && nextCode <= 57) { - pos += 2; - while (pos < length2) { - code = value2.charCodeAt(pos); - if (code < 48 || code > 57) { - break; - } - pos += 1; - } - } - code = value2.charCodeAt(pos); - nextCode = value2.charCodeAt(pos + 1); - nextNextCode = value2.charCodeAt(pos + 2); - if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) { - pos += nextCode === plus || nextCode === minus ? 3 : 2; - while (pos < length2) { - code = value2.charCodeAt(pos); - if (code < 48 || code > 57) { - break; - } - pos += 1; - } - } - return { - number: value2.slice(0, pos), - unit: value2.slice(pos) - }; - }; - } - }); - var require_value_parser = __commonJS2({ - "node_modules/tailwindcss/src/value-parser/index.js"(exports, module) { - var parse3 = require_parse2(); - var walk = require_walk(); - var stringify2 = require_stringify2(); - function ValueParser(value2) { - if (this instanceof ValueParser) { - this.nodes = parse3(value2); - return this; - } - return new ValueParser(value2); - } - ValueParser.prototype.toString = function() { - return Array.isArray(this.nodes) ? stringify2(this.nodes) : ""; - }; - ValueParser.prototype.walk = function(cb, bubble) { - walk(this.nodes, cb, bubble); - return this; - }; - ValueParser.unit = require_unit(); - ValueParser.walk = walk; - ValueParser.stringify = stringify2; - module.exports = ValueParser; - } - }); - var require_config_full = __commonJS2({ - "node_modules/tailwindcss/stubs/config.full.js"(exports, module) { - module.exports = { - content: [], - presets: [], - darkMode: "media", - theme: { - accentColor: ({ theme: theme2 }) => ({ - ...theme2("colors"), - auto: "auto" - }), - animation: { - none: "none", - spin: "spin 1s linear infinite", - ping: "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite", - pulse: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite", - bounce: "bounce 1s infinite" - }, - aria: { - busy: 'busy="true"', - checked: 'checked="true"', - disabled: 'disabled="true"', - expanded: 'expanded="true"', - hidden: 'hidden="true"', - pressed: 'pressed="true"', - readonly: 'readonly="true"', - required: 'required="true"', - selected: 'selected="true"' - }, - aspectRatio: { - auto: "auto", - square: "1 / 1", - video: "16 / 9" - }, - backdropBlur: ({ theme: theme2 }) => theme2("blur"), - backdropBrightness: ({ theme: theme2 }) => theme2("brightness"), - backdropContrast: ({ theme: theme2 }) => theme2("contrast"), - backdropGrayscale: ({ theme: theme2 }) => theme2("grayscale"), - backdropHueRotate: ({ theme: theme2 }) => theme2("hueRotate"), - backdropInvert: ({ theme: theme2 }) => theme2("invert"), - backdropOpacity: ({ theme: theme2 }) => theme2("opacity"), - backdropSaturate: ({ theme: theme2 }) => theme2("saturate"), - backdropSepia: ({ theme: theme2 }) => theme2("sepia"), - backgroundColor: ({ theme: theme2 }) => theme2("colors"), - backgroundImage: { - none: "none", - "gradient-to-t": "linear-gradient(to top, var(--tw-gradient-stops))", - "gradient-to-tr": "linear-gradient(to top right, var(--tw-gradient-stops))", - "gradient-to-r": "linear-gradient(to right, var(--tw-gradient-stops))", - "gradient-to-br": "linear-gradient(to bottom right, var(--tw-gradient-stops))", - "gradient-to-b": "linear-gradient(to bottom, var(--tw-gradient-stops))", - "gradient-to-bl": "linear-gradient(to bottom left, var(--tw-gradient-stops))", - "gradient-to-l": "linear-gradient(to left, var(--tw-gradient-stops))", - "gradient-to-tl": "linear-gradient(to top left, var(--tw-gradient-stops))" - }, - backgroundOpacity: ({ theme: theme2 }) => theme2("opacity"), - backgroundPosition: { - bottom: "bottom", - center: "center", - left: "left", - "left-bottom": "left bottom", - "left-top": "left top", - right: "right", - "right-bottom": "right bottom", - "right-top": "right top", - top: "top" - }, - backgroundSize: { - auto: "auto", - cover: "cover", - contain: "contain" - }, - blur: { - 0: "0", - none: "0", - sm: "4px", - DEFAULT: "8px", - md: "12px", - lg: "16px", - xl: "24px", - "2xl": "40px", - "3xl": "64px" - }, - borderColor: ({ theme: theme2 }) => ({ - ...theme2("colors"), - DEFAULT: theme2("colors.gray.200", "currentColor") - }), - borderOpacity: ({ theme: theme2 }) => theme2("opacity"), - borderRadius: { - none: "0px", - sm: "0.125rem", - DEFAULT: "0.25rem", - md: "0.375rem", - lg: "0.5rem", - xl: "0.75rem", - "2xl": "1rem", - "3xl": "1.5rem", - full: "9999px" - }, - borderSpacing: ({ theme: theme2 }) => ({ - ...theme2("spacing") - }), - borderWidth: { - DEFAULT: "1px", - 0: "0px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - boxShadow: { - sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", - DEFAULT: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", - md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)", - lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)", - xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)", - "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)", - inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)", - none: "none" - }, - boxShadowColor: ({ theme: theme2 }) => theme2("colors"), - brightness: { - 0: "0", - 50: ".5", - 75: ".75", - 90: ".9", - 95: ".95", - 100: "1", - 105: "1.05", - 110: "1.1", - 125: "1.25", - 150: "1.5", - 200: "2" - }, - caretColor: ({ theme: theme2 }) => theme2("colors"), - colors: ({ colors: colors2 }) => ({ - inherit: colors2.inherit, - current: colors2.current, - transparent: colors2.transparent, - black: colors2.black, - white: colors2.white, - slate: colors2.slate, - gray: colors2.gray, - zinc: colors2.zinc, - neutral: colors2.neutral, - stone: colors2.stone, - red: colors2.red, - orange: colors2.orange, - amber: colors2.amber, - yellow: colors2.yellow, - lime: colors2.lime, - green: colors2.green, - emerald: colors2.emerald, - teal: colors2.teal, - cyan: colors2.cyan, - sky: colors2.sky, - blue: colors2.blue, - indigo: colors2.indigo, - violet: colors2.violet, - purple: colors2.purple, - fuchsia: colors2.fuchsia, - pink: colors2.pink, - rose: colors2.rose - }), - columns: { - auto: "auto", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12", - "3xs": "16rem", - "2xs": "18rem", - xs: "20rem", - sm: "24rem", - md: "28rem", - lg: "32rem", - xl: "36rem", - "2xl": "42rem", - "3xl": "48rem", - "4xl": "56rem", - "5xl": "64rem", - "6xl": "72rem", - "7xl": "80rem" - }, - container: {}, - content: { - none: "none" - }, - contrast: { - 0: "0", - 50: ".5", - 75: ".75", - 100: "1", - 125: "1.25", - 150: "1.5", - 200: "2" - }, - cursor: { - auto: "auto", - default: "default", - pointer: "pointer", - wait: "wait", - text: "text", - move: "move", - help: "help", - "not-allowed": "not-allowed", - none: "none", - "context-menu": "context-menu", - progress: "progress", - cell: "cell", - crosshair: "crosshair", - "vertical-text": "vertical-text", - alias: "alias", - copy: "copy", - "no-drop": "no-drop", - grab: "grab", - grabbing: "grabbing", - "all-scroll": "all-scroll", - "col-resize": "col-resize", - "row-resize": "row-resize", - "n-resize": "n-resize", - "e-resize": "e-resize", - "s-resize": "s-resize", - "w-resize": "w-resize", - "ne-resize": "ne-resize", - "nw-resize": "nw-resize", - "se-resize": "se-resize", - "sw-resize": "sw-resize", - "ew-resize": "ew-resize", - "ns-resize": "ns-resize", - "nesw-resize": "nesw-resize", - "nwse-resize": "nwse-resize", - "zoom-in": "zoom-in", - "zoom-out": "zoom-out" - }, - divideColor: ({ theme: theme2 }) => theme2("borderColor"), - divideOpacity: ({ theme: theme2 }) => theme2("borderOpacity"), - divideWidth: ({ theme: theme2 }) => theme2("borderWidth"), - dropShadow: { - sm: "0 1px 1px rgb(0 0 0 / 0.05)", - DEFAULT: ["0 1px 2px rgb(0 0 0 / 0.1)", "0 1px 1px rgb(0 0 0 / 0.06)"], - md: ["0 4px 3px rgb(0 0 0 / 0.07)", "0 2px 2px rgb(0 0 0 / 0.06)"], - lg: ["0 10px 8px rgb(0 0 0 / 0.04)", "0 4px 3px rgb(0 0 0 / 0.1)"], - xl: ["0 20px 13px rgb(0 0 0 / 0.03)", "0 8px 5px rgb(0 0 0 / 0.08)"], - "2xl": "0 25px 25px rgb(0 0 0 / 0.15)", - none: "0 0 #0000" - }, - fill: ({ theme: theme2 }) => ({ - none: "none", - ...theme2("colors") - }), - flex: { - 1: "1 1 0%", - auto: "1 1 auto", - initial: "0 1 auto", - none: "none" - }, - flexBasis: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - "1/5": "20%", - "2/5": "40%", - "3/5": "60%", - "4/5": "80%", - "1/6": "16.666667%", - "2/6": "33.333333%", - "3/6": "50%", - "4/6": "66.666667%", - "5/6": "83.333333%", - "1/12": "8.333333%", - "2/12": "16.666667%", - "3/12": "25%", - "4/12": "33.333333%", - "5/12": "41.666667%", - "6/12": "50%", - "7/12": "58.333333%", - "8/12": "66.666667%", - "9/12": "75%", - "10/12": "83.333333%", - "11/12": "91.666667%", - full: "100%" - }), - flexGrow: { - 0: "0", - DEFAULT: "1" - }, - flexShrink: { - 0: "0", - DEFAULT: "1" - }, - fontFamily: { - sans: [ - "ui-sans-serif", - "system-ui", - "sans-serif", - '"Apple Color Emoji"', - '"Segoe UI Emoji"', - '"Segoe UI Symbol"', - '"Noto Color Emoji"' - ], - serif: ["ui-serif", "Georgia", "Cambria", '"Times New Roman"', "Times", "serif"], - mono: [ - "ui-monospace", - "SFMono-Regular", - "Menlo", - "Monaco", - "Consolas", - '"Liberation Mono"', - '"Courier New"', - "monospace" - ] - }, - fontSize: { - xs: ["0.75rem", { lineHeight: "1rem" }], - sm: ["0.875rem", { lineHeight: "1.25rem" }], - base: ["1rem", { lineHeight: "1.5rem" }], - lg: ["1.125rem", { lineHeight: "1.75rem" }], - xl: ["1.25rem", { lineHeight: "1.75rem" }], - "2xl": ["1.5rem", { lineHeight: "2rem" }], - "3xl": ["1.875rem", { lineHeight: "2.25rem" }], - "4xl": ["2.25rem", { lineHeight: "2.5rem" }], - "5xl": ["3rem", { lineHeight: "1" }], - "6xl": ["3.75rem", { lineHeight: "1" }], - "7xl": ["4.5rem", { lineHeight: "1" }], - "8xl": ["6rem", { lineHeight: "1" }], - "9xl": ["8rem", { lineHeight: "1" }] - }, - fontWeight: { - thin: "100", - extralight: "200", - light: "300", - normal: "400", - medium: "500", - semibold: "600", - bold: "700", - extrabold: "800", - black: "900" - }, - gap: ({ theme: theme2 }) => theme2("spacing"), - gradientColorStops: ({ theme: theme2 }) => theme2("colors"), - gradientColorStopPositions: { - "0%": "0%", - "5%": "5%", - "10%": "10%", - "15%": "15%", - "20%": "20%", - "25%": "25%", - "30%": "30%", - "35%": "35%", - "40%": "40%", - "45%": "45%", - "50%": "50%", - "55%": "55%", - "60%": "60%", - "65%": "65%", - "70%": "70%", - "75%": "75%", - "80%": "80%", - "85%": "85%", - "90%": "90%", - "95%": "95%", - "100%": "100%" - }, - grayscale: { - 0: "0", - DEFAULT: "100%" - }, - gridAutoColumns: { - auto: "auto", - min: "min-content", - max: "max-content", - fr: "minmax(0, 1fr)" - }, - gridAutoRows: { - auto: "auto", - min: "min-content", - max: "max-content", - fr: "minmax(0, 1fr)" - }, - gridColumn: { - auto: "auto", - "span-1": "span 1 / span 1", - "span-2": "span 2 / span 2", - "span-3": "span 3 / span 3", - "span-4": "span 4 / span 4", - "span-5": "span 5 / span 5", - "span-6": "span 6 / span 6", - "span-7": "span 7 / span 7", - "span-8": "span 8 / span 8", - "span-9": "span 9 / span 9", - "span-10": "span 10 / span 10", - "span-11": "span 11 / span 11", - "span-12": "span 12 / span 12", - "span-full": "1 / -1" - }, - gridColumnEnd: { - auto: "auto", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12", - 13: "13" - }, - gridColumnStart: { - auto: "auto", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12", - 13: "13" - }, - gridRow: { - auto: "auto", - "span-1": "span 1 / span 1", - "span-2": "span 2 / span 2", - "span-3": "span 3 / span 3", - "span-4": "span 4 / span 4", - "span-5": "span 5 / span 5", - "span-6": "span 6 / span 6", - "span-7": "span 7 / span 7", - "span-8": "span 8 / span 8", - "span-9": "span 9 / span 9", - "span-10": "span 10 / span 10", - "span-11": "span 11 / span 11", - "span-12": "span 12 / span 12", - "span-full": "1 / -1" - }, - gridRowEnd: { - auto: "auto", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12", - 13: "13" - }, - gridRowStart: { - auto: "auto", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12", - 13: "13" - }, - gridTemplateColumns: { - none: "none", - subgrid: "subgrid", - 1: "repeat(1, minmax(0, 1fr))", - 2: "repeat(2, minmax(0, 1fr))", - 3: "repeat(3, minmax(0, 1fr))", - 4: "repeat(4, minmax(0, 1fr))", - 5: "repeat(5, minmax(0, 1fr))", - 6: "repeat(6, minmax(0, 1fr))", - 7: "repeat(7, minmax(0, 1fr))", - 8: "repeat(8, minmax(0, 1fr))", - 9: "repeat(9, minmax(0, 1fr))", - 10: "repeat(10, minmax(0, 1fr))", - 11: "repeat(11, minmax(0, 1fr))", - 12: "repeat(12, minmax(0, 1fr))" - }, - gridTemplateRows: { - none: "none", - subgrid: "subgrid", - 1: "repeat(1, minmax(0, 1fr))", - 2: "repeat(2, minmax(0, 1fr))", - 3: "repeat(3, minmax(0, 1fr))", - 4: "repeat(4, minmax(0, 1fr))", - 5: "repeat(5, minmax(0, 1fr))", - 6: "repeat(6, minmax(0, 1fr))", - 7: "repeat(7, minmax(0, 1fr))", - 8: "repeat(8, minmax(0, 1fr))", - 9: "repeat(9, minmax(0, 1fr))", - 10: "repeat(10, minmax(0, 1fr))", - 11: "repeat(11, minmax(0, 1fr))", - 12: "repeat(12, minmax(0, 1fr))" - }, - height: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - "1/5": "20%", - "2/5": "40%", - "3/5": "60%", - "4/5": "80%", - "1/6": "16.666667%", - "2/6": "33.333333%", - "3/6": "50%", - "4/6": "66.666667%", - "5/6": "83.333333%", - full: "100%", - screen: "100vh", - svh: "100svh", - lvh: "100lvh", - dvh: "100dvh", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - hueRotate: { - 0: "0deg", - 15: "15deg", - 30: "30deg", - 60: "60deg", - 90: "90deg", - 180: "180deg" - }, - inset: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - full: "100%" - }), - invert: { - 0: "0", - DEFAULT: "100%" - }, - keyframes: { - spin: { - to: { - transform: "rotate(360deg)" - } - }, - ping: { - "75%, 100%": { - transform: "scale(2)", - opacity: "0" - } - }, - pulse: { - "50%": { - opacity: ".5" - } - }, - bounce: { - "0%, 100%": { - transform: "translateY(-25%)", - animationTimingFunction: "cubic-bezier(0.8,0,1,1)" - }, - "50%": { - transform: "none", - animationTimingFunction: "cubic-bezier(0,0,0.2,1)" - } - } - }, - letterSpacing: { - tighter: "-0.05em", - tight: "-0.025em", - normal: "0em", - wide: "0.025em", - wider: "0.05em", - widest: "0.1em" - }, - lineHeight: { - none: "1", - tight: "1.25", - snug: "1.375", - normal: "1.5", - relaxed: "1.625", - loose: "2", - 3: ".75rem", - 4: "1rem", - 5: "1.25rem", - 6: "1.5rem", - 7: "1.75rem", - 8: "2rem", - 9: "2.25rem", - 10: "2.5rem" - }, - listStyleType: { - none: "none", - disc: "disc", - decimal: "decimal" - }, - listStyleImage: { - none: "none" - }, - margin: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing") - }), - lineClamp: { - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6" - }, - maxHeight: ({ theme: theme2 }) => ({ - ...theme2("spacing"), - none: "none", - full: "100%", - screen: "100vh", - svh: "100svh", - lvh: "100lvh", - dvh: "100dvh", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - maxWidth: ({ theme: theme2, breakpoints }) => ({ - ...theme2("spacing"), - none: "none", - xs: "20rem", - sm: "24rem", - md: "28rem", - lg: "32rem", - xl: "36rem", - "2xl": "42rem", - "3xl": "48rem", - "4xl": "56rem", - "5xl": "64rem", - "6xl": "72rem", - "7xl": "80rem", - full: "100%", - min: "min-content", - max: "max-content", - fit: "fit-content", - prose: "65ch", - ...breakpoints(theme2("screens")) - }), - minHeight: ({ theme: theme2 }) => ({ - ...theme2("spacing"), - full: "100%", - screen: "100vh", - svh: "100svh", - lvh: "100lvh", - dvh: "100dvh", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - minWidth: ({ theme: theme2 }) => ({ - ...theme2("spacing"), - full: "100%", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - objectPosition: { - bottom: "bottom", - center: "center", - left: "left", - "left-bottom": "left bottom", - "left-top": "left top", - right: "right", - "right-bottom": "right bottom", - "right-top": "right top", - top: "top" - }, - opacity: { - 0: "0", - 5: "0.05", - 10: "0.1", - 15: "0.15", - 20: "0.2", - 25: "0.25", - 30: "0.3", - 35: "0.35", - 40: "0.4", - 45: "0.45", - 50: "0.5", - 55: "0.55", - 60: "0.6", - 65: "0.65", - 70: "0.7", - 75: "0.75", - 80: "0.8", - 85: "0.85", - 90: "0.9", - 95: "0.95", - 100: "1" - }, - order: { - first: "-9999", - last: "9999", - none: "0", - 1: "1", - 2: "2", - 3: "3", - 4: "4", - 5: "5", - 6: "6", - 7: "7", - 8: "8", - 9: "9", - 10: "10", - 11: "11", - 12: "12" - }, - outlineColor: ({ theme: theme2 }) => theme2("colors"), - outlineOffset: { - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - outlineWidth: { - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - padding: ({ theme: theme2 }) => theme2("spacing"), - placeholderColor: ({ theme: theme2 }) => theme2("colors"), - placeholderOpacity: ({ theme: theme2 }) => theme2("opacity"), - ringColor: ({ theme: theme2 }) => ({ - DEFAULT: theme2("colors.blue.500", "#3b82f6"), - ...theme2("colors") - }), - ringOffsetColor: ({ theme: theme2 }) => theme2("colors"), - ringOffsetWidth: { - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - ringOpacity: ({ theme: theme2 }) => ({ - DEFAULT: "0.5", - ...theme2("opacity") - }), - ringWidth: { - DEFAULT: "3px", - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - rotate: { - 0: "0deg", - 1: "1deg", - 2: "2deg", - 3: "3deg", - 6: "6deg", - 12: "12deg", - 45: "45deg", - 90: "90deg", - 180: "180deg" - }, - saturate: { - 0: "0", - 50: ".5", - 100: "1", - 150: "1.5", - 200: "2" - }, - scale: { - 0: "0", - 50: ".5", - 75: ".75", - 90: ".9", - 95: ".95", - 100: "1", - 105: "1.05", - 110: "1.1", - 125: "1.25", - 150: "1.5" - }, - screens: { - sm: "640px", - md: "768px", - lg: "1024px", - xl: "1280px", - "2xl": "1536px" - }, - scrollMargin: ({ theme: theme2 }) => ({ - ...theme2("spacing") - }), - scrollPadding: ({ theme: theme2 }) => theme2("spacing"), - sepia: { - 0: "0", - DEFAULT: "100%" - }, - skew: { - 0: "0deg", - 1: "1deg", - 2: "2deg", - 3: "3deg", - 6: "6deg", - 12: "12deg" - }, - space: ({ theme: theme2 }) => ({ - ...theme2("spacing") - }), - spacing: { - px: "1px", - 0: "0px", - 0.5: "0.125rem", - 1: "0.25rem", - 1.5: "0.375rem", - 2: "0.5rem", - 2.5: "0.625rem", - 3: "0.75rem", - 3.5: "0.875rem", - 4: "1rem", - 5: "1.25rem", - 6: "1.5rem", - 7: "1.75rem", - 8: "2rem", - 9: "2.25rem", - 10: "2.5rem", - 11: "2.75rem", - 12: "3rem", - 14: "3.5rem", - 16: "4rem", - 20: "5rem", - 24: "6rem", - 28: "7rem", - 32: "8rem", - 36: "9rem", - 40: "10rem", - 44: "11rem", - 48: "12rem", - 52: "13rem", - 56: "14rem", - 60: "15rem", - 64: "16rem", - 72: "18rem", - 80: "20rem", - 96: "24rem" - }, - stroke: ({ theme: theme2 }) => ({ - none: "none", - ...theme2("colors") - }), - strokeWidth: { - 0: "0", - 1: "1", - 2: "2" - }, - supports: {}, - data: {}, - textColor: ({ theme: theme2 }) => theme2("colors"), - textDecorationColor: ({ theme: theme2 }) => theme2("colors"), - textDecorationThickness: { - auto: "auto", - "from-font": "from-font", - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - textIndent: ({ theme: theme2 }) => ({ - ...theme2("spacing") - }), - textOpacity: ({ theme: theme2 }) => theme2("opacity"), - textUnderlineOffset: { - auto: "auto", - 0: "0px", - 1: "1px", - 2: "2px", - 4: "4px", - 8: "8px" - }, - transformOrigin: { - center: "center", - top: "top", - "top-right": "top right", - right: "right", - "bottom-right": "bottom right", - bottom: "bottom", - "bottom-left": "bottom left", - left: "left", - "top-left": "top left" - }, - transitionDelay: { - 0: "0s", - 75: "75ms", - 100: "100ms", - 150: "150ms", - 200: "200ms", - 300: "300ms", - 500: "500ms", - 700: "700ms", - 1e3: "1000ms" - }, - transitionDuration: { - DEFAULT: "150ms", - 0: "0s", - 75: "75ms", - 100: "100ms", - 150: "150ms", - 200: "200ms", - 300: "300ms", - 500: "500ms", - 700: "700ms", - 1e3: "1000ms" - }, - transitionProperty: { - none: "none", - all: "all", - DEFAULT: "color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter", - colors: "color, background-color, border-color, text-decoration-color, fill, stroke", - opacity: "opacity", - shadow: "box-shadow", - transform: "transform" - }, - transitionTimingFunction: { - DEFAULT: "cubic-bezier(0.4, 0, 0.2, 1)", - linear: "linear", - in: "cubic-bezier(0.4, 0, 1, 1)", - out: "cubic-bezier(0, 0, 0.2, 1)", - "in-out": "cubic-bezier(0.4, 0, 0.2, 1)" - }, - translate: ({ theme: theme2 }) => ({ - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - full: "100%" - }), - size: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - "1/5": "20%", - "2/5": "40%", - "3/5": "60%", - "4/5": "80%", - "1/6": "16.666667%", - "2/6": "33.333333%", - "3/6": "50%", - "4/6": "66.666667%", - "5/6": "83.333333%", - "1/12": "8.333333%", - "2/12": "16.666667%", - "3/12": "25%", - "4/12": "33.333333%", - "5/12": "41.666667%", - "6/12": "50%", - "7/12": "58.333333%", - "8/12": "66.666667%", - "9/12": "75%", - "10/12": "83.333333%", - "11/12": "91.666667%", - full: "100%", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - width: ({ theme: theme2 }) => ({ - auto: "auto", - ...theme2("spacing"), - "1/2": "50%", - "1/3": "33.333333%", - "2/3": "66.666667%", - "1/4": "25%", - "2/4": "50%", - "3/4": "75%", - "1/5": "20%", - "2/5": "40%", - "3/5": "60%", - "4/5": "80%", - "1/6": "16.666667%", - "2/6": "33.333333%", - "3/6": "50%", - "4/6": "66.666667%", - "5/6": "83.333333%", - "1/12": "8.333333%", - "2/12": "16.666667%", - "3/12": "25%", - "4/12": "33.333333%", - "5/12": "41.666667%", - "6/12": "50%", - "7/12": "58.333333%", - "8/12": "66.666667%", - "9/12": "75%", - "10/12": "83.333333%", - "11/12": "91.666667%", - full: "100%", - screen: "100vw", - svw: "100svw", - lvw: "100lvw", - dvw: "100dvw", - min: "min-content", - max: "max-content", - fit: "fit-content" - }), - willChange: { - auto: "auto", - scroll: "scroll-position", - contents: "contents", - transform: "transform" - }, - zIndex: { - auto: "auto", - 0: "0", - 10: "10", - 20: "20", - 30: "30", - 40: "40", - 50: "50" - } - }, - plugins: [] - }; - } - }); - function log() { - } - function dim(input) { - return input; - } - var log_default = { - info: log, - warn: log, - risk: log - }; - function normalizeTailwindDirectives(root2) { - let tailwindDirectives = /* @__PURE__ */ new Set(); - let layerDirectives = /* @__PURE__ */ new Set(); - let applyDirectives = /* @__PURE__ */ new Set(); - root2.walkAtRules((atRule2) => { - if (atRule2.name === "apply") { - applyDirectives.add(atRule2); - } - if (atRule2.name === "import") { - if (atRule2.params === '"tailwindcss/base"' || atRule2.params === "'tailwindcss/base'") { - atRule2.name = "tailwind"; - atRule2.params = "base"; - } else if (atRule2.params === '"tailwindcss/components"' || atRule2.params === "'tailwindcss/components'") { - atRule2.name = "tailwind"; - atRule2.params = "components"; - } else if (atRule2.params === '"tailwindcss/utilities"' || atRule2.params === "'tailwindcss/utilities'") { - atRule2.name = "tailwind"; - atRule2.params = "utilities"; - } else if (atRule2.params === '"tailwindcss/screens"' || atRule2.params === "'tailwindcss/screens'" || atRule2.params === '"tailwindcss/variants"' || atRule2.params === "'tailwindcss/variants'") { - atRule2.name = "tailwind"; - atRule2.params = "variants"; - } - } - if (atRule2.name === "tailwind") { - if (atRule2.params === "screens") { - atRule2.params = "variants"; - } - tailwindDirectives.add(atRule2.params); - } - if (["layer", "responsive", "variants"].includes(atRule2.name)) { - if (["responsive", "variants"].includes(atRule2.name)) { - log_default.warn(`${atRule2.name}-at-rule-deprecated`, [ - `The \`@${atRule2.name}\` directive has been deprecated in Tailwind CSS v3.0.`, - `Use \`@layer utilities\` or \`@layer components\` instead.`, - "https://tailwindcss.com/docs/upgrade-guide#replace-variants-with-layer" - ]); - } - layerDirectives.add(atRule2); - } - }); - if (!tailwindDirectives.has("base") || !tailwindDirectives.has("components") || !tailwindDirectives.has("utilities")) { - for (let rule2 of layerDirectives) { - if (rule2.name === "layer" && ["base", "components", "utilities"].includes(rule2.params)) { - if (!tailwindDirectives.has(rule2.params)) { - throw rule2.error( - `\`@layer ${rule2.params}\` is used but no matching \`@tailwind ${rule2.params}\` directive is present.` - ); - } - } else if (rule2.name === "responsive") { - if (!tailwindDirectives.has("utilities")) { - throw rule2.error("`@responsive` is used but `@tailwind utilities` is missing."); - } - } else if (rule2.name === "variants") { - if (!tailwindDirectives.has("utilities")) { - throw rule2.error("`@variants` is used but `@tailwind utilities` is missing."); - } - } - } - } - return { tailwindDirectives, applyDirectives }; - } - var preflight_default = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:theme("borderColor.DEFAULT",currentColor)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:theme("fontFamily.sans",ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:theme("fontFamily.sans[1].fontFeatureSettings",normal);font-variation-settings:theme("fontFamily.sans[1].fontVariationSettings",normal);-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:theme("fontFamily.mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:theme("fontFamily.mono[1].fontFeatureSettings",normal);font-variation-settings:theme("fontFamily.mono[1].fontVariationSettings",normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:theme("colors.gray.400",#9ca3af)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}\n'; - var fs_default = { - readFileSync: () => preflight_default - }; - var import_quick_lru = __toESM2(require_quick_lru()); - var version = "3.4.1"; - var package_default = { - name: "tailwindcss", - version, - description: "A utility-first CSS framework for rapidly building custom user interfaces.", - license: "MIT", - main: "lib/index.js", - types: "types/index.d.ts", - repository: "https://github.com/tailwindlabs/tailwindcss.git", - bugs: "https://github.com/tailwindlabs/tailwindcss/issues", - homepage: "https://tailwindcss.com", - bin: { - tailwind: "lib/cli.js", - tailwindcss: "lib/cli.js" - }, - tailwindcss: { - engine: "stable" - }, - scripts: { - prebuild: "npm run generate && rimraf lib", - build: `swc src --out-dir lib --copy-files --config jsc.transform.optimizer.globals.vars.__OXIDE__='"false"'`, - postbuild: "esbuild lib/cli-peer-dependencies.js --bundle --platform=node --outfile=peers/index.js --define:process.env.CSS_TRANSFORMER_WASM=false", - "rebuild-fixtures": "npm run build && node -r @swc/register scripts/rebuildFixtures.js", - style: "eslint .", - pretest: "npm run generate", - test: "jest", - "test:integrations": "npm run test --prefix ./integrations", - "install:integrations": "node scripts/install-integrations.js", - "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js", - "generate:types": "node -r @swc/register scripts/generate-types.js", - generate: "npm run generate:plugin-list && npm run generate:types", - "release-channel": "node ./scripts/release-channel.js", - "release-notes": "node ./scripts/release-notes.js", - prepublishOnly: "npm install --force && npm run build" - }, - files: [ - "src/*", - "cli/*", - "lib/*", - "peers/*", - "scripts/*.js", - "stubs/*", - "nesting/*", - "types/**/*", - "*.d.ts", - "*.css", - "*.js" - ], - devDependencies: { - "@swc/cli": "^0.1.62", - "@swc/core": "^1.3.55", - "@swc/jest": "^0.2.26", - "@swc/register": "^0.1.10", - autoprefixer: "^10.4.14", - browserslist: "^4.21.5", - concurrently: "^8.0.1", - cssnano: "^6.0.0", - esbuild: "^0.17.18", - eslint: "^8.39.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^4.2.1", - jest: "^29.6.0", - "jest-diff": "^29.6.0", - lightningcss: "1.18.0", - prettier: "^2.8.8", - rimraf: "^5.0.0", - "source-map-js": "^1.0.2", - turbo: "^1.9.3" - }, - dependencies: { - "@alloc/quick-lru": "^5.2.0", - arg: "^5.0.2", - chokidar: "^3.5.3", - didyoumean: "^1.2.2", - dlv: "^1.1.3", - "fast-glob": "^3.3.0", - "glob-parent": "^6.0.2", - "is-glob": "^4.0.3", - jiti: "^1.19.1", - lilconfig: "^2.1.0", - micromatch: "^4.0.5", - "normalize-path": "^3.0.0", - "object-hash": "^3.0.0", - picocolors: "^1.0.0", - postcss: "^8.4.23", - "postcss-import": "^15.1.0", - "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.1", - "postcss-nested": "^6.0.1", - "postcss-selector-parser": "^6.0.11", - resolve: "^1.22.2", - sucrase: "^3.32.0" - }, - browserslist: [ - "> 1%", - "not edge <= 18", - "not ie 11", - "not op_mini all" - ], - jest: { - testTimeout: 3e4, - setupFilesAfterEnv: [ - "/jest/customMatchers.js" - ], - testPathIgnorePatterns: [ - "/node_modules/", - "/integrations/", - "/standalone-cli/", - "\\.test\\.skip\\.js$" - ], - transformIgnorePatterns: [ - "node_modules/(?!lightningcss)" - ], - transform: { - "\\.js$": "@swc/jest", - "\\.ts$": "@swc/jest" - } - }, - engines: { - node: ">=14.0.0" - } - }; - var env = typeof process !== "undefined" ? { - NODE_ENV: "development", - DEBUG: resolveDebug(void 0), - ENGINE: package_default.tailwindcss.engine - } : { - NODE_ENV: "production", - DEBUG: false, - ENGINE: package_default.tailwindcss.engine - }; - var contextSourcesMap = /* @__PURE__ */ new Map(); - var NOT_ON_DEMAND = new String("*"); - var NONE = Symbol("__NONE__"); - function resolveDebug(debug) { - if (debug === void 0) { - return false; - } - if (debug === "true" || debug === "1") { - return true; - } - if (debug === "false" || debug === "0") { - return false; - } - if (debug === "*") { - return true; - } - let debuggers = debug.split(",").map((d) => d.split(":")[0]); - if (debuggers.includes("-tailwindcss")) { - return false; - } - if (debuggers.includes("tailwindcss")) { - return true; - } - return false; - } - function parseObjectStyles(styles) { - if (!Array.isArray(styles)) { - return parseObjectStyles([styles]); - } - return styles.flatMap((style) => { - return postcss_default([ - (0, import_postcss_nested.default)({ - bubble: ["screen"] - }) - ]).process(style, { - parser: postcss_js_default - }).root.nodes; - }); - } - function isPlainObject(value2) { - if (Object.prototype.toString.call(value2) !== "[object Object]") { - return false; - } - const prototype = Object.getPrototypeOf(value2); - return prototype === null || Object.getPrototypeOf(prototype) === null; - } - function prefixSelector_default(prefix3, selector, prependNegative = false) { - if (prefix3 === "") { - return selector; - } - let ast = typeof selector === "string" ? (0, import_postcss_selector_parser2.default)().astSync(selector) : selector; - ast.walkClasses((classSelector) => { - let baseClass = classSelector.value; - let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-"); - classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix3}${baseClass.slice(1)}` : `${prefix3}${baseClass}`; - }); - return typeof selector === "string" ? ast.toString() : ast; - } - function escapeCommas(className) { - return className.replace(/\\,/g, "\\2c "); - } - var colorNames_default = { - aliceblue: [240, 248, 255], - antiquewhite: [250, 235, 215], - aqua: [0, 255, 255], - aquamarine: [127, 255, 212], - azure: [240, 255, 255], - beige: [245, 245, 220], - bisque: [255, 228, 196], - black: [0, 0, 0], - blanchedalmond: [255, 235, 205], - blue: [0, 0, 255], - blueviolet: [138, 43, 226], - brown: [165, 42, 42], - burlywood: [222, 184, 135], - cadetblue: [95, 158, 160], - chartreuse: [127, 255, 0], - chocolate: [210, 105, 30], - coral: [255, 127, 80], - cornflowerblue: [100, 149, 237], - cornsilk: [255, 248, 220], - crimson: [220, 20, 60], - cyan: [0, 255, 255], - darkblue: [0, 0, 139], - darkcyan: [0, 139, 139], - darkgoldenrod: [184, 134, 11], - darkgray: [169, 169, 169], - darkgreen: [0, 100, 0], - darkgrey: [169, 169, 169], - darkkhaki: [189, 183, 107], - darkmagenta: [139, 0, 139], - darkolivegreen: [85, 107, 47], - darkorange: [255, 140, 0], - darkorchid: [153, 50, 204], - darkred: [139, 0, 0], - darksalmon: [233, 150, 122], - darkseagreen: [143, 188, 143], - darkslateblue: [72, 61, 139], - darkslategray: [47, 79, 79], - darkslategrey: [47, 79, 79], - darkturquoise: [0, 206, 209], - darkviolet: [148, 0, 211], - deeppink: [255, 20, 147], - deepskyblue: [0, 191, 255], - dimgray: [105, 105, 105], - dimgrey: [105, 105, 105], - dodgerblue: [30, 144, 255], - firebrick: [178, 34, 34], - floralwhite: [255, 250, 240], - forestgreen: [34, 139, 34], - fuchsia: [255, 0, 255], - gainsboro: [220, 220, 220], - ghostwhite: [248, 248, 255], - gold: [255, 215, 0], - goldenrod: [218, 165, 32], - gray: [128, 128, 128], - green: [0, 128, 0], - greenyellow: [173, 255, 47], - grey: [128, 128, 128], - honeydew: [240, 255, 240], - hotpink: [255, 105, 180], - indianred: [205, 92, 92], - indigo: [75, 0, 130], - ivory: [255, 255, 240], - khaki: [240, 230, 140], - lavender: [230, 230, 250], - lavenderblush: [255, 240, 245], - lawngreen: [124, 252, 0], - lemonchiffon: [255, 250, 205], - lightblue: [173, 216, 230], - lightcoral: [240, 128, 128], - lightcyan: [224, 255, 255], - lightgoldenrodyellow: [250, 250, 210], - lightgray: [211, 211, 211], - lightgreen: [144, 238, 144], - lightgrey: [211, 211, 211], - lightpink: [255, 182, 193], - lightsalmon: [255, 160, 122], - lightseagreen: [32, 178, 170], - lightskyblue: [135, 206, 250], - lightslategray: [119, 136, 153], - lightslategrey: [119, 136, 153], - lightsteelblue: [176, 196, 222], - lightyellow: [255, 255, 224], - lime: [0, 255, 0], - limegreen: [50, 205, 50], - linen: [250, 240, 230], - magenta: [255, 0, 255], - maroon: [128, 0, 0], - mediumaquamarine: [102, 205, 170], - mediumblue: [0, 0, 205], - mediumorchid: [186, 85, 211], - mediumpurple: [147, 112, 219], - mediumseagreen: [60, 179, 113], - mediumslateblue: [123, 104, 238], - mediumspringgreen: [0, 250, 154], - mediumturquoise: [72, 209, 204], - mediumvioletred: [199, 21, 133], - midnightblue: [25, 25, 112], - mintcream: [245, 255, 250], - mistyrose: [255, 228, 225], - moccasin: [255, 228, 181], - navajowhite: [255, 222, 173], - navy: [0, 0, 128], - oldlace: [253, 245, 230], - olive: [128, 128, 0], - olivedrab: [107, 142, 35], - orange: [255, 165, 0], - orangered: [255, 69, 0], - orchid: [218, 112, 214], - palegoldenrod: [238, 232, 170], - palegreen: [152, 251, 152], - paleturquoise: [175, 238, 238], - palevioletred: [219, 112, 147], - papayawhip: [255, 239, 213], - peachpuff: [255, 218, 185], - peru: [205, 133, 63], - pink: [255, 192, 203], - plum: [221, 160, 221], - powderblue: [176, 224, 230], - purple: [128, 0, 128], - rebeccapurple: [102, 51, 153], - red: [255, 0, 0], - rosybrown: [188, 143, 143], - royalblue: [65, 105, 225], - saddlebrown: [139, 69, 19], - salmon: [250, 128, 114], - sandybrown: [244, 164, 96], - seagreen: [46, 139, 87], - seashell: [255, 245, 238], - sienna: [160, 82, 45], - silver: [192, 192, 192], - skyblue: [135, 206, 235], - slateblue: [106, 90, 205], - slategray: [112, 128, 144], - slategrey: [112, 128, 144], - snow: [255, 250, 250], - springgreen: [0, 255, 127], - steelblue: [70, 130, 180], - tan: [210, 180, 140], - teal: [0, 128, 128], - thistle: [216, 191, 216], - tomato: [255, 99, 71], - turquoise: [64, 224, 208], - violet: [238, 130, 238], - wheat: [245, 222, 179], - white: [255, 255, 255], - whitesmoke: [245, 245, 245], - yellow: [255, 255, 0], - yellowgreen: [154, 205, 50] - }; - var HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i; - var SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i; - var VALUE = /(?:\d+|\d*\.\d+)%?/; - var SEP = /(?:\s*,\s*|\s+)/; - var ALPHA_SEP = /\s*[,/]\s*/; - var CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)(?:,(?:[^ )]*?|var\(--[^ )]*?\)))?\)/; - var RGB = new RegExp( - `^(rgba?)\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$` - ); - var HSL = new RegExp( - `^(hsla?)\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$` - ); - function parseColor(value2, { loose = false } = {}) { - if (typeof value2 !== "string") { - return null; - } - value2 = value2.trim(); - if (value2 === "transparent") { - return { mode: "rgb", color: ["0", "0", "0"], alpha: "0" }; - } - if (value2 in colorNames_default) { - return { mode: "rgb", color: colorNames_default[value2].map((v) => v.toString()) }; - } - let hex = value2.replace(SHORT_HEX, (_, r, g, b, a) => ["#", r, r, g, g, b, b, a ? a + a : ""].join("")).match(HEX); - if (hex !== null) { - return { - mode: "rgb", - color: [parseInt(hex[1], 16), parseInt(hex[2], 16), parseInt(hex[3], 16)].map( - (v) => v.toString() - ), - alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : void 0 - }; - } - let match = value2.match(RGB) ?? value2.match(HSL); - if (match === null) { - return null; - } - let color2 = [match[2], match[3], match[4]].filter(Boolean).map((v) => v.toString()); - if (color2.length === 2 && color2[0].startsWith("var(")) { - return { - mode: match[1], - color: [color2[0]], - alpha: color2[1] - }; - } - if (!loose && color2.length !== 3) { - return null; - } - if (color2.length < 3 && !color2.some((part) => /^var\(.*?\)$/.test(part))) { - return null; - } - return { - mode: match[1], - color: color2, - alpha: match[5]?.toString?.() - }; - } - function formatColor({ mode, color: color2, alpha }) { - let hasAlpha = alpha !== void 0; - if (mode === "rgba" || mode === "hsla") { - return `${mode}(${color2.join(", ")}${hasAlpha ? `, ${alpha}` : ""})`; - } - return `${mode}(${color2.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`; - } - function withAlphaValue(color2, alphaValue, defaultValue) { - if (typeof color2 === "function") { - return color2({ opacityValue: alphaValue }); - } - let parsed = parseColor(color2, { loose: true }); - if (parsed === null) { - return defaultValue; - } - return formatColor({ ...parsed, alpha: alphaValue }); - } - function withAlphaVariable({ color: color2, property, variable }) { - let properties = [].concat(property); - if (typeof color2 === "function") { - return { - [variable]: "1", - ...Object.fromEntries( - properties.map((p) => { - return [p, color2({ opacityVariable: variable, opacityValue: `var(${variable})` })]; - }) - ) - }; - } - const parsed = parseColor(color2); - if (parsed === null) { - return Object.fromEntries(properties.map((p) => [p, color2])); - } - if (parsed.alpha !== void 0) { - return Object.fromEntries(properties.map((p) => [p, color2])); - } - return { - [variable]: "1", - ...Object.fromEntries( - properties.map((p) => { - return [p, formatColor({ ...parsed, alpha: `var(${variable})` })]; - }) - ) - }; - } - function splitAtTopLevelOnly(input, separator) { - let stack = []; - let parts = []; - let lastPos = 0; - let isEscaped = false; - for (let idx = 0; idx < input.length; idx++) { - let char = input[idx]; - if (stack.length === 0 && char === separator[0] && !isEscaped) { - if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) { - parts.push(input.slice(lastPos, idx)); - lastPos = idx + separator.length; - } - } - if (isEscaped) { - isEscaped = false; - } else if (char === "\\") { - isEscaped = true; - } - if (char === "(" || char === "[" || char === "{") { - stack.push(char); - } else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") { - stack.pop(); - } - } - parts.push(input.slice(lastPos)); - return parts; - } - var KEYWORDS = /* @__PURE__ */ new Set(["inset", "inherit", "initial", "revert", "unset"]); - var SPACE = /\ +(?![^(]*\))/g; - var LENGTH = /^-?(\d+|\.\d+)(.*?)$/g; - function parseBoxShadowValue(input) { - let shadows = splitAtTopLevelOnly(input, ","); - return shadows.map((shadow2) => { - let value2 = shadow2.trim(); - let result = { raw: value2 }; - let parts = value2.split(SPACE); - let seen = /* @__PURE__ */ new Set(); - for (let part of parts) { - LENGTH.lastIndex = 0; - if (!seen.has("KEYWORD") && KEYWORDS.has(part)) { - result.keyword = part; - seen.add("KEYWORD"); - } else if (LENGTH.test(part)) { - if (!seen.has("X")) { - result.x = part; - seen.add("X"); - } else if (!seen.has("Y")) { - result.y = part; - seen.add("Y"); - } else if (!seen.has("BLUR")) { - result.blur = part; - seen.add("BLUR"); - } else if (!seen.has("SPREAD")) { - result.spread = part; - seen.add("SPREAD"); - } - } else { - if (!result.color) { - result.color = part; - } else { - if (!result.unknown) - result.unknown = []; - result.unknown.push(part); - } - } - } - result.valid = result.x !== void 0 && result.y !== void 0; - return result; - }); - } - function formatBoxShadowValue(shadows) { - return shadows.map((shadow2) => { - if (!shadow2.valid) { - return shadow2.raw; - } - return [shadow2.keyword, shadow2.x, shadow2.y, shadow2.blur, shadow2.spread, shadow2.color].filter(Boolean).join(" "); - }).join(", "); - } - var cssFunctions = ["min", "max", "clamp", "calc"]; - function isCSSFunction(value2) { - return cssFunctions.some((fn) => new RegExp(`^${fn}\\(.*\\)`).test(value2)); - } - var AUTO_VAR_INJECTION_EXCEPTIONS = /* @__PURE__ */ new Set([ - "scroll-timeline-name", - "timeline-scope", - "view-timeline-name", - "font-palette", - "scroll-timeline", - "animation-timeline", - "view-timeline" - ]); - function normalize(value2, context = null, isRoot2 = true) { - let isVarException = context && AUTO_VAR_INJECTION_EXCEPTIONS.has(context.property); - if (value2.startsWith("--") && !isVarException) { - return `var(${value2})`; - } - if (value2.includes("url(")) { - return value2.split(/(url\(.*?\))/g).filter(Boolean).map((part) => { - if (/^url\(.*?\)$/.test(part)) { - return part; - } - return normalize(part, context, false); - }).join(""); - } - value2 = value2.replace( - /([^\\])_+/g, - (fullMatch, characterBefore) => characterBefore + " ".repeat(fullMatch.length - 1) - ).replace(/^_/g, " ").replace(/\\_/g, "_"); - if (isRoot2) { - value2 = value2.trim(); - } - value2 = normalizeMathOperatorSpacing(value2); - return value2; - } - function normalizeMathOperatorSpacing(value2) { - let preventFormattingInFunctions = ["theme"]; - let preventFormattingKeywords = [ - "min-content", - "max-content", - "fit-content", - "safe-area-inset-top", - "safe-area-inset-right", - "safe-area-inset-bottom", - "safe-area-inset-left", - "titlebar-area-x", - "titlebar-area-y", - "titlebar-area-width", - "titlebar-area-height", - "keyboard-inset-top", - "keyboard-inset-right", - "keyboard-inset-bottom", - "keyboard-inset-left", - "keyboard-inset-width", - "keyboard-inset-height", - "radial-gradient", - "linear-gradient", - "conic-gradient", - "repeating-radial-gradient", - "repeating-linear-gradient", - "repeating-conic-gradient" - ]; - return value2.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => { - let result = ""; - function lastChar() { - let char = result.trimEnd(); - return char[char.length - 1]; - } - for (let i = 0; i < match.length; i++) { - let peek = function(word) { - return word.split("").every((char2, j) => match[i + j] === char2); - }, consumeUntil = function(chars) { - let minIndex = Infinity; - for (let char2 of chars) { - let index4 = match.indexOf(char2, i); - if (index4 !== -1 && index4 < minIndex) { - minIndex = index4; - } - } - let result2 = match.slice(i, minIndex); - i += result2.length - 1; - return result2; - }; - let char = match[i]; - if (peek("var")) { - result += consumeUntil([")", ","]); - } else if (preventFormattingKeywords.some((keyword) => peek(keyword))) { - let keyword = preventFormattingKeywords.find((keyword2) => peek(keyword2)); - result += keyword; - i += keyword.length - 1; - } else if (preventFormattingInFunctions.some((fn) => peek(fn))) { - result += consumeUntil([")"]); - } else if (peek("[")) { - result += consumeUntil(["]"]); - } else if (["+", "-", "*", "/"].includes(char) && !["(", "+", "-", "*", "/", ","].includes(lastChar())) { - result += ` ${char} `; - } else { - result += char; - } - } - return result.replace(/\s+/g, " "); - }); - } - function url(value2) { - return value2.startsWith("url("); - } - function number(value2) { - return !isNaN(Number(value2)) || isCSSFunction(value2); - } - function percentage(value2) { - return value2.endsWith("%") && number(value2.slice(0, -1)) || isCSSFunction(value2); - } - var lengthUnits = [ - "cm", - "mm", - "Q", - "in", - "pc", - "pt", - "px", - "em", - "ex", - "ch", - "rem", - "lh", - "rlh", - "vw", - "vh", - "vmin", - "vmax", - "vb", - "vi", - "svw", - "svh", - "lvw", - "lvh", - "dvw", - "dvh", - "cqw", - "cqh", - "cqi", - "cqb", - "cqmin", - "cqmax" - ]; - var lengthUnitsPattern = `(?:${lengthUnits.join("|")})`; - function length(value2) { - return value2 === "0" || new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value2) || isCSSFunction(value2); - } - var lineWidths = /* @__PURE__ */ new Set(["thin", "medium", "thick"]); - function lineWidth(value2) { - return lineWidths.has(value2); - } - function shadow(value2) { - let parsedShadows = parseBoxShadowValue(normalize(value2)); - for (let parsedShadow of parsedShadows) { - if (!parsedShadow.valid) { - return false; - } - } - return true; - } - function color(value2) { - let colors2 = 0; - let result = splitAtTopLevelOnly(value2, "_").every((part) => { - part = normalize(part); - if (part.startsWith("var(")) - return true; - if (parseColor(part, { loose: true }) !== null) - return colors2++, true; - return false; - }); - if (!result) - return false; - return colors2 > 0; - } - function image(value2) { - let images = 0; - let result = splitAtTopLevelOnly(value2, ",").every((part) => { - part = normalize(part); - if (part.startsWith("var(")) - return true; - if (url(part) || gradient(part) || ["element(", "image(", "cross-fade(", "image-set("].some((fn) => part.startsWith(fn))) { - images++; - return true; - } - return false; - }); - if (!result) - return false; - return images > 0; - } - var gradientTypes = /* @__PURE__ */ new Set([ - "conic-gradient", - "linear-gradient", - "radial-gradient", - "repeating-conic-gradient", - "repeating-linear-gradient", - "repeating-radial-gradient" - ]); - function gradient(value2) { - value2 = normalize(value2); - for (let type of gradientTypes) { - if (value2.startsWith(`${type}(`)) { - return true; - } - } - return false; - } - var validPositions = /* @__PURE__ */ new Set(["center", "top", "right", "bottom", "left"]); - function position(value2) { - let positions = 0; - let result = splitAtTopLevelOnly(value2, "_").every((part) => { - part = normalize(part); - if (part.startsWith("var(")) - return true; - if (validPositions.has(part) || length(part) || percentage(part)) { - positions++; - return true; - } - return false; - }); - if (!result) - return false; - return positions > 0; - } - function familyName(value2) { - let fonts = 0; - let result = splitAtTopLevelOnly(value2, ",").every((part) => { - part = normalize(part); - if (part.startsWith("var(")) - return true; - if (part.includes(" ")) { - if (!/(['"])([^"']+)\1/g.test(part)) { - return false; - } - } - if (/^\d/g.test(part)) { - return false; - } - fonts++; - return true; - }); - if (!result) - return false; - return fonts > 0; - } - var genericNames = /* @__PURE__ */ new Set([ - "serif", - "sans-serif", - "monospace", - "cursive", - "fantasy", - "system-ui", - "ui-serif", - "ui-sans-serif", - "ui-monospace", - "ui-rounded", - "math", - "emoji", - "fangsong" - ]); - function genericName(value2) { - return genericNames.has(value2); - } - var absoluteSizes = /* @__PURE__ */ new Set([ - "xx-small", - "x-small", - "small", - "medium", - "large", - "x-large", - "x-large", - "xxx-large" - ]); - function absoluteSize(value2) { - return absoluteSizes.has(value2); - } - var relativeSizes = /* @__PURE__ */ new Set(["larger", "smaller"]); - function relativeSize(value2) { - return relativeSizes.has(value2); - } - function negateValue(value2) { - value2 = `${value2}`; - if (value2 === "0") { - return "0"; - } - if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value2)) { - return value2.replace(/^[+-]?/, (sign) => sign === "-" ? "" : "-"); - } - let numericFunctions = ["var", "calc", "min", "max", "clamp"]; - for (const fn of numericFunctions) { - if (value2.includes(`${fn}(`)) { - return `calc(${value2} * -1)`; - } - } - } - function backgroundSize(value2) { - let keywordValues = ["cover", "contain"]; - return splitAtTopLevelOnly(value2, ",").every((part) => { - let sizes = splitAtTopLevelOnly(part, "_").filter(Boolean); - if (sizes.length === 1 && keywordValues.includes(sizes[0])) - return true; - if (sizes.length !== 1 && sizes.length !== 2) - return false; - return sizes.every((size) => length(size) || percentage(size) || size === "auto"); - }); - } - var picocolors_default = { - yellow: (input) => input - }; - var defaults = { - optimizeUniversalDefaults: false, - generalizedModifiers: true, - get disableColorOpacityUtilitiesByDefault() { - return false; - }, - get relativeContentPathsByDefault() { - return false; - } - }; - var featureFlags = { - future: [ - "hoverOnlyWhenSupported", - "respectDefaultRingColorOpacity", - "disableColorOpacityUtilitiesByDefault", - "relativeContentPathsByDefault" - ], - experimental: ["optimizeUniversalDefaults", "generalizedModifiers"] - }; - function flagEnabled(config5, flag) { - if (featureFlags.future.includes(flag)) { - return config5.future === "all" || (config5?.future?.[flag] ?? defaults[flag] ?? false); - } - if (featureFlags.experimental.includes(flag)) { - return config5.experimental === "all" || (config5?.experimental?.[flag] ?? defaults[flag] ?? false); - } - return false; - } - function experimentalFlagsEnabled(config5) { - if (config5.experimental === "all") { - return featureFlags.experimental; - } - return Object.keys(config5?.experimental ?? {}).filter( - (flag) => featureFlags.experimental.includes(flag) && config5.experimental[flag] - ); - } - function issueFlagNotices(config5) { - if (true) { - return; - } - if (experimentalFlagsEnabled(config5).length > 0) { - let changes = experimentalFlagsEnabled(config5).map((s) => picocolors_default.yellow(s)).join(", "); - log_default.warn("experimental-flags-enabled", [ - `You have enabled experimental features: ${changes}`, - "Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time." - ]); - } - } - function updateAllClasses(selectors, updateClass) { - selectors.walkClasses((sel) => { - sel.value = updateClass(sel.value); - if (sel.raws && sel.raws.value) { - sel.raws.value = escapeCommas(sel.raws.value); - } - }); - } - function resolveArbitraryValue(modifier, validate) { - if (!isArbitraryValue(modifier)) { - return void 0; - } - let value2 = modifier.slice(1, -1); - if (!validate(value2)) { - return void 0; - } - return normalize(value2); - } - function asNegativeValue(modifier, lookup = {}, validate) { - let positiveValue = lookup[modifier]; - if (positiveValue !== void 0) { - return negateValue(positiveValue); - } - if (isArbitraryValue(modifier)) { - let resolved = resolveArbitraryValue(modifier, validate); - if (resolved === void 0) { - return void 0; - } - return negateValue(resolved); - } - } - function asValue(modifier, options = {}, { validate = () => true } = {}) { - let value2 = options.values?.[modifier]; - if (value2 !== void 0) { - return value2; - } - if (options.supportsNegativeValues && modifier.startsWith("-")) { - return asNegativeValue(modifier.slice(1), options.values, validate); - } - return resolveArbitraryValue(modifier, validate); - } - function isArbitraryValue(input) { - return input.startsWith("[") && input.endsWith("]"); - } - function splitUtilityModifier(modifier) { - let slashIdx = modifier.lastIndexOf("/"); - let arbitraryStartIdx = modifier.lastIndexOf("[", slashIdx); - let arbitraryEndIdx = modifier.indexOf("]", slashIdx); - let isNextToArbitrary = modifier[slashIdx - 1] === "]" || modifier[slashIdx + 1] === "["; - if (!isNextToArbitrary) { - if (arbitraryStartIdx !== -1 && arbitraryEndIdx !== -1) { - if (arbitraryStartIdx < slashIdx && slashIdx < arbitraryEndIdx) { - slashIdx = modifier.lastIndexOf("/", arbitraryStartIdx); - } - } - } - if (slashIdx === -1 || slashIdx === modifier.length - 1) { - return [modifier, void 0]; - } - let arbitrary = isArbitraryValue(modifier); - if (arbitrary && !modifier.includes("]/[")) { - return [modifier, void 0]; - } - return [modifier.slice(0, slashIdx), modifier.slice(slashIdx + 1)]; - } - function parseColorFormat(value2) { - if (typeof value2 === "string" && value2.includes("")) { - let oldValue = value2; - return ({ opacityValue = 1 }) => oldValue.replace("", opacityValue); - } - return value2; - } - function unwrapArbitraryModifier(modifier) { - return normalize(modifier.slice(1, -1)); - } - function asColor(modifier, options = {}, { tailwindConfig: tailwindConfig2 = {} } = {}) { - if (options.values?.[modifier] !== void 0) { - return parseColorFormat(options.values?.[modifier]); - } - let [color2, alpha] = splitUtilityModifier(modifier); - if (alpha !== void 0) { - let normalizedColor = options.values?.[color2] ?? (isArbitraryValue(color2) ? color2.slice(1, -1) : void 0); - if (normalizedColor === void 0) { - return void 0; - } - normalizedColor = parseColorFormat(normalizedColor); - if (isArbitraryValue(alpha)) { - return withAlphaValue(normalizedColor, unwrapArbitraryModifier(alpha)); - } - if (tailwindConfig2.theme?.opacity?.[alpha] === void 0) { - return void 0; - } - return withAlphaValue(normalizedColor, tailwindConfig2.theme.opacity[alpha]); - } - return asValue(modifier, options, { validate: color }); - } - function asLookupValue(modifier, options = {}) { - return options.values?.[modifier]; - } - function guess(validate) { - return (modifier, options) => { - return asValue(modifier, options, { validate }); - }; - } - var typeMap = { - any: asValue, - color: asColor, - url: guess(url), - image: guess(image), - length: guess(length), - percentage: guess(percentage), - position: guess(position), - lookup: asLookupValue, - "generic-name": guess(genericName), - "family-name": guess(familyName), - number: guess(number), - "line-width": guess(lineWidth), - "absolute-size": guess(absoluteSize), - "relative-size": guess(relativeSize), - shadow: guess(shadow), - size: guess(backgroundSize) - }; - var supportedTypes = Object.keys(typeMap); - function splitAtFirst(input, delim) { - let idx = input.indexOf(delim); - if (idx === -1) - return [void 0, input]; - return [input.slice(0, idx), input.slice(idx + 1)]; - } - function coerceValue(types2, modifier, options, tailwindConfig2) { - if (options.values && modifier in options.values) { - for (let { type } of types2 ?? []) { - let result = typeMap[type](modifier, options, { - tailwindConfig: tailwindConfig2 - }); - if (result === void 0) { - continue; - } - return [result, type, null]; - } - } - if (isArbitraryValue(modifier)) { - let arbitraryValue = modifier.slice(1, -1); - let [explicitType, value2] = splitAtFirst(arbitraryValue, ":"); - if (!/^[\w-_]+$/g.test(explicitType)) { - value2 = arbitraryValue; - } else if (explicitType !== void 0 && !supportedTypes.includes(explicitType)) { - return []; - } - if (value2.length > 0 && supportedTypes.includes(explicitType)) { - return [asValue(`[${value2}]`, options), explicitType, null]; - } - } - let matches = getMatchingTypes(types2, modifier, options, tailwindConfig2); - for (let match of matches) { - return match; - } - return []; - } - function* getMatchingTypes(types2, rawModifier, options, tailwindConfig2) { - let modifiersEnabled = flagEnabled(tailwindConfig2, "generalizedModifiers"); - let [modifier, utilityModifier] = splitUtilityModifier(rawModifier); - let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers)); - if (!canUseUtilityModifier) { - modifier = rawModifier; - utilityModifier = void 0; - } - if (utilityModifier !== void 0 && modifier === "") { - modifier = "DEFAULT"; - } - if (utilityModifier !== void 0) { - if (typeof options.modifiers === "object") { - let configValue = options.modifiers?.[utilityModifier] ?? null; - if (configValue !== null) { - utilityModifier = configValue; - } else if (isArbitraryValue(utilityModifier)) { - utilityModifier = unwrapArbitraryModifier(utilityModifier); - } - } - } - for (let { type } of types2 ?? []) { - let result = typeMap[type](modifier, options, { - tailwindConfig: tailwindConfig2 - }); - if (result === void 0) { - continue; - } - yield [result, type, utilityModifier ?? null]; - } - } - function escapeClassName(className) { - let node = import_postcss_selector_parser4.default.className(); - node.value = className; - return escapeCommas(node?.raws?.value ?? node.value); - } - var elementProperties = { - "::after": ["terminal", "jumpable"], - "::backdrop": ["terminal", "jumpable"], - "::before": ["terminal", "jumpable"], - "::cue": ["terminal"], - "::cue-region": ["terminal"], - "::first-letter": ["terminal", "jumpable"], - "::first-line": ["terminal", "jumpable"], - "::grammar-error": ["terminal"], - "::marker": ["terminal", "jumpable"], - "::part": ["terminal", "actionable"], - "::placeholder": ["terminal", "jumpable"], - "::selection": ["terminal", "jumpable"], - "::slotted": ["terminal"], - "::spelling-error": ["terminal"], - "::target-text": ["terminal"], - "::file-selector-button": ["terminal", "actionable"], - "::deep": ["actionable"], - "::v-deep": ["actionable"], - "::ng-deep": ["actionable"], - ":after": ["terminal", "jumpable"], - ":before": ["terminal", "jumpable"], - ":first-letter": ["terminal", "jumpable"], - ":first-line": ["terminal", "jumpable"], - ":where": [], - ":is": [], - ":has": [], - __default__: ["terminal", "actionable"] - }; - function movePseudos(sel) { - let [pseudos] = movablePseudos(sel); - pseudos.forEach(([sel2, pseudo]) => sel2.removeChild(pseudo)); - sel.nodes.push(...pseudos.map(([, pseudo]) => pseudo)); - return sel; - } - function movablePseudos(sel) { - let buffer = []; - let lastSeenElement = null; - for (let node of sel.nodes) { - if (node.type === "combinator") { - buffer = buffer.filter(([, node2]) => propertiesForPseudo(node2).includes("jumpable")); - lastSeenElement = null; - } else if (node.type === "pseudo") { - if (isMovablePseudoElement(node)) { - lastSeenElement = node; - buffer.push([sel, node, null]); - } else if (lastSeenElement && isAttachablePseudoClass(node, lastSeenElement)) { - buffer.push([sel, node, lastSeenElement]); - } else { - lastSeenElement = null; - } - for (let sub of node.nodes ?? []) { - let [movable, lastSeenElementInSub] = movablePseudos(sub); - lastSeenElement = lastSeenElementInSub || lastSeenElement; - buffer.push(...movable); - } - } - } - return [buffer, lastSeenElement]; - } - function isPseudoElement(node) { - return node.value.startsWith("::") || elementProperties[node.value] !== void 0; - } - function isMovablePseudoElement(node) { - return isPseudoElement(node) && propertiesForPseudo(node).includes("terminal"); - } - function isAttachablePseudoClass(node, pseudo) { - if (node.type !== "pseudo") - return false; - if (isPseudoElement(node)) - return false; - return propertiesForPseudo(pseudo).includes("actionable"); - } - function propertiesForPseudo(pseudo) { - return elementProperties[pseudo.value] ?? elementProperties.__default__; - } - var MERGE = ":merge"; - function formatVariantSelector(formats, { context, candidate }) { - let prefix3 = context?.tailwindConfig.prefix ?? ""; - let parsedFormats = formats.map((format) => { - let ast = (0, import_postcss_selector_parser3.default)().astSync(format.format); - return { - ...format, - ast: format.respectPrefix ? prefixSelector_default(prefix3, ast) : ast - }; - }); - let formatAst = import_postcss_selector_parser3.default.root({ - nodes: [ - import_postcss_selector_parser3.default.selector({ - nodes: [import_postcss_selector_parser3.default.className({ value: escapeClassName(candidate) })] - }) - ] - }); - for (let { ast } of parsedFormats) { - ; - [formatAst, ast] = handleMergePseudo(formatAst, ast); - ast.walkNesting((nesting) => nesting.replaceWith(...formatAst.nodes[0].nodes)); - formatAst = ast; - } - return formatAst; - } - function simpleSelectorForNode(node) { - let nodes = []; - while (node.prev() && node.prev().type !== "combinator") { - node = node.prev(); - } - while (node && node.type !== "combinator") { - nodes.push(node); - node = node.next(); - } - return nodes; - } - function resortSelector(sel) { - sel.sort((a, b) => { - if (a.type === "tag" && b.type === "class") { - return -1; - } else if (a.type === "class" && b.type === "tag") { - return 1; - } else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) { - return -1; - } else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") { - return 1; - } - return sel.index(a) - sel.index(b); - }); - return sel; - } - function eliminateIrrelevantSelectors(sel, base) { - let hasClassesMatchingCandidate = false; - sel.walk((child) => { - if (child.type === "class" && child.value === base) { - hasClassesMatchingCandidate = true; - return false; - } - }); - if (!hasClassesMatchingCandidate) { - sel.remove(); - } - } - function finalizeSelector(current, formats, { context, candidate, base }) { - let separator = context?.tailwindConfig?.separator ?? ":"; - base = base ?? splitAtTopLevelOnly(candidate, separator).pop(); - let selector = (0, import_postcss_selector_parser3.default)().astSync(current); - selector.walkClasses((node) => { - if (node.raws && node.value.includes(base)) { - node.raws.value = escapeClassName((0, import_unesc.default)(node.raws.value)); - } - }); - selector.each((sel) => eliminateIrrelevantSelectors(sel, base)); - if (selector.length === 0) { - return null; - } - let formatAst = Array.isArray(formats) ? formatVariantSelector(formats, { context, candidate }) : formats; - if (formatAst === null) { - return selector.toString(); - } - let simpleStart = import_postcss_selector_parser3.default.comment({ value: "/*__simple__*/" }); - let simpleEnd = import_postcss_selector_parser3.default.comment({ value: "/*__simple__*/" }); - selector.walkClasses((node) => { - if (node.value !== base) { - return; - } - let parent = node.parent; - let formatNodes = formatAst.nodes[0].nodes; - if (parent.nodes.length === 1) { - node.replaceWith(...formatNodes); - return; - } - let simpleSelector = simpleSelectorForNode(node); - parent.insertBefore(simpleSelector[0], simpleStart); - parent.insertAfter(simpleSelector[simpleSelector.length - 1], simpleEnd); - for (let child of formatNodes) { - parent.insertBefore(simpleSelector[0], child.clone()); - } - node.remove(); - simpleSelector = simpleSelectorForNode(simpleStart); - let firstNode = parent.index(simpleStart); - parent.nodes.splice( - firstNode, - simpleSelector.length, - ...resortSelector(import_postcss_selector_parser3.default.selector({ nodes: simpleSelector })).nodes - ); - simpleStart.remove(); - simpleEnd.remove(); - }); - selector.walkPseudos((p) => { - if (p.value === MERGE) { - p.replaceWith(p.nodes); - } - }); - selector.each((sel) => movePseudos(sel)); - return selector.toString(); - } - function handleMergePseudo(selector, format) { - let merges = []; - selector.walkPseudos((pseudo) => { - if (pseudo.value === MERGE) { - merges.push({ - pseudo, - value: pseudo.nodes[0].toString() - }); - } - }); - format.walkPseudos((pseudo) => { - if (pseudo.value !== MERGE) { - return; - } - let value2 = pseudo.nodes[0].toString(); - let existing = merges.find((merge3) => merge3.value === value2); - if (!existing) { - return; - } - let attachments = []; - let next = pseudo.next(); - while (next && next.type !== "combinator") { - attachments.push(next); - next = next.next(); - } - let combinator = next; - existing.pseudo.parent.insertAfter( - existing.pseudo, - import_postcss_selector_parser3.default.selector({ nodes: attachments.map((node) => node.clone()) }) - ); - pseudo.remove(); - attachments.forEach((node) => node.remove()); - if (combinator && combinator.type === "combinator") { - combinator.remove(); - } - }); - return [selector, format]; - } - function asClass(name) { - return escapeCommas(`.${escapeClassName(name)}`); - } - function nameClass(classPrefix, key) { - return asClass(formatClass(classPrefix, key)); - } - function formatClass(classPrefix, key) { - if (key === "DEFAULT") { - return classPrefix; - } - if (key === "-" || key === "-DEFAULT") { - return `-${classPrefix}`; - } - if (key.startsWith("-")) { - return `-${classPrefix}${key}`; - } - if (key.startsWith("/")) { - return `${classPrefix}${key}`; - } - return `${classPrefix}-${key}`; - } - function transformThemeValue(themeSection) { - if (["fontSize", "outline"].includes(themeSection)) { - return (value2) => { - if (typeof value2 === "function") - value2 = value2({}); - if (Array.isArray(value2)) - value2 = value2[0]; - return value2; - }; - } - if (themeSection === "fontFamily") { - return (value2) => { - if (typeof value2 === "function") - value2 = value2({}); - let families = Array.isArray(value2) && isPlainObject(value2[1]) ? value2[0] : value2; - return Array.isArray(families) ? families.join(", ") : families; - }; - } - if ([ - "boxShadow", - "transitionProperty", - "transitionDuration", - "transitionDelay", - "transitionTimingFunction", - "backgroundImage", - "backgroundSize", - "backgroundColor", - "cursor", - "animation" - ].includes(themeSection)) { - return (value2) => { - if (typeof value2 === "function") - value2 = value2({}); - if (Array.isArray(value2)) - value2 = value2.join(", "); - return value2; - }; - } - if (["gridTemplateColumns", "gridTemplateRows", "objectPosition"].includes(themeSection)) { - return (value2) => { - if (typeof value2 === "function") - value2 = value2({}); - if (typeof value2 === "string") - value2 = postcss_default.list.comma(value2).join(" "); - return value2; - }; - } - return (value2, opts = {}) => { - if (typeof value2 === "function") { - value2 = value2(opts); - } - return value2; - }; - } - var join = () => ""; - function createUtilityPlugin(themeKey, utilityVariations = [[themeKey, [themeKey]]], { filterDefault = false, ...options } = {}) { - let transformValue = transformThemeValue(themeKey); - return function({ matchUtilities, theme: theme2 }) { - for (let utilityVariation of utilityVariations) { - let group = Array.isArray(utilityVariation[0]) ? utilityVariation : [utilityVariation]; - matchUtilities( - group.reduce((obj, [classPrefix, properties]) => { - return Object.assign(obj, { - [classPrefix]: (value2) => { - return properties.reduce((obj2, name) => { - if (Array.isArray(name)) { - return Object.assign(obj2, { [name[0]]: name[1] }); - } - return Object.assign(obj2, { [name]: transformValue(value2) }); - }, {}); - } - }); - }, {}), - { - ...options, - values: filterDefault ? Object.fromEntries( - Object.entries(theme2(themeKey) ?? {}).filter(([modifier]) => modifier !== "DEFAULT") - ) : theme2(themeKey) - } - ); - } - }; - } - function buildMediaQuery(screens) { - screens = Array.isArray(screens) ? screens : [screens]; - return screens.map((screen) => { - let values = screen.values.map((screen2) => { - if (screen2.raw !== void 0) { - return screen2.raw; - } - return [ - screen2.min && `(min-width: ${screen2.min})`, - screen2.max && `(max-width: ${screen2.max})` - ].filter(Boolean).join(" and "); - }); - return screen.not ? `not all and ${values}` : values; - }).join(", "); - } - var DIRECTIONS = /* @__PURE__ */ new Set(["normal", "reverse", "alternate", "alternate-reverse"]); - var PLAY_STATES = /* @__PURE__ */ new Set(["running", "paused"]); - var FILL_MODES = /* @__PURE__ */ new Set(["none", "forwards", "backwards", "both"]); - var ITERATION_COUNTS = /* @__PURE__ */ new Set(["infinite"]); - var TIMINGS = /* @__PURE__ */ new Set([ - "linear", - "ease", - "ease-in", - "ease-out", - "ease-in-out", - "step-start", - "step-end" - ]); - var TIMING_FNS = ["cubic-bezier", "steps"]; - var COMMA = /\,(?![^(]*\))/g; - var SPACE2 = /\ +(?![^(]*\))/g; - var TIME = /^(-?[\d.]+m?s)$/; - var DIGIT = /^(\d+)$/; - function parseAnimationValue(input) { - let animations = input.split(COMMA); - return animations.map((animation) => { - let value2 = animation.trim(); - let result = { value: value2 }; - let parts = value2.split(SPACE2); - let seen = /* @__PURE__ */ new Set(); - for (let part of parts) { - if (!seen.has("DIRECTIONS") && DIRECTIONS.has(part)) { - result.direction = part; - seen.add("DIRECTIONS"); - } else if (!seen.has("PLAY_STATES") && PLAY_STATES.has(part)) { - result.playState = part; - seen.add("PLAY_STATES"); - } else if (!seen.has("FILL_MODES") && FILL_MODES.has(part)) { - result.fillMode = part; - seen.add("FILL_MODES"); - } else if (!seen.has("ITERATION_COUNTS") && (ITERATION_COUNTS.has(part) || DIGIT.test(part))) { - result.iterationCount = part; - seen.add("ITERATION_COUNTS"); - } else if (!seen.has("TIMING_FUNCTION") && TIMINGS.has(part)) { - result.timingFunction = part; - seen.add("TIMING_FUNCTION"); - } else if (!seen.has("TIMING_FUNCTION") && TIMING_FNS.some((f) => part.startsWith(`${f}(`))) { - result.timingFunction = part; - seen.add("TIMING_FUNCTION"); - } else if (!seen.has("DURATION") && TIME.test(part)) { - result.duration = part; - seen.add("DURATION"); - } else if (!seen.has("DELAY") && TIME.test(part)) { - result.delay = part; - seen.add("DELAY"); - } else if (!seen.has("NAME")) { - result.name = part; - seen.add("NAME"); - } else { - if (!result.unknown) - result.unknown = []; - result.unknown.push(part); - } - } - return result; - }); - } - var flattenColorPalette = (colors2) => Object.assign( - {}, - ...Object.entries(colors2 ?? {}).flatMap( - ([color2, values]) => typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number2, hex]) => ({ - [color2 + (number2 === "DEFAULT" ? "" : `-${number2}`)]: hex - })) : [{ [`${color2}`]: values }] - ) - ); - var flattenColorPalette_default = flattenColorPalette; - function toColorValue(maybeFunction) { - return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction; - } - function normalizeScreens(screens, root2 = true) { - if (Array.isArray(screens)) { - return screens.map((screen) => { - if (root2 && Array.isArray(screen)) { - throw new Error("The tuple syntax is not supported for `screens`."); - } - if (typeof screen === "string") { - return { name: screen.toString(), not: false, values: [{ min: screen, max: void 0 }] }; - } - let [name, options] = screen; - name = name.toString(); - if (typeof options === "string") { - return { name, not: false, values: [{ min: options, max: void 0 }] }; - } - if (Array.isArray(options)) { - return { name, not: false, values: options.map((option) => resolveValue(option)) }; - } - return { name, not: false, values: [resolveValue(options)] }; - }); - } - return normalizeScreens(Object.entries(screens ?? {}), false); - } - function isScreenSortable(screen) { - if (screen.values.length !== 1) { - return { result: false, reason: "multiple-values" }; - } else if (screen.values[0].raw !== void 0) { - return { result: false, reason: "raw-values" }; - } else if (screen.values[0].min !== void 0 && screen.values[0].max !== void 0) { - return { result: false, reason: "min-and-max" }; - } - return { result: true, reason: null }; - } - function compareScreens(type, a, z) { - let aScreen = toScreen(a, type); - let zScreen = toScreen(z, type); - let aSorting = isScreenSortable(aScreen); - let bSorting = isScreenSortable(zScreen); - if (aSorting.reason === "multiple-values" || bSorting.reason === "multiple-values") { - throw new Error( - "Attempted to sort a screen with multiple values. This should never happen. Please open a bug report." - ); - } else if (aSorting.reason === "raw-values" || bSorting.reason === "raw-values") { - throw new Error( - "Attempted to sort a screen with raw values. This should never happen. Please open a bug report." - ); - } else if (aSorting.reason === "min-and-max" || bSorting.reason === "min-and-max") { - throw new Error( - "Attempted to sort a screen with both min and max values. This should never happen. Please open a bug report." - ); - } - let { min: aMin, max: aMax } = aScreen.values[0]; - let { min: zMin, max: zMax } = zScreen.values[0]; - if (a.not) - [aMin, aMax] = [aMax, aMin]; - if (z.not) - [zMin, zMax] = [zMax, zMin]; - aMin = aMin === void 0 ? aMin : parseFloat(aMin); - aMax = aMax === void 0 ? aMax : parseFloat(aMax); - zMin = zMin === void 0 ? zMin : parseFloat(zMin); - zMax = zMax === void 0 ? zMax : parseFloat(zMax); - let [aValue, zValue] = type === "min" ? [aMin, zMin] : [zMax, aMax]; - return aValue - zValue; - } - function toScreen(value2, type) { - if (typeof value2 === "object") { - return value2; - } - return { - name: "arbitrary-screen", - values: [{ [type]: value2 }] - }; - } - function resolveValue({ "min-width": _minWidth, min = _minWidth, max: max2, raw } = {}) { - return { min, max: max2, raw }; - } - function removeAlphaVariables(container, toRemove) { - container.walkDecls((decl2) => { - if (toRemove.includes(decl2.prop)) { - decl2.remove(); - return; - } - for (let varName of toRemove) { - if (decl2.value.includes(`/ var(${varName})`)) { - decl2.value = decl2.value.replace(`/ var(${varName})`, ""); - } - } - }); - } - var variantPlugins = { - childVariant: ({ addVariant }) => { - addVariant("*", "& > *"); - }, - pseudoElementVariants: ({ addVariant }) => { - addVariant("first-letter", "&::first-letter"); - addVariant("first-line", "&::first-line"); - addVariant("marker", [ - ({ container }) => { - removeAlphaVariables(container, ["--tw-text-opacity"]); - return "& *::marker"; - }, - ({ container }) => { - removeAlphaVariables(container, ["--tw-text-opacity"]); - return "&::marker"; - } - ]); - addVariant("selection", ["& *::selection", "&::selection"]); - addVariant("file", "&::file-selector-button"); - addVariant("placeholder", "&::placeholder"); - addVariant("backdrop", "&::backdrop"); - addVariant("before", ({ container }) => { - container.walkRules((rule2) => { - let foundContent = false; - rule2.walkDecls("content", () => { - foundContent = true; - }); - if (!foundContent) { - rule2.prepend(postcss_default.decl({ prop: "content", value: "var(--tw-content)" })); - } - }); - return "&::before"; - }); - addVariant("after", ({ container }) => { - container.walkRules((rule2) => { - let foundContent = false; - rule2.walkDecls("content", () => { - foundContent = true; - }); - if (!foundContent) { - rule2.prepend(postcss_default.decl({ prop: "content", value: "var(--tw-content)" })); - } - }); - return "&::after"; - }); - }, - pseudoClassVariants: ({ addVariant, matchVariant, config: config5, prefix: prefix3 }) => { - let pseudoVariants = [ - ["first", "&:first-child"], - ["last", "&:last-child"], - ["only", "&:only-child"], - ["odd", "&:nth-child(odd)"], - ["even", "&:nth-child(even)"], - "first-of-type", - "last-of-type", - "only-of-type", - [ - "visited", - ({ container }) => { - removeAlphaVariables(container, [ - "--tw-text-opacity", - "--tw-border-opacity", - "--tw-bg-opacity" - ]); - return "&:visited"; - } - ], - "target", - ["open", "&[open]"], - "default", - "checked", - "indeterminate", - "placeholder-shown", - "autofill", - "optional", - "required", - "valid", - "invalid", - "in-range", - "out-of-range", - "read-only", - "empty", - "focus-within", - [ - "hover", - !flagEnabled(config5(), "hoverOnlyWhenSupported") ? "&:hover" : "@media (hover: hover) and (pointer: fine) { &:hover }" - ], - "focus", - "focus-visible", - "active", - "enabled", - "disabled" - ].map((variant) => Array.isArray(variant) ? variant : [variant, `&:${variant}`]); - for (let [variantName, state] of pseudoVariants) { - addVariant(variantName, (ctx) => { - let result = typeof state === "function" ? state(ctx) : state; - return result; - }); - } - let variants = { - group: (_, { modifier }) => modifier ? [`:merge(${prefix3(".group")}\\/${escapeClassName(modifier)})`, " &"] : [`:merge(${prefix3(".group")})`, " &"], - peer: (_, { modifier }) => modifier ? [`:merge(${prefix3(".peer")}\\/${escapeClassName(modifier)})`, " ~ &"] : [`:merge(${prefix3(".peer")})`, " ~ &"] - }; - for (let [name, fn] of Object.entries(variants)) { - matchVariant( - name, - (value2 = "", extra) => { - let result = normalize(typeof value2 === "function" ? value2(extra) : value2); - if (!result.includes("&")) - result = "&" + result; - let [a, b] = fn("", extra); - let start = null; - let end = null; - let quotes2 = 0; - for (let i = 0; i < result.length; ++i) { - let c = result[i]; - if (c === "&") { - start = i; - } else if (c === "'" || c === '"') { - quotes2 += 1; - } else if (start !== null && c === " " && !quotes2) { - end = i; - } - } - if (start !== null && end === null) { - end = result.length; - } - return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end); - }, - { - values: Object.fromEntries(pseudoVariants), - [INTERNAL_FEATURES]: { - respectPrefix: false - } - } - ); - } - }, - directionVariants: ({ addVariant }) => { - addVariant("ltr", '&:where([dir="ltr"], [dir="ltr"] *)'); - addVariant("rtl", '&:where([dir="rtl"], [dir="rtl"] *)'); - }, - reducedMotionVariants: ({ addVariant }) => { - addVariant("motion-safe", "@media (prefers-reduced-motion: no-preference)"); - addVariant("motion-reduce", "@media (prefers-reduced-motion: reduce)"); - }, - darkVariants: ({ config: config5, addVariant }) => { - let [mode, selector = ".dark"] = [].concat(config5("darkMode", "media")); - if (mode === false) { - mode = "media"; - log_default.warn("darkmode-false", [ - "The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.", - "Change `darkMode` to `media` or remove it entirely.", - "https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration" - ]); - } - if (mode === "variant") { - let formats; - if (Array.isArray(selector)) { - formats = selector; - } else if (typeof selector === "function") { - formats = selector; - } else if (typeof selector === "string") { - formats = [selector]; - } - if (Array.isArray(formats)) { - for (let format of formats) { - if (format === ".dark") { - mode = false; - log_default.warn("darkmode-variant-without-selector", [ - "When using `variant` for `darkMode`, you must provide a selector.", - 'Example: `darkMode: ["variant", ".your-selector &"]`' - ]); - } else if (!format.includes("&")) { - mode = false; - log_default.warn("darkmode-variant-without-ampersand", [ - "When using `variant` for `darkMode`, your selector must contain `&`.", - 'Example `darkMode: ["variant", ".your-selector &"]`' - ]); - } - } - } - selector = formats; - } - if (mode === "selector") { - addVariant("dark", `&:where(${selector}, ${selector} *)`); - } else if (mode === "media") { - addVariant("dark", "@media (prefers-color-scheme: dark)"); - } else if (mode === "variant") { - addVariant("dark", selector); - } else if (mode === "class") { - addVariant("dark", `:is(${selector} &)`); - } - }, - printVariant: ({ addVariant }) => { - addVariant("print", "@media print"); - }, - screenVariants: ({ theme: theme2, addVariant, matchVariant }) => { - let rawScreens = theme2("screens") ?? {}; - let areSimpleScreens = Object.values(rawScreens).every((v) => typeof v === "string"); - let screens = normalizeScreens(theme2("screens")); - let unitCache = /* @__PURE__ */ new Set([]); - function units(value2) { - return value2.match(/(\D+)$/)?.[1] ?? "(none)"; - } - function recordUnits(value2) { - if (value2 !== void 0) { - unitCache.add(units(value2)); - } - } - function canUseUnits(value2) { - recordUnits(value2); - return unitCache.size === 1; - } - for (const screen of screens) { - for (const value2 of screen.values) { - recordUnits(value2.min); - recordUnits(value2.max); - } - } - let screensUseConsistentUnits = unitCache.size <= 1; - function buildScreenValues(type) { - return Object.fromEntries( - screens.filter((screen) => isScreenSortable(screen).result).map((screen) => { - let { min, max: max2 } = screen.values[0]; - if (type === "min" && min !== void 0) { - return screen; - } else if (type === "min" && max2 !== void 0) { - return { ...screen, not: !screen.not }; - } else if (type === "max" && max2 !== void 0) { - return screen; - } else if (type === "max" && min !== void 0) { - return { ...screen, not: !screen.not }; - } - }).map((screen) => [screen.name, screen]) - ); - } - function buildSort(type) { - return (a, z) => compareScreens(type, a.value, z.value); - } - let maxSort = buildSort("max"); - let minSort = buildSort("min"); - function buildScreenVariant(type) { - return (value2) => { - if (!areSimpleScreens) { - log_default.warn("complex-screen-config", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects." - ]); - return []; - } else if (!screensUseConsistentUnits) { - log_default.warn("mixed-screen-units", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." - ]); - return []; - } else if (typeof value2 === "string" && !canUseUnits(value2)) { - log_default.warn("minmax-have-mixed-units", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." - ]); - return []; - } - return [`@media ${buildMediaQuery(toScreen(value2, type))}`]; - }; - } - matchVariant("max", buildScreenVariant("max"), { - sort: maxSort, - values: areSimpleScreens ? buildScreenValues("max") : {} - }); - let id = "min-screens"; - for (let screen of screens) { - addVariant(screen.name, `@media ${buildMediaQuery(screen)}`, { - id, - sort: areSimpleScreens && screensUseConsistentUnits ? minSort : void 0, - value: screen - }); - } - matchVariant("min", buildScreenVariant("min"), { - id, - sort: minSort - }); - }, - supportsVariants: ({ matchVariant, theme: theme2 }) => { - matchVariant( - "supports", - (value2 = "") => { - let check = normalize(value2); - let isRaw = /^\w*\s*\(/.test(check); - check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check; - if (isRaw) { - return `@supports ${check}`; - } - if (!check.includes(":")) { - check = `${check}: var(--tw)`; - } - if (!(check.startsWith("(") && check.endsWith(")"))) { - check = `(${check})`; - } - return `@supports ${check}`; - }, - { values: theme2("supports") ?? {} } - ); - }, - hasVariants: ({ matchVariant }) => { - matchVariant("has", (value2) => `&:has(${normalize(value2)})`, { values: {} }); - matchVariant( - "group-has", - (value2, { modifier }) => modifier ? `:merge(.group\\/${modifier}):has(${normalize(value2)}) &` : `:merge(.group):has(${normalize(value2)}) &`, - { values: {} } - ); - matchVariant( - "peer-has", - (value2, { modifier }) => modifier ? `:merge(.peer\\/${modifier}):has(${normalize(value2)}) ~ &` : `:merge(.peer):has(${normalize(value2)}) ~ &`, - { values: {} } - ); - }, - ariaVariants: ({ matchVariant, theme: theme2 }) => { - matchVariant("aria", (value2) => `&[aria-${normalize(value2)}]`, { values: theme2("aria") ?? {} }); - matchVariant( - "group-aria", - (value2, { modifier }) => modifier ? `:merge(.group\\/${modifier})[aria-${normalize(value2)}] &` : `:merge(.group)[aria-${normalize(value2)}] &`, - { values: theme2("aria") ?? {} } - ); - matchVariant( - "peer-aria", - (value2, { modifier }) => modifier ? `:merge(.peer\\/${modifier})[aria-${normalize(value2)}] ~ &` : `:merge(.peer)[aria-${normalize(value2)}] ~ &`, - { values: theme2("aria") ?? {} } - ); - }, - dataVariants: ({ matchVariant, theme: theme2 }) => { - matchVariant("data", (value2) => `&[data-${normalize(value2)}]`, { values: theme2("data") ?? {} }); - matchVariant( - "group-data", - (value2, { modifier }) => modifier ? `:merge(.group\\/${modifier})[data-${normalize(value2)}] &` : `:merge(.group)[data-${normalize(value2)}] &`, - { values: theme2("data") ?? {} } - ); - matchVariant( - "peer-data", - (value2, { modifier }) => modifier ? `:merge(.peer\\/${modifier})[data-${normalize(value2)}] ~ &` : `:merge(.peer)[data-${normalize(value2)}] ~ &`, - { values: theme2("data") ?? {} } - ); - }, - orientationVariants: ({ addVariant }) => { - addVariant("portrait", "@media (orientation: portrait)"); - addVariant("landscape", "@media (orientation: landscape)"); - }, - prefersContrastVariants: ({ addVariant }) => { - addVariant("contrast-more", "@media (prefers-contrast: more)"); - addVariant("contrast-less", "@media (prefers-contrast: less)"); - }, - forcedColorsVariants: ({ addVariant }) => { - addVariant("forced-colors", "@media (forced-colors: active)"); - } - }; - var cssTransformValue = [ - "translate(var(--tw-translate-x), var(--tw-translate-y))", - "rotate(var(--tw-rotate))", - "skewX(var(--tw-skew-x))", - "skewY(var(--tw-skew-y))", - "scaleX(var(--tw-scale-x))", - "scaleY(var(--tw-scale-y))" - ].join(" "); - var cssFilterValue = [ - "var(--tw-blur)", - "var(--tw-brightness)", - "var(--tw-contrast)", - "var(--tw-grayscale)", - "var(--tw-hue-rotate)", - "var(--tw-invert)", - "var(--tw-saturate)", - "var(--tw-sepia)", - "var(--tw-drop-shadow)" - ].join(" "); - var cssBackdropFilterValue = [ - "var(--tw-backdrop-blur)", - "var(--tw-backdrop-brightness)", - "var(--tw-backdrop-contrast)", - "var(--tw-backdrop-grayscale)", - "var(--tw-backdrop-hue-rotate)", - "var(--tw-backdrop-invert)", - "var(--tw-backdrop-opacity)", - "var(--tw-backdrop-saturate)", - "var(--tw-backdrop-sepia)" - ].join(" "); - var corePlugins = { - preflight: ({ addBase }) => { - let preflightStyles = postcss_default.parse( - fs_default.readFileSync(join("/", "./css/preflight.css"), "utf8") - ); - addBase([ - postcss_default.comment({ - text: `! tailwindcss v${version} | MIT License | https://tailwindcss.com` - }), - ...preflightStyles.nodes - ]); - }, - container: /* @__PURE__ */ (() => { - function extractMinWidths(breakpoints = []) { - return breakpoints.flatMap((breakpoint) => breakpoint.values.map((breakpoint2) => breakpoint2.min)).filter((v) => v !== void 0); - } - function mapMinWidthsToPadding(minWidths, screens, paddings) { - if (typeof paddings === "undefined") { - return []; - } - if (!(typeof paddings === "object" && paddings !== null)) { - return [ - { - screen: "DEFAULT", - minWidth: 0, - padding: paddings - } - ]; - } - let mapping = []; - if (paddings.DEFAULT) { - mapping.push({ - screen: "DEFAULT", - minWidth: 0, - padding: paddings.DEFAULT - }); - } - for (let minWidth of minWidths) { - for (let screen of screens) { - for (let { min } of screen.values) { - if (min === minWidth) { - mapping.push({ minWidth, padding: paddings[screen.name] }); - } - } - } - } - return mapping; - } - return function({ addComponents, theme: theme2 }) { - let screens = normalizeScreens(theme2("container.screens", theme2("screens"))); - let minWidths = extractMinWidths(screens); - let paddings = mapMinWidthsToPadding(minWidths, screens, theme2("container.padding")); - let generatePaddingFor = (minWidth) => { - let paddingConfig = paddings.find((padding) => padding.minWidth === minWidth); - if (!paddingConfig) { - return {}; - } - return { - paddingRight: paddingConfig.padding, - paddingLeft: paddingConfig.padding - }; - }; - let atRules = Array.from( - new Set(minWidths.slice().sort((a, z) => parseInt(a) - parseInt(z))) - ).map((minWidth) => ({ - [`@media (min-width: ${minWidth})`]: { - ".container": { - "max-width": minWidth, - ...generatePaddingFor(minWidth) - } - } - })); - addComponents([ - { - ".container": Object.assign( - { width: "100%" }, - theme2("container.center", false) ? { marginRight: "auto", marginLeft: "auto" } : {}, - generatePaddingFor(0) - ) - }, - ...atRules - ]); - }; - })(), - accessibility: ({ addUtilities }) => { - addUtilities({ - ".sr-only": { - position: "absolute", - width: "1px", - height: "1px", - padding: "0", - margin: "-1px", - overflow: "hidden", - clip: "rect(0, 0, 0, 0)", - whiteSpace: "nowrap", - borderWidth: "0" - }, - ".not-sr-only": { - position: "static", - width: "auto", - height: "auto", - padding: "0", - margin: "0", - overflow: "visible", - clip: "auto", - whiteSpace: "normal" - } - }); - }, - pointerEvents: ({ addUtilities }) => { - addUtilities({ - ".pointer-events-none": { "pointer-events": "none" }, - ".pointer-events-auto": { "pointer-events": "auto" } - }); - }, - visibility: ({ addUtilities }) => { - addUtilities({ - ".visible": { visibility: "visible" }, - ".invisible": { visibility: "hidden" }, - ".collapse": { visibility: "collapse" } - }); - }, - position: ({ addUtilities }) => { - addUtilities({ - ".static": { position: "static" }, - ".fixed": { position: "fixed" }, - ".absolute": { position: "absolute" }, - ".relative": { position: "relative" }, - ".sticky": { position: "sticky" } - }); - }, - inset: createUtilityPlugin( - "inset", - [ - ["inset", ["inset"]], - [ - ["inset-x", ["left", "right"]], - ["inset-y", ["top", "bottom"]] - ], - [ - ["start", ["inset-inline-start"]], - ["end", ["inset-inline-end"]], - ["top", ["top"]], - ["right", ["right"]], - ["bottom", ["bottom"]], - ["left", ["left"]] - ] - ], - { supportsNegativeValues: true } - ), - isolation: ({ addUtilities }) => { - addUtilities({ - ".isolate": { isolation: "isolate" }, - ".isolation-auto": { isolation: "auto" } - }); - }, - zIndex: createUtilityPlugin("zIndex", [["z", ["zIndex"]]], { supportsNegativeValues: true }), - order: createUtilityPlugin("order", void 0, { supportsNegativeValues: true }), - gridColumn: createUtilityPlugin("gridColumn", [["col", ["gridColumn"]]]), - gridColumnStart: createUtilityPlugin("gridColumnStart", [["col-start", ["gridColumnStart"]]]), - gridColumnEnd: createUtilityPlugin("gridColumnEnd", [["col-end", ["gridColumnEnd"]]]), - gridRow: createUtilityPlugin("gridRow", [["row", ["gridRow"]]]), - gridRowStart: createUtilityPlugin("gridRowStart", [["row-start", ["gridRowStart"]]]), - gridRowEnd: createUtilityPlugin("gridRowEnd", [["row-end", ["gridRowEnd"]]]), - float: ({ addUtilities }) => { - addUtilities({ - ".float-start": { float: "inline-start" }, - ".float-end": { float: "inline-end" }, - ".float-right": { float: "right" }, - ".float-left": { float: "left" }, - ".float-none": { float: "none" } - }); - }, - clear: ({ addUtilities }) => { - addUtilities({ - ".clear-start": { clear: "inline-start" }, - ".clear-end": { clear: "inline-end" }, - ".clear-left": { clear: "left" }, - ".clear-right": { clear: "right" }, - ".clear-both": { clear: "both" }, - ".clear-none": { clear: "none" } - }); - }, - margin: createUtilityPlugin( - "margin", - [ - ["m", ["margin"]], - [ - ["mx", ["margin-left", "margin-right"]], - ["my", ["margin-top", "margin-bottom"]] - ], - [ - ["ms", ["margin-inline-start"]], - ["me", ["margin-inline-end"]], - ["mt", ["margin-top"]], - ["mr", ["margin-right"]], - ["mb", ["margin-bottom"]], - ["ml", ["margin-left"]] - ] - ], - { supportsNegativeValues: true } - ), - boxSizing: ({ addUtilities }) => { - addUtilities({ - ".box-border": { "box-sizing": "border-box" }, - ".box-content": { "box-sizing": "content-box" } - }); - }, - lineClamp: ({ matchUtilities, addUtilities, theme: theme2 }) => { - matchUtilities( - { - "line-clamp": (value2) => ({ - overflow: "hidden", - display: "-webkit-box", - "-webkit-box-orient": "vertical", - "-webkit-line-clamp": `${value2}` - }) - }, - { values: theme2("lineClamp") } - ); - addUtilities({ - ".line-clamp-none": { - overflow: "visible", - display: "block", - "-webkit-box-orient": "horizontal", - "-webkit-line-clamp": "none" - } - }); - }, - display: ({ addUtilities }) => { - addUtilities({ - ".block": { display: "block" }, - ".inline-block": { display: "inline-block" }, - ".inline": { display: "inline" }, - ".flex": { display: "flex" }, - ".inline-flex": { display: "inline-flex" }, - ".table": { display: "table" }, - ".inline-table": { display: "inline-table" }, - ".table-caption": { display: "table-caption" }, - ".table-cell": { display: "table-cell" }, - ".table-column": { display: "table-column" }, - ".table-column-group": { display: "table-column-group" }, - ".table-footer-group": { display: "table-footer-group" }, - ".table-header-group": { display: "table-header-group" }, - ".table-row-group": { display: "table-row-group" }, - ".table-row": { display: "table-row" }, - ".flow-root": { display: "flow-root" }, - ".grid": { display: "grid" }, - ".inline-grid": { display: "inline-grid" }, - ".contents": { display: "contents" }, - ".list-item": { display: "list-item" }, - ".hidden": { display: "none" } - }); - }, - aspectRatio: createUtilityPlugin("aspectRatio", [["aspect", ["aspect-ratio"]]]), - size: createUtilityPlugin("size", [["size", ["width", "height"]]]), - height: createUtilityPlugin("height", [["h", ["height"]]]), - maxHeight: createUtilityPlugin("maxHeight", [["max-h", ["maxHeight"]]]), - minHeight: createUtilityPlugin("minHeight", [["min-h", ["minHeight"]]]), - width: createUtilityPlugin("width", [["w", ["width"]]]), - minWidth: createUtilityPlugin("minWidth", [["min-w", ["minWidth"]]]), - maxWidth: createUtilityPlugin("maxWidth", [["max-w", ["maxWidth"]]]), - flex: createUtilityPlugin("flex"), - flexShrink: createUtilityPlugin("flexShrink", [ - ["flex-shrink", ["flex-shrink"]], - ["shrink", ["flex-shrink"]] - ]), - flexGrow: createUtilityPlugin("flexGrow", [ - ["flex-grow", ["flex-grow"]], - ["grow", ["flex-grow"]] - ]), - flexBasis: createUtilityPlugin("flexBasis", [["basis", ["flex-basis"]]]), - tableLayout: ({ addUtilities }) => { - addUtilities({ - ".table-auto": { "table-layout": "auto" }, - ".table-fixed": { "table-layout": "fixed" } - }); - }, - captionSide: ({ addUtilities }) => { - addUtilities({ - ".caption-top": { "caption-side": "top" }, - ".caption-bottom": { "caption-side": "bottom" } - }); - }, - borderCollapse: ({ addUtilities }) => { - addUtilities({ - ".border-collapse": { "border-collapse": "collapse" }, - ".border-separate": { "border-collapse": "separate" } - }); - }, - borderSpacing: ({ addDefaults, matchUtilities, theme: theme2 }) => { - addDefaults("border-spacing", { - "--tw-border-spacing-x": 0, - "--tw-border-spacing-y": 0 - }); - matchUtilities( - { - "border-spacing": (value2) => { - return { - "--tw-border-spacing-x": value2, - "--tw-border-spacing-y": value2, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - }, - "border-spacing-x": (value2) => { - return { - "--tw-border-spacing-x": value2, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - }, - "border-spacing-y": (value2) => { - return { - "--tw-border-spacing-y": value2, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - } - }, - { values: theme2("borderSpacing") } - ); - }, - transformOrigin: createUtilityPlugin("transformOrigin", [["origin", ["transformOrigin"]]]), - translate: createUtilityPlugin( - "translate", - [ - [ - [ - "translate-x", - [["@defaults transform", {}], "--tw-translate-x", ["transform", cssTransformValue]] - ], - [ - "translate-y", - [["@defaults transform", {}], "--tw-translate-y", ["transform", cssTransformValue]] - ] - ] - ], - { supportsNegativeValues: true } - ), - rotate: createUtilityPlugin( - "rotate", - [["rotate", [["@defaults transform", {}], "--tw-rotate", ["transform", cssTransformValue]]]], - { supportsNegativeValues: true } - ), - skew: createUtilityPlugin( - "skew", - [ - [ - ["skew-x", [["@defaults transform", {}], "--tw-skew-x", ["transform", cssTransformValue]]], - ["skew-y", [["@defaults transform", {}], "--tw-skew-y", ["transform", cssTransformValue]]] - ] - ], - { supportsNegativeValues: true } - ), - scale: createUtilityPlugin( - "scale", - [ - [ - "scale", - [ - ["@defaults transform", {}], - "--tw-scale-x", - "--tw-scale-y", - ["transform", cssTransformValue] - ] - ], - [ - [ - "scale-x", - [["@defaults transform", {}], "--tw-scale-x", ["transform", cssTransformValue]] - ], - [ - "scale-y", - [["@defaults transform", {}], "--tw-scale-y", ["transform", cssTransformValue]] - ] - ] - ], - { supportsNegativeValues: true } - ), - transform: ({ addDefaults, addUtilities }) => { - addDefaults("transform", { - "--tw-translate-x": "0", - "--tw-translate-y": "0", - "--tw-rotate": "0", - "--tw-skew-x": "0", - "--tw-skew-y": "0", - "--tw-scale-x": "1", - "--tw-scale-y": "1" - }); - addUtilities({ - ".transform": { "@defaults transform": {}, transform: cssTransformValue }, - ".transform-cpu": { - transform: cssTransformValue - }, - ".transform-gpu": { - transform: cssTransformValue.replace( - "translate(var(--tw-translate-x), var(--tw-translate-y))", - "translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)" - ) - }, - ".transform-none": { transform: "none" } - }); - }, - animation: ({ matchUtilities, theme: theme2, config: config5 }) => { - let prefixName = (name) => escapeClassName(config5("prefix") + name); - let keyframes = Object.fromEntries( - Object.entries(theme2("keyframes") ?? {}).map(([key, value2]) => { - return [key, { [`@keyframes ${prefixName(key)}`]: value2 }]; - }) - ); - matchUtilities( - { - animate: (value2) => { - let animations = parseAnimationValue(value2); - return [ - ...animations.flatMap((animation) => keyframes[animation.name]), - { - animation: animations.map(({ name, value: value3 }) => { - if (name === void 0 || keyframes[name] === void 0) { - return value3; - } - return value3.replace(name, prefixName(name)); - }).join(", ") - } - ]; - } - }, - { values: theme2("animation") } - ); - }, - cursor: createUtilityPlugin("cursor"), - touchAction: ({ addDefaults, addUtilities }) => { - addDefaults("touch-action", { - "--tw-pan-x": " ", - "--tw-pan-y": " ", - "--tw-pinch-zoom": " " - }); - let cssTouchActionValue = "var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"; - addUtilities({ - ".touch-auto": { "touch-action": "auto" }, - ".touch-none": { "touch-action": "none" }, - ".touch-pan-x": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-x", - "touch-action": cssTouchActionValue - }, - ".touch-pan-left": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-left", - "touch-action": cssTouchActionValue - }, - ".touch-pan-right": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-right", - "touch-action": cssTouchActionValue - }, - ".touch-pan-y": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-y", - "touch-action": cssTouchActionValue - }, - ".touch-pan-up": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-up", - "touch-action": cssTouchActionValue - }, - ".touch-pan-down": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-down", - "touch-action": cssTouchActionValue - }, - ".touch-pinch-zoom": { - "@defaults touch-action": {}, - "--tw-pinch-zoom": "pinch-zoom", - "touch-action": cssTouchActionValue - }, - ".touch-manipulation": { "touch-action": "manipulation" } - }); - }, - userSelect: ({ addUtilities }) => { - addUtilities({ - ".select-none": { "user-select": "none" }, - ".select-text": { "user-select": "text" }, - ".select-all": { "user-select": "all" }, - ".select-auto": { "user-select": "auto" } - }); - }, - resize: ({ addUtilities }) => { - addUtilities({ - ".resize-none": { resize: "none" }, - ".resize-y": { resize: "vertical" }, - ".resize-x": { resize: "horizontal" }, - ".resize": { resize: "both" } - }); - }, - scrollSnapType: ({ addDefaults, addUtilities }) => { - addDefaults("scroll-snap-type", { - "--tw-scroll-snap-strictness": "proximity" - }); - addUtilities({ - ".snap-none": { "scroll-snap-type": "none" }, - ".snap-x": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "x var(--tw-scroll-snap-strictness)" - }, - ".snap-y": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "y var(--tw-scroll-snap-strictness)" - }, - ".snap-both": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "both var(--tw-scroll-snap-strictness)" - }, - ".snap-mandatory": { "--tw-scroll-snap-strictness": "mandatory" }, - ".snap-proximity": { "--tw-scroll-snap-strictness": "proximity" } - }); - }, - scrollSnapAlign: ({ addUtilities }) => { - addUtilities({ - ".snap-start": { "scroll-snap-align": "start" }, - ".snap-end": { "scroll-snap-align": "end" }, - ".snap-center": { "scroll-snap-align": "center" }, - ".snap-align-none": { "scroll-snap-align": "none" } - }); - }, - scrollSnapStop: ({ addUtilities }) => { - addUtilities({ - ".snap-normal": { "scroll-snap-stop": "normal" }, - ".snap-always": { "scroll-snap-stop": "always" } - }); - }, - scrollMargin: createUtilityPlugin( - "scrollMargin", - [ - ["scroll-m", ["scroll-margin"]], - [ - ["scroll-mx", ["scroll-margin-left", "scroll-margin-right"]], - ["scroll-my", ["scroll-margin-top", "scroll-margin-bottom"]] - ], - [ - ["scroll-ms", ["scroll-margin-inline-start"]], - ["scroll-me", ["scroll-margin-inline-end"]], - ["scroll-mt", ["scroll-margin-top"]], - ["scroll-mr", ["scroll-margin-right"]], - ["scroll-mb", ["scroll-margin-bottom"]], - ["scroll-ml", ["scroll-margin-left"]] - ] - ], - { supportsNegativeValues: true } - ), - scrollPadding: createUtilityPlugin("scrollPadding", [ - ["scroll-p", ["scroll-padding"]], - [ - ["scroll-px", ["scroll-padding-left", "scroll-padding-right"]], - ["scroll-py", ["scroll-padding-top", "scroll-padding-bottom"]] - ], - [ - ["scroll-ps", ["scroll-padding-inline-start"]], - ["scroll-pe", ["scroll-padding-inline-end"]], - ["scroll-pt", ["scroll-padding-top"]], - ["scroll-pr", ["scroll-padding-right"]], - ["scroll-pb", ["scroll-padding-bottom"]], - ["scroll-pl", ["scroll-padding-left"]] - ] - ]), - listStylePosition: ({ addUtilities }) => { - addUtilities({ - ".list-inside": { "list-style-position": "inside" }, - ".list-outside": { "list-style-position": "outside" } - }); - }, - listStyleType: createUtilityPlugin("listStyleType", [["list", ["listStyleType"]]]), - listStyleImage: createUtilityPlugin("listStyleImage", [["list-image", ["listStyleImage"]]]), - appearance: ({ addUtilities }) => { - addUtilities({ - ".appearance-none": { appearance: "none" }, - ".appearance-auto": { appearance: "auto" } - }); - }, - columns: createUtilityPlugin("columns", [["columns", ["columns"]]]), - breakBefore: ({ addUtilities }) => { - addUtilities({ - ".break-before-auto": { "break-before": "auto" }, - ".break-before-avoid": { "break-before": "avoid" }, - ".break-before-all": { "break-before": "all" }, - ".break-before-avoid-page": { "break-before": "avoid-page" }, - ".break-before-page": { "break-before": "page" }, - ".break-before-left": { "break-before": "left" }, - ".break-before-right": { "break-before": "right" }, - ".break-before-column": { "break-before": "column" } - }); - }, - breakInside: ({ addUtilities }) => { - addUtilities({ - ".break-inside-auto": { "break-inside": "auto" }, - ".break-inside-avoid": { "break-inside": "avoid" }, - ".break-inside-avoid-page": { "break-inside": "avoid-page" }, - ".break-inside-avoid-column": { "break-inside": "avoid-column" } - }); - }, - breakAfter: ({ addUtilities }) => { - addUtilities({ - ".break-after-auto": { "break-after": "auto" }, - ".break-after-avoid": { "break-after": "avoid" }, - ".break-after-all": { "break-after": "all" }, - ".break-after-avoid-page": { "break-after": "avoid-page" }, - ".break-after-page": { "break-after": "page" }, - ".break-after-left": { "break-after": "left" }, - ".break-after-right": { "break-after": "right" }, - ".break-after-column": { "break-after": "column" } - }); - }, - gridAutoColumns: createUtilityPlugin("gridAutoColumns", [["auto-cols", ["gridAutoColumns"]]]), - gridAutoFlow: ({ addUtilities }) => { - addUtilities({ - ".grid-flow-row": { gridAutoFlow: "row" }, - ".grid-flow-col": { gridAutoFlow: "column" }, - ".grid-flow-dense": { gridAutoFlow: "dense" }, - ".grid-flow-row-dense": { gridAutoFlow: "row dense" }, - ".grid-flow-col-dense": { gridAutoFlow: "column dense" } - }); - }, - gridAutoRows: createUtilityPlugin("gridAutoRows", [["auto-rows", ["gridAutoRows"]]]), - gridTemplateColumns: createUtilityPlugin("gridTemplateColumns", [ - ["grid-cols", ["gridTemplateColumns"]] - ]), - gridTemplateRows: createUtilityPlugin("gridTemplateRows", [["grid-rows", ["gridTemplateRows"]]]), - flexDirection: ({ addUtilities }) => { - addUtilities({ - ".flex-row": { "flex-direction": "row" }, - ".flex-row-reverse": { "flex-direction": "row-reverse" }, - ".flex-col": { "flex-direction": "column" }, - ".flex-col-reverse": { "flex-direction": "column-reverse" } - }); - }, - flexWrap: ({ addUtilities }) => { - addUtilities({ - ".flex-wrap": { "flex-wrap": "wrap" }, - ".flex-wrap-reverse": { "flex-wrap": "wrap-reverse" }, - ".flex-nowrap": { "flex-wrap": "nowrap" } - }); - }, - placeContent: ({ addUtilities }) => { - addUtilities({ - ".place-content-center": { "place-content": "center" }, - ".place-content-start": { "place-content": "start" }, - ".place-content-end": { "place-content": "end" }, - ".place-content-between": { "place-content": "space-between" }, - ".place-content-around": { "place-content": "space-around" }, - ".place-content-evenly": { "place-content": "space-evenly" }, - ".place-content-baseline": { "place-content": "baseline" }, - ".place-content-stretch": { "place-content": "stretch" } - }); - }, - placeItems: ({ addUtilities }) => { - addUtilities({ - ".place-items-start": { "place-items": "start" }, - ".place-items-end": { "place-items": "end" }, - ".place-items-center": { "place-items": "center" }, - ".place-items-baseline": { "place-items": "baseline" }, - ".place-items-stretch": { "place-items": "stretch" } - }); - }, - alignContent: ({ addUtilities }) => { - addUtilities({ - ".content-normal": { "align-content": "normal" }, - ".content-center": { "align-content": "center" }, - ".content-start": { "align-content": "flex-start" }, - ".content-end": { "align-content": "flex-end" }, - ".content-between": { "align-content": "space-between" }, - ".content-around": { "align-content": "space-around" }, - ".content-evenly": { "align-content": "space-evenly" }, - ".content-baseline": { "align-content": "baseline" }, - ".content-stretch": { "align-content": "stretch" } - }); - }, - alignItems: ({ addUtilities }) => { - addUtilities({ - ".items-start": { "align-items": "flex-start" }, - ".items-end": { "align-items": "flex-end" }, - ".items-center": { "align-items": "center" }, - ".items-baseline": { "align-items": "baseline" }, - ".items-stretch": { "align-items": "stretch" } - }); - }, - justifyContent: ({ addUtilities }) => { - addUtilities({ - ".justify-normal": { "justify-content": "normal" }, - ".justify-start": { "justify-content": "flex-start" }, - ".justify-end": { "justify-content": "flex-end" }, - ".justify-center": { "justify-content": "center" }, - ".justify-between": { "justify-content": "space-between" }, - ".justify-around": { "justify-content": "space-around" }, - ".justify-evenly": { "justify-content": "space-evenly" }, - ".justify-stretch": { "justify-content": "stretch" } - }); - }, - justifyItems: ({ addUtilities }) => { - addUtilities({ - ".justify-items-start": { "justify-items": "start" }, - ".justify-items-end": { "justify-items": "end" }, - ".justify-items-center": { "justify-items": "center" }, - ".justify-items-stretch": { "justify-items": "stretch" } - }); - }, - gap: createUtilityPlugin("gap", [ - ["gap", ["gap"]], - [ - ["gap-x", ["columnGap"]], - ["gap-y", ["rowGap"]] - ] - ]), - space: ({ matchUtilities, addUtilities, theme: theme2 }) => { - matchUtilities( - { - "space-x": (value2) => { - value2 = value2 === "0" ? "0px" : value2; - if (false) { - return { - "& > :not([hidden]) ~ :not([hidden])": { - "--tw-space-x-reverse": "0", - "margin-inline-end": `calc(${value2} * var(--tw-space-x-reverse))`, - "margin-inline-start": `calc(${value2} * calc(1 - var(--tw-space-x-reverse)))` - } - }; - } - return { - "& > :not([hidden]) ~ :not([hidden])": { - "--tw-space-x-reverse": "0", - "margin-right": `calc(${value2} * var(--tw-space-x-reverse))`, - "margin-left": `calc(${value2} * calc(1 - var(--tw-space-x-reverse)))` - } - }; - }, - "space-y": (value2) => { - value2 = value2 === "0" ? "0px" : value2; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "--tw-space-y-reverse": "0", - "margin-top": `calc(${value2} * calc(1 - var(--tw-space-y-reverse)))`, - "margin-bottom": `calc(${value2} * var(--tw-space-y-reverse))` - } - }; - } - }, - { values: theme2("space"), supportsNegativeValues: true } - ); - addUtilities({ - ".space-y-reverse > :not([hidden]) ~ :not([hidden])": { "--tw-space-y-reverse": "1" }, - ".space-x-reverse > :not([hidden]) ~ :not([hidden])": { "--tw-space-x-reverse": "1" } - }); - }, - divideWidth: ({ matchUtilities, addUtilities, theme: theme2 }) => { - matchUtilities( - { - "divide-x": (value2) => { - value2 = value2 === "0" ? "0px" : value2; - if (false) { - return { - "& > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-x-reverse": "0", - "border-inline-end-width": `calc(${value2} * var(--tw-divide-x-reverse))`, - "border-inline-start-width": `calc(${value2} * calc(1 - var(--tw-divide-x-reverse)))` - } - }; - } - return { - "& > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-x-reverse": "0", - "border-right-width": `calc(${value2} * var(--tw-divide-x-reverse))`, - "border-left-width": `calc(${value2} * calc(1 - var(--tw-divide-x-reverse)))` - } - }; - }, - "divide-y": (value2) => { - value2 = value2 === "0" ? "0px" : value2; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-y-reverse": "0", - "border-top-width": `calc(${value2} * calc(1 - var(--tw-divide-y-reverse)))`, - "border-bottom-width": `calc(${value2} * var(--tw-divide-y-reverse))` - } - }; - } - }, - { values: theme2("divideWidth"), type: ["line-width", "length", "any"] } - ); - addUtilities({ - ".divide-y-reverse > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-y-reverse": "1" - }, - ".divide-x-reverse > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-x-reverse": "1" - } - }); - }, - divideStyle: ({ addUtilities }) => { - addUtilities({ - ".divide-solid > :not([hidden]) ~ :not([hidden])": { "border-style": "solid" }, - ".divide-dashed > :not([hidden]) ~ :not([hidden])": { "border-style": "dashed" }, - ".divide-dotted > :not([hidden]) ~ :not([hidden])": { "border-style": "dotted" }, - ".divide-double > :not([hidden]) ~ :not([hidden])": { "border-style": "double" }, - ".divide-none > :not([hidden]) ~ :not([hidden])": { "border-style": "none" } - }); - }, - divideColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - divide: (value2) => { - if (!corePlugins2("divideOpacity")) { - return { - ["& > :not([hidden]) ~ :not([hidden])"]: { - "border-color": toColorValue(value2) - } - }; - } - return { - ["& > :not([hidden]) ~ :not([hidden])"]: withAlphaVariable({ - color: value2, - property: "border-color", - variable: "--tw-divide-opacity" - }) - }; - } - }, - { - values: (({ DEFAULT: _, ...colors2 }) => colors2)(flattenColorPalette_default(theme2("divideColor"))), - type: ["color", "any"] - } - ); - }, - divideOpacity: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "divide-opacity": (value2) => { - return { [`& > :not([hidden]) ~ :not([hidden])`]: { "--tw-divide-opacity": value2 } }; - } - }, - { values: theme2("divideOpacity") } - ); - }, - placeSelf: ({ addUtilities }) => { - addUtilities({ - ".place-self-auto": { "place-self": "auto" }, - ".place-self-start": { "place-self": "start" }, - ".place-self-end": { "place-self": "end" }, - ".place-self-center": { "place-self": "center" }, - ".place-self-stretch": { "place-self": "stretch" } - }); - }, - alignSelf: ({ addUtilities }) => { - addUtilities({ - ".self-auto": { "align-self": "auto" }, - ".self-start": { "align-self": "flex-start" }, - ".self-end": { "align-self": "flex-end" }, - ".self-center": { "align-self": "center" }, - ".self-stretch": { "align-self": "stretch" }, - ".self-baseline": { "align-self": "baseline" } - }); - }, - justifySelf: ({ addUtilities }) => { - addUtilities({ - ".justify-self-auto": { "justify-self": "auto" }, - ".justify-self-start": { "justify-self": "start" }, - ".justify-self-end": { "justify-self": "end" }, - ".justify-self-center": { "justify-self": "center" }, - ".justify-self-stretch": { "justify-self": "stretch" } - }); - }, - overflow: ({ addUtilities }) => { - addUtilities({ - ".overflow-auto": { overflow: "auto" }, - ".overflow-hidden": { overflow: "hidden" }, - ".overflow-clip": { overflow: "clip" }, - ".overflow-visible": { overflow: "visible" }, - ".overflow-scroll": { overflow: "scroll" }, - ".overflow-x-auto": { "overflow-x": "auto" }, - ".overflow-y-auto": { "overflow-y": "auto" }, - ".overflow-x-hidden": { "overflow-x": "hidden" }, - ".overflow-y-hidden": { "overflow-y": "hidden" }, - ".overflow-x-clip": { "overflow-x": "clip" }, - ".overflow-y-clip": { "overflow-y": "clip" }, - ".overflow-x-visible": { "overflow-x": "visible" }, - ".overflow-y-visible": { "overflow-y": "visible" }, - ".overflow-x-scroll": { "overflow-x": "scroll" }, - ".overflow-y-scroll": { "overflow-y": "scroll" } - }); - }, - overscrollBehavior: ({ addUtilities }) => { - addUtilities({ - ".overscroll-auto": { "overscroll-behavior": "auto" }, - ".overscroll-contain": { "overscroll-behavior": "contain" }, - ".overscroll-none": { "overscroll-behavior": "none" }, - ".overscroll-y-auto": { "overscroll-behavior-y": "auto" }, - ".overscroll-y-contain": { "overscroll-behavior-y": "contain" }, - ".overscroll-y-none": { "overscroll-behavior-y": "none" }, - ".overscroll-x-auto": { "overscroll-behavior-x": "auto" }, - ".overscroll-x-contain": { "overscroll-behavior-x": "contain" }, - ".overscroll-x-none": { "overscroll-behavior-x": "none" } - }); - }, - scrollBehavior: ({ addUtilities }) => { - addUtilities({ - ".scroll-auto": { "scroll-behavior": "auto" }, - ".scroll-smooth": { "scroll-behavior": "smooth" } - }); - }, - textOverflow: ({ addUtilities }) => { - addUtilities({ - ".truncate": { overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }, - ".overflow-ellipsis": { "text-overflow": "ellipsis" }, - ".text-ellipsis": { "text-overflow": "ellipsis" }, - ".text-clip": { "text-overflow": "clip" } - }); - }, - hyphens: ({ addUtilities }) => { - addUtilities({ - ".hyphens-none": { hyphens: "none" }, - ".hyphens-manual": { hyphens: "manual" }, - ".hyphens-auto": { hyphens: "auto" } - }); - }, - whitespace: ({ addUtilities }) => { - addUtilities({ - ".whitespace-normal": { "white-space": "normal" }, - ".whitespace-nowrap": { "white-space": "nowrap" }, - ".whitespace-pre": { "white-space": "pre" }, - ".whitespace-pre-line": { "white-space": "pre-line" }, - ".whitespace-pre-wrap": { "white-space": "pre-wrap" }, - ".whitespace-break-spaces": { "white-space": "break-spaces" } - }); - }, - textWrap: ({ addUtilities }) => { - addUtilities({ - ".text-wrap": { "text-wrap": "wrap" }, - ".text-nowrap": { "text-wrap": "nowrap" }, - ".text-balance": { "text-wrap": "balance" }, - ".text-pretty": { "text-wrap": "pretty" } - }); - }, - wordBreak: ({ addUtilities }) => { - addUtilities({ - ".break-normal": { "overflow-wrap": "normal", "word-break": "normal" }, - ".break-words": { "overflow-wrap": "break-word" }, - ".break-all": { "word-break": "break-all" }, - ".break-keep": { "word-break": "keep-all" } - }); - }, - borderRadius: createUtilityPlugin("borderRadius", [ - ["rounded", ["border-radius"]], - [ - ["rounded-s", ["border-start-start-radius", "border-end-start-radius"]], - ["rounded-e", ["border-start-end-radius", "border-end-end-radius"]], - ["rounded-t", ["border-top-left-radius", "border-top-right-radius"]], - ["rounded-r", ["border-top-right-radius", "border-bottom-right-radius"]], - ["rounded-b", ["border-bottom-right-radius", "border-bottom-left-radius"]], - ["rounded-l", ["border-top-left-radius", "border-bottom-left-radius"]] - ], - [ - ["rounded-ss", ["border-start-start-radius"]], - ["rounded-se", ["border-start-end-radius"]], - ["rounded-ee", ["border-end-end-radius"]], - ["rounded-es", ["border-end-start-radius"]], - ["rounded-tl", ["border-top-left-radius"]], - ["rounded-tr", ["border-top-right-radius"]], - ["rounded-br", ["border-bottom-right-radius"]], - ["rounded-bl", ["border-bottom-left-radius"]] - ] - ]), - borderWidth: createUtilityPlugin( - "borderWidth", - [ - ["border", [["@defaults border-width", {}], "border-width"]], - [ - ["border-x", [["@defaults border-width", {}], "border-left-width", "border-right-width"]], - ["border-y", [["@defaults border-width", {}], "border-top-width", "border-bottom-width"]] - ], - [ - ["border-s", [["@defaults border-width", {}], "border-inline-start-width"]], - ["border-e", [["@defaults border-width", {}], "border-inline-end-width"]], - ["border-t", [["@defaults border-width", {}], "border-top-width"]], - ["border-r", [["@defaults border-width", {}], "border-right-width"]], - ["border-b", [["@defaults border-width", {}], "border-bottom-width"]], - ["border-l", [["@defaults border-width", {}], "border-left-width"]] - ] - ], - { type: ["line-width", "length"] } - ), - borderStyle: ({ addUtilities }) => { - addUtilities({ - ".border-solid": { "border-style": "solid" }, - ".border-dashed": { "border-style": "dashed" }, - ".border-dotted": { "border-style": "dotted" }, - ".border-double": { "border-style": "double" }, - ".border-hidden": { "border-style": "hidden" }, - ".border-none": { "border-style": "none" } - }); - }, - borderColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - border: (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-color", - variable: "--tw-border-opacity" - }); - } - }, - { - values: (({ DEFAULT: _, ...colors2 }) => colors2)(flattenColorPalette_default(theme2("borderColor"))), - type: ["color", "any"] - } - ); - matchUtilities( - { - "border-x": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-left-color": toColorValue(value2), - "border-right-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: ["border-left-color", "border-right-color"], - variable: "--tw-border-opacity" - }); - }, - "border-y": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-top-color": toColorValue(value2), - "border-bottom-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: ["border-top-color", "border-bottom-color"], - variable: "--tw-border-opacity" - }); - } - }, - { - values: (({ DEFAULT: _, ...colors2 }) => colors2)(flattenColorPalette_default(theme2("borderColor"))), - type: ["color", "any"] - } - ); - matchUtilities( - { - "border-s": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-inline-start-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-inline-start-color", - variable: "--tw-border-opacity" - }); - }, - "border-e": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-inline-end-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-inline-end-color", - variable: "--tw-border-opacity" - }); - }, - "border-t": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-top-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-top-color", - variable: "--tw-border-opacity" - }); - }, - "border-r": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-right-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-right-color", - variable: "--tw-border-opacity" - }); - }, - "border-b": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-bottom-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-bottom-color", - variable: "--tw-border-opacity" - }); - }, - "border-l": (value2) => { - if (!corePlugins2("borderOpacity")) { - return { - "border-left-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "border-left-color", - variable: "--tw-border-opacity" - }); - } - }, - { - values: (({ DEFAULT: _, ...colors2 }) => colors2)(flattenColorPalette_default(theme2("borderColor"))), - type: ["color", "any"] - } - ); - }, - borderOpacity: createUtilityPlugin("borderOpacity", [ - ["border-opacity", ["--tw-border-opacity"]] - ]), - backgroundColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - bg: (value2) => { - if (!corePlugins2("backgroundOpacity")) { - return { - "background-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "background-color", - variable: "--tw-bg-opacity" - }); - } - }, - { values: flattenColorPalette_default(theme2("backgroundColor")), type: ["color", "any"] } - ); - }, - backgroundOpacity: createUtilityPlugin("backgroundOpacity", [ - ["bg-opacity", ["--tw-bg-opacity"]] - ]), - backgroundImage: createUtilityPlugin("backgroundImage", [["bg", ["background-image"]]], { - type: ["lookup", "image", "url"] - }), - gradientColorStops: /* @__PURE__ */ (() => { - function transparentTo(value2) { - return withAlphaValue(value2, 0, "rgb(255 255 255 / 0)"); - } - return function({ matchUtilities, theme: theme2, addDefaults }) { - addDefaults("gradient-color-stops", { - "--tw-gradient-from-position": " ", - "--tw-gradient-via-position": " ", - "--tw-gradient-to-position": " " - }); - let options = { - values: flattenColorPalette_default(theme2("gradientColorStops")), - type: ["color", "any"] - }; - let positionOptions = { - values: theme2("gradientColorStopPositions"), - type: ["length", "percentage"] - }; - matchUtilities( - { - from: (value2) => { - let transparentToValue = transparentTo(value2); - return { - "@defaults gradient-color-stops": {}, - "--tw-gradient-from": `${toColorValue(value2)} var(--tw-gradient-from-position)`, - "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, - "--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)` - }; - } - }, - options - ); - matchUtilities( - { - from: (value2) => { - return { - "--tw-gradient-from-position": value2 - }; - } - }, - positionOptions - ); - matchUtilities( - { - via: (value2) => { - let transparentToValue = transparentTo(value2); - return { - "@defaults gradient-color-stops": {}, - "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, - "--tw-gradient-stops": `var(--tw-gradient-from), ${toColorValue( - value2 - )} var(--tw-gradient-via-position), var(--tw-gradient-to)` - }; - } - }, - options - ); - matchUtilities( - { - via: (value2) => { - return { - "--tw-gradient-via-position": value2 - }; - } - }, - positionOptions - ); - matchUtilities( - { - to: (value2) => ({ - "@defaults gradient-color-stops": {}, - "--tw-gradient-to": `${toColorValue(value2)} var(--tw-gradient-to-position)` - }) - }, - options - ); - matchUtilities( - { - to: (value2) => { - return { - "--tw-gradient-to-position": value2 - }; - } - }, - positionOptions - ); - }; - })(), - boxDecorationBreak: ({ addUtilities }) => { - addUtilities({ - ".decoration-slice": { "box-decoration-break": "slice" }, - ".decoration-clone": { "box-decoration-break": "clone" }, - ".box-decoration-slice": { "box-decoration-break": "slice" }, - ".box-decoration-clone": { "box-decoration-break": "clone" } - }); - }, - backgroundSize: createUtilityPlugin("backgroundSize", [["bg", ["background-size"]]], { - type: ["lookup", "length", "percentage", "size"] - }), - backgroundAttachment: ({ addUtilities }) => { - addUtilities({ - ".bg-fixed": { "background-attachment": "fixed" }, - ".bg-local": { "background-attachment": "local" }, - ".bg-scroll": { "background-attachment": "scroll" } - }); - }, - backgroundClip: ({ addUtilities }) => { - addUtilities({ - ".bg-clip-border": { "background-clip": "border-box" }, - ".bg-clip-padding": { "background-clip": "padding-box" }, - ".bg-clip-content": { "background-clip": "content-box" }, - ".bg-clip-text": { "background-clip": "text" } - }); - }, - backgroundPosition: createUtilityPlugin("backgroundPosition", [["bg", ["background-position"]]], { - type: ["lookup", ["position", { preferOnConflict: true }]] - }), - backgroundRepeat: ({ addUtilities }) => { - addUtilities({ - ".bg-repeat": { "background-repeat": "repeat" }, - ".bg-no-repeat": { "background-repeat": "no-repeat" }, - ".bg-repeat-x": { "background-repeat": "repeat-x" }, - ".bg-repeat-y": { "background-repeat": "repeat-y" }, - ".bg-repeat-round": { "background-repeat": "round" }, - ".bg-repeat-space": { "background-repeat": "space" } - }); - }, - backgroundOrigin: ({ addUtilities }) => { - addUtilities({ - ".bg-origin-border": { "background-origin": "border-box" }, - ".bg-origin-padding": { "background-origin": "padding-box" }, - ".bg-origin-content": { "background-origin": "content-box" } - }); - }, - fill: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - fill: (value2) => { - return { fill: toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("fill")), type: ["color", "any"] } - ); - }, - stroke: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - stroke: (value2) => { - return { stroke: toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("stroke")), type: ["color", "url", "any"] } - ); - }, - strokeWidth: createUtilityPlugin("strokeWidth", [["stroke", ["stroke-width"]]], { - type: ["length", "number", "percentage"] - }), - objectFit: ({ addUtilities }) => { - addUtilities({ - ".object-contain": { "object-fit": "contain" }, - ".object-cover": { "object-fit": "cover" }, - ".object-fill": { "object-fit": "fill" }, - ".object-none": { "object-fit": "none" }, - ".object-scale-down": { "object-fit": "scale-down" } - }); - }, - objectPosition: createUtilityPlugin("objectPosition", [["object", ["object-position"]]]), - padding: createUtilityPlugin("padding", [ - ["p", ["padding"]], - [ - ["px", ["padding-left", "padding-right"]], - ["py", ["padding-top", "padding-bottom"]] - ], - [ - ["ps", ["padding-inline-start"]], - ["pe", ["padding-inline-end"]], - ["pt", ["padding-top"]], - ["pr", ["padding-right"]], - ["pb", ["padding-bottom"]], - ["pl", ["padding-left"]] - ] - ]), - textAlign: ({ addUtilities }) => { - addUtilities({ - ".text-left": { "text-align": "left" }, - ".text-center": { "text-align": "center" }, - ".text-right": { "text-align": "right" }, - ".text-justify": { "text-align": "justify" }, - ".text-start": { "text-align": "start" }, - ".text-end": { "text-align": "end" } - }); - }, - textIndent: createUtilityPlugin("textIndent", [["indent", ["text-indent"]]], { - supportsNegativeValues: true - }), - verticalAlign: ({ addUtilities, matchUtilities }) => { - addUtilities({ - ".align-baseline": { "vertical-align": "baseline" }, - ".align-top": { "vertical-align": "top" }, - ".align-middle": { "vertical-align": "middle" }, - ".align-bottom": { "vertical-align": "bottom" }, - ".align-text-top": { "vertical-align": "text-top" }, - ".align-text-bottom": { "vertical-align": "text-bottom" }, - ".align-sub": { "vertical-align": "sub" }, - ".align-super": { "vertical-align": "super" } - }); - matchUtilities({ align: (value2) => ({ "vertical-align": value2 }) }); - }, - fontFamily: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - font: (value2) => { - let [families, options = {}] = Array.isArray(value2) && isPlainObject(value2[1]) ? value2 : [value2]; - let { fontFeatureSettings, fontVariationSettings } = options; - return { - "font-family": Array.isArray(families) ? families.join(", ") : families, - ...fontFeatureSettings === void 0 ? {} : { "font-feature-settings": fontFeatureSettings }, - ...fontVariationSettings === void 0 ? {} : { "font-variation-settings": fontVariationSettings } - }; - } - }, - { - values: theme2("fontFamily"), - type: ["lookup", "generic-name", "family-name"] - } - ); - }, - fontSize: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - text: (value2, { modifier }) => { - let [fontSize, options] = Array.isArray(value2) ? value2 : [value2]; - if (modifier) { - return { - "font-size": fontSize, - "line-height": modifier - }; - } - let { lineHeight, letterSpacing, fontWeight } = isPlainObject(options) ? options : { lineHeight: options }; - return { - "font-size": fontSize, - ...lineHeight === void 0 ? {} : { "line-height": lineHeight }, - ...letterSpacing === void 0 ? {} : { "letter-spacing": letterSpacing }, - ...fontWeight === void 0 ? {} : { "font-weight": fontWeight } - }; - } - }, - { - values: theme2("fontSize"), - modifiers: theme2("lineHeight"), - type: ["absolute-size", "relative-size", "length", "percentage"] - } - ); - }, - fontWeight: createUtilityPlugin("fontWeight", [["font", ["fontWeight"]]], { - type: ["lookup", "number", "any"] - }), - textTransform: ({ addUtilities }) => { - addUtilities({ - ".uppercase": { "text-transform": "uppercase" }, - ".lowercase": { "text-transform": "lowercase" }, - ".capitalize": { "text-transform": "capitalize" }, - ".normal-case": { "text-transform": "none" } - }); - }, - fontStyle: ({ addUtilities }) => { - addUtilities({ - ".italic": { "font-style": "italic" }, - ".not-italic": { "font-style": "normal" } - }); - }, - fontVariantNumeric: ({ addDefaults, addUtilities }) => { - let cssFontVariantNumericValue = "var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)"; - addDefaults("font-variant-numeric", { - "--tw-ordinal": " ", - "--tw-slashed-zero": " ", - "--tw-numeric-figure": " ", - "--tw-numeric-spacing": " ", - "--tw-numeric-fraction": " " - }); - addUtilities({ - ".normal-nums": { "font-variant-numeric": "normal" }, - ".ordinal": { - "@defaults font-variant-numeric": {}, - "--tw-ordinal": "ordinal", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".slashed-zero": { - "@defaults font-variant-numeric": {}, - "--tw-slashed-zero": "slashed-zero", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".lining-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-figure": "lining-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".oldstyle-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-figure": "oldstyle-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".proportional-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-spacing": "proportional-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".tabular-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-spacing": "tabular-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".diagonal-fractions": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-fraction": "diagonal-fractions", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".stacked-fractions": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-fraction": "stacked-fractions", - "font-variant-numeric": cssFontVariantNumericValue - } - }); - }, - lineHeight: createUtilityPlugin("lineHeight", [["leading", ["lineHeight"]]]), - letterSpacing: createUtilityPlugin("letterSpacing", [["tracking", ["letterSpacing"]]], { - supportsNegativeValues: true - }), - textColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - text: (value2) => { - if (!corePlugins2("textOpacity")) { - return { color: toColorValue(value2) }; - } - return withAlphaVariable({ - color: value2, - property: "color", - variable: "--tw-text-opacity" - }); - } - }, - { values: flattenColorPalette_default(theme2("textColor")), type: ["color", "any"] } - ); - }, - textOpacity: createUtilityPlugin("textOpacity", [["text-opacity", ["--tw-text-opacity"]]]), - textDecoration: ({ addUtilities }) => { - addUtilities({ - ".underline": { "text-decoration-line": "underline" }, - ".overline": { "text-decoration-line": "overline" }, - ".line-through": { "text-decoration-line": "line-through" }, - ".no-underline": { "text-decoration-line": "none" } - }); - }, - textDecorationColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - decoration: (value2) => { - return { "text-decoration-color": toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("textDecorationColor")), type: ["color", "any"] } - ); - }, - textDecorationStyle: ({ addUtilities }) => { - addUtilities({ - ".decoration-solid": { "text-decoration-style": "solid" }, - ".decoration-double": { "text-decoration-style": "double" }, - ".decoration-dotted": { "text-decoration-style": "dotted" }, - ".decoration-dashed": { "text-decoration-style": "dashed" }, - ".decoration-wavy": { "text-decoration-style": "wavy" } - }); - }, - textDecorationThickness: createUtilityPlugin( - "textDecorationThickness", - [["decoration", ["text-decoration-thickness"]]], - { type: ["length", "percentage"] } - ), - textUnderlineOffset: createUtilityPlugin( - "textUnderlineOffset", - [["underline-offset", ["text-underline-offset"]]], - { type: ["length", "percentage", "any"] } - ), - fontSmoothing: ({ addUtilities }) => { - addUtilities({ - ".antialiased": { - "-webkit-font-smoothing": "antialiased", - "-moz-osx-font-smoothing": "grayscale" - }, - ".subpixel-antialiased": { - "-webkit-font-smoothing": "auto", - "-moz-osx-font-smoothing": "auto" - } - }); - }, - placeholderColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - placeholder: (value2) => { - if (!corePlugins2("placeholderOpacity")) { - return { - "&::placeholder": { - color: toColorValue(value2) - } - }; - } - return { - "&::placeholder": withAlphaVariable({ - color: value2, - property: "color", - variable: "--tw-placeholder-opacity" - }) - }; - } - }, - { values: flattenColorPalette_default(theme2("placeholderColor")), type: ["color", "any"] } - ); - }, - placeholderOpacity: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "placeholder-opacity": (value2) => { - return { ["&::placeholder"]: { "--tw-placeholder-opacity": value2 } }; - } - }, - { values: theme2("placeholderOpacity") } - ); - }, - caretColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - caret: (value2) => { - return { "caret-color": toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("caretColor")), type: ["color", "any"] } - ); - }, - accentColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - accent: (value2) => { - return { "accent-color": toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("accentColor")), type: ["color", "any"] } - ); - }, - opacity: createUtilityPlugin("opacity", [["opacity", ["opacity"]]]), - backgroundBlendMode: ({ addUtilities }) => { - addUtilities({ - ".bg-blend-normal": { "background-blend-mode": "normal" }, - ".bg-blend-multiply": { "background-blend-mode": "multiply" }, - ".bg-blend-screen": { "background-blend-mode": "screen" }, - ".bg-blend-overlay": { "background-blend-mode": "overlay" }, - ".bg-blend-darken": { "background-blend-mode": "darken" }, - ".bg-blend-lighten": { "background-blend-mode": "lighten" }, - ".bg-blend-color-dodge": { "background-blend-mode": "color-dodge" }, - ".bg-blend-color-burn": { "background-blend-mode": "color-burn" }, - ".bg-blend-hard-light": { "background-blend-mode": "hard-light" }, - ".bg-blend-soft-light": { "background-blend-mode": "soft-light" }, - ".bg-blend-difference": { "background-blend-mode": "difference" }, - ".bg-blend-exclusion": { "background-blend-mode": "exclusion" }, - ".bg-blend-hue": { "background-blend-mode": "hue" }, - ".bg-blend-saturation": { "background-blend-mode": "saturation" }, - ".bg-blend-color": { "background-blend-mode": "color" }, - ".bg-blend-luminosity": { "background-blend-mode": "luminosity" } - }); - }, - mixBlendMode: ({ addUtilities }) => { - addUtilities({ - ".mix-blend-normal": { "mix-blend-mode": "normal" }, - ".mix-blend-multiply": { "mix-blend-mode": "multiply" }, - ".mix-blend-screen": { "mix-blend-mode": "screen" }, - ".mix-blend-overlay": { "mix-blend-mode": "overlay" }, - ".mix-blend-darken": { "mix-blend-mode": "darken" }, - ".mix-blend-lighten": { "mix-blend-mode": "lighten" }, - ".mix-blend-color-dodge": { "mix-blend-mode": "color-dodge" }, - ".mix-blend-color-burn": { "mix-blend-mode": "color-burn" }, - ".mix-blend-hard-light": { "mix-blend-mode": "hard-light" }, - ".mix-blend-soft-light": { "mix-blend-mode": "soft-light" }, - ".mix-blend-difference": { "mix-blend-mode": "difference" }, - ".mix-blend-exclusion": { "mix-blend-mode": "exclusion" }, - ".mix-blend-hue": { "mix-blend-mode": "hue" }, - ".mix-blend-saturation": { "mix-blend-mode": "saturation" }, - ".mix-blend-color": { "mix-blend-mode": "color" }, - ".mix-blend-luminosity": { "mix-blend-mode": "luminosity" }, - ".mix-blend-plus-lighter": { "mix-blend-mode": "plus-lighter" } - }); - }, - boxShadow: (() => { - let transformValue = transformThemeValue("boxShadow"); - let defaultBoxShadow = [ - `var(--tw-ring-offset-shadow, 0 0 #0000)`, - `var(--tw-ring-shadow, 0 0 #0000)`, - `var(--tw-shadow)` - ].join(", "); - return function({ matchUtilities, addDefaults, theme: theme2 }) { - addDefaults(" box-shadow", { - "--tw-ring-offset-shadow": "0 0 #0000", - "--tw-ring-shadow": "0 0 #0000", - "--tw-shadow": "0 0 #0000", - "--tw-shadow-colored": "0 0 #0000" - }); - matchUtilities( - { - shadow: (value2) => { - value2 = transformValue(value2); - let ast = parseBoxShadowValue(value2); - for (let shadow2 of ast) { - if (!shadow2.valid) { - continue; - } - shadow2.color = "var(--tw-shadow-color)"; - } - return { - "@defaults box-shadow": {}, - "--tw-shadow": value2 === "none" ? "0 0 #0000" : value2, - "--tw-shadow-colored": value2 === "none" ? "0 0 #0000" : formatBoxShadowValue(ast), - "box-shadow": defaultBoxShadow - }; - } - }, - { values: theme2("boxShadow"), type: ["shadow"] } - ); - }; - })(), - boxShadowColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - shadow: (value2) => { - return { - "--tw-shadow-color": toColorValue(value2), - "--tw-shadow": "var(--tw-shadow-colored)" - }; - } - }, - { values: flattenColorPalette_default(theme2("boxShadowColor")), type: ["color", "any"] } - ); - }, - outlineStyle: ({ addUtilities }) => { - addUtilities({ - ".outline-none": { - outline: "2px solid transparent", - "outline-offset": "2px" - }, - ".outline": { "outline-style": "solid" }, - ".outline-dashed": { "outline-style": "dashed" }, - ".outline-dotted": { "outline-style": "dotted" }, - ".outline-double": { "outline-style": "double" } - }); - }, - outlineWidth: createUtilityPlugin("outlineWidth", [["outline", ["outline-width"]]], { - type: ["length", "number", "percentage"] - }), - outlineOffset: createUtilityPlugin("outlineOffset", [["outline-offset", ["outline-offset"]]], { - type: ["length", "number", "percentage", "any"], - supportsNegativeValues: true - }), - outlineColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - outline: (value2) => { - return { "outline-color": toColorValue(value2) }; - } - }, - { values: flattenColorPalette_default(theme2("outlineColor")), type: ["color", "any"] } - ); - }, - ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme: theme2, config: config5 }) => { - let ringColorDefault = (() => { - if (flagEnabled(config5(), "respectDefaultRingColorOpacity")) { - return theme2("ringColor.DEFAULT"); - } - let ringOpacityDefault = theme2("ringOpacity.DEFAULT", "0.5"); - if (!theme2("ringColor")?.DEFAULT) { - return `rgb(147 197 253 / ${ringOpacityDefault})`; - } - return withAlphaValue( - theme2("ringColor")?.DEFAULT, - ringOpacityDefault, - `rgb(147 197 253 / ${ringOpacityDefault})` - ); - })(); - addDefaults("ring-width", { - "--tw-ring-inset": " ", - "--tw-ring-offset-width": theme2("ringOffsetWidth.DEFAULT", "0px"), - "--tw-ring-offset-color": theme2("ringOffsetColor.DEFAULT", "#fff"), - "--tw-ring-color": ringColorDefault, - "--tw-ring-offset-shadow": "0 0 #0000", - "--tw-ring-shadow": "0 0 #0000", - "--tw-shadow": "0 0 #0000", - "--tw-shadow-colored": "0 0 #0000" - }); - matchUtilities( - { - ring: (value2) => { - return { - "@defaults ring-width": {}, - "--tw-ring-offset-shadow": `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, - "--tw-ring-shadow": `var(--tw-ring-inset) 0 0 0 calc(${value2} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, - "box-shadow": [ - `var(--tw-ring-offset-shadow)`, - `var(--tw-ring-shadow)`, - `var(--tw-shadow, 0 0 #0000)` - ].join(", ") - }; - } - }, - { values: theme2("ringWidth"), type: "length" } - ); - addUtilities({ - ".ring-inset": { "@defaults ring-width": {}, "--tw-ring-inset": "inset" } - }); - }, - ringColor: ({ matchUtilities, theme: theme2, corePlugins: corePlugins2 }) => { - matchUtilities( - { - ring: (value2) => { - if (!corePlugins2("ringOpacity")) { - return { - "--tw-ring-color": toColorValue(value2) - }; - } - return withAlphaVariable({ - color: value2, - property: "--tw-ring-color", - variable: "--tw-ring-opacity" - }); - } - }, - { - values: Object.fromEntries( - Object.entries(flattenColorPalette_default(theme2("ringColor"))).filter( - ([modifier]) => modifier !== "DEFAULT" - ) - ), - type: ["color", "any"] - } - ); - }, - ringOpacity: (helpers) => { - let { config: config5 } = helpers; - return createUtilityPlugin("ringOpacity", [["ring-opacity", ["--tw-ring-opacity"]]], { - filterDefault: !flagEnabled(config5(), "respectDefaultRingColorOpacity") - })(helpers); - }, - ringOffsetWidth: createUtilityPlugin( - "ringOffsetWidth", - [["ring-offset", ["--tw-ring-offset-width"]]], - { type: "length" } - ), - ringOffsetColor: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "ring-offset": (value2) => { - return { - "--tw-ring-offset-color": toColorValue(value2) - }; - } - }, - { values: flattenColorPalette_default(theme2("ringOffsetColor")), type: ["color", "any"] } - ); - }, - blur: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - blur: (value2) => { - return { - "--tw-blur": `blur(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("blur") } - ); - }, - brightness: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - brightness: (value2) => { - return { - "--tw-brightness": `brightness(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("brightness") } - ); - }, - contrast: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - contrast: (value2) => { - return { - "--tw-contrast": `contrast(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("contrast") } - ); - }, - dropShadow: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "drop-shadow": (value2) => { - return { - "--tw-drop-shadow": Array.isArray(value2) ? value2.map((v) => `drop-shadow(${v})`).join(" ") : `drop-shadow(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("dropShadow") } - ); - }, - grayscale: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - grayscale: (value2) => { - return { - "--tw-grayscale": `grayscale(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("grayscale") } - ); - }, - hueRotate: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "hue-rotate": (value2) => { - return { - "--tw-hue-rotate": `hue-rotate(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("hueRotate"), supportsNegativeValues: true } - ); - }, - invert: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - invert: (value2) => { - return { - "--tw-invert": `invert(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("invert") } - ); - }, - saturate: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - saturate: (value2) => { - return { - "--tw-saturate": `saturate(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("saturate") } - ); - }, - sepia: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - sepia: (value2) => { - return { - "--tw-sepia": `sepia(${value2})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, - { values: theme2("sepia") } - ); - }, - filter: ({ addDefaults, addUtilities }) => { - addDefaults("filter", { - "--tw-blur": " ", - "--tw-brightness": " ", - "--tw-contrast": " ", - "--tw-grayscale": " ", - "--tw-hue-rotate": " ", - "--tw-invert": " ", - "--tw-saturate": " ", - "--tw-sepia": " ", - "--tw-drop-shadow": " " - }); - addUtilities({ - ".filter": { "@defaults filter": {}, filter: cssFilterValue }, - ".filter-none": { filter: "none" } - }); - }, - backdropBlur: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-blur": (value2) => { - return { - "--tw-backdrop-blur": `blur(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropBlur") } - ); - }, - backdropBrightness: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-brightness": (value2) => { - return { - "--tw-backdrop-brightness": `brightness(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropBrightness") } - ); - }, - backdropContrast: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-contrast": (value2) => { - return { - "--tw-backdrop-contrast": `contrast(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropContrast") } - ); - }, - backdropGrayscale: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-grayscale": (value2) => { - return { - "--tw-backdrop-grayscale": `grayscale(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropGrayscale") } - ); - }, - backdropHueRotate: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-hue-rotate": (value2) => { - return { - "--tw-backdrop-hue-rotate": `hue-rotate(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropHueRotate"), supportsNegativeValues: true } - ); - }, - backdropInvert: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-invert": (value2) => { - return { - "--tw-backdrop-invert": `invert(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropInvert") } - ); - }, - backdropOpacity: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-opacity": (value2) => { - return { - "--tw-backdrop-opacity": `opacity(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropOpacity") } - ); - }, - backdropSaturate: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-saturate": (value2) => { - return { - "--tw-backdrop-saturate": `saturate(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropSaturate") } - ); - }, - backdropSepia: ({ matchUtilities, theme: theme2 }) => { - matchUtilities( - { - "backdrop-sepia": (value2) => { - return { - "--tw-backdrop-sepia": `sepia(${value2})`, - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, - { values: theme2("backdropSepia") } - ); - }, - backdropFilter: ({ addDefaults, addUtilities }) => { - addDefaults("backdrop-filter", { - "--tw-backdrop-blur": " ", - "--tw-backdrop-brightness": " ", - "--tw-backdrop-contrast": " ", - "--tw-backdrop-grayscale": " ", - "--tw-backdrop-hue-rotate": " ", - "--tw-backdrop-invert": " ", - "--tw-backdrop-opacity": " ", - "--tw-backdrop-saturate": " ", - "--tw-backdrop-sepia": " " - }); - addUtilities({ - ".backdrop-filter": { - "@defaults backdrop-filter": {}, - "backdrop-filter": cssBackdropFilterValue - }, - ".backdrop-filter-none": { "backdrop-filter": "none" } - }); - }, - transitionProperty: ({ matchUtilities, theme: theme2 }) => { - let defaultTimingFunction = theme2("transitionTimingFunction.DEFAULT"); - let defaultDuration = theme2("transitionDuration.DEFAULT"); - matchUtilities( - { - transition: (value2) => { - return { - "transition-property": value2, - ...value2 === "none" ? {} : { - "transition-timing-function": defaultTimingFunction, - "transition-duration": defaultDuration - } - }; - } - }, - { values: theme2("transitionProperty") } - ); - }, - transitionDelay: createUtilityPlugin("transitionDelay", [["delay", ["transitionDelay"]]]), - transitionDuration: createUtilityPlugin( - "transitionDuration", - [["duration", ["transitionDuration"]]], - { filterDefault: true } - ), - transitionTimingFunction: createUtilityPlugin( - "transitionTimingFunction", - [["ease", ["transitionTimingFunction"]]], - { filterDefault: true } - ), - willChange: createUtilityPlugin("willChange", [["will-change", ["will-change"]]]), - content: createUtilityPlugin("content", [ - ["content", ["--tw-content", ["content", "var(--tw-content)"]]] - ]), - forcedColorAdjust: ({ addUtilities }) => { - addUtilities({ - ".forced-color-adjust-auto": { "forced-color-adjust": "auto" }, - ".forced-color-adjust-none": { "forced-color-adjust": "none" } - }); - } - }; - function toPath(path) { - if (Array.isArray(path)) - return path; - let openBrackets = path.split("[").length - 1; - let closedBrackets = path.split("]").length - 1; - if (openBrackets !== closedBrackets) { - throw new Error(`Path is invalid. Has unbalanced brackets: ${path}`); - } - return path.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean); - } - var matchingBrackets = /* @__PURE__ */ new Map([ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ]); - var inverseMatchingBrackets = new Map( - Array.from(matchingBrackets.entries()).map(([k, v]) => [v, k]) - ); - var quotes = /* @__PURE__ */ new Set(['"', "'", "`"]); - function isSyntacticallyValidPropertyValue(value2) { - let stack = []; - let inQuotes = false; - for (let i = 0; i < value2.length; i++) { - let char = value2[i]; - if (char === ":" && !inQuotes && stack.length === 0) { - return false; - } - if (quotes.has(char) && value2[i - 1] !== "\\") { - inQuotes = !inQuotes; - } - if (inQuotes) - continue; - if (value2[i - 1] === "\\") - continue; - if (matchingBrackets.has(char)) { - stack.push(char); - } else if (inverseMatchingBrackets.has(char)) { - let inverse = inverseMatchingBrackets.get(char); - if (stack.length <= 0) { - return false; - } - if (stack.pop() !== inverse) { - return false; - } - } - } - if (stack.length > 0) { - return false; - } - return true; - } - function bigSign(bigIntValue) { - return (bigIntValue > 0n) - (bigIntValue < 0n); - } - function remapBitfield(num, mapping) { - let oldMask = 0n; - let newMask = 0n; - for (let [oldBit, newBit] of mapping) { - if (num & oldBit) { - oldMask = oldMask | oldBit; - newMask = newMask | newBit; - } - } - return num & ~oldMask | newMask; - } - var Offsets = class { - constructor() { - this.offsets = { - defaults: 0n, - base: 0n, - components: 0n, - utilities: 0n, - variants: 0n, - user: 0n - }; - this.layerPositions = { - defaults: 0n, - base: 1n, - components: 2n, - utilities: 3n, - user: 4n, - variants: 5n - }; - this.reservedVariantBits = 0n; - this.variantOffsets = /* @__PURE__ */ new Map(); - } - create(layer) { - return { - layer, - parentLayer: layer, - arbitrary: 0n, - variants: 0n, - parallelIndex: 0n, - index: this.offsets[layer]++, - options: [] - }; - } - arbitraryProperty() { - return { - ...this.create("utilities"), - arbitrary: 1n - }; - } - forVariant(variant, index4 = 0) { - let offset = this.variantOffsets.get(variant); - if (offset === void 0) { - throw new Error(`Cannot find offset for unknown variant ${variant}`); - } - return { - ...this.create("variants"), - variants: offset << BigInt(index4) - }; - } - applyVariantOffset(rule2, variant, options) { - options.variant = variant.variants; - return { - ...rule2, - layer: "variants", - parentLayer: rule2.layer === "variants" ? rule2.parentLayer : rule2.layer, - variants: rule2.variants | variant.variants, - options: options.sort ? [].concat(options, rule2.options) : rule2.options, - parallelIndex: max([rule2.parallelIndex, variant.parallelIndex]) - }; - } - applyParallelOffset(offset, parallelIndex) { - return { - ...offset, - parallelIndex: BigInt(parallelIndex) - }; - } - recordVariants(variants, getLength) { - for (let variant of variants) { - this.recordVariant(variant, getLength(variant)); - } - } - recordVariant(variant, fnCount = 1) { - this.variantOffsets.set(variant, 1n << this.reservedVariantBits); - this.reservedVariantBits += BigInt(fnCount); - return { - ...this.create("variants"), - variants: this.variantOffsets.get(variant) - }; - } - compare(a, b) { - if (a.layer !== b.layer) { - return this.layerPositions[a.layer] - this.layerPositions[b.layer]; - } - if (a.parentLayer !== b.parentLayer) { - return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer]; - } - for (let aOptions of a.options) { - for (let bOptions of b.options) { - if (aOptions.id !== bOptions.id) - continue; - if (!aOptions.sort || !bOptions.sort) - continue; - let maxFnVariant = max([aOptions.variant, bOptions.variant]) ?? 0n; - let mask = ~(maxFnVariant | maxFnVariant - 1n); - let aVariantsAfterFn = a.variants & mask; - let bVariantsAfterFn = b.variants & mask; - if (aVariantsAfterFn !== bVariantsAfterFn) { - continue; - } - let result = aOptions.sort( - { - value: aOptions.value, - modifier: aOptions.modifier - }, - { - value: bOptions.value, - modifier: bOptions.modifier - } - ); - if (result !== 0) - return result; - } - } - if (a.variants !== b.variants) { - return a.variants - b.variants; - } - if (a.parallelIndex !== b.parallelIndex) { - return a.parallelIndex - b.parallelIndex; - } - if (a.arbitrary !== b.arbitrary) { - return a.arbitrary - b.arbitrary; - } - return a.index - b.index; - } - recalculateVariantOffsets() { - let variants = Array.from(this.variantOffsets.entries()).filter(([v]) => v.startsWith("[")).sort(([a], [z]) => fastCompare(a, z)); - let newOffsets = variants.map(([, offset]) => offset).sort((a, z) => bigSign(a - z)); - let mapping = variants.map(([, oldOffset], i) => [oldOffset, newOffsets[i]]); - return mapping.filter(([a, z]) => a !== z); - } - remapArbitraryVariantOffsets(list22) { - let mapping = this.recalculateVariantOffsets(); - if (mapping.length === 0) { - return list22; - } - return list22.map((item) => { - let [offset, rule2] = item; - offset = { - ...offset, - variants: remapBitfield(offset.variants, mapping) - }; - return [offset, rule2]; - }); - } - sort(list22) { - list22 = this.remapArbitraryVariantOffsets(list22); - return list22.sort(([a], [b]) => bigSign(this.compare(a, b))); - } - }; - function max(nums) { - let max2 = null; - for (const num of nums) { - max2 = max2 ?? num; - max2 = max2 > num ? max2 : num; - } - return max2; - } - function fastCompare(a, b) { - let aLen = a.length; - let bLen = b.length; - let minLen = aLen < bLen ? aLen : bLen; - for (let i = 0; i < minLen; i++) { - let cmp = a.charCodeAt(i) - b.charCodeAt(i); - if (cmp !== 0) - return cmp; - } - return aLen - bLen; - } - var INTERNAL_FEATURES = Symbol(); - var VARIANT_TYPES = { - AddVariant: Symbol.for("ADD_VARIANT"), - MatchVariant: Symbol.for("MATCH_VARIANT") - }; - var VARIANT_INFO = { - Base: 1 << 0, - Dynamic: 1 << 1 - }; - function prefix(context, selector) { - let prefix3 = context.tailwindConfig.prefix; - return typeof prefix3 === "function" ? prefix3(selector) : prefix3 + selector; - } - function normalizeOptionTypes({ type = "any", ...options }) { - let types2 = [].concat(type); - return { - ...options, - types: types2.map((type2) => { - if (Array.isArray(type2)) { - return { type: type2[0], ...type2[1] }; - } - return { type: type2, preferOnConflict: false }; - }) - }; - } - function parseVariantFormatString(input) { - let parts = []; - let current = ""; - let depth = 0; - for (let idx = 0; idx < input.length; idx++) { - let char = input[idx]; - if (char === "\\") { - current += "\\" + input[++idx]; - } else if (char === "{") { - ++depth; - parts.push(current.trim()); - current = ""; - } else if (char === "}") { - if (--depth < 0) { - throw new Error(`Your { and } are unbalanced.`); - } - parts.push(current.trim()); - current = ""; - } else { - current += char; - } - } - if (current.length > 0) { - parts.push(current.trim()); - } - parts = parts.filter((part) => part !== ""); - return parts; - } - function insertInto(list22, value2, { before = [] } = {}) { - before = [].concat(before); - if (before.length <= 0) { - list22.push(value2); - return; - } - let idx = list22.length - 1; - for (let other of before) { - let iidx = list22.indexOf(other); - if (iidx === -1) - continue; - idx = Math.min(idx, iidx); - } - list22.splice(idx, 0, value2); - } - function parseStyles(styles) { - if (!Array.isArray(styles)) { - return parseStyles([styles]); - } - return styles.flatMap((style) => { - let isNode = !Array.isArray(style) && !isPlainObject(style); - return isNode ? style : parseObjectStyles(style); - }); - } - function getClasses(selector, mutate) { - let parser5 = (0, import_postcss_selector_parser5.default)((selectors) => { - let allClasses = []; - if (mutate) { - mutate(selectors); - } - selectors.walkClasses((classNode) => { - allClasses.push(classNode.value); - }); - return allClasses; - }); - return parser5.transformSync(selector); - } - function ignoreNot(selectors) { - selectors.walkPseudos((pseudo) => { - if (pseudo.value === ":not") { - pseudo.remove(); - } - }); - } - function extractCandidates(node, state = { containsNonOnDemandable: false }, depth = 0) { - let classes = []; - let selectors = []; - if (node.type === "rule") { - selectors.push(...node.selectors); - } else if (node.type === "atrule") { - node.walkRules((rule2) => selectors.push(...rule2.selectors)); - } - for (let selector of selectors) { - let classCandidates = getClasses(selector, ignoreNot); - if (classCandidates.length === 0) { - state.containsNonOnDemandable = true; - } - for (let classCandidate of classCandidates) { - classes.push(classCandidate); - } - } - if (depth === 0) { - return [state.containsNonOnDemandable || classes.length === 0, classes]; - } - return classes; - } - function withIdentifiers(styles) { - return parseStyles(styles).flatMap((node) => { - let nodeMap = /* @__PURE__ */ new Map(); - let [containsNonOnDemandableSelectors, candidates] = extractCandidates(node); - if (containsNonOnDemandableSelectors) { - candidates.unshift(NOT_ON_DEMAND); - } - return candidates.map((c) => { - if (!nodeMap.has(node)) { - nodeMap.set(node, node); - } - return [c, nodeMap.get(node)]; - }); - }); - } - function isValidVariantFormatString(format) { - return format.startsWith("@") || format.includes("&"); - } - function parseVariant(variant) { - variant = variant.replace(/\n+/g, "").replace(/\s{1,}/g, " ").trim(); - let fns = parseVariantFormatString(variant).map((str) => { - if (!str.startsWith("@")) { - return ({ format }) => format(str); - } - let [, name, params] = /@(\S*)( .+|[({].*)?/g.exec(str); - return ({ wrap }) => wrap(postcss_default.atRule({ name, params: params?.trim() ?? "" })); - }).reverse(); - return (api) => { - for (let fn of fns) { - fn(api); - } - }; - } - function buildPluginApi(tailwindConfig2, context, { variantList, variantMap, offsets, classList }) { - function getConfigValue(path, defaultValue) { - return path ? (0, import_dlv.default)(tailwindConfig2, path, defaultValue) : tailwindConfig2; - } - function applyConfiguredPrefix(selector) { - return prefixSelector_default(tailwindConfig2.prefix, selector); - } - function prefixIdentifier(identifier, options) { - if (identifier === NOT_ON_DEMAND) { - return NOT_ON_DEMAND; - } - if (!options.respectPrefix) { - return identifier; - } - return context.tailwindConfig.prefix + identifier; - } - function resolveThemeValue(path, defaultValue, opts = {}) { - let parts = toPath(path); - let value2 = getConfigValue(["theme", ...parts], defaultValue); - return transformThemeValue(parts[0])(value2, opts); - } - let variantIdentifier = 0; - let api = { - postcss: postcss_default, - prefix: applyConfiguredPrefix, - e: escapeClassName, - config: getConfigValue, - theme: resolveThemeValue, - corePlugins: (path) => { - if (Array.isArray(tailwindConfig2.corePlugins)) { - return tailwindConfig2.corePlugins.includes(path); - } - return getConfigValue(["corePlugins", path], true); - }, - variants: () => { - return []; - }, - addBase(base) { - for (let [identifier, rule2] of withIdentifiers(base)) { - let prefixedIdentifier = prefixIdentifier(identifier, {}); - let offset = offsets.create("base"); - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push([{ sort: offset, layer: "base" }, rule2]); - } - }, - addDefaults(group, declarations) { - const groups = { - [`@defaults ${group}`]: declarations - }; - for (let [identifier, rule2] of withIdentifiers(groups)) { - let prefixedIdentifier = prefixIdentifier(identifier, {}); - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push([{ sort: offsets.create("defaults"), layer: "defaults" }, rule2]); - } - }, - addComponents(components, options) { - let defaultOptions = { - preserveSource: false, - respectPrefix: true, - respectImportant: false - }; - options = Object.assign({}, defaultOptions, Array.isArray(options) ? {} : options); - for (let [identifier, rule2] of withIdentifiers(components)) { - let prefixedIdentifier = prefixIdentifier(identifier, options); - classList.add(prefixedIdentifier); - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push([{ sort: offsets.create("components"), layer: "components", options }, rule2]); - } - }, - addUtilities(utilities, options) { - let defaultOptions = { - preserveSource: false, - respectPrefix: true, - respectImportant: true - }; - options = Object.assign({}, defaultOptions, Array.isArray(options) ? {} : options); - for (let [identifier, rule2] of withIdentifiers(utilities)) { - let prefixedIdentifier = prefixIdentifier(identifier, options); - classList.add(prefixedIdentifier); - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push([{ sort: offsets.create("utilities"), layer: "utilities", options }, rule2]); - } - }, - matchUtilities: function(utilities, options) { - let defaultOptions = { - respectPrefix: true, - respectImportant: true, - modifiers: false - }; - options = normalizeOptionTypes({ ...defaultOptions, ...options }); - let offset = offsets.create("utilities"); - for (let identifier in utilities) { - let wrapped = function(modifier, { isOnlyPlugin }) { - let [value2, coercedType, utilityModifier] = coerceValue( - options.types, - modifier, - options, - tailwindConfig2 - ); - if (value2 === void 0) { - return []; - } - if (!options.types.some(({ type }) => type === coercedType)) { - if (isOnlyPlugin) { - log_default.warn([ - `Unnecessary typehint \`${coercedType}\` in \`${identifier}-${modifier}\`.`, - `You can safely update it to \`${identifier}-${modifier.replace( - coercedType + ":", - "" - )}\`.` - ]); - } else { - return []; - } - } - if (!isSyntacticallyValidPropertyValue(value2)) { - return []; - } - let extras = { - get modifier() { - if (!options.modifiers) { - log_default.warn(`modifier-used-without-options-for-${identifier}`, [ - "Your plugin must set `modifiers: true` in its options to support modifiers." - ]); - } - return utilityModifier; - } - }; - let modifiersEnabled = flagEnabled(tailwindConfig2, "generalizedModifiers"); - let ruleSets = [].concat(modifiersEnabled ? rule2(value2, extras) : rule2(value2)).filter(Boolean).map((declaration) => ({ - [nameClass(identifier, modifier)]: declaration - })); - return ruleSets; - }; - let prefixedIdentifier = prefixIdentifier(identifier, options); - let rule2 = utilities[identifier]; - classList.add([prefixedIdentifier, options]); - let withOffsets = [{ sort: offset, layer: "utilities", options }, wrapped]; - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push(withOffsets); - } - }, - matchComponents: function(components, options) { - let defaultOptions = { - respectPrefix: true, - respectImportant: false, - modifiers: false - }; - options = normalizeOptionTypes({ ...defaultOptions, ...options }); - let offset = offsets.create("components"); - for (let identifier in components) { - let wrapped = function(modifier, { isOnlyPlugin }) { - let [value2, coercedType, utilityModifier] = coerceValue( - options.types, - modifier, - options, - tailwindConfig2 - ); - if (value2 === void 0) { - return []; - } - if (!options.types.some(({ type }) => type === coercedType)) { - if (isOnlyPlugin) { - log_default.warn([ - `Unnecessary typehint \`${coercedType}\` in \`${identifier}-${modifier}\`.`, - `You can safely update it to \`${identifier}-${modifier.replace( - coercedType + ":", - "" - )}\`.` - ]); - } else { - return []; - } - } - if (!isSyntacticallyValidPropertyValue(value2)) { - return []; - } - let extras = { - get modifier() { - if (!options.modifiers) { - log_default.warn(`modifier-used-without-options-for-${identifier}`, [ - "Your plugin must set `modifiers: true` in its options to support modifiers." - ]); - } - return utilityModifier; - } - }; - let modifiersEnabled = flagEnabled(tailwindConfig2, "generalizedModifiers"); - let ruleSets = [].concat(modifiersEnabled ? rule2(value2, extras) : rule2(value2)).filter(Boolean).map((declaration) => ({ - [nameClass(identifier, modifier)]: declaration - })); - return ruleSets; - }; - let prefixedIdentifier = prefixIdentifier(identifier, options); - let rule2 = components[identifier]; - classList.add([prefixedIdentifier, options]); - let withOffsets = [{ sort: offset, layer: "components", options }, wrapped]; - if (!context.candidateRuleMap.has(prefixedIdentifier)) { - context.candidateRuleMap.set(prefixedIdentifier, []); - } - context.candidateRuleMap.get(prefixedIdentifier).push(withOffsets); - } - }, - addVariant(variantName, variantFunctions, options = {}) { - variantFunctions = [].concat(variantFunctions).map((variantFunction) => { - if (typeof variantFunction !== "string") { - return (api2 = {}) => { - let { args, modifySelectors, container, separator, wrap, format } = api2; - let result = variantFunction( - Object.assign( - { modifySelectors, container, separator }, - options.type === VARIANT_TYPES.MatchVariant && { args, wrap, format } - ) - ); - if (typeof result === "string" && !isValidVariantFormatString(result)) { - throw new Error( - `Your custom variant \`${variantName}\` has an invalid format string. Make sure it's an at-rule or contains a \`&\` placeholder.` - ); - } - if (Array.isArray(result)) { - return result.filter((variant) => typeof variant === "string").map((variant) => parseVariant(variant)); - } - return result && typeof result === "string" && parseVariant(result)(api2); - }; - } - if (!isValidVariantFormatString(variantFunction)) { - throw new Error( - `Your custom variant \`${variantName}\` has an invalid format string. Make sure it's an at-rule or contains a \`&\` placeholder.` - ); - } - return parseVariant(variantFunction); - }); - insertInto(variantList, variantName, options); - variantMap.set(variantName, variantFunctions); - context.variantOptions.set(variantName, options); - }, - matchVariant(variant, variantFn, options) { - let id = options?.id ?? ++variantIdentifier; - let isSpecial = variant === "@"; - let modifiersEnabled = flagEnabled(tailwindConfig2, "generalizedModifiers"); - for (let [key, value2] of Object.entries(options?.values ?? {})) { - if (key === "DEFAULT") - continue; - api.addVariant( - isSpecial ? `${variant}${key}` : `${variant}-${key}`, - ({ args, container }) => { - return variantFn( - value2, - modifiersEnabled ? { modifier: args?.modifier, container } : { container } - ); - }, - { - ...options, - value: value2, - id, - type: VARIANT_TYPES.MatchVariant, - variantInfo: VARIANT_INFO.Base - } - ); - } - let hasDefault = "DEFAULT" in (options?.values ?? {}); - api.addVariant( - variant, - ({ args, container }) => { - if (args?.value === NONE && !hasDefault) { - return null; - } - return variantFn( - args?.value === NONE ? options.values.DEFAULT : args?.value ?? (typeof args === "string" ? args : ""), - modifiersEnabled ? { modifier: args?.modifier, container } : { container } - ); - }, - { - ...options, - id, - type: VARIANT_TYPES.MatchVariant, - variantInfo: VARIANT_INFO.Dynamic - } - ); - } - }; - return api; - } - function extractVariantAtRules(node) { - node.walkAtRules((atRule2) => { - if (["responsive", "variants"].includes(atRule2.name)) { - extractVariantAtRules(atRule2); - atRule2.before(atRule2.nodes); - atRule2.remove(); - } - }); - } - function collectLayerPlugins(root2) { - let layerPlugins = []; - root2.each((node) => { - if (node.type === "atrule" && ["responsive", "variants"].includes(node.name)) { - node.name = "layer"; - node.params = "utilities"; - } - }); - root2.walkAtRules("layer", (layerRule) => { - extractVariantAtRules(layerRule); - if (layerRule.params === "base") { - for (let node of layerRule.nodes) { - layerPlugins.push(function({ addBase }) { - addBase(node, { respectPrefix: false }); - }); - } - layerRule.remove(); - } else if (layerRule.params === "components") { - for (let node of layerRule.nodes) { - layerPlugins.push(function({ addComponents }) { - addComponents(node, { respectPrefix: false, preserveSource: true }); - }); - } - layerRule.remove(); - } else if (layerRule.params === "utilities") { - for (let node of layerRule.nodes) { - layerPlugins.push(function({ addUtilities }) { - addUtilities(node, { respectPrefix: false, preserveSource: true }); - }); - } - layerRule.remove(); - } - }); - return layerPlugins; - } - function resolvePlugins(context, root2) { - let corePluginList = Object.entries({ ...variantPlugins, ...corePlugins }).map(([name, plugin2]) => { - if (!context.tailwindConfig.corePlugins.includes(name)) { - return null; - } - return plugin2; - }).filter(Boolean); - let userPlugins = context.tailwindConfig.plugins.map((plugin2) => { - if (plugin2.__isOptionsFunction) { - plugin2 = plugin2(); - } - return typeof plugin2 === "function" ? plugin2 : plugin2.handler; - }); - let layerPlugins = collectLayerPlugins(root2); - let beforeVariants = [ - variantPlugins["childVariant"], - variantPlugins["pseudoElementVariants"], - variantPlugins["pseudoClassVariants"], - variantPlugins["hasVariants"], - variantPlugins["ariaVariants"], - variantPlugins["dataVariants"] - ]; - let afterVariants = [ - variantPlugins["supportsVariants"], - variantPlugins["reducedMotionVariants"], - variantPlugins["prefersContrastVariants"], - variantPlugins["screenVariants"], - variantPlugins["orientationVariants"], - variantPlugins["directionVariants"], - variantPlugins["darkVariants"], - variantPlugins["forcedColorsVariants"], - variantPlugins["printVariant"] - ]; - let isLegacyDarkMode = context.tailwindConfig.darkMode === "class" || Array.isArray(context.tailwindConfig.darkMode) && context.tailwindConfig.darkMode[0] === "class"; - if (isLegacyDarkMode) { - afterVariants = [ - variantPlugins["supportsVariants"], - variantPlugins["reducedMotionVariants"], - variantPlugins["prefersContrastVariants"], - variantPlugins["darkVariants"], - variantPlugins["screenVariants"], - variantPlugins["orientationVariants"], - variantPlugins["directionVariants"], - variantPlugins["forcedColorsVariants"], - variantPlugins["printVariant"] - ]; - } - return [...corePluginList, ...beforeVariants, ...userPlugins, ...afterVariants, ...layerPlugins]; - } - function registerPlugins(plugins, context) { - let variantList = []; - let variantMap = /* @__PURE__ */ new Map(); - context.variantMap = variantMap; - let offsets = new Offsets(); - context.offsets = offsets; - let classList = /* @__PURE__ */ new Set(); - let pluginApi = buildPluginApi(context.tailwindConfig, context, { - variantList, - variantMap, - offsets, - classList - }); - for (let plugin2 of plugins) { - if (Array.isArray(plugin2)) { - for (let pluginItem of plugin2) { - pluginItem(pluginApi); - } - } else { - plugin2?.(pluginApi); - } - } - offsets.recordVariants(variantList, (variant) => variantMap.get(variant).length); - for (let [variantName, variantFunctions] of variantMap.entries()) { - context.variantMap.set( - variantName, - variantFunctions.map((variantFunction, idx) => [ - offsets.forVariant(variantName, idx), - variantFunction - ]) - ); - } - let safelist = (context.tailwindConfig.safelist ?? []).filter(Boolean); - if (safelist.length > 0) { - let checks = []; - for (let value2 of safelist) { - if (typeof value2 === "string") { - context.changedContent.push({ content: value2, extension: "html" }); - continue; - } - if (value2 instanceof RegExp) { - log_default.warn("root-regex", [ - "Regular expressions in `safelist` work differently in Tailwind CSS v3.0.", - "Update your `safelist` configuration to eliminate this warning.", - "https://tailwindcss.com/docs/content-configuration#safelisting-classes" - ]); - continue; - } - checks.push(value2); - } - if (checks.length > 0) { - let patternMatchingCount = /* @__PURE__ */ new Map(); - let prefixLength = context.tailwindConfig.prefix.length; - let checkImportantUtils = checks.some((check) => check.pattern.source.includes("!")); - for (let util of classList) { - let utils = Array.isArray(util) ? (() => { - let [utilName, options] = util; - let values = Object.keys(options?.values ?? {}); - let classes = values.map((value2) => formatClass(utilName, value2)); - if (options?.supportsNegativeValues) { - classes = [...classes, ...classes.map((cls) => "-" + cls)]; - classes = [ - ...classes, - ...classes.map( - (cls) => cls.slice(0, prefixLength) + "-" + cls.slice(prefixLength) - ) - ]; - } - if (options.types.some(({ type }) => type === "color")) { - classes = [ - ...classes, - ...classes.flatMap( - (cls) => Object.keys(context.tailwindConfig.theme.opacity).map( - (opacity) => `${cls}/${opacity}` - ) - ) - ]; - } - if (checkImportantUtils && options?.respectImportant) { - classes = [...classes, ...classes.map((cls) => "!" + cls)]; - } - return classes; - })() : [util]; - for (let util2 of utils) { - for (let { pattern: pattern2, variants = [] } of checks) { - pattern2.lastIndex = 0; - if (!patternMatchingCount.has(pattern2)) { - patternMatchingCount.set(pattern2, 0); - } - if (!pattern2.test(util2)) - continue; - patternMatchingCount.set(pattern2, patternMatchingCount.get(pattern2) + 1); - context.changedContent.push({ content: util2, extension: "html" }); - for (let variant of variants) { - context.changedContent.push({ - content: variant + context.tailwindConfig.separator + util2, - extension: "html" - }); - } - } - } - } - for (let [regex, count] of patternMatchingCount.entries()) { - if (count !== 0) - continue; - log_default.warn([ - `The safelist pattern \`${regex}\` doesn't match any Tailwind CSS classes.`, - "Fix this pattern or remove it from your `safelist` configuration.", - "https://tailwindcss.com/docs/content-configuration#safelisting-classes" - ]); - } - } - } - let darkClassName = [].concat(context.tailwindConfig.darkMode ?? "media")[1] ?? "dark"; - let parasiteUtilities = [ - prefix(context, darkClassName), - prefix(context, "group"), - prefix(context, "peer") - ]; - context.getClassOrder = function getClassOrder(classes) { - let sorted = [...classes].sort((a, z) => { - if (a === z) - return 0; - if (a < z) - return -1; - return 1; - }); - let sortedClassNames = new Map(sorted.map((className) => [className, null])); - let rules2 = generateRules(new Set(sorted), context, true); - rules2 = context.offsets.sort(rules2); - let idx = BigInt(parasiteUtilities.length); - for (const [, rule2] of rules2) { - let candidate = rule2.raws.tailwind.candidate; - sortedClassNames.set(candidate, sortedClassNames.get(candidate) ?? idx++); - } - return classes.map((className) => { - let order = sortedClassNames.get(className) ?? null; - let parasiteIndex = parasiteUtilities.indexOf(className); - if (order === null && parasiteIndex !== -1) { - order = BigInt(parasiteIndex); - } - return [className, order]; - }); - }; - context.getClassList = function getClassList(options = {}) { - let output = []; - for (let util of classList) { - if (Array.isArray(util)) { - let [utilName, utilOptions] = util; - let negativeClasses = []; - let modifiers = Object.keys(utilOptions?.modifiers ?? {}); - if (utilOptions?.types?.some(({ type }) => type === "color")) { - modifiers.push(...Object.keys(context.tailwindConfig.theme.opacity ?? {})); - } - let metadata = { modifiers }; - let includeMetadata = options.includeMetadata && modifiers.length > 0; - for (let [key, value2] of Object.entries(utilOptions?.values ?? {})) { - if (value2 == null) { - continue; - } - let cls = formatClass(utilName, key); - output.push(includeMetadata ? [cls, metadata] : cls); - if (utilOptions?.supportsNegativeValues && negateValue(value2)) { - let cls2 = formatClass(utilName, `-${key}`); - negativeClasses.push(includeMetadata ? [cls2, metadata] : cls2); - } - } - output.push(...negativeClasses); - } else { - output.push(util); - } - } - return output; - }; - context.getVariants = function getVariants() { - let result = []; - for (let [name, options] of context.variantOptions.entries()) { - if (options.variantInfo === VARIANT_INFO.Base) - continue; - result.push({ - name, - isArbitrary: options.type === Symbol.for("MATCH_VARIANT"), - values: Object.keys(options.values ?? {}), - hasDash: name !== "@", - selectors({ modifier, value: value2 } = {}) { - let candidate = "__TAILWIND_PLACEHOLDER__"; - let rule2 = postcss_default.rule({ selector: `.${candidate}` }); - let container = postcss_default.root({ nodes: [rule2.clone()] }); - let before = container.toString(); - let fns = (context.variantMap.get(name) ?? []).flatMap(([_, fn]) => fn); - let formatStrings = []; - for (let fn of fns) { - let localFormatStrings = []; - let api = { - args: { modifier, value: options.values?.[value2] ?? value2 }, - separator: context.tailwindConfig.separator, - modifySelectors(modifierFunction) { - container.each((rule22) => { - if (rule22.type !== "rule") { - return; - } - rule22.selectors = rule22.selectors.map((selector) => { - return modifierFunction({ - get className() { - return getClassNameFromSelector(selector); - }, - selector - }); - }); - }); - return container; - }, - format(str) { - localFormatStrings.push(str); - }, - wrap(wrapper) { - localFormatStrings.push(`@${wrapper.name} ${wrapper.params} { & }`); - }, - container - }; - let ruleWithVariant = fn(api); - if (localFormatStrings.length > 0) { - formatStrings.push(localFormatStrings); - } - if (Array.isArray(ruleWithVariant)) { - for (let variantFunction of ruleWithVariant) { - localFormatStrings = []; - variantFunction(api); - formatStrings.push(localFormatStrings); - } - } - } - let manualFormatStrings = []; - let after = container.toString(); - if (before !== after) { - container.walkRules((rule22) => { - let modified = rule22.selector; - let rebuiltBase = (0, import_postcss_selector_parser5.default)((selectors) => { - selectors.walkClasses((classNode) => { - classNode.value = `${name}${context.tailwindConfig.separator}${classNode.value}`; - }); - }).processSync(modified); - manualFormatStrings.push(modified.replace(rebuiltBase, "&").replace(candidate, "&")); - }); - container.walkAtRules((atrule) => { - manualFormatStrings.push(`@${atrule.name} (${atrule.params}) { & }`); - }); - } - let isArbitraryVariant = !(value2 in (options.values ?? {})); - let internalFeatures = options[INTERNAL_FEATURES] ?? {}; - let respectPrefix = (() => { - if (isArbitraryVariant) - return false; - if (internalFeatures.respectPrefix === false) - return false; - return true; - })(); - formatStrings = formatStrings.map( - (format) => format.map((str) => ({ - format: str, - respectPrefix - })) - ); - manualFormatStrings = manualFormatStrings.map((format) => ({ - format, - respectPrefix - })); - let opts = { - candidate, - context - }; - let result2 = formatStrings.map( - (formats) => finalizeSelector(`.${candidate}`, formatVariantSelector(formats, opts), opts).replace(`.${candidate}`, "&").replace("{ & }", "").trim() - ); - if (manualFormatStrings.length > 0) { - result2.push( - formatVariantSelector(manualFormatStrings, opts).toString().replace(`.${candidate}`, "&") - ); - } - return result2; - } - }); - } - return result; - }; - } - function markInvalidUtilityCandidate(context, candidate) { - if (!context.classCache.has(candidate)) { - return; - } - context.notClassCache.add(candidate); - context.classCache.delete(candidate); - context.applyClassCache.delete(candidate); - context.candidateRuleMap.delete(candidate); - context.candidateRuleCache.delete(candidate); - context.stylesheetCache = null; - } - function markInvalidUtilityNode(context, node) { - let candidate = node.raws.tailwind.candidate; - if (!candidate) { - return; - } - for (const entry of context.ruleCache) { - if (entry[1].raws.tailwind.candidate === candidate) { - context.ruleCache.delete(entry); - } - } - markInvalidUtilityCandidate(context, candidate); - } - function createContext(tailwindConfig2, changedContent = [], root2 = postcss_default.root()) { - let context = { - disposables: [], - ruleCache: /* @__PURE__ */ new Set(), - candidateRuleCache: /* @__PURE__ */ new Map(), - classCache: /* @__PURE__ */ new Map(), - applyClassCache: /* @__PURE__ */ new Map(), - notClassCache: new Set(tailwindConfig2.blocklist ?? []), - postCssNodeCache: /* @__PURE__ */ new Map(), - candidateRuleMap: /* @__PURE__ */ new Map(), - tailwindConfig: tailwindConfig2, - changedContent, - variantMap: /* @__PURE__ */ new Map(), - stylesheetCache: null, - variantOptions: /* @__PURE__ */ new Map(), - markInvalidUtilityCandidate: (candidate) => markInvalidUtilityCandidate(context, candidate), - markInvalidUtilityNode: (node) => markInvalidUtilityNode(context, node) - }; - let resolvedPlugins = resolvePlugins(context, root2); - registerPlugins(resolvedPlugins, context); - return context; - } - function applyImportantSelector(selector, important) { - let sel = (0, import_postcss_selector_parser6.default)().astSync(selector); - sel.each((sel2) => { - let isWrapped = sel2.nodes[0].type === "pseudo" && sel2.nodes[0].value === ":is" && sel2.nodes.every((node) => node.type !== "combinator"); - if (!isWrapped) { - sel2.nodes = [ - import_postcss_selector_parser6.default.pseudo({ - value: ":is", - nodes: [sel2.clone()] - }) - ]; - } - movePseudos(sel2); - }); - return `${important} ${sel.toString()}`; - } - var classNameParser = (0, import_postcss_selector_parser.default)((selectors) => { - return selectors.first.filter(({ type }) => type === "class").pop().value; - }); - function getClassNameFromSelector(selector) { - return classNameParser.transformSync(selector); - } - function* candidatePermutations(candidate) { - let lastIndex = Infinity; - while (lastIndex >= 0) { - let dashIdx; - let wasSlash = false; - if (lastIndex === Infinity && candidate.endsWith("]")) { - let bracketIdx = candidate.indexOf("["); - if (candidate[bracketIdx - 1] === "-") { - dashIdx = bracketIdx - 1; - } else if (candidate[bracketIdx - 1] === "/") { - dashIdx = bracketIdx - 1; - wasSlash = true; - } else { - dashIdx = -1; - } - } else if (lastIndex === Infinity && candidate.includes("/")) { - dashIdx = candidate.lastIndexOf("/"); - wasSlash = true; - } else { - dashIdx = candidate.lastIndexOf("-", lastIndex); - } - if (dashIdx < 0) { - break; - } - let prefix3 = candidate.slice(0, dashIdx); - let modifier = candidate.slice(wasSlash ? dashIdx : dashIdx + 1); - lastIndex = dashIdx - 1; - if (prefix3 === "" || modifier === "/") { - continue; - } - yield [prefix3, modifier]; - } - } - function applyPrefix(matches, context) { - if (matches.length === 0 || context.tailwindConfig.prefix === "") { - return matches; - } - for (let match of matches) { - let [meta] = match; - if (meta.options.respectPrefix) { - let container = postcss_default.root({ nodes: [match[1].clone()] }); - let classCandidate = match[1].raws.tailwind.classCandidate; - container.walkRules((r) => { - let shouldPrependNegative = classCandidate.startsWith("-"); - r.selector = prefixSelector_default( - context.tailwindConfig.prefix, - r.selector, - shouldPrependNegative - ); - }); - match[1] = container.nodes[0]; - } - } - return matches; - } - function applyImportant(matches, classCandidate) { - if (matches.length === 0) { - return matches; - } - let result = []; - function isInKeyframes(rule2) { - return rule2.parent && rule2.parent.type === "atrule" && rule2.parent.name === "keyframes"; - } - for (let [meta, rule2] of matches) { - let container = postcss_default.root({ nodes: [rule2.clone()] }); - container.walkRules((r) => { - if (isInKeyframes(r)) { - return; - } - let ast = (0, import_postcss_selector_parser.default)().astSync(r.selector); - ast.each((sel) => eliminateIrrelevantSelectors(sel, classCandidate)); - updateAllClasses( - ast, - (className) => className === classCandidate ? `!${className}` : className - ); - r.selector = ast.toString(); - r.walkDecls((d) => d.important = true); - }); - result.push([{ ...meta, important: true }, container.nodes[0]]); - } - return result; - } - function applyVariant(variant, matches, context) { - if (matches.length === 0) { - return matches; - } - let args = { modifier: null, value: NONE }; - { - let [baseVariant, ...modifiers] = splitAtTopLevelOnly(variant, "/"); - if (modifiers.length > 1) { - baseVariant = baseVariant + "/" + modifiers.slice(0, -1).join("/"); - modifiers = modifiers.slice(-1); - } - if (modifiers.length && !context.variantMap.has(variant)) { - variant = baseVariant; - args.modifier = modifiers[0]; - if (!flagEnabled(context.tailwindConfig, "generalizedModifiers")) { - return []; - } - } - } - if (variant.endsWith("]") && !variant.startsWith("[")) { - let match = /(.)(-?)\[(.*)\]/g.exec(variant); - if (match) { - let [, char, separator, value2] = match; - if (char === "@" && separator === "-") - return []; - if (char !== "@" && separator === "") - return []; - variant = variant.replace(`${separator}[${value2}]`, ""); - args.value = value2; - } - } - if (isArbitraryValue2(variant) && !context.variantMap.has(variant)) { - let sort = context.offsets.recordVariant(variant); - let selector = normalize(variant.slice(1, -1)); - let selectors = splitAtTopLevelOnly(selector, ","); - if (selectors.length > 1) { - return []; - } - if (!selectors.every(isValidVariantFormatString)) { - return []; - } - let records = selectors.map((sel, idx) => [ - context.offsets.applyParallelOffset(sort, idx), - parseVariant(sel.trim()) - ]); - context.variantMap.set(variant, records); - } - if (context.variantMap.has(variant)) { - let isArbitraryVariant = isArbitraryValue2(variant); - let internalFeatures = context.variantOptions.get(variant)?.[INTERNAL_FEATURES] ?? {}; - let variantFunctionTuples = context.variantMap.get(variant).slice(); - let result = []; - let respectPrefix = (() => { - if (isArbitraryVariant) - return false; - if (internalFeatures.respectPrefix === false) - return false; - return true; - })(); - for (let [meta, rule2] of matches) { - if (meta.layer === "user") { - continue; - } - let container = postcss_default.root({ nodes: [rule2.clone()] }); - for (let [variantSort, variantFunction, containerFromArray] of variantFunctionTuples) { - let prepareBackup = function() { - if (clone.raws.neededBackup) { - return; - } - clone.raws.neededBackup = true; - clone.walkRules((rule22) => rule22.raws.originalSelector = rule22.selector); - }, modifySelectors = function(modifierFunction) { - prepareBackup(); - clone.each((rule22) => { - if (rule22.type !== "rule") { - return; - } - rule22.selectors = rule22.selectors.map((selector) => { - return modifierFunction({ - get className() { - return getClassNameFromSelector(selector); - }, - selector - }); - }); - }); - return clone; - }; - let clone = (containerFromArray ?? container).clone(); - let collectedFormats = []; - let ruleWithVariant = variantFunction({ - get container() { - prepareBackup(); - return clone; - }, - separator: context.tailwindConfig.separator, - modifySelectors, - wrap(wrapper) { - let nodes = clone.nodes; - clone.removeAll(); - wrapper.append(nodes); - clone.append(wrapper); - }, - format(selectorFormat) { - collectedFormats.push({ - format: selectorFormat, - respectPrefix - }); - }, - args - }); - if (Array.isArray(ruleWithVariant)) { - for (let [idx, variantFunction2] of ruleWithVariant.entries()) { - variantFunctionTuples.push([ - context.offsets.applyParallelOffset(variantSort, idx), - variantFunction2, - clone.clone() - ]); - } - continue; - } - if (typeof ruleWithVariant === "string") { - collectedFormats.push({ - format: ruleWithVariant, - respectPrefix - }); - } - if (ruleWithVariant === null) { - continue; - } - if (clone.raws.neededBackup) { - delete clone.raws.neededBackup; - clone.walkRules((rule22) => { - let before = rule22.raws.originalSelector; - if (!before) - return; - delete rule22.raws.originalSelector; - if (before === rule22.selector) - return; - let modified = rule22.selector; - let rebuiltBase = (0, import_postcss_selector_parser.default)((selectors) => { - selectors.walkClasses((classNode) => { - classNode.value = `${variant}${context.tailwindConfig.separator}${classNode.value}`; - }); - }).processSync(before); - collectedFormats.push({ - format: modified.replace(rebuiltBase, "&"), - respectPrefix - }); - rule22.selector = before; - }); - } - clone.nodes[0].raws.tailwind = { ...clone.nodes[0].raws.tailwind, parentLayer: meta.layer }; - let withOffset = [ - { - ...meta, - sort: context.offsets.applyVariantOffset( - meta.sort, - variantSort, - Object.assign(args, context.variantOptions.get(variant)) - ), - collectedFormats: (meta.collectedFormats ?? []).concat(collectedFormats) - }, - clone.nodes[0] - ]; - result.push(withOffset); - } - } - return result; - } - return []; - } - function parseRules(rule2, cache2, options = {}) { - if (!isPlainObject(rule2) && !Array.isArray(rule2)) { - return [[rule2], options]; - } - if (Array.isArray(rule2)) { - return parseRules(rule2[0], cache2, rule2[1]); - } - if (!cache2.has(rule2)) { - cache2.set(rule2, parseObjectStyles(rule2)); - } - return [cache2.get(rule2), options]; - } - var IS_VALID_PROPERTY_NAME = /^[a-z_-]/; - function isValidPropName(name) { - return IS_VALID_PROPERTY_NAME.test(name); - } - function looksLikeUri(declaration) { - if (!declaration.includes("://")) { - return false; - } - try { - const url2 = new URL(declaration); - return url2.scheme !== "" && url2.host !== ""; - } catch (err) { - return false; - } - } - function isParsableNode(node) { - let isParsable = true; - node.walkDecls((decl2) => { - if (!isParsableCssValue(decl2.prop, decl2.value)) { - isParsable = false; - return false; - } - }); - return isParsable; - } - function isParsableCssValue(property, value2) { - if (looksLikeUri(`${property}:${value2}`)) { - return false; - } - try { - postcss_default.parse(`a{${property}:${value2}}`).toResult(); - return true; - } catch (err) { - return false; - } - } - function extractArbitraryProperty(classCandidate, context) { - let [, property, value2] = classCandidate.match(/^\[([a-zA-Z0-9-_]+):(\S+)\]$/) ?? []; - if (value2 === void 0) { - return null; - } - if (!isValidPropName(property)) { - return null; - } - if (!isSyntacticallyValidPropertyValue(value2)) { - return null; - } - let normalized = normalize(value2, { property }); - if (!isParsableCssValue(property, normalized)) { - return null; - } - let sort = context.offsets.arbitraryProperty(); - return [ - [ - { sort, layer: "utilities" }, - () => ({ - [asClass(classCandidate)]: { - [property]: normalized - } - }) - ] - ]; - } - function* resolveMatchedPlugins(classCandidate, context) { - if (context.candidateRuleMap.has(classCandidate)) { - yield [context.candidateRuleMap.get(classCandidate), "DEFAULT"]; - } - yield* function* (arbitraryPropertyRule) { - if (arbitraryPropertyRule !== null) { - yield [arbitraryPropertyRule, "DEFAULT"]; - } - }(extractArbitraryProperty(classCandidate, context)); - let candidatePrefix = classCandidate; - let negative = false; - const twConfigPrefix = context.tailwindConfig.prefix; - const twConfigPrefixLen = twConfigPrefix.length; - const hasMatchingPrefix = candidatePrefix.startsWith(twConfigPrefix) || candidatePrefix.startsWith(`-${twConfigPrefix}`); - if (candidatePrefix[twConfigPrefixLen] === "-" && hasMatchingPrefix) { - negative = true; - candidatePrefix = twConfigPrefix + candidatePrefix.slice(twConfigPrefixLen + 1); - } - if (negative && context.candidateRuleMap.has(candidatePrefix)) { - yield [context.candidateRuleMap.get(candidatePrefix), "-DEFAULT"]; - } - for (let [prefix3, modifier] of candidatePermutations(candidatePrefix)) { - if (context.candidateRuleMap.has(prefix3)) { - yield [context.candidateRuleMap.get(prefix3), negative ? `-${modifier}` : modifier]; - } - } - } - function splitWithSeparator(input, separator) { - if (input === NOT_ON_DEMAND) { - return [NOT_ON_DEMAND]; - } - return splitAtTopLevelOnly(input, separator); - } - function* recordCandidates(matches, classCandidate) { - for (const match of matches) { - match[1].raws.tailwind = { - ...match[1].raws.tailwind, - classCandidate, - preserveSource: match[0].options?.preserveSource ?? false - }; - yield match; - } - } - function* resolveMatches(candidate, context) { - let separator = context.tailwindConfig.separator; - let [classCandidate, ...variants] = splitWithSeparator(candidate, separator).reverse(); - let important = false; - if (classCandidate.startsWith("!")) { - important = true; - classCandidate = classCandidate.slice(1); - } - for (let matchedPlugins of resolveMatchedPlugins(classCandidate, context)) { - let matches = []; - let typesByMatches = /* @__PURE__ */ new Map(); - let [plugins, modifier] = matchedPlugins; - let isOnlyPlugin = plugins.length === 1; - for (let [sort, plugin2] of plugins) { - let matchesPerPlugin = []; - if (typeof plugin2 === "function") { - for (let ruleSet of [].concat(plugin2(modifier, { isOnlyPlugin }))) { - let [rules2, options] = parseRules(ruleSet, context.postCssNodeCache); - for (let rule2 of rules2) { - matchesPerPlugin.push([{ ...sort, options: { ...sort.options, ...options } }, rule2]); - } - } - } else if (modifier === "DEFAULT" || modifier === "-DEFAULT") { - let ruleSet = plugin2; - let [rules2, options] = parseRules(ruleSet, context.postCssNodeCache); - for (let rule2 of rules2) { - matchesPerPlugin.push([{ ...sort, options: { ...sort.options, ...options } }, rule2]); - } - } - if (matchesPerPlugin.length > 0) { - let matchingTypes = Array.from( - getMatchingTypes( - sort.options?.types ?? [], - modifier, - sort.options ?? {}, - context.tailwindConfig - ) - ).map(([_, type]) => type); - if (matchingTypes.length > 0) { - typesByMatches.set(matchesPerPlugin, matchingTypes); - } - matches.push(matchesPerPlugin); - } - } - if (isArbitraryValue2(modifier)) { - if (matches.length > 1) { - let findFallback = function(matches2) { - if (matches2.length === 1) { - return matches2[0]; - } - return matches2.find((rules2) => { - let matchingTypes = typesByMatches.get(rules2); - return rules2.some(([{ options }, rule2]) => { - if (!isParsableNode(rule2)) { - return false; - } - return options.types.some( - ({ type, preferOnConflict }) => matchingTypes.includes(type) && preferOnConflict - ); - }); - }); - }; - let [withAny, withoutAny] = matches.reduce( - (group, plugin2) => { - let hasAnyType = plugin2.some( - ([{ options }]) => options.types.some(({ type }) => type === "any") - ); - if (hasAnyType) { - group[0].push(plugin2); - } else { - group[1].push(plugin2); - } - return group; - }, - [[], []] - ); - let fallback = findFallback(withoutAny) ?? findFallback(withAny); - if (fallback) { - matches = [fallback]; - } else { - let typesPerPlugin = matches.map( - (match) => /* @__PURE__ */ new Set([...typesByMatches.get(match) ?? []]) - ); - for (let pluginTypes of typesPerPlugin) { - for (let type of pluginTypes) { - let removeFromOwnGroup = false; - for (let otherGroup of typesPerPlugin) { - if (pluginTypes === otherGroup) - continue; - if (otherGroup.has(type)) { - otherGroup.delete(type); - removeFromOwnGroup = true; - } - } - if (removeFromOwnGroup) - pluginTypes.delete(type); - } - } - let messages = []; - for (let [idx, group] of typesPerPlugin.entries()) { - for (let type of group) { - let rules2 = matches[idx].map(([, rule2]) => rule2).flat().map( - (rule2) => rule2.toString().split("\n").slice(1, -1).map((line) => line.trim()).map((x) => ` ${x}`).join("\n") - ).join("\n\n"); - messages.push( - ` Use \`${candidate.replace("[", `[${type}:`)}\` for \`${rules2.trim()}\`` - ); - break; - } - } - log_default.warn([ - `The class \`${candidate}\` is ambiguous and matches multiple utilities.`, - ...messages, - `If this is content and not a class, replace it with \`${candidate.replace("[", "[").replace("]", "]")}\` to silence this warning.` - ]); - continue; - } - } - matches = matches.map((list22) => list22.filter((match) => isParsableNode(match[1]))); - } - matches = matches.flat(); - matches = Array.from(recordCandidates(matches, classCandidate)); - matches = applyPrefix(matches, context); - if (important) { - matches = applyImportant(matches, classCandidate); - } - for (let variant of variants) { - matches = applyVariant(variant, matches, context); - } - for (let match of matches) { - match[1].raws.tailwind = { ...match[1].raws.tailwind, candidate }; - match = applyFinalFormat(match, { context, candidate }); - if (match === null) { - continue; - } - yield match; - } - } - } - function applyFinalFormat(match, { context, candidate }) { - if (!match[0].collectedFormats) { - return match; - } - let isValid = true; - let finalFormat; - try { - finalFormat = formatVariantSelector(match[0].collectedFormats, { - context, - candidate - }); - } catch { - return null; - } - let container = postcss_default.root({ nodes: [match[1].clone()] }); - container.walkRules((rule2) => { - if (inKeyframes(rule2)) { - return; - } - try { - let selector = finalizeSelector(rule2.selector, finalFormat, { - candidate, - context - }); - if (selector === null) { - rule2.remove(); - return; - } - rule2.selector = selector; - } catch { - isValid = false; - return false; - } - }); - if (!isValid) { - return null; - } - if (container.nodes.length === 0) { - return null; - } - match[1] = container.nodes[0]; - return match; - } - function inKeyframes(rule2) { - return rule2.parent && rule2.parent.type === "atrule" && rule2.parent.name === "keyframes"; - } - function getImportantStrategy(important) { - if (important === true) { - return (rule2) => { - if (inKeyframes(rule2)) { - return; - } - rule2.walkDecls((d) => { - if (d.parent.type === "rule" && !inKeyframes(d.parent)) { - d.important = true; - } - }); - }; - } - if (typeof important === "string") { - return (rule2) => { - if (inKeyframes(rule2)) { - return; - } - rule2.selectors = rule2.selectors.map((selector) => { - return applyImportantSelector(selector, important); - }); - }; - } - } - function generateRules(candidates, context, isSorting = false) { - let allRules = []; - let strategy = getImportantStrategy(context.tailwindConfig.important); - for (let candidate of candidates) { - if (context.notClassCache.has(candidate)) { - continue; - } - if (context.candidateRuleCache.has(candidate)) { - allRules = allRules.concat(Array.from(context.candidateRuleCache.get(candidate))); - continue; - } - let matches = Array.from(resolveMatches(candidate, context)); - if (matches.length === 0) { - context.notClassCache.add(candidate); - continue; - } - context.classCache.set(candidate, matches); - let rules2 = context.candidateRuleCache.get(candidate) ?? /* @__PURE__ */ new Set(); - context.candidateRuleCache.set(candidate, rules2); - for (const match of matches) { - let [{ sort, options }, rule2] = match; - if (options.respectImportant && strategy) { - let container = postcss_default.root({ nodes: [rule2.clone()] }); - container.walkRules(strategy); - rule2 = container.nodes[0]; - } - let newEntry = [sort, isSorting ? rule2.clone() : rule2]; - rules2.add(newEntry); - context.ruleCache.add(newEntry); - allRules.push(newEntry); - } - } - return allRules; - } - function isArbitraryValue2(input) { - return input.startsWith("[") && input.endsWith("]"); - } - function cloneNodes(nodes, source = void 0, raws = void 0) { - return nodes.map((node) => { - let cloned = node.clone(); - if (raws !== void 0) { - cloned.raws.tailwind = { - ...cloned.raws.tailwind, - ...raws - }; - } - if (source !== void 0) { - traverse(cloned, (node2) => { - let shouldPreserveSource = node2.raws.tailwind?.preserveSource === true && node2.source; - if (shouldPreserveSource) { - return false; - } - node2.source = source; - }); - } - return cloned; - }); - } - function traverse(node, onNode) { - if (onNode(node) !== false) { - node.each?.((child) => traverse(child, onNode)); - } - } - var REGEX_SPECIAL = /[\\^$.*+?()[\]{}|]/g; - var REGEX_HAS_SPECIAL = RegExp(REGEX_SPECIAL.source); - function toSource(source) { - source = Array.isArray(source) ? source : [source]; - source = source.map((item) => item instanceof RegExp ? item.source : item); - return source.join(""); - } - function pattern(source) { - return new RegExp(toSource(source), "g"); - } - function any(sources) { - return `(?:${sources.map(toSource).join("|")})`; - } - function optional(source) { - return `(?:${toSource(source)})?`; - } - function escape(string) { - return string && REGEX_HAS_SPECIAL.test(string) ? string.replace(REGEX_SPECIAL, "\\$&") : string || ""; - } - function defaultExtractor(context) { - let patterns = Array.from(buildRegExps(context)); - return (content) => { - let results = []; - for (let pattern2 of patterns) { - for (let result of content.match(pattern2) ?? []) { - results.push(clipAtBalancedParens(result)); - } - } - return results; - }; - } - function* buildRegExps(context) { - let separator = context.tailwindConfig.separator; - let prefix3 = context.tailwindConfig.prefix !== "" ? optional(pattern([/-?/, escape(context.tailwindConfig.prefix)])) : ""; - let utility = any([ - /\[[^\s:'"`]+:[^\s\[\]]+\]/, - /\[[^\s:'"`\]]+:[^\s]+?\[[^\s]+\][^\s]+?\]/, - pattern([ - any([ - /-?(?:\w+)/, - /@(?:\w+)/ - ]), - optional( - any([ - pattern([ - any([ - /-(?:\w+-)*\['[^\s]+'\]/, - /-(?:\w+-)*\["[^\s]+"\]/, - /-(?:\w+-)*\[`[^\s]+`\]/, - /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/ - ]), - /(?![{([]])/, - /(?:\/[^\s'"`\\><$]*)?/ - ]), - pattern([ - any([ - /-(?:\w+-)*\['[^\s]+'\]/, - /-(?:\w+-)*\["[^\s]+"\]/, - /-(?:\w+-)*\[`[^\s]+`\]/, - /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/ - ]), - /(?![{([]])/, - /(?:\/[^\s'"`\\$]*)?/ - ]), - /[-\/][^\s'"`\\$={><]*/ - ]) - ) - ]) - ]); - let variantPatterns = [ - any([ - pattern([/@\[[^\s"'`]+\](\/[^\s"'`]+)?/, separator]), - pattern([/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/\w+/, separator]), - pattern([/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/, separator]), - pattern([/[^\s"'`\[\\]+/, separator]) - ]), - any([ - pattern([/([^\s"'`\[\\]+-)?\[[^\s`]+\]\/\w+/, separator]), - pattern([/([^\s"'`\[\\]+-)?\[[^\s`]+\]/, separator]), - pattern([/[^\s`\[\\]+/, separator]) - ]) - ]; - for (const variantPattern of variantPatterns) { - yield pattern([ - "((?=((", - variantPattern, - ")+))\\2)?", - /!?/, - prefix3, - utility - ]); - } - yield /[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g; - } - var SPECIALS = /([\[\]'"`])([^\[\]'"`])?/g; - var ALLOWED_CLASS_CHARACTERS = /[^"'`\s<>\]]+/; - function clipAtBalancedParens(input) { - if (!input.includes("-[")) { - return input; - } - let depth = 0; - let openStringTypes = []; - let matches = input.matchAll(SPECIALS); - matches = Array.from(matches).flatMap((match) => { - const [, ...groups] = match; - return groups.map( - (group, idx) => Object.assign([], match, { - index: match.index + idx, - 0: group - }) - ); - }); - for (let match of matches) { - let char = match[0]; - let inStringType = openStringTypes[openStringTypes.length - 1]; - if (char === inStringType) { - openStringTypes.pop(); - } else if (char === "'" || char === '"' || char === "`") { - openStringTypes.push(char); - } - if (inStringType) { - continue; - } else if (char === "[") { - depth++; - continue; - } else if (char === "]") { - depth--; - continue; - } - if (depth < 0) { - return input.substring(0, match.index - 1); - } - if (depth === 0 && !ALLOWED_CLASS_CHARACTERS.test(char)) { - return input.substring(0, match.index); - } - } - return input; - } - var env2 = env; - var builtInExtractors = { - DEFAULT: defaultExtractor - }; - var builtInTransformers = { - DEFAULT: (content) => content, - svelte: (content) => content.replace(/(?:^|\s)class:/g, " ") - }; - function getExtractor(context, fileExtension) { - let extractors = context.tailwindConfig.content.extract; - return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context); - } - function getTransformer(tailwindConfig2, fileExtension) { - let transformers = tailwindConfig2.content.transform; - return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT; - } - var extractorCache = /* @__PURE__ */ new WeakMap(); - function getClassCandidates(content, extractor, candidates, seen) { - if (!extractorCache.has(extractor)) { - extractorCache.set(extractor, new import_quick_lru.default({ maxSize: 25e3 })); - } - for (let line of content.split("\n")) { - line = line.trim(); - if (seen.has(line)) { - continue; - } - seen.add(line); - if (extractorCache.get(extractor).has(line)) { - for (let match of extractorCache.get(extractor).get(line)) { - candidates.add(match); - } - } else { - let extractorMatches = extractor(line).filter((s) => s !== "!*"); - let lineMatchesSet = new Set(extractorMatches); - for (let match of lineMatchesSet) { - candidates.add(match); - } - extractorCache.get(extractor).set(line, lineMatchesSet); - } - } - } - function buildStylesheet(rules2, context) { - let sortedRules = context.offsets.sort(rules2); - let returnValue = { - base: /* @__PURE__ */ new Set(), - defaults: /* @__PURE__ */ new Set(), - components: /* @__PURE__ */ new Set(), - utilities: /* @__PURE__ */ new Set(), - variants: /* @__PURE__ */ new Set() - }; - for (let [sort, rule2] of sortedRules) { - returnValue[sort.layer].add(rule2); - } - return returnValue; - } - function expandTailwindAtRules(context) { - return async (root2) => { - let layerNodes = { - base: null, - components: null, - utilities: null, - variants: null - }; - root2.walkAtRules((rule2) => { - if (rule2.name === "tailwind") { - if (Object.keys(layerNodes).includes(rule2.params)) { - layerNodes[rule2.params] = rule2; - } - } - }); - if (Object.values(layerNodes).every((n) => n === null)) { - return root2; - } - let candidates = /* @__PURE__ */ new Set([...context.candidates ?? [], NOT_ON_DEMAND]); - let seen = /* @__PURE__ */ new Set(); - env2.DEBUG && console.time("Reading changed files"); - if (false) { - for (let candidate of null.parseCandidateStringsFromFiles( - context.changedContent - )) { - candidates.add(candidate); - } - } else { - let regexParserContent = []; - for (let item of context.changedContent) { - let transformer = getTransformer(context.tailwindConfig, item.extension); - let extractor = getExtractor(context, item.extension); - regexParserContent.push([item, { transformer, extractor }]); - } - const BATCH_SIZE = 500; - for (let i = 0; i < regexParserContent.length; i += BATCH_SIZE) { - let batch = regexParserContent.slice(i, i + BATCH_SIZE); - await Promise.all( - batch.map(async ([{ file: file15, content }, { transformer, extractor }]) => { - content = file15 ? await fs_default.promises.readFile(file15, "utf8") : content; - getClassCandidates(transformer(content), extractor, candidates, seen); - }) - ); - } - } - env2.DEBUG && console.timeEnd("Reading changed files"); - let classCacheCount = context.classCache.size; - env2.DEBUG && console.time("Generate rules"); - env2.DEBUG && console.time("Sorting candidates"); - let sortedCandidates = false ? candidates : new Set( - [...candidates].sort((a, z) => { - if (a === z) - return 0; - if (a < z) - return -1; - return 1; - }) - ); - env2.DEBUG && console.timeEnd("Sorting candidates"); - generateRules(sortedCandidates, context); - env2.DEBUG && console.timeEnd("Generate rules"); - env2.DEBUG && console.time("Build stylesheet"); - if (context.stylesheetCache === null || context.classCache.size !== classCacheCount) { - context.stylesheetCache = buildStylesheet([...context.ruleCache], context); - } - env2.DEBUG && console.timeEnd("Build stylesheet"); - let { - defaults: defaultNodes, - base: baseNodes, - components: componentNodes, - utilities: utilityNodes, - variants: screenNodes - } = context.stylesheetCache; - if (layerNodes.base) { - layerNodes.base.before( - cloneNodes([...baseNodes, ...defaultNodes], layerNodes.base.source, { - layer: "base" - }) - ); - layerNodes.base.remove(); - } - if (layerNodes.components) { - layerNodes.components.before( - cloneNodes([...componentNodes], layerNodes.components.source, { - layer: "components" - }) - ); - layerNodes.components.remove(); - } - if (layerNodes.utilities) { - layerNodes.utilities.before( - cloneNodes([...utilityNodes], layerNodes.utilities.source, { - layer: "utilities" - }) - ); - layerNodes.utilities.remove(); - } - const variantNodes = Array.from(screenNodes).filter((node) => { - const parentLayer = node.raws.tailwind?.parentLayer; - if (parentLayer === "components") { - return layerNodes.components !== null; - } - if (parentLayer === "utilities") { - return layerNodes.utilities !== null; - } - return true; - }); - if (layerNodes.variants) { - layerNodes.variants.before( - cloneNodes(variantNodes, layerNodes.variants.source, { - layer: "variants" - }) - ); - layerNodes.variants.remove(); - } else if (variantNodes.length > 0) { - root2.append( - cloneNodes(variantNodes, root2.source, { - layer: "variants" - }) - ); - } - root2.source.end = root2.source.end ?? root2.source.start; - const hasUtilityVariants = variantNodes.some( - (node) => node.raws.tailwind?.parentLayer === "utilities" - ); - if (layerNodes.utilities && utilityNodes.size === 0 && !hasUtilityVariants) { - log_default.warn("content-problems", [ - "No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.", - "https://tailwindcss.com/docs/content-configuration" - ]); - } - if (env2.DEBUG) { - console.log("Potential classes: ", candidates.size); - console.log("Active contexts: ", contextSourcesMap.size); - } - context.changedContent = []; - root2.walkAtRules("layer", (rule2) => { - if (Object.keys(layerNodes).includes(rule2.params)) { - rule2.remove(); - } - }); - }; - } - function extractClasses(node) { - let groups = /* @__PURE__ */ new Map(); - let container = postcss_default.root({ nodes: [node.clone()] }); - container.walkRules((rule2) => { - (0, import_postcss_selector_parser7.default)((selectors) => { - selectors.walkClasses((classSelector) => { - let parentSelector = classSelector.parent.toString(); - let classes2 = groups.get(parentSelector); - if (!classes2) { - groups.set(parentSelector, classes2 = /* @__PURE__ */ new Set()); - } - classes2.add(classSelector.value); - }); - }).processSync(rule2.selector); - }); - let normalizedGroups = Array.from(groups.values(), (classes2) => Array.from(classes2)); - let classes = normalizedGroups.flat(); - return Object.assign(classes, { groups: normalizedGroups }); - } - var selectorExtractor = (0, import_postcss_selector_parser7.default)(); - function extractSelectors(ruleSelectors) { - return selectorExtractor.astSync(ruleSelectors); - } - function extractBaseCandidates(candidates, separator) { - let baseClasses = /* @__PURE__ */ new Set(); - for (let candidate of candidates) { - baseClasses.add(candidate.split(separator).pop()); - } - return Array.from(baseClasses); - } - function prefix2(context, selector) { - let prefix3 = context.tailwindConfig.prefix; - return typeof prefix3 === "function" ? prefix3(selector) : prefix3 + selector; - } - function* pathToRoot(node) { - yield node; - while (node.parent) { - yield node.parent; - node = node.parent; - } - } - function shallowClone(node, overrides = {}) { - let children2 = node.nodes; - node.nodes = []; - let tmp = node.clone(overrides); - node.nodes = children2; - return tmp; - } - function nestedClone(node) { - for (let parent of pathToRoot(node)) { - if (node === parent) { - continue; - } - if (parent.type === "root") { - break; - } - node = shallowClone(parent, { - nodes: [node] - }); - } - return node; - } - function buildLocalApplyCache(root2, context) { - let cache2 = /* @__PURE__ */ new Map(); - root2.walkRules((rule2) => { - for (let node of pathToRoot(rule2)) { - if (node.raws.tailwind?.layer !== void 0) { - return; - } - } - let container = nestedClone(rule2); - let sort = context.offsets.create("user"); - for (let className of extractClasses(rule2)) { - let list22 = cache2.get(className) || []; - cache2.set(className, list22); - list22.push([ - { - layer: "user", - sort, - important: false - }, - container - ]); - } - }); - return cache2; - } - function buildApplyCache(applyCandidates, context) { - for (let candidate of applyCandidates) { - if (context.notClassCache.has(candidate) || context.applyClassCache.has(candidate)) { - continue; - } - if (context.classCache.has(candidate)) { - context.applyClassCache.set( - candidate, - context.classCache.get(candidate).map(([meta, rule2]) => [meta, rule2.clone()]) - ); - continue; - } - let matches = Array.from(resolveMatches(candidate, context)); - if (matches.length === 0) { - context.notClassCache.add(candidate); - continue; - } - context.applyClassCache.set(candidate, matches); - } - return context.applyClassCache; - } - function lazyCache(buildCacheFn) { - let cache2 = null; - return { - get: (name) => { - cache2 = cache2 || buildCacheFn(); - return cache2.get(name); - }, - has: (name) => { - cache2 = cache2 || buildCacheFn(); - return cache2.has(name); - } - }; - } - function combineCaches(caches) { - return { - get: (name) => caches.flatMap((cache2) => cache2.get(name) || []), - has: (name) => caches.some((cache2) => cache2.has(name)) - }; - } - function extractApplyCandidates(params) { - let candidates = params.split(/[\s\t\n]+/g); - if (candidates[candidates.length - 1] === "!important") { - return [candidates.slice(0, -1), true]; - } - return [candidates, false]; - } - function processApply(root2, context, localCache) { - let applyCandidates = /* @__PURE__ */ new Set(); - let applies = []; - root2.walkAtRules("apply", (rule2) => { - let [candidates] = extractApplyCandidates(rule2.params); - for (let util of candidates) { - applyCandidates.add(util); - } - applies.push(rule2); - }); - if (applies.length === 0) { - return; - } - let applyClassCache = combineCaches([localCache, buildApplyCache(applyCandidates, context)]); - function replaceSelector(selector, utilitySelectors, candidate) { - let selectorList = extractSelectors(selector); - let utilitySelectorsList = extractSelectors(utilitySelectors); - let candidateList = extractSelectors(`.${escapeClassName(candidate)}`); - let candidateClass = candidateList.nodes[0].nodes[0]; - selectorList.each((sel) => { - let replaced = /* @__PURE__ */ new Set(); - utilitySelectorsList.each((utilitySelector) => { - let hasReplaced = false; - utilitySelector = utilitySelector.clone(); - utilitySelector.walkClasses((node) => { - if (node.value !== candidateClass.value) { - return; - } - if (hasReplaced) { - return; - } - node.replaceWith(...sel.nodes.map((node2) => node2.clone())); - replaced.add(utilitySelector); - hasReplaced = true; - }); - }); - for (let sel2 of replaced) { - let groups = [[]]; - for (let node of sel2.nodes) { - if (node.type === "combinator") { - groups.push(node); - groups.push([]); - } else { - let last = groups[groups.length - 1]; - last.push(node); - } - } - sel2.nodes = []; - for (let group of groups) { - if (Array.isArray(group)) { - group.sort((a, b) => { - if (a.type === "tag" && b.type === "class") { - return -1; - } else if (a.type === "class" && b.type === "tag") { - return 1; - } else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) { - return -1; - } else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") { - return 1; - } - return 0; - }); - } - sel2.nodes = sel2.nodes.concat(group); - } - } - sel.replaceWith(...replaced); - }); - return selectorList.toString(); - } - let perParentApplies = /* @__PURE__ */ new Map(); - for (let apply of applies) { - let [candidates] = perParentApplies.get(apply.parent) || [[], apply.source]; - perParentApplies.set(apply.parent, [candidates, apply.source]); - let [applyCandidates2, important] = extractApplyCandidates(apply.params); - if (apply.parent.type === "atrule") { - if (apply.parent.name === "screen") { - let screenType = apply.parent.params; - throw apply.error( - `@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates2.map((c) => `${screenType}:${c}`).join(" ")} instead.` - ); - } - throw apply.error( - `@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.` - ); - } - for (let applyCandidate of applyCandidates2) { - if ([prefix2(context, "group"), prefix2(context, "peer")].includes(applyCandidate)) { - throw apply.error(`@apply should not be used with the '${applyCandidate}' utility`); - } - if (!applyClassCache.has(applyCandidate)) { - throw apply.error( - `The \`${applyCandidate}\` class does not exist. If \`${applyCandidate}\` is a custom class, make sure it is defined within a \`@layer\` directive.` - ); - } - let rules2 = applyClassCache.get(applyCandidate); - candidates.push([applyCandidate, important, rules2]); - } - } - for (let [parent, [candidates, atApplySource]] of perParentApplies) { - let siblings = []; - for (let [applyCandidate, important, rules2] of candidates) { - let potentialApplyCandidates = [ - applyCandidate, - ...extractBaseCandidates([applyCandidate], context.tailwindConfig.separator) - ]; - for (let [meta, node] of rules2) { - let parentClasses = extractClasses(parent); - let nodeClasses = extractClasses(node); - nodeClasses = nodeClasses.groups.filter( - (classList) => classList.some((className) => potentialApplyCandidates.includes(className)) - ).flat(); - nodeClasses = nodeClasses.concat( - extractBaseCandidates(nodeClasses, context.tailwindConfig.separator) - ); - let intersects = parentClasses.some((selector) => nodeClasses.includes(selector)); - if (intersects) { - throw node.error( - `You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.` - ); - } - let root22 = postcss_default.root({ nodes: [node.clone()] }); - root22.walk((node2) => { - node2.source = atApplySource; - }); - let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes"; - if (canRewriteSelector) { - root22.walkRules((rule2) => { - if (!extractClasses(rule2).some((candidate) => candidate === applyCandidate)) { - rule2.remove(); - return; - } - let importantSelector = typeof context.tailwindConfig.important === "string" ? context.tailwindConfig.important : null; - let isGenerated = parent.raws.tailwind !== void 0; - let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector; - if (parentSelector === "") { - parentSelector = parent.selector; - } - rule2.selector = replaceSelector(parentSelector, rule2.selector, applyCandidate); - if (importantSelector && parentSelector !== parent.selector) { - rule2.selector = applyImportantSelector(rule2.selector, importantSelector); - } - rule2.walkDecls((d) => { - d.important = meta.important || important; - }); - let selector = (0, import_postcss_selector_parser7.default)().astSync(rule2.selector); - selector.each((sel) => movePseudos(sel)); - rule2.selector = selector.toString(); - }); - } - if (!root22.nodes[0]) { - continue; - } - siblings.push([meta.sort, root22.nodes[0]]); - } - } - let nodes = context.offsets.sort(siblings).map((s) => s[1]); - parent.after(nodes); - } - for (let apply of applies) { - if (apply.parent.nodes.length > 1) { - apply.remove(); - } else { - apply.parent.remove(); - } - } - processApply(root2, context, localCache); - } - function expandApplyAtRules(context) { - return (root2) => { - let localCache = lazyCache(() => buildLocalApplyCache(root2, context)); - processApply(root2, context, localCache); - }; - } - var import_value_parser = __toESM2(require_value_parser()); - function isObject5(input) { - return typeof input === "object" && input !== null; - } - function findClosestExistingPath(theme2, path) { - let parts = toPath(path); - do { - parts.pop(); - if ((0, import_dlv2.default)(theme2, parts) !== void 0) - break; - } while (parts.length); - return parts.length ? parts : void 0; - } - function pathToString(path) { - if (typeof path === "string") - return path; - return path.reduce((acc, cur, i) => { - if (cur.includes(".")) - return `${acc}[${cur}]`; - return i === 0 ? cur : `${acc}.${cur}`; - }, ""); - } - function list2(items) { - return items.map((key) => `'${key}'`).join(", "); - } - function listKeys(obj) { - return list2(Object.keys(obj)); - } - function validatePath(config5, path, defaultValue, themeOpts = {}) { - const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, ""); - const pathSegments = Array.isArray(path) ? path : toPath(pathString); - const value2 = (0, import_dlv2.default)(config5.theme, pathSegments, defaultValue); - if (value2 === void 0) { - let error = `'${pathString}' does not exist in your theme config.`; - const parentSegments = pathSegments.slice(0, -1); - const parentValue = (0, import_dlv2.default)(config5.theme, parentSegments); - if (isObject5(parentValue)) { - const validKeys = Object.keys(parentValue).filter( - (key) => validatePath(config5, [...parentSegments, key]).isValid - ); - const suggestion = (0, import_didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys); - if (suggestion) { - error += ` Did you mean '${pathToString([...parentSegments, suggestion])}'?`; - } else if (validKeys.length > 0) { - error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list2( - validKeys - )}`; - } - } else { - const closestPath = findClosestExistingPath(config5.theme, pathString); - if (closestPath) { - const closestValue = (0, import_dlv2.default)(config5.theme, closestPath); - if (isObject5(closestValue)) { - error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys( - closestValue - )}`; - } else { - error += ` '${pathToString(closestPath)}' is not an object.`; - } - } else { - error += ` Your theme has the following top-level keys: ${listKeys(config5.theme)}`; - } - } - return { - isValid: false, - error - }; - } - if (!(typeof value2 === "string" || typeof value2 === "number" || typeof value2 === "function" || value2 instanceof String || value2 instanceof Number || Array.isArray(value2))) { - let error = `'${pathString}' was found but does not resolve to a string.`; - if (isObject5(value2)) { - let validKeys = Object.keys(value2).filter( - (key) => validatePath(config5, [...pathSegments, key]).isValid - ); - if (validKeys.length) { - error += ` Did you mean something like '${pathToString([...pathSegments, validKeys[0]])}'?`; - } - } - return { - isValid: false, - error - }; - } - const [themeSection] = pathSegments; - return { - isValid: true, - value: transformThemeValue(themeSection)(value2, themeOpts) - }; - } - function extractArgs(node, vNodes, functions) { - vNodes = vNodes.map((vNode) => resolveVNode(node, vNode, functions)); - let args = [""]; - for (let vNode of vNodes) { - if (vNode.type === "div" && vNode.value === ",") { - args.push(""); - } else { - args[args.length - 1] += import_value_parser.default.stringify(vNode); - } - } - return args; - } - function resolveVNode(node, vNode, functions) { - if (vNode.type === "function" && functions[vNode.value] !== void 0) { - let args = extractArgs(node, vNode.nodes, functions); - vNode.type = "word"; - vNode.value = functions[vNode.value](node, ...args); - } - return vNode; - } - function resolveFunctions(node, input, functions) { - let hasAnyFn = Object.keys(functions).some((fn) => input.includes(`${fn}(`)); - if (!hasAnyFn) - return input; - return (0, import_value_parser.default)(input).walk((vNode) => { - resolveVNode(node, vNode, functions); - }).toString(); - } - var nodeTypePropertyMap = { - atrule: "params", - decl: "value" - }; - function* toPaths(path) { - path = path.replace(/^['"]+|['"]+$/g, ""); - let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/); - let alpha = void 0; - yield [path, void 0]; - if (matches) { - path = matches[1]; - alpha = matches[2]; - yield [path, alpha]; - } - } - function resolvePath(config5, path, defaultValue) { - const results = Array.from(toPaths(path)).map(([path2, alpha]) => { - return Object.assign(validatePath(config5, path2, defaultValue, { opacityValue: alpha }), { - resolvedPath: path2, - alpha - }); - }); - return results.find((result) => result.isValid) ?? results[0]; - } - function evaluateTailwindFunctions_default(context) { - let config5 = context.tailwindConfig; - let functions = { - theme: (node, path, ...defaultValue) => { - let { isValid, value: value2, error, alpha } = resolvePath( - config5, - path, - defaultValue.length ? defaultValue : void 0 - ); - if (!isValid) { - let parentNode = node.parent; - let candidate = parentNode?.raws.tailwind?.candidate; - if (parentNode && candidate !== void 0) { - context.markInvalidUtilityNode(parentNode); - parentNode.remove(); - log_default.warn("invalid-theme-key-in-class", [ - `The utility \`${candidate}\` contains an invalid theme value and was not generated.` - ]); - return; - } - throw node.error(error); - } - let maybeColor = parseColorFormat(value2); - let isColorFunction = maybeColor !== void 0 && typeof maybeColor === "function"; - if (alpha !== void 0 || isColorFunction) { - if (alpha === void 0) { - alpha = 1; - } - value2 = withAlphaValue(maybeColor, alpha, maybeColor); - } - return value2; - }, - screen: (node, screen) => { - screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, ""); - let screens = normalizeScreens(config5.theme.screens); - let screenDefinition = screens.find(({ name }) => name === screen); - if (!screenDefinition) { - throw node.error(`The '${screen}' screen does not exist in your theme.`); - } - return buildMediaQuery(screenDefinition); - } - }; - return (root2) => { - root2.walk((node) => { - let property = nodeTypePropertyMap[node.type]; - if (property === void 0) { - return; - } - node[property] = resolveFunctions(node, node[property], functions); - }); - }; - } - function substituteScreenAtRules_default({ tailwindConfig: { theme: theme2 } }) { - return function(css) { - css.walkAtRules("screen", (atRule2) => { - let screen = atRule2.params; - let screens = normalizeScreens(theme2.screens); - let screenDefinition = screens.find(({ name }) => name === screen); - if (!screenDefinition) { - throw atRule2.error(`No \`${screen}\` screen found.`); - } - atRule2.name = "media"; - atRule2.params = buildMediaQuery(screenDefinition); - }); - }; - } - var getNode = { - id(node) { - return import_postcss_selector_parser8.default.attribute({ - attribute: "id", - operator: "=", - value: node.value, - quoteMark: '"' - }); - } - }; - function minimumImpactSelector(nodes) { - let rest = nodes.filter((node2) => { - if (node2.type !== "pseudo") - return true; - if (node2.nodes.length > 0) - return true; - return node2.value.startsWith("::") || [":before", ":after", ":first-line", ":first-letter"].includes(node2.value); - }).reverse(); - let searchFor = /* @__PURE__ */ new Set(["tag", "class", "id", "attribute"]); - let splitPointIdx = rest.findIndex((n) => searchFor.has(n.type)); - if (splitPointIdx === -1) - return rest.reverse().join("").trim(); - let node = rest[splitPointIdx]; - let bestNode = getNode[node.type] ? getNode[node.type](node) : node; - rest = rest.slice(0, splitPointIdx); - let combinatorIdx = rest.findIndex((n) => n.type === "combinator" && n.value === ">"); - if (combinatorIdx !== -1) { - rest.splice(0, combinatorIdx); - rest.unshift(import_postcss_selector_parser8.default.universal()); - } - return [bestNode, ...rest.reverse()].join("").trim(); - } - var elementSelectorParser = (0, import_postcss_selector_parser8.default)((selectors) => { - return selectors.map((s) => { - let nodes = s.split((n) => n.type === "combinator" && n.value === " ").pop(); - return minimumImpactSelector(nodes); - }); - }); - var cache = /* @__PURE__ */ new Map(); - function extractElementSelector(selector) { - if (!cache.has(selector)) { - cache.set(selector, elementSelectorParser.transformSync(selector)); - } - return cache.get(selector); - } - function resolveDefaultsAtRules({ tailwindConfig: tailwindConfig2 }) { - return (root2) => { - let variableNodeMap = /* @__PURE__ */ new Map(); - let universals = /* @__PURE__ */ new Set(); - root2.walkAtRules("defaults", (rule2) => { - if (rule2.nodes && rule2.nodes.length > 0) { - universals.add(rule2); - return; - } - let variable = rule2.params; - if (!variableNodeMap.has(variable)) { - variableNodeMap.set(variable, /* @__PURE__ */ new Set()); - } - variableNodeMap.get(variable).add(rule2.parent); - rule2.remove(); - }); - if (flagEnabled(tailwindConfig2, "optimizeUniversalDefaults")) { - for (let universal of universals) { - let selectorGroups = /* @__PURE__ */ new Map(); - let rules2 = variableNodeMap.get(universal.params) ?? []; - for (let rule2 of rules2) { - for (let selector of extractElementSelector(rule2.selector)) { - let selectorGroupName = selector.includes(":-") || selector.includes("::-") ? selector : "__DEFAULT__"; - let selectors = selectorGroups.get(selectorGroupName) ?? /* @__PURE__ */ new Set(); - selectorGroups.set(selectorGroupName, selectors); - selectors.add(selector); - } - } - if (flagEnabled(tailwindConfig2, "optimizeUniversalDefaults")) { - if (selectorGroups.size === 0) { - universal.remove(); - continue; - } - for (let [, selectors] of selectorGroups) { - let universalRule = postcss_default.rule({ - source: universal.source - }); - universalRule.selectors = [...selectors]; - universalRule.append(universal.nodes.map((node) => node.clone())); - universal.before(universalRule); - } - } - universal.remove(); - } - } else if (universals.size) { - let universalRule = postcss_default.rule({ - selectors: ["*", "::before", "::after"] - }); - for (let universal of universals) { - universalRule.append(universal.nodes); - if (!universalRule.parent) { - universal.before(universalRule); - } - if (!universalRule.source) { - universalRule.source = universal.source; - } - universal.remove(); - } - let backdropRule = universalRule.clone({ - selectors: ["::backdrop"] - }); - universalRule.after(backdropRule); - } - }; - } - var comparisonMap = { - atrule: ["name", "params"], - rule: ["selector"] - }; - var types = new Set(Object.keys(comparisonMap)); - function collapseAdjacentRules() { - function collapseRulesIn(root2) { - let currentRule = null; - root2.each((node) => { - if (!types.has(node.type)) { - currentRule = null; - return; - } - if (currentRule === null) { - currentRule = node; - return; - } - let properties = comparisonMap[node.type]; - if (node.type === "atrule" && node.name === "font-face") { - currentRule = node; - } else if (properties.every( - (property) => (node[property] ?? "").replace(/\s+/g, " ") === (currentRule[property] ?? "").replace(/\s+/g, " ") - )) { - if (node.nodes) { - currentRule.append(node.nodes); - } - node.remove(); - } else { - currentRule = node; - } - }); - root2.each((node) => { - if (node.type === "atrule") { - collapseRulesIn(node); - } - }); - } - return (root2) => { - collapseRulesIn(root2); - }; - } - function collapseDuplicateDeclarations() { - return (root2) => { - root2.walkRules((node) => { - let seen = /* @__PURE__ */ new Map(); - let droppable = /* @__PURE__ */ new Set([]); - let byProperty = /* @__PURE__ */ new Map(); - node.walkDecls((decl2) => { - if (decl2.parent !== node) { - return; - } - if (seen.has(decl2.prop)) { - if (seen.get(decl2.prop).value === decl2.value) { - droppable.add(seen.get(decl2.prop)); - seen.set(decl2.prop, decl2); - return; - } - if (!byProperty.has(decl2.prop)) { - byProperty.set(decl2.prop, /* @__PURE__ */ new Set()); - } - byProperty.get(decl2.prop).add(seen.get(decl2.prop)); - byProperty.get(decl2.prop).add(decl2); - } - seen.set(decl2.prop, decl2); - }); - for (let decl2 of droppable) { - decl2.remove(); - } - for (let declarations of byProperty.values()) { - let byUnit = /* @__PURE__ */ new Map(); - for (let decl2 of declarations) { - let unit = resolveUnit(decl2.value); - if (unit === null) { - continue; - } - if (!byUnit.has(unit)) { - byUnit.set(unit, /* @__PURE__ */ new Set()); - } - byUnit.get(unit).add(decl2); - } - for (let declarations2 of byUnit.values()) { - let removableDeclarations = Array.from(declarations2).slice(0, -1); - for (let decl2 of removableDeclarations) { - decl2.remove(); - } - } - } - }); - }; - } - var UNITLESS_NUMBER = Symbol("unitless-number"); - function resolveUnit(input) { - let result = /^-?\d*.?\d+([\w%]+)?$/g.exec(input); - if (result) { - return result[1] ?? UNITLESS_NUMBER; - } - return null; - } - function partitionRules(root2) { - if (!root2.walkAtRules) - return; - let applyParents = /* @__PURE__ */ new Set(); - root2.walkAtRules("apply", (rule2) => { - applyParents.add(rule2.parent); - }); - if (applyParents.size === 0) { - return; - } - for (let rule2 of applyParents) { - let nodeGroups = []; - let lastGroup = []; - for (let node of rule2.nodes) { - if (node.type === "atrule" && node.name === "apply") { - if (lastGroup.length > 0) { - nodeGroups.push(lastGroup); - lastGroup = []; - } - nodeGroups.push([node]); - } else { - lastGroup.push(node); - } - } - if (lastGroup.length > 0) { - nodeGroups.push(lastGroup); - } - if (nodeGroups.length === 1) { - continue; - } - for (let group of [...nodeGroups].reverse()) { - let clone = rule2.clone({ nodes: [] }); - clone.append(group); - rule2.after(clone); - } - rule2.remove(); - } - } - function expandApplyAtRules2() { - return (root2) => { - partitionRules(root2); - }; - } - function isRoot(node) { - return node.type === "root"; - } - function isAtLayer(node) { - return node.type === "atrule" && node.name === "layer"; - } - function detectNesting_default(_context) { - return (root2, result) => { - let found = false; - root2.walkAtRules("tailwind", (node) => { - if (found) - return false; - if (node.parent && !(isRoot(node.parent) || isAtLayer(node.parent))) { - found = true; - node.warn( - result, - [ - "Nested @tailwind rules were detected, but are not supported.", - "Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix", - "Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy" - ].join("\n") - ); - return false; - } - }); - root2.walkRules((rule2) => { - if (found) - return false; - rule2.walkRules((nestedRule) => { - found = true; - nestedRule.warn( - result, - [ - "Nested CSS was detected, but CSS nesting has not been configured correctly.", - "Please enable a CSS nesting plugin *before* Tailwind in your configuration.", - "See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting" - ].join("\n") - ); - return false; - }); - }); - }; - } - function processTailwindFeatures(setupContext) { - return async function(root2, result) { - let { tailwindDirectives, applyDirectives } = normalizeTailwindDirectives(root2); - detectNesting_default()(root2, result); - expandApplyAtRules2()(root2, result); - let context = setupContext({ - tailwindDirectives, - applyDirectives, - registerDependency(dependency) { - result.messages.push({ - plugin: "tailwindcss", - parent: result.opts.from, - ...dependency - }); - }, - createContext(tailwindConfig2, changedContent) { - return createContext(tailwindConfig2, changedContent, root2); - } - })(root2, result); - if (context.tailwindConfig.separator === "-") { - throw new Error( - "The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead." - ); - } - issueFlagNotices(context.tailwindConfig); - await expandTailwindAtRules(context)(root2, result); - expandApplyAtRules2()(root2, result); - expandApplyAtRules(context)(root2, result); - evaluateTailwindFunctions_default(context)(root2, result); - substituteScreenAtRules_default(context)(root2, result); - resolveDefaultsAtRules(context)(root2, result); - collapseAdjacentRules(context)(root2, result); - collapseDuplicateDeclarations(context)(root2, result); - }; - } - var corePluginList_default = ["preflight", "container", "accessibility", "pointerEvents", "visibility", "position", "inset", "isolation", "zIndex", "order", "gridColumn", "gridColumnStart", "gridColumnEnd", "gridRow", "gridRowStart", "gridRowEnd", "float", "clear", "margin", "boxSizing", "lineClamp", "display", "aspectRatio", "size", "height", "maxHeight", "minHeight", "width", "minWidth", "maxWidth", "flex", "flexShrink", "flexGrow", "flexBasis", "tableLayout", "captionSide", "borderCollapse", "borderSpacing", "transformOrigin", "translate", "rotate", "skew", "scale", "transform", "animation", "cursor", "touchAction", "userSelect", "resize", "scrollSnapType", "scrollSnapAlign", "scrollSnapStop", "scrollMargin", "scrollPadding", "listStylePosition", "listStyleType", "listStyleImage", "appearance", "columns", "breakBefore", "breakInside", "breakAfter", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridTemplateColumns", "gridTemplateRows", "flexDirection", "flexWrap", "placeContent", "placeItems", "alignContent", "alignItems", "justifyContent", "justifyItems", "gap", "space", "divideWidth", "divideStyle", "divideColor", "divideOpacity", "placeSelf", "alignSelf", "justifySelf", "overflow", "overscrollBehavior", "scrollBehavior", "textOverflow", "hyphens", "whitespace", "textWrap", "wordBreak", "borderRadius", "borderWidth", "borderStyle", "borderColor", "borderOpacity", "backgroundColor", "backgroundOpacity", "backgroundImage", "gradientColorStops", "boxDecorationBreak", "backgroundSize", "backgroundAttachment", "backgroundClip", "backgroundPosition", "backgroundRepeat", "backgroundOrigin", "fill", "stroke", "strokeWidth", "objectFit", "objectPosition", "padding", "textAlign", "textIndent", "verticalAlign", "fontFamily", "fontSize", "fontWeight", "textTransform", "fontStyle", "fontVariantNumeric", "lineHeight", "letterSpacing", "textColor", "textOpacity", "textDecoration", "textDecorationColor", "textDecorationStyle", "textDecorationThickness", "textUnderlineOffset", "fontSmoothing", "placeholderColor", "placeholderOpacity", "caretColor", "accentColor", "opacity", "backgroundBlendMode", "mixBlendMode", "boxShadow", "boxShadowColor", "outlineStyle", "outlineWidth", "outlineOffset", "outlineColor", "ringWidth", "ringColor", "ringOpacity", "ringOffsetWidth", "ringOffsetColor", "blur", "brightness", "contrast", "dropShadow", "grayscale", "hueRotate", "invert", "saturate", "sepia", "filter", "backdropBlur", "backdropBrightness", "backdropContrast", "backdropGrayscale", "backdropHueRotate", "backdropInvert", "backdropOpacity", "backdropSaturate", "backdropSepia", "backdropFilter", "transitionProperty", "transitionDelay", "transitionDuration", "transitionTimingFunction", "willChange", "content", "forcedColorAdjust"]; - function configurePlugins_default(pluginConfig, plugins) { - if (pluginConfig === void 0) { - return plugins; - } - const pluginNames = Array.isArray(pluginConfig) ? pluginConfig : [ - ...new Set( - plugins.filter((pluginName) => { - return pluginConfig !== false && pluginConfig[pluginName] !== false; - }).concat( - Object.keys(pluginConfig).filter((pluginName) => { - return pluginConfig[pluginName] !== false; - }) - ) - ) - ]; - return pluginNames; - } - function warn({ version: version2, from, to }) { - log_default.warn(`${from}-color-renamed`, [ - `As of Tailwind CSS ${version2}, \`${from}\` has been renamed to \`${to}\`.`, - "Update your configuration file to silence this warning." - ]); - } - var colors_default = { - inherit: "inherit", - current: "currentColor", - transparent: "transparent", - black: "#000", - white: "#fff", - slate: { - 50: "#f8fafc", - 100: "#f1f5f9", - 200: "#e2e8f0", - 300: "#cbd5e1", - 400: "#94a3b8", - 500: "#64748b", - 600: "#475569", - 700: "#334155", - 800: "#1e293b", - 900: "#0f172a", - 950: "#020617" - }, - gray: { - 50: "#f9fafb", - 100: "#f3f4f6", - 200: "#e5e7eb", - 300: "#d1d5db", - 400: "#9ca3af", - 500: "#6b7280", - 600: "#4b5563", - 700: "#374151", - 800: "#1f2937", - 900: "#111827", - 950: "#030712" - }, - zinc: { - 50: "#fafafa", - 100: "#f4f4f5", - 200: "#e4e4e7", - 300: "#d4d4d8", - 400: "#a1a1aa", - 500: "#71717a", - 600: "#52525b", - 700: "#3f3f46", - 800: "#27272a", - 900: "#18181b", - 950: "#09090b" - }, - neutral: { - 50: "#fafafa", - 100: "#f5f5f5", - 200: "#e5e5e5", - 300: "#d4d4d4", - 400: "#a3a3a3", - 500: "#737373", - 600: "#525252", - 700: "#404040", - 800: "#262626", - 900: "#171717", - 950: "#0a0a0a" - }, - stone: { - 50: "#fafaf9", - 100: "#f5f5f4", - 200: "#e7e5e4", - 300: "#d6d3d1", - 400: "#a8a29e", - 500: "#78716c", - 600: "#57534e", - 700: "#44403c", - 800: "#292524", - 900: "#1c1917", - 950: "#0c0a09" - }, - red: { - 50: "#fef2f2", - 100: "#fee2e2", - 200: "#fecaca", - 300: "#fca5a5", - 400: "#f87171", - 500: "#ef4444", - 600: "#dc2626", - 700: "#b91c1c", - 800: "#991b1b", - 900: "#7f1d1d", - 950: "#450a0a" - }, - orange: { - 50: "#fff7ed", - 100: "#ffedd5", - 200: "#fed7aa", - 300: "#fdba74", - 400: "#fb923c", - 500: "#f97316", - 600: "#ea580c", - 700: "#c2410c", - 800: "#9a3412", - 900: "#7c2d12", - 950: "#431407" - }, - amber: { - 50: "#fffbeb", - 100: "#fef3c7", - 200: "#fde68a", - 300: "#fcd34d", - 400: "#fbbf24", - 500: "#f59e0b", - 600: "#d97706", - 700: "#b45309", - 800: "#92400e", - 900: "#78350f", - 950: "#451a03" - }, - yellow: { - 50: "#fefce8", - 100: "#fef9c3", - 200: "#fef08a", - 300: "#fde047", - 400: "#facc15", - 500: "#eab308", - 600: "#ca8a04", - 700: "#a16207", - 800: "#854d0e", - 900: "#713f12", - 950: "#422006" - }, - lime: { - 50: "#f7fee7", - 100: "#ecfccb", - 200: "#d9f99d", - 300: "#bef264", - 400: "#a3e635", - 500: "#84cc16", - 600: "#65a30d", - 700: "#4d7c0f", - 800: "#3f6212", - 900: "#365314", - 950: "#1a2e05" - }, - green: { - 50: "#f0fdf4", - 100: "#dcfce7", - 200: "#bbf7d0", - 300: "#86efac", - 400: "#4ade80", - 500: "#22c55e", - 600: "#16a34a", - 700: "#15803d", - 800: "#166534", - 900: "#14532d", - 950: "#052e16" - }, - emerald: { - 50: "#ecfdf5", - 100: "#d1fae5", - 200: "#a7f3d0", - 300: "#6ee7b7", - 400: "#34d399", - 500: "#10b981", - 600: "#059669", - 700: "#047857", - 800: "#065f46", - 900: "#064e3b", - 950: "#022c22" - }, - teal: { - 50: "#f0fdfa", - 100: "#ccfbf1", - 200: "#99f6e4", - 300: "#5eead4", - 400: "#2dd4bf", - 500: "#14b8a6", - 600: "#0d9488", - 700: "#0f766e", - 800: "#115e59", - 900: "#134e4a", - 950: "#042f2e" - }, - cyan: { - 50: "#ecfeff", - 100: "#cffafe", - 200: "#a5f3fc", - 300: "#67e8f9", - 400: "#22d3ee", - 500: "#06b6d4", - 600: "#0891b2", - 700: "#0e7490", - 800: "#155e75", - 900: "#164e63", - 950: "#083344" - }, - sky: { - 50: "#f0f9ff", - 100: "#e0f2fe", - 200: "#bae6fd", - 300: "#7dd3fc", - 400: "#38bdf8", - 500: "#0ea5e9", - 600: "#0284c7", - 700: "#0369a1", - 800: "#075985", - 900: "#0c4a6e", - 950: "#082f49" - }, - blue: { - 50: "#eff6ff", - 100: "#dbeafe", - 200: "#bfdbfe", - 300: "#93c5fd", - 400: "#60a5fa", - 500: "#3b82f6", - 600: "#2563eb", - 700: "#1d4ed8", - 800: "#1e40af", - 900: "#1e3a8a", - 950: "#172554" - }, - indigo: { - 50: "#eef2ff", - 100: "#e0e7ff", - 200: "#c7d2fe", - 300: "#a5b4fc", - 400: "#818cf8", - 500: "#6366f1", - 600: "#4f46e5", - 700: "#4338ca", - 800: "#3730a3", - 900: "#312e81", - 950: "#1e1b4b" - }, - violet: { - 50: "#f5f3ff", - 100: "#ede9fe", - 200: "#ddd6fe", - 300: "#c4b5fd", - 400: "#a78bfa", - 500: "#8b5cf6", - 600: "#7c3aed", - 700: "#6d28d9", - 800: "#5b21b6", - 900: "#4c1d95", - 950: "#2e1065" - }, - purple: { - 50: "#faf5ff", - 100: "#f3e8ff", - 200: "#e9d5ff", - 300: "#d8b4fe", - 400: "#c084fc", - 500: "#a855f7", - 600: "#9333ea", - 700: "#7e22ce", - 800: "#6b21a8", - 900: "#581c87", - 950: "#3b0764" - }, - fuchsia: { - 50: "#fdf4ff", - 100: "#fae8ff", - 200: "#f5d0fe", - 300: "#f0abfc", - 400: "#e879f9", - 500: "#d946ef", - 600: "#c026d3", - 700: "#a21caf", - 800: "#86198f", - 900: "#701a75", - 950: "#4a044e" - }, - pink: { - 50: "#fdf2f8", - 100: "#fce7f3", - 200: "#fbcfe8", - 300: "#f9a8d4", - 400: "#f472b6", - 500: "#ec4899", - 600: "#db2777", - 700: "#be185d", - 800: "#9d174d", - 900: "#831843", - 950: "#500724" - }, - rose: { - 50: "#fff1f2", - 100: "#ffe4e6", - 200: "#fecdd3", - 300: "#fda4af", - 400: "#fb7185", - 500: "#f43f5e", - 600: "#e11d48", - 700: "#be123c", - 800: "#9f1239", - 900: "#881337", - 950: "#4c0519" - }, - get lightBlue() { - warn({ version: "v2.2", from: "lightBlue", to: "sky" }); - return this.sky; - }, - get warmGray() { - warn({ version: "v3.0", from: "warmGray", to: "stone" }); - return this.stone; - }, - get trueGray() { - warn({ version: "v3.0", from: "trueGray", to: "neutral" }); - return this.neutral; - }, - get coolGray() { - warn({ version: "v3.0", from: "coolGray", to: "gray" }); - return this.gray; - }, - get blueGray() { - warn({ version: "v3.0", from: "blueGray", to: "slate" }); - return this.slate; - } - }; - function defaults2(target, ...sources) { - for (let source of sources) { - for (let k in source) { - if (!target?.hasOwnProperty?.(k)) { - target[k] = source[k]; - } - } - for (let k of Object.getOwnPropertySymbols(source)) { - if (!target?.hasOwnProperty?.(k)) { - target[k] = source[k]; - } - } - } - return target; - } - function normalizeConfig(config5) { - let valid = (() => { - if (config5.purge) { - return false; - } - if (!config5.content) { - return false; - } - if (!Array.isArray(config5.content) && !(typeof config5.content === "object" && config5.content !== null)) { - return false; - } - if (Array.isArray(config5.content)) { - return config5.content.every((path) => { - if (typeof path === "string") - return true; - if (typeof path?.raw !== "string") - return false; - if (path?.extension && typeof path?.extension !== "string") { - return false; - } - return true; - }); - } - if (typeof config5.content === "object" && config5.content !== null) { - if (Object.keys(config5.content).some( - (key) => !["files", "relative", "extract", "transform"].includes(key) - )) { - return false; - } - if (Array.isArray(config5.content.files)) { - if (!config5.content.files.every((path) => { - if (typeof path === "string") - return true; - if (typeof path?.raw !== "string") - return false; - if (path?.extension && typeof path?.extension !== "string") { - return false; - } - return true; - })) { - return false; - } - if (typeof config5.content.extract === "object") { - for (let value2 of Object.values(config5.content.extract)) { - if (typeof value2 !== "function") { - return false; - } - } - } else if (!(config5.content.extract === void 0 || typeof config5.content.extract === "function")) { - return false; - } - if (typeof config5.content.transform === "object") { - for (let value2 of Object.values(config5.content.transform)) { - if (typeof value2 !== "function") { - return false; - } - } - } else if (!(config5.content.transform === void 0 || typeof config5.content.transform === "function")) { - return false; - } - if (typeof config5.content.relative !== "boolean" && typeof config5.content.relative !== "undefined") { - return false; - } - } - return true; - } - return false; - })(); - if (!valid) { - log_default.warn("purge-deprecation", [ - "The `purge`/`content` options have changed in Tailwind CSS v3.0.", - "Update your configuration file to eliminate this warning.", - "https://tailwindcss.com/docs/upgrade-guide#configure-content-sources" - ]); - } - config5.safelist = (() => { - let { content, purge, safelist } = config5; - if (Array.isArray(safelist)) - return safelist; - if (Array.isArray(content?.safelist)) - return content.safelist; - if (Array.isArray(purge?.safelist)) - return purge.safelist; - if (Array.isArray(purge?.options?.safelist)) - return purge.options.safelist; - return []; - })(); - config5.blocklist = (() => { - let { blocklist } = config5; - if (Array.isArray(blocklist)) { - if (blocklist.every((item) => typeof item === "string")) { - return blocklist; - } - log_default.warn("blocklist-invalid", [ - "The `blocklist` option must be an array of strings.", - "https://tailwindcss.com/docs/content-configuration#discarding-classes" - ]); - } - return []; - })(); - if (typeof config5.prefix === "function") { - log_default.warn("prefix-function", [ - "As of Tailwind CSS v3.0, `prefix` cannot be a function.", - "Update `prefix` in your configuration to be a string to eliminate this warning.", - "https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function" - ]); - config5.prefix = ""; - } else { - config5.prefix = config5.prefix ?? ""; - } - config5.content = { - relative: (() => { - let { content } = config5; - if (content?.relative) { - return content.relative; - } - return flagEnabled(config5, "relativeContentPathsByDefault"); - })(), - files: (() => { - let { content, purge } = config5; - if (Array.isArray(purge)) - return purge; - if (Array.isArray(purge?.content)) - return purge.content; - if (Array.isArray(content)) - return content; - if (Array.isArray(content?.content)) - return content.content; - if (Array.isArray(content?.files)) - return content.files; - return []; - })(), - extract: (() => { - let extract = (() => { - if (config5.purge?.extract) - return config5.purge.extract; - if (config5.content?.extract) - return config5.content.extract; - if (config5.purge?.extract?.DEFAULT) - return config5.purge.extract.DEFAULT; - if (config5.content?.extract?.DEFAULT) - return config5.content.extract.DEFAULT; - if (config5.purge?.options?.extractors) - return config5.purge.options.extractors; - if (config5.content?.options?.extractors) - return config5.content.options.extractors; - return {}; - })(); - let extractors = {}; - let defaultExtractor2 = (() => { - if (config5.purge?.options?.defaultExtractor) { - return config5.purge.options.defaultExtractor; - } - if (config5.content?.options?.defaultExtractor) { - return config5.content.options.defaultExtractor; - } - return void 0; - })(); - if (defaultExtractor2 !== void 0) { - extractors.DEFAULT = defaultExtractor2; - } - if (typeof extract === "function") { - extractors.DEFAULT = extract; - } else if (Array.isArray(extract)) { - for (let { extensions, extractor } of extract ?? []) { - for (let extension of extensions) { - extractors[extension] = extractor; - } - } - } else if (typeof extract === "object" && extract !== null) { - Object.assign(extractors, extract); - } - return extractors; - })(), - transform: (() => { - let transform = (() => { - if (config5.purge?.transform) - return config5.purge.transform; - if (config5.content?.transform) - return config5.content.transform; - if (config5.purge?.transform?.DEFAULT) - return config5.purge.transform.DEFAULT; - if (config5.content?.transform?.DEFAULT) - return config5.content.transform.DEFAULT; - return {}; - })(); - let transformers = {}; - if (typeof transform === "function") { - transformers.DEFAULT = transform; - } - if (typeof transform === "object" && transform !== null) { - Object.assign(transformers, transform); - } - return transformers; - })() - }; - for (let file15 of config5.content.files) { - if (typeof file15 === "string" && /{([^,]*?)}/g.test(file15)) { - log_default.warn("invalid-glob-braces", [ - `The glob pattern ${dim(file15)} in your Tailwind CSS configuration is invalid.`, - `Update it to ${dim(file15.replace(/{([^,]*?)}/g, "$1"))} to silence this warning.` - ]); - break; - } - } - return config5; - } - function cloneDeep(value2) { - if (Array.isArray(value2)) { - return value2.map((child) => cloneDeep(child)); - } - if (typeof value2 === "object" && value2 !== null) { - return Object.fromEntries(Object.entries(value2).map(([k, v]) => [k, cloneDeep(v)])); - } - return value2; - } - function isFunction3(input) { - return typeof input === "function"; - } - function mergeWith(target, ...sources) { - let customizer = sources.pop(); - for (let source of sources) { - for (let k in source) { - let merged = customizer(target[k], source[k]); - if (merged === void 0) { - if (isPlainObject(target[k]) && isPlainObject(source[k])) { - target[k] = mergeWith({}, target[k], source[k], customizer); - } else { - target[k] = source[k]; - } - } else { - target[k] = merged; - } - } - } - return target; - } - var configUtils = { - colors: colors_default, - negative(scale) { - return Object.keys(scale).filter((key) => scale[key] !== "0").reduce((negativeScale, key) => { - let negativeValue = negateValue(scale[key]); - if (negativeValue !== void 0) { - negativeScale[`-${key}`] = negativeValue; - } - return negativeScale; - }, {}); - }, - breakpoints(screens) { - return Object.keys(screens).filter((key) => typeof screens[key] === "string").reduce( - (breakpoints, key) => ({ - ...breakpoints, - [`screen-${key}`]: screens[key] - }), - {} - ); - } - }; - function value(valueToResolve, ...args) { - return isFunction3(valueToResolve) ? valueToResolve(...args) : valueToResolve; - } - function collectExtends(items) { - return items.reduce((merged, { extend }) => { - return mergeWith(merged, extend, (mergedValue, extendValue) => { - if (mergedValue === void 0) { - return [extendValue]; - } - if (Array.isArray(mergedValue)) { - return [extendValue, ...mergedValue]; - } - return [extendValue, mergedValue]; - }); - }, {}); - } - function mergeThemes(themes) { - return { - ...themes.reduce((merged, theme2) => defaults2(merged, theme2), {}), - extend: collectExtends(themes) - }; - } - function mergeExtensionCustomizer(merged, value2) { - if (Array.isArray(merged) && isPlainObject(merged[0])) { - return merged.concat(value2); - } - if (Array.isArray(value2) && isPlainObject(value2[0]) && isPlainObject(merged)) { - return [merged, ...value2]; - } - if (Array.isArray(value2)) { - return value2; - } - return void 0; - } - function mergeExtensions({ extend, ...theme2 }) { - return mergeWith(theme2, extend, (themeValue, extensions) => { - if (!isFunction3(themeValue) && !extensions.some(isFunction3)) { - return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer); - } - return (resolveThemePath, utils) => mergeWith( - {}, - ...[themeValue, ...extensions].map((e) => value(e, resolveThemePath, utils)), - mergeExtensionCustomizer - ); - }); - } - function* toPaths2(key) { - let path = toPath(key); - if (path.length === 0) { - return; - } - yield path; - if (Array.isArray(key)) { - return; - } - let pattern2 = /^(.*?)\s*\/\s*([^/]+)$/; - let matches = key.match(pattern2); - if (matches !== null) { - let [, prefix3, alpha] = matches; - let newPath = toPath(prefix3); - newPath.alpha = alpha; - yield newPath; - } - } - function resolveFunctionKeys(object) { - const resolvePath2 = (key, defaultValue) => { - for (const path of toPaths2(key)) { - let index4 = 0; - let val = object; - while (val !== void 0 && val !== null && index4 < path.length) { - val = val[path[index4++]]; - let shouldResolveAsFn = isFunction3(val) && (path.alpha === void 0 || index4 <= path.length - 1); - val = shouldResolveAsFn ? val(resolvePath2, configUtils) : val; - } - if (val !== void 0) { - if (path.alpha !== void 0) { - let normalized = parseColorFormat(val); - return withAlphaValue(normalized, path.alpha, toColorValue(normalized)); - } - if (isPlainObject(val)) { - return cloneDeep(val); - } - return val; - } - } - return defaultValue; - }; - Object.assign(resolvePath2, { - theme: resolvePath2, - ...configUtils - }); - return Object.keys(object).reduce((resolved, key) => { - resolved[key] = isFunction3(object[key]) ? object[key](resolvePath2, configUtils) : object[key]; - return resolved; - }, {}); - } - function extractPluginConfigs(configs) { - let allConfigs = []; - configs.forEach((config5) => { - allConfigs = [...allConfigs, config5]; - const plugins = config5?.plugins ?? []; - if (plugins.length === 0) { - return; - } - plugins.forEach((plugin2) => { - if (plugin2.__isOptionsFunction) { - plugin2 = plugin2(); - } - allConfigs = [...allConfigs, ...extractPluginConfigs([plugin2?.config ?? {}])]; - }); - }); - return allConfigs; - } - function resolveCorePlugins(corePluginConfigs) { - const result = [...corePluginConfigs].reduceRight((resolved, corePluginConfig) => { - if (isFunction3(corePluginConfig)) { - return corePluginConfig({ corePlugins: resolved }); - } - return configurePlugins_default(corePluginConfig, resolved); - }, corePluginList_default); - return result; - } - function resolvePluginLists(pluginLists) { - const result = [...pluginLists].reduceRight((resolved, pluginList) => { - return [...resolved, ...pluginList]; - }, []); - return result; - } - function resolveConfig(configs) { - let allConfigs = [ - ...extractPluginConfigs(configs), - { - prefix: "", - important: false, - separator: ":" - } - ]; - return normalizeConfig( - defaults2( - { - theme: resolveFunctionKeys( - mergeExtensions(mergeThemes(allConfigs.map((t) => t?.theme ?? {}))) - ), - corePlugins: resolveCorePlugins(allConfigs.map((c) => c.corePlugins)), - plugins: resolvePluginLists(configs.map((c) => c?.plugins ?? [])) - }, - ...allConfigs - ) - ); - } - var import_config_full = __toESM2(require_config_full()); - function getAllConfigs(config5) { - const configs = (config5?.presets ?? [import_config_full.default]).slice().reverse().flatMap((preset) => getAllConfigs(preset instanceof Function ? preset() : preset)); - const features = { - respectDefaultRingColorOpacity: { - theme: { - ringColor: ({ theme: theme2 }) => ({ - DEFAULT: "#3b82f67f", - ...theme2("colors") - }) - } - }, - disableColorOpacityUtilitiesByDefault: { - corePlugins: { - backgroundOpacity: false, - borderOpacity: false, - divideOpacity: false, - placeholderOpacity: false, - ringOpacity: false, - textOpacity: false - } - } - }; - const experimentals = Object.keys(features).filter((feature) => flagEnabled(config5, feature)).map((feature) => features[feature]); - return [config5, ...experimentals, ...configs]; - } - function resolveConfig2(...configs) { - let [, ...defaultConfigs] = getAllConfigs(configs[0]); - return resolveConfig([...configs, ...defaultConfigs]); - } - var createTailwindcss = ({ tailwindConfig: tailwindConfig2 } = {}) => { - let currentTailwindConfig = tailwindConfig2; - return { - setTailwindConfig(newTailwindConfig) { - currentTailwindConfig = newTailwindConfig; - }, - async generateStylesFromContent(css, content) { - const tailwindcssPlugin = createTailwindcssPlugin({ tailwindConfig: currentTailwindConfig, content }); - const processor = postcss_default([tailwindcssPlugin]); - const result = await processor.process(css, { from: void 0 }); - return result.css; - } - }; - }; - var createTailwindcssPlugin = ({ tailwindConfig: tailwindConfig2, content: contentCollection }) => { - const config5 = resolveConfig2(tailwindConfig2 ?? {}); - const tailwindcssPlugin = processTailwindFeatures( - (processOptions) => () => processOptions.createContext( - config5, - contentCollection.map((content) => typeof content === "string" ? { content } : content) - ) - ); - return tailwindcssPlugin; - }; - - // svelte/components/PageWrapper.svelte - var file9 = "svelte/components/PageWrapper.svelte"; - function add_css4(target) { - append_styles(target, "svelte-1rms11c", '[data-selected="true"]{outline-color:#06b6d4;outline-width:1px;outline-style:solid}[data-selected="true"].contents > *{outline-color:#06b6d4;outline-width:1px;outline-style:solid}[data-highlighted="true"]{outline-color:#06b6d4;outline-width:2px;outline-style:dashed}:before, :after{pointer-events:none}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGFnZVdyYXBwZXIuc3ZlbHRlIiwibWFwcGluZ3MiOiJBQTBEVSxzQkFBd0IsQ0FDOUIsYUFBYSxDQUFFLE9BQU8sQ0FDdEIsYUFBYSxDQUFFLEdBQUcsQ0FDbEIsYUFBYSxDQUFFLEtBQ2pCLENBQ1EsbUNBQXFDLENBQzNDLGFBQWEsQ0FBRSxPQUFPLENBQ3RCLGFBQWEsQ0FBRSxHQUFHLENBQ2xCLGFBQWEsQ0FBRSxLQUNqQixDQUVRLHlCQUEyQixDQUNqQyxhQUFhLENBQUUsT0FBTyxDQUN0QixhQUFhLENBQUUsR0FBRyxDQUNsQixhQUFhLENBQUUsTUFDakIsQ0FFUSxlQUFpQixDQUN2QixjQUFjLENBQUUsSUFDbEIiLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiUGFnZVdyYXBwZXIuc3ZlbHRlIl19 */'); - } - function get_each_context4(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[9] = list3[i]; - return child_ctx; - } - function get_each_context_12(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[12] = list3[i]; - child_ctx[14] = i; - return child_ctx; - } - function create_each_block_12(ctx) { - let pageastnode; - let current; - pageastnode = new PageAstNode_default({ - props: { - node: ( - /*astNode*/ - ctx[12] - ), - nodeId: String( - /*index*/ - ctx[14] - ) - }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(pageastnode.$$.fragment); - }, - l: function claim(nodes) { - claim_component(pageastnode.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(pageastnode, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const pageastnode_changes = {}; - if (dirty & /*$page*/ - 4) - pageastnode_changes.node = /*astNode*/ - ctx2[12]; - pageastnode.$set(pageastnode_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(pageastnode.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(pageastnode.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(pageastnode, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_12.name, - type: "each", - source: "(46:8) {#each $page.ast as astNode, index}", - ctx - }); - return block; - } - function create_default_slot2(ctx) { - let div; - let t; - let current; - let each_value_1 = ensure_array_like_dev( - /*$page*/ - ctx[2].ast - ); - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - const block = { - c: function create3() { - div = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t = space(); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(div_nodes); - } - div_nodes.forEach(detach_dev); - t = claim_space(nodes); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "contents"); - add_location(div, file9, 48, 6, 1778); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div, null); - } - } - insert_hydration_dev(target, t, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if (dirty & /*$page, String*/ - 4) { - each_value_1 = ensure_array_like_dev( - /*$page*/ - ctx2[2].ast - ); - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_12(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_12(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div, null); - } - } - group_outros(); - for (i = each_value_1.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - detach_dev(t); - } - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_default_slot2.name, - type: "slot", - source: "(43:4) ", - ctx - }); - return block; - } - function create_each_block4(ctx) { - let layoutastnode; - let current; - layoutastnode = new LayoutAstNode_default({ - props: { - node: ( - /*layoutAstNode*/ - ctx[9] - ), - $$slots: { default: [create_default_slot2] }, - $$scope: { ctx } - }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(layoutastnode.$$.fragment); - }, - l: function claim(nodes) { - claim_component(layoutastnode.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(layoutastnode, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const layoutastnode_changes = {}; - if (dirty & /*$page*/ - 4) - layoutastnode_changes.node = /*layoutAstNode*/ - ctx2[9]; - if (dirty & /*$$scope, $page*/ - 32772) { - layoutastnode_changes.$$scope = { dirty, ctx: ctx2 }; - } - layoutastnode.$set(layoutastnode_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(layoutastnode.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(layoutastnode.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(layoutastnode, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block4.name, - type: "each", - source: "(42:2) {#each $page.layout.ast as layoutAstNode}", - ctx - }); - return block; - } - function create_fragment9(ctx) { - let span; - let t; - let div; - let current; - let mounted; - let dispose; - let each_value = ensure_array_like_dev( - /*$page*/ - ctx[2].layout.ast - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block4(get_each_context4(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - const block = { - c: function create3() { - span = element("span"); - t = space(); - div = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - this.h(); - }, - l: function claim(nodes) { - span = claim_element(nodes, "SPAN", {}); - children(span).forEach(detach_dev); - t = claim_space(nodes); - div = claim_element(nodes, "DIV", {}); - var div_nodes = children(div); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(div_nodes); - } - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - add_location(span, file9, 43, 0, 1418); - add_location(div, file9, 44, 0, 1457); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, span, anchor); - ctx[3](span); - insert_hydration_dev(target, t, anchor); - insert_hydration_dev(target, div, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div, null); - } - } - ctx[4](div); - current = true; - if (!mounted) { - dispose = listen_dev(div, "click", preventLinkNavigation, false, false, false, false); - mounted = true; - } - }, - p: function update2(ctx2, [dirty]) { - if (dirty & /*$page, String*/ - 4) { - each_value = ensure_array_like_dev( - /*$page*/ - ctx2[2].layout.ast - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context4(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block4(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(span); - detach_dev(t); - detach_dev(div); - } - ctx[3](null); - destroy_each(each_blocks, detaching); - ctx[4](null); - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment9.name, - type: "component", - source: "", - ctx - }); - return block; - } - function preventLinkNavigation(event) { - if (event.target instanceof HTMLAnchorElement) { - event.preventDefault(); - } - } - function instance9($$self, $$props, $$invalidate) { - let $tailwindInput; - let $tailwindConfig; - let $page; - validate_store(tailwindInput, "tailwindInput"); - component_subscribe($$self, tailwindInput, ($$value) => $$invalidate(5, $tailwindInput = $$value)); - validate_store(tailwindConfig, "tailwindConfig"); - component_subscribe($$self, tailwindConfig, ($$value) => $$invalidate(6, $tailwindConfig = $$value)); - validate_store(page, "page"); - component_subscribe($$self, page, ($$value) => $$invalidate(2, $page = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("page-wrapper", slots, []); - let wrapper; - let styleWrapper; - let twConfig = $tailwindConfig; - let configPromise = import(twConfig); - onMount(async () => { - const { default: tailwindConfig2 } = await configPromise; - const tailwind = createTailwindcss({ tailwindConfig: tailwindConfig2 }); - const reloadStylesheet = async () => { - if (!wrapper) - return; - const content = wrapper.outerHTML; - const css = await tailwind.generateStylesFromContent($tailwindInput, [content]); - let styleEl = document.createElement("style"); - styleEl.textContent = css; - styleWrapper.appendChild(styleEl); - }; - window.reloadStylesheet = reloadStylesheet; - reloadStylesheet(); - }); - page.subscribe(async () => { - await tick(); - window.reloadStylesheet && window.reloadStylesheet(); - }); - const writable_props = []; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - function span_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - styleWrapper = $$value; - $$invalidate(1, styleWrapper); - }); - } - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - wrapper = $$value; - $$invalidate(0, wrapper); - }); - } - $$self.$capture_state = () => ({ - LayoutAstNode: LayoutAstNode_default, - PageAstNode: PageAstNode_default, - page, - tailwindConfig, - tailwindInput, - createTailwindcss, - onMount, - tick, - wrapper, - styleWrapper, - twConfig, - configPromise, - preventLinkNavigation, - $tailwindInput, - $tailwindConfig, - $page - }); - $$self.$inject_state = ($$props2) => { - if ("wrapper" in $$props2) - $$invalidate(0, wrapper = $$props2.wrapper); - if ("styleWrapper" in $$props2) - $$invalidate(1, styleWrapper = $$props2.styleWrapper); - if ("twConfig" in $$props2) - twConfig = $$props2.twConfig; - if ("configPromise" in $$props2) - configPromise = $$props2.configPromise; - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - return [wrapper, styleWrapper, $page, span_binding, div_binding]; - } - var PageWrapper = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance9, create_fragment9, safe_not_equal, {}, add_css4); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "PageWrapper", - options, - id: create_fragment9.name - }); - } - }; - customElements.define("page-wrapper", create_custom_element(PageWrapper, {}, [], [], true)); - var PageWrapper_default = PageWrapper; - - // svelte/components/Pill.svelte - var Pill_exports = {}; - __export(Pill_exports, { - default: () => Pill_default - }); - var file10 = "svelte/components/Pill.svelte"; - function create_fragment10(ctx) { - let div; - let t0; - let button; - let span; - let t1; - let t2; - let svg; - let path; - let current; - let mounted; - let dispose; - const default_slot_template = ( - /*#slots*/ - ctx[2].default - ); - const default_slot = create_slot( - default_slot_template, - ctx, - /*$$scope*/ - ctx[1], - null - ); - const default_slot_template_1 = ( - /*#slots*/ - ctx[2].default - ); - const default_slot_1 = create_slot( - default_slot_template_1, - ctx, - /*$$scope*/ - ctx[1], - null - ); - const block = { - c: function create3() { - div = element("div"); - if (default_slot) - default_slot.c(); - t0 = space(); - button = element("button"); - span = element("span"); - t1 = text("Delete class: "); - if (default_slot_1) - default_slot_1.c(); - t2 = space(); - svg = svg_element("svg"); - path = svg_element("path"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - if (default_slot) - default_slot.l(div_nodes); - t0 = claim_space(div_nodes); - button = claim_element(div_nodes, "BUTTON", { class: true, type: true }); - var button_nodes = children(button); - span = claim_element(button_nodes, "SPAN", { class: true }); - var span_nodes = children(span); - t1 = claim_text(span_nodes, "Delete class: "); - if (default_slot_1) - default_slot_1.l(span_nodes); - span_nodes.forEach(detach_dev); - t2 = claim_space(button_nodes); - svg = claim_svg_element(button_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg_nodes = children(svg); - path = claim_svg_element(svg_nodes, "path", { - "fill-rule": true, - d: true, - "clip-rule": true - }); - children(path).forEach(detach_dev); - svg_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span, "class", "sr-only"); - add_location(span, file10, 12, 4, 436); - attr_dev(path, "fill-rule", "evenodd"); - attr_dev(path, "d", "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z"); - attr_dev(path, "clip-rule", "evenodd"); - add_location(path, file10, 14, 6, 595); - attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg, "viewBox", "0 0 24 24"); - attr_dev(svg, "fill", "currentColor"); - attr_dev(svg, "class", "w-3 h-3"); - add_location(svg, file10, 13, 4, 492); - attr_dev(button, "class", "p-2 rounded-full inline-block bg-slate-700 text-white hover:text-blue-400 active:text-blue-500"); - attr_dev(button, "type", "button"); - add_location(button, file10, 7, 2, 240); - attr_dev(div, "class", "inline-flex items-center rounded-full bg-slate-700 text-white text-xs px-3 pr-0 m-1 leading-4"); - add_location(div, file10, 5, 0, 119); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - if (default_slot) { - default_slot.m(div, null); - } - append_hydration_dev(div, t0); - append_hydration_dev(div, button); - append_hydration_dev(button, span); - append_hydration_dev(span, t1); - if (default_slot_1) { - default_slot_1.m(span, null); - } - append_hydration_dev(button, t2); - append_hydration_dev(button, svg); - append_hydration_dev(svg, path); - current = true; - if (!mounted) { - dispose = listen_dev(button, "click", prevent_default( - /*click_handler*/ - ctx[3] - ), false, true, false, false); - mounted = true; - } - }, - p: function update2(ctx2, [dirty]) { - if (default_slot) { - if (default_slot.p && (!current || dirty & /*$$scope*/ - 2)) { - update_slot_base( - default_slot, - default_slot_template, - ctx2, - /*$$scope*/ - ctx2[1], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[1] - ) : get_slot_changes( - default_slot_template, - /*$$scope*/ - ctx2[1], - dirty, - null - ), - null - ); - } - } - if (default_slot_1) { - if (default_slot_1.p && (!current || dirty & /*$$scope*/ - 2)) { - update_slot_base( - default_slot_1, - default_slot_template_1, - ctx2, - /*$$scope*/ - ctx2[1], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[1] - ) : get_slot_changes( - default_slot_template_1, - /*$$scope*/ - ctx2[1], - dirty, - null - ), - null - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(default_slot, local); - transition_in(default_slot_1, local); - current = true; - }, - o: function outro(local) { - transition_out(default_slot, local); - transition_out(default_slot_1, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - if (default_slot) - default_slot.d(detaching); - if (default_slot_1) - default_slot_1.d(detaching); - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment10.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance10($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("Pill", slots, ["default"]); - const dispatch2 = createEventDispatcher(); - const writable_props = []; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - const click_handler = () => dispatch2("delete"); - $$self.$$set = ($$props2) => { - if ("$$scope" in $$props2) - $$invalidate(1, $$scope = $$props2.$$scope); - }; - $$self.$capture_state = () => ({ createEventDispatcher, dispatch: dispatch2 }); - return [dispatch2, $$scope, slots, click_handler]; - } - var Pill = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance10, create_fragment10, safe_not_equal, {}); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "Pill", - options, - id: create_fragment10.name - }); - } - }; - create_custom_element(Pill, {}, ["default"], [], true); - var Pill_default = Pill; - - // svelte/components/PropertiesSidebar.svelte - var PropertiesSidebar_exports = {}; - __export(PropertiesSidebar_exports, { - default: () => PropertiesSidebar_default - }); - - // svelte/components/SidebarSection.svelte - var SidebarSection_exports = {}; - __export(SidebarSection_exports, { - default: () => SidebarSection_default - }); - var file11 = "svelte/components/SidebarSection.svelte"; - function get_each_context5(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[32] = list3[i]; - child_ctx[34] = i; - return child_ctx; - } - var get_value_slot_changes_1 = (dirty) => ({}); - var get_value_slot_context_1 = (ctx) => ({}); - var get_input_slot_changes_1 = (dirty) => ({}); - var get_input_slot_context_1 = (ctx) => ({}); - var get_value_slot_changes = (dirty) => ({}); - var get_value_slot_context = (ctx) => ({}); - var get_input_slot_changes = (dirty) => ({}); - var get_input_slot_context = (ctx) => ({}); - var get_heading_slot_changes = (dirty) => ({}); - var get_heading_slot_context = (ctx) => ({}); - function create_if_block_8(ctx) { - let button; - let span; - let mounted; - let dispose; - const block = { - c: function create3() { - button = element("button"); - span = element("span"); - this.h(); - }, - l: function claim(nodes) { - button = claim_element(nodes, "BUTTON", { type: true, class: true, title: true }); - var button_nodes = children(button); - span = claim_element(button_nodes, "SPAN", { class: true }); - children(span).forEach(detach_dev); - button_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span, "class", "hero-trash text-red hover:text-red"); - add_location(span, file11, 90, 13, 2830); - attr_dev(button, "type", "button"); - attr_dev(button, "class", "ml-4"); - attr_dev(button, "title", "Delete attribute"); - add_location(button, file11, 89, 10, 2714); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, button, anchor); - append_hydration_dev(button, span); - if (!mounted) { - dispose = listen_dev(button, "click", stop_propagation( - /*deleteAttribute*/ - ctx[9] - ), false, false, true, false); - mounted = true; - } - }, - p: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(button); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_8.name, - type: "if", - source: "(84:8) {#if !disableDelete}", - ctx - }); - return block; - } - function create_if_block_15(ctx) { - let current; - const input_slot_template = ( - /*#slots*/ - ctx[19].input - ); - const input_slot = create_slot( - input_slot_template, - ctx, - /*$$scope*/ - ctx[18], - get_input_slot_context_1 - ); - const input_slot_or_fallback = input_slot || fallback_block_1(ctx); - const block = { - c: function create3() { - if (input_slot_or_fallback) - input_slot_or_fallback.c(); - }, - l: function claim(nodes) { - if (input_slot_or_fallback) - input_slot_or_fallback.l(nodes); - }, - m: function mount(target, anchor) { - if (input_slot_or_fallback) { - input_slot_or_fallback.m(target, anchor); - } - current = true; - }, - p: function update2(ctx2, dirty) { - if (input_slot) { - if (input_slot.p && (!current || dirty[0] & /*$$scope*/ - 262144)) { - update_slot_base( - input_slot, - input_slot_template, - ctx2, - /*$$scope*/ - ctx2[18], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[18] - ) : get_slot_changes( - input_slot_template, - /*$$scope*/ - ctx2[18], - dirty, - get_input_slot_changes_1 - ), - get_input_slot_context_1 - ); - } - } else { - if (input_slot_or_fallback && input_slot_or_fallback.p && (!current || dirty[0] & /*$$scope, $$slots, placeholder, internalValue, disabled, large, astNodes*/ - 295022)) { - input_slot_or_fallback.p(ctx2, !current ? [-1, -1] : dirty); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(input_slot_or_fallback, local); - current = true; - }, - o: function outro(local) { - transition_out(input_slot_or_fallback, local); - current = false; - }, - d: function destroy(detaching) { - if (input_slot_or_fallback) - input_slot_or_fallback.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_15.name, - type: "if", - source: "(119:21) ", - ctx - }); - return block; - } - function create_if_block7(ctx) { - let t; - let div; - let current; - const input_slot_template = ( - /*#slots*/ - ctx[19].input - ); - const input_slot = create_slot( - input_slot_template, - ctx, - /*$$scope*/ - ctx[18], - get_input_slot_context - ); - const input_slot_or_fallback = input_slot || fallback_block(ctx); - const value_slot_template = ( - /*#slots*/ - ctx[19].value - ); - const value_slot = create_slot( - value_slot_template, - ctx, - /*$$scope*/ - ctx[18], - get_value_slot_context - ); - const block = { - c: function create3() { - if (input_slot_or_fallback) - input_slot_or_fallback.c(); - t = space(); - div = element("div"); - if (value_slot) - value_slot.c(); - this.h(); - }, - l: function claim(nodes) { - if (input_slot_or_fallback) - input_slot_or_fallback.l(nodes); - t = claim_space(nodes); - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - if (value_slot) - value_slot.l(div_nodes); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "pt-3"); - add_location(div, file11, 122, 4, 3876); - }, - m: function mount(target, anchor) { - if (input_slot_or_fallback) { - input_slot_or_fallback.m(target, anchor); - } - insert_hydration_dev(target, t, anchor); - insert_hydration_dev(target, div, anchor); - if (value_slot) { - value_slot.m(div, null); - } - current = true; - }, - p: function update2(ctx2, dirty) { - if (input_slot) { - if (input_slot.p && (!current || dirty[0] & /*$$scope*/ - 262144)) { - update_slot_base( - input_slot, - input_slot_template, - ctx2, - /*$$scope*/ - ctx2[18], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[18] - ) : get_slot_changes( - input_slot_template, - /*$$scope*/ - ctx2[18], - dirty, - get_input_slot_changes - ), - get_input_slot_context - ); - } - } else { - if (input_slot_or_fallback && input_slot_or_fallback.p && (!current || dirty[0] & /*placeholder, internalValue*/ - 68)) { - input_slot_or_fallback.p(ctx2, !current ? [-1, -1] : dirty); - } - } - if (value_slot) { - if (value_slot.p && (!current || dirty[0] & /*$$scope*/ - 262144)) { - update_slot_base( - value_slot, - value_slot_template, - ctx2, - /*$$scope*/ - ctx2[18], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[18] - ) : get_slot_changes( - value_slot_template, - /*$$scope*/ - ctx2[18], - dirty, - get_value_slot_changes - ), - get_value_slot_context - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(input_slot_or_fallback, local); - transition_in(value_slot, local); - current = true; - }, - o: function outro(local) { - transition_out(input_slot_or_fallback, local); - transition_out(value_slot, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - detach_dev(div); - } - if (input_slot_or_fallback) - input_slot_or_fallback.d(detaching); - if (value_slot) - value_slot.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block7.name, - type: "if", - source: '(107:2) {#if $$slots[\\"value\\"]}', - ctx - }); - return block; - } - function create_if_block_53(ctx) { - let each_1_anchor; - let each_value = ensure_array_like_dev( - /*astNodes*/ - ctx[1] - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block5(get_each_context5(ctx, each_value, i)); - } - const block = { - c: function create3() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - l: function claim(nodes) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, each_1_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*highlightAstElement, astNodes, unhighlightAstElement, moveAstElement, select, placeholder, handleKeydown, updateNodeContents, large*/ - 30094) { - each_value = ensure_array_like_dev( - /*astNodes*/ - ctx2[1] - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context5(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - } else { - each_blocks[i] = create_each_block5(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - each_blocks.length = each_value.length; - } - }, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_53.name, - type: "if", - source: "(145:25) ", - ctx - }); - return block; - } - function create_if_block_24(ctx) { - let t; - let if_block1_anchor; - let current; - function select_block_type_2(ctx2, dirty) { - if ( - /*large*/ - ctx2[3] - ) - return create_if_block_43; - return create_else_block3; - } - let current_block_type = select_block_type_2(ctx, [-1, -1]); - let if_block0 = current_block_type(ctx); - let if_block1 = ( - /*$$slots*/ - ctx[15]["value"] && create_if_block_33(ctx) - ); - const block = { - c: function create3() { - if_block0.c(); - t = space(); - if (if_block1) - if_block1.c(); - if_block1_anchor = empty(); - }, - l: function claim(nodes) { - if_block0.l(nodes); - t = claim_space(nodes); - if (if_block1) - if_block1.l(nodes); - if_block1_anchor = empty(); - }, - m: function mount(target, anchor) { - if_block0.m(target, anchor); - insert_hydration_dev(target, t, anchor); - if (if_block1) - if_block1.m(target, anchor); - insert_hydration_dev(target, if_block1_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if (current_block_type === (current_block_type = select_block_type_2(ctx2, dirty)) && if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0.d(1); - if_block0 = current_block_type(ctx2); - if (if_block0) { - if_block0.c(); - if_block0.m(t.parentNode, t); - } - } - if ( - /*$$slots*/ - ctx2[15]["value"] - ) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & /*$$slots*/ - 32768) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block_33(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(if_block1_anchor.parentNode, if_block1_anchor); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block1); - current = true; - }, - o: function outro(local) { - transition_out(if_block1); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - detach_dev(if_block1_anchor); - } - if_block0.d(detaching); - if (if_block1) - if_block1.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_24.name, - type: "if", - source: "(121:6) {#if internalValue}", - ctx - }); - return block; - } - function create_else_block_13(ctx) { - let input; - let input_value_value; - let mounted; - let dispose; - function change_handler_1(...args) { - return ( - /*change_handler_1*/ - ctx[27]( - /*idx*/ - ctx[34], - ...args - ) - ); - } - const block = { - c: function create3() { - input = element("input"); - this.h(); - }, - l: function claim(nodes) { - input = claim_element(nodes, "INPUT", { - type: true, - class: true, - placeholder: true - }); - this.h(); - }, - h: function hydrate() { - attr_dev(input, "type", "text"); - attr_dev(input, "class", "w-full py-1 px-2 mt-5 bg-slate-100 border-slate-100 rounded-md leading-6 text-sm"); - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx[2] - ); - input.value = input_value_value = /*astNode*/ - ctx[32]; - add_location(input, file11, 215, 12, 8869); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, input, anchor); - if (!mounted) { - dispose = [ - listen_dev( - input, - "keydown", - /*handleKeydown*/ - ctx[10], - false, - false, - false, - false - ), - listen_dev(input, "change", change_handler_1, false, false, false, false) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty[0] & /*placeholder*/ - 4) { - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx[2] - ); - } - if (dirty[0] & /*astNodes*/ - 2 && input_value_value !== (input_value_value = /*astNode*/ - ctx[32]) && input.value !== input_value_value) { - prop_dev(input, "value", input_value_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(input); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block_13.name, - type: "else", - source: "(210:10) {:else}", - ctx - }); - return block; - } - function create_if_block_72(ctx) { - let textarea; - let textarea_value_value; - let mounted; - let dispose; - function change_handler(...args) { - return ( - /*change_handler*/ - ctx[26]( - /*idx*/ - ctx[34], - ...args - ) - ); - } - const block = { - c: function create3() { - textarea = element("textarea"); - this.h(); - }, - l: function claim(nodes) { - textarea = claim_element(nodes, "TEXTAREA", { class: true, placeholder: true }); - children(textarea).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(textarea, "class", "w-full py-1 px-2 bg-slate-100 border-slate-100 rounded-md leading-6 text-sm"); - attr_dev( - textarea, - "placeholder", - /*placeholder*/ - ctx[2] - ); - textarea.value = textarea_value_value = /*astNode*/ - ctx[32]; - add_location(textarea, file11, 207, 12, 8547); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, textarea, anchor); - if (!mounted) { - dispose = [ - listen_dev( - textarea, - "keydown", - /*handleKeydown*/ - ctx[10], - false, - false, - false, - false - ), - listen_dev(textarea, "change", change_handler, false, false, false, false) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty[0] & /*placeholder*/ - 4) { - attr_dev( - textarea, - "placeholder", - /*placeholder*/ - ctx[2] - ); - } - if (dirty[0] & /*astNodes*/ - 2 && textarea_value_value !== (textarea_value_value = /*astNode*/ - ctx[32])) { - prop_dev(textarea, "value", textarea_value_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(textarea); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_72.name, - type: "if", - source: "(202:26) ", - ctx - }); - return block; - } - function create_if_block_63(ctx) { - let div2; - let div0; - let span0; - let code; - let t0; - let t1_value = ( - /*astNode*/ - ctx[32].tag + "" - ); - let t1; - let t2; - let t3; - let button0; - let t4; - let span1; - let t5_value = ( - /*astNode*/ - ctx[32].tag + "" - ); - let t5; - let t6; - let t7; - let svg0; - let path0; - let path1; - let t8; - let div1; - let button1; - let span3; - let t9; - let span2; - let t10_value = ( - /*astNode*/ - ctx[32].tag + "" - ); - let t10; - let t11; - let t12; - let t13; - let svg1; - let path2; - let button1_disabled_value; - let t14; - let button2; - let span5; - let t15; - let span4; - let t16_value = ( - /*astNode*/ - ctx[32].tag + "" - ); - let t16; - let t17; - let t18; - let t19; - let svg2; - let path3; - let button2_disabled_value; - let t20; - let mounted; - let dispose; - function click_handler_1() { - return ( - /*click_handler_1*/ - ctx[21]( - /*astNode*/ - ctx[32] - ) - ); - } - function click_handler_2() { - return ( - /*click_handler_2*/ - ctx[22]( - /*astNode*/ - ctx[32] - ) - ); - } - function click_handler_3() { - return ( - /*click_handler_3*/ - ctx[23]( - /*astNode*/ - ctx[32] - ) - ); - } - function mouseenter_handler() { - return ( - /*mouseenter_handler*/ - ctx[24]( - /*astNode*/ - ctx[32] - ) - ); - } - const block = { - c: function create3() { - div2 = element("div"); - div0 = element("div"); - span0 = element("span"); - code = element("code"); - t0 = text("<"); - t1 = text(t1_value); - t2 = text(">"); - t3 = space(); - button0 = element("button"); - t4 = text("Edit "); - span1 = element("span"); - t5 = text(t5_value); - t6 = text(" element"); - t7 = space(); - svg0 = svg_element("svg"); - path0 = svg_element("path"); - path1 = svg_element("path"); - t8 = space(); - div1 = element("div"); - button1 = element("button"); - span3 = element("span"); - t9 = text("Move "); - span2 = element("span"); - t10 = text(t10_value); - t11 = text(" element"); - t12 = text(" up"); - t13 = space(); - svg1 = svg_element("svg"); - path2 = svg_element("path"); - t14 = space(); - button2 = element("button"); - span5 = element("span"); - t15 = text("Move "); - span4 = element("span"); - t16 = text(t16_value); - t17 = text(" element"); - t18 = text(" down"); - t19 = space(); - svg2 = svg_element("svg"); - path3 = svg_element("path"); - t20 = space(); - this.h(); - }, - l: function claim(nodes) { - div2 = claim_element(nodes, "DIV", { class: true }); - var div2_nodes = children(div2); - div0 = claim_element(div2_nodes, "DIV", { class: true }); - var div0_nodes = children(div0); - span0 = claim_element(div0_nodes, "SPAN", {}); - var span0_nodes = children(span0); - code = claim_element(span0_nodes, "CODE", {}); - var code_nodes = children(code); - t0 = claim_text(code_nodes, "<"); - t1 = claim_text(code_nodes, t1_value); - t2 = claim_text(code_nodes, ">"); - code_nodes.forEach(detach_dev); - span0_nodes.forEach(detach_dev); - t3 = claim_space(div0_nodes); - button0 = claim_element(div0_nodes, "BUTTON", { class: true }); - var button0_nodes = children(button0); - t4 = claim_text(button0_nodes, "Edit "); - span1 = claim_element(button0_nodes, "SPAN", { class: true }); - var span1_nodes = children(span1); - t5 = claim_text(span1_nodes, t5_value); - t6 = claim_text(span1_nodes, " element"); - span1_nodes.forEach(detach_dev); - t7 = claim_space(button0_nodes); - svg0 = claim_svg_element(button0_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg0_nodes = children(svg0); - path0 = claim_svg_element(svg0_nodes, "path", { d: true }); - children(path0).forEach(detach_dev); - path1 = claim_svg_element(svg0_nodes, "path", { d: true }); - children(path1).forEach(detach_dev); - svg0_nodes.forEach(detach_dev); - button0_nodes.forEach(detach_dev); - div0_nodes.forEach(detach_dev); - t8 = claim_space(div2_nodes); - div1 = claim_element(div2_nodes, "DIV", { class: true }); - var div1_nodes = children(div1); - button1 = claim_element(div1_nodes, "BUTTON", { class: true }); - var button1_nodes = children(button1); - span3 = claim_element(button1_nodes, "SPAN", {}); - var span3_nodes = children(span3); - t9 = claim_text(span3_nodes, "Move "); - span2 = claim_element(span3_nodes, "SPAN", { class: true }); - var span2_nodes = children(span2); - t10 = claim_text(span2_nodes, t10_value); - t11 = claim_text(span2_nodes, " element"); - span2_nodes.forEach(detach_dev); - t12 = claim_text(span3_nodes, " up"); - span3_nodes.forEach(detach_dev); - t13 = claim_space(button1_nodes); - svg1 = claim_svg_element(button1_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg1_nodes = children(svg1); - path2 = claim_svg_element(svg1_nodes, "path", { - "fill-rule": true, - d: true, - "clip-rule": true - }); - children(path2).forEach(detach_dev); - svg1_nodes.forEach(detach_dev); - button1_nodes.forEach(detach_dev); - t14 = claim_space(div1_nodes); - button2 = claim_element(div1_nodes, "BUTTON", { class: true }); - var button2_nodes = children(button2); - span5 = claim_element(button2_nodes, "SPAN", {}); - var span5_nodes = children(span5); - t15 = claim_text(span5_nodes, "Move "); - span4 = claim_element(span5_nodes, "SPAN", { class: true }); - var span4_nodes = children(span4); - t16 = claim_text(span4_nodes, t16_value); - t17 = claim_text(span4_nodes, " element"); - span4_nodes.forEach(detach_dev); - t18 = claim_text(span5_nodes, " down"); - span5_nodes.forEach(detach_dev); - t19 = claim_space(button2_nodes); - svg2 = claim_svg_element(button2_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg2_nodes = children(svg2); - path3 = claim_svg_element(svg2_nodes, "path", { - "fill-rule": true, - d: true, - "clip-rule": true - }); - children(path3).forEach(detach_dev); - svg2_nodes.forEach(detach_dev); - button2_nodes.forEach(detach_dev); - div1_nodes.forEach(detach_dev); - t20 = claim_space(div2_nodes); - div2_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - add_location(code, file11, 159, 22, 5287); - add_location(span0, file11, 159, 16, 5281); - attr_dev(span1, "class", "sr-only"); - add_location(span1, file11, 164, 23, 5658); - attr_dev(path0, "d", "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"); - add_location(path0, file11, 166, 20, 5844); - attr_dev(path1, "d", "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"); - add_location(path1, file11, 169, 20, 6161); - attr_dev(svg0, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg0, "viewBox", "0 0 24 24"); - attr_dev(svg0, "fill", "currentColor"); - attr_dev(svg0, "class", "w-3 h-3"); - add_location(svg0, file11, 165, 18, 5727); - attr_dev(button0, "class", "flex items-center justify-center gap-x-0.5 px-2 py-1 bg-cyan-300 font-bold text-xs uppercase tracking-wide rounded transition-colors hover:bg-cyan-900 active:bg-cyan-700 hover:text-white"); - add_location(button0, file11, 160, 16, 5345); - attr_dev(div0, "class", "flex items-center justify-between"); - add_location(div0, file11, 158, 14, 5217); - attr_dev(span2, "class", "sr-only"); - add_location(span2, file11, 181, 29, 6957); - add_location(span3, file11, 181, 18, 6946); - attr_dev(path2, "fill-rule", "evenodd"); - attr_dev(path2, "d", "M11.47 2.47a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06l-6.22-6.22V21a.75.75 0 0 1-1.5 0V4.81l-6.22 6.22a.75.75 0 1 1-1.06-1.06l7.5-7.5Z"); - attr_dev(path2, "clip-rule", "evenodd"); - add_location(path2, file11, 183, 20, 7153); - attr_dev(svg1, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg1, "viewBox", "0 0 24 24"); - attr_dev(svg1, "fill", "currentColor"); - attr_dev(svg1, "class", "w-3 h-3"); - add_location(svg1, file11, 182, 18, 7036); - attr_dev(button1, "class", "flex items-center justify-center gap-x-0.5 px-1.5 py-1 bg-cyan-800 font-bold text-xs uppercase tracking-wide rounded hover:bg-cyan-950 active:bg-cyan-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white"); - button1.disabled = button1_disabled_value = /*idx*/ - ctx[34] === 0; - add_location(button1, file11, 176, 16, 6560); - attr_dev(span4, "class", "sr-only"); - add_location(span4, file11, 195, 29, 7917); - add_location(span5, file11, 195, 18, 7906); - attr_dev(path3, "fill-rule", "evenodd"); - attr_dev(path3, "d", "M12 2.25a.75.75 0 0 1 .75.75v16.19l6.22-6.22a.75.75 0 1 1 1.06 1.06l-7.5 7.5a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 1 1 1.06-1.06l6.22 6.22V3a.75.75 0 0 1 .75-.75Z"); - attr_dev(path3, "clip-rule", "evenodd"); - add_location(path3, file11, 197, 20, 8115); - attr_dev(svg2, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg2, "viewBox", "0 0 24 24"); - attr_dev(svg2, "fill", "currentColor"); - attr_dev(svg2, "class", "w-3 h-3"); - add_location(svg2, file11, 196, 18, 7998); - attr_dev(button2, "class", "flex items-center justify-center gap-x-0.5 px-1.5 py-1 bg-cyan-800 font-bold text-xs uppercase tracking-wide rounded hover:bg-cyan-950 active:bg-cyan-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white"); - button2.disabled = button2_disabled_value = /*idx*/ - ctx[34] === /*astNodes*/ - ctx[1].length - 1; - add_location(button2, file11, 190, 16, 7503); - attr_dev(div1, "class", "mt-2 grid grid-cols-2 gap-x-1"); - add_location(div1, file11, 175, 14, 6500); - attr_dev(div2, "class", "mt-5"); - add_location(div2, file11, 153, 12, 5032); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div2, anchor); - append_hydration_dev(div2, div0); - append_hydration_dev(div0, span0); - append_hydration_dev(span0, code); - append_hydration_dev(code, t0); - append_hydration_dev(code, t1); - append_hydration_dev(code, t2); - append_hydration_dev(div0, t3); - append_hydration_dev(div0, button0); - append_hydration_dev(button0, t4); - append_hydration_dev(button0, span1); - append_hydration_dev(span1, t5); - append_hydration_dev(span1, t6); - append_hydration_dev(button0, t7); - append_hydration_dev(button0, svg0); - append_hydration_dev(svg0, path0); - append_hydration_dev(svg0, path1); - append_hydration_dev(div2, t8); - append_hydration_dev(div2, div1); - append_hydration_dev(div1, button1); - append_hydration_dev(button1, span3); - append_hydration_dev(span3, t9); - append_hydration_dev(span3, span2); - append_hydration_dev(span2, t10); - append_hydration_dev(span2, t11); - append_hydration_dev(span3, t12); - append_hydration_dev(button1, t13); - append_hydration_dev(button1, svg1); - append_hydration_dev(svg1, path2); - append_hydration_dev(div1, t14); - append_hydration_dev(div1, button2); - append_hydration_dev(button2, span5); - append_hydration_dev(span5, t15); - append_hydration_dev(span5, span4); - append_hydration_dev(span4, t16); - append_hydration_dev(span4, t17); - append_hydration_dev(span5, t18); - append_hydration_dev(button2, t19); - append_hydration_dev(button2, svg2); - append_hydration_dev(svg2, path3); - append_hydration_dev(div2, t20); - if (!mounted) { - dispose = [ - listen_dev(button0, "click", click_handler_1, false, false, false, false), - listen_dev(button1, "click", click_handler_2, false, false, false, false), - listen_dev(button2, "click", click_handler_3, false, false, false, false), - listen_dev(div2, "mouseenter", mouseenter_handler, false, false, false, false), - listen_dev( - div2, - "mouseleave", - /*mouseleave_handler*/ - ctx[25], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty[0] & /*astNodes*/ - 2 && t1_value !== (t1_value = /*astNode*/ - ctx[32].tag + "")) - set_data_dev(t1, t1_value); - if (dirty[0] & /*astNodes*/ - 2 && t5_value !== (t5_value = /*astNode*/ - ctx[32].tag + "")) - set_data_dev(t5, t5_value); - if (dirty[0] & /*astNodes*/ - 2 && t10_value !== (t10_value = /*astNode*/ - ctx[32].tag + "")) - set_data_dev(t10, t10_value); - if (dirty[0] & /*astNodes*/ - 2 && t16_value !== (t16_value = /*astNode*/ - ctx[32].tag + "")) - set_data_dev(t16, t16_value); - if (dirty[0] & /*astNodes*/ - 2 && button2_disabled_value !== (button2_disabled_value = /*idx*/ - ctx[34] === /*astNodes*/ - ctx[1].length - 1)) { - prop_dev(button2, "disabled", button2_disabled_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div2); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_63.name, - type: "if", - source: "(147:10) {#if isAstElement(astNode)}", - ctx - }); - return block; - } - function create_each_block5(ctx) { - let show_if; - let if_block_anchor; - function select_block_type_3(ctx2, dirty) { - if (dirty[0] & /*astNodes*/ - 2) - show_if = null; - if (show_if == null) - show_if = !!isAstElement( - /*astNode*/ - ctx2[32] - ); - if (show_if) - return create_if_block_63; - if ( - /*large*/ - ctx2[3] - ) - return create_if_block_72; - return create_else_block_13; - } - let current_block_type = select_block_type_3(ctx, [-1, -1]); - let if_block = current_block_type(ctx); - const block = { - c: function create3() { - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if_block.m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - }, - p: function update2(ctx2, dirty) { - if (current_block_type === (current_block_type = select_block_type_3(ctx2, dirty)) && if_block) { - if_block.p(ctx2, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx2); - if (if_block) { - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if_block.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block5.name, - type: "each", - source: "(146:8) {#each astNodes as astNode, idx}", - ctx - }); - return block; - } - function create_else_block3(ctx) { - let input; - let mounted; - let dispose; - const block = { - c: function create3() { - input = element("input"); - this.h(); - }, - l: function claim(nodes) { - input = claim_element(nodes, "INPUT", { - type: true, - class: true, - placeholder: true - }); - this.h(); - }, - h: function hydrate() { - attr_dev(input, "type", "text"); - attr_dev(input, "class", "w-full py-1 px-2 bg-slate-100 border-slate-100 rounded-md leading-6 text-sm"); - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx[2] - ); - input.value = /*internalValue*/ - ctx[6]; - add_location(input, file11, 137, 10, 4449); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, input, anchor); - if (!mounted) { - dispose = [ - listen_dev( - input, - "keydown", - /*handleKeydown*/ - ctx[10], - false, - false, - false, - false - ), - listen_dev( - input, - "change", - /*handleTextChange*/ - ctx[11], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*placeholder*/ - 4) { - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx2[2] - ); - } - if (dirty[0] & /*internalValue*/ - 64 && input.value !== /*internalValue*/ - ctx2[6]) { - prop_dev( - input, - "value", - /*internalValue*/ - ctx2[6] - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(input); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block3.name, - type: "else", - source: "(132:8) {:else}", - ctx - }); - return block; - } - function create_if_block_43(ctx) { - let textarea; - let mounted; - let dispose; - const block = { - c: function create3() { - textarea = element("textarea"); - this.h(); - }, - l: function claim(nodes) { - textarea = claim_element(nodes, "TEXTAREA", { class: true, placeholder: true }); - children(textarea).forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(textarea, "class", "w-full py-1 px-2 bg-slate-100 border-slate-100 rounded-md leading-6 text-sm"); - attr_dev( - textarea, - "placeholder", - /*placeholder*/ - ctx[2] - ); - textarea.value = /*internalValue*/ - ctx[6]; - textarea.disabled = /*disabled*/ - ctx[5]; - add_location(textarea, file11, 128, 10, 4131); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, textarea, anchor); - if (!mounted) { - dispose = [ - listen_dev( - textarea, - "keydown", - /*handleKeydown*/ - ctx[10], - false, - false, - false, - false - ), - listen_dev( - textarea, - "change", - /*handleTextChange*/ - ctx[11], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*placeholder*/ - 4) { - attr_dev( - textarea, - "placeholder", - /*placeholder*/ - ctx2[2] - ); - } - if (dirty[0] & /*internalValue*/ - 64) { - prop_dev( - textarea, - "value", - /*internalValue*/ - ctx2[6] - ); - } - if (dirty[0] & /*disabled*/ - 32) { - prop_dev( - textarea, - "disabled", - /*disabled*/ - ctx2[5] - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(textarea); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_43.name, - type: "if", - source: "(122:8) {#if large}", - ctx - }); - return block; - } - function create_if_block_33(ctx) { - let div; - let current; - const value_slot_template = ( - /*#slots*/ - ctx[19].value - ); - const value_slot = create_slot( - value_slot_template, - ctx, - /*$$scope*/ - ctx[18], - get_value_slot_context_1 - ); - const block = { - c: function create3() { - div = element("div"); - if (value_slot) - value_slot.c(); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - if (value_slot) - value_slot.l(div_nodes); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "pt-3"); - add_location(div, file11, 147, 10, 4784); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - if (value_slot) { - value_slot.m(div, null); - } - current = true; - }, - p: function update2(ctx2, dirty) { - if (value_slot) { - if (value_slot.p && (!current || dirty[0] & /*$$scope*/ - 262144)) { - update_slot_base( - value_slot, - value_slot_template, - ctx2, - /*$$scope*/ - ctx2[18], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[18] - ) : get_slot_changes( - value_slot_template, - /*$$scope*/ - ctx2[18], - dirty, - get_value_slot_changes_1 - ), - get_value_slot_context_1 - ); - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(value_slot, local); - current = true; - }, - o: function outro(local) { - transition_out(value_slot, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - if (value_slot) - value_slot.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_33.name, - type: "if", - source: '(142:8) {#if $$slots[\\"value\\"]}', - ctx - }); - return block; - } - function fallback_block_1(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block_24, create_if_block_53]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if ( - /*internalValue*/ - ctx2[6] - ) - return 0; - if ( - /*astNodes*/ - ctx2[1] - ) - return 1; - return -1; - } - if (~(current_block_type_index = select_block_type_1(ctx, [-1, -1]))) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - } - const block = { - c: function create3() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if (~current_block_type_index) { - if_blocks[current_block_type_index].m(target, anchor); - } - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if (~current_block_type_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } - } else { - if (if_block) { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - } - if (~current_block_type_index) { - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } else { - if_block = null; - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if (~current_block_type_index) { - if_blocks[current_block_type_index].d(detaching); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: fallback_block_1.name, - type: "fallback", - source: "(120:23) ", - ctx - }); - return block; - } - function fallback_block(ctx) { - let input; - let mounted; - let dispose; - const block = { - c: function create3() { - input = element("input"); - this.h(); - }, - l: function claim(nodes) { - input = claim_element(nodes, "INPUT", { - type: true, - class: true, - placeholder: true - }); - this.h(); - }, - h: function hydrate() { - attr_dev(input, "type", "text"); - attr_dev(input, "class", "w-full py-1 px-2 bg-gray-100 border-gray-100 rounded-md leading-6 text-sm"); - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx[2] - ); - input.value = /*internalValue*/ - ctx[6]; - add_location(input, file11, 113, 6, 3610); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, input, anchor); - if (!mounted) { - dispose = [ - listen_dev( - input, - "keydown", - /*handleKeydown*/ - ctx[10], - false, - false, - false, - false - ), - listen_dev( - input, - "change", - /*handleTextChange*/ - ctx[11], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*placeholder*/ - 4) { - attr_dev( - input, - "placeholder", - /*placeholder*/ - ctx2[2] - ); - } - if (dirty[0] & /*internalValue*/ - 64 && input.value !== /*internalValue*/ - ctx2[6]) { - prop_dev( - input, - "value", - /*internalValue*/ - ctx2[6] - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(input); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: fallback_block.name, - type: "fallback", - source: "(108:23) ", - ctx - }); - return block; - } - function create_fragment11(ctx) { - let section; - let header; - let button; - let span1; - let span0; - let t0; - let t1; - let span2; - let svg; - let path; - let span2_class_value; - let t2; - let current_block_type_index; - let if_block1; - let current; - let mounted; - let dispose; - const heading_slot_template = ( - /*#slots*/ - ctx[19].heading - ); - const heading_slot = create_slot( - heading_slot_template, - ctx, - /*$$scope*/ - ctx[18], - get_heading_slot_context - ); - let if_block0 = !/*disableDelete*/ - ctx[4] && create_if_block_8(ctx); - const if_block_creators = [create_if_block7, create_if_block_15]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*$$slots*/ - ctx2[15]["value"] - ) - return 0; - if ( - /*expanded*/ - ctx2[0] - ) - return 1; - return -1; - } - if (~(current_block_type_index = select_block_type(ctx, [-1, -1]))) { - if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - } - const block = { - c: function create3() { - section = element("section"); - header = element("header"); - button = element("button"); - span1 = element("span"); - span0 = element("span"); - if (heading_slot) - heading_slot.c(); - t0 = space(); - if (if_block0) - if_block0.c(); - t1 = space(); - span2 = element("span"); - svg = svg_element("svg"); - path = svg_element("path"); - t2 = space(); - if (if_block1) - if_block1.c(); - this.h(); - }, - l: function claim(nodes) { - section = claim_element(nodes, "SECTION", { class: true }); - var section_nodes = children(section); - header = claim_element(section_nodes, "HEADER", { class: true }); - var header_nodes = children(header); - button = claim_element(header_nodes, "BUTTON", { - type: true, - class: true, - "aria-expanded": true - }); - var button_nodes = children(button); - span1 = claim_element(button_nodes, "SPAN", {}); - var span1_nodes = children(span1); - span0 = claim_element(span1_nodes, "SPAN", { class: true }); - var span0_nodes = children(span0); - if (heading_slot) - heading_slot.l(span0_nodes); - span0_nodes.forEach(detach_dev); - t0 = claim_space(span1_nodes); - if (if_block0) - if_block0.l(span1_nodes); - span1_nodes.forEach(detach_dev); - t1 = claim_space(button_nodes); - span2 = claim_element(button_nodes, "SPAN", { class: true }); - var span2_nodes = children(span2); - svg = claim_svg_element(span2_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg_nodes = children(svg); - path = claim_svg_element(svg_nodes, "path", { - "fill-rule": true, - d: true, - "clip-rule": true - }); - children(path).forEach(detach_dev); - svg_nodes.forEach(detach_dev); - span2_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - header_nodes.forEach(detach_dev); - t2 = claim_space(section_nodes); - if (if_block1) - if_block1.l(section_nodes); - section_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span0, "class", "hover:text-blue-700 active:text-blue-900"); - add_location(span0, file11, 87, 8, 2589); - add_location(span1, file11, 86, 6, 2574); - attr_dev(path, "fill-rule", "evenodd"); - attr_dev(path, "d", "M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z"); - attr_dev(path, "clip-rule", "evenodd"); - add_location(path, file11, 101, 10, 3266); - attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg, "viewBox", "0 0 24 24"); - attr_dev(svg, "fill", "currentColor"); - attr_dev(svg, "class", "w-5 h-5 stroke-slate-500 fill-slate-500 group-hover:stroke-current group-hover:fill-current"); - add_location(svg, file11, 95, 8, 3026); - attr_dev(span2, "class", span2_class_value = /*expanded*/ - ctx[0] ? "" : " [&_path]:origin-center [&_path]:rotate-180"); - add_location(span2, file11, 94, 6, 2941); - attr_dev(button, "type", "button"); - attr_dev(button, "class", "w-full flex items-center justify-between gap-x-1 p-1 font-semibold group"); - attr_dev( - button, - "aria-expanded", - /*expanded*/ - ctx[0] - ); - add_location(button, file11, 80, 4, 2370); - attr_dev(header, "class", "flex items-center text-sm mb-2 font-medium"); - add_location(header, file11, 79, 2, 2306); - attr_dev(section, "class", "p-4 border-b border-b-gray-100 border-solid"); - add_location(section, file11, 78, 0, 2242); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, section, anchor); - append_hydration_dev(section, header); - append_hydration_dev(header, button); - append_hydration_dev(button, span1); - append_hydration_dev(span1, span0); - if (heading_slot) { - heading_slot.m(span0, null); - } - append_hydration_dev(span1, t0); - if (if_block0) - if_block0.m(span1, null); - append_hydration_dev(button, t1); - append_hydration_dev(button, span2); - append_hydration_dev(span2, svg); - append_hydration_dev(svg, path); - append_hydration_dev(section, t2); - if (~current_block_type_index) { - if_blocks[current_block_type_index].m(section, null); - } - current = true; - if (!mounted) { - dispose = listen_dev( - button, - "click", - /*click_handler*/ - ctx[20], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (heading_slot) { - if (heading_slot.p && (!current || dirty[0] & /*$$scope*/ - 262144)) { - update_slot_base( - heading_slot, - heading_slot_template, - ctx2, - /*$$scope*/ - ctx2[18], - !current ? get_all_dirty_from_scope( - /*$$scope*/ - ctx2[18] - ) : get_slot_changes( - heading_slot_template, - /*$$scope*/ - ctx2[18], - dirty, - get_heading_slot_changes - ), - get_heading_slot_context - ); - } - } - if (!/*disableDelete*/ - ctx2[4]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_8(ctx2); - if_block0.c(); - if_block0.m(span1, null); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if (!current || dirty[0] & /*expanded*/ - 1 && span2_class_value !== (span2_class_value = /*expanded*/ - ctx2[0] ? "" : " [&_path]:origin-center [&_path]:rotate-180")) { - attr_dev(span2, "class", span2_class_value); - } - if (!current || dirty[0] & /*expanded*/ - 1) { - attr_dev( - button, - "aria-expanded", - /*expanded*/ - ctx2[0] - ); - } - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if (~current_block_type_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } - } else { - if (if_block1) { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - } - if (~current_block_type_index) { - if_block1 = if_blocks[current_block_type_index]; - if (!if_block1) { - if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block1.c(); - } else { - if_block1.p(ctx2, dirty); - } - transition_in(if_block1, 1); - if_block1.m(section, null); - } else { - if_block1 = null; - } - } - }, - i: function intro(local) { - if (current) - return; - transition_in(heading_slot, local); - transition_in(if_block1); - current = true; - }, - o: function outro(local) { - transition_out(heading_slot, local); - transition_out(if_block1); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(section); - } - if (heading_slot) - heading_slot.d(detaching); - if (if_block0) - if_block0.d(); - if (~current_block_type_index) { - if_blocks[current_block_type_index].d(); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment11.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance11($$self, $$props, $$invalidate) { - let astElements; - let $selectedAstElementId; - let $highlightedAstElement; - validate_store(selectedAstElementId, "selectedAstElementId"); - component_subscribe($$self, selectedAstElementId, ($$value) => $$invalidate(29, $selectedAstElementId = $$value)); - validate_store(highlightedAstElement, "highlightedAstElement"); - component_subscribe($$self, highlightedAstElement, ($$value) => $$invalidate(30, $highlightedAstElement = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("SidebarSection", slots, ["heading", "input", "value"]); - const $$slots = compute_slots(slots); - const dispatch2 = createEventDispatcher(); - let { value: value2 = "" } = $$props; - let { astNodes = null } = $$props; - let { clearOnUpdate = false } = $$props; - let { expanded = true } = $$props; - let { placeholder = "" } = $$props; - let { large = false } = $$props; - let { disableDelete = false } = $$props; - let { disabled = false } = $$props; - function highlightAstElement(astElement) { - set_store_value(highlightedAstElement, $highlightedAstElement = astElement, $highlightedAstElement); - } - function unhighlightAstElement() { - set_store_value(highlightedAstElement, $highlightedAstElement = void 0, $highlightedAstElement); - } - function deleteAttribute() { - if (confirm("Are you sure you want to delete this attribute?")) { - dispatch2("delete"); - } - } - let internalValue = astElements ? null : value2; - function handleKeydown(e) { - if (!(e.target instanceof HTMLInputElement)) - return; - let text2 = e.target.value; - if (e.key === "Enter" && text2 && text2.length > 0 && text2 !== value2) { - dispatch2("update", text2); - if (clearOnUpdate) { - $$invalidate(6, internalValue = null); - e.target.value = ""; - } - } - } - function handleTextChange(e) { - if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) { - dispatch2("textChange", e.target.value); - } - } - function select(astElement) { - let id = findAstElementId(astElement); - set_store_value(selectedAstElementId, $selectedAstElementId = id, $selectedAstElementId); - } - function moveAstElement(movement, astElement) { - if (!astNodes) - return; - let astNodesCopy = Array.from(astNodes); - let index4 = astNodesCopy.indexOf(astElement); - astNodesCopy.splice(index4, 1); - astNodesCopy.splice(index4 + movement, 0, astElement); - dispatch2("nodesChange", astNodesCopy); - } - function updateNodeContents(e, idx) { - let astNodesCopy = [...astNodes]; - astNodesCopy[idx] = e.target.value; - dispatch2("nodesChange", astNodesCopy); - } - const writable_props = [ - "value", - "astNodes", - "clearOnUpdate", - "expanded", - "placeholder", - "large", - "disableDelete", - "disabled" - ]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - const click_handler = () => $$invalidate(0, expanded = !expanded); - const click_handler_1 = (astNode) => select(astNode); - const click_handler_2 = (astNode) => moveAstElement(-1, astNode); - const click_handler_3 = (astNode) => moveAstElement(1, astNode); - const mouseenter_handler = (astNode) => highlightAstElement(astNode); - const mouseleave_handler = () => unhighlightAstElement(); - const change_handler = (idx, e) => updateNodeContents(e, idx); - const change_handler_1 = (idx, e) => updateNodeContents(e, idx); - $$self.$$set = ($$props2) => { - if ("value" in $$props2) - $$invalidate(16, value2 = $$props2.value); - if ("astNodes" in $$props2) - $$invalidate(1, astNodes = $$props2.astNodes); - if ("clearOnUpdate" in $$props2) - $$invalidate(17, clearOnUpdate = $$props2.clearOnUpdate); - if ("expanded" in $$props2) - $$invalidate(0, expanded = $$props2.expanded); - if ("placeholder" in $$props2) - $$invalidate(2, placeholder = $$props2.placeholder); - if ("large" in $$props2) - $$invalidate(3, large = $$props2.large); - if ("disableDelete" in $$props2) - $$invalidate(4, disableDelete = $$props2.disableDelete); - if ("disabled" in $$props2) - $$invalidate(5, disabled = $$props2.disabled); - if ("$$scope" in $$props2) - $$invalidate(18, $$scope = $$props2.$$scope); - }; - $$self.$capture_state = () => ({ - createEventDispatcher, - highlightedAstElement, - findAstElementId, - selectedAstElementId, - isAstElement, - dispatch: dispatch2, - value: value2, - astNodes, - clearOnUpdate, - expanded, - placeholder, - large, - disableDelete, - disabled, - highlightAstElement, - unhighlightAstElement, - deleteAttribute, - internalValue, - handleKeydown, - handleTextChange, - select, - moveAstElement, - updateNodeContents, - astElements, - $selectedAstElementId, - $highlightedAstElement - }); - $$self.$inject_state = ($$props2) => { - if ("value" in $$props2) - $$invalidate(16, value2 = $$props2.value); - if ("astNodes" in $$props2) - $$invalidate(1, astNodes = $$props2.astNodes); - if ("clearOnUpdate" in $$props2) - $$invalidate(17, clearOnUpdate = $$props2.clearOnUpdate); - if ("expanded" in $$props2) - $$invalidate(0, expanded = $$props2.expanded); - if ("placeholder" in $$props2) - $$invalidate(2, placeholder = $$props2.placeholder); - if ("large" in $$props2) - $$invalidate(3, large = $$props2.large); - if ("disableDelete" in $$props2) - $$invalidate(4, disableDelete = $$props2.disableDelete); - if ("disabled" in $$props2) - $$invalidate(5, disabled = $$props2.disabled); - if ("internalValue" in $$props2) - $$invalidate(6, internalValue = $$props2.internalValue); - if ("astElements" in $$props2) - astElements = $$props2.astElements; - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*astNodes*/ - 2) { - $: - astElements = (astNodes || []).filter(isAstElement); - } - if ($$self.$$.dirty[0] & /*astNodes*/ - 2) { - $: { - if (astNodes?.length === 1) { - let first = astNodes[0]; - if (!isAstElement(first)) { - $$invalidate(6, internalValue = first); - } - } else if (astNodes) { - $$invalidate(6, internalValue = null); - } - } - } - }; - return [ - expanded, - astNodes, - placeholder, - large, - disableDelete, - disabled, - internalValue, - highlightAstElement, - unhighlightAstElement, - deleteAttribute, - handleKeydown, - handleTextChange, - select, - moveAstElement, - updateNodeContents, - $$slots, - value2, - clearOnUpdate, - $$scope, - slots, - click_handler, - click_handler_1, - click_handler_2, - click_handler_3, - mouseenter_handler, - mouseleave_handler, - change_handler, - change_handler_1 - ]; - } - var SidebarSection = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2( - this, - options, - instance11, - create_fragment11, - safe_not_equal, - { - value: 16, - astNodes: 1, - clearOnUpdate: 17, - expanded: 0, - placeholder: 2, - large: 3, - disableDelete: 4, - disabled: 5 - }, - null, - [-1, -1] - ); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "SidebarSection", - options, - id: create_fragment11.name - }); - } - get value() { - return this.$$.ctx[16]; - } - set value(value2) { - this.$$set({ value: value2 }); - flush(); - } - get astNodes() { - return this.$$.ctx[1]; - } - set astNodes(astNodes) { - this.$$set({ astNodes }); - flush(); - } - get clearOnUpdate() { - return this.$$.ctx[17]; - } - set clearOnUpdate(clearOnUpdate) { - this.$$set({ clearOnUpdate }); - flush(); - } - get expanded() { - return this.$$.ctx[0]; - } - set expanded(expanded) { - this.$$set({ expanded }); - flush(); - } - get placeholder() { - return this.$$.ctx[2]; - } - set placeholder(placeholder) { - this.$$set({ placeholder }); - flush(); - } - get large() { - return this.$$.ctx[3]; - } - set large(large) { - this.$$set({ large }); - flush(); - } - get disableDelete() { - return this.$$.ctx[4]; - } - set disableDelete(disableDelete) { - this.$$set({ disableDelete }); - flush(); - } - get disabled() { - return this.$$.ctx[5]; - } - set disabled(disabled) { - this.$$set({ disabled }); - flush(); - } - }; - create_custom_element(SidebarSection, { "value": {}, "astNodes": {}, "clearOnUpdate": { "type": "Boolean" }, "expanded": { "type": "Boolean" }, "placeholder": {}, "large": { "type": "Boolean" }, "disableDelete": { "type": "Boolean" }, "disabled": { "type": "Boolean" } }, ["heading", "input", "value"], [], true); - var SidebarSection_default = SidebarSection; - - // svelte/components/PropertiesSidebar.svelte - var { Object: Object_1 } = globals; - var file12 = "svelte/components/PropertiesSidebar.svelte"; - function get_each_context6(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[35] = list3[i]; - child_ctx[36] = list3; - child_ctx[37] = i; - return child_ctx; - } - function get_each_context_13(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[38] = list3[i]; - const constants_0 = ( - /*entry*/ - child_ctx[38] - ); - child_ctx[39] = constants_0[0]; - child_ctx[40] = constants_0[1]; - return child_ctx; - } - function get_each_context_22(ctx, list3, i) { - const child_ctx = ctx.slice(); - child_ctx[43] = list3[i]; - return child_ctx; - } - function create_else_block4(ctx) { - let div; - let textContent = "Select a component to edit its properties"; - const block = { - c: function create3() { - div = element("div"); - div.textContent = textContent; - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(div) !== "svelte-y8jlza") - div.textContent = textContent; - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "p-4 pt-8 font-medium text-lg text-center"); - add_location(div, file12, 292, 6, 10690); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - }, - p: noop2, - i: noop2, - o: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_else_block4.name, - type: "else", - source: "(266:4) {:else}", - ctx - }); - return block; - } - function create_if_block8(ctx) { - let div0; - let t0; - let t1; - let t2; - let button; - let span; - let textContent = "Close"; - let t4; - let svg; - let path; - let t5; - let t6; - let t7; - let div1; - let show_if = ( - /*$draggedComponentDefinition*/ - ctx[8] && elementCanBeDroppedInTarget( - /*$draggedComponentDefinition*/ - ctx[8] - ) - ); - let t8; - let t9; - let sidebarsection; - let current; - let mounted; - let dispose; - let if_block0 = !/*isRootNode*/ - ctx[5] && create_if_block_54(ctx); - let if_block1 = ( - /*attributesEditable*/ - ctx[4] && create_if_block_44(ctx) - ); - let if_block2 = ( - /*$selectedAstElement*/ - ctx[0].tag === "eex_block" && create_if_block_34(ctx) - ); - let if_block3 = show_if && create_if_block_25(ctx); - let if_block4 = ( - /*$selectedAstElement*/ - ctx[0].content?.length > 0 && create_if_block_16(ctx) - ); - sidebarsection = new SidebarSection_default({ - props: { - expanded: false, - disableDelete: true, - $$slots: { - input: [create_input_slot], - heading: [create_heading_slot] - }, - $$scope: { ctx } - }, - $$inline: true - }); - const block = { - c: function create3() { - div0 = element("div"); - t0 = text( - /*sidebarTitle*/ - ctx[6] - ); - t1 = space(); - if (if_block0) - if_block0.c(); - t2 = space(); - button = element("button"); - span = element("span"); - span.textContent = textContent; - t4 = space(); - svg = svg_element("svg"); - path = svg_element("path"); - t5 = space(); - if (if_block1) - if_block1.c(); - t6 = space(); - if (if_block2) - if_block2.c(); - t7 = space(); - div1 = element("div"); - if (if_block3) - if_block3.c(); - t8 = space(); - if (if_block4) - if_block4.c(); - t9 = space(); - create_component(sidebarsection.$$.fragment); - this.h(); - }, - l: function claim(nodes) { - div0 = claim_element(nodes, "DIV", { class: true }); - var div0_nodes = children(div0); - t0 = claim_text( - div0_nodes, - /*sidebarTitle*/ - ctx[6] - ); - t1 = claim_space(div0_nodes); - if (if_block0) - if_block0.l(div0_nodes); - t2 = claim_space(div0_nodes); - button = claim_element(div0_nodes, "BUTTON", { type: true, class: true }); - var button_nodes = children(button); - span = claim_element(button_nodes, "SPAN", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(span) !== "svelte-1pewzs3") - span.textContent = textContent; - t4 = claim_space(button_nodes); - svg = claim_svg_element(button_nodes, "svg", { - xmlns: true, - viewBox: true, - fill: true, - class: true - }); - var svg_nodes = children(svg); - path = claim_svg_element(svg_nodes, "path", { - "fill-rule": true, - d: true, - "clip-rule": true - }); - children(path).forEach(detach_dev); - svg_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - div0_nodes.forEach(detach_dev); - t5 = claim_space(nodes); - if (if_block1) - if_block1.l(nodes); - t6 = claim_space(nodes); - if (if_block2) - if_block2.l(nodes); - t7 = claim_space(nodes); - div1 = claim_element(nodes, "DIV", { class: true }); - var div1_nodes = children(div1); - if (if_block3) - if_block3.l(div1_nodes); - t8 = claim_space(div1_nodes); - if (if_block4) - if_block4.l(div1_nodes); - div1_nodes.forEach(detach_dev); - t9 = claim_space(nodes); - claim_component(sidebarsection.$$.fragment, nodes); - this.h(); - }, - h: function hydrate() { - attr_dev(span, "class", "sr-only"); - add_location(span, file12, 171, 10, 5704); - attr_dev(path, "fill-rule", "evenodd"); - attr_dev(path, "d", "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z"); - attr_dev(path, "clip-rule", "evenodd"); - add_location(path, file12, 178, 12, 5958); - attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg, "viewBox", "0 0 24 24"); - attr_dev(svg, "fill", "currentColor"); - attr_dev(svg, "class", "w-6 h-6 hover:text-blue-700 active:text-blue-900"); - add_location(svg, file12, 172, 10, 5749); - attr_dev(button, "type", "button"); - attr_dev(button, "class", "absolute p-2 top-2 right-1"); - add_location(button, file12, 170, 8, 5610); - attr_dev(div0, "class", "border-b text-lg font-medium leading-5 p-4 relative"); - add_location(div0, file12, 145, 6, 4532); - attr_dev(div1, "class", "relative"); - add_location(div1, file12, 251, 6, 9094); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div0, anchor); - append_hydration_dev(div0, t0); - append_hydration_dev(div0, t1); - if (if_block0) - if_block0.m(div0, null); - append_hydration_dev(div0, t2); - append_hydration_dev(div0, button); - append_hydration_dev(button, span); - append_hydration_dev(button, t4); - append_hydration_dev(button, svg); - append_hydration_dev(svg, path); - insert_hydration_dev(target, t5, anchor); - if (if_block1) - if_block1.m(target, anchor); - insert_hydration_dev(target, t6, anchor); - if (if_block2) - if_block2.m(target, anchor); - insert_hydration_dev(target, t7, anchor); - insert_hydration_dev(target, div1, anchor); - if (if_block3) - if_block3.m(div1, null); - append_hydration_dev(div1, t8); - if (if_block4) - if_block4.m(div1, null); - insert_hydration_dev(target, t9, anchor); - mount_component(sidebarsection, target, anchor); - current = true; - if (!mounted) { - dispose = listen_dev(button, "click", resetSelection, false, false, false, false); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (!current || dirty[0] & /*sidebarTitle*/ - 64) - set_data_dev( - t0, - /*sidebarTitle*/ - ctx2[6] - ); - if (!/*isRootNode*/ - ctx2[5]) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_54(ctx2); - if_block0.c(); - if_block0.m(div0, t2); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if ( - /*attributesEditable*/ - ctx2[4] - ) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & /*attributesEditable*/ - 16) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block_44(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(t6.parentNode, t6); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - if ( - /*$selectedAstElement*/ - ctx2[0].tag === "eex_block" - ) { - if (if_block2) { - if_block2.p(ctx2, dirty); - if (dirty[0] & /*$selectedAstElement*/ - 1) { - transition_in(if_block2, 1); - } - } else { - if_block2 = create_if_block_34(ctx2); - if_block2.c(); - transition_in(if_block2, 1); - if_block2.m(t7.parentNode, t7); - } - } else if (if_block2) { - group_outros(); - transition_out(if_block2, 1, 1, () => { - if_block2 = null; - }); - check_outros(); - } - if (dirty[0] & /*$draggedComponentDefinition*/ - 256) - show_if = /*$draggedComponentDefinition*/ - ctx2[8] && elementCanBeDroppedInTarget( - /*$draggedComponentDefinition*/ - ctx2[8] - ); - if (show_if) { - if (if_block3) { - if_block3.p(ctx2, dirty); - } else { - if_block3 = create_if_block_25(ctx2); - if_block3.c(); - if_block3.m(div1, t8); - } - } else if (if_block3) { - if_block3.d(1); - if_block3 = null; - } - if ( - /*$selectedAstElement*/ - ctx2[0].content?.length > 0 - ) { - if (if_block4) { - if_block4.p(ctx2, dirty); - if (dirty[0] & /*$selectedAstElement*/ - 1) { - transition_in(if_block4, 1); - } - } else { - if_block4 = create_if_block_16(ctx2); - if_block4.c(); - transition_in(if_block4, 1); - if_block4.m(div1, null); - } - } else if (if_block4) { - group_outros(); - transition_out(if_block4, 1, 1, () => { - if_block4 = null; - }); - check_outros(); - } - const sidebarsection_changes = {}; - if (dirty[0] & /*sidebarTitle*/ - 64 | dirty[1] & /*$$scope*/ - 32768) { - sidebarsection_changes.$$scope = { dirty, ctx: ctx2 }; - } - sidebarsection.$set(sidebarsection_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block1); - transition_in(if_block2); - transition_in(if_block4); - transition_in(sidebarsection.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(if_block1); - transition_out(if_block2); - transition_out(if_block4); - transition_out(sidebarsection.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div0); - detach_dev(t5); - detach_dev(t6); - detach_dev(t7); - detach_dev(div1); - detach_dev(t9); - } - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(detaching); - if (if_block2) - if_block2.d(detaching); - if (if_block3) - if_block3.d(); - if (if_block4) - if_block4.d(); - destroy_component(sidebarsection, detaching); - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block8.name, - type: "if", - source: "(119:4) {#if $selectedAstElement}", - ctx - }); - return block; - } - function create_if_block_54(ctx) { - let button; - let span0; - let textContent = "Up one level"; - let t1; - let span1; - let textContent_1 = "Up one level"; - let t3; - let svg; - let path; - let mounted; - let dispose; - const block = { - c: function create3() { - button = element("button"); - span0 = element("span"); - span0.textContent = textContent; - t1 = space(); - span1 = element("span"); - span1.textContent = textContent_1; - t3 = space(); - svg = svg_element("svg"); - path = svg_element("path"); - this.h(); - }, - l: function claim(nodes) { - button = claim_element(nodes, "BUTTON", { type: true, class: true }); - var button_nodes = children(button); - span0 = claim_element(button_nodes, "SPAN", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(span0) !== "svelte-e67xyw") - span0.textContent = textContent; - t1 = claim_space(button_nodes); - span1 = claim_element(button_nodes, "SPAN", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(span1) !== "svelte-uuliww") - span1.textContent = textContent_1; - t3 = claim_space(button_nodes); - svg = claim_svg_element(button_nodes, "svg", { - xmlns: true, - fill: true, - viewBox: true, - "stroke-width": true, - stroke: true, - class: true - }); - var svg_nodes = children(svg); - path = claim_svg_element(svg_nodes, "path", { - "stroke-linecap": true, - "stroke-linejoin": true, - d: true - }); - children(path).forEach(detach_dev); - svg_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span0, "class", "sr-only"); - add_location(span0, file12, 149, 12, 4761); - attr_dev(span1, "class", "absolute opacity-0 invisible right-9 min-w-[100px] bg-amber-100 py-1 px-1.5 rounded text-xs text-medium transition group-hover:opacity-100 group-hover:visible"); - add_location(span1, file12, 150, 12, 4815); - attr_dev(path, "stroke-linecap", "round"); - attr_dev(path, "stroke-linejoin", "round"); - attr_dev(path, "d", "M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"); - add_location(path, file12, 162, 14, 5352); - attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr_dev(svg, "fill", "currentColor"); - attr_dev(svg, "viewBox", "0 0 24 24"); - attr_dev(svg, "stroke-width", "1.5"); - attr_dev(svg, "stroke", "currentColor"); - attr_dev(svg, "class", "w-6 h-6 hover:text-blue-700 active:text-blue-900"); - add_location(svg, file12, 154, 12, 5062); - attr_dev(button, "type", "button"); - attr_dev(button, "class", "absolute p-2 top-2 right-9 group"); - add_location(button, file12, 148, 10, 4657); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, button, anchor); - append_hydration_dev(button, span0); - append_hydration_dev(button, t1); - append_hydration_dev(button, span1); - append_hydration_dev(button, t3); - append_hydration_dev(button, svg); - append_hydration_dev(svg, path); - if (!mounted) { - dispose = listen_dev( - button, - "click", - /*selectParentNode*/ - ctx[13], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(button); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_54.name, - type: "if", - source: "(122:8) {#if !isRootNode}", - ctx - }); - return block; - } - function create_if_block_44(ctx) { - let sidebarsection; - let t0; - let each_blocks_1 = []; - let each0_lookup = /* @__PURE__ */ new Map(); - let t1; - let each_blocks = []; - let each1_lookup = /* @__PURE__ */ new Map(); - let t2; - let div; - let button; - let textContent = "+ Add attribute"; - let current; - let mounted; - let dispose; - sidebarsection = new SidebarSection_default({ - props: { - clearOnUpdate: true, - disableDelete: true, - placeholder: "Add new class", - $$slots: { - value: [create_value_slot], - heading: [create_heading_slot_5] - }, - $$scope: { ctx } - }, - $$inline: true - }); - sidebarsection.$on( - "update", - /*addClasses*/ - ctx[12] - ); - let each_value_1 = ensure_array_like_dev( - /*editableAttrs*/ - ctx[7] - ); - const get_key = (ctx2) => ( - /*entry*/ - ctx2[38] - ); - validate_each_keys(ctx, each_value_1, get_each_context_13, get_key); - for (let i = 0; i < each_value_1.length; i += 1) { - let child_ctx = get_each_context_13(ctx, each_value_1, i); - let key = get_key(child_ctx); - each0_lookup.set(key, each_blocks_1[i] = create_each_block_13(key, child_ctx)); - } - let each_value = ensure_array_like_dev( - /*arbitraryAttributes*/ - ctx[2] - ); - const get_key_1 = (ctx2) => ( - /*attribute*/ - ctx2[35] - ); - validate_each_keys(ctx, each_value, get_each_context6, get_key_1); - for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context6(ctx, each_value, i); - let key = get_key_1(child_ctx); - each1_lookup.set(key, each_blocks[i] = create_each_block6(key, child_ctx)); - } - const block = { - c: function create3() { - create_component(sidebarsection.$$.fragment); - t0 = space(); - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].c(); - } - t1 = space(); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - t2 = space(); - div = element("div"); - button = element("button"); - button.textContent = textContent; - this.h(); - }, - l: function claim(nodes) { - claim_component(sidebarsection.$$.fragment, nodes); - t0 = claim_space(nodes); - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].l(nodes); - } - t1 = claim_space(nodes); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - t2 = claim_space(nodes); - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - button = claim_element(div_nodes, "BUTTON", { - type: true, - class: true, - ["data-svelte-h"]: true - }); - if (get_svelte_dataset(button) !== "svelte-15j3120") - button.textContent = textContent; - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(button, "type", "button"); - attr_dev(button, "class", "bg-blue-500 hover:bg-blue-700 active:bg-blue-800 text-white font-bold py-2 px-4 rounded outline-2 w-full"); - add_location(button, file12, 225, 10, 8075); - attr_dev(div, "class", "p-4"); - add_location(div, file12, 224, 8, 8047); - }, - m: function mount(target, anchor) { - mount_component(sidebarsection, target, anchor); - insert_hydration_dev(target, t0, anchor); - for (let i = 0; i < each_blocks_1.length; i += 1) { - if (each_blocks_1[i]) { - each_blocks_1[i].m(target, anchor); - } - } - insert_hydration_dev(target, t1, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, t2, anchor); - insert_hydration_dev(target, div, anchor); - append_hydration_dev(div, button); - current = true; - if (!mounted) { - dispose = listen_dev( - button, - "click", - /*addArbitraryAttribute*/ - ctx[9], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - const sidebarsection_changes = {}; - if (dirty[0] & /*classList*/ - 2 | dirty[1] & /*$$scope*/ - 32768) { - sidebarsection_changes.$$scope = { dirty, ctx: ctx2 }; - } - sidebarsection.$set(sidebarsection_changes); - if (dirty[0] & /*editableAttrs, deleteAttribute, updateAttribute*/ - 133248) { - each_value_1 = ensure_array_like_dev( - /*editableAttrs*/ - ctx2[7] - ); - group_outros(); - validate_each_keys(ctx2, each_value_1, get_each_context_13, get_key); - each_blocks_1 = update_keyed_each(each_blocks_1, dirty, get_key, 1, ctx2, each_value_1, each0_lookup, t1.parentNode, outro_and_destroy_block, create_each_block_13, t1, get_each_context_13); - check_outros(); - } - if (dirty[0] & /*arbitraryAttributes, saveArbitraryAttribute*/ - 1028) { - each_value = ensure_array_like_dev( - /*arbitraryAttributes*/ - ctx2[2] - ); - validate_each_keys(ctx2, each_value, get_each_context6, get_key_1); - each_blocks = update_keyed_each(each_blocks, dirty, get_key_1, 1, ctx2, each_value, each1_lookup, t2.parentNode, destroy_block, create_each_block6, t2, get_each_context6); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(sidebarsection.$$.fragment, local); - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in(each_blocks_1[i]); - } - current = true; - }, - o: function outro(local) { - transition_out(sidebarsection.$$.fragment, local); - for (let i = 0; i < each_blocks_1.length; i += 1) { - transition_out(each_blocks_1[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t0); - detach_dev(t1); - detach_dev(t2); - detach_dev(div); - } - destroy_component(sidebarsection, detaching); - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].d(detaching); - } - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].d(detaching); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_44.name, - type: "if", - source: "(161:6) {#if attributesEditable}", - ctx - }); - return block; - } - function create_heading_slot_5(ctx) { - let t; - const block = { - c: function create3() { - t = text("Classes"); - }, - l: function claim(nodes) { - t = claim_text(nodes, "Classes"); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot_5.name, - type: "slot", - source: '(163:10) ', - ctx - }); - return block; - } - function create_default_slot3(ctx) { - let t_value = ( - /*className*/ - ctx[43] + "" - ); - let t; - const block = { - c: function create3() { - t = text(t_value); - }, - l: function claim(nodes) { - t = claim_text(nodes, t_value); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*classList*/ - 2 && t_value !== (t_value = /*className*/ - ctx2[43] + "")) - set_data_dev(t, t_value); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_default_slot3.name, - type: "slot", - source: "(166:14) deleteClass(className)}>", - ctx - }); - return block; - } - function create_each_block_22(ctx) { - let pill; - let current; - function delete_handler() { - return ( - /*delete_handler*/ - ctx[23]( - /*className*/ - ctx[43] - ) - ); - } - pill = new Pill_default({ - props: { - $$slots: { default: [create_default_slot3] }, - $$scope: { ctx } - }, - $$inline: true - }); - pill.$on("delete", delete_handler); - const block = { - c: function create3() { - create_component(pill.$$.fragment); - }, - l: function claim(nodes) { - claim_component(pill.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(pill, target, anchor); - current = true; - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - const pill_changes = {}; - if (dirty[0] & /*classList*/ - 2 | dirty[1] & /*$$scope*/ - 32768) { - pill_changes.$$scope = { dirty, ctx }; - } - pill.$set(pill_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(pill.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(pill.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(pill, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_22.name, - type: "each", - source: "(165:12) {#each classList as className}", - ctx - }); - return block; - } - function create_value_slot(ctx) { - let each_1_anchor; - let current; - let each_value_2 = ensure_array_like_dev( - /*classList*/ - ctx[1] - ); - let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_22(get_each_context_22(ctx, each_value_2, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - const block = { - c: function create3() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - l: function claim(nodes) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].l(nodes); - } - each_1_anchor = empty(); - }, - m: function mount(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert_hydration_dev(target, each_1_anchor, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*deleteClass, classList*/ - 16386) { - each_value_2 = ensure_array_like_dev( - /*classList*/ - ctx2[1] - ); - let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_22(ctx2, each_value_2, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_22(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value_2.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - for (let i = 0; i < each_value_2.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o: function outro(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_value_slot.name, - type: "slot", - source: '(164:10) ', - ctx - }); - return block; - } - function create_heading_slot_4(ctx) { - let t_value = ( - /*name*/ - ctx[39] + "" - ); - let t; - const block = { - c: function create3() { - t = text(t_value); - }, - l: function claim(nodes) { - t = claim_text(nodes, t_value); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*editableAttrs*/ - 128 && t_value !== (t_value = /*name*/ - ctx2[39] + "")) - set_data_dev(t, t_value); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot_4.name, - type: "slot", - source: '(178:12) ', - ctx - }); - return block; - } - function create_each_block_13(key_1, ctx) { - let first; - let sidebarsection; - let current; - function delete_handler_1() { - return ( - /*delete_handler_1*/ - ctx[24]( - /*name*/ - ctx[39] - ) - ); - } - function textChange_handler(...args) { - return ( - /*textChange_handler*/ - ctx[25]( - /*name*/ - ctx[39], - ...args - ) - ); - } - sidebarsection = new SidebarSection_default({ - props: { - value: ( - /*value*/ - ctx[40] - ), - placeholder: "Set " + /*name*/ - ctx[39], - $$slots: { heading: [create_heading_slot_4] }, - $$scope: { ctx } - }, - $$inline: true - }); - sidebarsection.$on("delete", delete_handler_1); - sidebarsection.$on("textChange", textChange_handler); - const block = { - key: key_1, - first: null, - c: function create3() { - first = empty(); - create_component(sidebarsection.$$.fragment); - this.h(); - }, - l: function claim(nodes) { - first = empty(); - claim_component(sidebarsection.$$.fragment, nodes); - this.h(); - }, - h: function hydrate() { - this.first = first; - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, first, anchor); - mount_component(sidebarsection, target, anchor); - current = true; - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - const sidebarsection_changes = {}; - if (dirty[0] & /*editableAttrs*/ - 128) - sidebarsection_changes.value = /*value*/ - ctx[40]; - if (dirty[0] & /*editableAttrs*/ - 128) - sidebarsection_changes.placeholder = "Set " + /*name*/ - ctx[39]; - if (dirty[0] & /*editableAttrs*/ - 128 | dirty[1] & /*$$scope*/ - 32768) { - sidebarsection_changes.$$scope = { dirty, ctx }; - } - sidebarsection.$set(sidebarsection_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(sidebarsection.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(sidebarsection.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(first); - } - destroy_component(sidebarsection, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_13.name, - type: "each", - source: "(170:8) {#each editableAttrs as entry (entry)}", - ctx - }); - return block; - } - function create_each_block6(key_1, ctx) { - let div; - let input0; - let t; - let input1; - let mounted; - let dispose; - function input0_input_handler() { - ctx[26].call( - input0, - /*each_value*/ - ctx[36], - /*index*/ - ctx[37] - ); - } - function blur_handler() { - return ( - /*blur_handler*/ - ctx[27]( - /*index*/ - ctx[37] - ) - ); - } - function input1_input_handler() { - ctx[28].call( - input1, - /*each_value*/ - ctx[36], - /*index*/ - ctx[37] - ); - } - function blur_handler_1() { - return ( - /*blur_handler_1*/ - ctx[29]( - /*index*/ - ctx[37] - ) - ); - } - const block = { - key: key_1, - first: null, - c: function create3() { - div = element("div"); - input0 = element("input"); - t = space(); - input1 = element("input"); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true }); - var div_nodes = children(div); - input0 = claim_element(div_nodes, "INPUT", { - type: true, - class: true, - placeholder: true - }); - t = claim_space(div_nodes); - input1 = claim_element(div_nodes, "INPUT", { - type: true, - class: true, - placeholder: true - }); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(input0, "type", "text"); - attr_dev(input0, "class", "w-full py-1 px-2 bg-gray-100 border-gray-100 rounded-md leading-6 text-sm"); - attr_dev(input0, "placeholder", "Attribute name"); - add_location(input0, file12, 208, 12, 7409); - attr_dev(input1, "type", "text"); - attr_dev(input1, "class", "w-full mt-2 py-1 px-2 bg-gray-100 border-gray-100 rounded-md leading-6 text-sm"); - attr_dev(input1, "placeholder", "Attribute value"); - add_location(input1, file12, 215, 12, 7710); - attr_dev(div, "class", "p-4 border-b border-b-gray-100 border-solid"); - add_location(div, file12, 207, 10, 7339); - this.first = div; - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - append_hydration_dev(div, input0); - set_input_value( - input0, - /*attribute*/ - ctx[35].name - ); - append_hydration_dev(div, t); - append_hydration_dev(div, input1); - set_input_value( - input1, - /*attribute*/ - ctx[35].value - ); - if (!mounted) { - dispose = [ - listen_dev(input0, "input", input0_input_handler), - listen_dev(input0, "blur", blur_handler, false, false, false, false), - listen_dev(input1, "input", input1_input_handler), - listen_dev(input1, "blur", blur_handler_1, false, false, false, false) - ]; - mounted = true; - } - }, - p: function update2(new_ctx, dirty) { - ctx = new_ctx; - if (dirty[0] & /*arbitraryAttributes*/ - 4 && input0.value !== /*attribute*/ - ctx[35].name) { - set_input_value( - input0, - /*attribute*/ - ctx[35].name - ); - } - if (dirty[0] & /*arbitraryAttributes*/ - 4 && input1.value !== /*attribute*/ - ctx[35].value) { - set_input_value( - input1, - /*attribute*/ - ctx[35].value - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block6.name, - type: "each", - source: "(181:8) {#each arbitraryAttributes as attribute, index (attribute)}", - ctx - }); - return block; - } - function create_if_block_34(ctx) { - let sidebarsection0; - let t; - let sidebarsection1; - let current; - sidebarsection0 = new SidebarSection_default({ - props: { - disabled: true, - value: ( - /*$selectedAstElement*/ - ctx[0].arg - ), - large: true, - disableDelete: true, - $$slots: { heading: [create_heading_slot_3] }, - $$scope: { ctx } - }, - $$inline: true - }); - sidebarsection0.$on( - "update", - /*updateArg*/ - ctx[16] - ); - sidebarsection1 = new SidebarSection_default({ - props: { - disableDelete: true, - $$slots: { - input: [create_input_slot_1], - heading: [create_heading_slot_2] - }, - $$scope: { ctx } - }, - $$inline: true - }); - const block = { - c: function create3() { - create_component(sidebarsection0.$$.fragment); - t = space(); - create_component(sidebarsection1.$$.fragment); - }, - l: function claim(nodes) { - claim_component(sidebarsection0.$$.fragment, nodes); - t = claim_space(nodes); - claim_component(sidebarsection1.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(sidebarsection0, target, anchor); - insert_hydration_dev(target, t, anchor); - mount_component(sidebarsection1, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const sidebarsection0_changes = {}; - if (dirty[0] & /*$selectedAstElement*/ - 1) - sidebarsection0_changes.value = /*$selectedAstElement*/ - ctx2[0].arg; - if (dirty[1] & /*$$scope*/ - 32768) { - sidebarsection0_changes.$$scope = { dirty, ctx: ctx2 }; - } - sidebarsection0.$set(sidebarsection0_changes); - const sidebarsection1_changes = {}; - if (dirty[1] & /*$$scope*/ - 32768) { - sidebarsection1_changes.$$scope = { dirty, ctx: ctx2 }; - } - sidebarsection1.$set(sidebarsection1_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(sidebarsection0.$$.fragment, local); - transition_in(sidebarsection1.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(sidebarsection0.$$.fragment, local); - transition_out(sidebarsection1.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - destroy_component(sidebarsection0, detaching); - destroy_component(sidebarsection1, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_34.name, - type: "if", - source: '(207:6) {#if $selectedAstElement.tag === \\"eex_block\\"}', - ctx - }); - return block; - } - function create_heading_slot_3(ctx) { - let t; - const block = { - c: function create3() { - t = text("Block argument"); - }, - l: function claim(nodes) { - t = claim_text(nodes, "Block argument"); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot_3.name, - type: "slot", - source: '(215:10) ', - ctx - }); - return block; - } - function create_heading_slot_2(ctx) { - let t; - const block = { - c: function create3() { - t = text("Block content"); - }, - l: function claim(nodes) { - t = claim_text(nodes, "Block content"); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot_2.name, - type: "slot", - source: '(219:10) ', - ctx - }); - return block; - } - function create_input_slot_1(ctx) { - let p; - let textContent = "The content of eex blocks can't be edited from the visual editor yet. Please use the code editor."; - const block = { - c: function create3() { - p = element("p"); - p.textContent = textContent; - this.h(); - }, - l: function claim(nodes) { - p = claim_element(nodes, "P", { ["data-svelte-h"]: true }); - if (get_svelte_dataset(p) !== "svelte-lwo9ri") - p.textContent = textContent; - this.h(); - }, - h: function hydrate() { - add_location(p, file12, 246, 12, 8915); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, p, anchor); - }, - p: noop2, - d: function destroy(detaching) { - if (detaching) { - detach_dev(p); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_input_slot_1.name, - type: "slot", - source: '(220:10) ', - ctx - }); - return block; - } - function create_if_block_25(ctx) { - let div1; - let div0; - let textContent = "Drop components here"; - let mounted; - let dispose; - const block = { - c: function create3() { - div1 = element("div"); - div0 = element("div"); - div0.textContent = textContent; - this.h(); - }, - l: function claim(nodes) { - div1 = claim_element(nodes, "DIV", { class: true, role: true }); - var div1_nodes = children(div1); - div0 = claim_element(div1_nodes, "DIV", { class: true, ["data-svelte-h"]: true }); - if (get_svelte_dataset(div0) !== "svelte-1mbq8po") - div0.textContent = textContent; - div1_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div0, "class", "flex rounded-lg outline-dashed outline-2 h-full text-center justify-center items-center"); - add_location(div0, file12, 261, 12, 9536); - attr_dev(div1, "class", "absolute bg-white opacity-70 w-full h-full p-4"); - attr_dev(div1, "role", "list"); - toggle_class( - div1, - "opacity-90", - /*isDraggingOver*/ - ctx[3] - ); - add_location(div1, file12, 253, 10, 9229); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div1, anchor); - append_hydration_dev(div1, div0); - if (!mounted) { - dispose = [ - listen_dev(div1, "drop", prevent_default( - /*dropInside*/ - ctx[19] - ), false, true, false, false), - listen_dev( - div1, - "dragover", - /*dragOver*/ - ctx[20], - false, - false, - false, - false - ), - listen_dev( - div1, - "dragleave", - /*dragleave_handler*/ - ctx[30], - false, - false, - false, - false - ) - ]; - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*isDraggingOver*/ - 8) { - toggle_class( - div1, - "opacity-90", - /*isDraggingOver*/ - ctx2[3] - ); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div1); - } - mounted = false; - run_all(dispose); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_25.name, - type: "if", - source: "(227:8) {#if $draggedComponentDefinition && elementCanBeDroppedInTarget($draggedComponentDefinition)}", - ctx - }); - return block; - } - function create_if_block_16(ctx) { - let sidebarsection; - let current; - sidebarsection = new SidebarSection_default({ - props: { - astNodes: ( - /*$selectedAstElement*/ - ctx[0].content - ), - large: true, - disableDelete: true, - $$slots: { heading: [create_heading_slot_1] }, - $$scope: { ctx } - }, - $$inline: true - }); - sidebarsection.$on( - "textChange", - /*textChange_handler_1*/ - ctx[31] - ); - sidebarsection.$on( - "nodesChange", - /*changeNodes*/ - ctx[21] - ); - const block = { - c: function create3() { - create_component(sidebarsection.$$.fragment); - }, - l: function claim(nodes) { - claim_component(sidebarsection.$$.fragment, nodes); - }, - m: function mount(target, anchor) { - mount_component(sidebarsection, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - const sidebarsection_changes = {}; - if (dirty[0] & /*$selectedAstElement*/ - 1) - sidebarsection_changes.astNodes = /*$selectedAstElement*/ - ctx2[0].content; - if (dirty[1] & /*$$scope*/ - 32768) { - sidebarsection_changes.$$scope = { dirty, ctx: ctx2 }; - } - sidebarsection.$set(sidebarsection_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(sidebarsection.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(sidebarsection.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - destroy_component(sidebarsection, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_16.name, - type: "if", - source: "(241:8) {#if $selectedAstElement.content?.length > 0}", - ctx - }); - return block; - } - function create_heading_slot_1(ctx) { - let t; - const block = { - c: function create3() { - t = text("Content"); - }, - l: function claim(nodes) { - t = claim_text(nodes, "Content"); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot_1.name, - type: "slot", - source: '(249:12) ', - ctx - }); - return block; - } - function create_heading_slot(ctx) { - let t; - const block = { - c: function create3() { - t = text("Delete"); - }, - l: function claim(nodes) { - t = claim_text(nodes, "Delete"); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, t, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t); - } - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_heading_slot.name, - type: "slot", - source: '(255:8) ', - ctx - }); - return block; - } - function create_input_slot(ctx) { - let button; - let t0; - let span; - let t1; - let t2; - let t3; - let mounted; - let dispose; - const block = { - c: function create3() { - button = element("button"); - t0 = text("Delete "); - span = element("span"); - t1 = text("current "); - t2 = text( - /*sidebarTitle*/ - ctx[6] - ); - t3 = text(" element"); - this.h(); - }, - l: function claim(nodes) { - button = claim_element(nodes, "BUTTON", { type: true, class: true }); - var button_nodes = children(button); - t0 = claim_text(button_nodes, "Delete "); - span = claim_element(button_nodes, "SPAN", { class: true }); - var span_nodes = children(span); - t1 = claim_text(span_nodes, "current "); - t2 = claim_text( - span_nodes, - /*sidebarTitle*/ - ctx[6] - ); - t3 = claim_text(span_nodes, " element"); - span_nodes.forEach(detach_dev); - button_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span, "class", "sr-only"); - add_location(span, file12, 287, 19, 10541); - attr_dev(button, "type", "button"); - attr_dev(button, "class", "bg-red-500 hover:bg-red-700 active:bg-red-800 text-white font-bold py-2 px-4 rounded outline-2 w-full"); - add_location(button, file12, 282, 10, 10315); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, button, anchor); - append_hydration_dev(button, t0); - append_hydration_dev(button, span); - append_hydration_dev(span, t1); - append_hydration_dev(span, t2); - append_hydration_dev(span, t3); - if (!mounted) { - dispose = listen_dev( - button, - "click", - /*deleteComponent*/ - ctx[18], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty[0] & /*sidebarTitle*/ - 64) - set_data_dev( - t2, - /*sidebarTitle*/ - ctx2[6] - ); - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(button); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_input_slot.name, - type: "slot", - source: '(256:8) ', - ctx - }); - return block; - } - function create_fragment12(ctx) { - let div1; - let div0; - let current_block_type_index; - let if_block; - let current; - const if_block_creators = [create_if_block8, create_else_block4]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*$selectedAstElement*/ - ctx2[0] - ) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - const block = { - c: function create3() { - div1 = element("div"); - div0 = element("div"); - if_block.c(); - this.h(); - }, - l: function claim(nodes) { - div1 = claim_element(nodes, "DIV", { class: true, "data-test-id": true }); - var div1_nodes = children(div1); - div0 = claim_element(div1_nodes, "DIV", { class: true }); - var div0_nodes = children(div0); - if_block.l(div0_nodes); - div0_nodes.forEach(detach_dev); - div1_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div0, "class", "sticky top-0 overflow-y-auto h-screen"); - add_location(div0, file12, 143, 2, 4444); - attr_dev(div1, "class", "w-64 bg-white"); - attr_dev(div1, "data-test-id", "right-sidebar"); - add_location(div1, file12, 142, 0, 4385); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div1, anchor); - append_hydration_dev(div1, div0); - if_blocks[current_block_type_index].m(div0, null); - current = true; - }, - p: function update2(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div0, null); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div1); - } - if_blocks[current_block_type_index].d(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment12.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance12($$self, $$props, $$invalidate) { - let editableAttrs; - let sidebarTitle; - let isRootNode; - let attributesEditable; - let $page; - let $live; - let $selectedAstElement; - let $selectedAstElementId; - let $draggedComponentDefinition; - validate_store(page, "page"); - component_subscribe($$self, page, ($$value) => $$invalidate(32, $page = $$value)); - validate_store(live, "live"); - component_subscribe($$self, live, ($$value) => $$invalidate(33, $live = $$value)); - validate_store(selectedAstElement, "selectedAstElement"); - component_subscribe($$self, selectedAstElement, ($$value) => $$invalidate(0, $selectedAstElement = $$value)); - validate_store(selectedAstElementId, "selectedAstElementId"); - component_subscribe($$self, selectedAstElementId, ($$value) => $$invalidate(22, $selectedAstElementId = $$value)); - validate_store(draggedComponentDefinition, "draggedComponentDefinition"); - component_subscribe($$self, draggedComponentDefinition, ($$value) => $$invalidate(8, $draggedComponentDefinition = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("PropertiesSidebar", slots, []); - const dispatch2 = createEventDispatcher(); - let classList; - let arbitraryAttributes = []; - function addArbitraryAttribute() { - $$invalidate(2, arbitraryAttributes = [...arbitraryAttributes, { name: "", value: "" }]); - } - function saveArbitraryAttribute(index4) { - let attribute = arbitraryAttributes[index4]; - if (attribute.name && attribute.value) { - let node = $selectedAstElement; - if (node && isAstElement(node)) { - node.attrs[attribute.name] = attribute.value; - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - $$invalidate(2, arbitraryAttributes = arbitraryAttributes.filter((_, i) => i !== index4)); - } - } - } - function deleteAttribute(name) { - let node = $selectedAstElement; - if (node && isAstElement(node)) { - delete node.attrs[name]; - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - async function addClasses({ detail: newClasses }) { - let node = $selectedAstElement; - if (node) { - let classes = newClasses.split(" ").map((c) => c.trim()); - node.attrs.class = node.attrs.class ? `${node.attrs.class} ${classes.join(" ")}` : classes.join(" "); - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - function selectParentNode() { - let parentId = getParentNodeId($selectedAstElementId); - setSelection(parentId); - } - async function deleteClass(className) { - let node = $selectedAstElement; - if (node) { - let newClass = node.attrs.class.split(" ").filter((c) => c !== className).join(" "); - node.attrs.class = newClass; - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - async function updateText(e) { - updateNodeContent($selectedAstElement, e.detail); - } - async function updateArg(e) { - let node = $selectedAstElement; - if (node && isAstElement(node)) { - node.arg = e.detail; - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - async function updateAttribute(attrName, e) { - let node = $selectedAstElement; - if (node && isAstElement(node)) { - node.attrs[attrName] = e.detail; - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - } - async function deleteComponent() { - if (!$selectedAstElementId) - return; - if (confirm("Are you sure you want to delete this component?")) { - deleteAstNode($selectedAstElementId); - resetSelection(); - } - } - function dropInside() { - dispatch2("droppedIntoTarget", $selectedAstElement); - } - let isDraggingOver = false; - function dragOver(e) { - e.preventDefault(); - $$invalidate(3, isDraggingOver = true); - if (e.dataTransfer) { - e.dataTransfer.dropEffect = "move"; - } - } - async function changeNodes({ detail: nodes }) { - if ($selectedAstElementId === "root") { - let selectedElement = $page; - selectedElement.ast = nodes; - } else { - let selectedElement = $selectedAstElement; - if (!selectedElement) - return; - selectedElement.content = nodes; - } - $live.pushEvent("update_page_ast", { id: $page.id, ast: $page.ast }); - } - const writable_props = []; - Object_1.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - const delete_handler = (className) => deleteClass(className); - const delete_handler_1 = (name) => deleteAttribute(name); - const textChange_handler = (name, e) => updateAttribute(name, e); - function input0_input_handler(each_value, index4) { - each_value[index4].name = this.value; - $$invalidate(2, arbitraryAttributes); - } - const blur_handler = (index4) => saveArbitraryAttribute(index4); - function input1_input_handler(each_value, index4) { - each_value[index4].value = this.value; - $$invalidate(2, arbitraryAttributes); - } - const blur_handler_1 = (index4) => saveArbitraryAttribute(index4); - const dragleave_handler = () => $$invalidate(3, isDraggingOver = false); - const textChange_handler_1 = (e) => updateText(e); - $$self.$capture_state = () => ({ - createEventDispatcher, - Pill: Pill_default, - SidebarSection: SidebarSection_default, - draggedComponentDefinition, - live, - page, - selectedAstElement, - selectedAstElementId, - isAstElement, - setSelection, - resetSelection, - getParentNodeId, - deleteAstNode, - updateNodeContent, - elementCanBeDroppedInTarget, - dispatch: dispatch2, - classList, - arbitraryAttributes, - addArbitraryAttribute, - saveArbitraryAttribute, - deleteAttribute, - addClasses, - selectParentNode, - deleteClass, - updateText, - updateArg, - updateAttribute, - deleteComponent, - dropInside, - isDraggingOver, - dragOver, - changeNodes, - attributesEditable, - isRootNode, - sidebarTitle, - editableAttrs, - $page, - $live, - $selectedAstElement, - $selectedAstElementId, - $draggedComponentDefinition - }); - $$self.$inject_state = ($$props2) => { - if ("classList" in $$props2) - $$invalidate(1, classList = $$props2.classList); - if ("arbitraryAttributes" in $$props2) - $$invalidate(2, arbitraryAttributes = $$props2.arbitraryAttributes); - if ("isDraggingOver" in $$props2) - $$invalidate(3, isDraggingOver = $$props2.isDraggingOver); - if ("attributesEditable" in $$props2) - $$invalidate(4, attributesEditable = $$props2.attributesEditable); - if ("isRootNode" in $$props2) - $$invalidate(5, isRootNode = $$props2.isRootNode); - if ("sidebarTitle" in $$props2) - $$invalidate(6, sidebarTitle = $$props2.sidebarTitle); - if ("editableAttrs" in $$props2) - $$invalidate(7, editableAttrs = $$props2.editableAttrs); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*$selectedAstElement*/ - 1) { - $: { - let classAttr = $selectedAstElement?.attrs?.class; - $$invalidate(1, classList = classAttr ? classAttr.split(" ").filter((e) => e.trim().length > 0) : []); - } - } - if ($$self.$$.dirty[0] & /*$selectedAstElement*/ - 1) { - $: - $$invalidate(7, editableAttrs = Object.entries($selectedAstElement?.attrs || {}).filter(([k, _]) => k !== "class" && k !== "self_close" && !/data-/.test(k))); - } - if ($$self.$$.dirty[0] & /*$selectedAstElement*/ - 1) { - $: - $$invalidate(6, sidebarTitle = $selectedAstElement?.tag); - } - if ($$self.$$.dirty[0] & /*$selectedAstElementId*/ - 4194304) { - $: - $$invalidate(5, isRootNode = !!$selectedAstElementId && $selectedAstElementId === "root"); - } - if ($$self.$$.dirty[0] & /*$selectedAstElement*/ - 1) { - $: - $$invalidate(4, attributesEditable = !["eex", "eex_block"].includes($selectedAstElement?.tag)); - } - }; - return [ - $selectedAstElement, - classList, - arbitraryAttributes, - isDraggingOver, - attributesEditable, - isRootNode, - sidebarTitle, - editableAttrs, - $draggedComponentDefinition, - addArbitraryAttribute, - saveArbitraryAttribute, - deleteAttribute, - addClasses, - selectParentNode, - deleteClass, - updateText, - updateArg, - updateAttribute, - deleteComponent, - dropInside, - dragOver, - changeNodes, - $selectedAstElementId, - delete_handler, - delete_handler_1, - textChange_handler, - input0_input_handler, - blur_handler, - input1_input_handler, - blur_handler_1, - dragleave_handler, - textChange_handler_1 - ]; - } - var PropertiesSidebar = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance12, create_fragment12, safe_not_equal, {}, null, [-1, -1]); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "PropertiesSidebar", - options, - id: create_fragment12.name - }); - } - }; - create_custom_element(PropertiesSidebar, {}, [], [], true); - var PropertiesSidebar_default = PropertiesSidebar; - - // svelte/components/SelectedElementFloatingMenu.svelte - var SelectedElementFloatingMenu_exports = {}; - __export(SelectedElementFloatingMenu_exports, { - default: () => SelectedElementFloatingMenu_default - }); - var file13 = "svelte/components/SelectedElementFloatingMenu.svelte"; - function create_if_block9(ctx) { - let div; - let div_style_value; - let t; - let dragmenuoption; - let current; - let if_block = ( - /*showMenu*/ - ctx[1] && create_if_block_17(ctx) - ); - dragmenuoption = new DragMenuOption_default({ - props: { element: ( - /*$selectedDomElement*/ - ctx[2] - ) }, - $$inline: true - }); - const block = { - c: function create3() { - div = element("div"); - if (if_block) - if_block.c(); - t = space(); - create_component(dragmenuoption.$$.fragment); - this.h(); - }, - l: function claim(nodes) { - div = claim_element(nodes, "DIV", { class: true, style: true }); - var div_nodes = children(div); - if (if_block) - if_block.l(div_nodes); - div_nodes.forEach(detach_dev); - t = claim_space(nodes); - claim_component(dragmenuoption.$$.fragment, nodes); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "selected-element-menu absolute"); - attr_dev(div, "style", div_style_value = `top: ${/*menuPosition*/ - ctx[3].y}px; left: ${/*menuPosition*/ - ctx[3].x}px;`); - add_location(div, file13, 39, 2, 1389); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, div, anchor); - if (if_block) - if_block.m(div, null); - ctx[7](div); - insert_hydration_dev(target, t, anchor); - mount_component(dragmenuoption, target, anchor); - current = true; - }, - p: function update2(ctx2, dirty) { - if ( - /*showMenu*/ - ctx2[1] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block_17(ctx2); - if_block.c(); - if_block.m(div, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (!current || dirty & /*menuPosition*/ - 8 && div_style_value !== (div_style_value = `top: ${/*menuPosition*/ - ctx2[3].y}px; left: ${/*menuPosition*/ - ctx2[3].x}px;`)) { - attr_dev(div, "style", div_style_value); - } - const dragmenuoption_changes = {}; - if (dirty & /*$selectedDomElement*/ - 4) - dragmenuoption_changes.element = /*$selectedDomElement*/ - ctx2[2]; - dragmenuoption.$set(dragmenuoption_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(dragmenuoption.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(dragmenuoption.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(div); - detach_dev(t); - } - if (if_block) - if_block.d(); - ctx[7](null); - destroy_component(dragmenuoption, detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block9.name, - type: "if", - source: "(34:0) {#if $selectedAstElement}", - ctx - }); - return block; - } - function create_if_block_17(ctx) { - let button; - let span; - let button_style_value; - let mounted; - let dispose; - const block = { - c: function create3() { - button = element("button"); - span = element("span"); - this.h(); - }, - l: function claim(nodes) { - button = claim_element(nodes, "BUTTON", { - class: true, - style: true, - "aria-label": true - }); - var button_nodes = children(button); - span = claim_element(button_nodes, "SPAN", { class: true }); - children(span).forEach(detach_dev); - button_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(span, "class", "hero-trash"); - add_location(span, file13, 51, 8, 1925); - attr_dev(button, "class", "absolute top-0 -m-3 w-6 h-6 rounded-full flex justify-center items-center bg-red-500 text-white hover:bg-red-700 focus:outline-none focus-visible:ring-4 focus-visible:ring-blue-200 active:bg-red-800"); - attr_dev(button, "style", button_style_value = `left: ${/*menuPosition*/ - ctx[3].width}px;`); - attr_dev(button, "aria-label", "Delete component"); - add_location(button, file13, 45, 6, 1564); - }, - m: function mount(target, anchor) { - insert_hydration_dev(target, button, anchor); - append_hydration_dev(button, span); - if (!mounted) { - dispose = listen_dev( - button, - "click", - /*deleteComponent*/ - ctx[5], - false, - false, - false, - false - ); - mounted = true; - } - }, - p: function update2(ctx2, dirty) { - if (dirty & /*menuPosition*/ - 8 && button_style_value !== (button_style_value = `left: ${/*menuPosition*/ - ctx2[3].width}px;`)) { - attr_dev(button, "style", button_style_value); - } - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(button); - } - mounted = false; - dispose(); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_if_block_17.name, - type: "if", - source: "(40:4) {#if showMenu}", - ctx - }); - return block; - } - function create_fragment13(ctx) { - let if_block_anchor; - let current; - let if_block = ( - /*$selectedAstElement*/ - ctx[4] && create_if_block9(ctx) - ); - const block = { - c: function create3() { - if (if_block) - if_block.c(); - if_block_anchor = empty(); - }, - l: function claim(nodes) { - if (if_block) - if_block.l(nodes); - if_block_anchor = empty(); - }, - m: function mount(target, anchor) { - if (if_block) - if_block.m(target, anchor); - insert_hydration_dev(target, if_block_anchor, anchor); - current = true; - }, - p: function update2(ctx2, [dirty]) { - if ( - /*$selectedAstElement*/ - ctx2[4] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty & /*$selectedAstElement*/ - 16) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block9(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i: function intro(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o: function outro(local) { - transition_out(if_block); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(if_block_anchor); - } - if (if_block) - if_block.d(detaching); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment13.name, - type: "component", - source: "", - ctx - }); - return block; - } - function instance13($$self, $$props, $$invalidate) { - let showMenu; - let $selectedAstElementId; - let $selectedDomElement; - let $isDragging; - let $selectedAstElement; - validate_store(selectedAstElementId, "selectedAstElementId"); - component_subscribe($$self, selectedAstElementId, ($$value) => $$invalidate(8, $selectedAstElementId = $$value)); - validate_store(selectedDomElement, "selectedDomElement"); - component_subscribe($$self, selectedDomElement, ($$value) => $$invalidate(2, $selectedDomElement = $$value)); - validate_store(isDragging, "isDragging"); - component_subscribe($$self, isDragging, ($$value) => $$invalidate(6, $isDragging = $$value)); - validate_store(selectedAstElement, "selectedAstElement"); - component_subscribe($$self, selectedAstElement, ($$value) => $$invalidate(4, $selectedAstElement = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("SelectedElementFloatingMenu", slots, []); - let menuDOMElement; - let menuPosition; - async function deleteComponent() { - if (!$selectedAstElementId) - return; - if (confirm("Are you sure you want to delete this component?")) { - deleteAstNode($selectedAstElementId); - resetSelection(); - } - } - const writable_props = []; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - menuDOMElement = $$value; - $$invalidate(0, menuDOMElement); - }); - } - $$self.$capture_state = () => ({ - selectedAstElement, - DragMenuOption: DragMenuOption_default, - isDragging, - selectedAstElementId, - selectedDomElement, - resetSelection, - deleteAstNode, - getBoundingRect, - menuDOMElement, - menuPosition, - deleteComponent, - showMenu, - $selectedAstElementId, - $selectedDomElement, - $isDragging, - $selectedAstElement - }); - $$self.$inject_state = ($$props2) => { - if ("menuDOMElement" in $$props2) - $$invalidate(0, menuDOMElement = $$props2.menuDOMElement); - if ("menuPosition" in $$props2) - $$invalidate(3, menuPosition = $$props2.menuPosition); - if ("showMenu" in $$props2) - $$invalidate(1, showMenu = $$props2.showMenu); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$selectedDomElement, $isDragging*/ - 68) { - $: - $$invalidate(1, showMenu = !!$selectedDomElement && !$isDragging); - } - if ($$self.$$.dirty & /*showMenu, menuDOMElement, $selectedDomElement*/ - 7) { - $: - $$invalidate(3, menuPosition = (() => { - if (!(showMenu && document && menuDOMElement && $selectedDomElement)) { - return { x: 0, y: 0, width: 0, height: 0 }; - } - let relativeWrapperRect2 = getBoundingRect(menuDOMElement.closest(".relative")); - let currentRect = getBoundingRect($selectedDomElement); - return { - x: currentRect.x - relativeWrapperRect2.x, - y: currentRect.y - relativeWrapperRect2.y, - width: currentRect.width, - height: currentRect.height - }; - })()); - } - }; - return [ - menuDOMElement, - showMenu, - $selectedDomElement, - menuPosition, - $selectedAstElement, - deleteComponent, - $isDragging, - div_binding - ]; - } - var SelectedElementFloatingMenu = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance13, create_fragment13, safe_not_equal, {}); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "SelectedElementFloatingMenu", - options, - id: create_fragment13.name - }); - } - }; - create_custom_element(SelectedElementFloatingMenu, {}, [], [], true); - var SelectedElementFloatingMenu_default = SelectedElementFloatingMenu; - - // svelte/components/UiBuilder.svelte - var UiBuilder_exports = {}; - __export(UiBuilder_exports, { - default: () => UiBuilder_default - }); - var file14 = "svelte/components/UiBuilder.svelte"; - function create_fragment14(ctx) { - let backdrop; - let t0; - let div; - let componentssidebar; - let t1; - let pagepreview; - let t2; - let propertiessidebar; - let t3; - let selectedelementfloatingmenu; - let current; - backdrop = new Backdrop_default({ $$inline: true }); - componentssidebar = new ComponentsSidebar_default({ - props: { components: ( - /*components*/ - ctx[0] - ) }, - $$inline: true - }); - pagepreview = new PagePreview_default({ $$inline: true }); - propertiessidebar = new PropertiesSidebar_default({ $$inline: true }); - propertiessidebar.$on( - "droppedIntoTarget", - /*droppedIntoTarget_handler*/ - ctx[5] - ); - selectedelementfloatingmenu = new SelectedElementFloatingMenu_default({ $$inline: true }); - const block = { - c: function create3() { - create_component(backdrop.$$.fragment); - t0 = space(); - div = element("div"); - create_component(componentssidebar.$$.fragment); - t1 = space(); - create_component(pagepreview.$$.fragment); - t2 = space(); - create_component(propertiessidebar.$$.fragment); - t3 = space(); - create_component(selectedelementfloatingmenu.$$.fragment); - this.h(); - }, - l: function claim(nodes) { - claim_component(backdrop.$$.fragment, nodes); - t0 = claim_space(nodes); - div = claim_element(nodes, "DIV", { - class: true, - id: true, - "data-test-id": true - }); - var div_nodes = children(div); - claim_component(componentssidebar.$$.fragment, div_nodes); - t1 = claim_space(div_nodes); - claim_component(pagepreview.$$.fragment, div_nodes); - t2 = claim_space(div_nodes); - claim_component(propertiessidebar.$$.fragment, div_nodes); - t3 = claim_space(div_nodes); - claim_component(selectedelementfloatingmenu.$$.fragment, div_nodes); - div_nodes.forEach(detach_dev); - this.h(); - }, - h: function hydrate() { - attr_dev(div, "class", "flex min-h-screen bg-gray-100"); - attr_dev(div, "id", "ui-builder-app-container"); - attr_dev(div, "data-test-id", "app-container"); - add_location(div, file14, 33, 0, 1011); - }, - m: function mount(target, anchor) { - mount_component(backdrop, target, anchor); - insert_hydration_dev(target, t0, anchor); - insert_hydration_dev(target, div, anchor); - mount_component(componentssidebar, div, null); - append_hydration_dev(div, t1); - mount_component(pagepreview, div, null); - append_hydration_dev(div, t2); - mount_component(propertiessidebar, div, null); - append_hydration_dev(div, t3); - mount_component(selectedelementfloatingmenu, div, null); - current = true; - }, - p: function update2(ctx2, [dirty]) { - const componentssidebar_changes = {}; - if (dirty & /*components*/ - 1) - componentssidebar_changes.components = /*components*/ - ctx2[0]; - componentssidebar.$set(componentssidebar_changes); - }, - i: function intro(local) { - if (current) - return; - transition_in(backdrop.$$.fragment, local); - transition_in(componentssidebar.$$.fragment, local); - transition_in(pagepreview.$$.fragment, local); - transition_in(propertiessidebar.$$.fragment, local); - transition_in(selectedelementfloatingmenu.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(backdrop.$$.fragment, local); - transition_out(componentssidebar.$$.fragment, local); - transition_out(pagepreview.$$.fragment, local); - transition_out(propertiessidebar.$$.fragment, local); - transition_out(selectedelementfloatingmenu.$$.fragment, local); - current = false; - }, - d: function destroy(detaching) { - if (detaching) { - detach_dev(t0); - detach_dev(div); - } - destroy_component(backdrop, detaching); - destroy_component(componentssidebar); - destroy_component(pagepreview); - destroy_component(propertiessidebar); - destroy_component(selectedelementfloatingmenu); - } - }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment14.name, - type: "component", - source: "", - ctx - }); - return block; - } - function addBasicComponentToTarget(e) { - } - function instance14($$self, $$props, $$invalidate) { - let $liveStore; - let $tailwindInputStore; - let $tailwindConfigStore; - let $pageStore; - validate_store(live, "liveStore"); - component_subscribe($$self, live, ($$value) => $$invalidate(6, $liveStore = $$value)); - validate_store(tailwindInput, "tailwindInputStore"); - component_subscribe($$self, tailwindInput, ($$value) => $$invalidate(7, $tailwindInputStore = $$value)); - validate_store(tailwindConfig, "tailwindConfigStore"); - component_subscribe($$self, tailwindConfig, ($$value) => $$invalidate(8, $tailwindConfigStore = $$value)); - validate_store(page, "pageStore"); - component_subscribe($$self, page, ($$value) => $$invalidate(9, $pageStore = $$value)); - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots("UiBuilder", slots, []); - let { components } = $$props; - let { page: page2 } = $$props; - let { tailwindConfig: tailwindConfig2 } = $$props; - let { tailwindInput: tailwindInput2 } = $$props; - let { live: live2 } = $$props; - onDestroy(() => { - resetStores(); - }); - $$self.$$.on_mount.push(function() { - if (components === void 0 && !("components" in $$props || $$self.$$.bound[$$self.$$.props["components"]])) { - console.warn(" was created without expected prop 'components'"); - } - if (page2 === void 0 && !("page" in $$props || $$self.$$.bound[$$self.$$.props["page"]])) { - console.warn(" was created without expected prop 'page'"); - } - if (tailwindConfig2 === void 0 && !("tailwindConfig" in $$props || $$self.$$.bound[$$self.$$.props["tailwindConfig"]])) { - console.warn(" was created without expected prop 'tailwindConfig'"); - } - if (tailwindInput2 === void 0 && !("tailwindInput" in $$props || $$self.$$.bound[$$self.$$.props["tailwindInput"]])) { - console.warn(" was created without expected prop 'tailwindInput'"); - } - if (live2 === void 0 && !("live" in $$props || $$self.$$.bound[$$self.$$.props["live"]])) { - console.warn(" was created without expected prop 'live'"); - } - }); - const writable_props = ["components", "page", "tailwindConfig", "tailwindInput", "live"]; - Object.keys($$props).forEach((key) => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$" && key !== "slot") - console.warn(` was created with unknown prop '${key}'`); - }); - const droppedIntoTarget_handler = (e) => addBasicComponentToTarget(e.detail); - $$self.$$set = ($$props2) => { - if ("components" in $$props2) - $$invalidate(0, components = $$props2.components); - if ("page" in $$props2) - $$invalidate(1, page2 = $$props2.page); - if ("tailwindConfig" in $$props2) - $$invalidate(2, tailwindConfig2 = $$props2.tailwindConfig); - if ("tailwindInput" in $$props2) - $$invalidate(3, tailwindInput2 = $$props2.tailwindInput); - if ("live" in $$props2) - $$invalidate(4, live2 = $$props2.live); - }; - $$self.$capture_state = () => ({ - onDestroy, - ComponentsSidebar: ComponentsSidebar_default, - Backdrop: Backdrop_default, - PagePreview: PagePreview_default, - PropertiesSidebar: PropertiesSidebar_default, - SelectedElementFloatingMenu: SelectedElementFloatingMenu_default, - pageStore: page, - resetStores, - liveStore: live, - tailwindConfigStore: tailwindConfig, - tailwindInputStore: tailwindInput, - components, - page: page2, - tailwindConfig: tailwindConfig2, - tailwindInput: tailwindInput2, - live: live2, - addBasicComponentToTarget, - $liveStore, - $tailwindInputStore, - $tailwindConfigStore, - $pageStore - }); - $$self.$inject_state = ($$props2) => { - if ("components" in $$props2) - $$invalidate(0, components = $$props2.components); - if ("page" in $$props2) - $$invalidate(1, page2 = $$props2.page); - if ("tailwindConfig" in $$props2) - $$invalidate(2, tailwindConfig2 = $$props2.tailwindConfig); - if ("tailwindInput" in $$props2) - $$invalidate(3, tailwindInput2 = $$props2.tailwindInput); - if ("live" in $$props2) - $$invalidate(4, live2 = $$props2.live); - }; - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*page*/ - 2) { - $: - set_store_value(page, $pageStore = page2, $pageStore); - } - if ($$self.$$.dirty & /*tailwindConfig*/ - 4) { - $: - set_store_value(tailwindConfig, $tailwindConfigStore = tailwindConfig2, $tailwindConfigStore); - } - if ($$self.$$.dirty & /*tailwindInput*/ - 8) { - $: - set_store_value(tailwindInput, $tailwindInputStore = tailwindInput2, $tailwindInputStore); - } - if ($$self.$$.dirty & /*live*/ - 16) { - $: - set_store_value(live, $liveStore = live2, $liveStore); - } - }; - return [ - components, - page2, - tailwindConfig2, - tailwindInput2, - live2, - droppedIntoTarget_handler - ]; - } - var UiBuilder = class extends SvelteComponentDev { - constructor(options) { - super(options); - init2(this, options, instance14, create_fragment14, safe_not_equal, { - components: 0, - page: 1, - tailwindConfig: 2, - tailwindInput: 3, - live: 4 - }); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "UiBuilder", - options, - id: create_fragment14.name - }); - } - get components() { - return this.$$.ctx[0]; - } - set components(components) { - this.$$set({ components }); - flush(); - } - get page() { - return this.$$.ctx[1]; - } - set page(page2) { - this.$$set({ page: page2 }); - flush(); - } - get tailwindConfig() { - return this.$$.ctx[2]; - } - set tailwindConfig(tailwindConfig2) { - this.$$set({ tailwindConfig: tailwindConfig2 }); - flush(); - } - get tailwindInput() { - return this.$$.ctx[3]; - } - set tailwindInput(tailwindInput2) { - this.$$set({ tailwindInput: tailwindInput2 }); - flush(); - } - get live() { - return this.$$.ctx[4]; - } - set live(live2) { - this.$$set({ live: live2 }); - flush(); - } - }; - create_custom_element(UiBuilder, { "components": {}, "page": {}, "tailwindConfig": {}, "tailwindInput": {}, "live": {} }, [], [], true); - var UiBuilder_default = UiBuilder; - - // import-glob:../svelte/**/*.svelte - var modules = [Backdrop_exports, BrowserFrame_exports, CodeEditor_exports, ComponentsSidebar_exports, LayoutAstNode_exports, PageAstNode_exports, PagePreview_exports, PageWrapper_exports, Pill_exports, PropertiesSidebar_exports, SelectedElementFloatingMenu_exports, DragMenuOption_exports, SidebarSection_exports, UiBuilder_exports]; - var __default = modules; - var filenames = ["../svelte/components/Backdrop.svelte", "../svelte/components/BrowserFrame.svelte", "../svelte/components/CodeEditor.svelte", "../svelte/components/ComponentsSidebar.svelte", "../svelte/components/LayoutAstNode.svelte", "../svelte/components/PageAstNode.svelte", "../svelte/components/PagePreview.svelte", "../svelte/components/PageWrapper.svelte", "../svelte/components/Pill.svelte", "../svelte/components/PropertiesSidebar.svelte", "../svelte/components/SelectedElementFloatingMenu.svelte", "../svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte", "../svelte/components/SidebarSection.svelte", "../svelte/components/UiBuilder.svelte"]; - - // js/beacon_live_admin.js - var Hooks = {}; - Hooks.CodeEditorHook = CodeEditorHook; - import_topbar.default.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" }); - window.addEventListener("phx:page-loading-start", (_info) => import_topbar.default.show(300)); - window.addEventListener("phx:page-loading-stop", (_info) => import_topbar.default.hide()); - window.addEventListener("beacon_admin:clipcopy", (event) => { - const result_id = `${event.target.id}-copy-to-clipboard-result`; - const el = document.getElementById(result_id); - if ("clipboard" in navigator) { - if (event.target.tagName === "INPUT") { - txt = event.target.value; - } else { - txt = event.target.textContent; - } - navigator.clipboard.writeText(txt).then(() => { - el.innerText = "Copied to clipboard"; - el.classList.remove("invisible", "text-red-500", "opacity-0"); - el.classList.add("text-green-500", "opacity-100", "-translate-y-2"); - setTimeout(function() { - el.classList.remove("text-green-500", "opacity-100", "-translate-y-2"); - el.classList.add("invisible", "text-red-500", "opacity-0"); - }, 2e3); - }).catch(() => { - el.innerText = "Could not copy"; - el.classList.remove("invisible", "text-green-500", "opacity-0"); - el.classList.add("text-red-500", "opacity-100", "-translate-y-2"); - }); - } else { - alert("Sorry, your browser does not support clipboard copy."); - } - }); - var socketPath = document.querySelector("html").getAttribute("phx-socket") || "/live"; - var csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content"); - var liveSocket = new LiveView.LiveSocket(socketPath, Phoenix.Socket, { - hooks: { ...getHooks(__exports), ...Hooks }, - params: { _csrf_token: csrfToken } - }); - liveSocket.connect(); - window.liveSocket = liveSocket; -})(); -/** - * @license MIT - * topbar 2.0.0, 2023-02-04 - * https://buunguyen.github.io/topbar - * Copyright (c) 2021 Buu Nguyen - */ -/*! Bundled license information: - -cssesc/cssesc.js: - (*! https://mths.be/cssesc v3.0.0 by @mathias *) -*/ diff --git a/priv/static/beacon_live_admin.js.map b/priv/static/beacon_live_admin.js.map deleted file mode 100644 index 6bd4cdd0..00000000 --- a/priv/static/beacon_live_admin.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../assets/vendor/topbar.js", "../../assets/node_modules/picocolors/picocolors.browser.js", "../../assets/node_modules/postcss/lib/css-syntax-error.js", "../../assets/node_modules/postcss/lib/stringifier.js", "../../assets/node_modules/postcss/lib/stringify.js", "../../assets/node_modules/postcss/lib/symbols.js", "../../assets/node_modules/postcss/lib/node.js", "../../assets/node_modules/postcss/lib/comment.js", "../../assets/node_modules/postcss/lib/declaration.js", "../../assets/node_modules/postcss/lib/container.js", "../../assets/node_modules/postcss/lib/at-rule.js", "../../assets/node_modules/postcss/lib/document.js", "../../assets/node_modules/nanoid/non-secure/index.cjs", "../../assets/node_modules/postcss/lib/previous-map.js", "../../assets/node_modules/postcss/lib/input.js", "../../assets/node_modules/postcss/lib/root.js", "../../assets/node_modules/postcss/lib/list.js", "../../assets/node_modules/postcss/lib/rule.js", "../../assets/node_modules/postcss/lib/fromJSON.js", "../../assets/node_modules/postcss/lib/map-generator.js", "../../assets/node_modules/postcss/lib/tokenize.js", "../../assets/node_modules/postcss/lib/parser.js", "../../assets/node_modules/postcss/lib/parse.js", "../../assets/node_modules/postcss/lib/warning.js", "../../assets/node_modules/postcss/lib/result.js", "../../assets/node_modules/postcss/lib/warn-once.js", "../../assets/node_modules/postcss/lib/lazy-result.js", "../../assets/node_modules/postcss/lib/no-work-result.js", "../../assets/node_modules/postcss/lib/processor.js", "../../assets/node_modules/postcss/lib/postcss.js", "../../assets/node_modules/postcss-selector-parser/dist/util/unesc.js", "../../assets/node_modules/postcss-selector-parser/dist/util/getProp.js", "../../assets/node_modules/postcss-selector-parser/dist/util/ensureObject.js", "../../assets/node_modules/postcss-selector-parser/dist/util/stripComments.js", "../../assets/node_modules/postcss-selector-parser/dist/util/index.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/node.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/types.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/container.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/root.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/selector.js", "../../assets/node_modules/cssesc/cssesc.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/className.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/comment.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/id.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/namespace.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/tag.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/string.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/pseudo.js", "../../assets/node_modules/util-deprecate/browser.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/attribute.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/universal.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/combinator.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/nesting.js", "../../assets/node_modules/postcss-selector-parser/dist/sortAscending.js", "../../assets/node_modules/postcss-selector-parser/dist/tokenTypes.js", "../../assets/node_modules/postcss-selector-parser/dist/tokenize.js", "../../assets/node_modules/postcss-selector-parser/dist/parser.js", "../../assets/node_modules/postcss-selector-parser/dist/processor.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/constructors.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/guards.js", "../../assets/node_modules/postcss-selector-parser/dist/selectors/index.js", "../../assets/node_modules/postcss-selector-parser/dist/index.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/postcss-nested/index.js", "../../assets/node_modules/camelcase-css/index-es5.js", "../../assets/node_modules/postcss-js/objectifier.js", "../../assets/node_modules/postcss-js/parser.js", "../../assets/node_modules/postcss-js/process-result.js", "../../assets/node_modules/postcss-js/async.js", "../../assets/node_modules/postcss-js/sync.js", "../../assets/node_modules/postcss-js/index.js", "../../assets/node_modules/dlv/index.js", "../../assets/node_modules/didyoumean/didYouMean-1.2.1.js", "../../assets/js/beacon_live_admin.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js", "../../deps/live_monaco_editor/assets/node_modules/state-local/lib/es/state-local.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/config/index.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/utils/curry.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/validators/index.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/utils/compose.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js", "../../deps/live_monaco_editor/assets/node_modules/@monaco-editor/loader/lib/es/loader/index.js", "../../deps/live_monaco_editor/assets/js/live_monaco_editor/editor/themes.js", "../../deps/live_monaco_editor/assets/js/live_monaco_editor/editor/code_editor.js", "../../deps/live_monaco_editor/assets/js/live_monaco_editor/hooks/code_editor.js", "../../deps/live_svelte/assets/js/live_svelte/utils.js", "../../deps/live_svelte/assets/js/live_svelte/render.js", "../../deps/live_svelte/assets/js/live_svelte/hooks.js", "import-glob:../svelte/**/*.svelte", "../../assets/node_modules/svelte/src/runtime/internal/utils.js", "../../assets/node_modules/svelte/src/runtime/internal/environment.js", "../../assets/node_modules/svelte/src/runtime/internal/loop.js", "../../assets/node_modules/svelte/src/runtime/internal/globals.js", "../../assets/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js", "../../assets/node_modules/svelte/src/runtime/internal/dom.js", "../../assets/node_modules/svelte/src/runtime/internal/style_manager.js", "../../assets/node_modules/svelte/src/runtime/internal/lifecycle.js", "../../assets/node_modules/svelte/src/runtime/internal/scheduler.js", "../../assets/node_modules/svelte/src/runtime/internal/transitions.js", "../../assets/node_modules/svelte/src/runtime/internal/each.js", "../../assets/node_modules/svelte/src/runtime/internal/spread.js", "../../assets/node_modules/svelte/src/shared/boolean_attributes.js", "../../assets/node_modules/svelte/src/shared/utils/names.js", "../../assets/node_modules/svelte/src/runtime/internal/Component.js", "../../assets/node_modules/svelte/src/shared/version.js", "../../assets/node_modules/svelte/src/runtime/internal/dev.js", "../../assets/node_modules/svelte/src/runtime/internal/disclose-version/index.js", "../../assets/node_modules/svelte/src/runtime/transition/index.js", "../../assets/node_modules/svelte/src/runtime/store/index.js", "../../assets/svelte/components/Backdrop.svelte", "../../assets/svelte/components/BrowserFrame.svelte", "../../assets/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js", "../../assets/node_modules/state-local/lib/es/state-local.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/config/index.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/utils/curry.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/validators/index.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/utils/compose.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js", "../../assets/node_modules/@monaco-editor/loader/lib/es/loader/index.js", "../../assets/svelte/components/CodeEditor.svelte", "../../assets/svelte/utils/animations.ts", "../../assets/svelte/stores/currentComponentCategory.ts", "../../assets/svelte/stores/dragAndDrop.ts", "../../assets/svelte/components/ComponentsSidebar.svelte", "../../assets/svelte/stores/page.ts", "../../assets/svelte/components/LayoutAstNode.svelte", "../../assets/svelte/stores/live.ts", "../../assets/svelte/utils/ast-helpers.ts", "../../assets/svelte/utils/ast-manipulation.ts", "../../assets/svelte/utils/drag-helpers.ts", "../../assets/svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte", "../../assets/svelte/components/PageAstNode.svelte", "../../assets/svelte/components/PagePreview.svelte", "../../assets/svelte/stores/tailwindConfig.ts", "../../assets/svelte/stores/tailwindInput.ts", "../../assets/node_modules/postcss/lib/postcss.mjs", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/@alloc/quick-lru/index.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/value-parser/parse.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/value-parser/walk.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/value-parser/stringify.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/value-parser/unit.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/value-parser/index.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/stubs/config.full.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/src/index.ts", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/src/stubs/tailwindcss/utils/log.ts", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/normalizeTailwindDirectives.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/src/stubs/fs.ts", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/expandTailwindAtRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/sharedState.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/generateRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/parseObjectStyles.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/isPlainObject.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/prefixSelector.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/escapeCommas.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/colorNames.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/color.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/withAlphaVariable.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/splitAtTopLevelOnly.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/parseBoxShadowValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/dataTypes.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/negateValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/validateFormalSyntax.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/src/stubs/picocolors.ts", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/featureFlags.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/pluginUtils.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/formatVariantSelector.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/escapeClassName.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/pseudoElements.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/nameClass.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/setupContextUtils.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/transformThemeValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/src/stubs/path.ts", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/corePlugins.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/createUtilityPlugin.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/buildMediaQuery.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/parseAnimationValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/flattenColorPalette.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/toColorValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/normalizeScreens.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/removeAlphaVariables.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/toPath.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/isSyntacticallyValidPropertyValue.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/bigSign.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/remap-bitfield.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/offsets.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/applyImportantSelector.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/cloneNodes.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/regex.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/defaultExtractor.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/expandApplyAtRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/evaluateTailwindFunctions.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/substituteScreenAtRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/resolveDefaultsAtRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/collapseAdjacentRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/collapseDuplicateDeclarations.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/partitionApplyAtRules.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/lib/detectNesting.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/processTailwindFeatures.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/corePluginList.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/configurePlugins.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/public/colors.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/defaults.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/normalizeConfig.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/cloneDeep.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/resolveConfig.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/util/getAllConfigs.js", "../../assets/node_modules/@mhsdesign/jit-browser-tailwindcss/node_modules/tailwindcss/src/public/resolve-config.js", "../../assets/node_modules/postcss-js/index.mjs", "../../assets/svelte/components/PageWrapper.svelte", "../../assets/svelte/components/Pill.svelte", "../../assets/svelte/components/SidebarSection.svelte", "../../assets/svelte/components/PropertiesSidebar.svelte", "../../assets/svelte/components/SelectedElementFloatingMenu.svelte", "../../assets/svelte/components/UiBuilder.svelte"], - "sourcesContent": ["/**\n * @license MIT\n * topbar 2.0.0, 2023-02-04\n * https://buunguyen.github.io/topbar\n * Copyright (c) 2021 Buu Nguyen\n */\n;(function (window, document) {\n \"use strict\"\n\n // https://gist.github.com/paulirish/1579671\n ;(function () {\n var lastTime = 0\n var vendors = [\"ms\", \"moz\", \"webkit\", \"o\"]\n for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n window.requestAnimationFrame = window[vendors[x] + \"RequestAnimationFrame\"]\n window.cancelAnimationFrame =\n window[vendors[x] + \"CancelAnimationFrame\"] || window[vendors[x] + \"CancelRequestAnimationFrame\"]\n }\n if (!window.requestAnimationFrame)\n window.requestAnimationFrame = function (callback, element) {\n var currTime = new Date().getTime()\n var timeToCall = Math.max(0, 16 - (currTime - lastTime))\n var id = window.setTimeout(function () {\n callback(currTime + timeToCall)\n }, timeToCall)\n lastTime = currTime + timeToCall\n return id\n }\n if (!window.cancelAnimationFrame)\n window.cancelAnimationFrame = function (id) {\n clearTimeout(id)\n }\n })()\n\n var canvas,\n currentProgress,\n showing,\n progressTimerId = null,\n fadeTimerId = null,\n delayTimerId = null,\n addEvent = function (elem, type, handler) {\n if (elem.addEventListener) elem.addEventListener(type, handler, false)\n else if (elem.attachEvent) elem.attachEvent(\"on\" + type, handler)\n else elem[\"on\" + type] = handler\n },\n options = {\n autoRun: true,\n barThickness: 3,\n barColors: {\n 0: \"rgba(26, 188, 156, .9)\",\n \".25\": \"rgba(52, 152, 219, .9)\",\n \".50\": \"rgba(241, 196, 15, .9)\",\n \".75\": \"rgba(230, 126, 34, .9)\",\n \"1.0\": \"rgba(211, 84, 0, .9)\",\n },\n shadowBlur: 10,\n shadowColor: \"rgba(0, 0, 0, .6)\",\n className: null,\n },\n repaint = function () {\n canvas.width = window.innerWidth\n canvas.height = options.barThickness * 5 // need space for shadow\n\n var ctx = canvas.getContext(\"2d\")\n ctx.shadowBlur = options.shadowBlur\n ctx.shadowColor = options.shadowColor\n\n var lineGradient = ctx.createLinearGradient(0, 0, canvas.width, 0)\n for (var stop in options.barColors) lineGradient.addColorStop(stop, options.barColors[stop])\n ctx.lineWidth = options.barThickness\n ctx.beginPath()\n ctx.moveTo(0, options.barThickness / 2)\n ctx.lineTo(Math.ceil(currentProgress * canvas.width), options.barThickness / 2)\n ctx.strokeStyle = lineGradient\n ctx.stroke()\n },\n createCanvas = function () {\n canvas = document.createElement(\"canvas\")\n var style = canvas.style\n style.position = \"fixed\"\n style.top = style.left = style.right = style.margin = style.padding = 0\n style.zIndex = 100001\n style.display = \"none\"\n if (options.className) canvas.classList.add(options.className)\n document.body.appendChild(canvas)\n addEvent(window, \"resize\", repaint)\n },\n topbar = {\n config: function (opts) {\n for (var key in opts) if (options.hasOwnProperty(key)) options[key] = opts[key]\n },\n show: function (delay) {\n if (showing) return\n if (delay) {\n if (delayTimerId) return\n delayTimerId = setTimeout(() => topbar.show(), delay)\n } else {\n showing = true\n if (fadeTimerId !== null) window.cancelAnimationFrame(fadeTimerId)\n if (!canvas) createCanvas()\n canvas.style.opacity = 1\n canvas.style.display = \"block\"\n topbar.progress(0)\n if (options.autoRun) {\n ;(function loop() {\n progressTimerId = window.requestAnimationFrame(loop)\n topbar.progress(\"+\" + 0.05 * Math.pow(1 - Math.sqrt(currentProgress), 2))\n })()\n }\n }\n },\n progress: function (to) {\n if (typeof to === \"undefined\") return currentProgress\n if (typeof to === \"string\") {\n to = (to.indexOf(\"+\") >= 0 || to.indexOf(\"-\") >= 0 ? currentProgress : 0) + parseFloat(to)\n }\n currentProgress = to > 1 ? 1 : to\n repaint()\n return currentProgress\n },\n hide: function () {\n clearTimeout(delayTimerId)\n delayTimerId = null\n if (!showing) return\n showing = false\n if (progressTimerId != null) {\n window.cancelAnimationFrame(progressTimerId)\n progressTimerId = null\n }\n ;(function loop() {\n if (topbar.progress(\"+.1\") >= 1) {\n canvas.style.opacity -= 0.05\n if (canvas.style.opacity <= 0.05) {\n canvas.style.display = \"none\"\n fadeTimerId = null\n return\n }\n }\n fadeTimerId = window.requestAnimationFrame(loop)\n })()\n },\n }\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = topbar\n } else if (typeof define === \"function\" && define.amd) {\n define(function () {\n return topbar\n })\n } else {\n this.topbar = topbar\n }\n}).call(this, window, document)\n", "var x=String;\nvar create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};\nmodule.exports=create();\nmodule.exports.createColors = create;\n", "'use strict'\n\nlet pico = require('picocolors')\n\nlet terminalHighlight = require('./terminal-highlight')\n\nclass CssSyntaxError extends Error {\n constructor(message, line, column, source, file, plugin) {\n super(message)\n this.name = 'CssSyntaxError'\n this.reason = message\n\n if (file) {\n this.file = file\n }\n if (source) {\n this.source = source\n }\n if (plugin) {\n this.plugin = plugin\n }\n if (typeof line !== 'undefined' && typeof column !== 'undefined') {\n if (typeof line === 'number') {\n this.line = line\n this.column = column\n } else {\n this.line = line.line\n this.column = line.column\n this.endLine = column.line\n this.endColumn = column.column\n }\n }\n\n this.setMessage()\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CssSyntaxError)\n }\n }\n\n setMessage() {\n this.message = this.plugin ? this.plugin + ': ' : ''\n this.message += this.file ? this.file : ''\n if (typeof this.line !== 'undefined') {\n this.message += ':' + this.line + ':' + this.column\n }\n this.message += ': ' + this.reason\n }\n\n showSourceCode(color) {\n if (!this.source) return ''\n\n let css = this.source\n if (color == null) color = pico.isColorSupported\n\n let aside = text => text\n let mark = text => text\n let highlight = text => text\n if (color) {\n let { bold, gray, red } = pico.createColors(true)\n mark = text => bold(red(text))\n aside = text => gray(text)\n if (terminalHighlight) {\n highlight = text => terminalHighlight(text)\n }\n }\n\n let lines = css.split(/\\r?\\n/)\n let start = Math.max(this.line - 3, 0)\n let end = Math.min(this.line + 2, lines.length)\n let maxWidth = String(end).length\n\n return lines\n .slice(start, end)\n .map((line, index) => {\n let number = start + 1 + index\n let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '\n if (number === this.line) {\n if (line.length > 160) {\n let padding = 20\n let subLineStart = Math.max(0, this.column - padding)\n let subLineEnd = Math.max(\n this.column + padding,\n this.endColumn + padding\n )\n let subLine = line.slice(subLineStart, subLineEnd)\n\n let spacing =\n aside(gutter.replace(/\\d/g, ' ')) +\n line\n .slice(0, Math.min(this.column - 1, padding - 1))\n .replace(/[^\\t]/g, ' ')\n\n return (\n mark('>') +\n aside(gutter) +\n highlight(subLine) +\n '\\n ' +\n spacing +\n mark('^')\n )\n }\n\n let spacing =\n aside(gutter.replace(/\\d/g, ' ')) +\n line.slice(0, this.column - 1).replace(/[^\\t]/g, ' ')\n\n return (\n mark('>') +\n aside(gutter) +\n highlight(line) +\n '\\n ' +\n spacing +\n mark('^')\n )\n }\n\n return ' ' + aside(gutter) + highlight(line)\n })\n .join('\\n')\n }\n\n toString() {\n let code = this.showSourceCode()\n if (code) {\n code = '\\n\\n' + code + '\\n'\n }\n return this.name + ': ' + this.message + code\n }\n}\n\nmodule.exports = CssSyntaxError\nCssSyntaxError.default = CssSyntaxError\n", "'use strict'\n\nconst DEFAULT_RAW = {\n after: '\\n',\n beforeClose: '\\n',\n beforeComment: '\\n',\n beforeDecl: '\\n',\n beforeOpen: ' ',\n beforeRule: '\\n',\n colon: ': ',\n commentLeft: ' ',\n commentRight: ' ',\n emptyBody: '',\n indent: ' ',\n semicolon: false\n}\n\nfunction capitalize(str) {\n return str[0].toUpperCase() + str.slice(1)\n}\n\nclass Stringifier {\n constructor(builder) {\n this.builder = builder\n }\n\n atrule(node, semicolon) {\n let name = '@' + node.name\n let params = node.params ? this.rawValue(node, 'params') : ''\n\n if (typeof node.raws.afterName !== 'undefined') {\n name += node.raws.afterName\n } else if (params) {\n name += ' '\n }\n\n if (node.nodes) {\n this.block(node, name + params)\n } else {\n let end = (node.raws.between || '') + (semicolon ? ';' : '')\n this.builder(name + params + end, node)\n }\n }\n\n beforeAfter(node, detect) {\n let value\n if (node.type === 'decl') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (node.type === 'comment') {\n value = this.raw(node, null, 'beforeComment')\n } else if (detect === 'before') {\n value = this.raw(node, null, 'beforeRule')\n } else {\n value = this.raw(node, null, 'beforeClose')\n }\n\n let buf = node.parent\n let depth = 0\n while (buf && buf.type !== 'root') {\n depth += 1\n buf = buf.parent\n }\n\n if (value.includes('\\n')) {\n let indent = this.raw(node, null, 'indent')\n if (indent.length) {\n for (let step = 0; step < depth; step++) value += indent\n }\n }\n\n return value\n }\n\n block(node, start) {\n let between = this.raw(node, 'between', 'beforeOpen')\n this.builder(start + between + '{', node, 'start')\n\n let after\n if (node.nodes && node.nodes.length) {\n this.body(node)\n after = this.raw(node, 'after')\n } else {\n after = this.raw(node, 'after', 'emptyBody')\n }\n\n if (after) this.builder(after)\n this.builder('}', node, 'end')\n }\n\n body(node) {\n let last = node.nodes.length - 1\n while (last > 0) {\n if (node.nodes[last].type !== 'comment') break\n last -= 1\n }\n\n let semicolon = this.raw(node, 'semicolon')\n for (let i = 0; i < node.nodes.length; i++) {\n let child = node.nodes[i]\n let before = this.raw(child, 'before')\n if (before) this.builder(before)\n this.stringify(child, last !== i || semicolon)\n }\n }\n\n comment(node) {\n let left = this.raw(node, 'left', 'commentLeft')\n let right = this.raw(node, 'right', 'commentRight')\n this.builder('/*' + left + node.text + right + '*/', node)\n }\n\n decl(node, semicolon) {\n let between = this.raw(node, 'between', 'colon')\n let string = node.prop + between + this.rawValue(node, 'value')\n\n if (node.important) {\n string += node.raws.important || ' !important'\n }\n\n if (semicolon) string += ';'\n this.builder(string, node)\n }\n\n document(node) {\n this.body(node)\n }\n\n raw(node, own, detect) {\n let value\n if (!detect) detect = own\n\n // Already had\n if (own) {\n value = node.raws[own]\n if (typeof value !== 'undefined') return value\n }\n\n let parent = node.parent\n\n if (detect === 'before') {\n // Hack for first rule in CSS\n if (!parent || (parent.type === 'root' && parent.first === node)) {\n return ''\n }\n\n // `root` nodes in `document` should use only their own raws\n if (parent && parent.type === 'document') {\n return ''\n }\n }\n\n // Floating child without parent\n if (!parent) return DEFAULT_RAW[detect]\n\n // Detect style by other nodes\n let root = node.root()\n if (!root.rawCache) root.rawCache = {}\n if (typeof root.rawCache[detect] !== 'undefined') {\n return root.rawCache[detect]\n }\n\n if (detect === 'before' || detect === 'after') {\n return this.beforeAfter(node, detect)\n } else {\n let method = 'raw' + capitalize(detect)\n if (this[method]) {\n value = this[method](root, node)\n } else {\n root.walk(i => {\n value = i.raws[own]\n if (typeof value !== 'undefined') return false\n })\n }\n }\n\n if (typeof value === 'undefined') value = DEFAULT_RAW[detect]\n\n root.rawCache[detect] = value\n return value\n }\n\n rawBeforeClose(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length > 0) {\n if (typeof i.raws.after !== 'undefined') {\n value = i.raws.after\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawBeforeComment(root, node) {\n let value\n root.walkComments(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeDecl')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeDecl(root, node) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n })\n if (typeof value === 'undefined') {\n value = this.raw(node, null, 'beforeRule')\n } else if (value) {\n value = value.replace(/\\S/g, '')\n }\n return value\n }\n\n rawBeforeOpen(root) {\n let value\n root.walk(i => {\n if (i.type !== 'decl') {\n value = i.raws.between\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawBeforeRule(root) {\n let value\n root.walk(i => {\n if (i.nodes && (i.parent !== root || root.first !== i)) {\n if (typeof i.raws.before !== 'undefined') {\n value = i.raws.before\n if (value.includes('\\n')) {\n value = value.replace(/[^\\n]+$/, '')\n }\n return false\n }\n }\n })\n if (value) value = value.replace(/\\S/g, '')\n return value\n }\n\n rawColon(root) {\n let value\n root.walkDecls(i => {\n if (typeof i.raws.between !== 'undefined') {\n value = i.raws.between.replace(/[^\\s:]/g, '')\n return false\n }\n })\n return value\n }\n\n rawEmptyBody(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length === 0) {\n value = i.raws.after\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawIndent(root) {\n if (root.raws.indent) return root.raws.indent\n let value\n root.walk(i => {\n let p = i.parent\n if (p && p !== root && p.parent && p.parent === root) {\n if (typeof i.raws.before !== 'undefined') {\n let parts = i.raws.before.split('\\n')\n value = parts[parts.length - 1]\n value = value.replace(/\\S/g, '')\n return false\n }\n }\n })\n return value\n }\n\n rawSemicolon(root) {\n let value\n root.walk(i => {\n if (i.nodes && i.nodes.length && i.last.type === 'decl') {\n value = i.raws.semicolon\n if (typeof value !== 'undefined') return false\n }\n })\n return value\n }\n\n rawValue(node, prop) {\n let value = node[prop]\n let raw = node.raws[prop]\n if (raw && raw.value === value) {\n return raw.raw\n }\n\n return value\n }\n\n root(node) {\n this.body(node)\n if (node.raws.after) this.builder(node.raws.after)\n }\n\n rule(node) {\n this.block(node, this.rawValue(node, 'selector'))\n if (node.raws.ownSemicolon) {\n this.builder(node.raws.ownSemicolon, node, 'end')\n }\n }\n\n stringify(node, semicolon) {\n /* c8 ignore start */\n if (!this[node.type]) {\n throw new Error(\n 'Unknown AST node type ' +\n node.type +\n '. ' +\n 'Maybe you need to change PostCSS stringifier.'\n )\n }\n /* c8 ignore stop */\n this[node.type](node, semicolon)\n }\n}\n\nmodule.exports = Stringifier\nStringifier.default = Stringifier\n", "'use strict'\n\nlet Stringifier = require('./stringifier')\n\nfunction stringify(node, builder) {\n let str = new Stringifier(builder)\n str.stringify(node)\n}\n\nmodule.exports = stringify\nstringify.default = stringify\n", "'use strict'\n\nmodule.exports.isClean = Symbol('isClean')\n\nmodule.exports.my = Symbol('my')\n", "'use strict'\n\nlet CssSyntaxError = require('./css-syntax-error')\nlet Stringifier = require('./stringifier')\nlet stringify = require('./stringify')\nlet { isClean, my } = require('./symbols')\n\nfunction cloneNode(obj, parent) {\n let cloned = new obj.constructor()\n\n for (let i in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i)) {\n /* c8 ignore next 2 */\n continue\n }\n if (i === 'proxyCache') continue\n let value = obj[i]\n let type = typeof value\n\n if (i === 'parent' && type === 'object') {\n if (parent) cloned[i] = parent\n } else if (i === 'source') {\n cloned[i] = value\n } else if (Array.isArray(value)) {\n cloned[i] = value.map(j => cloneNode(j, cloned))\n } else {\n if (type === 'object' && value !== null) value = cloneNode(value)\n cloned[i] = value\n }\n }\n\n return cloned\n}\n\nclass Node {\n constructor(defaults = {}) {\n this.raws = {}\n this[isClean] = false\n this[my] = true\n\n for (let name in defaults) {\n if (name === 'nodes') {\n this.nodes = []\n for (let node of defaults[name]) {\n if (typeof node.clone === 'function') {\n this.append(node.clone())\n } else {\n this.append(node)\n }\n }\n } else {\n this[name] = defaults[name]\n }\n }\n }\n\n addToError(error) {\n error.postcssNode = this\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s = this.source\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s.input.from}:${s.start.line}:${s.start.column}$&`\n )\n }\n return error\n }\n\n after(add) {\n this.parent.insertAfter(this, add)\n return this\n }\n\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name]\n }\n return this\n }\n\n before(add) {\n this.parent.insertBefore(this, add)\n return this\n }\n\n cleanRaws(keepBetween) {\n delete this.raws.before\n delete this.raws.after\n if (!keepBetween) delete this.raws.between\n }\n\n clone(overrides = {}) {\n let cloned = cloneNode(this)\n for (let name in overrides) {\n cloned[name] = overrides[name]\n }\n return cloned\n }\n\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertAfter(this, cloned)\n return cloned\n }\n\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides)\n this.parent.insertBefore(this, cloned)\n return cloned\n }\n\n error(message, opts = {}) {\n if (this.source) {\n let { end, start } = this.rangeBy(opts)\n return this.source.input.error(\n message,\n { column: start.column, line: start.line },\n { column: end.column, line: end.line },\n opts\n )\n }\n return new CssSyntaxError(message)\n }\n\n getProxyProcessor() {\n return {\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else {\n return node[prop]\n }\n },\n\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (\n prop === 'prop' ||\n prop === 'value' ||\n prop === 'name' ||\n prop === 'params' ||\n prop === 'important' ||\n /* c8 ignore next */\n prop === 'text'\n ) {\n node.markDirty()\n }\n return true\n }\n }\n }\n\n markClean() {\n this[isClean] = true;\n }\n\n markDirty() {\n if (this[isClean]) {\n this[isClean] = false\n let next = this\n while ((next = next.parent)) {\n next[isClean] = false\n }\n }\n }\n\n next() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index + 1]\n }\n\n positionBy(opts, stringRepresentation) {\n let pos = this.source.start\n if (opts.index) {\n pos = this.positionInside(opts.index, stringRepresentation)\n } else if (opts.word) {\n stringRepresentation = this.toString()\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) pos = this.positionInside(index, stringRepresentation)\n }\n return pos\n }\n\n positionInside(index, stringRepresentation) {\n let string = stringRepresentation || this.toString()\n let column = this.source.start.column\n let line = this.source.start.line\n\n for (let i = 0; i < index; i++) {\n if (string[i] === '\\n') {\n column = 1\n line += 1\n } else {\n column += 1\n }\n }\n\n return { column, line }\n }\n\n prev() {\n if (!this.parent) return undefined\n let index = this.parent.index(this)\n return this.parent.nodes[index - 1]\n }\n\n rangeBy(opts) {\n let start = {\n column: this.source.start.column,\n line: this.source.start.line\n }\n let end = this.source.end\n ? {\n column: this.source.end.column + 1,\n line: this.source.end.line\n }\n : {\n column: start.column + 1,\n line: start.line\n }\n\n if (opts.word) {\n let stringRepresentation = this.toString()\n let index = stringRepresentation.indexOf(opts.word)\n if (index !== -1) {\n start = this.positionInside(index, stringRepresentation)\n end = this.positionInside(index + opts.word.length, stringRepresentation)\n }\n } else {\n if (opts.start) {\n start = {\n column: opts.start.column,\n line: opts.start.line\n }\n } else if (opts.index) {\n start = this.positionInside(opts.index)\n }\n\n if (opts.end) {\n end = {\n column: opts.end.column,\n line: opts.end.line\n }\n } else if (typeof opts.endIndex === 'number') {\n end = this.positionInside(opts.endIndex)\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1)\n }\n }\n\n if (\n end.line < start.line ||\n (end.line === start.line && end.column <= start.column)\n ) {\n end = { column: start.column + 1, line: start.line }\n }\n\n return { end, start }\n }\n\n raw(prop, defaultType) {\n let str = new Stringifier()\n return str.raw(this, prop, defaultType)\n }\n\n remove() {\n if (this.parent) {\n this.parent.removeChild(this)\n }\n this.parent = undefined\n return this\n }\n\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this\n let foundSelf = false\n for (let node of nodes) {\n if (node === this) {\n foundSelf = true\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node)\n bookmark = node\n } else {\n this.parent.insertBefore(bookmark, node)\n }\n }\n\n if (!foundSelf) {\n this.remove()\n }\n }\n\n return this\n }\n\n root() {\n let result = this\n while (result.parent && result.parent.type !== 'document') {\n result = result.parent\n }\n return result\n }\n\n toJSON(_, inputs) {\n let fixed = {}\n let emitInputs = inputs == null\n inputs = inputs || new Map()\n let inputsNextIndex = 0\n\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n /* c8 ignore next 2 */\n continue\n }\n if (name === 'parent' || name === 'proxyCache') continue\n let value = this[name]\n\n if (Array.isArray(value)) {\n fixed[name] = value.map(i => {\n if (typeof i === 'object' && i.toJSON) {\n return i.toJSON(null, inputs)\n } else {\n return i\n }\n })\n } else if (typeof value === 'object' && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs)\n } else if (name === 'source') {\n let inputId = inputs.get(value.input)\n if (inputId == null) {\n inputId = inputsNextIndex\n inputs.set(value.input, inputsNextIndex)\n inputsNextIndex++\n }\n fixed[name] = {\n end: value.end,\n inputId,\n start: value.start\n }\n } else {\n fixed[name] = value\n }\n }\n\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map(input => input.toJSON())\n }\n\n return fixed\n }\n\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor())\n }\n return this.proxyCache\n }\n\n toString(stringifier = stringify) {\n if (stringifier.stringify) stringifier = stringifier.stringify\n let result = ''\n stringifier(this, i => {\n result += i\n })\n return result\n }\n\n warn(result, text, opts) {\n let data = { node: this }\n for (let i in opts) data[i] = opts[i]\n return result.warn(text, data)\n }\n\n get proxyOf() {\n return this\n }\n}\n\nmodule.exports = Node\nNode.default = Node\n", "'use strict'\n\nlet Node = require('./node')\n\nclass Comment extends Node {\n constructor(defaults) {\n super(defaults)\n this.type = 'comment'\n }\n}\n\nmodule.exports = Comment\nComment.default = Comment\n", "'use strict'\n\nlet Node = require('./node')\n\nclass Declaration extends Node {\n constructor(defaults) {\n if (\n defaults &&\n typeof defaults.value !== 'undefined' &&\n typeof defaults.value !== 'string'\n ) {\n defaults = { ...defaults, value: String(defaults.value) }\n }\n super(defaults)\n this.type = 'decl'\n }\n\n get variable() {\n return this.prop.startsWith('--') || this.prop[0] === '$'\n }\n}\n\nmodule.exports = Declaration\nDeclaration.default = Declaration\n", "'use strict'\n\nlet Comment = require('./comment')\nlet Declaration = require('./declaration')\nlet Node = require('./node')\nlet { isClean, my } = require('./symbols')\n\nlet AtRule, parse, Root, Rule\n\nfunction cleanSource(nodes) {\n return nodes.map(i => {\n if (i.nodes) i.nodes = cleanSource(i.nodes)\n delete i.source\n return i\n })\n}\n\nfunction markTreeDirty(node) {\n node[isClean] = false\n if (node.proxyOf.nodes) {\n for (let i of node.proxyOf.nodes) {\n markTreeDirty(i)\n }\n }\n}\n\nclass Container extends Node {\n append(...children) {\n for (let child of children) {\n let nodes = this.normalize(child, this.last)\n for (let node of nodes) this.proxyOf.nodes.push(node)\n }\n\n this.markDirty()\n\n return this\n }\n\n cleanRaws(keepBetween) {\n super.cleanRaws(keepBetween)\n if (this.nodes) {\n for (let node of this.nodes) node.cleanRaws(keepBetween)\n }\n }\n\n each(callback) {\n if (!this.proxyOf.nodes) return undefined\n let iterator = this.getIterator()\n\n let index, result\n while (this.indexes[iterator] < this.proxyOf.nodes.length) {\n index = this.indexes[iterator]\n result = callback(this.proxyOf.nodes[index], index)\n if (result === false) break\n\n this.indexes[iterator] += 1\n }\n\n delete this.indexes[iterator]\n return result\n }\n\n every(condition) {\n return this.nodes.every(condition)\n }\n\n getIterator() {\n if (!this.lastEach) this.lastEach = 0\n if (!this.indexes) this.indexes = {}\n\n this.lastEach += 1\n let iterator = this.lastEach\n this.indexes[iterator] = 0\n\n return iterator\n }\n\n getProxyProcessor() {\n return {\n get(node, prop) {\n if (prop === 'proxyOf') {\n return node\n } else if (!node[prop]) {\n return node[prop]\n } else if (\n prop === 'each' ||\n (typeof prop === 'string' && prop.startsWith('walk'))\n ) {\n return (...args) => {\n return node[prop](\n ...args.map(i => {\n if (typeof i === 'function') {\n return (child, index) => i(child.toProxy(), index)\n } else {\n return i\n }\n })\n )\n }\n } else if (prop === 'every' || prop === 'some') {\n return cb => {\n return node[prop]((child, ...other) =>\n cb(child.toProxy(), ...other)\n )\n }\n } else if (prop === 'root') {\n return () => node.root().toProxy()\n } else if (prop === 'nodes') {\n return node.nodes.map(i => i.toProxy())\n } else if (prop === 'first' || prop === 'last') {\n return node[prop].toProxy()\n } else {\n return node[prop]\n }\n },\n\n set(node, prop, value) {\n if (node[prop] === value) return true\n node[prop] = value\n if (prop === 'name' || prop === 'params' || prop === 'selector') {\n node.markDirty()\n }\n return true\n }\n }\n }\n\n index(child) {\n if (typeof child === 'number') return child\n if (child.proxyOf) child = child.proxyOf\n return this.proxyOf.nodes.indexOf(child)\n }\n\n insertAfter(exist, add) {\n let existIndex = this.index(exist)\n let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse()\n existIndex = this.index(exist)\n for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (existIndex < index) {\n this.indexes[id] = index + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n insertBefore(exist, add) {\n let existIndex = this.index(exist)\n let type = existIndex === 0 ? 'prepend' : false\n let nodes = this.normalize(\n add,\n this.proxyOf.nodes[existIndex],\n type\n ).reverse()\n existIndex = this.index(exist)\n for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (existIndex <= index) {\n this.indexes[id] = index + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n normalize(nodes, sample) {\n if (typeof nodes === 'string') {\n nodes = cleanSource(parse(nodes).nodes)\n } else if (typeof nodes === 'undefined') {\n nodes = []\n } else if (Array.isArray(nodes)) {\n nodes = nodes.slice(0)\n for (let i of nodes) {\n if (i.parent) i.parent.removeChild(i, 'ignore')\n }\n } else if (nodes.type === 'root' && this.type !== 'document') {\n nodes = nodes.nodes.slice(0)\n for (let i of nodes) {\n if (i.parent) i.parent.removeChild(i, 'ignore')\n }\n } else if (nodes.type) {\n nodes = [nodes]\n } else if (nodes.prop) {\n if (typeof nodes.value === 'undefined') {\n throw new Error('Value field is missed in node creation')\n } else if (typeof nodes.value !== 'string') {\n nodes.value = String(nodes.value)\n }\n nodes = [new Declaration(nodes)]\n } else if (nodes.selector || nodes.selectors) {\n nodes = [new Rule(nodes)]\n } else if (nodes.name) {\n nodes = [new AtRule(nodes)]\n } else if (nodes.text) {\n nodes = [new Comment(nodes)]\n } else {\n throw new Error('Unknown node type in node creation')\n }\n\n let processed = nodes.map(i => {\n /* c8 ignore next */\n if (!i[my] || !i.markClean) Container.rebuild(i)\n i = i.proxyOf\n if (i.parent) i.parent.removeChild(i)\n if (i[isClean]) markTreeDirty(i)\n if (typeof i.raws.before === 'undefined') {\n if (sample && typeof sample.raws.before !== 'undefined') {\n i.raws.before = sample.raws.before.replace(/\\S/g, '')\n }\n }\n i.parent = this.proxyOf\n return i\n })\n\n return processed\n }\n\n prepend(...children) {\n children = children.reverse()\n for (let child of children) {\n let nodes = this.normalize(child, this.first, 'prepend').reverse()\n for (let node of nodes) this.proxyOf.nodes.unshift(node)\n for (let id in this.indexes) {\n this.indexes[id] = this.indexes[id] + nodes.length\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n push(child) {\n child.parent = this\n this.proxyOf.nodes.push(child)\n return this\n }\n\n removeAll() {\n for (let node of this.proxyOf.nodes) node.parent = undefined\n this.proxyOf.nodes = []\n\n this.markDirty()\n\n return this\n }\n\n removeChild(child) {\n child = this.index(child)\n this.proxyOf.nodes[child].parent = undefined\n this.proxyOf.nodes.splice(child, 1)\n\n let index\n for (let id in this.indexes) {\n index = this.indexes[id]\n if (index >= child) {\n this.indexes[id] = index - 1\n }\n }\n\n this.markDirty()\n\n return this\n }\n\n replaceValues(pattern, opts, callback) {\n if (!callback) {\n callback = opts\n opts = {}\n }\n\n this.walkDecls(decl => {\n if (opts.props && !opts.props.includes(decl.prop)) return\n if (opts.fast && !decl.value.includes(opts.fast)) return\n\n decl.value = decl.value.replace(pattern, callback)\n })\n\n this.markDirty()\n\n return this\n }\n\n some(condition) {\n return this.nodes.some(condition)\n }\n\n walk(callback) {\n return this.each((child, i) => {\n let result\n try {\n result = callback(child, i)\n } catch (e) {\n throw child.addToError(e)\n }\n if (result !== false && child.walk) {\n result = child.walk(callback)\n }\n\n return result\n })\n }\n\n walkAtRules(name, callback) {\n if (!callback) {\n callback = name\n return this.walk((child, i) => {\n if (child.type === 'atrule') {\n return callback(child, i)\n }\n })\n }\n if (name instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'atrule' && name.test(child.name)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'atrule' && child.name === name) {\n return callback(child, i)\n }\n })\n }\n\n walkComments(callback) {\n return this.walk((child, i) => {\n if (child.type === 'comment') {\n return callback(child, i)\n }\n })\n }\n\n walkDecls(prop, callback) {\n if (!callback) {\n callback = prop\n return this.walk((child, i) => {\n if (child.type === 'decl') {\n return callback(child, i)\n }\n })\n }\n if (prop instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'decl' && prop.test(child.prop)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'decl' && child.prop === prop) {\n return callback(child, i)\n }\n })\n }\n\n walkRules(selector, callback) {\n if (!callback) {\n callback = selector\n\n return this.walk((child, i) => {\n if (child.type === 'rule') {\n return callback(child, i)\n }\n })\n }\n if (selector instanceof RegExp) {\n return this.walk((child, i) => {\n if (child.type === 'rule' && selector.test(child.selector)) {\n return callback(child, i)\n }\n })\n }\n return this.walk((child, i) => {\n if (child.type === 'rule' && child.selector === selector) {\n return callback(child, i)\n }\n })\n }\n\n get first() {\n if (!this.proxyOf.nodes) return undefined\n return this.proxyOf.nodes[0]\n }\n\n get last() {\n if (!this.proxyOf.nodes) return undefined\n return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]\n }\n}\n\nContainer.registerParse = dependant => {\n parse = dependant\n}\n\nContainer.registerRule = dependant => {\n Rule = dependant\n}\n\nContainer.registerAtRule = dependant => {\n AtRule = dependant\n}\n\nContainer.registerRoot = dependant => {\n Root = dependant\n}\n\nmodule.exports = Container\nContainer.default = Container\n\n/* c8 ignore start */\nContainer.rebuild = node => {\n if (node.type === 'atrule') {\n Object.setPrototypeOf(node, AtRule.prototype)\n } else if (node.type === 'rule') {\n Object.setPrototypeOf(node, Rule.prototype)\n } else if (node.type === 'decl') {\n Object.setPrototypeOf(node, Declaration.prototype)\n } else if (node.type === 'comment') {\n Object.setPrototypeOf(node, Comment.prototype)\n } else if (node.type === 'root') {\n Object.setPrototypeOf(node, Root.prototype)\n }\n\n node[my] = true\n\n if (node.nodes) {\n node.nodes.forEach(child => {\n Container.rebuild(child)\n })\n }\n}\n/* c8 ignore stop */\n", "'use strict'\n\nlet Container = require('./container')\n\nclass AtRule extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'atrule'\n }\n\n append(...children) {\n if (!this.proxyOf.nodes) this.nodes = []\n return super.append(...children)\n }\n\n prepend(...children) {\n if (!this.proxyOf.nodes) this.nodes = []\n return super.prepend(...children)\n }\n}\n\nmodule.exports = AtRule\nAtRule.default = AtRule\n\nContainer.registerAtRule(AtRule)\n", "'use strict'\n\nlet Container = require('./container')\n\nlet LazyResult, Processor\n\nclass Document extends Container {\n constructor(defaults) {\n // type needs to be passed to super, otherwise child roots won't be normalized correctly\n super({ type: 'document', ...defaults })\n\n if (!this.nodes) {\n this.nodes = []\n }\n }\n\n toResult(opts = {}) {\n let lazy = new LazyResult(new Processor(), this, opts)\n\n return lazy.stringify()\n }\n}\n\nDocument.registerLazyResult = dependant => {\n LazyResult = dependant\n}\n\nDocument.registerProcessor = dependant => {\n Processor = dependant\n}\n\nmodule.exports = Document\nDocument.default = Document\n", "let urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n let i = size\n while (i--) {\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\nlet nanoid = (size = 21) => {\n let id = ''\n let i = size\n while (i--) {\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\nmodule.exports = { nanoid, customAlphabet }\n", "'use strict'\n\nlet { existsSync, readFileSync } = require('fs')\nlet { dirname, join } = require('path')\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\n\nfunction fromBase64(str) {\n if (Buffer) {\n return Buffer.from(str, 'base64').toString()\n } else {\n /* c8 ignore next 2 */\n return window.atob(str)\n }\n}\n\nclass PreviousMap {\n constructor(css, opts) {\n if (opts.map === false) return\n this.loadAnnotation(css)\n this.inline = this.startWith(this.annotation, 'data:')\n\n let prev = opts.map ? opts.map.prev : undefined\n let text = this.loadMap(opts.from, prev)\n if (!this.mapFile && opts.from) {\n this.mapFile = opts.from\n }\n if (this.mapFile) this.root = dirname(this.mapFile)\n if (text) this.text = text\n }\n\n consumer() {\n if (!this.consumerCache) {\n this.consumerCache = new SourceMapConsumer(this.text)\n }\n return this.consumerCache\n }\n\n decodeInline(text) {\n let baseCharsetUri = /^data:application\\/json;charset=utf-?8;base64,/\n let baseUri = /^data:application\\/json;base64,/\n let charsetUri = /^data:application\\/json;charset=utf-?8,/\n let uri = /^data:application\\/json,/\n\n let uriMatch = text.match(charsetUri) || text.match(uri)\n if (uriMatch) {\n return decodeURIComponent(text.substr(uriMatch[0].length))\n }\n\n let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri)\n if (baseUriMatch) {\n return fromBase64(text.substr(baseUriMatch[0].length))\n }\n\n let encoding = text.match(/data:application\\/json;([^,]+),/)[1]\n throw new Error('Unsupported source map encoding ' + encoding)\n }\n\n getAnnotationURL(sourceMapString) {\n return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, '').trim()\n }\n\n isMap(map) {\n if (typeof map !== 'object') return false\n return (\n typeof map.mappings === 'string' ||\n typeof map._mappings === 'string' ||\n Array.isArray(map.sections)\n )\n }\n\n loadAnnotation(css) {\n let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/g)\n if (!comments) return\n\n // sourceMappingURLs from comments, strings, etc.\n let start = css.lastIndexOf(comments.pop())\n let end = css.indexOf('*/', start)\n\n if (start > -1 && end > -1) {\n // Locate the last sourceMappingURL to avoid pickin\n this.annotation = this.getAnnotationURL(css.substring(start, end))\n }\n }\n\n loadFile(path) {\n this.root = dirname(path)\n if (existsSync(path)) {\n this.mapFile = path\n return readFileSync(path, 'utf-8').toString().trim()\n }\n }\n\n loadMap(file, prev) {\n if (prev === false) return false\n\n if (prev) {\n if (typeof prev === 'string') {\n return prev\n } else if (typeof prev === 'function') {\n let prevPath = prev(file)\n if (prevPath) {\n let map = this.loadFile(prevPath)\n if (!map) {\n throw new Error(\n 'Unable to load previous source map: ' + prevPath.toString()\n )\n }\n return map\n }\n } else if (prev instanceof SourceMapConsumer) {\n return SourceMapGenerator.fromSourceMap(prev).toString()\n } else if (prev instanceof SourceMapGenerator) {\n return prev.toString()\n } else if (this.isMap(prev)) {\n return JSON.stringify(prev)\n } else {\n throw new Error(\n 'Unsupported previous source map format: ' + prev.toString()\n )\n }\n } else if (this.inline) {\n return this.decodeInline(this.annotation)\n } else if (this.annotation) {\n let map = this.annotation\n if (file) map = join(dirname(file), map)\n return this.loadFile(map)\n }\n }\n\n startWith(string, start) {\n if (!string) return false\n return string.substr(0, start.length) === start\n }\n\n withContent() {\n return !!(\n this.consumer().sourcesContent &&\n this.consumer().sourcesContent.length > 0\n )\n }\n}\n\nmodule.exports = PreviousMap\nPreviousMap.default = PreviousMap\n", "'use strict'\n\nlet { nanoid } = require('nanoid/non-secure')\nlet { isAbsolute, resolve } = require('path')\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { fileURLToPath, pathToFileURL } = require('url')\n\nlet CssSyntaxError = require('./css-syntax-error')\nlet PreviousMap = require('./previous-map')\nlet terminalHighlight = require('./terminal-highlight')\n\nlet fromOffsetCache = Symbol('fromOffsetCache')\n\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)\nlet pathAvailable = Boolean(resolve && isAbsolute)\n\nclass Input {\n constructor(css, opts = {}) {\n if (\n css === null ||\n typeof css === 'undefined' ||\n (typeof css === 'object' && !css.toString)\n ) {\n throw new Error(`PostCSS received ${css} instead of CSS string`)\n }\n\n this.css = css.toString()\n\n if (this.css[0] === '\\uFEFF' || this.css[0] === '\\uFFFE') {\n this.hasBOM = true\n this.css = this.css.slice(1)\n } else {\n this.hasBOM = false\n }\n\n if (opts.from) {\n if (\n !pathAvailable ||\n /^\\w+:\\/\\//.test(opts.from) ||\n isAbsolute(opts.from)\n ) {\n this.file = opts.from\n } else {\n this.file = resolve(opts.from)\n }\n }\n\n if (pathAvailable && sourceMapAvailable) {\n let map = new PreviousMap(this.css, opts)\n if (map.text) {\n this.map = map\n let file = map.consumer().file\n if (!this.file && file) this.file = this.mapResolve(file)\n }\n }\n\n if (!this.file) {\n this.id = ''\n }\n if (this.map) this.map.file = this.from\n }\n\n error(message, line, column, opts = {}) {\n let endColumn, endLine, result\n\n if (line && typeof line === 'object') {\n let start = line\n let end = column\n if (typeof start.offset === 'number') {\n let pos = this.fromOffset(start.offset)\n line = pos.line\n column = pos.col\n } else {\n line = start.line\n column = start.column\n }\n if (typeof end.offset === 'number') {\n let pos = this.fromOffset(end.offset)\n endLine = pos.line\n endColumn = pos.col\n } else {\n endLine = end.line\n endColumn = end.column\n }\n } else if (!column) {\n let pos = this.fromOffset(line)\n line = pos.line\n column = pos.col\n }\n\n let origin = this.origin(line, column, endLine, endColumn)\n if (origin) {\n result = new CssSyntaxError(\n message,\n origin.endLine === undefined\n ? origin.line\n : { column: origin.column, line: origin.line },\n origin.endLine === undefined\n ? origin.column\n : { column: origin.endColumn, line: origin.endLine },\n origin.source,\n origin.file,\n opts.plugin\n )\n } else {\n result = new CssSyntaxError(\n message,\n endLine === undefined ? line : { column, line },\n endLine === undefined ? column : { column: endColumn, line: endLine },\n this.css,\n this.file,\n opts.plugin\n )\n }\n\n result.input = { column, endColumn, endLine, line, source: this.css }\n if (this.file) {\n if (pathToFileURL) {\n result.input.url = pathToFileURL(this.file).toString()\n }\n result.input.file = this.file\n }\n\n return result\n }\n\n fromOffset(offset) {\n let lastLine, lineToIndex\n if (!this[fromOffsetCache]) {\n let lines = this.css.split('\\n')\n lineToIndex = new Array(lines.length)\n let prevIndex = 0\n\n for (let i = 0, l = lines.length; i < l; i++) {\n lineToIndex[i] = prevIndex\n prevIndex += lines[i].length + 1\n }\n\n this[fromOffsetCache] = lineToIndex\n } else {\n lineToIndex = this[fromOffsetCache]\n }\n lastLine = lineToIndex[lineToIndex.length - 1]\n\n let min = 0\n if (offset >= lastLine) {\n min = lineToIndex.length - 1\n } else {\n let max = lineToIndex.length - 2\n let mid\n while (min < max) {\n mid = min + ((max - min) >> 1)\n if (offset < lineToIndex[mid]) {\n max = mid - 1\n } else if (offset >= lineToIndex[mid + 1]) {\n min = mid + 1\n } else {\n min = mid\n break\n }\n }\n }\n return {\n col: offset - lineToIndex[min] + 1,\n line: min + 1\n }\n }\n\n mapResolve(file) {\n if (/^\\w+:\\/\\//.test(file)) {\n return file\n }\n return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)\n }\n\n origin(line, column, endLine, endColumn) {\n if (!this.map) return false\n let consumer = this.map.consumer()\n\n let from = consumer.originalPositionFor({ column, line })\n if (!from.source) return false\n\n let to\n if (typeof endLine === 'number') {\n to = consumer.originalPositionFor({ column: endColumn, line: endLine })\n }\n\n let fromUrl\n\n if (isAbsolute(from.source)) {\n fromUrl = pathToFileURL(from.source)\n } else {\n fromUrl = new URL(\n from.source,\n this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)\n )\n }\n\n let result = {\n column: from.column,\n endColumn: to && to.column,\n endLine: to && to.line,\n line: from.line,\n url: fromUrl.toString()\n }\n\n if (fromUrl.protocol === 'file:') {\n if (fileURLToPath) {\n result.file = fileURLToPath(fromUrl)\n } else {\n /* c8 ignore next 2 */\n throw new Error(`file: protocol is not available in this PostCSS build`)\n }\n }\n\n let source = consumer.sourceContentFor(from.source)\n if (source) result.source = source\n\n return result\n }\n\n toJSON() {\n let json = {}\n for (let name of ['hasBOM', 'css', 'file', 'id']) {\n if (this[name] != null) {\n json[name] = this[name]\n }\n }\n if (this.map) {\n json.map = { ...this.map }\n if (json.map.consumerCache) {\n json.map.consumerCache = undefined\n }\n }\n return json\n }\n\n get from() {\n return this.file || this.id\n }\n}\n\nmodule.exports = Input\nInput.default = Input\n\nif (terminalHighlight && terminalHighlight.registerInput) {\n terminalHighlight.registerInput(Input)\n}\n", "'use strict'\n\nlet Container = require('./container')\n\nlet LazyResult, Processor\n\nclass Root extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'root'\n if (!this.nodes) this.nodes = []\n }\n\n normalize(child, sample, type) {\n let nodes = super.normalize(child)\n\n if (sample) {\n if (type === 'prepend') {\n if (this.nodes.length > 1) {\n sample.raws.before = this.nodes[1].raws.before\n } else {\n delete sample.raws.before\n }\n } else if (this.first !== sample) {\n for (let node of nodes) {\n node.raws.before = sample.raws.before\n }\n }\n }\n\n return nodes\n }\n\n removeChild(child, ignore) {\n let index = this.index(child)\n\n if (!ignore && index === 0 && this.nodes.length > 1) {\n this.nodes[1].raws.before = this.nodes[index].raws.before\n }\n\n return super.removeChild(child)\n }\n\n toResult(opts = {}) {\n let lazy = new LazyResult(new Processor(), this, opts)\n return lazy.stringify()\n }\n}\n\nRoot.registerLazyResult = dependant => {\n LazyResult = dependant\n}\n\nRoot.registerProcessor = dependant => {\n Processor = dependant\n}\n\nmodule.exports = Root\nRoot.default = Root\n\nContainer.registerRoot(Root)\n", "'use strict'\n\nlet list = {\n comma(string) {\n return list.split(string, [','], true)\n },\n\n space(string) {\n let spaces = [' ', '\\n', '\\t']\n return list.split(string, spaces)\n },\n\n split(string, separators, last) {\n let array = []\n let current = ''\n let split = false\n\n let func = 0\n let inQuote = false\n let prevQuote = ''\n let escape = false\n\n for (let letter of string) {\n if (escape) {\n escape = false\n } else if (letter === '\\\\') {\n escape = true\n } else if (inQuote) {\n if (letter === prevQuote) {\n inQuote = false\n }\n } else if (letter === '\"' || letter === \"'\") {\n inQuote = true\n prevQuote = letter\n } else if (letter === '(') {\n func += 1\n } else if (letter === ')') {\n if (func > 0) func -= 1\n } else if (func === 0) {\n if (separators.includes(letter)) split = true\n }\n\n if (split) {\n if (current !== '') array.push(current.trim())\n current = ''\n split = false\n } else {\n current += letter\n }\n }\n\n if (last || current !== '') array.push(current.trim())\n return array\n }\n}\n\nmodule.exports = list\nlist.default = list\n", "'use strict'\n\nlet Container = require('./container')\nlet list = require('./list')\n\nclass Rule extends Container {\n constructor(defaults) {\n super(defaults)\n this.type = 'rule'\n if (!this.nodes) this.nodes = []\n }\n\n get selectors() {\n return list.comma(this.selector)\n }\n\n set selectors(values) {\n let match = this.selector ? this.selector.match(/,\\s*/) : null\n let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen')\n this.selector = values.join(sep)\n }\n}\n\nmodule.exports = Rule\nRule.default = Rule\n\nContainer.registerRule(Rule)\n", "'use strict'\n\nlet AtRule = require('./at-rule')\nlet Comment = require('./comment')\nlet Declaration = require('./declaration')\nlet Input = require('./input')\nlet PreviousMap = require('./previous-map')\nlet Root = require('./root')\nlet Rule = require('./rule')\n\nfunction fromJSON(json, inputs) {\n if (Array.isArray(json)) return json.map(n => fromJSON(n))\n\n let { inputs: ownInputs, ...defaults } = json\n if (ownInputs) {\n inputs = []\n for (let input of ownInputs) {\n let inputHydrated = { ...input, __proto__: Input.prototype }\n if (inputHydrated.map) {\n inputHydrated.map = {\n ...inputHydrated.map,\n __proto__: PreviousMap.prototype\n }\n }\n inputs.push(inputHydrated)\n }\n }\n if (defaults.nodes) {\n defaults.nodes = json.nodes.map(n => fromJSON(n, inputs))\n }\n if (defaults.source) {\n let { inputId, ...source } = defaults.source\n defaults.source = source\n if (inputId != null) {\n defaults.source.input = inputs[inputId]\n }\n }\n if (defaults.type === 'root') {\n return new Root(defaults)\n } else if (defaults.type === 'decl') {\n return new Declaration(defaults)\n } else if (defaults.type === 'rule') {\n return new Rule(defaults)\n } else if (defaults.type === 'comment') {\n return new Comment(defaults)\n } else if (defaults.type === 'atrule') {\n return new AtRule(defaults)\n } else {\n throw new Error('Unknown node type: ' + json.type)\n }\n}\n\nmodule.exports = fromJSON\nfromJSON.default = fromJSON\n", "'use strict'\n\nlet { dirname, relative, resolve, sep } = require('path')\nlet { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')\nlet { pathToFileURL } = require('url')\n\nlet Input = require('./input')\n\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)\nlet pathAvailable = Boolean(dirname && resolve && relative && sep)\n\nclass MapGenerator {\n constructor(stringify, root, opts, cssString) {\n this.stringify = stringify\n this.mapOpts = opts.map || {}\n this.root = root\n this.opts = opts\n this.css = cssString\n this.originalCSS = cssString\n this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute\n\n this.memoizedFileURLs = new Map()\n this.memoizedPaths = new Map()\n this.memoizedURLs = new Map()\n }\n\n addAnnotation() {\n let content\n\n if (this.isInline()) {\n content =\n 'data:application/json;base64,' + this.toBase64(this.map.toString())\n } else if (typeof this.mapOpts.annotation === 'string') {\n content = this.mapOpts.annotation\n } else if (typeof this.mapOpts.annotation === 'function') {\n content = this.mapOpts.annotation(this.opts.to, this.root)\n } else {\n content = this.outputFile() + '.map'\n }\n let eol = '\\n'\n if (this.css.includes('\\r\\n')) eol = '\\r\\n'\n\n this.css += eol + '/*# sourceMappingURL=' + content + ' */'\n }\n\n applyPrevMaps() {\n for (let prev of this.previous()) {\n let from = this.toUrl(this.path(prev.file))\n let root = prev.root || dirname(prev.file)\n let map\n\n if (this.mapOpts.sourcesContent === false) {\n map = new SourceMapConsumer(prev.text)\n if (map.sourcesContent) {\n map.sourcesContent = null\n }\n } else {\n map = prev.consumer()\n }\n\n this.map.applySourceMap(map, from, this.toUrl(this.path(root)))\n }\n }\n\n clearAnnotation() {\n if (this.mapOpts.annotation === false) return\n\n if (this.root) {\n let node\n for (let i = this.root.nodes.length - 1; i >= 0; i--) {\n node = this.root.nodes[i]\n if (node.type !== 'comment') continue\n if (node.text.startsWith('# sourceMappingURL=')) {\n this.root.removeChild(i)\n }\n }\n } else if (this.css) {\n this.css = this.css.replace(/\\n*\\/\\*#[\\S\\s]*?\\*\\/$/gm, '')\n }\n }\n\n generate() {\n this.clearAnnotation()\n if (pathAvailable && sourceMapAvailable && this.isMap()) {\n return this.generateMap()\n } else {\n let result = ''\n this.stringify(this.root, i => {\n result += i\n })\n return [result]\n }\n }\n\n generateMap() {\n if (this.root) {\n this.generateString()\n } else if (this.previous().length === 1) {\n let prev = this.previous()[0].consumer()\n prev.file = this.outputFile()\n this.map = SourceMapGenerator.fromSourceMap(prev, {\n ignoreInvalidMapping: true\n })\n } else {\n this.map = new SourceMapGenerator({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n })\n this.map.addMapping({\n generated: { column: 0, line: 1 },\n original: { column: 0, line: 1 },\n source: this.opts.from\n ? this.toUrl(this.path(this.opts.from))\n : ''\n })\n }\n\n if (this.isSourcesContent()) this.setSourcesContent()\n if (this.root && this.previous().length > 0) this.applyPrevMaps()\n if (this.isAnnotation()) this.addAnnotation()\n\n if (this.isInline()) {\n return [this.css]\n } else {\n return [this.css, this.map]\n }\n }\n\n generateString() {\n this.css = ''\n this.map = new SourceMapGenerator({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n })\n\n let line = 1\n let column = 1\n\n let noSource = ''\n let mapping = {\n generated: { column: 0, line: 0 },\n original: { column: 0, line: 0 },\n source: ''\n }\n\n let last, lines\n this.stringify(this.root, (str, node, type) => {\n this.css += str\n\n if (node && type !== 'end') {\n mapping.generated.line = line\n mapping.generated.column = column - 1\n if (node.source && node.source.start) {\n mapping.source = this.sourcePath(node)\n mapping.original.line = node.source.start.line\n mapping.original.column = node.source.start.column - 1\n this.map.addMapping(mapping)\n } else {\n mapping.source = noSource\n mapping.original.line = 1\n mapping.original.column = 0\n this.map.addMapping(mapping)\n }\n }\n\n lines = str.match(/\\n/g)\n if (lines) {\n line += lines.length\n last = str.lastIndexOf('\\n')\n column = str.length - last\n } else {\n column += str.length\n }\n\n if (node && type !== 'start') {\n let p = node.parent || { raws: {} }\n let childless =\n node.type === 'decl' || (node.type === 'atrule' && !node.nodes)\n if (!childless || node !== p.last || p.raws.semicolon) {\n if (node.source && node.source.end) {\n mapping.source = this.sourcePath(node)\n mapping.original.line = node.source.end.line\n mapping.original.column = node.source.end.column - 1\n mapping.generated.line = line\n mapping.generated.column = column - 2\n this.map.addMapping(mapping)\n } else {\n mapping.source = noSource\n mapping.original.line = 1\n mapping.original.column = 0\n mapping.generated.line = line\n mapping.generated.column = column - 1\n this.map.addMapping(mapping)\n }\n }\n }\n })\n }\n\n isAnnotation() {\n if (this.isInline()) {\n return true\n }\n if (typeof this.mapOpts.annotation !== 'undefined') {\n return this.mapOpts.annotation\n }\n if (this.previous().length) {\n return this.previous().some(i => i.annotation)\n }\n return true\n }\n\n isInline() {\n if (typeof this.mapOpts.inline !== 'undefined') {\n return this.mapOpts.inline\n }\n\n let annotation = this.mapOpts.annotation\n if (typeof annotation !== 'undefined' && annotation !== true) {\n return false\n }\n\n if (this.previous().length) {\n return this.previous().some(i => i.inline)\n }\n return true\n }\n\n isMap() {\n if (typeof this.opts.map !== 'undefined') {\n return !!this.opts.map\n }\n return this.previous().length > 0\n }\n\n isSourcesContent() {\n if (typeof this.mapOpts.sourcesContent !== 'undefined') {\n return this.mapOpts.sourcesContent\n }\n if (this.previous().length) {\n return this.previous().some(i => i.withContent())\n }\n return true\n }\n\n outputFile() {\n if (this.opts.to) {\n return this.path(this.opts.to)\n } else if (this.opts.from) {\n return this.path(this.opts.from)\n } else {\n return 'to.css'\n }\n }\n\n path(file) {\n if (this.mapOpts.absolute) return file\n if (file.charCodeAt(0) === 60 /* `<` */) return file\n if (/^\\w+:\\/\\//.test(file)) return file\n let cached = this.memoizedPaths.get(file)\n if (cached) return cached\n\n let from = this.opts.to ? dirname(this.opts.to) : '.'\n\n if (typeof this.mapOpts.annotation === 'string') {\n from = dirname(resolve(from, this.mapOpts.annotation))\n }\n\n let path = relative(from, file)\n this.memoizedPaths.set(file, path)\n\n return path\n }\n\n previous() {\n if (!this.previousMaps) {\n this.previousMaps = []\n if (this.root) {\n this.root.walk(node => {\n if (node.source && node.source.input.map) {\n let map = node.source.input.map\n if (!this.previousMaps.includes(map)) {\n this.previousMaps.push(map)\n }\n }\n })\n } else {\n let input = new Input(this.originalCSS, this.opts)\n if (input.map) this.previousMaps.push(input.map)\n }\n }\n\n return this.previousMaps\n }\n\n setSourcesContent() {\n let already = {}\n if (this.root) {\n this.root.walk(node => {\n if (node.source) {\n let from = node.source.input.from\n if (from && !already[from]) {\n already[from] = true\n let fromUrl = this.usesFileUrls\n ? this.toFileUrl(from)\n : this.toUrl(this.path(from))\n this.map.setSourceContent(fromUrl, node.source.input.css)\n }\n }\n })\n } else if (this.css) {\n let from = this.opts.from\n ? this.toUrl(this.path(this.opts.from))\n : ''\n this.map.setSourceContent(from, this.css)\n }\n }\n\n sourcePath(node) {\n if (this.mapOpts.from) {\n return this.toUrl(this.mapOpts.from)\n } else if (this.usesFileUrls) {\n return this.toFileUrl(node.source.input.from)\n } else {\n return this.toUrl(this.path(node.source.input.from))\n }\n }\n\n toBase64(str) {\n if (Buffer) {\n return Buffer.from(str).toString('base64')\n } else {\n return window.btoa(unescape(encodeURIComponent(str)))\n }\n }\n\n toFileUrl(path) {\n let cached = this.memoizedFileURLs.get(path)\n if (cached) return cached\n\n if (pathToFileURL) {\n let fileURL = pathToFileURL(path).toString()\n this.memoizedFileURLs.set(path, fileURL)\n\n return fileURL\n } else {\n throw new Error(\n '`map.absolute` option is not available in this PostCSS build'\n )\n }\n }\n\n toUrl(path) {\n let cached = this.memoizedURLs.get(path)\n if (cached) return cached\n\n if (sep === '\\\\') {\n path = path.replace(/\\\\/g, '/')\n }\n\n let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent)\n this.memoizedURLs.set(path, url)\n\n return url\n }\n}\n\nmodule.exports = MapGenerator\n", "'use strict'\n\nconst SINGLE_QUOTE = \"'\".charCodeAt(0)\nconst DOUBLE_QUOTE = '\"'.charCodeAt(0)\nconst BACKSLASH = '\\\\'.charCodeAt(0)\nconst SLASH = '/'.charCodeAt(0)\nconst NEWLINE = '\\n'.charCodeAt(0)\nconst SPACE = ' '.charCodeAt(0)\nconst FEED = '\\f'.charCodeAt(0)\nconst TAB = '\\t'.charCodeAt(0)\nconst CR = '\\r'.charCodeAt(0)\nconst OPEN_SQUARE = '['.charCodeAt(0)\nconst CLOSE_SQUARE = ']'.charCodeAt(0)\nconst OPEN_PARENTHESES = '('.charCodeAt(0)\nconst CLOSE_PARENTHESES = ')'.charCodeAt(0)\nconst OPEN_CURLY = '{'.charCodeAt(0)\nconst CLOSE_CURLY = '}'.charCodeAt(0)\nconst SEMICOLON = ';'.charCodeAt(0)\nconst ASTERISK = '*'.charCodeAt(0)\nconst COLON = ':'.charCodeAt(0)\nconst AT = '@'.charCodeAt(0)\n\nconst RE_AT_END = /[\\t\\n\\f\\r \"#'()/;[\\\\\\]{}]/g\nconst RE_WORD_END = /[\\t\\n\\f\\r !\"#'():;@[\\\\\\]{}]|\\/(?=\\*)/g\nconst RE_BAD_BRACKET = /.[\\r\\n\"'(/\\\\]/\nconst RE_HEX_ESCAPE = /[\\da-f]/i\n\nmodule.exports = function tokenizer(input, options = {}) {\n let css = input.css.valueOf()\n let ignore = options.ignoreErrors\n\n let code, content, escape, next, quote\n let currentToken, escaped, escapePos, n, prev\n\n let length = css.length\n let pos = 0\n let buffer = []\n let returned = []\n\n function position() {\n return pos\n }\n\n function unclosed(what) {\n throw input.error('Unclosed ' + what, pos)\n }\n\n function endOfFile() {\n return returned.length === 0 && pos >= length\n }\n\n function nextToken(opts) {\n if (returned.length) return returned.pop()\n if (pos >= length) return\n\n let ignoreUnclosed = opts ? opts.ignoreUnclosed : false\n\n code = css.charCodeAt(pos)\n\n switch (code) {\n case NEWLINE:\n case SPACE:\n case TAB:\n case CR:\n case FEED: {\n next = pos\n do {\n next += 1\n code = css.charCodeAt(next)\n } while (\n code === SPACE ||\n code === NEWLINE ||\n code === TAB ||\n code === CR ||\n code === FEED\n )\n\n currentToken = ['space', css.slice(pos, next)]\n pos = next - 1\n break\n }\n\n case OPEN_SQUARE:\n case CLOSE_SQUARE:\n case OPEN_CURLY:\n case CLOSE_CURLY:\n case COLON:\n case SEMICOLON:\n case CLOSE_PARENTHESES: {\n let controlChar = String.fromCharCode(code)\n currentToken = [controlChar, controlChar, pos]\n break\n }\n\n case OPEN_PARENTHESES: {\n prev = buffer.length ? buffer.pop()[1] : ''\n n = css.charCodeAt(pos + 1)\n if (\n prev === 'url' &&\n n !== SINGLE_QUOTE &&\n n !== DOUBLE_QUOTE &&\n n !== SPACE &&\n n !== NEWLINE &&\n n !== TAB &&\n n !== FEED &&\n n !== CR\n ) {\n next = pos\n do {\n escaped = false\n next = css.indexOf(')', next + 1)\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos\n break\n } else {\n unclosed('bracket')\n }\n }\n escapePos = next\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1\n escaped = !escaped\n }\n } while (escaped)\n\n currentToken = ['brackets', css.slice(pos, next + 1), pos, next]\n\n pos = next\n } else {\n next = css.indexOf(')', pos + 1)\n content = css.slice(pos, next + 1)\n\n if (next === -1 || RE_BAD_BRACKET.test(content)) {\n currentToken = ['(', '(', pos]\n } else {\n currentToken = ['brackets', content, pos, next]\n pos = next\n }\n }\n\n break\n }\n\n case SINGLE_QUOTE:\n case DOUBLE_QUOTE: {\n quote = code === SINGLE_QUOTE ? \"'\" : '\"'\n next = pos\n do {\n escaped = false\n next = css.indexOf(quote, next + 1)\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos + 1\n break\n } else {\n unclosed('string')\n }\n }\n escapePos = next\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1\n escaped = !escaped\n }\n } while (escaped)\n\n currentToken = ['string', css.slice(pos, next + 1), pos, next]\n pos = next\n break\n }\n\n case AT: {\n RE_AT_END.lastIndex = pos + 1\n RE_AT_END.test(css)\n if (RE_AT_END.lastIndex === 0) {\n next = css.length - 1\n } else {\n next = RE_AT_END.lastIndex - 2\n }\n\n currentToken = ['at-word', css.slice(pos, next + 1), pos, next]\n\n pos = next\n break\n }\n\n case BACKSLASH: {\n next = pos\n escape = true\n while (css.charCodeAt(next + 1) === BACKSLASH) {\n next += 1\n escape = !escape\n }\n code = css.charCodeAt(next + 1)\n if (\n escape &&\n code !== SLASH &&\n code !== SPACE &&\n code !== NEWLINE &&\n code !== TAB &&\n code !== CR &&\n code !== FEED\n ) {\n next += 1\n if (RE_HEX_ESCAPE.test(css.charAt(next))) {\n while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {\n next += 1\n }\n if (css.charCodeAt(next + 1) === SPACE) {\n next += 1\n }\n }\n }\n\n currentToken = ['word', css.slice(pos, next + 1), pos, next]\n\n pos = next\n break\n }\n\n default: {\n if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {\n next = css.indexOf('*/', pos + 2) + 1\n if (next === 0) {\n if (ignore || ignoreUnclosed) {\n next = css.length\n } else {\n unclosed('comment')\n }\n }\n\n currentToken = ['comment', css.slice(pos, next + 1), pos, next]\n pos = next\n } else {\n RE_WORD_END.lastIndex = pos + 1\n RE_WORD_END.test(css)\n if (RE_WORD_END.lastIndex === 0) {\n next = css.length - 1\n } else {\n next = RE_WORD_END.lastIndex - 2\n }\n\n currentToken = ['word', css.slice(pos, next + 1), pos, next]\n buffer.push(currentToken)\n pos = next\n }\n\n break\n }\n }\n\n pos++\n return currentToken\n }\n\n function back(token) {\n returned.push(token)\n }\n\n return {\n back,\n endOfFile,\n nextToken,\n position\n }\n}\n", "'use strict'\n\nlet AtRule = require('./at-rule')\nlet Comment = require('./comment')\nlet Declaration = require('./declaration')\nlet Root = require('./root')\nlet Rule = require('./rule')\nlet tokenizer = require('./tokenize')\n\nconst SAFE_COMMENT_NEIGHBOR = {\n empty: true,\n space: true\n}\n\nfunction findLastWithPosition(tokens) {\n for (let i = tokens.length - 1; i >= 0; i--) {\n let token = tokens[i]\n let pos = token[3] || token[2]\n if (pos) return pos\n }\n}\n\nclass Parser {\n constructor(input) {\n this.input = input\n\n this.root = new Root()\n this.current = this.root\n this.spaces = ''\n this.semicolon = false\n\n this.createTokenizer()\n this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }\n }\n\n atrule(token) {\n let node = new AtRule()\n node.name = token[1].slice(1)\n if (node.name === '') {\n this.unnamedAtrule(node, token)\n }\n this.init(node, token[2])\n\n let type\n let prev\n let shift\n let last = false\n let open = false\n let params = []\n let brackets = []\n\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken()\n type = token[0]\n\n if (type === '(' || type === '[') {\n brackets.push(type === '(' ? ')' : ']')\n } else if (type === '{' && brackets.length > 0) {\n brackets.push('}')\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop()\n }\n\n if (brackets.length === 0) {\n if (type === ';') {\n node.source.end = this.getPosition(token[2])\n node.source.end.offset++\n this.semicolon = true\n break\n } else if (type === '{') {\n open = true\n break\n } else if (type === '}') {\n if (params.length > 0) {\n shift = params.length - 1\n prev = params[shift]\n while (prev && prev[0] === 'space') {\n prev = params[--shift]\n }\n if (prev) {\n node.source.end = this.getPosition(prev[3] || prev[2])\n node.source.end.offset++\n }\n }\n this.end(token)\n break\n } else {\n params.push(token)\n }\n } else {\n params.push(token)\n }\n\n if (this.tokenizer.endOfFile()) {\n last = true\n break\n }\n }\n\n node.raws.between = this.spacesAndCommentsFromEnd(params)\n if (params.length) {\n node.raws.afterName = this.spacesAndCommentsFromStart(params)\n this.raw(node, 'params', params)\n if (last) {\n token = params[params.length - 1]\n node.source.end = this.getPosition(token[3] || token[2])\n node.source.end.offset++\n this.spaces = node.raws.between\n node.raws.between = ''\n }\n } else {\n node.raws.afterName = ''\n node.params = ''\n }\n\n if (open) {\n node.nodes = []\n this.current = node\n }\n }\n\n checkMissedSemicolon(tokens) {\n let colon = this.colon(tokens)\n if (colon === false) return\n\n let founded = 0\n let token\n for (let j = colon - 1; j >= 0; j--) {\n token = tokens[j]\n if (token[0] !== 'space') {\n founded += 1\n if (founded === 2) break\n }\n }\n // If the token is a word, e.g. `!important`, `red` or any other valid property's value.\n // Then we need to return the colon after that word token. [3] is the \"end\" colon of that word.\n // And because we need it after that one we do +1 to get the next one.\n throw this.input.error(\n 'Missed semicolon',\n token[0] === 'word' ? token[3] + 1 : token[2]\n )\n }\n\n colon(tokens) {\n let brackets = 0\n let prev, token, type\n for (let [i, element] of tokens.entries()) {\n token = element\n type = token[0]\n\n if (type === '(') {\n brackets += 1\n }\n if (type === ')') {\n brackets -= 1\n }\n if (brackets === 0 && type === ':') {\n if (!prev) {\n this.doubleColon(token)\n } else if (prev[0] === 'word' && prev[1] === 'progid') {\n continue\n } else {\n return i\n }\n }\n\n prev = token\n }\n return false\n }\n\n comment(token) {\n let node = new Comment()\n this.init(node, token[2])\n node.source.end = this.getPosition(token[3] || token[2])\n node.source.end.offset++\n\n let text = token[1].slice(2, -2)\n if (/^\\s*$/.test(text)) {\n node.text = ''\n node.raws.left = text\n node.raws.right = ''\n } else {\n let match = text.match(/^(\\s*)([^]*\\S)(\\s*)$/)\n node.text = match[2]\n node.raws.left = match[1]\n node.raws.right = match[3]\n }\n }\n\n createTokenizer() {\n this.tokenizer = tokenizer(this.input)\n }\n\n decl(tokens, customProperty) {\n let node = new Declaration()\n this.init(node, tokens[0][2])\n\n let last = tokens[tokens.length - 1]\n if (last[0] === ';') {\n this.semicolon = true\n tokens.pop()\n }\n\n node.source.end = this.getPosition(\n last[3] || last[2] || findLastWithPosition(tokens)\n )\n node.source.end.offset++\n\n while (tokens[0][0] !== 'word') {\n if (tokens.length === 1) this.unknownWord(tokens)\n node.raws.before += tokens.shift()[1]\n }\n node.source.start = this.getPosition(tokens[0][2])\n\n node.prop = ''\n while (tokens.length) {\n let type = tokens[0][0]\n if (type === ':' || type === 'space' || type === 'comment') {\n break\n }\n node.prop += tokens.shift()[1]\n }\n\n node.raws.between = ''\n\n let token\n while (tokens.length) {\n token = tokens.shift()\n\n if (token[0] === ':') {\n node.raws.between += token[1]\n break\n } else {\n if (token[0] === 'word' && /\\w/.test(token[1])) {\n this.unknownWord([token])\n }\n node.raws.between += token[1]\n }\n }\n\n if (node.prop[0] === '_' || node.prop[0] === '*') {\n node.raws.before += node.prop[0]\n node.prop = node.prop.slice(1)\n }\n\n let firstSpaces = []\n let next\n while (tokens.length) {\n next = tokens[0][0]\n if (next !== 'space' && next !== 'comment') break\n firstSpaces.push(tokens.shift())\n }\n\n this.precheckMissedSemicolon(tokens)\n\n for (let i = tokens.length - 1; i >= 0; i--) {\n token = tokens[i]\n if (token[1].toLowerCase() === '!important') {\n node.important = true\n let string = this.stringFrom(tokens, i)\n string = this.spacesFromEnd(tokens) + string\n if (string !== ' !important') node.raws.important = string\n break\n } else if (token[1].toLowerCase() === 'important') {\n let cache = tokens.slice(0)\n let str = ''\n for (let j = i; j > 0; j--) {\n let type = cache[j][0]\n if (str.trim().startsWith('!') && type !== 'space') {\n break\n }\n str = cache.pop()[1] + str\n }\n if (str.trim().startsWith('!')) {\n node.important = true\n node.raws.important = str\n tokens = cache\n }\n }\n\n if (token[0] !== 'space' && token[0] !== 'comment') {\n break\n }\n }\n\n let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment')\n\n if (hasWord) {\n node.raws.between += firstSpaces.map(i => i[1]).join('')\n firstSpaces = []\n }\n this.raw(node, 'value', firstSpaces.concat(tokens), customProperty)\n\n if (node.value.includes(':') && !customProperty) {\n this.checkMissedSemicolon(tokens)\n }\n }\n\n doubleColon(token) {\n throw this.input.error(\n 'Double colon',\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n )\n }\n\n emptyRule(token) {\n let node = new Rule()\n this.init(node, token[2])\n node.selector = ''\n node.raws.between = ''\n this.current = node\n }\n\n end(token) {\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon\n }\n this.semicolon = false\n\n this.current.raws.after = (this.current.raws.after || '') + this.spaces\n this.spaces = ''\n\n if (this.current.parent) {\n this.current.source.end = this.getPosition(token[2])\n this.current.source.end.offset++\n this.current = this.current.parent\n } else {\n this.unexpectedClose(token)\n }\n }\n\n endFile() {\n if (this.current.parent) this.unclosedBlock()\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon\n }\n this.current.raws.after = (this.current.raws.after || '') + this.spaces\n this.root.source.end = this.getPosition(this.tokenizer.position())\n }\n\n freeSemicolon(token) {\n this.spaces += token[1]\n if (this.current.nodes) {\n let prev = this.current.nodes[this.current.nodes.length - 1]\n if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {\n prev.raws.ownSemicolon = this.spaces\n this.spaces = ''\n }\n }\n }\n\n // Helpers\n\n getPosition(offset) {\n let pos = this.input.fromOffset(offset)\n return {\n column: pos.col,\n line: pos.line,\n offset\n }\n }\n\n init(node, offset) {\n this.current.push(node)\n node.source = {\n input: this.input,\n start: this.getPosition(offset)\n }\n node.raws.before = this.spaces\n this.spaces = ''\n if (node.type !== 'comment') this.semicolon = false\n }\n\n other(start) {\n let end = false\n let type = null\n let colon = false\n let bracket = null\n let brackets = []\n let customProperty = start[1].startsWith('--')\n\n let tokens = []\n let token = start\n while (token) {\n type = token[0]\n tokens.push(token)\n\n if (type === '(' || type === '[') {\n if (!bracket) bracket = token\n brackets.push(type === '(' ? ')' : ']')\n } else if (customProperty && colon && type === '{') {\n if (!bracket) bracket = token\n brackets.push('}')\n } else if (brackets.length === 0) {\n if (type === ';') {\n if (colon) {\n this.decl(tokens, customProperty)\n return\n } else {\n break\n }\n } else if (type === '{') {\n this.rule(tokens)\n return\n } else if (type === '}') {\n this.tokenizer.back(tokens.pop())\n end = true\n break\n } else if (type === ':') {\n colon = true\n }\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop()\n if (brackets.length === 0) bracket = null\n }\n\n token = this.tokenizer.nextToken()\n }\n\n if (this.tokenizer.endOfFile()) end = true\n if (brackets.length > 0) this.unclosedBracket(bracket)\n\n if (end && colon) {\n if (!customProperty) {\n while (tokens.length) {\n token = tokens[tokens.length - 1][0]\n if (token !== 'space' && token !== 'comment') break\n this.tokenizer.back(tokens.pop())\n }\n }\n this.decl(tokens, customProperty)\n } else {\n this.unknownWord(tokens)\n }\n }\n\n parse() {\n let token\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken()\n\n switch (token[0]) {\n case 'space':\n this.spaces += token[1]\n break\n\n case ';':\n this.freeSemicolon(token)\n break\n\n case '}':\n this.end(token)\n break\n\n case 'comment':\n this.comment(token)\n break\n\n case 'at-word':\n this.atrule(token)\n break\n\n case '{':\n this.emptyRule(token)\n break\n\n default:\n this.other(token)\n break\n }\n }\n this.endFile()\n }\n\n precheckMissedSemicolon(/* tokens */) {\n // Hook for Safe Parser\n }\n\n raw(node, prop, tokens, customProperty) {\n let token, type\n let length = tokens.length\n let value = ''\n let clean = true\n let next, prev\n\n for (let i = 0; i < length; i += 1) {\n token = tokens[i]\n type = token[0]\n if (type === 'space' && i === length - 1 && !customProperty) {\n clean = false\n } else if (type === 'comment') {\n prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty'\n next = tokens[i + 1] ? tokens[i + 1][0] : 'empty'\n if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {\n if (value.slice(-1) === ',') {\n clean = false\n } else {\n value += token[1]\n }\n } else {\n clean = false\n }\n } else {\n value += token[1]\n }\n }\n if (!clean) {\n let raw = tokens.reduce((all, i) => all + i[1], '')\n node.raws[prop] = { raw, value }\n }\n node[prop] = value\n }\n\n rule(tokens) {\n tokens.pop()\n\n let node = new Rule()\n this.init(node, tokens[0][2])\n\n node.raws.between = this.spacesAndCommentsFromEnd(tokens)\n this.raw(node, 'selector', tokens)\n this.current = node\n }\n\n spacesAndCommentsFromEnd(tokens) {\n let lastTokenType\n let spaces = ''\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0]\n if (lastTokenType !== 'space' && lastTokenType !== 'comment') break\n spaces = tokens.pop()[1] + spaces\n }\n return spaces\n }\n\n // Errors\n\n spacesAndCommentsFromStart(tokens) {\n let next\n let spaces = ''\n while (tokens.length) {\n next = tokens[0][0]\n if (next !== 'space' && next !== 'comment') break\n spaces += tokens.shift()[1]\n }\n return spaces\n }\n\n spacesFromEnd(tokens) {\n let lastTokenType\n let spaces = ''\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0]\n if (lastTokenType !== 'space') break\n spaces = tokens.pop()[1] + spaces\n }\n return spaces\n }\n\n stringFrom(tokens, from) {\n let result = ''\n for (let i = from; i < tokens.length; i++) {\n result += tokens[i][1]\n }\n tokens.splice(from, tokens.length - from)\n return result\n }\n\n unclosedBlock() {\n let pos = this.current.source.start\n throw this.input.error('Unclosed block', pos.line, pos.column)\n }\n\n unclosedBracket(bracket) {\n throw this.input.error(\n 'Unclosed bracket',\n { offset: bracket[2] },\n { offset: bracket[2] + 1 }\n )\n }\n\n unexpectedClose(token) {\n throw this.input.error(\n 'Unexpected }',\n { offset: token[2] },\n { offset: token[2] + 1 }\n )\n }\n\n unknownWord(tokens) {\n throw this.input.error(\n 'Unknown word',\n { offset: tokens[0][2] },\n { offset: tokens[0][2] + tokens[0][1].length }\n )\n }\n\n unnamedAtrule(node, token) {\n throw this.input.error(\n 'At-rule without name',\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n )\n }\n}\n\nmodule.exports = Parser\n", "'use strict'\n\nlet Container = require('./container')\nlet Input = require('./input')\nlet Parser = require('./parser')\n\nfunction parse(css, opts) {\n let input = new Input(css, opts)\n let parser = new Parser(input)\n try {\n parser.parse()\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n if (e.name === 'CssSyntaxError' && opts && opts.from) {\n if (/\\.scss$/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse SCSS with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-scss parser'\n } else if (/\\.sass/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse Sass with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-sass parser'\n } else if (/\\.less$/i.test(opts.from)) {\n e.message +=\n '\\nYou tried to parse Less with ' +\n 'the standard CSS parser; ' +\n 'try again with the postcss-less parser'\n }\n }\n }\n throw e\n }\n\n return parser.root\n}\n\nmodule.exports = parse\nparse.default = parse\n\nContainer.registerParse(parse)\n", "'use strict'\n\nclass Warning {\n constructor(text, opts = {}) {\n this.type = 'warning'\n this.text = text\n\n if (opts.node && opts.node.source) {\n let range = opts.node.rangeBy(opts)\n this.line = range.start.line\n this.column = range.start.column\n this.endLine = range.end.line\n this.endColumn = range.end.column\n }\n\n for (let opt in opts) this[opt] = opts[opt]\n }\n\n toString() {\n if (this.node) {\n return this.node.error(this.text, {\n index: this.index,\n plugin: this.plugin,\n word: this.word\n }).message\n }\n\n if (this.plugin) {\n return this.plugin + ': ' + this.text\n }\n\n return this.text\n }\n}\n\nmodule.exports = Warning\nWarning.default = Warning\n", "'use strict'\n\nlet Warning = require('./warning')\n\nclass Result {\n constructor(processor, root, opts) {\n this.processor = processor\n this.messages = []\n this.root = root\n this.opts = opts\n this.css = undefined\n this.map = undefined\n }\n\n toString() {\n return this.css\n }\n\n warn(text, opts = {}) {\n if (!opts.plugin) {\n if (this.lastPlugin && this.lastPlugin.postcssPlugin) {\n opts.plugin = this.lastPlugin.postcssPlugin\n }\n }\n\n let warning = new Warning(text, opts)\n this.messages.push(warning)\n\n return warning\n }\n\n warnings() {\n return this.messages.filter(i => i.type === 'warning')\n }\n\n get content() {\n return this.css\n }\n}\n\nmodule.exports = Result\nResult.default = Result\n", "/* eslint-disable no-console */\n'use strict'\n\nlet printed = {}\n\nmodule.exports = function warnOnce(message) {\n if (printed[message]) return\n printed[message] = true\n\n if (typeof console !== 'undefined' && console.warn) {\n console.warn(message)\n }\n}\n", "'use strict'\n\nlet Container = require('./container')\nlet Document = require('./document')\nlet MapGenerator = require('./map-generator')\nlet parse = require('./parse')\nlet Result = require('./result')\nlet Root = require('./root')\nlet stringify = require('./stringify')\nlet { isClean, my } = require('./symbols')\nlet warnOnce = require('./warn-once')\n\nconst TYPE_TO_CLASS_NAME = {\n atrule: 'AtRule',\n comment: 'Comment',\n decl: 'Declaration',\n document: 'Document',\n root: 'Root',\n rule: 'Rule'\n}\n\nconst PLUGIN_PROPS = {\n AtRule: true,\n AtRuleExit: true,\n Comment: true,\n CommentExit: true,\n Declaration: true,\n DeclarationExit: true,\n Document: true,\n DocumentExit: true,\n Once: true,\n OnceExit: true,\n postcssPlugin: true,\n prepare: true,\n Root: true,\n RootExit: true,\n Rule: true,\n RuleExit: true\n}\n\nconst NOT_VISITORS = {\n Once: true,\n postcssPlugin: true,\n prepare: true\n}\n\nconst CHILDREN = 0\n\nfunction isPromise(obj) {\n return typeof obj === 'object' && typeof obj.then === 'function'\n}\n\nfunction getEvents(node) {\n let key = false\n let type = TYPE_TO_CLASS_NAME[node.type]\n if (node.type === 'decl') {\n key = node.prop.toLowerCase()\n } else if (node.type === 'atrule') {\n key = node.name.toLowerCase()\n }\n\n if (key && node.append) {\n return [\n type,\n type + '-' + key,\n CHILDREN,\n type + 'Exit',\n type + 'Exit-' + key\n ]\n } else if (key) {\n return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key]\n } else if (node.append) {\n return [type, CHILDREN, type + 'Exit']\n } else {\n return [type, type + 'Exit']\n }\n}\n\nfunction toStack(node) {\n let events\n if (node.type === 'document') {\n events = ['Document', CHILDREN, 'DocumentExit']\n } else if (node.type === 'root') {\n events = ['Root', CHILDREN, 'RootExit']\n } else {\n events = getEvents(node)\n }\n\n return {\n eventIndex: 0,\n events,\n iterator: 0,\n node,\n visitorIndex: 0,\n visitors: []\n }\n}\n\nfunction cleanMarks(node) {\n node[isClean] = false\n if (node.nodes) node.nodes.forEach(i => cleanMarks(i))\n return node\n}\n\nlet postcss = {}\n\nclass LazyResult {\n constructor(processor, css, opts) {\n this.stringified = false\n this.processed = false\n\n let root\n if (\n typeof css === 'object' &&\n css !== null &&\n (css.type === 'root' || css.type === 'document')\n ) {\n root = cleanMarks(css)\n } else if (css instanceof LazyResult || css instanceof Result) {\n root = cleanMarks(css.root)\n if (css.map) {\n if (typeof opts.map === 'undefined') opts.map = {}\n if (!opts.map.inline) opts.map.inline = false\n opts.map.prev = css.map\n }\n } else {\n let parser = parse\n if (opts.syntax) parser = opts.syntax.parse\n if (opts.parser) parser = opts.parser\n if (parser.parse) parser = parser.parse\n\n try {\n root = parser(css, opts)\n } catch (error) {\n this.processed = true\n this.error = error\n }\n\n if (root && !root[my]) {\n /* c8 ignore next 2 */\n Container.rebuild(root)\n }\n }\n\n this.result = new Result(processor, root, opts)\n this.helpers = { ...postcss, postcss, result: this.result }\n this.plugins = this.processor.plugins.map(plugin => {\n if (typeof plugin === 'object' && plugin.prepare) {\n return { ...plugin, ...plugin.prepare(this.result) }\n } else {\n return plugin\n }\n })\n }\n\n async() {\n if (this.error) return Promise.reject(this.error)\n if (this.processed) return Promise.resolve(this.result)\n if (!this.processing) {\n this.processing = this.runAsync()\n }\n return this.processing\n }\n\n catch(onRejected) {\n return this.async().catch(onRejected)\n }\n\n finally(onFinally) {\n return this.async().then(onFinally, onFinally)\n }\n\n getAsyncError() {\n throw new Error('Use process(css).then(cb) to work with async plugins')\n }\n\n handleError(error, node) {\n let plugin = this.result.lastPlugin\n try {\n if (node) node.addToError(error)\n this.error = error\n if (error.name === 'CssSyntaxError' && !error.plugin) {\n error.plugin = plugin.postcssPlugin\n error.setMessage()\n } else if (plugin.postcssVersion) {\n if (process.env.NODE_ENV !== 'production') {\n let pluginName = plugin.postcssPlugin\n let pluginVer = plugin.postcssVersion\n let runtimeVer = this.result.processor.version\n let a = pluginVer.split('.')\n let b = runtimeVer.split('.')\n\n if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {\n // eslint-disable-next-line no-console\n console.error(\n 'Unknown error from PostCSS plugin. Your current PostCSS ' +\n 'version is ' +\n runtimeVer +\n ', but ' +\n pluginName +\n ' uses ' +\n pluginVer +\n '. Perhaps this is the source of the error below.'\n )\n }\n }\n }\n } catch (err) {\n /* c8 ignore next 3 */\n // eslint-disable-next-line no-console\n if (console && console.error) console.error(err)\n }\n return error\n }\n\n prepareVisitors() {\n this.listeners = {}\n let add = (plugin, type, cb) => {\n if (!this.listeners[type]) this.listeners[type] = []\n this.listeners[type].push([plugin, cb])\n }\n for (let plugin of this.plugins) {\n if (typeof plugin === 'object') {\n for (let event in plugin) {\n if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {\n throw new Error(\n `Unknown event ${event} in ${plugin.postcssPlugin}. ` +\n `Try to update PostCSS (${this.processor.version} now).`\n )\n }\n if (!NOT_VISITORS[event]) {\n if (typeof plugin[event] === 'object') {\n for (let filter in plugin[event]) {\n if (filter === '*') {\n add(plugin, event, plugin[event][filter])\n } else {\n add(\n plugin,\n event + '-' + filter.toLowerCase(),\n plugin[event][filter]\n )\n }\n }\n } else if (typeof plugin[event] === 'function') {\n add(plugin, event, plugin[event])\n }\n }\n }\n }\n }\n this.hasListener = Object.keys(this.listeners).length > 0\n }\n\n async runAsync() {\n this.plugin = 0\n for (let i = 0; i < this.plugins.length; i++) {\n let plugin = this.plugins[i]\n let promise = this.runOnRoot(plugin)\n if (isPromise(promise)) {\n try {\n await promise\n } catch (error) {\n throw this.handleError(error)\n }\n }\n }\n\n this.prepareVisitors()\n if (this.hasListener) {\n let root = this.result.root\n while (!root[isClean]) {\n root[isClean] = true\n let stack = [toStack(root)]\n while (stack.length > 0) {\n let promise = this.visitTick(stack)\n if (isPromise(promise)) {\n try {\n await promise\n } catch (e) {\n let node = stack[stack.length - 1].node\n throw this.handleError(e, node)\n }\n }\n }\n }\n\n if (this.listeners.OnceExit) {\n for (let [plugin, visitor] of this.listeners.OnceExit) {\n this.result.lastPlugin = plugin\n try {\n if (root.type === 'document') {\n let roots = root.nodes.map(subRoot =>\n visitor(subRoot, this.helpers)\n )\n\n await Promise.all(roots)\n } else {\n await visitor(root, this.helpers)\n }\n } catch (e) {\n throw this.handleError(e)\n }\n }\n }\n }\n\n this.processed = true\n return this.stringify()\n }\n\n runOnRoot(plugin) {\n this.result.lastPlugin = plugin\n try {\n if (typeof plugin === 'object' && plugin.Once) {\n if (this.result.root.type === 'document') {\n let roots = this.result.root.nodes.map(root =>\n plugin.Once(root, this.helpers)\n )\n\n if (isPromise(roots[0])) {\n return Promise.all(roots)\n }\n\n return roots\n }\n\n return plugin.Once(this.result.root, this.helpers)\n } else if (typeof plugin === 'function') {\n return plugin(this.result.root, this.result)\n }\n } catch (error) {\n throw this.handleError(error)\n }\n }\n\n stringify() {\n if (this.error) throw this.error\n if (this.stringified) return this.result\n this.stringified = true\n\n this.sync()\n\n let opts = this.result.opts\n let str = stringify\n if (opts.syntax) str = opts.syntax.stringify\n if (opts.stringifier) str = opts.stringifier\n if (str.stringify) str = str.stringify\n\n let map = new MapGenerator(str, this.result.root, this.result.opts)\n let data = map.generate()\n this.result.css = data[0]\n this.result.map = data[1]\n\n return this.result\n }\n\n sync() {\n if (this.error) throw this.error\n if (this.processed) return this.result\n this.processed = true\n\n if (this.processing) {\n throw this.getAsyncError()\n }\n\n for (let plugin of this.plugins) {\n let promise = this.runOnRoot(plugin)\n if (isPromise(promise)) {\n throw this.getAsyncError()\n }\n }\n\n this.prepareVisitors()\n if (this.hasListener) {\n let root = this.result.root\n while (!root[isClean]) {\n root[isClean] = true\n this.walkSync(root)\n }\n if (this.listeners.OnceExit) {\n if (root.type === 'document') {\n for (let subRoot of root.nodes) {\n this.visitSync(this.listeners.OnceExit, subRoot)\n }\n } else {\n this.visitSync(this.listeners.OnceExit, root)\n }\n }\n }\n\n return this.result\n }\n\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== 'production') {\n if (!('from' in this.opts)) {\n warnOnce(\n 'Without `from` option PostCSS could generate wrong source map ' +\n 'and will not find Browserslist config. Set it to CSS file path ' +\n 'or to `undefined` to prevent this warning.'\n )\n }\n }\n return this.async().then(onFulfilled, onRejected)\n }\n\n toString() {\n return this.css\n }\n\n visitSync(visitors, node) {\n for (let [plugin, visitor] of visitors) {\n this.result.lastPlugin = plugin\n let promise\n try {\n promise = visitor(node, this.helpers)\n } catch (e) {\n throw this.handleError(e, node.proxyOf)\n }\n if (node.type !== 'root' && node.type !== 'document' && !node.parent) {\n return true\n }\n if (isPromise(promise)) {\n throw this.getAsyncError()\n }\n }\n }\n\n visitTick(stack) {\n let visit = stack[stack.length - 1]\n let { node, visitors } = visit\n\n if (node.type !== 'root' && node.type !== 'document' && !node.parent) {\n stack.pop()\n return\n }\n\n if (visitors.length > 0 && visit.visitorIndex < visitors.length) {\n let [plugin, visitor] = visitors[visit.visitorIndex]\n visit.visitorIndex += 1\n if (visit.visitorIndex === visitors.length) {\n visit.visitors = []\n visit.visitorIndex = 0\n }\n this.result.lastPlugin = plugin\n try {\n return visitor(node.toProxy(), this.helpers)\n } catch (e) {\n throw this.handleError(e, node)\n }\n }\n\n if (visit.iterator !== 0) {\n let iterator = visit.iterator\n let child\n while ((child = node.nodes[node.indexes[iterator]])) {\n node.indexes[iterator] += 1\n if (!child[isClean]) {\n child[isClean] = true\n stack.push(toStack(child))\n return\n }\n }\n visit.iterator = 0\n delete node.indexes[iterator]\n }\n\n let events = visit.events\n while (visit.eventIndex < events.length) {\n let event = events[visit.eventIndex]\n visit.eventIndex += 1\n if (event === CHILDREN) {\n if (node.nodes && node.nodes.length) {\n node[isClean] = true\n visit.iterator = node.getIterator()\n }\n return\n } else if (this.listeners[event]) {\n visit.visitors = this.listeners[event]\n return\n }\n }\n stack.pop()\n }\n\n walkSync(node) {\n node[isClean] = true\n let events = getEvents(node)\n for (let event of events) {\n if (event === CHILDREN) {\n if (node.nodes) {\n node.each(child => {\n if (!child[isClean]) this.walkSync(child)\n })\n }\n } else {\n let visitors = this.listeners[event]\n if (visitors) {\n if (this.visitSync(visitors, node.toProxy())) return\n }\n }\n }\n }\n\n warnings() {\n return this.sync().warnings()\n }\n\n get content() {\n return this.stringify().content\n }\n\n get css() {\n return this.stringify().css\n }\n\n get map() {\n return this.stringify().map\n }\n\n get messages() {\n return this.sync().messages\n }\n\n get opts() {\n return this.result.opts\n }\n\n get processor() {\n return this.result.processor\n }\n\n get root() {\n return this.sync().root\n }\n\n get [Symbol.toStringTag]() {\n return 'LazyResult'\n }\n}\n\nLazyResult.registerPostcss = dependant => {\n postcss = dependant\n}\n\nmodule.exports = LazyResult\nLazyResult.default = LazyResult\n\nRoot.registerLazyResult(LazyResult)\nDocument.registerLazyResult(LazyResult)\n", "'use strict'\n\nlet MapGenerator = require('./map-generator')\nlet parse = require('./parse')\nconst Result = require('./result')\nlet stringify = require('./stringify')\nlet warnOnce = require('./warn-once')\n\nclass NoWorkResult {\n constructor(processor, css, opts) {\n css = css.toString()\n this.stringified = false\n\n this._processor = processor\n this._css = css\n this._opts = opts\n this._map = undefined\n let root\n\n let str = stringify\n this.result = new Result(this._processor, root, this._opts)\n this.result.css = css\n\n let self = this\n Object.defineProperty(this.result, 'root', {\n get() {\n return self.root\n }\n })\n\n let map = new MapGenerator(str, root, this._opts, css)\n if (map.isMap()) {\n let [generatedCSS, generatedMap] = map.generate()\n if (generatedCSS) {\n this.result.css = generatedCSS\n }\n if (generatedMap) {\n this.result.map = generatedMap\n }\n } else {\n map.clearAnnotation()\n this.result.css = map.css\n }\n }\n\n async() {\n if (this.error) return Promise.reject(this.error)\n return Promise.resolve(this.result)\n }\n\n catch(onRejected) {\n return this.async().catch(onRejected)\n }\n\n finally(onFinally) {\n return this.async().then(onFinally, onFinally)\n }\n\n sync() {\n if (this.error) throw this.error\n return this.result\n }\n\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== 'production') {\n if (!('from' in this._opts)) {\n warnOnce(\n 'Without `from` option PostCSS could generate wrong source map ' +\n 'and will not find Browserslist config. Set it to CSS file path ' +\n 'or to `undefined` to prevent this warning.'\n )\n }\n }\n\n return this.async().then(onFulfilled, onRejected)\n }\n\n toString() {\n return this._css\n }\n\n warnings() {\n return []\n }\n\n get content() {\n return this.result.css\n }\n\n get css() {\n return this.result.css\n }\n\n get map() {\n return this.result.map\n }\n\n get messages() {\n return []\n }\n\n get opts() {\n return this.result.opts\n }\n\n get processor() {\n return this.result.processor\n }\n\n get root() {\n if (this._root) {\n return this._root\n }\n\n let root\n let parser = parse\n\n try {\n root = parser(this._css, this._opts)\n } catch (error) {\n this.error = error\n }\n\n if (this.error) {\n throw this.error\n } else {\n this._root = root\n return root\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'NoWorkResult'\n }\n}\n\nmodule.exports = NoWorkResult\nNoWorkResult.default = NoWorkResult\n", "'use strict'\n\nlet Document = require('./document')\nlet LazyResult = require('./lazy-result')\nlet NoWorkResult = require('./no-work-result')\nlet Root = require('./root')\n\nclass Processor {\n constructor(plugins = []) {\n this.version = '8.4.44'\n this.plugins = this.normalize(plugins)\n }\n\n normalize(plugins) {\n let normalized = []\n for (let i of plugins) {\n if (i.postcss === true) {\n i = i()\n } else if (i.postcss) {\n i = i.postcss\n }\n\n if (typeof i === 'object' && Array.isArray(i.plugins)) {\n normalized = normalized.concat(i.plugins)\n } else if (typeof i === 'object' && i.postcssPlugin) {\n normalized.push(i)\n } else if (typeof i === 'function') {\n normalized.push(i)\n } else if (typeof i === 'object' && (i.parse || i.stringify)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'PostCSS syntaxes cannot be used as plugins. Instead, please use ' +\n 'one of the syntax/parser/stringifier options as outlined ' +\n 'in your PostCSS runner documentation.'\n )\n }\n } else {\n throw new Error(i + ' is not a PostCSS plugin')\n }\n }\n return normalized\n }\n\n process(css, opts = {}) {\n if (\n !this.plugins.length &&\n !opts.parser &&\n !opts.stringifier &&\n !opts.syntax\n ) {\n return new NoWorkResult(this, css, opts)\n } else {\n return new LazyResult(this, css, opts)\n }\n }\n\n use(plugin) {\n this.plugins = this.plugins.concat(this.normalize([plugin]))\n return this\n }\n}\n\nmodule.exports = Processor\nProcessor.default = Processor\n\nRoot.registerProcessor(Processor)\nDocument.registerProcessor(Processor)\n", "'use strict'\n\nlet AtRule = require('./at-rule')\nlet Comment = require('./comment')\nlet Container = require('./container')\nlet CssSyntaxError = require('./css-syntax-error')\nlet Declaration = require('./declaration')\nlet Document = require('./document')\nlet fromJSON = require('./fromJSON')\nlet Input = require('./input')\nlet LazyResult = require('./lazy-result')\nlet list = require('./list')\nlet Node = require('./node')\nlet parse = require('./parse')\nlet Processor = require('./processor')\nlet Result = require('./result.js')\nlet Root = require('./root')\nlet Rule = require('./rule')\nlet stringify = require('./stringify')\nlet Warning = require('./warning')\n\nfunction postcss(...plugins) {\n if (plugins.length === 1 && Array.isArray(plugins[0])) {\n plugins = plugins[0]\n }\n return new Processor(plugins)\n}\n\npostcss.plugin = function plugin(name, initializer) {\n let warningPrinted = false\n function creator(...args) {\n // eslint-disable-next-line no-console\n if (console && console.warn && !warningPrinted) {\n warningPrinted = true\n // eslint-disable-next-line no-console\n console.warn(\n name +\n ': postcss.plugin was deprecated. Migration guide:\\n' +\n 'https://evilmartians.com/chronicles/postcss-8-plugin-migration'\n )\n if (process.env.LANG && process.env.LANG.startsWith('cn')) {\n /* c8 ignore next 7 */\n // eslint-disable-next-line no-console\n console.warn(\n name +\n ': \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:\\n' +\n 'https://www.w3ctech.com/topic/2226'\n )\n }\n }\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n }\n })\n\n creator.process = function (css, processOpts, pluginOpts) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n}\n\npostcss.stringify = stringify\npostcss.parse = parse\npostcss.fromJSON = fromJSON\npostcss.list = list\n\npostcss.comment = defaults => new Comment(defaults)\npostcss.atRule = defaults => new AtRule(defaults)\npostcss.decl = defaults => new Declaration(defaults)\npostcss.rule = defaults => new Rule(defaults)\npostcss.root = defaults => new Root(defaults)\npostcss.document = defaults => new Document(defaults)\n\npostcss.CssSyntaxError = CssSyntaxError\npostcss.Declaration = Declaration\npostcss.Container = Container\npostcss.Processor = Processor\npostcss.Document = Document\npostcss.Comment = Comment\npostcss.Warning = Warning\npostcss.AtRule = AtRule\npostcss.Result = Result\npostcss.Input = Input\npostcss.Rule = Rule\npostcss.Root = Root\npostcss.Node = Node\n\nLazyResult.registerPostcss(postcss)\n\nmodule.exports = postcss\npostcss.default = postcss\n", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = unesc;\n// Many thanks for this post which made this migration much easier.\n// https://mathiasbynens.be/notes/css-escapes\n\n/**\n * \n * @param {string} str \n * @returns {[string, number]|undefined}\n */\nfunction gobbleHex(str) {\n var lower = str.toLowerCase();\n var hex = '';\n var spaceTerminated = false;\n for (var i = 0; i < 6 && lower[i] !== undefined; i++) {\n var code = lower.charCodeAt(i);\n // check to see if we are dealing with a valid hex char [a-f|0-9]\n var valid = code >= 97 && code <= 102 || code >= 48 && code <= 57;\n // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point\n spaceTerminated = code === 32;\n if (!valid) {\n break;\n }\n hex += lower[i];\n }\n if (hex.length === 0) {\n return undefined;\n }\n var codePoint = parseInt(hex, 16);\n var isSurrogate = codePoint >= 0xD800 && codePoint <= 0xDFFF;\n // Add special case for\n // \"If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point\"\n // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point\n if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10FFFF) {\n return [\"\\uFFFD\", hex.length + (spaceTerminated ? 1 : 0)];\n }\n return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];\n}\nvar CONTAINS_ESCAPE = /\\\\/;\nfunction unesc(str) {\n var needToProcess = CONTAINS_ESCAPE.test(str);\n if (!needToProcess) {\n return str;\n }\n var ret = \"\";\n for (var i = 0; i < str.length; i++) {\n if (str[i] === \"\\\\\") {\n var gobbled = gobbleHex(str.slice(i + 1, i + 7));\n if (gobbled !== undefined) {\n ret += gobbled[0];\n i += gobbled[1];\n continue;\n }\n\n // Retain a pair of \\\\ if double escaped `\\\\\\\\`\n // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e\n if (str[i + 1] === \"\\\\\") {\n ret += \"\\\\\";\n i++;\n continue;\n }\n\n // if \\\\ is at the end of the string retain it\n // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb\n if (str.length === i + 1) {\n ret += str[i];\n }\n continue;\n }\n ret += str[i];\n }\n return ret;\n}\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = getProp;\nfunction getProp(obj) {\n for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n props[_key - 1] = arguments[_key];\n }\n while (props.length > 0) {\n var prop = props.shift();\n if (!obj[prop]) {\n return undefined;\n }\n obj = obj[prop];\n }\n return obj;\n}\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = ensureObject;\nfunction ensureObject(obj) {\n for (var _len = arguments.length, props = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n props[_key - 1] = arguments[_key];\n }\n while (props.length > 0) {\n var prop = props.shift();\n if (!obj[prop]) {\n obj[prop] = {};\n }\n obj = obj[prop];\n }\n}\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = stripComments;\nfunction stripComments(str) {\n var s = \"\";\n var commentStart = str.indexOf(\"/*\");\n var lastEnd = 0;\n while (commentStart >= 0) {\n s = s + str.slice(lastEnd, commentStart);\n var commentEnd = str.indexOf(\"*/\", commentStart + 2);\n if (commentEnd < 0) {\n return s;\n }\n lastEnd = commentEnd + 2;\n commentStart = str.indexOf(\"/*\", lastEnd);\n }\n s = s + str.slice(lastEnd);\n return s;\n}\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports.unesc = exports.stripComments = exports.getProp = exports.ensureObject = void 0;\nvar _unesc = _interopRequireDefault(require(\"./unesc\"));\nexports.unesc = _unesc[\"default\"];\nvar _getProp = _interopRequireDefault(require(\"./getProp\"));\nexports.getProp = _getProp[\"default\"];\nvar _ensureObject = _interopRequireDefault(require(\"./ensureObject\"));\nexports.ensureObject = _ensureObject[\"default\"];\nvar _stripComments = _interopRequireDefault(require(\"./stripComments\"));\nexports.stripComments = _stripComments[\"default\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _util = require(\"../util\");\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nvar cloneNode = function cloneNode(obj, parent) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var cloned = new obj.constructor();\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) {\n continue;\n }\n var value = obj[i];\n var type = typeof value;\n if (i === 'parent' && type === 'object') {\n if (parent) {\n cloned[i] = parent;\n }\n } else if (value instanceof Array) {\n cloned[i] = value.map(function (j) {\n return cloneNode(j, cloned);\n });\n } else {\n cloned[i] = cloneNode(value, cloned);\n }\n }\n return cloned;\n};\nvar Node = /*#__PURE__*/function () {\n function Node(opts) {\n if (opts === void 0) {\n opts = {};\n }\n Object.assign(this, opts);\n this.spaces = this.spaces || {};\n this.spaces.before = this.spaces.before || '';\n this.spaces.after = this.spaces.after || '';\n }\n var _proto = Node.prototype;\n _proto.remove = function remove() {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.parent = undefined;\n return this;\n };\n _proto.replaceWith = function replaceWith() {\n if (this.parent) {\n for (var index in arguments) {\n this.parent.insertBefore(this, arguments[index]);\n }\n this.remove();\n }\n return this;\n };\n _proto.next = function next() {\n return this.parent.at(this.parent.index(this) + 1);\n };\n _proto.prev = function prev() {\n return this.parent.at(this.parent.index(this) - 1);\n };\n _proto.clone = function clone(overrides) {\n if (overrides === void 0) {\n overrides = {};\n }\n var cloned = cloneNode(this);\n for (var name in overrides) {\n cloned[name] = overrides[name];\n }\n return cloned;\n }\n\n /**\n * Some non-standard syntax doesn't follow normal escaping rules for css.\n * This allows non standard syntax to be appended to an existing property\n * by specifying the escaped value. By specifying the escaped value,\n * illegal characters are allowed to be directly inserted into css output.\n * @param {string} name the property to set\n * @param {any} value the unescaped value of the property\n * @param {string} valueEscaped optional. the escaped value of the property.\n */;\n _proto.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {\n if (!this.raws) {\n this.raws = {};\n }\n var originalValue = this[name];\n var originalEscaped = this.raws[name];\n this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.\n if (originalEscaped || valueEscaped !== value) {\n this.raws[name] = (originalEscaped || originalValue) + valueEscaped;\n } else {\n delete this.raws[name]; // delete any escaped value that was created by the setter.\n }\n }\n\n /**\n * Some non-standard syntax doesn't follow normal escaping rules for css.\n * This allows the escaped value to be specified directly, allowing illegal\n * characters to be directly inserted into css output.\n * @param {string} name the property to set\n * @param {any} value the unescaped value of the property\n * @param {string} valueEscaped the escaped value of the property.\n */;\n _proto.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {\n if (!this.raws) {\n this.raws = {};\n }\n this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.\n this.raws[name] = valueEscaped;\n }\n\n /**\n * When you want a value to passed through to CSS directly. This method\n * deletes the corresponding raw value causing the stringifier to fallback\n * to the unescaped value.\n * @param {string} name the property to set.\n * @param {any} value The value that is both escaped and unescaped.\n */;\n _proto.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {\n this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.\n if (this.raws) {\n delete this.raws[name];\n }\n }\n\n /**\n *\n * @param {number} line The number (starting with 1)\n * @param {number} column The column number (starting with 1)\n */;\n _proto.isAtPosition = function isAtPosition(line, column) {\n if (this.source && this.source.start && this.source.end) {\n if (this.source.start.line > line) {\n return false;\n }\n if (this.source.end.line < line) {\n return false;\n }\n if (this.source.start.line === line && this.source.start.column > column) {\n return false;\n }\n if (this.source.end.line === line && this.source.end.column < column) {\n return false;\n }\n return true;\n }\n return undefined;\n };\n _proto.stringifyProperty = function stringifyProperty(name) {\n return this.raws && this.raws[name] || this[name];\n };\n _proto.valueToString = function valueToString() {\n return String(this.stringifyProperty(\"value\"));\n };\n _proto.toString = function toString() {\n return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join('');\n };\n _createClass(Node, [{\n key: \"rawSpaceBefore\",\n get: function get() {\n var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;\n if (rawSpace === undefined) {\n rawSpace = this.spaces && this.spaces.before;\n }\n return rawSpace || \"\";\n },\n set: function set(raw) {\n (0, _util.ensureObject)(this, \"raws\", \"spaces\");\n this.raws.spaces.before = raw;\n }\n }, {\n key: \"rawSpaceAfter\",\n get: function get() {\n var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;\n if (rawSpace === undefined) {\n rawSpace = this.spaces.after;\n }\n return rawSpace || \"\";\n },\n set: function set(raw) {\n (0, _util.ensureObject)(this, \"raws\", \"spaces\");\n this.raws.spaces.after = raw;\n }\n }]);\n return Node;\n}();\nexports[\"default\"] = Node;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports.UNIVERSAL = exports.TAG = exports.STRING = exports.SELECTOR = exports.ROOT = exports.PSEUDO = exports.NESTING = exports.ID = exports.COMMENT = exports.COMBINATOR = exports.CLASS = exports.ATTRIBUTE = void 0;\nvar TAG = 'tag';\nexports.TAG = TAG;\nvar STRING = 'string';\nexports.STRING = STRING;\nvar SELECTOR = 'selector';\nexports.SELECTOR = SELECTOR;\nvar ROOT = 'root';\nexports.ROOT = ROOT;\nvar PSEUDO = 'pseudo';\nexports.PSEUDO = PSEUDO;\nvar NESTING = 'nesting';\nexports.NESTING = NESTING;\nvar ID = 'id';\nexports.ID = ID;\nvar COMMENT = 'comment';\nexports.COMMENT = COMMENT;\nvar COMBINATOR = 'combinator';\nexports.COMBINATOR = COMBINATOR;\nvar CLASS = 'class';\nexports.CLASS = CLASS;\nvar ATTRIBUTE = 'attribute';\nexports.ATTRIBUTE = ATTRIBUTE;\nvar UNIVERSAL = 'universal';\nexports.UNIVERSAL = UNIVERSAL;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar types = _interopRequireWildcard(require(\"./types\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Container = /*#__PURE__*/function (_Node) {\n _inheritsLoose(Container, _Node);\n function Container(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n if (!_this.nodes) {\n _this.nodes = [];\n }\n return _this;\n }\n var _proto = Container.prototype;\n _proto.append = function append(selector) {\n selector.parent = this;\n this.nodes.push(selector);\n return this;\n };\n _proto.prepend = function prepend(selector) {\n selector.parent = this;\n this.nodes.unshift(selector);\n return this;\n };\n _proto.at = function at(index) {\n return this.nodes[index];\n };\n _proto.index = function index(child) {\n if (typeof child === 'number') {\n return child;\n }\n return this.nodes.indexOf(child);\n };\n _proto.removeChild = function removeChild(child) {\n child = this.index(child);\n this.at(child).parent = undefined;\n this.nodes.splice(child, 1);\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (index >= child) {\n this.indexes[id] = index - 1;\n }\n }\n return this;\n };\n _proto.removeAll = function removeAll() {\n for (var _iterator = _createForOfIteratorHelperLoose(this.nodes), _step; !(_step = _iterator()).done;) {\n var node = _step.value;\n node.parent = undefined;\n }\n this.nodes = [];\n return this;\n };\n _proto.empty = function empty() {\n return this.removeAll();\n };\n _proto.insertAfter = function insertAfter(oldNode, newNode) {\n newNode.parent = this;\n var oldIndex = this.index(oldNode);\n this.nodes.splice(oldIndex + 1, 0, newNode);\n newNode.parent = this;\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (oldIndex <= index) {\n this.indexes[id] = index + 1;\n }\n }\n return this;\n };\n _proto.insertBefore = function insertBefore(oldNode, newNode) {\n newNode.parent = this;\n var oldIndex = this.index(oldNode);\n this.nodes.splice(oldIndex, 0, newNode);\n newNode.parent = this;\n var index;\n for (var id in this.indexes) {\n index = this.indexes[id];\n if (index <= oldIndex) {\n this.indexes[id] = index + 1;\n }\n }\n return this;\n };\n _proto._findChildAtPosition = function _findChildAtPosition(line, col) {\n var found = undefined;\n this.each(function (node) {\n if (node.atPosition) {\n var foundChild = node.atPosition(line, col);\n if (foundChild) {\n found = foundChild;\n return false;\n }\n } else if (node.isAtPosition(line, col)) {\n found = node;\n return false;\n }\n });\n return found;\n }\n\n /**\n * Return the most specific node at the line and column number given.\n * The source location is based on the original parsed location, locations aren't\n * updated as selector nodes are mutated.\n * \n * Note that this location is relative to the location of the first character\n * of the selector, and not the location of the selector in the overall document\n * when used in conjunction with postcss.\n *\n * If not found, returns undefined.\n * @param {number} line The line number of the node to find. (1-based index)\n * @param {number} col The column number of the node to find. (1-based index)\n */;\n _proto.atPosition = function atPosition(line, col) {\n if (this.isAtPosition(line, col)) {\n return this._findChildAtPosition(line, col) || this;\n } else {\n return undefined;\n }\n };\n _proto._inferEndPosition = function _inferEndPosition() {\n if (this.last && this.last.source && this.last.source.end) {\n this.source = this.source || {};\n this.source.end = this.source.end || {};\n Object.assign(this.source.end, this.last.source.end);\n }\n };\n _proto.each = function each(callback) {\n if (!this.lastEach) {\n this.lastEach = 0;\n }\n if (!this.indexes) {\n this.indexes = {};\n }\n this.lastEach++;\n var id = this.lastEach;\n this.indexes[id] = 0;\n if (!this.length) {\n return undefined;\n }\n var index, result;\n while (this.indexes[id] < this.length) {\n index = this.indexes[id];\n result = callback(this.at(index), index);\n if (result === false) {\n break;\n }\n this.indexes[id] += 1;\n }\n delete this.indexes[id];\n if (result === false) {\n return false;\n }\n };\n _proto.walk = function walk(callback) {\n return this.each(function (node, i) {\n var result = callback(node, i);\n if (result !== false && node.length) {\n result = node.walk(callback);\n }\n if (result === false) {\n return false;\n }\n });\n };\n _proto.walkAttributes = function walkAttributes(callback) {\n var _this2 = this;\n return this.walk(function (selector) {\n if (selector.type === types.ATTRIBUTE) {\n return callback.call(_this2, selector);\n }\n });\n };\n _proto.walkClasses = function walkClasses(callback) {\n var _this3 = this;\n return this.walk(function (selector) {\n if (selector.type === types.CLASS) {\n return callback.call(_this3, selector);\n }\n });\n };\n _proto.walkCombinators = function walkCombinators(callback) {\n var _this4 = this;\n return this.walk(function (selector) {\n if (selector.type === types.COMBINATOR) {\n return callback.call(_this4, selector);\n }\n });\n };\n _proto.walkComments = function walkComments(callback) {\n var _this5 = this;\n return this.walk(function (selector) {\n if (selector.type === types.COMMENT) {\n return callback.call(_this5, selector);\n }\n });\n };\n _proto.walkIds = function walkIds(callback) {\n var _this6 = this;\n return this.walk(function (selector) {\n if (selector.type === types.ID) {\n return callback.call(_this6, selector);\n }\n });\n };\n _proto.walkNesting = function walkNesting(callback) {\n var _this7 = this;\n return this.walk(function (selector) {\n if (selector.type === types.NESTING) {\n return callback.call(_this7, selector);\n }\n });\n };\n _proto.walkPseudos = function walkPseudos(callback) {\n var _this8 = this;\n return this.walk(function (selector) {\n if (selector.type === types.PSEUDO) {\n return callback.call(_this8, selector);\n }\n });\n };\n _proto.walkTags = function walkTags(callback) {\n var _this9 = this;\n return this.walk(function (selector) {\n if (selector.type === types.TAG) {\n return callback.call(_this9, selector);\n }\n });\n };\n _proto.walkUniversals = function walkUniversals(callback) {\n var _this10 = this;\n return this.walk(function (selector) {\n if (selector.type === types.UNIVERSAL) {\n return callback.call(_this10, selector);\n }\n });\n };\n _proto.split = function split(callback) {\n var _this11 = this;\n var current = [];\n return this.reduce(function (memo, node, index) {\n var split = callback.call(_this11, node);\n current.push(node);\n if (split) {\n memo.push(current);\n current = [];\n } else if (index === _this11.length - 1) {\n memo.push(current);\n }\n return memo;\n }, []);\n };\n _proto.map = function map(callback) {\n return this.nodes.map(callback);\n };\n _proto.reduce = function reduce(callback, memo) {\n return this.nodes.reduce(callback, memo);\n };\n _proto.every = function every(callback) {\n return this.nodes.every(callback);\n };\n _proto.some = function some(callback) {\n return this.nodes.some(callback);\n };\n _proto.filter = function filter(callback) {\n return this.nodes.filter(callback);\n };\n _proto.sort = function sort(callback) {\n return this.nodes.sort(callback);\n };\n _proto.toString = function toString() {\n return this.map(String).join('');\n };\n _createClass(Container, [{\n key: \"first\",\n get: function get() {\n return this.at(0);\n }\n }, {\n key: \"last\",\n get: function get() {\n return this.at(this.length - 1);\n }\n }, {\n key: \"length\",\n get: function get() {\n return this.nodes.length;\n }\n }]);\n return Container;\n}(_node[\"default\"]);\nexports[\"default\"] = Container;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _container = _interopRequireDefault(require(\"./container\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Root = /*#__PURE__*/function (_Container) {\n _inheritsLoose(Root, _Container);\n function Root(opts) {\n var _this;\n _this = _Container.call(this, opts) || this;\n _this.type = _types.ROOT;\n return _this;\n }\n var _proto = Root.prototype;\n _proto.toString = function toString() {\n var str = this.reduce(function (memo, selector) {\n memo.push(String(selector));\n return memo;\n }, []).join(',');\n return this.trailingComma ? str + ',' : str;\n };\n _proto.error = function error(message, options) {\n if (this._error) {\n return this._error(message, options);\n } else {\n return new Error(message);\n }\n };\n _createClass(Root, [{\n key: \"errorGenerator\",\n set: function set(handler) {\n this._error = handler;\n }\n }]);\n return Root;\n}(_container[\"default\"]);\nexports[\"default\"] = Root;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _container = _interopRequireDefault(require(\"./container\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Selector = /*#__PURE__*/function (_Container) {\n _inheritsLoose(Selector, _Container);\n function Selector(opts) {\n var _this;\n _this = _Container.call(this, opts) || this;\n _this.type = _types.SELECTOR;\n return _this;\n }\n return Selector;\n}(_container[\"default\"]);\nexports[\"default\"] = Selector;\nmodule.exports = exports.default;", "/*! https://mths.be/cssesc v3.0.0 by @mathias */\n'use strict';\n\nvar object = {};\nvar hasOwnProperty = object.hasOwnProperty;\nvar merge = function merge(options, defaults) {\n\tif (!options) {\n\t\treturn defaults;\n\t}\n\tvar result = {};\n\tfor (var key in defaults) {\n\t\t// `if (defaults.hasOwnProperty(key) { \u2026 }` is not needed here, since\n\t\t// only recognized option names are used.\n\t\tresult[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];\n\t}\n\treturn result;\n};\n\nvar regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/;\nvar regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/;\nvar regexAlwaysEscape = /['\"\\\\]/;\nvar regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g;\n\n// https://mathiasbynens.be/notes/css-escapes#css\nvar cssesc = function cssesc(string, options) {\n\toptions = merge(options, cssesc.options);\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single';\n\t}\n\tvar quote = options.quotes == 'double' ? '\"' : '\\'';\n\tvar isIdentifier = options.isIdentifier;\n\n\tvar firstChar = string.charAt(0);\n\tvar output = '';\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar character = string.charAt(counter++);\n\t\tvar codePoint = character.charCodeAt();\n\t\tvar value = void 0;\n\t\t// If it\u2019s not a printable ASCII character\u2026\n\t\tif (codePoint < 0x20 || codePoint > 0x7E) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {\n\t\t\t\t// It\u2019s a high surrogate, and there is a next character.\n\t\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;\n\t\t\t\t} else {\n\t\t\t\t\t// It\u2019s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' ';\n\t\t\t} else if (character == '\\\\' || !isIdentifier && (character == '\"' && quote == character || character == '\\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {\n\t\t\t\tvalue = '\\\\' + character;\n\t\t\t} else {\n\t\t\t\tvalue = character;\n\t\t\t}\n\t\t}\n\t\toutput += value;\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1);\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1);\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they\u2019re redundant. Note that this is only possible if the escape\n\t// sequence isn\u2019t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It\u2019s not safe to remove the space, so don\u2019t.\n\t\t\treturn $0;\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2;\n\t});\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote;\n\t}\n\treturn output;\n};\n\n// Expose default options (so they can be overridden globally).\ncssesc.options = {\n\t'escapeEverything': false,\n\t'isIdentifier': false,\n\t'quotes': 'single',\n\t'wrap': false\n};\n\ncssesc.version = '3.0.0';\n\nmodule.exports = cssesc;\n", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _cssesc = _interopRequireDefault(require(\"cssesc\"));\nvar _util = require(\"../util\");\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar ClassName = /*#__PURE__*/function (_Node) {\n _inheritsLoose(ClassName, _Node);\n function ClassName(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.CLASS;\n _this._constructed = true;\n return _this;\n }\n var _proto = ClassName.prototype;\n _proto.valueToString = function valueToString() {\n return '.' + _Node.prototype.valueToString.call(this);\n };\n _createClass(ClassName, [{\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set: function set(v) {\n if (this._constructed) {\n var escaped = (0, _cssesc[\"default\"])(v, {\n isIdentifier: true\n });\n if (escaped !== v) {\n (0, _util.ensureObject)(this, \"raws\");\n this.raws.value = escaped;\n } else if (this.raws) {\n delete this.raws.value;\n }\n }\n this._value = v;\n }\n }]);\n return ClassName;\n}(_node[\"default\"]);\nexports[\"default\"] = ClassName;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Comment = /*#__PURE__*/function (_Node) {\n _inheritsLoose(Comment, _Node);\n function Comment(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.COMMENT;\n return _this;\n }\n return Comment;\n}(_node[\"default\"]);\nexports[\"default\"] = Comment;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar ID = /*#__PURE__*/function (_Node) {\n _inheritsLoose(ID, _Node);\n function ID(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.ID;\n return _this;\n }\n var _proto = ID.prototype;\n _proto.valueToString = function valueToString() {\n return '#' + _Node.prototype.valueToString.call(this);\n };\n return ID;\n}(_node[\"default\"]);\nexports[\"default\"] = ID;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _cssesc = _interopRequireDefault(require(\"cssesc\"));\nvar _util = require(\"../util\");\nvar _node = _interopRequireDefault(require(\"./node\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Namespace = /*#__PURE__*/function (_Node) {\n _inheritsLoose(Namespace, _Node);\n function Namespace() {\n return _Node.apply(this, arguments) || this;\n }\n var _proto = Namespace.prototype;\n _proto.qualifiedName = function qualifiedName(value) {\n if (this.namespace) {\n return this.namespaceString + \"|\" + value;\n } else {\n return value;\n }\n };\n _proto.valueToString = function valueToString() {\n return this.qualifiedName(_Node.prototype.valueToString.call(this));\n };\n _createClass(Namespace, [{\n key: \"namespace\",\n get: function get() {\n return this._namespace;\n },\n set: function set(namespace) {\n if (namespace === true || namespace === \"*\" || namespace === \"&\") {\n this._namespace = namespace;\n if (this.raws) {\n delete this.raws.namespace;\n }\n return;\n }\n var escaped = (0, _cssesc[\"default\"])(namespace, {\n isIdentifier: true\n });\n this._namespace = namespace;\n if (escaped !== namespace) {\n (0, _util.ensureObject)(this, \"raws\");\n this.raws.namespace = escaped;\n } else if (this.raws) {\n delete this.raws.namespace;\n }\n }\n }, {\n key: \"ns\",\n get: function get() {\n return this._namespace;\n },\n set: function set(namespace) {\n this.namespace = namespace;\n }\n }, {\n key: \"namespaceString\",\n get: function get() {\n if (this.namespace) {\n var ns = this.stringifyProperty(\"namespace\");\n if (ns === true) {\n return '';\n } else {\n return ns;\n }\n } else {\n return '';\n }\n }\n }]);\n return Namespace;\n}(_node[\"default\"]);\nexports[\"default\"] = Namespace;\n;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _namespace = _interopRequireDefault(require(\"./namespace\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Tag = /*#__PURE__*/function (_Namespace) {\n _inheritsLoose(Tag, _Namespace);\n function Tag(opts) {\n var _this;\n _this = _Namespace.call(this, opts) || this;\n _this.type = _types.TAG;\n return _this;\n }\n return Tag;\n}(_namespace[\"default\"]);\nexports[\"default\"] = Tag;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar String = /*#__PURE__*/function (_Node) {\n _inheritsLoose(String, _Node);\n function String(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.STRING;\n return _this;\n }\n return String;\n}(_node[\"default\"]);\nexports[\"default\"] = String;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _container = _interopRequireDefault(require(\"./container\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Pseudo = /*#__PURE__*/function (_Container) {\n _inheritsLoose(Pseudo, _Container);\n function Pseudo(opts) {\n var _this;\n _this = _Container.call(this, opts) || this;\n _this.type = _types.PSEUDO;\n return _this;\n }\n var _proto = Pseudo.prototype;\n _proto.toString = function toString() {\n var params = this.length ? '(' + this.map(String).join(',') + ')' : '';\n return [this.rawSpaceBefore, this.stringifyProperty(\"value\"), params, this.rawSpaceAfter].join('');\n };\n return Pseudo;\n}(_container[\"default\"]);\nexports[\"default\"] = Pseudo;\nmodule.exports = exports.default;", "\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nexports.unescapeValue = unescapeValue;\nvar _cssesc = _interopRequireDefault(require(\"cssesc\"));\nvar _unesc = _interopRequireDefault(require(\"../util/unesc\"));\nvar _namespace = _interopRequireDefault(require(\"./namespace\"));\nvar _types = require(\"./types\");\nvar _CSSESC_QUOTE_OPTIONS;\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar deprecate = require(\"util-deprecate\");\nvar WRAPPED_IN_QUOTES = /^('|\")([^]*)\\1$/;\nvar warnOfDeprecatedValueAssignment = deprecate(function () {}, \"Assigning an attribute a value containing characters that might need to be escaped is deprecated. \" + \"Call attribute.setValue() instead.\");\nvar warnOfDeprecatedQuotedAssignment = deprecate(function () {}, \"Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.\");\nvar warnOfDeprecatedConstructor = deprecate(function () {}, \"Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.\");\nfunction unescapeValue(value) {\n var deprecatedUsage = false;\n var quoteMark = null;\n var unescaped = value;\n var m = unescaped.match(WRAPPED_IN_QUOTES);\n if (m) {\n quoteMark = m[1];\n unescaped = m[2];\n }\n unescaped = (0, _unesc[\"default\"])(unescaped);\n if (unescaped !== value) {\n deprecatedUsage = true;\n }\n return {\n deprecatedUsage: deprecatedUsage,\n unescaped: unescaped,\n quoteMark: quoteMark\n };\n}\nfunction handleDeprecatedContructorOpts(opts) {\n if (opts.quoteMark !== undefined) {\n return opts;\n }\n if (opts.value === undefined) {\n return opts;\n }\n warnOfDeprecatedConstructor();\n var _unescapeValue = unescapeValue(opts.value),\n quoteMark = _unescapeValue.quoteMark,\n unescaped = _unescapeValue.unescaped;\n if (!opts.raws) {\n opts.raws = {};\n }\n if (opts.raws.value === undefined) {\n opts.raws.value = opts.value;\n }\n opts.value = unescaped;\n opts.quoteMark = quoteMark;\n return opts;\n}\nvar Attribute = /*#__PURE__*/function (_Namespace) {\n _inheritsLoose(Attribute, _Namespace);\n function Attribute(opts) {\n var _this;\n if (opts === void 0) {\n opts = {};\n }\n _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;\n _this.type = _types.ATTRIBUTE;\n _this.raws = _this.raws || {};\n Object.defineProperty(_this.raws, 'unquoted', {\n get: deprecate(function () {\n return _this.value;\n }, \"attr.raws.unquoted is deprecated. Call attr.value instead.\"),\n set: deprecate(function () {\n return _this.value;\n }, \"Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now.\")\n });\n _this._constructed = true;\n return _this;\n }\n\n /**\n * Returns the Attribute's value quoted such that it would be legal to use\n * in the value of a css file. The original value's quotation setting\n * used for stringification is left unchanged. See `setValue(value, options)`\n * if you want to control the quote settings of a new value for the attribute.\n *\n * You can also change the quotation used for the current value by setting quoteMark.\n *\n * Options:\n * * quoteMark {'\"' | \"'\" | null} - Use this value to quote the value. If this\n * option is not set, the original value for quoteMark will be used. If\n * indeterminate, a double quote is used. The legal values are:\n * * `null` - the value will be unquoted and characters will be escaped as necessary.\n * * `'` - the value will be quoted with a single quote and single quotes are escaped.\n * * `\"` - the value will be quoted with a double quote and double quotes are escaped.\n * * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark\n * over the quoteMark option value.\n * * smart {boolean} - if true, will select a quote mark based on the value\n * and the other options specified here. See the `smartQuoteMark()`\n * method.\n **/\n var _proto = Attribute.prototype;\n _proto.getQuotedValue = function getQuotedValue(options) {\n if (options === void 0) {\n options = {};\n }\n var quoteMark = this._determineQuoteMark(options);\n var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];\n var escaped = (0, _cssesc[\"default\"])(this._value, cssescopts);\n return escaped;\n };\n _proto._determineQuoteMark = function _determineQuoteMark(options) {\n return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);\n }\n\n /**\n * Set the unescaped value with the specified quotation options. The value\n * provided must not include any wrapping quote marks -- those quotes will\n * be interpreted as part of the value and escaped accordingly.\n */;\n _proto.setValue = function setValue(value, options) {\n if (options === void 0) {\n options = {};\n }\n this._value = value;\n this._quoteMark = this._determineQuoteMark(options);\n this._syncRawValue();\n }\n\n /**\n * Intelligently select a quoteMark value based on the value's contents. If\n * the value is a legal CSS ident, it will not be quoted. Otherwise a quote\n * mark will be picked that minimizes the number of escapes.\n *\n * If there's no clear winner, the quote mark from these options is used,\n * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is\n * true). If the quoteMark is unspecified, a double quote is used.\n *\n * @param options This takes the quoteMark and preferCurrentQuoteMark options\n * from the quoteValue method.\n */;\n _proto.smartQuoteMark = function smartQuoteMark(options) {\n var v = this.value;\n var numSingleQuotes = v.replace(/[^']/g, '').length;\n var numDoubleQuotes = v.replace(/[^\"]/g, '').length;\n if (numSingleQuotes + numDoubleQuotes === 0) {\n var escaped = (0, _cssesc[\"default\"])(v, {\n isIdentifier: true\n });\n if (escaped === v) {\n return Attribute.NO_QUOTE;\n } else {\n var pref = this.preferredQuoteMark(options);\n if (pref === Attribute.NO_QUOTE) {\n // pick a quote mark that isn't none and see if it's smaller\n var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;\n var opts = CSSESC_QUOTE_OPTIONS[quote];\n var quoteValue = (0, _cssesc[\"default\"])(v, opts);\n if (quoteValue.length < escaped.length) {\n return quote;\n }\n }\n return pref;\n }\n } else if (numDoubleQuotes === numSingleQuotes) {\n return this.preferredQuoteMark(options);\n } else if (numDoubleQuotes < numSingleQuotes) {\n return Attribute.DOUBLE_QUOTE;\n } else {\n return Attribute.SINGLE_QUOTE;\n }\n }\n\n /**\n * Selects the preferred quote mark based on the options and the current quote mark value.\n * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`\n * instead.\n */;\n _proto.preferredQuoteMark = function preferredQuoteMark(options) {\n var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;\n if (quoteMark === undefined) {\n quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;\n }\n if (quoteMark === undefined) {\n quoteMark = Attribute.DOUBLE_QUOTE;\n }\n return quoteMark;\n };\n _proto._syncRawValue = function _syncRawValue() {\n var rawValue = (0, _cssesc[\"default\"])(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);\n if (rawValue === this._value) {\n if (this.raws) {\n delete this.raws.value;\n }\n } else {\n this.raws.value = rawValue;\n }\n };\n _proto._handleEscapes = function _handleEscapes(prop, value) {\n if (this._constructed) {\n var escaped = (0, _cssesc[\"default\"])(value, {\n isIdentifier: true\n });\n if (escaped !== value) {\n this.raws[prop] = escaped;\n } else {\n delete this.raws[prop];\n }\n }\n };\n _proto._spacesFor = function _spacesFor(name) {\n var attrSpaces = {\n before: '',\n after: ''\n };\n var spaces = this.spaces[name] || {};\n var rawSpaces = this.raws.spaces && this.raws.spaces[name] || {};\n return Object.assign(attrSpaces, spaces, rawSpaces);\n };\n _proto._stringFor = function _stringFor(name, spaceName, concat) {\n if (spaceName === void 0) {\n spaceName = name;\n }\n if (concat === void 0) {\n concat = defaultAttrConcat;\n }\n var attrSpaces = this._spacesFor(spaceName);\n return concat(this.stringifyProperty(name), attrSpaces);\n }\n\n /**\n * returns the offset of the attribute part specified relative to the\n * start of the node of the output string.\n *\n * * \"ns\" - alias for \"namespace\"\n * * \"namespace\" - the namespace if it exists.\n * * \"attribute\" - the attribute name\n * * \"attributeNS\" - the start of the attribute or its namespace\n * * \"operator\" - the match operator of the attribute\n * * \"value\" - The value (string or identifier)\n * * \"insensitive\" - the case insensitivity flag;\n * @param part One of the possible values inside an attribute.\n * @returns -1 if the name is invalid or the value doesn't exist in this attribute.\n */;\n _proto.offsetOf = function offsetOf(name) {\n var count = 1;\n var attributeSpaces = this._spacesFor(\"attribute\");\n count += attributeSpaces.before.length;\n if (name === \"namespace\" || name === \"ns\") {\n return this.namespace ? count : -1;\n }\n if (name === \"attributeNS\") {\n return count;\n }\n count += this.namespaceString.length;\n if (this.namespace) {\n count += 1;\n }\n if (name === \"attribute\") {\n return count;\n }\n count += this.stringifyProperty(\"attribute\").length;\n count += attributeSpaces.after.length;\n var operatorSpaces = this._spacesFor(\"operator\");\n count += operatorSpaces.before.length;\n var operator = this.stringifyProperty(\"operator\");\n if (name === \"operator\") {\n return operator ? count : -1;\n }\n count += operator.length;\n count += operatorSpaces.after.length;\n var valueSpaces = this._spacesFor(\"value\");\n count += valueSpaces.before.length;\n var value = this.stringifyProperty(\"value\");\n if (name === \"value\") {\n return value ? count : -1;\n }\n count += value.length;\n count += valueSpaces.after.length;\n var insensitiveSpaces = this._spacesFor(\"insensitive\");\n count += insensitiveSpaces.before.length;\n if (name === \"insensitive\") {\n return this.insensitive ? count : -1;\n }\n return -1;\n };\n _proto.toString = function toString() {\n var _this2 = this;\n var selector = [this.rawSpaceBefore, '['];\n selector.push(this._stringFor('qualifiedAttribute', 'attribute'));\n if (this.operator && (this.value || this.value === '')) {\n selector.push(this._stringFor('operator'));\n selector.push(this._stringFor('value'));\n selector.push(this._stringFor('insensitiveFlag', 'insensitive', function (attrValue, attrSpaces) {\n if (attrValue.length > 0 && !_this2.quoted && attrSpaces.before.length === 0 && !(_this2.spaces.value && _this2.spaces.value.after)) {\n attrSpaces.before = \" \";\n }\n return defaultAttrConcat(attrValue, attrSpaces);\n }));\n }\n selector.push(']');\n selector.push(this.rawSpaceAfter);\n return selector.join('');\n };\n _createClass(Attribute, [{\n key: \"quoted\",\n get: function get() {\n var qm = this.quoteMark;\n return qm === \"'\" || qm === '\"';\n },\n set: function set(value) {\n warnOfDeprecatedQuotedAssignment();\n }\n\n /**\n * returns a single (`'`) or double (`\"`) quote character if the value is quoted.\n * returns `null` if the value is not quoted.\n * returns `undefined` if the quotation state is unknown (this can happen when\n * the attribute is constructed without specifying a quote mark.)\n */\n }, {\n key: \"quoteMark\",\n get: function get() {\n return this._quoteMark;\n }\n\n /**\n * Set the quote mark to be used by this attribute's value.\n * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute\n * value is updated accordingly.\n *\n * @param {\"'\" | '\"' | null} quoteMark The quote mark or `null` if the value should be unquoted.\n */,\n set: function set(quoteMark) {\n if (!this._constructed) {\n this._quoteMark = quoteMark;\n return;\n }\n if (this._quoteMark !== quoteMark) {\n this._quoteMark = quoteMark;\n this._syncRawValue();\n }\n }\n }, {\n key: \"qualifiedAttribute\",\n get: function get() {\n return this.qualifiedName(this.raws.attribute || this.attribute);\n }\n }, {\n key: \"insensitiveFlag\",\n get: function get() {\n return this.insensitive ? 'i' : '';\n }\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n },\n set:\n /**\n * Before 3.0, the value had to be set to an escaped value including any wrapped\n * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value\n * is unescaped during parsing and any quote marks are removed.\n *\n * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,\n * a deprecation warning is raised when the new value contains any characters that would\n * require escaping (including if it contains wrapped quotes).\n *\n * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe\n * how the new value is quoted.\n */\n function set(v) {\n if (this._constructed) {\n var _unescapeValue2 = unescapeValue(v),\n deprecatedUsage = _unescapeValue2.deprecatedUsage,\n unescaped = _unescapeValue2.unescaped,\n quoteMark = _unescapeValue2.quoteMark;\n if (deprecatedUsage) {\n warnOfDeprecatedValueAssignment();\n }\n if (unescaped === this._value && quoteMark === this._quoteMark) {\n return;\n }\n this._value = unescaped;\n this._quoteMark = quoteMark;\n this._syncRawValue();\n } else {\n this._value = v;\n }\n }\n }, {\n key: \"insensitive\",\n get: function get() {\n return this._insensitive;\n }\n\n /**\n * Set the case insensitive flag.\n * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`\n * of the attribute is updated accordingly.\n *\n * @param {true | false} insensitive true if the attribute should match case-insensitively.\n */,\n set: function set(insensitive) {\n if (!insensitive) {\n this._insensitive = false;\n\n // \"i\" and \"I\" can be used in \"this.raws.insensitiveFlag\" to store the original notation.\n // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.\n if (this.raws && (this.raws.insensitiveFlag === 'I' || this.raws.insensitiveFlag === 'i')) {\n this.raws.insensitiveFlag = undefined;\n }\n }\n this._insensitive = insensitive;\n }\n }, {\n key: \"attribute\",\n get: function get() {\n return this._attribute;\n },\n set: function set(name) {\n this._handleEscapes(\"attribute\", name);\n this._attribute = name;\n }\n }]);\n return Attribute;\n}(_namespace[\"default\"]);\nexports[\"default\"] = Attribute;\nAttribute.NO_QUOTE = null;\nAttribute.SINGLE_QUOTE = \"'\";\nAttribute.DOUBLE_QUOTE = '\"';\nvar CSSESC_QUOTE_OPTIONS = (_CSSESC_QUOTE_OPTIONS = {\n \"'\": {\n quotes: 'single',\n wrap: true\n },\n '\"': {\n quotes: 'double',\n wrap: true\n }\n}, _CSSESC_QUOTE_OPTIONS[null] = {\n isIdentifier: true\n}, _CSSESC_QUOTE_OPTIONS);\nfunction defaultAttrConcat(attrValue, attrSpaces) {\n return \"\" + attrSpaces.before + attrValue + attrSpaces.after;\n}", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _namespace = _interopRequireDefault(require(\"./namespace\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Universal = /*#__PURE__*/function (_Namespace) {\n _inheritsLoose(Universal, _Namespace);\n function Universal(opts) {\n var _this;\n _this = _Namespace.call(this, opts) || this;\n _this.type = _types.UNIVERSAL;\n _this.value = '*';\n return _this;\n }\n return Universal;\n}(_namespace[\"default\"]);\nexports[\"default\"] = Universal;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Combinator = /*#__PURE__*/function (_Node) {\n _inheritsLoose(Combinator, _Node);\n function Combinator(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.COMBINATOR;\n return _this;\n }\n return Combinator;\n}(_node[\"default\"]);\nexports[\"default\"] = Combinator;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _node = _interopRequireDefault(require(\"./node\"));\nvar _types = require(\"./types\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar Nesting = /*#__PURE__*/function (_Node) {\n _inheritsLoose(Nesting, _Node);\n function Nesting(opts) {\n var _this;\n _this = _Node.call(this, opts) || this;\n _this.type = _types.NESTING;\n _this.value = '&';\n return _this;\n }\n return Nesting;\n}(_node[\"default\"]);\nexports[\"default\"] = Nesting;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = sortAscending;\nfunction sortAscending(list) {\n return list.sort(function (a, b) {\n return a - b;\n });\n}\n;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports.word = exports.tilde = exports.tab = exports.str = exports.space = exports.slash = exports.singleQuote = exports.semicolon = exports.plus = exports.pipe = exports.openSquare = exports.openParenthesis = exports.newline = exports.greaterThan = exports.feed = exports.equals = exports.doubleQuote = exports.dollar = exports.cr = exports.comment = exports.comma = exports.combinator = exports.colon = exports.closeSquare = exports.closeParenthesis = exports.caret = exports.bang = exports.backslash = exports.at = exports.asterisk = exports.ampersand = void 0;\nvar ampersand = 38; // `&`.charCodeAt(0);\nexports.ampersand = ampersand;\nvar asterisk = 42; // `*`.charCodeAt(0);\nexports.asterisk = asterisk;\nvar at = 64; // `@`.charCodeAt(0);\nexports.at = at;\nvar comma = 44; // `,`.charCodeAt(0);\nexports.comma = comma;\nvar colon = 58; // `:`.charCodeAt(0);\nexports.colon = colon;\nvar semicolon = 59; // `;`.charCodeAt(0);\nexports.semicolon = semicolon;\nvar openParenthesis = 40; // `(`.charCodeAt(0);\nexports.openParenthesis = openParenthesis;\nvar closeParenthesis = 41; // `)`.charCodeAt(0);\nexports.closeParenthesis = closeParenthesis;\nvar openSquare = 91; // `[`.charCodeAt(0);\nexports.openSquare = openSquare;\nvar closeSquare = 93; // `]`.charCodeAt(0);\nexports.closeSquare = closeSquare;\nvar dollar = 36; // `$`.charCodeAt(0);\nexports.dollar = dollar;\nvar tilde = 126; // `~`.charCodeAt(0);\nexports.tilde = tilde;\nvar caret = 94; // `^`.charCodeAt(0);\nexports.caret = caret;\nvar plus = 43; // `+`.charCodeAt(0);\nexports.plus = plus;\nvar equals = 61; // `=`.charCodeAt(0);\nexports.equals = equals;\nvar pipe = 124; // `|`.charCodeAt(0);\nexports.pipe = pipe;\nvar greaterThan = 62; // `>`.charCodeAt(0);\nexports.greaterThan = greaterThan;\nvar space = 32; // ` `.charCodeAt(0);\nexports.space = space;\nvar singleQuote = 39; // `'`.charCodeAt(0);\nexports.singleQuote = singleQuote;\nvar doubleQuote = 34; // `\"`.charCodeAt(0);\nexports.doubleQuote = doubleQuote;\nvar slash = 47; // `/`.charCodeAt(0);\nexports.slash = slash;\nvar bang = 33; // `!`.charCodeAt(0);\nexports.bang = bang;\nvar backslash = 92; // '\\\\'.charCodeAt(0);\nexports.backslash = backslash;\nvar cr = 13; // '\\r'.charCodeAt(0);\nexports.cr = cr;\nvar feed = 12; // '\\f'.charCodeAt(0);\nexports.feed = feed;\nvar newline = 10; // '\\n'.charCodeAt(0);\nexports.newline = newline;\nvar tab = 9; // '\\t'.charCodeAt(0);\n\n// Expose aliases primarily for readability.\nexports.tab = tab;\nvar str = singleQuote;\n\n// No good single character representation!\nexports.str = str;\nvar comment = -1;\nexports.comment = comment;\nvar word = -2;\nexports.word = word;\nvar combinator = -3;\nexports.combinator = combinator;", "\"use strict\";\n\nexports.__esModule = true;\nexports.FIELDS = void 0;\nexports[\"default\"] = tokenize;\nvar t = _interopRequireWildcard(require(\"./tokenTypes\"));\nvar _unescapable, _wordDelimiters;\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nvar unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);\nvar wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);\nvar hex = {};\nvar hexChars = \"0123456789abcdefABCDEF\";\nfor (var i = 0; i < hexChars.length; i++) {\n hex[hexChars.charCodeAt(i)] = true;\n}\n\n/**\n * Returns the last index of the bar css word\n * @param {string} css The string in which the word begins\n * @param {number} start The index into the string where word's first letter occurs\n */\nfunction consumeWord(css, start) {\n var next = start;\n var code;\n do {\n code = css.charCodeAt(next);\n if (wordDelimiters[code]) {\n return next - 1;\n } else if (code === t.backslash) {\n next = consumeEscape(css, next) + 1;\n } else {\n // All other characters are part of the word\n next++;\n }\n } while (next < css.length);\n return next - 1;\n}\n\n/**\n * Returns the last index of the escape sequence\n * @param {string} css The string in which the sequence begins\n * @param {number} start The index into the string where escape character (`\\`) occurs.\n */\nfunction consumeEscape(css, start) {\n var next = start;\n var code = css.charCodeAt(next + 1);\n if (unescapable[code]) {\n // just consume the escape char\n } else if (hex[code]) {\n var hexDigits = 0;\n // consume up to 6 hex chars\n do {\n next++;\n hexDigits++;\n code = css.charCodeAt(next + 1);\n } while (hex[code] && hexDigits < 6);\n // if fewer than 6 hex chars, a trailing space ends the escape\n if (hexDigits < 6 && code === t.space) {\n next++;\n }\n } else {\n // the next char is part of the current word\n next++;\n }\n return next;\n}\nvar FIELDS = {\n TYPE: 0,\n START_LINE: 1,\n START_COL: 2,\n END_LINE: 3,\n END_COL: 4,\n START_POS: 5,\n END_POS: 6\n};\nexports.FIELDS = FIELDS;\nfunction tokenize(input) {\n var tokens = [];\n var css = input.css.valueOf();\n var _css = css,\n length = _css.length;\n var offset = -1;\n var line = 1;\n var start = 0;\n var end = 0;\n var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;\n function unclosed(what, fix) {\n if (input.safe) {\n // fyi: this is never set to true.\n css += fix;\n next = css.length - 1;\n } else {\n throw input.error('Unclosed ' + what, line, start - offset, start);\n }\n }\n while (start < length) {\n code = css.charCodeAt(start);\n if (code === t.newline) {\n offset = start;\n line += 1;\n }\n switch (code) {\n case t.space:\n case t.tab:\n case t.newline:\n case t.cr:\n case t.feed:\n next = start;\n do {\n next += 1;\n code = css.charCodeAt(next);\n if (code === t.newline) {\n offset = next;\n line += 1;\n }\n } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);\n tokenType = t.space;\n endLine = line;\n endColumn = next - offset - 1;\n end = next;\n break;\n case t.plus:\n case t.greaterThan:\n case t.tilde:\n case t.pipe:\n next = start;\n do {\n next += 1;\n code = css.charCodeAt(next);\n } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);\n tokenType = t.combinator;\n endLine = line;\n endColumn = start - offset;\n end = next;\n break;\n\n // Consume these characters as single tokens.\n case t.asterisk:\n case t.ampersand:\n case t.bang:\n case t.comma:\n case t.equals:\n case t.dollar:\n case t.caret:\n case t.openSquare:\n case t.closeSquare:\n case t.colon:\n case t.semicolon:\n case t.openParenthesis:\n case t.closeParenthesis:\n next = start;\n tokenType = code;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n break;\n case t.singleQuote:\n case t.doubleQuote:\n quote = code === t.singleQuote ? \"'\" : '\"';\n next = start;\n do {\n escaped = false;\n next = css.indexOf(quote, next + 1);\n if (next === -1) {\n unclosed('quote', quote);\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === t.backslash) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n tokenType = t.str;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n break;\n default:\n if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {\n next = css.indexOf('*/', start + 2) + 1;\n if (next === 0) {\n unclosed('comment', '*/');\n }\n content = css.slice(start, next + 1);\n lines = content.split('\\n');\n last = lines.length - 1;\n if (last > 0) {\n nextLine = line + last;\n nextOffset = next - lines[last].length;\n } else {\n nextLine = line;\n nextOffset = offset;\n }\n tokenType = t.comment;\n line = nextLine;\n endLine = nextLine;\n endColumn = next - nextOffset;\n } else if (code === t.slash) {\n next = start;\n tokenType = code;\n endLine = line;\n endColumn = start - offset;\n end = next + 1;\n } else {\n next = consumeWord(css, start);\n tokenType = t.word;\n endLine = line;\n endColumn = next - offset;\n }\n end = next + 1;\n break;\n }\n\n // Ensure that the token structure remains consistent\n tokens.push([tokenType,\n // [0] Token type\n line,\n // [1] Starting line\n start - offset,\n // [2] Starting column\n endLine,\n // [3] Ending line\n endColumn,\n // [4] Ending column\n start,\n // [5] Start position / Source index\n end // [6] End position\n ]);\n\n // Reset offset for the next token\n if (nextOffset) {\n offset = nextOffset;\n nextOffset = null;\n }\n start = end;\n }\n return tokens;\n}", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _root = _interopRequireDefault(require(\"./selectors/root\"));\nvar _selector = _interopRequireDefault(require(\"./selectors/selector\"));\nvar _className = _interopRequireDefault(require(\"./selectors/className\"));\nvar _comment = _interopRequireDefault(require(\"./selectors/comment\"));\nvar _id = _interopRequireDefault(require(\"./selectors/id\"));\nvar _tag = _interopRequireDefault(require(\"./selectors/tag\"));\nvar _string = _interopRequireDefault(require(\"./selectors/string\"));\nvar _pseudo = _interopRequireDefault(require(\"./selectors/pseudo\"));\nvar _attribute = _interopRequireWildcard(require(\"./selectors/attribute\"));\nvar _universal = _interopRequireDefault(require(\"./selectors/universal\"));\nvar _combinator = _interopRequireDefault(require(\"./selectors/combinator\"));\nvar _nesting = _interopRequireDefault(require(\"./selectors/nesting\"));\nvar _sortAscending = _interopRequireDefault(require(\"./sortAscending\"));\nvar _tokenize = _interopRequireWildcard(require(\"./tokenize\"));\nvar tokens = _interopRequireWildcard(require(\"./tokenTypes\"));\nvar types = _interopRequireWildcard(require(\"./selectors/types\"));\nvar _util = require(\"./util\");\nvar _WHITESPACE_TOKENS, _Object$assign;\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nvar WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);\nvar WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));\nfunction tokenStart(token) {\n return {\n line: token[_tokenize.FIELDS.START_LINE],\n column: token[_tokenize.FIELDS.START_COL]\n };\n}\nfunction tokenEnd(token) {\n return {\n line: token[_tokenize.FIELDS.END_LINE],\n column: token[_tokenize.FIELDS.END_COL]\n };\n}\nfunction getSource(startLine, startColumn, endLine, endColumn) {\n return {\n start: {\n line: startLine,\n column: startColumn\n },\n end: {\n line: endLine,\n column: endColumn\n }\n };\n}\nfunction getTokenSource(token) {\n return getSource(token[_tokenize.FIELDS.START_LINE], token[_tokenize.FIELDS.START_COL], token[_tokenize.FIELDS.END_LINE], token[_tokenize.FIELDS.END_COL]);\n}\nfunction getTokenSourceSpan(startToken, endToken) {\n if (!startToken) {\n return undefined;\n }\n return getSource(startToken[_tokenize.FIELDS.START_LINE], startToken[_tokenize.FIELDS.START_COL], endToken[_tokenize.FIELDS.END_LINE], endToken[_tokenize.FIELDS.END_COL]);\n}\nfunction unescapeProp(node, prop) {\n var value = node[prop];\n if (typeof value !== \"string\") {\n return;\n }\n if (value.indexOf(\"\\\\\") !== -1) {\n (0, _util.ensureObject)(node, 'raws');\n node[prop] = (0, _util.unesc)(value);\n if (node.raws[prop] === undefined) {\n node.raws[prop] = value;\n }\n }\n return node;\n}\nfunction indexesOf(array, item) {\n var i = -1;\n var indexes = [];\n while ((i = array.indexOf(item, i + 1)) !== -1) {\n indexes.push(i);\n }\n return indexes;\n}\nfunction uniqs() {\n var list = Array.prototype.concat.apply([], arguments);\n return list.filter(function (item, i) {\n return i === list.indexOf(item);\n });\n}\nvar Parser = /*#__PURE__*/function () {\n function Parser(rule, options) {\n if (options === void 0) {\n options = {};\n }\n this.rule = rule;\n this.options = Object.assign({\n lossy: false,\n safe: false\n }, options);\n this.position = 0;\n this.css = typeof this.rule === 'string' ? this.rule : this.rule.selector;\n this.tokens = (0, _tokenize[\"default\"])({\n css: this.css,\n error: this._errorGenerator(),\n safe: this.options.safe\n });\n var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);\n this.root = new _root[\"default\"]({\n source: rootSource\n });\n this.root.errorGenerator = this._errorGenerator();\n var selector = new _selector[\"default\"]({\n source: {\n start: {\n line: 1,\n column: 1\n }\n }\n });\n this.root.append(selector);\n this.current = selector;\n this.loop();\n }\n var _proto = Parser.prototype;\n _proto._errorGenerator = function _errorGenerator() {\n var _this = this;\n return function (message, errorOptions) {\n if (typeof _this.rule === 'string') {\n return new Error(message);\n }\n return _this.rule.error(message, errorOptions);\n };\n };\n _proto.attribute = function attribute() {\n var attr = [];\n var startingToken = this.currToken;\n this.position++;\n while (this.position < this.tokens.length && this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {\n attr.push(this.currToken);\n this.position++;\n }\n if (this.currToken[_tokenize.FIELDS.TYPE] !== tokens.closeSquare) {\n return this.expected('closing square bracket', this.currToken[_tokenize.FIELDS.START_POS]);\n }\n var len = attr.length;\n var node = {\n source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),\n sourceIndex: startingToken[_tokenize.FIELDS.START_POS]\n };\n if (len === 1 && !~[tokens.word].indexOf(attr[0][_tokenize.FIELDS.TYPE])) {\n return this.expected('attribute', attr[0][_tokenize.FIELDS.START_POS]);\n }\n var pos = 0;\n var spaceBefore = '';\n var commentBefore = '';\n var lastAdded = null;\n var spaceAfterMeaningfulToken = false;\n while (pos < len) {\n var token = attr[pos];\n var content = this.content(token);\n var next = attr[pos + 1];\n switch (token[_tokenize.FIELDS.TYPE]) {\n case tokens.space:\n // if (\n // len === 1 ||\n // pos === 0 && this.content(next) === '|'\n // ) {\n // return this.expected('attribute', token[TOKEN.START_POS], content);\n // }\n spaceAfterMeaningfulToken = true;\n if (this.options.lossy) {\n break;\n }\n if (lastAdded) {\n (0, _util.ensureObject)(node, 'spaces', lastAdded);\n var prevContent = node.spaces[lastAdded].after || '';\n node.spaces[lastAdded].after = prevContent + content;\n var existingComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || null;\n if (existingComment) {\n node.raws.spaces[lastAdded].after = existingComment + content;\n }\n } else {\n spaceBefore = spaceBefore + content;\n commentBefore = commentBefore + content;\n }\n break;\n case tokens.asterisk:\n if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = 'operator';\n } else if ((!node.namespace || lastAdded === \"namespace\" && !spaceAfterMeaningfulToken) && next) {\n if (spaceBefore) {\n (0, _util.ensureObject)(node, 'spaces', 'attribute');\n node.spaces.attribute.before = spaceBefore;\n spaceBefore = '';\n }\n if (commentBefore) {\n (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');\n node.raws.spaces.attribute.before = spaceBefore;\n commentBefore = '';\n }\n node.namespace = (node.namespace || \"\") + content;\n var rawValue = (0, _util.getProp)(node, 'raws', 'namespace') || null;\n if (rawValue) {\n node.raws.namespace += content;\n }\n lastAdded = 'namespace';\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.dollar:\n if (lastAdded === \"value\") {\n var oldRawValue = (0, _util.getProp)(node, 'raws', 'value');\n node.value += \"$\";\n if (oldRawValue) {\n node.raws.value = oldRawValue + \"$\";\n }\n break;\n }\n // Falls through\n case tokens.caret:\n if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = 'operator';\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.combinator:\n if (content === '~' && next[_tokenize.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = 'operator';\n }\n if (content !== '|') {\n spaceAfterMeaningfulToken = false;\n break;\n }\n if (next[_tokenize.FIELDS.TYPE] === tokens.equals) {\n node.operator = content;\n lastAdded = 'operator';\n } else if (!node.namespace && !node.attribute) {\n node.namespace = true;\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.word:\n if (next && this.content(next) === '|' && attr[pos + 2] && attr[pos + 2][_tokenize.FIELDS.TYPE] !== tokens.equals &&\n // this look-ahead probably fails with comment nodes involved.\n !node.operator && !node.namespace) {\n node.namespace = content;\n lastAdded = 'namespace';\n } else if (!node.attribute || lastAdded === \"attribute\" && !spaceAfterMeaningfulToken) {\n if (spaceBefore) {\n (0, _util.ensureObject)(node, 'spaces', 'attribute');\n node.spaces.attribute.before = spaceBefore;\n spaceBefore = '';\n }\n if (commentBefore) {\n (0, _util.ensureObject)(node, 'raws', 'spaces', 'attribute');\n node.raws.spaces.attribute.before = commentBefore;\n commentBefore = '';\n }\n node.attribute = (node.attribute || \"\") + content;\n var _rawValue = (0, _util.getProp)(node, 'raws', 'attribute') || null;\n if (_rawValue) {\n node.raws.attribute += content;\n }\n lastAdded = 'attribute';\n } else if (!node.value && node.value !== \"\" || lastAdded === \"value\" && !(spaceAfterMeaningfulToken || node.quoteMark)) {\n var _unescaped = (0, _util.unesc)(content);\n var _oldRawValue = (0, _util.getProp)(node, 'raws', 'value') || '';\n var oldValue = node.value || '';\n node.value = oldValue + _unescaped;\n node.quoteMark = null;\n if (_unescaped !== content || _oldRawValue) {\n (0, _util.ensureObject)(node, 'raws');\n node.raws.value = (_oldRawValue || oldValue) + content;\n }\n lastAdded = 'value';\n } else {\n var insensitive = content === 'i' || content === \"I\";\n if ((node.value || node.value === '') && (node.quoteMark || spaceAfterMeaningfulToken)) {\n node.insensitive = insensitive;\n if (!insensitive || content === \"I\") {\n (0, _util.ensureObject)(node, 'raws');\n node.raws.insensitiveFlag = content;\n }\n lastAdded = 'insensitive';\n if (spaceBefore) {\n (0, _util.ensureObject)(node, 'spaces', 'insensitive');\n node.spaces.insensitive.before = spaceBefore;\n spaceBefore = '';\n }\n if (commentBefore) {\n (0, _util.ensureObject)(node, 'raws', 'spaces', 'insensitive');\n node.raws.spaces.insensitive.before = commentBefore;\n commentBefore = '';\n }\n } else if (node.value || node.value === '') {\n lastAdded = 'value';\n node.value += content;\n if (node.raws.value) {\n node.raws.value += content;\n }\n }\n }\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.str:\n if (!node.attribute || !node.operator) {\n return this.error(\"Expected an attribute followed by an operator preceding the string.\", {\n index: token[_tokenize.FIELDS.START_POS]\n });\n }\n var _unescapeValue = (0, _attribute.unescapeValue)(content),\n unescaped = _unescapeValue.unescaped,\n quoteMark = _unescapeValue.quoteMark;\n node.value = unescaped;\n node.quoteMark = quoteMark;\n lastAdded = 'value';\n (0, _util.ensureObject)(node, 'raws');\n node.raws.value = content;\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.equals:\n if (!node.attribute) {\n return this.expected('attribute', token[_tokenize.FIELDS.START_POS], content);\n }\n if (node.value) {\n return this.error('Unexpected \"=\" found; an operator was already defined.', {\n index: token[_tokenize.FIELDS.START_POS]\n });\n }\n node.operator = node.operator ? node.operator + content : content;\n lastAdded = 'operator';\n spaceAfterMeaningfulToken = false;\n break;\n case tokens.comment:\n if (lastAdded) {\n if (spaceAfterMeaningfulToken || next && next[_tokenize.FIELDS.TYPE] === tokens.space || lastAdded === 'insensitive') {\n var lastComment = (0, _util.getProp)(node, 'spaces', lastAdded, 'after') || '';\n var rawLastComment = (0, _util.getProp)(node, 'raws', 'spaces', lastAdded, 'after') || lastComment;\n (0, _util.ensureObject)(node, 'raws', 'spaces', lastAdded);\n node.raws.spaces[lastAdded].after = rawLastComment + content;\n } else {\n var lastValue = node[lastAdded] || '';\n var rawLastValue = (0, _util.getProp)(node, 'raws', lastAdded) || lastValue;\n (0, _util.ensureObject)(node, 'raws');\n node.raws[lastAdded] = rawLastValue + content;\n }\n } else {\n commentBefore = commentBefore + content;\n }\n break;\n default:\n return this.error(\"Unexpected \\\"\" + content + \"\\\" found.\", {\n index: token[_tokenize.FIELDS.START_POS]\n });\n }\n pos++;\n }\n unescapeProp(node, \"attribute\");\n unescapeProp(node, \"namespace\");\n this.newNode(new _attribute[\"default\"](node));\n this.position++;\n }\n\n /**\n * return a node containing meaningless garbage up to (but not including) the specified token position.\n * if the token position is negative, all remaining tokens are consumed.\n *\n * This returns an array containing a single string node if all whitespace,\n * otherwise an array of comment nodes with space before and after.\n *\n * These tokens are not added to the current selector, the caller can add them or use them to amend\n * a previous node's space metadata.\n *\n * In lossy mode, this returns only comments.\n */;\n _proto.parseWhitespaceEquivalentTokens = function parseWhitespaceEquivalentTokens(stopPosition) {\n if (stopPosition < 0) {\n stopPosition = this.tokens.length;\n }\n var startPosition = this.position;\n var nodes = [];\n var space = \"\";\n var lastComment = undefined;\n do {\n if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {\n if (!this.options.lossy) {\n space += this.content();\n }\n } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.comment) {\n var spaces = {};\n if (space) {\n spaces.before = space;\n space = \"\";\n }\n lastComment = new _comment[\"default\"]({\n value: this.content(),\n source: getTokenSource(this.currToken),\n sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],\n spaces: spaces\n });\n nodes.push(lastComment);\n }\n } while (++this.position < stopPosition);\n if (space) {\n if (lastComment) {\n lastComment.spaces.after = space;\n } else if (!this.options.lossy) {\n var firstToken = this.tokens[startPosition];\n var lastToken = this.tokens[this.position - 1];\n nodes.push(new _string[\"default\"]({\n value: '',\n source: getSource(firstToken[_tokenize.FIELDS.START_LINE], firstToken[_tokenize.FIELDS.START_COL], lastToken[_tokenize.FIELDS.END_LINE], lastToken[_tokenize.FIELDS.END_COL]),\n sourceIndex: firstToken[_tokenize.FIELDS.START_POS],\n spaces: {\n before: space,\n after: ''\n }\n }));\n }\n }\n return nodes;\n }\n\n /**\n *\n * @param {*} nodes\n */;\n _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {\n var _this2 = this;\n if (requiredSpace === void 0) {\n requiredSpace = false;\n }\n var space = \"\";\n var rawSpace = \"\";\n nodes.forEach(function (n) {\n var spaceBefore = _this2.lossySpace(n.spaces.before, requiredSpace);\n var rawSpaceBefore = _this2.lossySpace(n.rawSpaceBefore, requiredSpace);\n space += spaceBefore + _this2.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);\n rawSpace += spaceBefore + n.value + _this2.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);\n });\n if (rawSpace === space) {\n rawSpace = undefined;\n }\n var result = {\n space: space,\n rawSpace: rawSpace\n };\n return result;\n };\n _proto.isNamedCombinator = function isNamedCombinator(position) {\n if (position === void 0) {\n position = this.position;\n }\n return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;\n };\n _proto.namedCombinator = function namedCombinator() {\n if (this.isNamedCombinator()) {\n var nameRaw = this.content(this.tokens[this.position + 1]);\n var name = (0, _util.unesc)(nameRaw).toLowerCase();\n var raws = {};\n if (name !== nameRaw) {\n raws.value = \"/\" + nameRaw + \"/\";\n }\n var node = new _combinator[\"default\"]({\n value: \"/\" + name + \"/\",\n source: getSource(this.currToken[_tokenize.FIELDS.START_LINE], this.currToken[_tokenize.FIELDS.START_COL], this.tokens[this.position + 2][_tokenize.FIELDS.END_LINE], this.tokens[this.position + 2][_tokenize.FIELDS.END_COL]),\n sourceIndex: this.currToken[_tokenize.FIELDS.START_POS],\n raws: raws\n });\n this.position = this.position + 3;\n return node;\n } else {\n this.unexpected();\n }\n };\n _proto.combinator = function combinator() {\n var _this3 = this;\n if (this.content() === '|') {\n return this.namespace();\n }\n // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.\n var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);\n if (nextSigTokenPos < 0 || this.tokens[nextSigTokenPos][_tokenize.FIELDS.TYPE] === tokens.comma) {\n var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);\n if (nodes.length > 0) {\n var last = this.current.last;\n if (last) {\n var _this$convertWhitespa = this.convertWhitespaceNodesToSpace(nodes),\n space = _this$convertWhitespa.space,\n rawSpace = _this$convertWhitespa.rawSpace;\n if (rawSpace !== undefined) {\n last.rawSpaceAfter += rawSpace;\n }\n last.spaces.after += space;\n } else {\n nodes.forEach(function (n) {\n return _this3.newNode(n);\n });\n }\n }\n return;\n }\n var firstToken = this.currToken;\n var spaceOrDescendantSelectorNodes = undefined;\n if (nextSigTokenPos > this.position) {\n spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);\n }\n var node;\n if (this.isNamedCombinator()) {\n node = this.namedCombinator();\n } else if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.combinator) {\n node = new _combinator[\"default\"]({\n value: this.content(),\n source: getTokenSource(this.currToken),\n sourceIndex: this.currToken[_tokenize.FIELDS.START_POS]\n });\n this.position++;\n } else if (WHITESPACE_TOKENS[this.currToken[_tokenize.FIELDS.TYPE]]) {\n // pass\n } else if (!spaceOrDescendantSelectorNodes) {\n this.unexpected();\n }\n if (node) {\n if (spaceOrDescendantSelectorNodes) {\n var _this$convertWhitespa2 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes),\n _space = _this$convertWhitespa2.space,\n _rawSpace = _this$convertWhitespa2.rawSpace;\n node.spaces.before = _space;\n node.rawSpaceBefore = _rawSpace;\n }\n } else {\n // descendant combinator\n var _this$convertWhitespa3 = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true),\n _space2 = _this$convertWhitespa3.space,\n _rawSpace2 = _this$convertWhitespa3.rawSpace;\n if (!_rawSpace2) {\n _rawSpace2 = _space2;\n }\n var spaces = {};\n var raws = {\n spaces: {}\n };\n if (_space2.endsWith(' ') && _rawSpace2.endsWith(' ')) {\n spaces.before = _space2.slice(0, _space2.length - 1);\n raws.spaces.before = _rawSpace2.slice(0, _rawSpace2.length - 1);\n } else if (_space2.startsWith(' ') && _rawSpace2.startsWith(' ')) {\n spaces.after = _space2.slice(1);\n raws.spaces.after = _rawSpace2.slice(1);\n } else {\n raws.value = _rawSpace2;\n }\n node = new _combinator[\"default\"]({\n value: ' ',\n source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),\n sourceIndex: firstToken[_tokenize.FIELDS.START_POS],\n spaces: spaces,\n raws: raws\n });\n }\n if (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.space) {\n node.spaces.after = this.optionalSpace(this.content());\n this.position++;\n }\n return this.newNode(node);\n };\n _proto.comma = function comma() {\n if (this.position === this.tokens.length - 1) {\n this.root.trailingComma = true;\n this.position++;\n return;\n }\n this.current._inferEndPosition();\n var selector = new _selector[\"default\"]({\n source: {\n start: tokenStart(this.tokens[this.position + 1])\n }\n });\n this.current.parent.append(selector);\n this.current = selector;\n this.position++;\n };\n _proto.comment = function comment() {\n var current = this.currToken;\n this.newNode(new _comment[\"default\"]({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[_tokenize.FIELDS.START_POS]\n }));\n this.position++;\n };\n _proto.error = function error(message, opts) {\n throw this.root.error(message, opts);\n };\n _proto.missingBackslash = function missingBackslash() {\n return this.error('Expected a backslash preceding the semicolon.', {\n index: this.currToken[_tokenize.FIELDS.START_POS]\n });\n };\n _proto.missingParenthesis = function missingParenthesis() {\n return this.expected('opening parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);\n };\n _proto.missingSquareBracket = function missingSquareBracket() {\n return this.expected('opening square bracket', this.currToken[_tokenize.FIELDS.START_POS]);\n };\n _proto.unexpected = function unexpected() {\n return this.error(\"Unexpected '\" + this.content() + \"'. Escaping special characters with \\\\ may help.\", this.currToken[_tokenize.FIELDS.START_POS]);\n };\n _proto.unexpectedPipe = function unexpectedPipe() {\n return this.error(\"Unexpected '|'.\", this.currToken[_tokenize.FIELDS.START_POS]);\n };\n _proto.namespace = function namespace() {\n var before = this.prevToken && this.content(this.prevToken) || true;\n if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.word) {\n this.position++;\n return this.word(before);\n } else if (this.nextToken[_tokenize.FIELDS.TYPE] === tokens.asterisk) {\n this.position++;\n return this.universal(before);\n }\n this.unexpectedPipe();\n };\n _proto.nesting = function nesting() {\n if (this.nextToken) {\n var nextContent = this.content(this.nextToken);\n if (nextContent === \"|\") {\n this.position++;\n return;\n }\n }\n var current = this.currToken;\n this.newNode(new _nesting[\"default\"]({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[_tokenize.FIELDS.START_POS]\n }));\n this.position++;\n };\n _proto.parentheses = function parentheses() {\n var last = this.current.last;\n var unbalanced = 1;\n this.position++;\n if (last && last.type === types.PSEUDO) {\n var selector = new _selector[\"default\"]({\n source: {\n start: tokenStart(this.tokens[this.position - 1])\n }\n });\n var cache = this.current;\n last.append(selector);\n this.current = selector;\n while (this.position < this.tokens.length && unbalanced) {\n if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {\n unbalanced++;\n }\n if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {\n unbalanced--;\n }\n if (unbalanced) {\n this.parse();\n } else {\n this.current.source.end = tokenEnd(this.currToken);\n this.current.parent.source.end = tokenEnd(this.currToken);\n this.position++;\n }\n }\n this.current = cache;\n } else {\n // I think this case should be an error. It's used to implement a basic parse of media queries\n // but I don't think it's a good idea.\n var parenStart = this.currToken;\n var parenValue = \"(\";\n var parenEnd;\n while (this.position < this.tokens.length && unbalanced) {\n if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {\n unbalanced++;\n }\n if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {\n unbalanced--;\n }\n parenEnd = this.currToken;\n parenValue += this.parseParenthesisToken(this.currToken);\n this.position++;\n }\n if (last) {\n last.appendToPropertyAndEscape(\"value\", parenValue, parenValue);\n } else {\n this.newNode(new _string[\"default\"]({\n value: parenValue,\n source: getSource(parenStart[_tokenize.FIELDS.START_LINE], parenStart[_tokenize.FIELDS.START_COL], parenEnd[_tokenize.FIELDS.END_LINE], parenEnd[_tokenize.FIELDS.END_COL]),\n sourceIndex: parenStart[_tokenize.FIELDS.START_POS]\n }));\n }\n }\n if (unbalanced) {\n return this.expected('closing parenthesis', this.currToken[_tokenize.FIELDS.START_POS]);\n }\n };\n _proto.pseudo = function pseudo() {\n var _this4 = this;\n var pseudoStr = '';\n var startingToken = this.currToken;\n while (this.currToken && this.currToken[_tokenize.FIELDS.TYPE] === tokens.colon) {\n pseudoStr += this.content();\n this.position++;\n }\n if (!this.currToken) {\n return this.expected(['pseudo-class', 'pseudo-element'], this.position - 1);\n }\n if (this.currToken[_tokenize.FIELDS.TYPE] === tokens.word) {\n this.splitWord(false, function (first, length) {\n pseudoStr += first;\n _this4.newNode(new _pseudo[\"default\"]({\n value: pseudoStr,\n source: getTokenSourceSpan(startingToken, _this4.currToken),\n sourceIndex: startingToken[_tokenize.FIELDS.START_POS]\n }));\n if (length > 1 && _this4.nextToken && _this4.nextToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis) {\n _this4.error('Misplaced parenthesis.', {\n index: _this4.nextToken[_tokenize.FIELDS.START_POS]\n });\n }\n });\n } else {\n return this.expected(['pseudo-class', 'pseudo-element'], this.currToken[_tokenize.FIELDS.START_POS]);\n }\n };\n _proto.space = function space() {\n var content = this.content();\n // Handle space before and after the selector\n if (this.position === 0 || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.prevToken[_tokenize.FIELDS.TYPE] === tokens.openParenthesis || this.current.nodes.every(function (node) {\n return node.type === 'comment';\n })) {\n this.spaces = this.optionalSpace(content);\n this.position++;\n } else if (this.position === this.tokens.length - 1 || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.comma || this.nextToken[_tokenize.FIELDS.TYPE] === tokens.closeParenthesis) {\n this.current.last.spaces.after = this.optionalSpace(content);\n this.position++;\n } else {\n this.combinator();\n }\n };\n _proto.string = function string() {\n var current = this.currToken;\n this.newNode(new _string[\"default\"]({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[_tokenize.FIELDS.START_POS]\n }));\n this.position++;\n };\n _proto.universal = function universal(namespace) {\n var nextToken = this.nextToken;\n if (nextToken && this.content(nextToken) === '|') {\n this.position++;\n return this.namespace();\n }\n var current = this.currToken;\n this.newNode(new _universal[\"default\"]({\n value: this.content(),\n source: getTokenSource(current),\n sourceIndex: current[_tokenize.FIELDS.START_POS]\n }), namespace);\n this.position++;\n };\n _proto.splitWord = function splitWord(namespace, firstCallback) {\n var _this5 = this;\n var nextToken = this.nextToken;\n var word = this.content();\n while (nextToken && ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[_tokenize.FIELDS.TYPE])) {\n this.position++;\n var current = this.content();\n word += current;\n if (current.lastIndexOf('\\\\') === current.length - 1) {\n var next = this.nextToken;\n if (next && next[_tokenize.FIELDS.TYPE] === tokens.space) {\n word += this.requiredSpace(this.content(next));\n this.position++;\n }\n }\n nextToken = this.nextToken;\n }\n var hasClass = indexesOf(word, '.').filter(function (i) {\n // Allow escaped dot within class name\n var escapedDot = word[i - 1] === '\\\\';\n // Allow decimal numbers percent in @keyframes\n var isKeyframesPercent = /^\\d+\\.\\d+%$/.test(word);\n return !escapedDot && !isKeyframesPercent;\n });\n var hasId = indexesOf(word, '#').filter(function (i) {\n return word[i - 1] !== '\\\\';\n });\n // Eliminate Sass interpolations from the list of id indexes\n var interpolations = indexesOf(word, '#{');\n if (interpolations.length) {\n hasId = hasId.filter(function (hashIndex) {\n return !~interpolations.indexOf(hashIndex);\n });\n }\n var indices = (0, _sortAscending[\"default\"])(uniqs([0].concat(hasClass, hasId)));\n indices.forEach(function (ind, i) {\n var index = indices[i + 1] || word.length;\n var value = word.slice(ind, index);\n if (i === 0 && firstCallback) {\n return firstCallback.call(_this5, value, indices.length);\n }\n var node;\n var current = _this5.currToken;\n var sourceIndex = current[_tokenize.FIELDS.START_POS] + indices[i];\n var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));\n if (~hasClass.indexOf(ind)) {\n var classNameOpts = {\n value: value.slice(1),\n source: source,\n sourceIndex: sourceIndex\n };\n node = new _className[\"default\"](unescapeProp(classNameOpts, \"value\"));\n } else if (~hasId.indexOf(ind)) {\n var idOpts = {\n value: value.slice(1),\n source: source,\n sourceIndex: sourceIndex\n };\n node = new _id[\"default\"](unescapeProp(idOpts, \"value\"));\n } else {\n var tagOpts = {\n value: value,\n source: source,\n sourceIndex: sourceIndex\n };\n unescapeProp(tagOpts, \"value\");\n node = new _tag[\"default\"](tagOpts);\n }\n _this5.newNode(node, namespace);\n // Ensure that the namespace is used only once\n namespace = null;\n });\n this.position++;\n };\n _proto.word = function word(namespace) {\n var nextToken = this.nextToken;\n if (nextToken && this.content(nextToken) === '|') {\n this.position++;\n return this.namespace();\n }\n return this.splitWord(namespace);\n };\n _proto.loop = function loop() {\n while (this.position < this.tokens.length) {\n this.parse(true);\n }\n this.current._inferEndPosition();\n return this.root;\n };\n _proto.parse = function parse(throwOnParenthesis) {\n switch (this.currToken[_tokenize.FIELDS.TYPE]) {\n case tokens.space:\n this.space();\n break;\n case tokens.comment:\n this.comment();\n break;\n case tokens.openParenthesis:\n this.parentheses();\n break;\n case tokens.closeParenthesis:\n if (throwOnParenthesis) {\n this.missingParenthesis();\n }\n break;\n case tokens.openSquare:\n this.attribute();\n break;\n case tokens.dollar:\n case tokens.caret:\n case tokens.equals:\n case tokens.word:\n this.word();\n break;\n case tokens.colon:\n this.pseudo();\n break;\n case tokens.comma:\n this.comma();\n break;\n case tokens.asterisk:\n this.universal();\n break;\n case tokens.ampersand:\n this.nesting();\n break;\n case tokens.slash:\n case tokens.combinator:\n this.combinator();\n break;\n case tokens.str:\n this.string();\n break;\n // These cases throw; no break needed.\n case tokens.closeSquare:\n this.missingSquareBracket();\n case tokens.semicolon:\n this.missingBackslash();\n default:\n this.unexpected();\n }\n }\n\n /**\n * Helpers\n */;\n _proto.expected = function expected(description, index, found) {\n if (Array.isArray(description)) {\n var last = description.pop();\n description = description.join(', ') + \" or \" + last;\n }\n var an = /^[aeiou]/.test(description[0]) ? 'an' : 'a';\n if (!found) {\n return this.error(\"Expected \" + an + \" \" + description + \".\", {\n index: index\n });\n }\n return this.error(\"Expected \" + an + \" \" + description + \", found \\\"\" + found + \"\\\" instead.\", {\n index: index\n });\n };\n _proto.requiredSpace = function requiredSpace(space) {\n return this.options.lossy ? ' ' : space;\n };\n _proto.optionalSpace = function optionalSpace(space) {\n return this.options.lossy ? '' : space;\n };\n _proto.lossySpace = function lossySpace(space, required) {\n if (this.options.lossy) {\n return required ? ' ' : '';\n } else {\n return space;\n }\n };\n _proto.parseParenthesisToken = function parseParenthesisToken(token) {\n var content = this.content(token);\n if (token[_tokenize.FIELDS.TYPE] === tokens.space) {\n return this.requiredSpace(content);\n } else {\n return content;\n }\n };\n _proto.newNode = function newNode(node, namespace) {\n if (namespace) {\n if (/^ +$/.test(namespace)) {\n if (!this.options.lossy) {\n this.spaces = (this.spaces || '') + namespace;\n }\n namespace = true;\n }\n node.namespace = namespace;\n unescapeProp(node, \"namespace\");\n }\n if (this.spaces) {\n node.spaces.before = this.spaces;\n this.spaces = '';\n }\n return this.current.append(node);\n };\n _proto.content = function content(token) {\n if (token === void 0) {\n token = this.currToken;\n }\n return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);\n };\n /**\n * returns the index of the next non-whitespace, non-comment token.\n * returns -1 if no meaningful token is found.\n */\n _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) {\n if (startPosition === void 0) {\n startPosition = this.position + 1;\n }\n var searchPosition = startPosition;\n while (searchPosition < this.tokens.length) {\n if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][_tokenize.FIELDS.TYPE]]) {\n searchPosition++;\n continue;\n } else {\n return searchPosition;\n }\n }\n return -1;\n };\n _createClass(Parser, [{\n key: \"currToken\",\n get: function get() {\n return this.tokens[this.position];\n }\n }, {\n key: \"nextToken\",\n get: function get() {\n return this.tokens[this.position + 1];\n }\n }, {\n key: \"prevToken\",\n get: function get() {\n return this.tokens[this.position - 1];\n }\n }]);\n return Parser;\n}();\nexports[\"default\"] = Parser;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _parser = _interopRequireDefault(require(\"./parser\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar Processor = /*#__PURE__*/function () {\n function Processor(func, options) {\n this.func = func || function noop() {};\n this.funcRes = null;\n this.options = options;\n }\n var _proto = Processor.prototype;\n _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {\n if (options === void 0) {\n options = {};\n }\n var merged = Object.assign({}, this.options, options);\n if (merged.updateSelector === false) {\n return false;\n } else {\n return typeof rule !== \"string\";\n }\n };\n _proto._isLossy = function _isLossy(options) {\n if (options === void 0) {\n options = {};\n }\n var merged = Object.assign({}, this.options, options);\n if (merged.lossless === false) {\n return true;\n } else {\n return false;\n }\n };\n _proto._root = function _root(rule, options) {\n if (options === void 0) {\n options = {};\n }\n var parser = new _parser[\"default\"](rule, this._parseOptions(options));\n return parser.root;\n };\n _proto._parseOptions = function _parseOptions(options) {\n return {\n lossy: this._isLossy(options)\n };\n };\n _proto._run = function _run(rule, options) {\n var _this = this;\n if (options === void 0) {\n options = {};\n }\n return new Promise(function (resolve, reject) {\n try {\n var root = _this._root(rule, options);\n Promise.resolve(_this.func(root)).then(function (transform) {\n var string = undefined;\n if (_this._shouldUpdateSelector(rule, options)) {\n string = root.toString();\n rule.selector = string;\n }\n return {\n transform: transform,\n root: root,\n string: string\n };\n }).then(resolve, reject);\n } catch (e) {\n reject(e);\n return;\n }\n });\n };\n _proto._runSync = function _runSync(rule, options) {\n if (options === void 0) {\n options = {};\n }\n var root = this._root(rule, options);\n var transform = this.func(root);\n if (transform && typeof transform.then === \"function\") {\n throw new Error(\"Selector processor returned a promise to a synchronous call.\");\n }\n var string = undefined;\n if (options.updateSelector && typeof rule !== \"string\") {\n string = root.toString();\n rule.selector = string;\n }\n return {\n transform: transform,\n root: root,\n string: string\n };\n }\n\n /**\n * Process rule into a selector AST.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {Promise} The AST of the selector after processing it.\n */;\n _proto.ast = function ast(rule, options) {\n return this._run(rule, options).then(function (result) {\n return result.root;\n });\n }\n\n /**\n * Process rule into a selector AST synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {parser.Root} The AST of the selector after processing it.\n */;\n _proto.astSync = function astSync(rule, options) {\n return this._runSync(rule, options).root;\n }\n\n /**\n * Process a selector into a transformed value asynchronously\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {Promise} The value returned by the processor.\n */;\n _proto.transform = function transform(rule, options) {\n return this._run(rule, options).then(function (result) {\n return result.transform;\n });\n }\n\n /**\n * Process a selector into a transformed value synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {any} The value returned by the processor.\n */;\n _proto.transformSync = function transformSync(rule, options) {\n return this._runSync(rule, options).transform;\n }\n\n /**\n * Process a selector into a new selector string asynchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {string} the selector after processing.\n */;\n _proto.process = function process(rule, options) {\n return this._run(rule, options).then(function (result) {\n return result.string || result.root.toString();\n });\n }\n\n /**\n * Process a selector into a new selector string synchronously.\n *\n * @param rule {postcss.Rule | string} The css selector to be processed\n * @param options The options for processing\n * @returns {string} the selector after processing.\n */;\n _proto.processSync = function processSync(rule, options) {\n var result = this._runSync(rule, options);\n return result.string || result.root.toString();\n };\n return Processor;\n}();\nexports[\"default\"] = Processor;\nmodule.exports = exports.default;", "\"use strict\";\n\nexports.__esModule = true;\nexports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;\nvar _attribute = _interopRequireDefault(require(\"./attribute\"));\nvar _className = _interopRequireDefault(require(\"./className\"));\nvar _combinator = _interopRequireDefault(require(\"./combinator\"));\nvar _comment = _interopRequireDefault(require(\"./comment\"));\nvar _id = _interopRequireDefault(require(\"./id\"));\nvar _nesting = _interopRequireDefault(require(\"./nesting\"));\nvar _pseudo = _interopRequireDefault(require(\"./pseudo\"));\nvar _root = _interopRequireDefault(require(\"./root\"));\nvar _selector = _interopRequireDefault(require(\"./selector\"));\nvar _string = _interopRequireDefault(require(\"./string\"));\nvar _tag = _interopRequireDefault(require(\"./tag\"));\nvar _universal = _interopRequireDefault(require(\"./universal\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar attribute = function attribute(opts) {\n return new _attribute[\"default\"](opts);\n};\nexports.attribute = attribute;\nvar className = function className(opts) {\n return new _className[\"default\"](opts);\n};\nexports.className = className;\nvar combinator = function combinator(opts) {\n return new _combinator[\"default\"](opts);\n};\nexports.combinator = combinator;\nvar comment = function comment(opts) {\n return new _comment[\"default\"](opts);\n};\nexports.comment = comment;\nvar id = function id(opts) {\n return new _id[\"default\"](opts);\n};\nexports.id = id;\nvar nesting = function nesting(opts) {\n return new _nesting[\"default\"](opts);\n};\nexports.nesting = nesting;\nvar pseudo = function pseudo(opts) {\n return new _pseudo[\"default\"](opts);\n};\nexports.pseudo = pseudo;\nvar root = function root(opts) {\n return new _root[\"default\"](opts);\n};\nexports.root = root;\nvar selector = function selector(opts) {\n return new _selector[\"default\"](opts);\n};\nexports.selector = selector;\nvar string = function string(opts) {\n return new _string[\"default\"](opts);\n};\nexports.string = string;\nvar tag = function tag(opts) {\n return new _tag[\"default\"](opts);\n};\nexports.tag = tag;\nvar universal = function universal(opts) {\n return new _universal[\"default\"](opts);\n};\nexports.universal = universal;", "\"use strict\";\n\nexports.__esModule = true;\nexports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0;\nexports.isContainer = isContainer;\nexports.isIdentifier = void 0;\nexports.isNamespace = isNamespace;\nexports.isNesting = void 0;\nexports.isNode = isNode;\nexports.isPseudo = void 0;\nexports.isPseudoClass = isPseudoClass;\nexports.isPseudoElement = isPseudoElement;\nexports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = void 0;\nvar _types = require(\"./types\");\nvar _IS_TYPE;\nvar IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);\nfunction isNode(node) {\n return typeof node === \"object\" && IS_TYPE[node.type];\n}\nfunction isNodeType(type, node) {\n return isNode(node) && node.type === type;\n}\nvar isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);\nexports.isAttribute = isAttribute;\nvar isClassName = isNodeType.bind(null, _types.CLASS);\nexports.isClassName = isClassName;\nvar isCombinator = isNodeType.bind(null, _types.COMBINATOR);\nexports.isCombinator = isCombinator;\nvar isComment = isNodeType.bind(null, _types.COMMENT);\nexports.isComment = isComment;\nvar isIdentifier = isNodeType.bind(null, _types.ID);\nexports.isIdentifier = isIdentifier;\nvar isNesting = isNodeType.bind(null, _types.NESTING);\nexports.isNesting = isNesting;\nvar isPseudo = isNodeType.bind(null, _types.PSEUDO);\nexports.isPseudo = isPseudo;\nvar isRoot = isNodeType.bind(null, _types.ROOT);\nexports.isRoot = isRoot;\nvar isSelector = isNodeType.bind(null, _types.SELECTOR);\nexports.isSelector = isSelector;\nvar isString = isNodeType.bind(null, _types.STRING);\nexports.isString = isString;\nvar isTag = isNodeType.bind(null, _types.TAG);\nexports.isTag = isTag;\nvar isUniversal = isNodeType.bind(null, _types.UNIVERSAL);\nexports.isUniversal = isUniversal;\nfunction isPseudoElement(node) {\n return isPseudo(node) && node.value && (node.value.startsWith(\"::\") || node.value.toLowerCase() === \":before\" || node.value.toLowerCase() === \":after\" || node.value.toLowerCase() === \":first-letter\" || node.value.toLowerCase() === \":first-line\");\n}\nfunction isPseudoClass(node) {\n return isPseudo(node) && !isPseudoElement(node);\n}\nfunction isContainer(node) {\n return !!(isNode(node) && node.walk);\n}\nfunction isNamespace(node) {\n return isAttribute(node) || isTag(node);\n}", "\"use strict\";\n\nexports.__esModule = true;\nvar _types = require(\"./types\");\nObject.keys(_types).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _types[key]) return;\n exports[key] = _types[key];\n});\nvar _constructors = require(\"./constructors\");\nObject.keys(_constructors).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _constructors[key]) return;\n exports[key] = _constructors[key];\n});\nvar _guards = require(\"./guards\");\nObject.keys(_guards).forEach(function (key) {\n if (key === \"default\" || key === \"__esModule\") return;\n if (key in exports && exports[key] === _guards[key]) return;\n exports[key] = _guards[key];\n});", "\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\nvar _processor = _interopRequireDefault(require(\"./processor\"));\nvar selectors = _interopRequireWildcard(require(\"./selectors\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nvar parser = function parser(processor) {\n return new _processor[\"default\"](processor);\n};\nObject.assign(parser, selectors);\ndelete parser.__esModule;\nvar _default = parser;\nexports[\"default\"] = _default;\nmodule.exports = exports.default;", "let parser = require('postcss-selector-parser')\n\nfunction parse (str, rule) {\n let nodes\n let saver = parser(parsed => {\n nodes = parsed\n })\n try {\n saver.processSync(str)\n } catch (e) {\n if (str.includes(':')) {\n throw rule ? rule.error('Missed semicolon') : e\n } else {\n throw rule ? rule.error(e.message) : e\n }\n }\n return nodes.at(0)\n}\n\nfunction replace (nodes, parent) {\n let replaced = false\n nodes.each(i => {\n if (i.type === 'nesting') {\n let clonedParent = parent.clone()\n if (i.value !== '&') {\n i.replaceWith(parse(i.value.replace('&', clonedParent.toString())))\n } else {\n i.replaceWith(clonedParent)\n }\n replaced = true\n } else if (i.nodes) {\n if (replace(i, parent)) {\n replaced = true\n }\n }\n })\n return replaced\n}\n\nfunction selectors (parent, child) {\n let result = []\n parent.selectors.forEach(i => {\n let parentNode = parse(i, parent)\n\n child.selectors.forEach(j => {\n if (j.length) {\n let node = parse(j, child)\n let replaced = replace(node, parentNode)\n if (!replaced) {\n node.prepend(parser.combinator({ value: ' ' }))\n node.prepend(parentNode.clone())\n }\n result.push(node.toString())\n }\n })\n })\n return result\n}\n\nfunction pickComment (comment, after) {\n if (comment && comment.type === 'comment') {\n after.after(comment)\n return comment\n } else {\n return after\n }\n}\n\nfunction createFnAtruleChilds (bubble) {\n return function atruleChilds (rule, atrule, bubbling) {\n let children = []\n atrule.each(child => {\n if (child.type === 'comment') {\n children.push(child)\n } else if (child.type === 'decl') {\n children.push(child)\n } else if (child.type === 'rule' && bubbling) {\n child.selectors = selectors(rule, child)\n } else if (child.type === 'atrule') {\n if (child.nodes && bubble[child.name]) {\n atruleChilds(rule, child, true)\n } else {\n children.push(child)\n }\n }\n })\n if (bubbling) {\n if (children.length) {\n let clone = rule.clone({ nodes: [] })\n for (let child of children) {\n clone.append(child)\n }\n atrule.prepend(clone)\n }\n }\n }\n}\n\nfunction pickDeclarations (selector, declarations, after, Rule) {\n let parent = new Rule({\n selector,\n nodes: []\n })\n\n for (let declaration of declarations) {\n parent.append(declaration)\n }\n\n after.after(parent)\n return parent\n}\n\nfunction atruleNames (defaults, custom) {\n let list = {}\n for (let i of defaults) {\n list[i] = true\n }\n if (custom) {\n for (let i of custom) {\n let name = i.replace(/^@/, '')\n list[name] = true\n }\n }\n return list\n}\n\nmodule.exports = (opts = {}) => {\n let bubble = atruleNames(['media', 'supports'], opts.bubble)\n let atruleChilds = createFnAtruleChilds(bubble)\n let unwrap = atruleNames(\n [\n 'document',\n 'font-face',\n 'keyframes',\n '-webkit-keyframes',\n '-moz-keyframes'\n ],\n opts.unwrap\n )\n let preserveEmpty = opts.preserveEmpty\n\n return {\n postcssPlugin: 'postcss-nested',\n Rule (rule, { Rule }) {\n let unwrapped = false\n let after = rule\n let copyDeclarations = false\n let declarations = []\n\n rule.each(child => {\n if (child.type === 'rule') {\n if (declarations.length) {\n after = pickDeclarations(rule.selector, declarations, after, Rule)\n declarations = []\n }\n\n copyDeclarations = true\n unwrapped = true\n child.selectors = selectors(rule, child)\n after = pickComment(child.prev(), after)\n after.after(child)\n after = child\n } else if (child.type === 'atrule') {\n if (declarations.length) {\n after = pickDeclarations(rule.selector, declarations, after, Rule)\n declarations = []\n }\n\n if (child.name === 'at-root') {\n unwrapped = true\n atruleChilds(rule, child, false)\n\n let nodes = child.nodes\n if (child.params) {\n nodes = new Rule({ selector: child.params, nodes })\n }\n\n after.after(nodes)\n after = nodes\n child.remove()\n } else if (bubble[child.name]) {\n copyDeclarations = true\n unwrapped = true\n atruleChilds(rule, child, true)\n after = pickComment(child.prev(), after)\n after.after(child)\n after = child\n } else if (unwrap[child.name]) {\n copyDeclarations = true\n unwrapped = true\n atruleChilds(rule, child, false)\n after = pickComment(child.prev(), after)\n after.after(child)\n after = child\n } else if (copyDeclarations) {\n declarations.push(child)\n }\n } else if (child.type === 'decl' && copyDeclarations) {\n declarations.push(child)\n }\n })\n\n if (declarations.length) {\n after = pickDeclarations(rule.selector, declarations, after, Rule)\n }\n\n if (unwrapped && preserveEmpty !== true) {\n rule.raws.semicolon = true\n if (rule.nodes.length === 0) rule.remove()\n }\n }\n }\n}\nmodule.exports.postcss = true\n", "\"use strict\";\n\nvar pattern = /-(\\w|$)/g;\n\nvar callback = function callback(dashChar, char) {\n\treturn char.toUpperCase();\n};\n\nvar camelCaseCSS = function camelCaseCSS(property) {\n\tproperty = property.toLowerCase();\n\n\t// NOTE :: IE8's \"styleFloat\" is intentionally not supported\n\tif (property === \"float\") {\n\t\treturn \"cssFloat\";\n\t}\n\t// Microsoft vendor-prefixes are uniquely cased\n\telse if (property.charCodeAt(0) === 45&& property.charCodeAt(1) === 109&& property.charCodeAt(2) === 115&& property.charCodeAt(3) === 45) {\n\t\t\treturn property.substr(1).replace(pattern, callback);\n\t\t} else {\n\t\t\treturn property.replace(pattern, callback);\n\t\t}\n};\n\nmodule.exports = camelCaseCSS;\n", "let camelcase = require('camelcase-css')\n\nlet UNITLESS = {\n boxFlex: true,\n boxFlexGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n fillOpacity: true,\n strokeDashoffset: true,\n strokeOpacity: true,\n strokeWidth: true\n}\n\nfunction atRule(node) {\n if (typeof node.nodes === 'undefined') {\n return true\n } else {\n return process(node)\n }\n}\n\nfunction process(node) {\n let name\n let result = {}\n\n node.each(child => {\n if (child.type === 'atrule') {\n name = '@' + child.name\n if (child.params) name += ' ' + child.params\n if (typeof result[name] === 'undefined') {\n result[name] = atRule(child)\n } else if (Array.isArray(result[name])) {\n result[name].push(atRule(child))\n } else {\n result[name] = [result[name], atRule(child)]\n }\n } else if (child.type === 'rule') {\n let body = process(child)\n if (result[child.selector]) {\n for (let i in body) {\n result[child.selector][i] = body[i]\n }\n } else {\n result[child.selector] = body\n }\n } else if (child.type === 'decl') {\n if (child.prop[0] === '-' && child.prop[1] === '-') {\n name = child.prop\n } else if (child.parent && child.parent.selector === ':export') {\n name = child.prop\n } else {\n name = camelcase(child.prop)\n }\n let value = child.value\n if (!isNaN(child.value) && UNITLESS[name]) {\n value = parseFloat(child.value)\n }\n if (child.important) value += ' !important'\n if (typeof result[name] === 'undefined') {\n result[name] = value\n } else if (Array.isArray(result[name])) {\n result[name].push(value)\n } else {\n result[name] = [result[name], value]\n }\n }\n })\n return result\n}\n\nmodule.exports = process\n", "let postcss = require('postcss')\n\nlet IMPORTANT = /\\s*!important\\s*$/i\n\nlet UNITLESS = {\n 'box-flex': true,\n 'box-flex-group': true,\n 'column-count': true,\n 'flex': true,\n 'flex-grow': true,\n 'flex-positive': true,\n 'flex-shrink': true,\n 'flex-negative': true,\n 'font-weight': true,\n 'line-clamp': true,\n 'line-height': true,\n 'opacity': true,\n 'order': true,\n 'orphans': true,\n 'tab-size': true,\n 'widows': true,\n 'z-index': true,\n 'zoom': true,\n 'fill-opacity': true,\n 'stroke-dashoffset': true,\n 'stroke-opacity': true,\n 'stroke-width': true\n}\n\nfunction dashify(str) {\n return str\n .replace(/([A-Z])/g, '-$1')\n .replace(/^ms-/, '-ms-')\n .toLowerCase()\n}\n\nfunction decl(parent, name, value) {\n if (value === false || value === null) return\n\n if (!name.startsWith('--')) {\n name = dashify(name)\n }\n\n if (typeof value === 'number') {\n if (value === 0 || UNITLESS[name]) {\n value = value.toString()\n } else {\n value += 'px'\n }\n }\n\n if (name === 'css-float') name = 'float'\n\n if (IMPORTANT.test(value)) {\n value = value.replace(IMPORTANT, '')\n parent.push(postcss.decl({ prop: name, value, important: true }))\n } else {\n parent.push(postcss.decl({ prop: name, value }))\n }\n}\n\nfunction atRule(parent, parts, value) {\n let node = postcss.atRule({ name: parts[1], params: parts[3] || '' })\n if (typeof value === 'object') {\n node.nodes = []\n parse(value, node)\n }\n parent.push(node)\n}\n\nfunction parse(obj, parent) {\n let name, value, node\n for (name in obj) {\n value = obj[name]\n if (value === null || typeof value === 'undefined') {\n continue\n } else if (name[0] === '@') {\n let parts = name.match(/@(\\S+)(\\s+([\\W\\w]*)\\s*)?/)\n if (Array.isArray(value)) {\n for (let i of value) {\n atRule(parent, parts, i)\n }\n } else {\n atRule(parent, parts, value)\n }\n } else if (Array.isArray(value)) {\n for (let i of value) {\n decl(parent, name, i)\n }\n } else if (typeof value === 'object') {\n node = postcss.rule({ selector: name })\n parse(value, node)\n parent.push(node)\n } else {\n decl(parent, name, value)\n }\n }\n}\n\nmodule.exports = function (obj) {\n let root = postcss.root()\n parse(obj, root)\n return root\n}\n", "let objectify = require('./objectifier')\n\nmodule.exports = function processResult(result) {\n if (console && console.warn) {\n result.warnings().forEach(warn => {\n let source = warn.plugin || 'PostCSS'\n console.warn(source + ': ' + warn.text)\n })\n }\n return objectify(result.root)\n}\n", "let postcss = require('postcss')\n\nlet processResult = require('./process-result')\nlet parse = require('./parser')\n\nmodule.exports = function async(plugins) {\n let processor = postcss(plugins)\n return async input => {\n let result = await processor.process(input, {\n parser: parse,\n from: undefined\n })\n return processResult(result)\n }\n}\n", "let postcss = require('postcss')\n\nlet processResult = require('./process-result')\nlet parse = require('./parser')\n\nmodule.exports = function (plugins) {\n let processor = postcss(plugins)\n return input => {\n let result = processor.process(input, { parser: parse, from: undefined })\n return processResult(result)\n }\n}\n", "let objectify = require('./objectifier')\nlet parse = require('./parser')\nlet async = require('./async')\nlet sync = require('./sync')\n\nmodule.exports = {\n objectify,\n parse,\n async,\n sync\n}\n", "export default function dlv(obj, key, def, p, undef) {\n\tkey = key.split ? key.split('.') : key;\n\tfor (p = 0; p < key.length; p++) {\n\t\tobj = obj ? obj[key[p]] : undef;\n\t}\n\treturn obj === undef ? def : obj;\n}\n", "/*\n\ndidYouMean.js - A simple JavaScript matching engine\n===================================================\n\n[Available on GitHub](https://github.com/dcporter/didyoumean.js).\n\nA super-simple, highly optimized JS library for matching human-quality input to a list of potential\nmatches. You can use it to suggest a misspelled command-line utility option to a user, or to offer\nlinks to nearby valid URLs on your 404 page. (The examples below are taken from a personal project,\nmy [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct\nURLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).)\nUses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance).\n\ndidYouMean.js works in the browser as well as in node.js. To install it for use in node:\n\n```\nnpm install didyoumean\n```\n\n\nExamples\n--------\n\nMatching against a list of strings:\n```\nvar input = 'insargrm'\nvar list = ['facebook', 'twitter', 'instagram', 'linkedin'];\nconsole.log(didYouMean(input, list));\n> 'instagram'\n// The method matches 'insargrm' to 'instagram'.\n\ninput = 'google plus';\nconsole.log(didYouMean(input, list));\n> null\n// The method was unable to find 'google plus' in the list of options.\n```\n\nMatching against a list of objects:\n```\nvar input = 'insargrm';\nvar list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ];\nvar key = 'id';\nconsole.log(didYouMean(input, list, key));\n> 'instagram'\n// The method returns the matching value.\n\ndidYouMean.returnWinningObject = true;\nconsole.log(didYouMean(input, list, key));\n> { id: 'instagram' }\n// The method returns the matching object.\n```\n\n\ndidYouMean(str, list, [key])\n----------------------------\n\n- str: The string input to match.\n- list: An array of strings or objects to match against.\n- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string\n to match against.\n\nReturns: the closest matching string, or null if no strings exceed the threshold.\n\n\nOptions\n-------\n\nOptions are set on the didYouMean function object. You may change them at any time.\n\n### threshold\n\n By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length.\n For example, if a ten-letter string is five edits away from its nearest match, the method will return null.\n\n You can control this by setting the \"threshold\" value on the didYouMean function. For example, to set the\n edit distance threshold to 50% of the input string's length:\n\n ```\n didYouMean.threshold = 0.5;\n ```\n\n To return the nearest match no matter the threshold, set this value to null.\n\n### thresholdAbsolute\n\n This option behaves the same as threshold, but instead takes an integer number of edit steps. For example,\n if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance\n is less than 20. Both options apply.\n\n### caseSensitive\n\n By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set\n the \"caseSensitive\" value to true:\n\n ```\n didYouMean.caseSensitive = true;\n ```\n\n### nullResultValue\n\n By default, the method will return null if there is no sufficiently close match. You can change this value here.\n\n### returnWinningObject\n\n By default, the method will return the winning string value (if any). If your list contains objects rather\n than strings, you may set returnWinningObject to true.\n \n ```\n didYouMean.returnWinningObject = true;\n ```\n \n This option has no effect on lists of strings.\n\n### returnFirstMatch\n \n By default, the method will search all values and return the closest match. If you're simply looking for a \"good-\n enough\" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed\n things up.\n\n\nLicense\n-------\n\ndidYouMean copyright (c) 2013-2014 Dave Porter.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License\n[here](http://www.apache.org/licenses/LICENSE-2.0).\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n*/\n(function() {\n \"use strict\";\n\n // The didYouMean method.\n function didYouMean(str, list, key) {\n if (!str) return null;\n\n // If we're running a case-insensitive search, smallify str.\n if (!didYouMean.caseSensitive) { str = str.toLowerCase(); }\n\n // Calculate the initial value (the threshold) if present.\n var thresholdRelative = didYouMean.threshold === null ? null : didYouMean.threshold * str.length,\n thresholdAbsolute = didYouMean.thresholdAbsolute,\n winningVal;\n if (thresholdRelative !== null && thresholdAbsolute !== null) winningVal = Math.min(thresholdRelative, thresholdAbsolute);\n else if (thresholdRelative !== null) winningVal = thresholdRelative;\n else if (thresholdAbsolute !== null) winningVal = thresholdAbsolute;\n else winningVal = null;\n\n // Get the edit distance to each option. If the closest one is less than 40% (by default) of str's length,\n // then return it.\n var winner, candidate, testCandidate, val,\n i, len = list.length;\n for (i = 0; i < len; i++) {\n // Get item.\n candidate = list[i];\n // If there's a key, get the candidate value out of the object.\n if (key) { candidate = candidate[key]; }\n // Gatekeep.\n if (!candidate) { continue; }\n // If we're running a case-insensitive search, smallify the candidate.\n if (!didYouMean.caseSensitive) { testCandidate = candidate.toLowerCase(); }\n else { testCandidate = candidate; }\n // Get and compare edit distance.\n val = getEditDistance(str, testCandidate, winningVal);\n // If this value is smaller than our current winning value, OR if we have no winning val yet (i.e. the\n // threshold option is set to null, meaning the caller wants a match back no matter how bad it is), then\n // this is our new winner.\n if (winningVal === null || val < winningVal) {\n winningVal = val;\n // Set the winner to either the value or its object, depending on the returnWinningObject option.\n if (key && didYouMean.returnWinningObject) winner = list[i];\n else winner = candidate;\n // If we're returning the first match, return it now.\n if (didYouMean.returnFirstMatch) return winner;\n }\n }\n\n // If we have a winner, return it.\n return winner || didYouMean.nullResultValue;\n }\n\n // Set default options.\n didYouMean.threshold = 0.4;\n didYouMean.thresholdAbsolute = 20;\n didYouMean.caseSensitive = false;\n didYouMean.nullResultValue = null;\n didYouMean.returnWinningObject = null;\n didYouMean.returnFirstMatch = false;\n\n // Expose.\n // In node...\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = didYouMean;\n }\n // Otherwise...\n else {\n window.didYouMean = didYouMean;\n }\n\n var MAX_INT = Math.pow(2,32) - 1; // We could probably go higher than this, but for practical reasons let's not.\n function getEditDistance(a, b, max) {\n // Handle null or undefined max.\n max = max || max === 0 ? max : MAX_INT;\n\n var lena = a.length;\n var lenb = b.length;\n\n // Fast path - no A or B.\n if (lena === 0) return Math.min(max + 1, lenb);\n if (lenb === 0) return Math.min(max + 1, lena);\n\n // Fast path - length diff larger than max.\n if (Math.abs(lena - lenb) > max) return max + 1;\n\n // Slow path.\n var matrix = [],\n i, j, colMin, minJ, maxJ;\n\n // Set up the first row ([0, 1, 2, 3, etc]).\n for (i = 0; i <= lenb; i++) { matrix[i] = [i]; }\n\n // Set up the first column (same).\n for (j = 0; j <= lena; j++) { matrix[0][j] = j; }\n\n // Loop over the rest of the columns.\n for (i = 1; i <= lenb; i++) {\n colMin = MAX_INT;\n minJ = 1;\n if (i > max) minJ = i - max;\n maxJ = lenb + 1;\n if (maxJ > max + i) maxJ = max + i;\n // Loop over the rest of the rows.\n for (j = 1; j <= lena; j++) {\n // If j is out of bounds, just put a large value in the slot.\n if (j < minJ || j > maxJ) {\n matrix[i][j] = max + 1;\n }\n\n // Otherwise do the normal Levenshtein thing.\n else {\n // If the characters are the same, there's no change in edit distance.\n if (b.charAt(i - 1) === a.charAt(j - 1)) {\n matrix[i][j] = matrix[i - 1][j - 1];\n }\n // Otherwise, see if we're substituting, inserting or deleting.\n else {\n matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitute\n Math.min(matrix[i][j - 1] + 1, // Insert\n matrix[i - 1][j] + 1)); // Delete\n }\n }\n\n // Either way, update colMin.\n if (matrix[i][j] < colMin) colMin = matrix[i][j];\n }\n\n // If this column's minimum is greater than the allowed maximum, there's no point\n // in going on with life.\n if (colMin > max) return max + 1;\n }\n // If we made it this far without running into the max, then return the final matrix value.\n return matrix[lenb][lena];\n }\n\n})();\n", "import topbar from \"../vendor/topbar\"\nimport { CodeEditorHook } from \"../../deps/live_monaco_editor/priv/static/live_monaco_editor.esm\"\nimport { getHooks } from \"live_svelte\"\nimport * as Components from \"../svelte/**/*.svelte\"\nlet Hooks = {}\nHooks.CodeEditorHook = CodeEditorHook\ntopbar.config({ barColors: { 0: \"#29d\" }, shadowColor: \"rgba(0, 0, 0, .3)\" })\nwindow.addEventListener(\"phx:page-loading-start\", (_info) => topbar.show(300))\nwindow.addEventListener(\"phx:page-loading-stop\", (_info) => topbar.hide())\n\nwindow.addEventListener(\"beacon_admin:clipcopy\", (event) => {\n const result_id = `${event.target.id}-copy-to-clipboard-result`\n const el = document.getElementById(result_id)\n\n if (\"clipboard\" in navigator) {\n if (event.target.tagName === \"INPUT\") {\n txt = event.target.value\n } else {\n txt = event.target.textContent\n }\n\n navigator.clipboard\n .writeText(txt)\n .then(() => {\n el.innerText = \"Copied to clipboard\"\n // Make it visible\n el.classList.remove(\"invisible\", \"text-red-500\", \"opacity-0\")\n // Fade in and translate upwards\n el.classList.add(\"text-green-500\", \"opacity-100\", \"-translate-y-2\")\n\n setTimeout(function () {\n el.classList.remove(\"text-green-500\", \"opacity-100\", \"-translate-y-2\")\n el.classList.add(\"invisible\", \"text-red-500\", \"opacity-0\")\n }, 2000)\n })\n .catch(() => {\n el.innerText = \"Could not copy\"\n // Make it visible\n el.classList.remove(\"invisible\", \"text-green-500\", \"opacity-0\")\n // Fade in and translate upwards\n el.classList.add(\"text-red-500\", \"opacity-100\", \"-translate-y-2\")\n })\n } else {\n alert(\"Sorry, your browser does not support clipboard copy.\")\n }\n})\n\nlet socketPath = document.querySelector(\"html\").getAttribute(\"phx-socket\") || \"/live\"\nlet csrfToken = document.querySelector(\"meta[name='csrf-token']\").getAttribute(\"content\")\nlet liveSocket = new LiveView.LiveSocket(socketPath, Phoenix.Socket, {\n hooks: { ...getHooks(Components), ...Hooks },\n params: { _csrf_token: csrfToken },\n})\nliveSocket.connect()\nwindow.liveSocket = liveSocket\n", "function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nexport { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _defineProperty as defineProperty, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _unsupportedIterableToArray as unsupportedIterableToArray };\n", "function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n}\n\nfunction curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n nextArgs[_key3] = arguments[_key3];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nfunction isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nfunction isEmpty(obj) {\n return !Object.keys(obj).length;\n}\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\nfunction hasOwnProperty(object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n}\n\nfunction validateChanges(initial, changes) {\n if (!isObject(changes)) errorHandler('changeType');\n if (Object.keys(changes).some(function (field) {\n return !hasOwnProperty(initial, field);\n })) errorHandler('changeField');\n return changes;\n}\n\nfunction validateSelector(selector) {\n if (!isFunction(selector)) errorHandler('selectorType');\n}\n\nfunction validateHandler(handler) {\n if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');\n if (isObject(handler) && Object.values(handler).some(function (_handler) {\n return !isFunction(_handler);\n })) errorHandler('handlersType');\n}\n\nfunction validateInitial(initial) {\n if (!initial) errorHandler('initialIsRequired');\n if (!isObject(initial)) errorHandler('initialType');\n if (isEmpty(initial)) errorHandler('initialContent');\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n initialIsRequired: 'initial state is required',\n initialType: 'initial state should be an object',\n initialContent: 'initial state shouldn\\'t be an empty object',\n handlerType: 'handler should be an object or a function',\n handlersType: 'all handlers should be a functions',\n selectorType: 'selector should be a function',\n changeType: 'provided value of changes should be an object',\n changeField: 'it seams you want to change a field in the state which is not specified in the \"initial\" state',\n \"default\": 'an unknown error accured in `state-local` package'\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n changes: validateChanges,\n selector: validateSelector,\n handler: validateHandler,\n initial: validateInitial\n};\n\nfunction create(initial) {\n var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n validators.initial(initial);\n validators.handler(handler);\n var state = {\n current: initial\n };\n var didUpdate = curry(didStateUpdate)(state, handler);\n var update = curry(updateState)(state);\n var validate = curry(validators.changes)(initial);\n var getChanges = curry(extractChanges)(state);\n\n function getState() {\n var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {\n return state;\n };\n validators.selector(selector);\n return selector(state.current);\n }\n\n function setState(causedChanges) {\n compose(didUpdate, update, validate, getChanges)(causedChanges);\n }\n\n return [getState, setState];\n}\n\nfunction extractChanges(state, causedChanges) {\n return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;\n}\n\nfunction updateState(state, changes) {\n state.current = _objectSpread2(_objectSpread2({}, state.current), changes);\n return changes;\n}\n\nfunction didStateUpdate(state, handler, changes) {\n isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {\n var _handler$field;\n\n return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);\n });\n return changes;\n}\n\nvar index = {\n create: create\n};\n\nexport default index;\n", "var config = {\n paths: {\n vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs'\n }\n};\n\nexport default config;\n", "function curry(fn) {\n return function curried() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return args.length >= fn.length ? fn.apply(this, args) : function () {\n for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n nextArgs[_key2] = arguments[_key2];\n }\n\n return curried.apply(_this, [].concat(args, nextArgs));\n };\n };\n}\n\nexport default curry;\n", "function isObject(value) {\n return {}.toString.call(value).includes('Object');\n}\n\nexport default isObject;\n", "import curry from '../utils/curry.js';\nimport isObject from '../utils/isObject.js';\n\n/**\n * validates the configuration object and informs about deprecation\n * @param {Object} config - the configuration object \n * @return {Object} config - the validated configuration object\n */\n\nfunction validateConfig(config) {\n if (!config) errorHandler('configIsRequired');\n if (!isObject(config)) errorHandler('configType');\n\n if (config.urls) {\n informAboutDeprecation();\n return {\n paths: {\n vs: config.urls.monacoBase\n }\n };\n }\n\n return config;\n}\n/**\n * logs deprecation message\n */\n\n\nfunction informAboutDeprecation() {\n console.warn(errorMessages.deprecation);\n}\n\nfunction throwError(errorMessages, type) {\n throw new Error(errorMessages[type] || errorMessages[\"default\"]);\n}\n\nvar errorMessages = {\n configIsRequired: 'the configuration object is required',\n configType: 'the configuration object should be an object',\n \"default\": 'an unknown error accured in `@monaco-editor/loader` package',\n deprecation: \"Deprecation warning!\\n You are using deprecated way of configuration.\\n\\n Instead of using\\n monaco.config({ urls: { monacoBase: '...' } })\\n use\\n monaco.config({ paths: { vs: '...' } })\\n\\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\\n \"\n};\nvar errorHandler = curry(throwError)(errorMessages);\nvar validators = {\n config: validateConfig\n};\n\nexport default validators;\nexport { errorHandler, errorMessages };\n", "var compose = function compose() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (x) {\n return fns.reduceRight(function (y, f) {\n return f(y);\n }, x);\n };\n};\n\nexport default compose;\n", "import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';\n\nfunction merge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (source[key] instanceof Object) {\n if (target[key]) {\n Object.assign(source[key], merge(target[key], source[key]));\n }\n }\n });\n return _objectSpread2(_objectSpread2({}, target), source);\n}\n\nexport default merge;\n", "// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325\nvar CANCELATION_MESSAGE = {\n type: 'cancelation',\n msg: 'operation is manually canceled'\n};\n\nfunction makeCancelable(promise) {\n var hasCanceled_ = false;\n var wrappedPromise = new Promise(function (resolve, reject) {\n promise.then(function (val) {\n return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);\n });\n promise[\"catch\"](reject);\n });\n return wrappedPromise.cancel = function () {\n return hasCanceled_ = true;\n }, wrappedPromise;\n}\n\nexport default makeCancelable;\nexport { CANCELATION_MESSAGE };\n", "import { slicedToArray as _slicedToArray, objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';\nimport state from 'state-local';\nimport config$1 from '../config/index.js';\nimport validators from '../validators/index.js';\nimport compose from '../utils/compose.js';\nimport merge from '../utils/deepMerge.js';\nimport makeCancelable from '../utils/makeCancelable.js';\n\n/** the local state of the module */\n\nvar _state$create = state.create({\n config: config$1,\n isInitialized: false,\n resolve: null,\n reject: null,\n monaco: null\n}),\n _state$create2 = _slicedToArray(_state$create, 2),\n getState = _state$create2[0],\n setState = _state$create2[1];\n/**\n * set the loader configuration\n * @param {Object} config - the configuration object\n */\n\n\nfunction config(globalConfig) {\n var _validators$config = validators.config(globalConfig),\n monaco = _validators$config.monaco,\n config = _objectWithoutProperties(_validators$config, [\"monaco\"]);\n\n setState(function (state) {\n return {\n config: merge(state.config, config),\n monaco: monaco\n };\n });\n}\n/**\n * handles the initialization of the monaco-editor\n * @return {Promise} - returns an instance of monaco (with a cancelable promise)\n */\n\n\nfunction init() {\n var state = getState(function (_ref) {\n var monaco = _ref.monaco,\n isInitialized = _ref.isInitialized,\n resolve = _ref.resolve;\n return {\n monaco: monaco,\n isInitialized: isInitialized,\n resolve: resolve\n };\n });\n\n if (!state.isInitialized) {\n setState({\n isInitialized: true\n });\n\n if (state.monaco) {\n state.resolve(state.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n if (window.monaco && window.monaco.editor) {\n storeMonacoInstance(window.monaco);\n state.resolve(window.monaco);\n return makeCancelable(wrapperPromise);\n }\n\n compose(injectScripts, getMonacoLoaderScript)(configureLoader);\n }\n\n return makeCancelable(wrapperPromise);\n}\n/**\n * injects provided scripts into the document.body\n * @param {Object} script - an HTML script element\n * @return {Object} - the injected HTML script element\n */\n\n\nfunction injectScripts(script) {\n return document.body.appendChild(script);\n}\n/**\n * creates an HTML script element with/without provided src\n * @param {string} [src] - the source path of the script\n * @return {Object} - the created HTML script element\n */\n\n\nfunction createScript(src) {\n var script = document.createElement('script');\n return src && (script.src = src), script;\n}\n/**\n * creates an HTML script element with the monaco loader src\n * @return {Object} - the created HTML script element\n */\n\n\nfunction getMonacoLoaderScript(configureLoader) {\n var state = getState(function (_ref2) {\n var config = _ref2.config,\n reject = _ref2.reject;\n return {\n config: config,\n reject: reject\n };\n });\n var loaderScript = createScript(\"\".concat(state.config.paths.vs, \"/loader.js\"));\n\n loaderScript.onload = function () {\n return configureLoader();\n };\n\n loaderScript.onerror = state.reject;\n return loaderScript;\n}\n/**\n * configures the monaco loader\n */\n\n\nfunction configureLoader() {\n var state = getState(function (_ref3) {\n var config = _ref3.config,\n resolve = _ref3.resolve,\n reject = _ref3.reject;\n return {\n config: config,\n resolve: resolve,\n reject: reject\n };\n });\n var require = window.require;\n\n require.config(state.config);\n\n require(['vs/editor/editor.main'], function (monaco) {\n storeMonacoInstance(monaco);\n state.resolve(monaco);\n }, function (error) {\n state.reject(error);\n });\n}\n/**\n * store monaco instance in local state\n */\n\n\nfunction storeMonacoInstance(monaco) {\n if (!getState().monaco) {\n setState({\n monaco: monaco\n });\n }\n}\n/**\n * internal helper function\n * extracts stored monaco instance\n * @return {Object|null} - the monaco instance\n */\n\n\nfunction __getMonacoInstance() {\n return getState(function (_ref4) {\n var monaco = _ref4.monaco;\n return monaco;\n });\n}\n\nvar wrapperPromise = new Promise(function (resolve, reject) {\n return setState({\n resolve: resolve,\n reject: reject\n });\n});\nvar loader = {\n config: config,\n init: init,\n __getMonacoInstance: __getMonacoInstance\n};\n\nexport default loader;\n", "// Copied and modified from the original work available at https://github.com/livebook-dev/livebook/blob/23e58ac604de92ce54472f36fe3e28dc27576d6c/assets/js/hooks/cell_editor/live_editor/theme.js\n// Copyright (C) 2021 Dashbit\n// Licensed under Apache 2.0 available at https://www.apache.org/licenses/LICENSE-2.0\n\n// This is a port of the One Dark theme to the Monaco editor.\n// We color graded the comment so it has AA accessibility and\n// then similarly scaled the default font.\nconst colors = {\n background: \"#282c34\",\n default: \"#c4cad6\",\n lightRed: \"#e06c75\",\n blue: \"#61afef\",\n gray: \"#8c92a3\",\n green: \"#98c379\",\n purple: \"#c678dd\",\n red: \"#be5046\",\n teal: \"#56b6c2\",\n peach: \"#d19a66\",\n}\n\nconst rules = (colors) => [\n { token: \"\", foreground: colors.default },\n { token: \"variable\", foreground: colors.lightRed },\n { token: \"constant\", foreground: colors.blue },\n { token: \"constant.character.escape\", foreground: colors.blue },\n { token: \"comment\", foreground: colors.gray },\n { token: \"number\", foreground: colors.blue },\n { token: \"regexp\", foreground: colors.lightRed },\n { token: \"type\", foreground: colors.lightRed },\n { token: \"string\", foreground: colors.green },\n { token: \"keyword\", foreground: colors.purple },\n { token: \"operator\", foreground: colors.peach },\n { token: \"delimiter.bracket.embed\", foreground: colors.red },\n { token: \"sigil\", foreground: colors.teal },\n { token: \"function\", foreground: colors.blue },\n { token: \"function.call\", foreground: colors.default },\n\n // Markdown specific\n { token: \"emphasis\", fontStyle: \"italic\" },\n { token: \"strong\", fontStyle: \"bold\" },\n { token: \"keyword.md\", foreground: colors.lightRed },\n { token: \"keyword.table\", foreground: colors.lightRed },\n { token: \"string.link.md\", foreground: colors.blue },\n { token: \"variable.md\", foreground: colors.teal },\n { token: \"string.md\", foreground: colors.default },\n { token: \"variable.source.md\", foreground: colors.default },\n\n // XML specific\n { token: \"tag\", foreground: colors.lightRed },\n { token: \"metatag\", foreground: colors.lightRed },\n { token: \"attribute.name\", foreground: colors.peach },\n { token: \"attribute.value\", foreground: colors.green },\n\n // JSON specific\n { token: \"string.key\", foreground: colors.lightRed },\n { token: \"keyword.json\", foreground: colors.blue },\n\n // SQL specific\n { token: \"operator.sql\", foreground: colors.purple },\n]\n\nconst theme = {\n base: \"vs-dark\",\n inherit: false,\n rules: rules(colors),\n colors: {\n \"editor.background\": colors.background,\n \"editor.foreground\": colors.default,\n \"editorLineNumber.foreground\": \"#636d83\",\n \"editorCursor.foreground\": \"#636d83\",\n \"editor.selectionBackground\": \"#3e4451\",\n \"editor.findMatchHighlightBackground\": \"#528bff3d\",\n \"editorSuggestWidget.background\": \"#21252b\",\n \"editorSuggestWidget.border\": \"#181a1f\",\n \"editorSuggestWidget.selectedBackground\": \"#2c313a\",\n \"input.background\": \"#1b1d23\",\n \"input.border\": \"#181a1f\",\n \"editorBracketMatch.border\": \"#282c34\",\n \"editorBracketMatch.background\": \"#3e4451\",\n },\n}\n\nexport { theme }\n", "// Copied and modified from the original work available at https://github.com/livebook-dev/livebook/blob/8532bc334bdcf3c57fab9b694666e609877d279f/assets/js/hooks/cell_editor/live_editor.js\n// Copyright (C) 2021 Dashbit\n// Licensed under Apache 2.0 available at https://www.apache.org/licenses/LICENSE-2.0\n\nimport loader from \"@monaco-editor/loader\"\nimport { theme } from \"./themes\"\n\nclass CodeEditor {\n constructor(el, path, value, opts) {\n this.el = el\n this.path = path\n this.value = value\n this.opts = opts\n // https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IStandaloneCodeEditor.html\n this.standalone_code_editor = null\n this._onMount = []\n }\n\n isMounted() {\n return !!this.standalone_code_editor\n }\n\n mount() {\n if (this.isMounted()) {\n throw new Error(\"The monaco editor is already mounted\")\n }\n\n this._mountEditor()\n }\n\n onMount(callback) {\n this._onMount.push(callback)\n }\n\n dispose() {\n if (this.isMounted()) {\n const model = this.standalone_code_editor.getModel()\n\n if (model) {\n model.dispose()\n }\n\n this.standalone_code_editor.dispose()\n }\n }\n\n _mountEditor() {\n this.opts.value = this.value\n\n loader.config({\n paths: { vs: \"https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs\" },\n })\n\n loader.init().then((monaco) => {\n monaco.editor.defineTheme(\"default\", theme)\n\n let modelUri = monaco.Uri.parse(this.path)\n let language = this.opts.language\n let model = monaco.editor.createModel(this.value, language, modelUri)\n\n this.opts.language = undefined\n this.opts.model = model\n this.standalone_code_editor = monaco.editor.create(this.el, this.opts)\n\n this._onMount.forEach((callback) => callback(monaco))\n\n this._setScreenDependantEditorOptions()\n\n this.standalone_code_editor.addAction({\n contextMenuGroupId: \"word-wrapping\",\n id: \"enable-word-wrapping\",\n label: \"Enable word wrapping\",\n precondition: \"config.editor.wordWrap == off\",\n keybindings: [monaco.KeyMod.Alt | monaco.KeyCode.KeyZ],\n run: (editor) => editor.updateOptions({ wordWrap: \"on\" }),\n })\n\n this.standalone_code_editor.addAction({\n contextMenuGroupId: \"word-wrapping\",\n id: \"disable-word-wrapping\",\n label: \"Disable word wrapping\",\n precondition: \"config.editor.wordWrap == on\",\n keybindings: [monaco.KeyMod.Alt | monaco.KeyCode.KeyZ],\n run: (editor) => editor.updateOptions({ wordWrap: \"off\" }),\n })\n\n const resizeObserver = new ResizeObserver((entries) => {\n entries.forEach(() => {\n if (this.el.offsetHeight > 0) {\n this._setScreenDependantEditorOptions()\n this.standalone_code_editor.layout()\n }\n })\n })\n\n resizeObserver.observe(this.el)\n\n this.standalone_code_editor.onDidContentSizeChange(() => {\n const contentHeight = this.standalone_code_editor.getContentHeight()\n this.el.style.height = `${contentHeight}px`\n })\n })\n }\n\n _setScreenDependantEditorOptions() {\n if (window.screen.width < 768) {\n this.standalone_code_editor.updateOptions({\n folding: false,\n lineDecorationsWidth: 16,\n lineNumbersMinChars:\n Math.floor(\n Math.log10(this.standalone_code_editor.getModel().getLineCount())\n ) + 3,\n })\n } else {\n this.standalone_code_editor.updateOptions({\n folding: true,\n lineDecorationsWidth: 10,\n lineNumbersMinChars: 5,\n })\n }\n }\n}\n\nexport default CodeEditor\n", "import CodeEditor from \"../editor/code_editor\"\n\nconst CodeEditorHook = {\n mounted() {\n // TODO: validate dataset\n const opts = JSON.parse(this.el.dataset.opts)\n\n this.codeEditor = new CodeEditor(\n this.el,\n this.el.dataset.path,\n this.el.dataset.value,\n opts\n )\n\n this.codeEditor.onMount((monaco) => {\n if (this.el.dataset.changeEvent && this.el.dataset.changeEvent !== \"\") {\n this.codeEditor.standalone_code_editor.onDidChangeModelContent(() => {\n if (this.el.dataset.target && this.el.dataset.target !== \"\") {\n this.pushEventTo(\n this.el.dataset.target,\n this.el.dataset.changeEvent,\n {\n value: this.codeEditor.standalone_code_editor.getValue(),\n }\n )\n } else {\n this.pushEvent(this.el.dataset.changeEvent, {\n value: this.codeEditor.standalone_code_editor.getValue(),\n })\n }\n })\n }\n\n this.handleEvent(\n \"lme:change_language:\" + this.el.dataset.path,\n (data) => {\n const model = this.codeEditor.standalone_code_editor.getModel()\n\n if (model.getLanguageId() !== data.mimeTypeOrLanguageId) {\n monaco.editor.setModelLanguage(model, data.mimeTypeOrLanguageId)\n }\n }\n )\n\n this.handleEvent(\"lme:set_value:\" + this.el.dataset.path, (data) => {\n this.codeEditor.standalone_code_editor.setValue(data.value)\n })\n\n this.el.querySelectorAll(\"textarea\").forEach((textarea) => {\n textarea.setAttribute(\n \"name\",\n \"live_monaco_editor[\" + this.el.dataset.path + \"]\"\n )\n })\n\n this.el.removeAttribute(\"data-value\")\n this.el.removeAttribute(\"data-opts\")\n\n this.el.dispatchEvent(\n new CustomEvent(\"lme:editor_mounted\", {\n detail: { hook: this, editor: this.codeEditor },\n bubbles: true,\n })\n )\n })\n\n if (!this.codeEditor.isMounted()) {\n this.codeEditor.mount()\n }\n },\n\n destroyed() {\n if (this.codeEditor) {\n this.codeEditor.dispose()\n }\n },\n}\n\nexport { CodeEditorHook }\n", "export function normalizeComponents(components) {\n if (!Array.isArray(components.default) || !Array.isArray(components.filenames)) return components\n\n const normalized = {}\n for (const [index, module] of components.default.entries()) {\n const Component = module.default\n const name = components.filenames[index].replace(\"../svelte/\", \"\").replace(\".svelte\", \"\")\n normalized[name] = Component\n }\n return normalized\n}\n", "import {normalizeComponents} from \"./utils\"\n\nexport function getRender(components) {\n components = normalizeComponents(components)\n\n return function render(name, props, slots) {\n const Component = components[name]\n const $$slots = Object.fromEntries(Object.entries(slots).map(([k, v]) => [k, () => v]))\n return Component.render(props, {$$slots})\n }\n}\n", "import {normalizeComponents} from \"./utils\"\n\nfunction getAttributeJson(ref, attributeName) {\n const data = ref.el.getAttribute(attributeName)\n return data ? JSON.parse(data) : {}\n}\n\nfunction detach(node) {\n node.parentNode?.removeChild(node)\n}\n\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null)\n}\n\nfunction noop() {}\n\nfunction getSlots(ref) {\n const slots = {}\n\n for (const slotName in getAttributeJson(ref, \"data-slots\")) {\n const slot = () => {\n return {\n getElement() {\n const base64 = getAttributeJson(ref, \"data-slots\")[slotName]\n const element = document.createElement(\"div\")\n element.innerHTML = atob(base64).trim()\n return element\n },\n update() {\n detach(this.savedElement)\n this.savedElement = this.getElement()\n insert(this.savedTarget, this.savedElement, this.savedAnchor)\n },\n c: noop,\n m(target, anchor) {\n this.savedTarget = target\n this.savedAnchor = anchor\n this.savedElement = this.getElement()\n insert(this.savedTarget, this.savedElement, this.savedAnchor)\n },\n d(detaching) {\n if (detaching) detach(this.savedElement)\n },\n l: noop,\n }\n }\n\n slots[slotName] = [slot]\n }\n\n return slots\n}\n\nfunction getLiveJsonProps(ref) {\n const json = getAttributeJson(ref, \"data-live-json\")\n\n // On SSR, data-live-json is the full object we want\n // After SSR, data-live-json is an array of keys, and we'll get the data from the window\n if (!Array.isArray(json)) return json\n\n const liveJsonData = {}\n for (const liveJsonVariable of json) {\n const data = window[liveJsonVariable]\n if (data) liveJsonData[liveJsonVariable] = data\n }\n return liveJsonData\n}\n\nfunction getProps(ref) {\n return {\n ...getAttributeJson(ref, \"data-props\"),\n ...getLiveJsonProps(ref),\n live: ref,\n $$slots: getSlots(ref),\n $$scope: {},\n }\n}\n\nfunction findSlotCtx(component) {\n // The default slot always exists if there's a slot set\n // even if no slot is set for the explicit default slot\n return component.$$.ctx.find(ctxElement => ctxElement?.default)\n}\n\nexport function getHooks(components) {\n components = normalizeComponents(components)\n\n const SvelteHook = {\n mounted() {\n const componentName = this.el.getAttribute(\"data-name\")\n if (!componentName) {\n throw new Error(\"Component name must be provided\")\n }\n\n const Component = components[componentName]\n if (!Component) {\n throw new Error(`Unable to find ${componentName} component.`)\n }\n\n for (const liveJsonElement of Object.keys(getAttributeJson(this, \"data-live-json\"))) {\n window.addEventListener(`${liveJsonElement}_initialized`, event => this._instance.$set(getProps(this)), false)\n window.addEventListener(`${liveJsonElement}_patched`, event => this._instance.$set(getProps(this)), false)\n }\n\n this._instance = new Component({\n target: this.el,\n props: getProps(this),\n hydrate: this.el.hasAttribute(\"data-ssr\"),\n })\n },\n\n updated() {\n // Set the props\n this._instance.$set(getProps(this))\n\n // Set the slots\n const slotCtx = findSlotCtx(this._instance)\n for (const key in slotCtx) {\n slotCtx[key][0]().update()\n }\n },\n\n destroyed() {\n if (this._instance) {\n window.addEventListener(\"phx:page-loading-stop\", () => this._instance.$destroy(), {once: true})\n }\n },\n }\n\n return {\n SvelteHook,\n }\n}\n", "\n import * as module0 from '../svelte/components/Backdrop.svelte';import * as module1 from '../svelte/components/BrowserFrame.svelte';import * as module2 from '../svelte/components/CodeEditor.svelte';import * as module3 from '../svelte/components/ComponentsSidebar.svelte';import * as module4 from '../svelte/components/LayoutAstNode.svelte';import * as module5 from '../svelte/components/PageAstNode.svelte';import * as module6 from '../svelte/components/PagePreview.svelte';import * as module7 from '../svelte/components/PageWrapper.svelte';import * as module8 from '../svelte/components/Pill.svelte';import * as module9 from '../svelte/components/PropertiesSidebar.svelte';import * as module10 from '../svelte/components/SelectedElementFloatingMenu.svelte';import * as module11 from '../svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte';import * as module12 from '../svelte/components/SidebarSection.svelte';import * as module13 from '../svelte/components/UiBuilder.svelte'\n\n const modules = [module0,module1,module2,module3,module4,module5,module6,module7,module8,module9,module10,module11,module12,module13];\n\n export default modules;\n export const filenames = ['../svelte/components/Backdrop.svelte','../svelte/components/BrowserFrame.svelte','../svelte/components/CodeEditor.svelte','../svelte/components/ComponentsSidebar.svelte','../svelte/components/LayoutAstNode.svelte','../svelte/components/PageAstNode.svelte','../svelte/components/PagePreview.svelte','../svelte/components/PageWrapper.svelte','../svelte/components/Pill.svelte','../svelte/components/PropertiesSidebar.svelte','../svelte/components/SelectedElementFloatingMenu.svelte','../svelte/components/SelectedElementFloatingMenu/DragMenuOption.svelte','../svelte/components/SidebarSection.svelte','../svelte/components/UiBuilder.svelte']\n ", "/** @returns {void} */\nexport function noop() {}\n\nexport const identity = (x) => x;\n\n/**\n * @template T\n * @template S\n * @param {T} tar\n * @param {S} src\n * @returns {T & S}\n */\nexport function assign(tar, src) {\n\t// @ts-ignore\n\tfor (const k in src) tar[k] = src[k];\n\treturn /** @type {T & S} */ (tar);\n}\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n/**\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn (\n\t\t!!value &&\n\t\t(typeof value === 'object' || typeof value === 'function') &&\n\t\ttypeof (/** @type {any} */ (value).then) === 'function'\n\t);\n}\n\n/** @returns {void} */\nexport function add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nexport function run(fn) {\n\treturn fn();\n}\n\nexport function blank_object() {\n\treturn Object.create(null);\n}\n\n/**\n * @param {Function[]} fns\n * @returns {void}\n */\nexport function run_all(fns) {\n\tfns.forEach(run);\n}\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\n/** @returns {boolean} */\nexport function safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || (a && typeof a === 'object') || typeof a === 'function';\n}\n\nlet src_url_equal_anchor;\n\n/**\n * @param {string} element_src\n * @param {string} url\n * @returns {boolean}\n */\nexport function src_url_equal(element_src, url) {\n\tif (element_src === url) return true;\n\tif (!src_url_equal_anchor) {\n\t\tsrc_url_equal_anchor = document.createElement('a');\n\t}\n\t// This is actually faster than doing URL(..).href\n\tsrc_url_equal_anchor.href = url;\n\treturn element_src === src_url_equal_anchor.href;\n}\n\n/** @param {string} srcset */\nfunction split_srcset(srcset) {\n\treturn srcset.split(',').map((src) => src.trim().split(' ').filter(Boolean));\n}\n\n/**\n * @param {HTMLSourceElement | HTMLImageElement} element_srcset\n * @param {string | undefined | null} srcset\n * @returns {boolean}\n */\nexport function srcset_url_equal(element_srcset, srcset) {\n\tconst element_urls = split_srcset(element_srcset.srcset);\n\tconst urls = split_srcset(srcset || '');\n\n\treturn (\n\t\turls.length === element_urls.length &&\n\t\turls.every(\n\t\t\t([url, width], i) =>\n\t\t\t\twidth === element_urls[i][1] &&\n\t\t\t\t// We need to test both ways because Vite will create an a full URL with\n\t\t\t\t// `new URL(asset, import.meta.url).href` for the client when `base: './'`, and the\n\t\t\t\t// relative URLs inside srcset are not automatically resolved to absolute URLs by\n\t\t\t\t// browsers (in contrast to img.src). This means both SSR and DOM code could\n\t\t\t\t// contain relative or absolute URLs.\n\t\t\t\t(src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))\n\t\t)\n\t);\n}\n\n/** @returns {boolean} */\nexport function not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\n/** @returns {boolean} */\nexport function is_empty(obj) {\n\treturn Object.keys(obj).length === 0;\n}\n\n/** @returns {void} */\nexport function validate_store(store, name) {\n\tif (store != null && typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nexport function subscribe(store, ...callbacks) {\n\tif (store == null) {\n\t\tfor (const callback of callbacks) {\n\t\t\tcallback(undefined);\n\t\t}\n\t\treturn noop;\n\t}\n\tconst unsub = store.subscribe(...callbacks);\n\treturn unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\n\n/**\n * Get the current value from a store by subscribing and immediately unsubscribing.\n *\n * https://svelte.dev/docs/svelte-store#get\n * @template T\n * @param {import('../store/public.js').Readable} store\n * @returns {T}\n */\nexport function get_store_value(store) {\n\tlet value;\n\tsubscribe(store, (_) => (value = _))();\n\treturn value;\n}\n\n/** @returns {void} */\nexport function component_subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(subscribe(store, callback));\n}\n\nexport function create_slot(definition, ctx, $$scope, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n\treturn definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;\n}\n\nexport function get_slot_changes(definition, $$scope, dirty, fn) {\n\tif (definition[2] && fn) {\n\t\tconst lets = definition[2](fn(dirty));\n\t\tif ($$scope.dirty === undefined) {\n\t\t\treturn lets;\n\t\t}\n\t\tif (typeof lets === 'object') {\n\t\t\tconst merged = [];\n\t\t\tconst len = Math.max($$scope.dirty.length, lets.length);\n\t\t\tfor (let i = 0; i < len; i += 1) {\n\t\t\t\tmerged[i] = $$scope.dirty[i] | lets[i];\n\t\t\t}\n\t\t\treturn merged;\n\t\t}\n\t\treturn $$scope.dirty | lets;\n\t}\n\treturn $$scope.dirty;\n}\n\n/** @returns {void} */\nexport function update_slot_base(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tslot_changes,\n\tget_slot_context_fn\n) {\n\tif (slot_changes) {\n\t\tconst slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n\t\tslot.p(slot_context, slot_changes);\n\t}\n}\n\n/** @returns {void} */\nexport function update_slot(\n\tslot,\n\tslot_definition,\n\tctx,\n\t$$scope,\n\tdirty,\n\tget_slot_changes_fn,\n\tget_slot_context_fn\n) {\n\tconst slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n\tupdate_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\n\n/** @returns {any[] | -1} */\nexport function get_all_dirty_from_scope($$scope) {\n\tif ($$scope.ctx.length > 32) {\n\t\tconst dirty = [];\n\t\tconst length = $$scope.ctx.length / 32;\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tdirty[i] = -1;\n\t\t}\n\t\treturn dirty;\n\t}\n\treturn -1;\n}\n\n/** @returns {{}} */\nexport function exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\n/** @returns {{}} */\nexport function compute_rest_props(props, keys) {\n\tconst rest = {};\n\tkeys = new Set(keys);\n\tfor (const k in props) if (!keys.has(k) && k[0] !== '$') rest[k] = props[k];\n\treturn rest;\n}\n\n/** @returns {{}} */\nexport function compute_slots(slots) {\n\tconst result = {};\n\tfor (const key in slots) {\n\t\tresult[key] = true;\n\t}\n\treturn result;\n}\n\n/** @returns {(this: any, ...args: any[]) => void} */\nexport function once(fn) {\n\tlet ran = false;\n\treturn function (...args) {\n\t\tif (ran) return;\n\t\tran = true;\n\t\tfn.call(this, ...args);\n\t};\n}\n\nexport function null_to_empty(value) {\n\treturn value == null ? '' : value;\n}\n\nexport function set_store_value(store, ret, value) {\n\tstore.set(value);\n\treturn ret;\n}\n\nexport const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\n\nexport function action_destroyer(action_result) {\n\treturn action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\n\n/** @param {number | string} value\n * @returns {[number, string]}\n */\nexport function split_css_unit(value) {\n\tconst split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n\treturn split ? [parseFloat(split[1]), split[2] || 'px'] : [/** @type {number} */ (value), 'px'];\n}\n\nexport const contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n", "import { noop } from './utils.js';\n\nexport const is_client = typeof window !== 'undefined';\n\n/** @type {() => number} */\nexport let now = is_client ? () => window.performance.now() : () => Date.now();\n\nexport let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;\n\n// used internally for testing\n/** @returns {void} */\nexport function set_now(fn) {\n\tnow = fn;\n}\n\n/** @returns {void} */\nexport function set_raf(fn) {\n\traf = fn;\n}\n", "import { raf } from './environment.js';\n\nconst tasks = new Set();\n\n/**\n * @param {number} now\n * @returns {void}\n */\nfunction run_tasks(now) {\n\ttasks.forEach((task) => {\n\t\tif (!task.c(now)) {\n\t\t\ttasks.delete(task);\n\t\t\ttask.f();\n\t\t}\n\t});\n\tif (tasks.size !== 0) raf(run_tasks);\n}\n\n/**\n * For testing purposes only!\n * @returns {void}\n */\nexport function clear_loops() {\n\ttasks.clear();\n}\n\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n * @param {import('./private.js').TaskCallback} callback\n * @returns {import('./private.js').Task}\n */\nexport function loop(callback) {\n\t/** @type {import('./private.js').TaskEntry} */\n\tlet task;\n\tif (tasks.size === 0) raf(run_tasks);\n\treturn {\n\t\tpromise: new Promise((fulfill) => {\n\t\t\ttasks.add((task = { c: callback, f: fulfill }));\n\t\t}),\n\t\tabort() {\n\t\t\ttasks.delete(task);\n\t\t}\n\t};\n}\n", "/** @type {typeof globalThis} */\nexport const globals =\n\ttypeof window !== 'undefined'\n\t\t? window\n\t\t: typeof globalThis !== 'undefined'\n\t\t? globalThis\n\t\t: // @ts-ignore Node typings have this\n\t\t global;\n", "import { globals } from './globals.js';\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nexport class ResizeObserverSingleton {\n\t/**\n\t * @private\n\t * @readonly\n\t * @type {WeakMap}\n\t */\n\t_listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n\t/**\n\t * @private\n\t * @type {ResizeObserver}\n\t */\n\t_observer = undefined;\n\n\t/** @type {ResizeObserverOptions} */\n\toptions;\n\n\t/** @param {ResizeObserverOptions} options */\n\tconstructor(options) {\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * @param {Element} element\n\t * @param {import('./private.js').Listener} listener\n\t * @returns {() => void}\n\t */\n\tobserve(element, listener) {\n\t\tthis._listeners.set(element, listener);\n\t\tthis._getObserver().observe(element, this.options);\n\t\treturn () => {\n\t\t\tthis._listeners.delete(element);\n\t\t\tthis._observer.unobserve(element); // this line can probably be removed\n\t\t};\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_getObserver() {\n\t\treturn (\n\t\t\tthis._observer ??\n\t\t\t(this._observer = new ResizeObserver((entries) => {\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tResizeObserverSingleton.entries.set(entry.target, entry);\n\t\t\t\t\tthis._listeners.get(entry.target)?.(entry);\n\t\t\t\t}\n\t\t\t}))\n\t\t);\n\t}\n}\n\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n", "import { contenteditable_truthy_values, has_prop } from './utils.js';\n\nimport { ResizeObserverSingleton } from './ResizeObserverSingleton.js';\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\n\n/**\n * @returns {void}\n */\nexport function start_hydrating() {\n\tis_hydrating = true;\n}\n\n/**\n * @returns {void}\n */\nexport function end_hydrating() {\n\tis_hydrating = false;\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {(index: number) => number} key\n * @param {number} value\n * @returns {number}\n */\nfunction upper_bound(low, high, key, value) {\n\t// Return first index of value larger than input value in the range [low, high)\n\twhile (low < high) {\n\t\tconst mid = low + ((high - low) >> 1);\n\t\tif (key(mid) <= value) {\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\treturn low;\n}\n\n/**\n * @param {NodeEx} target\n * @returns {void}\n */\nfunction init_hydrate(target) {\n\tif (target.hydrate_init) return;\n\ttarget.hydrate_init = true;\n\t// We know that all children have claim_order values since the unclaimed have been detached if target is not \n\n\tlet children = /** @type {ArrayLike} */ (target.childNodes);\n\t// If target is , there may be children without claim_order\n\tif (target.nodeName === 'HEAD') {\n\t\tconst my_children = [];\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst node = children[i];\n\t\t\tif (node.claim_order !== undefined) {\n\t\t\t\tmy_children.push(node);\n\t\t\t}\n\t\t}\n\t\tchildren = my_children;\n\t}\n\t/*\n\t * Reorder claimed children optimally.\n\t * We can reorder claimed children optimally by finding the longest subsequence of\n\t * nodes that are already claimed in order and only moving the rest. The longest\n\t * subsequence of nodes that are claimed in order can be found by\n\t * computing the longest increasing subsequence of .claim_order values.\n\t *\n\t * This algorithm is optimal in generating the least amount of reorder operations\n\t * possible.\n\t *\n\t * Proof:\n\t * We know that, given a set of reordering operations, the nodes that do not move\n\t * always form an increasing subsequence, since they do not move among each other\n\t * meaning that they must be already ordered among each other. Thus, the maximal\n\t * set of nodes that do not move form a longest increasing subsequence.\n\t */\n\t// Compute longest increasing subsequence\n\t// m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n\tconst m = new Int32Array(children.length + 1);\n\t// Predecessor indices + 1\n\tconst p = new Int32Array(children.length);\n\tm[0] = -1;\n\tlet longest = 0;\n\tfor (let i = 0; i < children.length; i++) {\n\t\tconst current = children[i].claim_order;\n\t\t// Find the largest subsequence length such that it ends in a value less than our current value\n\t\t// upper_bound returns first greater value, so we subtract one\n\t\t// with fast path for when we are on the current longest subsequence\n\t\tconst seq_len =\n\t\t\t(longest > 0 && children[m[longest]].claim_order <= current\n\t\t\t\t? longest + 1\n\t\t\t\t: upper_bound(1, longest, (idx) => children[m[idx]].claim_order, current)) - 1;\n\t\tp[i] = m[seq_len] + 1;\n\t\tconst new_len = seq_len + 1;\n\t\t// We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n\t\tm[new_len] = i;\n\t\tlongest = Math.max(new_len, longest);\n\t}\n\t// The longest increasing subsequence of nodes (initially reversed)\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst lis = [];\n\t// The rest of the nodes, nodes that will be moved\n\n\t/**\n\t * @type {NodeEx2[]}\n\t */\n\tconst to_move = [];\n\tlet last = children.length - 1;\n\tfor (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n\t\tlis.push(children[cur - 1]);\n\t\tfor (; last >= cur; last--) {\n\t\t\tto_move.push(children[last]);\n\t\t}\n\t\tlast--;\n\t}\n\tfor (; last >= 0; last--) {\n\t\tto_move.push(children[last]);\n\t}\n\tlis.reverse();\n\t// We sort the nodes being moved to guarantee that their insertion order matches the claim order\n\tto_move.sort((a, b) => a.claim_order - b.claim_order);\n\t// Finally, we move the nodes\n\tfor (let i = 0, j = 0; i < to_move.length; i++) {\n\t\twhile (j < lis.length && to_move[i].claim_order >= lis[j].claim_order) {\n\t\t\tj++;\n\t\t}\n\t\tconst anchor = j < lis.length ? lis[j] : null;\n\t\ttarget.insertBefore(to_move[i], anchor);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @returns {void}\n */\nexport function append(target, node) {\n\ttarget.appendChild(node);\n}\n\n/**\n * @param {Node} target\n * @param {string} style_sheet_id\n * @param {string} styles\n * @returns {void}\n */\nexport function append_styles(target, style_sheet_id, styles) {\n\tconst append_styles_to = get_root_for_style(target);\n\tif (!append_styles_to.getElementById(style_sheet_id)) {\n\t\tconst style = element('style');\n\t\tstyle.id = style_sheet_id;\n\t\tstyle.textContent = styles;\n\t\tappend_stylesheet(append_styles_to, style);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {ShadowRoot | Document}\n */\nexport function get_root_for_style(node) {\n\tif (!node) return document;\n\tconst root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n\tif (root && /** @type {ShadowRoot} */ (root).host) {\n\t\treturn /** @type {ShadowRoot} */ (root);\n\t}\n\treturn node.ownerDocument;\n}\n\n/**\n * @param {Node} node\n * @returns {CSSStyleSheet}\n */\nexport function append_empty_stylesheet(node) {\n\tconst style_element = element('style');\n\t// For transitions to work without 'style-src: unsafe-inline' Content Security Policy,\n\t// these empty tags need to be allowed with a hash as a workaround until we move to the Web Animations API.\n\t// Using the hash for the empty string (for an empty tag) works in all browsers except Safari.\n\t// So as a workaround for the workaround, when we append empty style tags we set their content to /* empty */.\n\t// The hash 'sha256-9OlNO0DNEeaVzHL4RZwCLsBHA8WBQ8toBp/4F5XV2nc=' will then work even in Safari.\n\tstyle_element.textContent = '/* empty */';\n\tappend_stylesheet(get_root_for_style(node), style_element);\n\treturn style_element.sheet;\n}\n\n/**\n * @param {ShadowRoot | Document} node\n * @param {HTMLStyleElement} style\n * @returns {CSSStyleSheet}\n */\nfunction append_stylesheet(node, style) {\n\tappend(/** @type {Document} */ (node).head || node, style);\n\treturn style.sheet;\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @returns {void}\n */\nexport function append_hydration(target, node) {\n\tif (is_hydrating) {\n\t\tinit_hydrate(target);\n\t\tif (\n\t\t\ttarget.actual_end_child === undefined ||\n\t\t\t(target.actual_end_child !== null && target.actual_end_child.parentNode !== target)\n\t\t) {\n\t\t\ttarget.actual_end_child = target.firstChild;\n\t\t}\n\t\t// Skip nodes of undefined ordering\n\t\twhile (target.actual_end_child !== null && target.actual_end_child.claim_order === undefined) {\n\t\t\ttarget.actual_end_child = target.actual_end_child.nextSibling;\n\t\t}\n\t\tif (node !== target.actual_end_child) {\n\t\t\t// We only insert if the ordering of this node should be modified or the parent node is not target\n\t\t\tif (node.claim_order !== undefined || node.parentNode !== target) {\n\t\t\t\ttarget.insertBefore(node, target.actual_end_child);\n\t\t\t}\n\t\t} else {\n\t\t\ttarget.actual_end_child = node.nextSibling;\n\t\t}\n\t} else if (node.parentNode !== target || node.nextSibling !== null) {\n\t\ttarget.appendChild(node);\n\t}\n}\n\n/**\n * @param {Node} target\n * @param {Node} node\n * @param {Node} [anchor]\n * @returns {void}\n */\nexport function insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor || null);\n}\n\n/**\n * @param {NodeEx} target\n * @param {NodeEx} node\n * @param {NodeEx} [anchor]\n * @returns {void}\n */\nexport function insert_hydration(target, node, anchor) {\n\tif (is_hydrating && !anchor) {\n\t\tappend_hydration(target, node);\n\t} else if (node.parentNode !== target || node.nextSibling != anchor) {\n\t\ttarget.insertBefore(node, anchor || null);\n\t}\n}\n\n/**\n * @param {Node} node\n * @returns {void}\n */\nexport function detach(node) {\n\tif (node.parentNode) {\n\t\tnode.parentNode.removeChild(node);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element(name) {\n\treturn document.createElement(name);\n}\n\n/**\n * @template {keyof HTMLElementTagNameMap} K\n * @param {K} name\n * @param {string} is\n * @returns {HTMLElementTagNameMap[K]}\n */\nexport function element_is(name, is) {\n\treturn document.createElement(name, { is });\n}\n\n/**\n * @template T\n * @template {keyof T} K\n * @param {T} obj\n * @param {K[]} exclude\n * @returns {Pick>}\n */\nexport function object_without_properties(obj, exclude) {\n\tconst target = /** @type {Pick>} */ ({});\n\tfor (const k in obj) {\n\t\tif (\n\t\t\thas_prop(obj, k) &&\n\t\t\t// @ts-ignore\n\t\t\texclude.indexOf(k) === -1\n\t\t) {\n\t\t\t// @ts-ignore\n\t\t\ttarget[k] = obj[k];\n\t\t}\n\t}\n\treturn target;\n}\n\n/**\n * @template {keyof SVGElementTagNameMap} K\n * @param {K} name\n * @returns {SVGElement}\n */\nexport function svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n/**\n * @param {string} data\n * @returns {Text}\n */\nexport function text(data) {\n\treturn document.createTextNode(data);\n}\n\n/**\n * @returns {Text} */\nexport function space() {\n\treturn text(' ');\n}\n\n/**\n * @returns {Text} */\nexport function empty() {\n\treturn text('');\n}\n\n/**\n * @param {string} content\n * @returns {Comment}\n */\nexport function comment(content) {\n\treturn document.createComment(content);\n}\n\n/**\n * @param {EventTarget} node\n * @param {string} event\n * @param {EventListenerOrEventListenerObject} handler\n * @param {boolean | AddEventListenerOptions | EventListenerOptions} [options]\n * @returns {() => void}\n */\nexport function listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function prevent_default(fn) {\n\treturn function (event) {\n\t\tevent.preventDefault();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopPropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => any} */\nexport function stop_immediate_propagation(fn) {\n\treturn function (event) {\n\t\tevent.stopImmediatePropagation();\n\t\t// @ts-ignore\n\t\treturn fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function self(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.target === this) fn.call(this, event);\n\t};\n}\n\n/**\n * @returns {(event: any) => void} */\nexport function trusted(fn) {\n\treturn function (event) {\n\t\t// @ts-ignore\n\t\tif (event.isTrusted) fn.call(this, event);\n\t};\n}\n\n/**\n * @param {Element} node\n * @param {string} attribute\n * @param {string} [value]\n * @returns {void}\n */\nexport function attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_attributes(node, attributes) {\n\t// @ts-ignore\n\tconst descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n\tfor (const key in attributes) {\n\t\tif (attributes[key] == null) {\n\t\t\tnode.removeAttribute(key);\n\t\t} else if (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key === '__value') {\n\t\t\t/** @type {any} */ (node).value = node[key] = attributes[key];\n\t\t} else if (\n\t\t\tdescriptors[key] &&\n\t\t\tdescriptors[key].set &&\n\t\t\talways_set_through_set_attribute.indexOf(key) === -1\n\t\t) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} node\n * @param {{ [x: string]: string }} attributes\n * @returns {void}\n */\nexport function set_svg_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tattr(node, key, attributes[key]);\n\t}\n}\n\n/**\n * @param {Record} data_map\n * @returns {void}\n */\nexport function set_custom_element_data_map(node, data_map) {\n\tObject.keys(data_map).forEach((key) => {\n\t\tset_custom_element_data(node, key, data_map[key]);\n\t});\n}\n\n/**\n * @returns {void} */\nexport function set_custom_element_data(node, prop, value) {\n\tconst lower = prop.toLowerCase(); // for backwards compatibility with existing behavior we do lowercase first\n\tif (lower in node) {\n\t\tnode[lower] = typeof node[lower] === 'boolean' && value === '' ? true : value;\n\t} else if (prop in node) {\n\t\tnode[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\n/**\n * @param {string} tag\n */\nexport function set_dynamic_element_data(tag) {\n\treturn /-/.test(tag) ? set_custom_element_data_map : set_attributes;\n}\n\n/**\n * @returns {void}\n */\nexport function xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @returns {string}\n */\nexport function get_svelte_dataset(node) {\n\treturn node.dataset.svelteH;\n}\n\n/**\n * @returns {unknown[]} */\nexport function get_binding_group_value(group, __value, checked) {\n\tconst value = new Set();\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.add(group[i].__value);\n\t}\n\tif (!checked) {\n\t\tvalue.delete(__value);\n\t}\n\treturn Array.from(value);\n}\n\n/**\n * @param {HTMLInputElement[]} group\n * @returns {{ p(...inputs: HTMLInputElement[]): void; r(): void; }}\n */\nexport function init_binding_group(group) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\treturn {\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\t_inputs.forEach((input) => group.push(input));\n\t\t},\n\t\t/* remove */ r() {\n\t\t\t_inputs.forEach((input) => group.splice(group.indexOf(input), 1));\n\t\t}\n\t};\n}\n\n/**\n * @param {number[]} indexes\n * @returns {{ u(new_indexes: number[]): void; p(...inputs: HTMLInputElement[]): void; r: () => void; }}\n */\nexport function init_binding_group_dynamic(group, indexes) {\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _group = get_binding_group(group);\n\n\t/**\n\t * @type {HTMLInputElement[]} */\n\tlet _inputs;\n\n\tfunction get_binding_group(group) {\n\t\tfor (let i = 0; i < indexes.length; i++) {\n\t\t\tgroup = group[indexes[i]] = group[indexes[i]] || [];\n\t\t}\n\t\treturn group;\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction push() {\n\t\t_inputs.forEach((input) => _group.push(input));\n\t}\n\n\t/**\n\t * @returns {void} */\n\tfunction remove() {\n\t\t_inputs.forEach((input) => _group.splice(_group.indexOf(input), 1));\n\t}\n\treturn {\n\t\t/* update */ u(new_indexes) {\n\t\t\tindexes = new_indexes;\n\t\t\tconst new_group = get_binding_group(group);\n\t\t\tif (new_group !== _group) {\n\t\t\t\tremove();\n\t\t\t\t_group = new_group;\n\t\t\t\tpush();\n\t\t\t}\n\t\t},\n\t\t/* push */ p(...inputs) {\n\t\t\t_inputs = inputs;\n\t\t\tpush();\n\t\t},\n\t\t/* remove */ r: remove\n\t};\n}\n\n/** @returns {number} */\nexport function to_number(value) {\n\treturn value === '' ? null : +value;\n}\n\n/** @returns {any[]} */\nexport function time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\n/**\n * @param {Element} element\n * @returns {ChildNode[]}\n */\nexport function children(element) {\n\treturn Array.from(element.childNodes);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {void}\n */\nfunction init_claim_info(nodes) {\n\tif (nodes.claim_info === undefined) {\n\t\tnodes.claim_info = { last_index: 0, total_claimed: 0 };\n\t}\n}\n\n/**\n * @template {ChildNodeEx} R\n * @param {ChildNodeArray} nodes\n * @param {(node: ChildNodeEx) => node is R} predicate\n * @param {(node: ChildNodeEx) => ChildNodeEx | undefined} process_node\n * @param {() => R} create_node\n * @param {boolean} dont_update_last_index\n * @returns {R}\n */\nfunction claim_node(nodes, predicate, process_node, create_node, dont_update_last_index = false) {\n\t// Try to find nodes in an order such that we lengthen the longest increasing subsequence\n\tinit_claim_info(nodes);\n\tconst result_node = (() => {\n\t\t// We first try to find an element after the previous one\n\t\tfor (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// Otherwise, we try to find one before\n\t\t// We iterate in reverse so that we don't go too far back\n\t\tfor (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n\t\t\tconst node = nodes[i];\n\t\t\tif (predicate(node)) {\n\t\t\t\tconst replacement = process_node(node);\n\t\t\t\tif (replacement === undefined) {\n\t\t\t\t\tnodes.splice(i, 1);\n\t\t\t\t} else {\n\t\t\t\t\tnodes[i] = replacement;\n\t\t\t\t}\n\t\t\t\tif (!dont_update_last_index) {\n\t\t\t\t\tnodes.claim_info.last_index = i;\n\t\t\t\t} else if (replacement === undefined) {\n\t\t\t\t\t// Since we spliced before the last_index, we decrease it\n\t\t\t\t\tnodes.claim_info.last_index--;\n\t\t\t\t}\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\t// If we can't find any matching node, we create a new one\n\t\treturn create_node();\n\t})();\n\tresult_node.claim_order = nodes.claim_info.total_claimed;\n\tnodes.claim_info.total_claimed += 1;\n\treturn result_node;\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @param {(name: string) => Element | SVGElement} create_element\n * @returns {Element | SVGElement}\n */\nfunction claim_element_base(nodes, name, attributes, create_element) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Element | SVGElement} */\n\t\t(node) => node.nodeName === name,\n\t\t/** @param {Element} node */\n\t\t(node) => {\n\t\t\tconst remove = [];\n\t\t\tfor (let j = 0; j < node.attributes.length; j++) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) {\n\t\t\t\t\tremove.push(attribute.name);\n\t\t\t\t}\n\t\t\t}\n\t\t\tremove.forEach((v) => node.removeAttribute(v));\n\t\t\treturn undefined;\n\t\t},\n\t\t() => create_element(name)\n\t);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @param {string} name\n * @param {{ [key: string]: boolean }} attributes\n * @returns {Element | SVGElement}\n */\nexport function claim_svg_element(nodes, name, attributes) {\n\treturn claim_element_base(nodes, name, attributes, svg_element);\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Text}\n */\nexport function claim_text(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Text} */\n\t\t(node) => node.nodeType === 3,\n\t\t/** @param {Text} node */\n\t\t(node) => {\n\t\t\tconst data_str = '' + data;\n\t\t\tif (node.data.startsWith(data_str)) {\n\t\t\t\tif (node.data.length !== data_str.length) {\n\t\t\t\t\treturn node.splitText(data_str.length);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode.data = data_str;\n\t\t\t}\n\t\t},\n\t\t() => text(data),\n\t\ttrue // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n\t);\n}\n\n/**\n * @returns {Text} */\nexport function claim_space(nodes) {\n\treturn claim_text(nodes, ' ');\n}\n\n/**\n * @param {ChildNodeArray} nodes\n * @returns {Comment}\n */\nexport function claim_comment(nodes, data) {\n\treturn claim_node(\n\t\tnodes,\n\t\t/** @returns {node is Comment} */\n\t\t(node) => node.nodeType === 8,\n\t\t/** @param {Comment} node */\n\t\t(node) => {\n\t\t\tnode.data = '' + data;\n\t\t\treturn undefined;\n\t\t},\n\t\t() => comment(data),\n\t\ttrue\n\t);\n}\n\nfunction get_comment_idx(nodes, text, start) {\n\tfor (let i = start; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\n/**\n * @param {boolean} is_svg\n * @returns {HtmlTagHydration}\n */\nexport function claim_html_tag(nodes, is_svg) {\n\t// find html opening tag\n\tconst start_index = get_comment_idx(nodes, 'HTML_TAG_START', 0);\n\tconst end_index = get_comment_idx(nodes, 'HTML_TAG_END', start_index + 1);\n\tif (start_index === -1 || end_index === -1) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\n\tinit_claim_info(nodes);\n\tconst html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n\tdetach(html_tag_nodes[0]);\n\tdetach(html_tag_nodes[html_tag_nodes.length - 1]);\n\tconst claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n\tif (claimed_nodes.length === 0) {\n\t\treturn new HtmlTagHydration(is_svg);\n\t}\n\tfor (const n of claimed_nodes) {\n\t\tn.claim_order = nodes.claim_info.total_claimed;\n\t\tnodes.claim_info.total_claimed += 1;\n\t}\n\treturn new HtmlTagHydration(is_svg, claimed_nodes);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @returns {void}\n */\nexport function set_data_contenteditable(text, data) {\n\tdata = '' + data;\n\tif (text.wholeText === data) return;\n\ttext.data = /** @type {string} */ (data);\n}\n\n/**\n * @param {Text} text\n * @param {unknown} data\n * @param {string} attr_value\n * @returns {void}\n */\nexport function set_data_maybe_contenteditable(text, data, attr_value) {\n\tif (~contenteditable_truthy_values.indexOf(attr_value)) {\n\t\tset_data_contenteditable(text, data);\n\t} else {\n\t\tset_data(text, data);\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_input_value(input, value) {\n\tinput.value = value == null ? '' : value;\n}\n\n/**\n * @returns {void} */\nexport function set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\n/**\n * @returns {void} */\nexport function set_style(node, key, value, important) {\n\tif (value == null) {\n\t\tnode.style.removeProperty(key);\n\t} else {\n\t\tnode.style.setProperty(key, value, important ? 'important' : '');\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_option(select, value, mounting) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n\tif (!mounting || value !== undefined) {\n\t\tselect.selectedIndex = -1; // no option should be selected\n\t}\n}\n\n/**\n * @returns {void} */\nexport function select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nexport function select_value(select) {\n\tconst selected_option = select.querySelector(':checked');\n\treturn selected_option && selected_option.__value;\n}\n\nexport function select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), (option) => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\n\n/**\n * @type {boolean} */\nlet crossorigin;\n\n/**\n * @returns {boolean} */\nexport function is_crossorigin() {\n\tif (crossorigin === undefined) {\n\t\tcrossorigin = false;\n\t\ttry {\n\t\t\tif (typeof window !== 'undefined' && window.parent) {\n\t\t\t\tvoid window.parent.document;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tcrossorigin = true;\n\t\t}\n\t}\n\treturn crossorigin;\n}\n\n/**\n * @param {HTMLElement} node\n * @param {() => void} fn\n * @returns {() => void}\n */\nexport function add_iframe_resize_listener(node, fn) {\n\tconst computed_style = getComputedStyle(node);\n\tif (computed_style.position === 'static') {\n\t\tnode.style.position = 'relative';\n\t}\n\tconst iframe = element('iframe');\n\tiframe.setAttribute(\n\t\t'style',\n\t\t'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n\t\t\t'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'\n\t);\n\tiframe.setAttribute('aria-hidden', 'true');\n\tiframe.tabIndex = -1;\n\tconst crossorigin = is_crossorigin();\n\n\t/**\n\t * @type {() => void}\n\t */\n\tlet unsubscribe;\n\tif (crossorigin) {\n\t\tiframe.src = \"data:text/html,\";\n\t\tunsubscribe = listen(\n\t\t\twindow,\n\t\t\t'message',\n\t\t\t/** @param {MessageEvent} event */ (event) => {\n\t\t\t\tif (event.source === iframe.contentWindow) fn();\n\t\t\t}\n\t\t);\n\t} else {\n\t\tiframe.src = 'about:blank';\n\t\tiframe.onload = () => {\n\t\t\tunsubscribe = listen(iframe.contentWindow, 'resize', fn);\n\t\t\t// make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n\t\t\t// see https://github.com/sveltejs/svelte/issues/4233\n\t\t\tfn();\n\t\t};\n\t}\n\tappend(node, iframe);\n\treturn () => {\n\t\tif (crossorigin) {\n\t\t\tunsubscribe();\n\t\t} else if (unsubscribe && iframe.contentWindow) {\n\t\t\tunsubscribe();\n\t\t}\n\t\tdetach(iframe);\n\t};\n}\nexport const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'content-box'\n});\nexport const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({\n\tbox: 'border-box'\n});\nexport const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton(\n\t{ box: 'device-pixel-content-box' }\n);\nexport { ResizeObserverSingleton };\n\n/**\n * @returns {void} */\nexport function toggle_class(element, name, toggle) {\n\t// The `!!` is required because an `undefined` flag means flipping the current state.\n\telement.classList.toggle(name, !!toggle);\n}\n\n/**\n * @template T\n * @param {string} type\n * @param {T} [detail]\n * @param {{ bubbles?: boolean, cancelable?: boolean }} [options]\n * @returns {CustomEvent}\n */\nexport function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n\treturn new CustomEvent(type, { detail, bubbles, cancelable });\n}\n\n/**\n * @param {string} selector\n * @param {HTMLElement} parent\n * @returns {ChildNodeArray}\n */\nexport function query_selector_all(selector, parent = document.body) {\n\treturn Array.from(parent.querySelectorAll(selector));\n}\n\n/**\n * @param {string} nodeId\n * @param {HTMLElement} head\n * @returns {any[]}\n */\nexport function head_selector(nodeId, head) {\n\tconst result = [];\n\tlet started = 0;\n\tfor (const node of head.childNodes) {\n\t\tif (node.nodeType === 8 /* comment node */) {\n\t\t\tconst comment = node.textContent.trim();\n\t\t\tif (comment === `HEAD_${nodeId}_END`) {\n\t\t\t\tstarted -= 1;\n\t\t\t\tresult.push(node);\n\t\t\t} else if (comment === `HEAD_${nodeId}_START`) {\n\t\t\t\tstarted += 1;\n\t\t\t\tresult.push(node);\n\t\t\t}\n\t\t} else if (started > 0) {\n\t\t\tresult.push(node);\n\t\t}\n\t}\n\treturn result;\n}\n/** */\nexport class HtmlTag {\n\t/**\n\t * @private\n\t * @default false\n\t */\n\tis_svg = false;\n\t/** parent for creating node */\n\te = undefined;\n\t/** html tag nodes */\n\tn = undefined;\n\t/** target */\n\tt = undefined;\n\t/** anchor */\n\ta = undefined;\n\tconstructor(is_svg = false) {\n\t\tthis.is_svg = is_svg;\n\t\tthis.e = this.n = null;\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @returns {void}\n\t */\n\tc(html) {\n\t\tthis.h(html);\n\t}\n\n\t/**\n\t * @param {string} html\n\t * @param {HTMLElement | SVGElement} target\n\t * @param {HTMLElement | SVGElement} anchor\n\t * @returns {void}\n\t */\n\tm(html, target, anchor = null) {\n\t\tif (!this.e) {\n\t\t\tif (this.is_svg)\n\t\t\t\tthis.e = svg_element(/** @type {keyof SVGElementTagNameMap} */ (target.nodeName));\n\t\t\t/** #7364 target for