From 1eeddebecb86eb735bcf991e058a9bdb7306e85b Mon Sep 17 00:00:00 2001 From: Marius Sarca Date: Sat, 18 Sep 2021 20:18:49 +0300 Subject: [PATCH] v0.6.0 (#21) --- .gitignore | 2 +- dist/assembler.cjs.js | 246 ++++++++++++++-------------- dist/assembler.es.js | 246 ++++++++++++++-------------- dist/assembler.js | 246 ++++++++++++++-------------- dist/assembler.min.js | 2 +- package.json | 2 +- src/Root.ts | 144 ++++++++++------- src/StyleHandler.ts | 2 +- src/helpers.ts | 16 +- src/mixins.ts | 2 +- types/Root.d.ts | 11 +- yarn.lock | 368 +++++++++++++++++++++--------------------- 12 files changed, 669 insertions(+), 618 deletions(-) diff --git a/.gitignore b/.gitignore index b29df88..50ef94a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .idea *.html -!__tests__/*.html +!tests/*.html # Logs logs diff --git a/dist/assembler.cjs.js b/dist/assembler.cjs.js index fb84224..f10eb24 100644 --- a/dist/assembler.cjs.js +++ b/dist/assembler.cjs.js @@ -619,6 +619,128 @@ function generateRootVariables(settings) { return ':root{' + vars + '}'; } +/* + * Copyright 2021 Zindex Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const ESCAPE_REGEX = /\\\n/g; +const PROPERTY_REGEX$1 = /^--([a-zA-Z0-9-_]+)--(scope|mixin|register)$/; +class RootClass { + constructor() { + this.cache = new Map(); + this.scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", + "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", + "landscape", "portrait", "motion-reduce", "motion-safe" + ]; + this.registeredProperties = []; + const { cache } = this; + const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; + cache.set("--text-clip--scope", `$selector {${tc}}`); + cache.set("--l1--scope", "$selector > * {$body}"); + cache.set("--l2--scope", "$selector > * > * {$body}"); + cache.set("--sibling--scope", "$selector > * + * {$body}"); + cache.set("--child--scope", "$selector > $class {$body}"); + cache.set("--selection--scope", "$selector::selection {$body}"); + cache.set("--placeholder--scope", "$selector::placeholder {$body}"); + cache.set("--marker--scope", "$selector::marker {$body}"); + cache.set("--marker-l1--scope", "$selector > *::marker {$body}"); + cache.set("--before--scope", "$selector::before {$body}"); + cache.set("--after--scope", "$selector::after {$body}"); + cache.set("--even--scope", "$selector:nth-child(even) {$body}"); + cache.set("--odd--scope", "$selector:nth-child(odd) {$body}"); + cache.set("--first--scope", "$selector:first-child {$body}"); + cache.set("--last--scope", "$selector:last-child {$body}"); + cache.set("--first-letter--scope", "$selector::first-letter {$body}"); + cache.set("--first-line--scope", "$selector::first-line {$body}"); + cache.set("--dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); + cache.set("--light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); + cache.set("--landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); + cache.set("--portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); + cache.set("--motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); + cache.set("--motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); + this.initialize(); + } + initialize() { + const { cache, scopes, registeredProperties } = this; + for (const style of this.getComputedStyles()) { + for (const property of style) { + const match = PROPERTY_REGEX$1.exec(property); + if (match == null) { + continue; + } + const name = match[1]; + const value = this.getValue(style, property); + cache.set(property, value); + switch (match[2]) { + case "scope": + if (scopes.indexOf(name) === -1) { + scopes.push(name); + } + break; + case "register": + if (value === 'true' || value === '') { + registeredProperties.push({ name, aliases: [] }); + } + else { + const aliases = value.split(',').map(v => v.trim()).filter(v => v !== ''); + registeredProperties.push({ name, aliases }); + } + break; + } + } + } + } + getComputedStyles() { + const styles = []; + for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { + const styleSheet = document.styleSheets[si]; + if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { + continue; + } + if (styleSheet.href === null && styleSheet.ownerNode !== null + && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { + continue; + } + const rule = styleSheet.cssRules[0]; + if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { + styles.push(rule.style); + } + } + return styles; + } + getValue(style, property) { + let value = style.getPropertyValue(property).replace(ESCAPE_REGEX, "").trim(); + if (value.startsWith('"') && value.endsWith('"')) { + value = value.substring(1, value.length - 1).trim(); + } + return value; + } + getRegisteredScopes() { + return this.scopes; + } + getRegisteredProperties() { + return this.registeredProperties; + } + getPropertyValue(property) { + if (this.cache.has(property)) { + return this.cache.get(property); + } + return ''; + } +} +const Root = new RootClass(); + /* * Copyright 2021 Zindex Software * @@ -646,17 +768,8 @@ function getUserSettings(dataset) { const selectorAttribute = dataset.selectorAttribute === undefined ? 'class' : dataset.selectorAttribute; const cache = dataset.cache === undefined ? null : dataset.cache; const cacheKey = dataset.cacheKey === undefined ? "assembler-css-cache" : dataset.cacheKey; - const dataScopes = dataset.scopes === undefined ? [] : getStringItemList(dataset.scopes); - const registeredProperties = dataset.registerProperties === undefined ? [] : getRegisteredProperties(dataset.registerProperties); - const scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", - "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", - "landscape", "portrait", "motion-reduce", "motion-safe"]; - for (let i = 0, l = dataScopes.length; i < l; i++) { - const scope = dataScopes[i]; - if (scopes.indexOf(scope) < 0) { - scopes.push(scope); - } - } + const registeredProperties = Root.getRegisteredProperties(); + const scopes = Root.getRegisteredScopes(); for (let i = 0, l = registeredProperties.length; i < l; i++) { const prop = registeredProperties[i]; if (PROPERTY_LIST.indexOf(prop.name) === -1) { @@ -734,22 +847,6 @@ function getStringItemList(value, unique = true) { .filter(nonEmptyString); return unique ? items.filter(uniqueItems) : items; } -function getRegisteredProperties(value) { - return value - .split(';') - .map(v => v.trim()) - .filter(v => v !== '') - .map(v => { - const index = v.indexOf(':'); - if (index < 0) { - return { name: v, aliases: [] }; - } - return { - name: v.substr(0, index), - aliases: v.substr(index + 1).split(',').map(v => v.trim()).filter(v => v !== '') - }; - }); -} function trim(value) { return value.trim(); } @@ -936,97 +1033,6 @@ function observe(element, handler) { } } -/* - * Copyright 2021 Zindex Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const ESCAPE_REGEX = /\\\n/g; -class RootClass { - constructor() { - this.styles = null; - this.cache = new Map(); - const { cache } = this; - const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; - cache.set("text-clip--scope", `$selector {${tc}}`); - cache.set("l1--scope", "$selector > * {$body}"); - cache.set("l2--scope", "$selector > * > * {$body}"); - cache.set("sibling--scope", "$selector > * + * {$body}"); - cache.set("child--scope", "$selector > $class {$body}"); - cache.set("selection--scope", "$selector::selection {$body}"); - cache.set("placeholder--scope", "$selector::placeholder {$body}"); - cache.set("marker--scope", "$selector::marker {$body}"); - cache.set("marker-l1--scope", "$selector > *::marker {$body}"); - cache.set("before--scope", "$selector::before {$body}"); - cache.set("after--scope", "$selector::after {$body}"); - cache.set("even--scope", "$selector:nth-child(even) {$body}"); - cache.set("odd--scope", "$selector:nth-child(odd) {$body}"); - cache.set("first--scope", "$selector:first-child {$body}"); - cache.set("last--scope", "$selector:last-child {$body}"); - cache.set("first-letter--scope", "$selector::first-letter {$body}"); - cache.set("first-line--scope", "$selector::first-line {$body}"); - cache.set("dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); - cache.set("light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); - cache.set("landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); - cache.set("portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); - cache.set("motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); - cache.set("motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); - } - getComputedStyles() { - if (this.styles === null) { - this.styles = []; - for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { - const styleSheet = document.styleSheets[si]; - if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { - continue; - } - if (styleSheet.href === null && styleSheet.ownerNode !== null - && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { - continue; - } - const rule = styleSheet.cssRules[0]; - if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { - this.styles.unshift(rule.style); - } - } - } - return this.styles; - } - getPropertyValueFormComputedStyles(property) { - for (const style of this.getComputedStyles()) { - const value = style.getPropertyValue(property); - if (value !== '') { - return value; - } - } - return ''; - } - getPropertyValue(property) { - if (this.cache.has(property)) { - return this.cache.get(property); - } - let value = this.getPropertyValueFormComputedStyles('--' + property) - .replace(ESCAPE_REGEX, "") - .trim(); - if (value.startsWith('"') && value.endsWith('"')) { - value = value.substring(1, value.length - 1).trim(); - } - this.cache.set(property, value); - return value; - } -} -const Root = new RootClass(); - /* * Copyright 2021 Zindex Software * @@ -1045,7 +1051,7 @@ const Root = new RootClass(); const mixinRepository = new Map(); const MIXIN_ARGS_REGEX = /\${([0-9]+)(?:=([^}]+))?}/g; const defaultMixinHandler = (name, args) => { - return Root.getPropertyValue(name + '--mixin') + return Root.getPropertyValue('--' + name + '--mixin') .replace(MIXIN_ARGS_REGEX, (match, arg, fallback) => args[parseInt(arg)] || fallback || ''); }; mixinRepository.set('space-x', function (_, space, right) { @@ -1303,7 +1309,7 @@ class StyleHandler { } } if (scope) { - const scopeValue = Root.getPropertyValue(scope + '--scope'); + const scopeValue = Root.getPropertyValue('--' + scope + '--scope'); if (scopeValue === '') { return; } diff --git a/dist/assembler.es.js b/dist/assembler.es.js index 113db15..25fdef1 100644 --- a/dist/assembler.es.js +++ b/dist/assembler.es.js @@ -615,6 +615,128 @@ function generateRootVariables(settings) { return ':root{' + vars + '}'; } +/* + * Copyright 2021 Zindex Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const ESCAPE_REGEX = /\\\n/g; +const PROPERTY_REGEX$1 = /^--([a-zA-Z0-9-_]+)--(scope|mixin|register)$/; +class RootClass { + constructor() { + this.cache = new Map(); + this.scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", + "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", + "landscape", "portrait", "motion-reduce", "motion-safe" + ]; + this.registeredProperties = []; + const { cache } = this; + const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; + cache.set("--text-clip--scope", `$selector {${tc}}`); + cache.set("--l1--scope", "$selector > * {$body}"); + cache.set("--l2--scope", "$selector > * > * {$body}"); + cache.set("--sibling--scope", "$selector > * + * {$body}"); + cache.set("--child--scope", "$selector > $class {$body}"); + cache.set("--selection--scope", "$selector::selection {$body}"); + cache.set("--placeholder--scope", "$selector::placeholder {$body}"); + cache.set("--marker--scope", "$selector::marker {$body}"); + cache.set("--marker-l1--scope", "$selector > *::marker {$body}"); + cache.set("--before--scope", "$selector::before {$body}"); + cache.set("--after--scope", "$selector::after {$body}"); + cache.set("--even--scope", "$selector:nth-child(even) {$body}"); + cache.set("--odd--scope", "$selector:nth-child(odd) {$body}"); + cache.set("--first--scope", "$selector:first-child {$body}"); + cache.set("--last--scope", "$selector:last-child {$body}"); + cache.set("--first-letter--scope", "$selector::first-letter {$body}"); + cache.set("--first-line--scope", "$selector::first-line {$body}"); + cache.set("--dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); + cache.set("--light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); + cache.set("--landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); + cache.set("--portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); + cache.set("--motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); + cache.set("--motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); + this.initialize(); + } + initialize() { + const { cache, scopes, registeredProperties } = this; + for (const style of this.getComputedStyles()) { + for (const property of style) { + const match = PROPERTY_REGEX$1.exec(property); + if (match == null) { + continue; + } + const name = match[1]; + const value = this.getValue(style, property); + cache.set(property, value); + switch (match[2]) { + case "scope": + if (scopes.indexOf(name) === -1) { + scopes.push(name); + } + break; + case "register": + if (value === 'true' || value === '') { + registeredProperties.push({ name, aliases: [] }); + } + else { + const aliases = value.split(',').map(v => v.trim()).filter(v => v !== ''); + registeredProperties.push({ name, aliases }); + } + break; + } + } + } + } + getComputedStyles() { + const styles = []; + for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { + const styleSheet = document.styleSheets[si]; + if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { + continue; + } + if (styleSheet.href === null && styleSheet.ownerNode !== null + && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { + continue; + } + const rule = styleSheet.cssRules[0]; + if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { + styles.push(rule.style); + } + } + return styles; + } + getValue(style, property) { + let value = style.getPropertyValue(property).replace(ESCAPE_REGEX, "").trim(); + if (value.startsWith('"') && value.endsWith('"')) { + value = value.substring(1, value.length - 1).trim(); + } + return value; + } + getRegisteredScopes() { + return this.scopes; + } + getRegisteredProperties() { + return this.registeredProperties; + } + getPropertyValue(property) { + if (this.cache.has(property)) { + return this.cache.get(property); + } + return ''; + } +} +const Root = new RootClass(); + /* * Copyright 2021 Zindex Software * @@ -642,17 +764,8 @@ function getUserSettings(dataset) { const selectorAttribute = dataset.selectorAttribute === undefined ? 'class' : dataset.selectorAttribute; const cache = dataset.cache === undefined ? null : dataset.cache; const cacheKey = dataset.cacheKey === undefined ? "assembler-css-cache" : dataset.cacheKey; - const dataScopes = dataset.scopes === undefined ? [] : getStringItemList(dataset.scopes); - const registeredProperties = dataset.registerProperties === undefined ? [] : getRegisteredProperties(dataset.registerProperties); - const scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", - "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", - "landscape", "portrait", "motion-reduce", "motion-safe"]; - for (let i = 0, l = dataScopes.length; i < l; i++) { - const scope = dataScopes[i]; - if (scopes.indexOf(scope) < 0) { - scopes.push(scope); - } - } + const registeredProperties = Root.getRegisteredProperties(); + const scopes = Root.getRegisteredScopes(); for (let i = 0, l = registeredProperties.length; i < l; i++) { const prop = registeredProperties[i]; if (PROPERTY_LIST.indexOf(prop.name) === -1) { @@ -730,22 +843,6 @@ function getStringItemList(value, unique = true) { .filter(nonEmptyString); return unique ? items.filter(uniqueItems) : items; } -function getRegisteredProperties(value) { - return value - .split(';') - .map(v => v.trim()) - .filter(v => v !== '') - .map(v => { - const index = v.indexOf(':'); - if (index < 0) { - return { name: v, aliases: [] }; - } - return { - name: v.substr(0, index), - aliases: v.substr(index + 1).split(',').map(v => v.trim()).filter(v => v !== '') - }; - }); -} function trim(value) { return value.trim(); } @@ -932,97 +1029,6 @@ function observe(element, handler) { } } -/* - * Copyright 2021 Zindex Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const ESCAPE_REGEX = /\\\n/g; -class RootClass { - constructor() { - this.styles = null; - this.cache = new Map(); - const { cache } = this; - const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; - cache.set("text-clip--scope", `$selector {${tc}}`); - cache.set("l1--scope", "$selector > * {$body}"); - cache.set("l2--scope", "$selector > * > * {$body}"); - cache.set("sibling--scope", "$selector > * + * {$body}"); - cache.set("child--scope", "$selector > $class {$body}"); - cache.set("selection--scope", "$selector::selection {$body}"); - cache.set("placeholder--scope", "$selector::placeholder {$body}"); - cache.set("marker--scope", "$selector::marker {$body}"); - cache.set("marker-l1--scope", "$selector > *::marker {$body}"); - cache.set("before--scope", "$selector::before {$body}"); - cache.set("after--scope", "$selector::after {$body}"); - cache.set("even--scope", "$selector:nth-child(even) {$body}"); - cache.set("odd--scope", "$selector:nth-child(odd) {$body}"); - cache.set("first--scope", "$selector:first-child {$body}"); - cache.set("last--scope", "$selector:last-child {$body}"); - cache.set("first-letter--scope", "$selector::first-letter {$body}"); - cache.set("first-line--scope", "$selector::first-line {$body}"); - cache.set("dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); - cache.set("light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); - cache.set("landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); - cache.set("portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); - cache.set("motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); - cache.set("motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); - } - getComputedStyles() { - if (this.styles === null) { - this.styles = []; - for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { - const styleSheet = document.styleSheets[si]; - if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { - continue; - } - if (styleSheet.href === null && styleSheet.ownerNode !== null - && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { - continue; - } - const rule = styleSheet.cssRules[0]; - if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { - this.styles.unshift(rule.style); - } - } - } - return this.styles; - } - getPropertyValueFormComputedStyles(property) { - for (const style of this.getComputedStyles()) { - const value = style.getPropertyValue(property); - if (value !== '') { - return value; - } - } - return ''; - } - getPropertyValue(property) { - if (this.cache.has(property)) { - return this.cache.get(property); - } - let value = this.getPropertyValueFormComputedStyles('--' + property) - .replace(ESCAPE_REGEX, "") - .trim(); - if (value.startsWith('"') && value.endsWith('"')) { - value = value.substring(1, value.length - 1).trim(); - } - this.cache.set(property, value); - return value; - } -} -const Root = new RootClass(); - /* * Copyright 2021 Zindex Software * @@ -1041,7 +1047,7 @@ const Root = new RootClass(); const mixinRepository = new Map(); const MIXIN_ARGS_REGEX = /\${([0-9]+)(?:=([^}]+))?}/g; const defaultMixinHandler = (name, args) => { - return Root.getPropertyValue(name + '--mixin') + return Root.getPropertyValue('--' + name + '--mixin') .replace(MIXIN_ARGS_REGEX, (match, arg, fallback) => args[parseInt(arg)] || fallback || ''); }; mixinRepository.set('space-x', function (_, space, right) { @@ -1299,7 +1305,7 @@ class StyleHandler { } } if (scope) { - const scopeValue = Root.getPropertyValue(scope + '--scope'); + const scopeValue = Root.getPropertyValue('--' + scope + '--scope'); if (scopeValue === '') { return; } diff --git a/dist/assembler.js b/dist/assembler.js index 89d3421..e1f2a66 100644 --- a/dist/assembler.js +++ b/dist/assembler.js @@ -621,6 +621,128 @@ return ':root{' + vars + '}'; } + /* + * Copyright 2021 Zindex Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + const ESCAPE_REGEX = /\\\n/g; + const PROPERTY_REGEX$1 = /^--([a-zA-Z0-9-_]+)--(scope|mixin|register)$/; + class RootClass { + constructor() { + this.cache = new Map(); + this.scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", + "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", + "landscape", "portrait", "motion-reduce", "motion-safe" + ]; + this.registeredProperties = []; + const { cache } = this; + const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; + cache.set("--text-clip--scope", `$selector {${tc}}`); + cache.set("--l1--scope", "$selector > * {$body}"); + cache.set("--l2--scope", "$selector > * > * {$body}"); + cache.set("--sibling--scope", "$selector > * + * {$body}"); + cache.set("--child--scope", "$selector > $class {$body}"); + cache.set("--selection--scope", "$selector::selection {$body}"); + cache.set("--placeholder--scope", "$selector::placeholder {$body}"); + cache.set("--marker--scope", "$selector::marker {$body}"); + cache.set("--marker-l1--scope", "$selector > *::marker {$body}"); + cache.set("--before--scope", "$selector::before {$body}"); + cache.set("--after--scope", "$selector::after {$body}"); + cache.set("--even--scope", "$selector:nth-child(even) {$body}"); + cache.set("--odd--scope", "$selector:nth-child(odd) {$body}"); + cache.set("--first--scope", "$selector:first-child {$body}"); + cache.set("--last--scope", "$selector:last-child {$body}"); + cache.set("--first-letter--scope", "$selector::first-letter {$body}"); + cache.set("--first-line--scope", "$selector::first-line {$body}"); + cache.set("--dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); + cache.set("--light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); + cache.set("--landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); + cache.set("--portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); + cache.set("--motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); + cache.set("--motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); + this.initialize(); + } + initialize() { + const { cache, scopes, registeredProperties } = this; + for (const style of this.getComputedStyles()) { + for (const property of style) { + const match = PROPERTY_REGEX$1.exec(property); + if (match == null) { + continue; + } + const name = match[1]; + const value = this.getValue(style, property); + cache.set(property, value); + switch (match[2]) { + case "scope": + if (scopes.indexOf(name) === -1) { + scopes.push(name); + } + break; + case "register": + if (value === 'true' || value === '') { + registeredProperties.push({ name, aliases: [] }); + } + else { + const aliases = value.split(',').map(v => v.trim()).filter(v => v !== ''); + registeredProperties.push({ name, aliases }); + } + break; + } + } + } + } + getComputedStyles() { + const styles = []; + for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { + const styleSheet = document.styleSheets[si]; + if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { + continue; + } + if (styleSheet.href === null && styleSheet.ownerNode !== null + && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { + continue; + } + const rule = styleSheet.cssRules[0]; + if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { + styles.push(rule.style); + } + } + return styles; + } + getValue(style, property) { + let value = style.getPropertyValue(property).replace(ESCAPE_REGEX, "").trim(); + if (value.startsWith('"') && value.endsWith('"')) { + value = value.substring(1, value.length - 1).trim(); + } + return value; + } + getRegisteredScopes() { + return this.scopes; + } + getRegisteredProperties() { + return this.registeredProperties; + } + getPropertyValue(property) { + if (this.cache.has(property)) { + return this.cache.get(property); + } + return ''; + } + } + const Root = new RootClass(); + /* * Copyright 2021 Zindex Software * @@ -648,17 +770,8 @@ const selectorAttribute = dataset.selectorAttribute === undefined ? 'class' : dataset.selectorAttribute; const cache = dataset.cache === undefined ? null : dataset.cache; const cacheKey = dataset.cacheKey === undefined ? "assembler-css-cache" : dataset.cacheKey; - const dataScopes = dataset.scopes === undefined ? [] : getStringItemList(dataset.scopes); - const registeredProperties = dataset.registerProperties === undefined ? [] : getRegisteredProperties(dataset.registerProperties); - const scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", - "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", - "landscape", "portrait", "motion-reduce", "motion-safe"]; - for (let i = 0, l = dataScopes.length; i < l; i++) { - const scope = dataScopes[i]; - if (scopes.indexOf(scope) < 0) { - scopes.push(scope); - } - } + const registeredProperties = Root.getRegisteredProperties(); + const scopes = Root.getRegisteredScopes(); for (let i = 0, l = registeredProperties.length; i < l; i++) { const prop = registeredProperties[i]; if (PROPERTY_LIST.indexOf(prop.name) === -1) { @@ -736,22 +849,6 @@ .filter(nonEmptyString); return unique ? items.filter(uniqueItems) : items; } - function getRegisteredProperties(value) { - return value - .split(';') - .map(v => v.trim()) - .filter(v => v !== '') - .map(v => { - const index = v.indexOf(':'); - if (index < 0) { - return { name: v, aliases: [] }; - } - return { - name: v.substr(0, index), - aliases: v.substr(index + 1).split(',').map(v => v.trim()).filter(v => v !== '') - }; - }); - } function trim(value) { return value.trim(); } @@ -938,97 +1035,6 @@ } } - /* - * Copyright 2021 Zindex Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - const ESCAPE_REGEX = /\\\n/g; - class RootClass { - constructor() { - this.styles = null; - this.cache = new Map(); - const { cache } = this; - const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; - cache.set("text-clip--scope", `$selector {${tc}}`); - cache.set("l1--scope", "$selector > * {$body}"); - cache.set("l2--scope", "$selector > * > * {$body}"); - cache.set("sibling--scope", "$selector > * + * {$body}"); - cache.set("child--scope", "$selector > $class {$body}"); - cache.set("selection--scope", "$selector::selection {$body}"); - cache.set("placeholder--scope", "$selector::placeholder {$body}"); - cache.set("marker--scope", "$selector::marker {$body}"); - cache.set("marker-l1--scope", "$selector > *::marker {$body}"); - cache.set("before--scope", "$selector::before {$body}"); - cache.set("after--scope", "$selector::after {$body}"); - cache.set("even--scope", "$selector:nth-child(even) {$body}"); - cache.set("odd--scope", "$selector:nth-child(odd) {$body}"); - cache.set("first--scope", "$selector:first-child {$body}"); - cache.set("last--scope", "$selector:last-child {$body}"); - cache.set("first-letter--scope", "$selector::first-letter {$body}"); - cache.set("first-line--scope", "$selector::first-line {$body}"); - cache.set("dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); - cache.set("light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); - cache.set("landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); - cache.set("portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); - cache.set("motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); - cache.set("motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); - } - getComputedStyles() { - if (this.styles === null) { - this.styles = []; - for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { - const styleSheet = document.styleSheets[si]; - if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { - continue; - } - if (styleSheet.href === null && styleSheet.ownerNode !== null - && styleSheet.ownerNode instanceof Element && styleSheet.ownerNode.id === 'opis-assembler-css') { - continue; - } - const rule = styleSheet.cssRules[0]; - if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === ':root') { - this.styles.unshift(rule.style); - } - } - } - return this.styles; - } - getPropertyValueFormComputedStyles(property) { - for (const style of this.getComputedStyles()) { - const value = style.getPropertyValue(property); - if (value !== '') { - return value; - } - } - return ''; - } - getPropertyValue(property) { - if (this.cache.has(property)) { - return this.cache.get(property); - } - let value = this.getPropertyValueFormComputedStyles('--' + property) - .replace(ESCAPE_REGEX, "") - .trim(); - if (value.startsWith('"') && value.endsWith('"')) { - value = value.substring(1, value.length - 1).trim(); - } - this.cache.set(property, value); - return value; - } - } - const Root = new RootClass(); - /* * Copyright 2021 Zindex Software * @@ -1047,7 +1053,7 @@ const mixinRepository = new Map(); const MIXIN_ARGS_REGEX = /\${([0-9]+)(?:=([^}]+))?}/g; const defaultMixinHandler = (name, args) => { - return Root.getPropertyValue(name + '--mixin') + return Root.getPropertyValue('--' + name + '--mixin') .replace(MIXIN_ARGS_REGEX, (match, arg, fallback) => args[parseInt(arg)] || fallback || ''); }; mixinRepository.set('space-x', function (_, space, right) { @@ -1305,7 +1311,7 @@ } } if (scope) { - const scopeValue = Root.getPropertyValue(scope + '--scope'); + const scopeValue = Root.getPropertyValue('--' + scope + '--scope'); if (scopeValue === '') { return; } diff --git a/dist/assembler.min.js b/dist/assembler.min.js index 5d41e3b..47ee7a0 100644 --- a/dist/assembler.min.js +++ b/dist/assembler.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).AssemblerCSS={})}(this,(function(e){"use strict";const t=/^[0-9]+(\.5)?$/,r=/^-?[0-9]+(\.5)?$/,o=/^(xs|sm|base|lg|([2-9])?xl)$/,i=/^(none|tight|snug|normal|relaxed|loose)$/,s=/^[0-9]|1[0-9]|2[0-4]$/,n=/^[1-6]$/,a=/^(tighter|tight|normal|wide|wider|widest)$/,l=/^(xs|sm|md|lg|xl|pill)$/,p=/^(first|last|none)$/,c=["align-content","align-items","align-self","animation","appearance","backdrop-filter","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-position","background-repeat","background-size","backface-visibility","border","border-bottom","border-bottom-color","border-bottom-style","border-bottom-width","border-bottom-left-radius","border-bottom-right-radius","border-collapse","border-color","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-style","border-top","border-top-color","border-top-style","border-top-width","border-top-left-radius","border-top-right-radius","border-width","bottom","box-orient","box-shadow","box-sizing","clear","clip","clip-path","color","column-gap","content","cursor","display","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font-family","font-size","font-style","font-weight","font-variant-numeric","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","height","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-clamp","line-height","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-height","max-width","min-height","min-width","object-fit","object-position","opacity","order","outline","outline-offset","overflow","overflow-wrap","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-x","overscroll-behavior-y","padding","padding-bottom","padding-left","padding-right","padding-top","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","resize","right","row-gap","table-layout","text-align","text-decoration","text-decoration-style","text-fill-color","text-overflow","text-shadow","text-transform","top","transform","transform-box","transform-origin","transform-style","transition","user-select","vertical-align","visibility","white-space","width","word-break","z-index"],d={animation:["-webkit-animation"],appearance:["-webkit-appearance","-moz-appearance"],"background-clip":["-webkit-background-clip","-moz-background-clip"],"backdrop-filter":["-webkit-backdrop-filter"],"box-orient":["-webkit-box-orient"],"column-gap":["-moz-column-gap"],"line-clamp":["-webkit-line-clamp"],"user-select":["-webkit-user-select","-moz-user-select"],"text-fill-color":["-webkit-text-fill-color","-moz-text-fill-color"]},x=["normal","link","visited","empty","placeholder-shown","default","checked","indeterminate","valid","invalid","required","optional","out-of-range","in-range","hover","focus","focus-within","focus-visible","active","read-only","read-write","disabled","enabled"],m={backdrop:"backdrop-filter",bg:"background","bg-attachment":"background-attachment","bg-blend":"background-blend-mode","bg-clip":"background-clip","bg-color":"background-color","bg-image":"background-image","bg-position":"background-position","bg-repeat":"background-repeat","bg-size":"background-size",radius:"border-radius","radius-top":["border-top-left-radius","border-top-right-radius"],"radius-bottom":["border-bottom-left-radius","border-bottom-right-radius"],"radius-left":["border-bottom-left-radius","border-top-left-radius"],"radius-right":["border-bottom-right-radius","border-top-right-radius"],"radius-bl":"border-bottom-left-radius","radius-br":"border-bottom-right-radius","radius-tl":"border-top-left-radius","radius-tr":"border-top-right-radius",b:"border",bc:"border-color",bs:"border-style",bw:"border-width",bt:"border-top",bl:"border-left",br:"border-right",bb:"border-bottom","bt-color":"border-top-color","bt-style":"border-top-style","bt-width":"border-top-width","bl-color":"border-left-color","bl-style":"border-left-style","bl-width":"border-left-width","br-color":"border-right-color","br-style":"border-right-style","br-width":"border-right-width","bb-color":"border-bottom-color","bb-style":"border-bottom-style","bb-width":"border-bottom-width",m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mx:["margin-left","margin-right"],my:["margin-top","margin-bottom"],p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",px:["padding-left","padding-right"],py:["padding-top","padding-bottom"],"min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height",w:"width",h:"height",img:"background-image",gradient:"background-image","radial-gradient":"background-image","conic-gradient":"background-image","flex-dir":"flex-direction","col-reverse":"flex-direction","row-reverse":"flex-direction","grid-rows":"grid-template-rows","grid-flow":"grid-auto-flow","row-start":"grid-row-start","row-span":"grid-row-end","grid-cols":"grid-template-columns","col-start":"grid-column-start","col-span":"grid-column-end","col-gap":"column-gap","auto-cols":"grid-auto-columns","auto-rows":"grid-auto-rows",e:"box-shadow",shadow:"box-shadow",overscroll:"overscroll-behavior","overscroll-x":"overscroll-behavior-x","overscroll-y":"overscroll-behavior-y",inset:["top","bottom","left","right"],"inset-x":["left","right"],"inset-y":["top","bottom"],z:"z-index",decoration:"text-decoration","v-align":"vertical-align",ws:"white-space",ring:"box-shadow",leading:"line-height",tracking:"letter-spacing",break:e=>"words"===e?["overflow-wrap"]:"all"===e?["word-break"]:["overflow-wrap","word-break"],truncate:["overflow","text-overflow","white-space"],flex:e=>e?"flex":"display","inline-flex":"display",grid:"display","inline-grid":"display",hidden:"display",block:"display","inline-block":"display",static:"position",fixed:"position",absolute:"position",relative:"position",sticky:"position",visible:"visibility",invisible:"visibility","flex-row":"flex-direction","flex-col":"flex-direction",list:e=>"inside"===e||"outside"===e?"list-style-position":"list-style-type",text:e=>o.test(e)?["font-size","line-height"]:"font-size",uppercase:"text-transform",lowercase:"text-transform",capitalize:"text-transform","normal-case":"text-transform",variant:"font-variant-numeric"},u={border:["1px solid transparent"],truncate:["hidden","ellipsis","nowrap"],flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",hidden:"none",block:"block","inline-block":"inline-block",static:"static",fixed:"fixed",absolute:"absolute",relative:"relative",sticky:"sticky",visible:"visible",invisible:"hidden","flex-row":"row","flex-col":"column","flex-wrap":"wrap","flex-grow":"1","flex-shrink":"1","col-reverse":"column-reverse","row-reverse":"row-reverse",uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize","normal-case":"none",radius:"sm",shadow:"1"},b=e=>r.test(e)?`calc(${e} * @unit-size)`:e,g=e=>t.test(e)?`calc(${e} * @unit-size)`:e,h=e=>`repeat(${e}, minmax(0, 1fr))`,f=e=>`span ${e}`,y=e=>l.test(e)?"@border-radius-"+e:e,w={img:e=>`url(${e})`,gradient:e=>`linear-gradient(${e})`,"radial-gradient":e=>`radial-gradient(${e})`,"conic-gradient":e=>`conic-gradient(${e})`,"grid-rows":h,"row-span":f,"grid-cols":h,"col-span":f,e:e=>s.test(e)?`@elevation-${e}`:e,shadow:e=>n.test(e)?`@shadow-${e}`:e,ring:e=>`0 0 0 ${e}`,"font-size":e=>o.test(e)?"@font-size-"+e:e,leading:e=>t.test(e)?`calc(${e} * @unit-size)`:i.test(e)?"@line-height-"+e:e,tracking:e=>a.test(e)?"@letter-spacing-"+e:e,text:e=>o.test(e)?["@font-size-"+e,"@font-size-leading-"+e]:e,radius:y,"radius-top":y,"radius-left":y,"radius-bottom":y,"radius-right":y,"radius-tl":y,"radius-bl":y,"radius-tr":y,"radius-br":y,"border-radius":y,break:e=>"all"===e?"break-all":"words"===e?"break-word":["normal","normal"],"flex-wrap":e=>"reverse"===e?"wrap-reverse":e,"flex-row":e=>"reverse"===e?"row-reverse":e,"flex-col":e=>"reverse"===e?"column-reverse":e,order:e=>p.test(e)?"first"===e?"-9999":"last"===e?"9999":"0":e,padding:g,"padding-top":g,"padding-bottom":g,"padding-left":g,"padding-right":g,p:g,pt:g,pb:g,pl:g,pr:g,px:g,py:g,margin:b,"margin-top":b,"margin-bottom":b,"margin-left":b,"margin-right":b,m:b,mt:b,mb:b,ml:b,mr:b,mx:b,my:b,w:g,h:g,width:g,height:g,"min-w":g,"max-w":g,"min-h":g,"max-h":g,"min-width":g,"max-width":g,"min-height":g,"max-height":g},v=["0px 0px 0px 0px","0px 2px 1px -1px","0px 3px 1px -2px","0px 3px 3px -2px","0px 2px 4px -1px","0px 3px 5px -1px","0px 3px 5px -1px","0px 4px 5px -2px","0px 5px 5px -3px","0px 5px 6px -3px","0px 6px 6px -3px","0px 6px 7px -4px","0px 7px 8px -4px","0px 7px 8px -4px","0px 7px 9px -4px","0px 8px 9px -5px","0px 8px 10px -5px","0px 8px 11px -5px","0px 9px 11px -5px","0px 9px 12px -6px","0px 10px 13px -6px","0px 10px 13px -6px","0px 10px 14px -6px","0px 11px 14px -7px","0px 11px 15px -7px"],k=["0px 0px 0px 0px","0px 1px 1px 0px","0px 2px 2px 0px","0px 3px 4px 0px","0px 4px 5px 0px","0px 5px 8px 0px","0px 6px 10px 0px","0px 7px 10px 1px","0px 8px 10px 1px","0px 9px 12px 1px","0px 10px 14px 1px","0px 11px 15px 1px","0px 12px 17px 2px","0px 13px 19px 2px","0px 14px 21px 2px","0px 15px 22px 2px","0px 16px 24px 2px","0px 17px 26px 2px","0px 18px 28px 2px","0px 19px 29px 2px","0px 20px 31px 3px","0px 21px 33px 3px","0px 22px 35px 3px","0px 23px 36px 3px","0px 24px 38px 3px"],$=["0px 0px 0px 0px","0px 1px 3px 0px","0px 1px 5px 0px","0px 1px 8px 0px","0px 1px 10px 0px","0px 1px 14px 0px","0px 1px 18px 0px","0px 2px 16px 1px","0px 3px 14px 2px","0px 3px 16px 2px","0px 4px 18px 3px","0px 4px 20px 3px","0px 5px 22px 4px","0px 5px 24px 4px","0px 5px 26px 4px","0px 6px 28px 5px","0px 6px 30px 5px","0px 6px 32px 5px","0px 7px 34px 6px","0px 7px 36px 6px","0px 8px 38px 7px","0px 8px 40px 7px","0px 8px 42px 7px","0px 9px 44px 8px","0px 9px 46px 8px"],S={none:"0",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",pill:"9999px"},z={tighter:"-0.05rem",tight:"-0.025rem",normal:"0",wide:"0.025rem",wider:"0.05rem",widest:"0.1rem"},A={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},O={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},j={xs:"1rem",sm:"1.25rem",base:"1.5rem",lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.25rem","4xl":"2.5rem","5xl":"1","6xl":"1","7xl":"1","8xl":"1","9xl":"1"},P={"sans-serif":"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol",serif:"Georgia, Cambria, Times New Roman, Times, serif",monospace:"Lucida Console, Monaco, monospace"},C=["0px 2px 4px 0px hsla(0, 0%, 20%, 0.1), 0px 6px 6px -8px hsla(0, 0%, 0%, 15%)","0px 2px 8px -1px hsla(0, 0%, 20%, 0.1), 0px 16px 16px -12px hsla(0, 0%, 0%, 15%)","0px 2px 16px -2px hsla(0, 0%, 20%, 0.1), 0px 22px 18px -16px hsla(0, 0%, 0%, 15%)","0px 2px 20px -3px hsla(0, 0%, 20%, 0.1), 0px 28px 22px -18px hsla(0, 0%, 0%, 15%)","0px 2px 32px -2px hsla(0, 0%, 20%, 0.1), 0px 32px 26px -18px hsla(0, 0%, 0%, 15%)","0px 2px 36px -1px hsla(0, 0%, 20%, 0.1), 0px 42px 34px -24px hsla(0, 0%, 0%, 15%)"];function I(e){let t="--elevation-umbra: rgba(0, 0, 0, .2);--elevation-penumbra: rgba(0, 0, 0, .14);--elevation-ambient: rgba(0, 0, 0, .12);";for(let e=0;e<25;e++)t+=`--elevation-${e}:${v[e]} var(--elevation-umbra), ${k[e]} var(--elevation-penumbra), ${$[e]} var(--elevation-ambient);`;for(let e=0;e<6;e++)t+=`--shadow-${e+1}:${C[e]};`;for(const[e,r]of Object.entries(S))t+=`--border-radius-${e}:${r};`;for(const[e,r]of Object.entries(z))t+=`--letter-spacing-${e}:${r};`;for(const[e,r]of Object.entries(A))t+=`--line-height-${e}:${r};`;for(const[e,r]of Object.entries(P))t+=`--${e}:${r};`;for(const[e,r]of Object.entries(O))t+=`--font-size-${e}:${r};`;for(const[e,r]of Object.entries(j))t+=`--font-size-leading-${e}:${r};`;for(const r of e.breakpoints)"all"!==r&&(t+=`--breakpoint-${r}: ${e.media[r]};`);return t+="--unit-size:0.25rem;",":root{"+t+"}"}const R=/([a-z0-9]|(?=[A-Z]))([A-Z])/g,M="--asm-",E=/^(?:(?[a-z]{2})\|)?(?:(?[-a-zA-Z0-9]+)!)?(?[-a-z]+)(?:\.(?[-a-z]+))?$/m;function F(e){if("string"==typeof e)return e.trim();if(Array.isArray(e))return e.map(F).join(";");const t=[];for(const r in e){const o=e[r];if(void 0===o)continue;const i=r.replace(R,"$1-$2").toLowerCase();t.push(null===o?i:i+":"+o)}return t.join(";")}function K(e,t=!0){const r=e.replace(/[,;]/g," ").split(/\s\s*/g).map(L).filter(N);return t?r.filter(_):r}function L(e){return e.trim()}function N(e){return""!==e}function _(e,t,r){return r.indexOf(e)===t}function T(e){if(e.cache){const t=localStorage.getItem(e.cacheKey+":"+e.cache);if(null!==t){const e=JSON.parse(t);return e.tracker=new Set(e.tracker),e}const r=localStorage.getItem(e.cacheKey);null!==r&&localStorage.removeItem(e.cacheKey+":"+r),localStorage.setItem(e.cacheKey,e.cache)}else{const t=localStorage.getItem(e.cacheKey);null!==t&&(localStorage.removeItem(e.cacheKey+":"+t),localStorage.removeItem(e.cacheKey))}const t=x.length,r=[],o=e.breakpoints,i=e.media,s=e.desktopFirst,n=e.states,a=new Set,l=e.selectorAttribute,p="class"===l?".asm\\#":"["+l+'~="'+"asm#",m="class"===l?"":'"]';r.push(I(e));for(let e=0,l=o.length;e0?l+"--":"")+o+(n>0?"__"+i[n]:"");a.add(c);let g=d[o],h="";if(g)for(let e=0,t=g.length;e0?":"+s:""}{${h}${o}:var(${b}) !important}`}}0!==e&&(u+="}"),r.push(u)}const u={content:r.join(""),tracker:a};return e.cache&&(localStorage.setItem(e.cacheKey,e.cache),localStorage.setItem(e.cacheKey+":"+e.cache,JSON.stringify({content:u.content,tracker:[...a]}))),u}let V=null,U=null,W=null;const Z=new WeakMap;function H(e,t){if(Z.has(e))return;const r=e.attributes.getNamedItem(t.userSettings.xStyleAttribute);Z.set(e,r?t.handleStyleChange(e,r.value,[]):[]),function(e,t){null===U&&(U=new MutationObserver((function(e){for(const r of e){const e=r.target;Z.set(e,t.handleStyleChange(e,e.getAttribute(r.attributeName),Z.get(e)))}}))),U.observe(e,{attributes:!0,attributeOldValue:!0,childList:!0,attributeFilter:[t.userSettings.xStyleAttribute]})}(e,t);for(let r=e.firstElementChild;null!=r;r=r.nextElementSibling)H(r,t)}const B=/\\\n/g;const J=new class{constructor(){this.styles=null,this.cache=new Map;const{cache:e}=this;e.set("text-clip--scope","$selector {-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;}"),e.set("l1--scope","$selector > * {$body}"),e.set("l2--scope","$selector > * > * {$body}"),e.set("sibling--scope","$selector > * + * {$body}"),e.set("child--scope","$selector > $class {$body}"),e.set("selection--scope","$selector::selection {$body}"),e.set("placeholder--scope","$selector::placeholder {$body}"),e.set("marker--scope","$selector::marker {$body}"),e.set("marker-l1--scope","$selector > *::marker {$body}"),e.set("before--scope","$selector::before {$body}"),e.set("after--scope","$selector::after {$body}"),e.set("even--scope","$selector:nth-child(even) {$body}"),e.set("odd--scope","$selector:nth-child(odd) {$body}"),e.set("first--scope","$selector:first-child {$body}"),e.set("last--scope","$selector:last-child {$body}"),e.set("first-letter--scope","$selector::first-letter {$body}"),e.set("first-line--scope","$selector::first-line {$body}"),e.set("dark--scope","@media(prefers-color-scheme: dark) {$selector {$body}}"),e.set("light--scope","@media(prefers-color-scheme: light) {$selector {$body}}"),e.set("landscape--scope","@media(orientation: landscape) {$selector {$body}}"),e.set("portrait--scope","@media(orientation: portrait) {$selector {$body}}"),e.set("motion-reduce--scope","@media(prefers-reduced-motion: reduce) {$selector {$body}}"),e.set("motion-safe--scope","@media(prefers-reduced-motion: no-preference) {$selector {$body}}")}getComputedStyles(){if(null===this.styles){this.styles=[];for(let e=0,t=document.styleSheets.length;eJ.getPropertyValue(e+"--mixin").replace(q,((e,r,o)=>t[parseInt(r)]||o||"")))(t,r))}X.set("space-x",(function(e,t,r){return"true"===r?`sibling!mr:${t||"0"}`:`sibling!ml:${t||"0"}`})),X.set("space-y",(function(e,t,r){return"true"===r?`sibling!mb:${t||"0"}`:`sibling!mt:${t||"0"}`})),X.set("grid",(function(){return"grid; l1!wb:break-all; l2!max-w:100%; child!justify-self:normal; child!align-self:normal"})),X.set("stack",(function(){return'grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); \n grid-template-areas:"stackarea"; l1!grid-area:stackarea; l1!z:0; w:100%; h:100%'})),X.set("sr-only",(function(){return"absolute; w:1px; h:1px; p:0; m:-1px; bw:0; overflow:hidden; clip:rect(0, 0, 0, 0); left:-9999px"})),X.set("container",(function(e){return e.desktopFirst?"px: 1rem; mx:auto; max-w:@breakpoint-lg; lg|max-w:@breakpoint-md; md|max-w:@breakpoint-sm; sm|max-w:@breakpoint-xs; xs|max-w:100%":"px: 1rem; mx:auto; max-w:100%; sm|max-w:@breakpoint-sm; md|max-w:@breakpoint-md; lg|max-w:@breakpoint-lg; xl|max-w:@breakpoint-xl"}));const Y=/@([a-zA-Z0-9\-_]+)/g,D=/\$(selector|body|class|value|property|state|variants|var)/g,Q=/;/,ee=/\s*,\s*(?![^(]*\))/gm;class te{constructor(e,t,r){this.style=t,this.settings=e,this.tracker=r,this.mediaSettings=e.media,this.desktopFirst=e.desktopFirst,this.breakpoints=e.breakpoints,this.rules=[],this.padding=t.cssRules.length,this.selectorAttribute=e.selectorAttribute}get userSettings(){return this.settings}handleStyleChange(e,t,r){if(null===t)return this.handleStyleRemoved(e,r);const o=this.getStyleEntries(t),i=e.hasAttribute(this.selectorAttribute)?e.getAttribute(this.selectorAttribute).split(" "):[],s=[];for(const{n:t,p:s,e:n}of r)if(!o.has(t)){const t=i.indexOf(n);t>=0&&i.splice(t,1),e.style.removeProperty(s)}for(const t of o.values()){const{entry:r,property:o,hash:n,value:a,name:l}=t;i.indexOf(r)<0&&i.push(r),this.tracker.has(n)||this.generateCSS(t),e.style.setProperty(o,a),s.push({e:r,n:l,p:o})}return e.setAttribute(this.selectorAttribute,i.join(" ")),s}handleStyleRemoved(e,t){const r=e.hasAttribute(this.selectorAttribute)?e.getAttribute(this.selectorAttribute).split(" "):[];for(const{p:o,e:i}of t){const t=r.indexOf(i);t>=0&&r.splice(t,1),e.style.removeProperty(o)}return e.setAttribute(this.selectorAttribute,r.join(" ")),[]}extract(e,t=null){var r;const o=null===(r=E.exec(e))||void 0===r?void 0:r.groups;if(!o||!o.property)return[];const i=this.breakpoints.indexOf(o.media||"all"),s=x.indexOf(o.state||"normal");if(i<0||s<0)return[];let n=o.property;const a=n,l=this.settings.scopes;m.hasOwnProperty(n)&&(n=m[n],"function"==typeof n&&(n=n(t))),Array.isArray(n)||(n=[n]),null===t&&(t=u[a]||""),w.hasOwnProperty(a)&&(t=w[a](t,a,i,s)),t=Array.isArray(t)?t.map((e=>e.replace(Y,"var(--$1)"))):Array(n.length).fill(t.replace(Y,"var(--$1)"));const p=[],d=x.length;let b=-1;for(const e of n){b++;const r=c.indexOf(e);if(r<0)continue;const n=o.scope||"",a=(r*d+i)*d+s,x=a.toString(16)+(n?`-${n}`:""),m=1e5*l.indexOf(n),u=(o.media?o.media+"--":"")+(n?n+"__":"")+e+(o.state?"__"+o.state:"");p.push({name:(o.media?o.media+"|":"")+(n?n+"!":"")+e+(o.state?"."+o.state:""),property:M+u,entry:"asm#"+x,value:t[b],media:o.media||"",state:o.state||"",cssProperty:e,hash:x,scope:n,rank:m<0?-1:a+m})}return p}getStyleEntries(e){const t=new Map;for(let r of this.getResolvedProperties(e)){let e=null;const o=r.indexOf(":");o>=0&&(e=r.substr(o+1),r=r.substr(0,o).trim());for(const o of this.extract(r,e))t.set(o.name,o)}return t}getResolvedProperties(e,t=[]){const r=[];for(let o of e.split(Q))if(o=o.trim(),""!==o)if(o.startsWith("^")){const e=o.indexOf(":");let i,s;if(e<0?(i=o.substr(1),s=[]):(i=o.substr(1,e-1),s=o.substr(e+1).split(ee).map(L)),t.indexOf(i)>=0)throw t.push(i),new Error("Recursive mixin detected: "+t.join("->"));t.push(i),r.push(...this.getResolvedProperties(G(this.settings,i,s),t)),t.pop()}else r.push(o);return r}generateCSS(e){const{tracker:t,mediaSettings:r,desktopFirst:o,style:i}=this,{hash:s,media:n,state:a,cssProperty:l,property:p,scope:c,rank:x}=e,m=""!==n,u=this.settings.selectorAttribute,b="class"===u?".asm\\#":"["+u+'~="'+"asm#",g="class"===u?"":'"]';if(t.add(s),x<0)return;let h="";m&&(h+=o?`@media only screen and (max-width: ${r[n]}) {`:`@media only screen and (min-width: ${r[n]}) {`);let f=d[l],y="";if(f)for(let e=0,t=f.length;e{switch(t){case"selector":return`${b+s+g}${a?":"+a:""}`;case"body":return y+l+": var("+p+") !important";case"variants":return y;case"property":return l;case"value":return`var(${p})`;case"class":return b+s+g;case"state":return a?":"+a:"";case"var":return p}return t}))}else h+=`${b+s+g}${a?":"+a:""}{${y}${l}: var(${p}) !important}`;m&&(h+="}");const w=this.getRuleIndex(x);this.rules.splice(w,0,x);try{i.insertRule(h,this.padding+w)}catch(e){this.rules.splice(w,1),console.warn("Unsupported rule:",h)}}getRuleIndex(e){const{rules:t}=this;for(let r=0,o=t.length;re.trim())).filter((e=>""!==e)).map((e=>{const t=e.indexOf(":");return t<0?{name:e,aliases:[]}:{name:e.substr(0,t),aliases:e.substr(t+1).split(",").map((e=>e.trim())).filter((e=>""!==e))}})),x=["","text-clip","selection","placeholder","before","after","first-letter","first-line","l1","l2","marker-l1","marker","sibling","child","even","odd","first","last","dark","light","landscape","portrait","motion-reduce","motion-safe"];for(let e=0,t=l.length;e0&&(d[t.name]=t.aliases))}let m=["xs","sm","md","lg","xl"];i?(m.pop(),m.reverse()):m.shift(),m.unshift("all");const u=void 0===e.states?["normal","hover"]:K(e.states.toLowerCase());return-1===u.indexOf("normal")&&u.unshift("normal"),{enabled:t,generate:r,constructable:o,cache:n,cacheKey:a,desktopFirst:i,scopes:x,states:u,breakpoints:m,media:{xs:e.breakpointXs||"512px",sm:e.breakpointSm||(i?"768px":"512px"),md:e.breakpointMd||(i?"1024px":"768px"),lg:e.breakpointLg||(i?"1280px":"1024px"),xl:e.breakpointXl||"1280px"},xStyleAttribute:e.xStyleAttribute||"x-style",selectorAttribute:s,registeredProperties:p}}(e||document.currentScript.dataset),!ie.enabled)return!1;let t,r;if(ie.constructable&&document.adoptedStyleSheets&&Object.isFrozen(document.adoptedStyleSheets)){if(r=new CSSStyleSheet,ie.generate){const e=T(ie);t=e.tracker,r.replaceSync(e.content)}else t=new Set,r.replaceSync(I(ie));document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}else{oe=!1;const e=document.createElement("style"),o=T(ie);t=o.tracker,e.id="opis-assembler-css",e.textContent=o.content,document.currentScript.parentElement.insertBefore(e,document.currentScript),r=e.sheet}return re=new te(ie,r,t),function(e,t){null===V&&(V=new MutationObserver((function(e){for(let r=0,o=e.length;r"words"===e?["overflow-wrap"]:"all"===e?["word-break"]:["overflow-wrap","word-break"],truncate:["overflow","text-overflow","white-space"],flex:e=>e?"flex":"display","inline-flex":"display",grid:"display","inline-grid":"display",hidden:"display",block:"display","inline-block":"display",static:"position",fixed:"position",absolute:"position",relative:"position",sticky:"position",visible:"visibility",invisible:"visibility","flex-row":"flex-direction","flex-col":"flex-direction",list:e=>"inside"===e||"outside"===e?"list-style-position":"list-style-type",text:e=>o.test(e)?["font-size","line-height"]:"font-size",uppercase:"text-transform",lowercase:"text-transform",capitalize:"text-transform","normal-case":"text-transform",variant:"font-variant-numeric"},u={border:["1px solid transparent"],truncate:["hidden","ellipsis","nowrap"],flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",hidden:"none",block:"block","inline-block":"inline-block",static:"static",fixed:"fixed",absolute:"absolute",relative:"relative",sticky:"sticky",visible:"visible",invisible:"hidden","flex-row":"row","flex-col":"column","flex-wrap":"wrap","flex-grow":"1","flex-shrink":"1","col-reverse":"column-reverse","row-reverse":"row-reverse",uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize","normal-case":"none",radius:"sm",shadow:"1"},b=e=>r.test(e)?`calc(${e} * @unit-size)`:e,g=e=>t.test(e)?`calc(${e} * @unit-size)`:e,h=e=>`repeat(${e}, minmax(0, 1fr))`,f=e=>`span ${e}`,y=e=>l.test(e)?"@border-radius-"+e:e,w={img:e=>`url(${e})`,gradient:e=>`linear-gradient(${e})`,"radial-gradient":e=>`radial-gradient(${e})`,"conic-gradient":e=>`conic-gradient(${e})`,"grid-rows":h,"row-span":f,"grid-cols":h,"col-span":f,e:e=>s.test(e)?`@elevation-${e}`:e,shadow:e=>n.test(e)?`@shadow-${e}`:e,ring:e=>`0 0 0 ${e}`,"font-size":e=>o.test(e)?"@font-size-"+e:e,leading:e=>t.test(e)?`calc(${e} * @unit-size)`:i.test(e)?"@line-height-"+e:e,tracking:e=>a.test(e)?"@letter-spacing-"+e:e,text:e=>o.test(e)?["@font-size-"+e,"@font-size-leading-"+e]:e,radius:y,"radius-top":y,"radius-left":y,"radius-bottom":y,"radius-right":y,"radius-tl":y,"radius-bl":y,"radius-tr":y,"radius-br":y,"border-radius":y,break:e=>"all"===e?"break-all":"words"===e?"break-word":["normal","normal"],"flex-wrap":e=>"reverse"===e?"wrap-reverse":e,"flex-row":e=>"reverse"===e?"row-reverse":e,"flex-col":e=>"reverse"===e?"column-reverse":e,order:e=>p.test(e)?"first"===e?"-9999":"last"===e?"9999":"0":e,padding:g,"padding-top":g,"padding-bottom":g,"padding-left":g,"padding-right":g,p:g,pt:g,pb:g,pl:g,pr:g,px:g,py:g,margin:b,"margin-top":b,"margin-bottom":b,"margin-left":b,"margin-right":b,m:b,mt:b,mb:b,ml:b,mr:b,mx:b,my:b,w:g,h:g,width:g,height:g,"min-w":g,"max-w":g,"min-h":g,"max-h":g,"min-width":g,"max-width":g,"min-height":g,"max-height":g},v=["0px 0px 0px 0px","0px 2px 1px -1px","0px 3px 1px -2px","0px 3px 3px -2px","0px 2px 4px -1px","0px 3px 5px -1px","0px 3px 5px -1px","0px 4px 5px -2px","0px 5px 5px -3px","0px 5px 6px -3px","0px 6px 6px -3px","0px 6px 7px -4px","0px 7px 8px -4px","0px 7px 8px -4px","0px 7px 9px -4px","0px 8px 9px -5px","0px 8px 10px -5px","0px 8px 11px -5px","0px 9px 11px -5px","0px 9px 12px -6px","0px 10px 13px -6px","0px 10px 13px -6px","0px 10px 14px -6px","0px 11px 14px -7px","0px 11px 15px -7px"],k=["0px 0px 0px 0px","0px 1px 1px 0px","0px 2px 2px 0px","0px 3px 4px 0px","0px 4px 5px 0px","0px 5px 8px 0px","0px 6px 10px 0px","0px 7px 10px 1px","0px 8px 10px 1px","0px 9px 12px 1px","0px 10px 14px 1px","0px 11px 15px 1px","0px 12px 17px 2px","0px 13px 19px 2px","0px 14px 21px 2px","0px 15px 22px 2px","0px 16px 24px 2px","0px 17px 26px 2px","0px 18px 28px 2px","0px 19px 29px 2px","0px 20px 31px 3px","0px 21px 33px 3px","0px 22px 35px 3px","0px 23px 36px 3px","0px 24px 38px 3px"],$=["0px 0px 0px 0px","0px 1px 3px 0px","0px 1px 5px 0px","0px 1px 8px 0px","0px 1px 10px 0px","0px 1px 14px 0px","0px 1px 18px 0px","0px 2px 16px 1px","0px 3px 14px 2px","0px 3px 16px 2px","0px 4px 18px 3px","0px 4px 20px 3px","0px 5px 22px 4px","0px 5px 24px 4px","0px 5px 26px 4px","0px 6px 28px 5px","0px 6px 30px 5px","0px 6px 32px 5px","0px 7px 34px 6px","0px 7px 36px 6px","0px 8px 38px 7px","0px 8px 40px 7px","0px 8px 42px 7px","0px 9px 44px 8px","0px 9px 46px 8px"],S={none:"0",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",xl:"1rem",pill:"9999px"},z={tighter:"-0.05rem",tight:"-0.025rem",normal:"0",wide:"0.025rem",wider:"0.05rem",widest:"0.1rem"},A={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},O={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"},j={xs:"1rem",sm:"1.25rem",base:"1.5rem",lg:"1.75rem",xl:"1.75rem","2xl":"2rem","3xl":"2.25rem","4xl":"2.5rem","5xl":"1","6xl":"1","7xl":"1","8xl":"1","9xl":"1"},P={"sans-serif":"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol",serif:"Georgia, Cambria, Times New Roman, Times, serif",monospace:"Lucida Console, Monaco, monospace"},R=["0px 2px 4px 0px hsla(0, 0%, 20%, 0.1), 0px 6px 6px -8px hsla(0, 0%, 0%, 15%)","0px 2px 8px -1px hsla(0, 0%, 20%, 0.1), 0px 16px 16px -12px hsla(0, 0%, 0%, 15%)","0px 2px 16px -2px hsla(0, 0%, 20%, 0.1), 0px 22px 18px -16px hsla(0, 0%, 0%, 15%)","0px 2px 20px -3px hsla(0, 0%, 20%, 0.1), 0px 28px 22px -18px hsla(0, 0%, 0%, 15%)","0px 2px 32px -2px hsla(0, 0%, 20%, 0.1), 0px 32px 26px -18px hsla(0, 0%, 0%, 15%)","0px 2px 36px -1px hsla(0, 0%, 20%, 0.1), 0px 42px 34px -24px hsla(0, 0%, 0%, 15%)"];function C(e){let t="--elevation-umbra: rgba(0, 0, 0, .2);--elevation-penumbra: rgba(0, 0, 0, .14);--elevation-ambient: rgba(0, 0, 0, .12);";for(let e=0;e<25;e++)t+=`--elevation-${e}:${v[e]} var(--elevation-umbra), ${k[e]} var(--elevation-penumbra), ${$[e]} var(--elevation-ambient);`;for(let e=0;e<6;e++)t+=`--shadow-${e+1}:${R[e]};`;for(const[e,r]of Object.entries(S))t+=`--border-radius-${e}:${r};`;for(const[e,r]of Object.entries(z))t+=`--letter-spacing-${e}:${r};`;for(const[e,r]of Object.entries(A))t+=`--line-height-${e}:${r};`;for(const[e,r]of Object.entries(P))t+=`--${e}:${r};`;for(const[e,r]of Object.entries(O))t+=`--font-size-${e}:${r};`;for(const[e,r]of Object.entries(j))t+=`--font-size-leading-${e}:${r};`;for(const r of e.breakpoints)"all"!==r&&(t+=`--breakpoint-${r}: ${e.media[r]};`);return t+="--unit-size:0.25rem;",":root{"+t+"}"}const I=/\\\n/g,M=/^--([a-zA-Z0-9-_]+)--(scope|mixin|register)$/;const E=new class{constructor(){this.cache=new Map,this.scopes=["","text-clip","selection","placeholder","before","after","first-letter","first-line","l1","l2","marker-l1","marker","sibling","child","even","odd","first","last","dark","light","landscape","portrait","motion-reduce","motion-safe"],this.registeredProperties=[];const{cache:e}=this;e.set("--text-clip--scope","$selector {-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;}"),e.set("--l1--scope","$selector > * {$body}"),e.set("--l2--scope","$selector > * > * {$body}"),e.set("--sibling--scope","$selector > * + * {$body}"),e.set("--child--scope","$selector > $class {$body}"),e.set("--selection--scope","$selector::selection {$body}"),e.set("--placeholder--scope","$selector::placeholder {$body}"),e.set("--marker--scope","$selector::marker {$body}"),e.set("--marker-l1--scope","$selector > *::marker {$body}"),e.set("--before--scope","$selector::before {$body}"),e.set("--after--scope","$selector::after {$body}"),e.set("--even--scope","$selector:nth-child(even) {$body}"),e.set("--odd--scope","$selector:nth-child(odd) {$body}"),e.set("--first--scope","$selector:first-child {$body}"),e.set("--last--scope","$selector:last-child {$body}"),e.set("--first-letter--scope","$selector::first-letter {$body}"),e.set("--first-line--scope","$selector::first-line {$body}"),e.set("--dark--scope","@media(prefers-color-scheme: dark) {$selector {$body}}"),e.set("--light--scope","@media(prefers-color-scheme: light) {$selector {$body}}"),e.set("--landscape--scope","@media(orientation: landscape) {$selector {$body}}"),e.set("--portrait--scope","@media(orientation: portrait) {$selector {$body}}"),e.set("--motion-reduce--scope","@media(prefers-reduced-motion: reduce) {$selector {$body}}"),e.set("--motion-safe--scope","@media(prefers-reduced-motion: no-preference) {$selector {$body}}"),this.initialize()}initialize(){const{cache:e,scopes:t,registeredProperties:r}=this;for(const o of this.getComputedStyles())for(const i of o){const s=M.exec(i);if(null==s)continue;const n=s[1],a=this.getValue(o,i);switch(e.set(i,a),s[2]){case"scope":-1===t.indexOf(n)&&t.push(n);break;case"register":if("true"===a||""===a)r.push({name:n,aliases:[]});else{const e=a.split(",").map((e=>e.trim())).filter((e=>""!==e));r.push({name:n,aliases:e})}}}}getComputedStyles(){const e=[];for(let t=0,r=document.styleSheets.length;t[a-z]{2})\|)?(?:(?[-a-zA-Z0-9]+)!)?(?[-a-z]+)(?:\.(?[-a-z]+))?$/m;function _(e){const t=void 0===e.enabled||"true"===e.enabled,r=void 0!==e.generate&&"true"===e.generate,o=void 0===e.constructable||"true"===e.constructable,i=void 0!==e.mode&&"desktop-first"===e.mode,s=void 0===e.selectorAttribute?"class":e.selectorAttribute,n=void 0===e.cache?null:e.cache,a=void 0===e.cacheKey?"assembler-css-cache":e.cacheKey,l=E.getRegisteredProperties(),p=E.getRegisteredScopes();for(let e=0,t=l.length;e0&&(d[t.name]=t.aliases))}let x=["xs","sm","md","lg","xl"];i?(x.pop(),x.reverse()):x.shift(),x.unshift("all");const m=void 0===e.states?["normal","hover"]:function(e,t=!0){const r=e.replace(/[,;]/g," ").split(/\s\s*/g).map(T).filter(V);return t?r.filter(U):r}(e.states.toLowerCase());-1===m.indexOf("normal")&&m.unshift("normal");return{enabled:t,generate:r,constructable:o,cache:n,cacheKey:a,desktopFirst:i,scopes:p,states:m,breakpoints:x,media:{xs:e.breakpointXs||"512px",sm:e.breakpointSm||(i?"768px":"512px"),md:e.breakpointMd||(i?"1024px":"768px"),lg:e.breakpointLg||(i?"1280px":"1024px"),xl:e.breakpointXl||"1280px"},xStyleAttribute:e.xStyleAttribute||"x-style",selectorAttribute:s,registeredProperties:l}}function F(e){if("string"==typeof e)return e.trim();if(Array.isArray(e))return e.map(F).join(";");const t=[];for(const r in e){const o=e[r];if(void 0===o)continue;const i=r.replace(K,"$1-$2").toLowerCase();t.push(null===o?i:i+":"+o)}return t.join(";")}function T(e){return e.trim()}function V(e){return""!==e}function U(e,t,r){return r.indexOf(e)===t}function W(e){if(e.cache){const t=localStorage.getItem(e.cacheKey+":"+e.cache);if(null!==t){const e=JSON.parse(t);return e.tracker=new Set(e.tracker),e}const r=localStorage.getItem(e.cacheKey);null!==r&&localStorage.removeItem(e.cacheKey+":"+r),localStorage.setItem(e.cacheKey,e.cache)}else{const t=localStorage.getItem(e.cacheKey);null!==t&&(localStorage.removeItem(e.cacheKey+":"+t),localStorage.removeItem(e.cacheKey))}const t=x.length,r=[],o=e.breakpoints,i=e.media,s=e.desktopFirst,n=e.states,a=new Set,l=e.selectorAttribute,p="class"===l?".asm\\#":"["+l+'~="'+"asm#",m="class"===l?"":'"]';r.push(C(e));for(let e=0,l=o.length;e0?l+"--":"")+o+(n>0?"__"+i[n]:"");a.add(c);let g=d[o],h="";if(g)for(let e=0,t=g.length;e0?":"+s:""}{${h}${o}:var(${b}) !important}`}}0!==e&&(u+="}"),r.push(u)}const u={content:r.join(""),tracker:a};return e.cache&&(localStorage.setItem(e.cacheKey,e.cache),localStorage.setItem(e.cacheKey+":"+e.cache,JSON.stringify({content:u.content,tracker:[...a]}))),u}let Z=null,H=null,B=null;const J=new WeakMap;function X(e,t){if(J.has(e))return;const r=e.attributes.getNamedItem(t.userSettings.xStyleAttribute);J.set(e,r?t.handleStyleChange(e,r.value,[]):[]),function(e,t){null===H&&(H=new MutationObserver((function(e){for(const r of e){const e=r.target;J.set(e,t.handleStyleChange(e,e.getAttribute(r.attributeName),J.get(e)))}}))),H.observe(e,{attributes:!0,attributeOldValue:!0,childList:!0,attributeFilter:[t.userSettings.xStyleAttribute]})}(e,t);for(let r=e.firstElementChild;null!=r;r=r.nextElementSibling)X(r,t)}const q=new Map,G=/\${([0-9]+)(?:=([^}]+))?}/g;function Y(e,t,r){return q.has(t)?F(q.get(t)(e,...r)):F(((e,t)=>E.getPropertyValue("--"+e+"--mixin").replace(G,((e,r,o)=>t[parseInt(r)]||o||"")))(t,r))}q.set("space-x",(function(e,t,r){return"true"===r?`sibling!mr:${t||"0"}`:`sibling!ml:${t||"0"}`})),q.set("space-y",(function(e,t,r){return"true"===r?`sibling!mb:${t||"0"}`:`sibling!mt:${t||"0"}`})),q.set("grid",(function(){return"grid; l1!wb:break-all; l2!max-w:100%; child!justify-self:normal; child!align-self:normal"})),q.set("stack",(function(){return'grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); \n grid-template-areas:"stackarea"; l1!grid-area:stackarea; l1!z:0; w:100%; h:100%'})),q.set("sr-only",(function(){return"absolute; w:1px; h:1px; p:0; m:-1px; bw:0; overflow:hidden; clip:rect(0, 0, 0, 0); left:-9999px"})),q.set("container",(function(e){return e.desktopFirst?"px: 1rem; mx:auto; max-w:@breakpoint-lg; lg|max-w:@breakpoint-md; md|max-w:@breakpoint-sm; sm|max-w:@breakpoint-xs; xs|max-w:100%":"px: 1rem; mx:auto; max-w:100%; sm|max-w:@breakpoint-sm; md|max-w:@breakpoint-md; lg|max-w:@breakpoint-lg; xl|max-w:@breakpoint-xl"}));const D=/@([a-zA-Z0-9\-_]+)/g,Q=/\$(selector|body|class|value|property|state|variants|var)/g,ee=/;/,te=/\s*,\s*(?![^(]*\))/gm;class re{constructor(e,t,r){this.style=t,this.settings=e,this.tracker=r,this.mediaSettings=e.media,this.desktopFirst=e.desktopFirst,this.breakpoints=e.breakpoints,this.rules=[],this.padding=t.cssRules.length,this.selectorAttribute=e.selectorAttribute}get userSettings(){return this.settings}handleStyleChange(e,t,r){if(null===t)return this.handleStyleRemoved(e,r);const o=this.getStyleEntries(t),i=e.hasAttribute(this.selectorAttribute)?e.getAttribute(this.selectorAttribute).split(" "):[],s=[];for(const{n:t,p:s,e:n}of r)if(!o.has(t)){const t=i.indexOf(n);t>=0&&i.splice(t,1),e.style.removeProperty(s)}for(const t of o.values()){const{entry:r,property:o,hash:n,value:a,name:l}=t;i.indexOf(r)<0&&i.push(r),this.tracker.has(n)||this.generateCSS(t),e.style.setProperty(o,a),s.push({e:r,n:l,p:o})}return e.setAttribute(this.selectorAttribute,i.join(" ")),s}handleStyleRemoved(e,t){const r=e.hasAttribute(this.selectorAttribute)?e.getAttribute(this.selectorAttribute).split(" "):[];for(const{p:o,e:i}of t){const t=r.indexOf(i);t>=0&&r.splice(t,1),e.style.removeProperty(o)}return e.setAttribute(this.selectorAttribute,r.join(" ")),[]}extract(e,t=null){var r;const o=null===(r=N.exec(e))||void 0===r?void 0:r.groups;if(!o||!o.property)return[];const i=this.breakpoints.indexOf(o.media||"all"),s=x.indexOf(o.state||"normal");if(i<0||s<0)return[];let n=o.property;const a=n,l=this.settings.scopes;m.hasOwnProperty(n)&&(n=m[n],"function"==typeof n&&(n=n(t))),Array.isArray(n)||(n=[n]),null===t&&(t=u[a]||""),w.hasOwnProperty(a)&&(t=w[a](t,a,i,s)),t=Array.isArray(t)?t.map((e=>e.replace(D,"var(--$1)"))):Array(n.length).fill(t.replace(D,"var(--$1)"));const p=[],d=x.length;let b=-1;for(const e of n){b++;const r=c.indexOf(e);if(r<0)continue;const n=o.scope||"",a=(r*d+i)*d+s,x=a.toString(16)+(n?`-${n}`:""),m=1e5*l.indexOf(n),u=(o.media?o.media+"--":"")+(n?n+"__":"")+e+(o.state?"__"+o.state:"");p.push({name:(o.media?o.media+"|":"")+(n?n+"!":"")+e+(o.state?"."+o.state:""),property:L+u,entry:"asm#"+x,value:t[b],media:o.media||"",state:o.state||"",cssProperty:e,hash:x,scope:n,rank:m<0?-1:a+m})}return p}getStyleEntries(e){const t=new Map;for(let r of this.getResolvedProperties(e)){let e=null;const o=r.indexOf(":");o>=0&&(e=r.substr(o+1),r=r.substr(0,o).trim());for(const o of this.extract(r,e))t.set(o.name,o)}return t}getResolvedProperties(e,t=[]){const r=[];for(let o of e.split(ee))if(o=o.trim(),""!==o)if(o.startsWith("^")){const e=o.indexOf(":");let i,s;if(e<0?(i=o.substr(1),s=[]):(i=o.substr(1,e-1),s=o.substr(e+1).split(te).map(T)),t.indexOf(i)>=0)throw t.push(i),new Error("Recursive mixin detected: "+t.join("->"));t.push(i),r.push(...this.getResolvedProperties(Y(this.settings,i,s),t)),t.pop()}else r.push(o);return r}generateCSS(e){const{tracker:t,mediaSettings:r,desktopFirst:o,style:i}=this,{hash:s,media:n,state:a,cssProperty:l,property:p,scope:c,rank:x}=e,m=""!==n,u=this.settings.selectorAttribute,b="class"===u?".asm\\#":"["+u+'~="'+"asm#",g="class"===u?"":'"]';if(t.add(s),x<0)return;let h="";m&&(h+=o?`@media only screen and (max-width: ${r[n]}) {`:`@media only screen and (min-width: ${r[n]}) {`);let f=d[l],y="";if(f)for(let e=0,t=f.length;e{switch(t){case"selector":return`${b+s+g}${a?":"+a:""}`;case"body":return y+l+": var("+p+") !important";case"variants":return y;case"property":return l;case"value":return`var(${p})`;case"class":return b+s+g;case"state":return a?":"+a:"";case"var":return p}return t}))}else h+=`${b+s+g}${a?":"+a:""}{${y}${l}: var(${p}) !important}`;m&&(h+="}");const w=this.getRuleIndex(x);this.rules.splice(w,0,x);try{i.insertRule(h,this.padding+w)}catch(e){this.rules.splice(w,1),console.warn("Unsupported rule:",h)}}getRuleIndex(e){const{rules:t}=this;for(let r=0,o=t.length;r = new Map(); + private scopes: string[] = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", + "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", + "landscape", "portrait", "motion-reduce", "motion-safe" + ]; + private registeredProperties: {name: string, aliases:string[]}[] = []; constructor() { const {cache} = this; const tc = '-webkit-background-clip: text !important;-moz-background-clip:text !important;background-clip:text !important;'; - cache.set("text-clip--scope", `$selector {${tc}}`); - cache.set("l1--scope", "$selector > * {$body}"); - cache.set("l2--scope", "$selector > * > * {$body}"); - cache.set("sibling--scope", "$selector > * + * {$body}"); - cache.set("child--scope", "$selector > $class {$body}"); + cache.set("--text-clip--scope", `$selector {${tc}}`); + cache.set("--l1--scope", "$selector > * {$body}"); + cache.set("--l2--scope", "$selector > * > * {$body}"); + cache.set("--sibling--scope", "$selector > * + * {$body}"); + cache.set("--child--scope", "$selector > $class {$body}"); - cache.set("selection--scope", "$selector::selection {$body}"); - cache.set("placeholder--scope", "$selector::placeholder {$body}"); - cache.set("marker--scope", "$selector::marker {$body}"); - cache.set("marker-l1--scope", "$selector > *::marker {$body}"); + cache.set("--selection--scope", "$selector::selection {$body}"); + cache.set("--placeholder--scope", "$selector::placeholder {$body}"); - cache.set("before--scope", "$selector::before {$body}"); - cache.set("after--scope", "$selector::after {$body}"); + cache.set("--marker--scope", "$selector::marker {$body}"); + cache.set("--marker-l1--scope", "$selector > *::marker {$body}"); - cache.set("even--scope", "$selector:nth-child(even) {$body}"); - cache.set("odd--scope", "$selector:nth-child(odd) {$body}"); - cache.set("first--scope", "$selector:first-child {$body}"); - cache.set("last--scope", "$selector:last-child {$body}"); + cache.set("--before--scope", "$selector::before {$body}"); + cache.set("--after--scope", "$selector::after {$body}"); - cache.set("first-letter--scope", "$selector::first-letter {$body}"); - cache.set("first-line--scope", "$selector::first-line {$body}"); + cache.set("--even--scope", "$selector:nth-child(even) {$body}"); + cache.set("--odd--scope", "$selector:nth-child(odd) {$body}"); + cache.set("--first--scope", "$selector:first-child {$body}"); + cache.set("--last--scope", "$selector:last-child {$body}"); - cache.set("dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); - cache.set("light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); + cache.set("--first-letter--scope", "$selector::first-letter {$body}"); + cache.set("--first-line--scope", "$selector::first-line {$body}"); - cache.set("landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); - cache.set("portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); + cache.set("--dark--scope", "@media(prefers-color-scheme: dark) {$selector {$body}}"); + cache.set("--light--scope", "@media(prefers-color-scheme: light) {$selector {$body}}"); - cache.set("motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); - cache.set("motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); + cache.set("--landscape--scope", "@media(orientation: landscape) {$selector {$body}}"); + cache.set("--portrait--scope", "@media(orientation: portrait) {$selector {$body}}"); + + cache.set("--motion-reduce--scope", "@media(prefers-reduced-motion: reduce) {$selector {$body}}"); + cache.set("--motion-safe--scope", "@media(prefers-reduced-motion: no-preference) {$selector {$body}}"); + + this.initialize(); } - private getComputedStyles(): CSSStyleDeclaration[] { - if (this.styles === null) { - this.styles = []; - for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { - const styleSheet = document.styleSheets[si]; - if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { - continue; - } - if (styleSheet.href === null && styleSheet.ownerNode !== null - && styleSheet.ownerNode instanceof Element && (styleSheet.ownerNode as Element).id === 'opis-assembler-css') { + private initialize() { + const {cache, scopes, registeredProperties} = this; + for (const style of this.getComputedStyles()) { + for (const property of style) { + const match = PROPERTY_REGEX.exec(property); + if (match == null) { continue; } - const rule = styleSheet.cssRules[0]; - if (rule.type === CSSRule.STYLE_RULE && (rule as CSSStyleRule).selectorText === ':root') { - this.styles.unshift((rule as CSSStyleRule).style); + const name = match[1]; + const value = this.getValue(style, property); + cache.set(property, value); + switch (match[2]) { + case "scope": + if (scopes.indexOf(name) === -1) { + scopes.push(name); + } + break; + case "register": + if (value === 'true' || value === '') { + registeredProperties.push({name, aliases: []}); + } else { + const aliases = value.split(',').map(v => v.trim()).filter(v => v !== ''); + registeredProperties.push({name, aliases}) + } + break; } } } - return this.styles; } - private getPropertyValueFormComputedStyles(property: string): string { - for (const style of this.getComputedStyles()) { - const value = style.getPropertyValue(property); - if (value !== '') { - return value; + private getComputedStyles(): CSSStyleDeclaration[] { + const styles = []; + for (let si = 0, sl = document.styleSheets.length; si < sl; si++) { + const styleSheet = document.styleSheets[si]; + if (styleSheet.href !== null && styleSheet.href.indexOf(window.location.origin) !== 0) { + continue; + } + if (styleSheet.href === null && styleSheet.ownerNode !== null + && styleSheet.ownerNode instanceof Element && (styleSheet.ownerNode as Element).id === 'opis-assembler-css') { + continue; + } + const rule = styleSheet.cssRules[0]; + if (rule.type === CSSRule.STYLE_RULE && (rule as CSSStyleRule).selectorText === ':root') { + styles.push((rule as CSSStyleRule).style); } - } - return ''; - } - - getPropertyValue(property: string): string { - if (this.cache.has(property)) { - return this.cache.get(property); } - let value = this.getPropertyValueFormComputedStyles('--' + property) - .replace(ESCAPE_REGEX, "") - .trim(); + return styles; + } + private getValue(style: CSSStyleDeclaration, property: string): string { + let value = style.getPropertyValue(property).replace(ESCAPE_REGEX, "").trim(); if (value.startsWith('"') && value.endsWith('"')) { value = value.substring(1, value.length - 1).trim(); } + return value; + } - this.cache.set(property, value); + getRegisteredScopes(): string[] { + return this.scopes; + } - return value; + getRegisteredProperties(): {name: string, aliases:string[]}[] { + return this.registeredProperties; + } + + getPropertyValue(property: string): string { + if (this.cache.has(property)) { + return this.cache.get(property); + } + + return ''; } } diff --git a/src/StyleHandler.ts b/src/StyleHandler.ts index 2908979..d0d9f30 100644 --- a/src/StyleHandler.ts +++ b/src/StyleHandler.ts @@ -303,7 +303,7 @@ export default class StyleHandler { } if (scope) { - const scopeValue = Root.getPropertyValue(scope + '--scope') + const scopeValue = Root.getPropertyValue('--' + scope + '--scope'); if (scopeValue === '') { return; } diff --git a/src/helpers.ts b/src/helpers.ts index 6feac83..d2e9217 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -15,6 +15,7 @@ */ import {PROPERTY_LIST, PROPERTY_VARIANTS} from "./list"; +import {Root} from "./Root"; export type UserSettings = { enabled: boolean, @@ -46,18 +47,9 @@ export function getUserSettings(dataset: {[key: string]: string}): UserSettings const selectorAttribute = dataset.selectorAttribute === undefined ? 'class' : dataset.selectorAttribute; const cache = dataset.cache === undefined ? null : dataset.cache; const cacheKey = dataset.cacheKey === undefined ? "assembler-css-cache" : dataset.cacheKey; - const dataScopes = dataset.scopes === undefined ? [] : getStringItemList(dataset.scopes); - const registeredProperties = dataset.registerProperties === undefined ? [] : getRegisteredProperties(dataset.registerProperties); - const scopes = ["", "text-clip", "selection", "placeholder", "before", "after", "first-letter", "first-line", - "l1", "l2", "marker-l1", "marker", "sibling", "child", "even", "odd", "first", "last", "dark", "light", - "landscape", "portrait", "motion-reduce", "motion-safe"]; - - for (let i = 0, l = dataScopes.length; i < l; i++) { - const scope = dataScopes[i]; - if (scopes.indexOf(scope) < 0) { - scopes.push(scope); - } - } + + const registeredProperties = Root.getRegisteredProperties(); + const scopes = Root.getRegisteredScopes(); for (let i = 0, l = registeredProperties.length; i < l; i++) { const prop = registeredProperties[i]; diff --git a/src/mixins.ts b/src/mixins.ts index 453ea67..9a0cb64 100644 --- a/src/mixins.ts +++ b/src/mixins.ts @@ -27,7 +27,7 @@ const mixinRepository: Map = new Map { - return Root.getPropertyValue(name + '--mixin') + return Root.getPropertyValue('--' + name + '--mixin') .replace(MIXIN_ARGS_REGEX, (match, arg, fallback) => args[parseInt(arg)] || fallback || ''); }; diff --git a/types/Root.d.ts b/types/Root.d.ts index f2a513d..56fdb47 100644 --- a/types/Root.d.ts +++ b/types/Root.d.ts @@ -1,9 +1,16 @@ declare class RootClass { - private styles; private cache; + private scopes; + private registeredProperties; constructor(); + private initialize; private getComputedStyles; - private getPropertyValueFormComputedStyles; + private getValue; + getRegisteredScopes(): string[]; + getRegisteredProperties(): { + name: string; + aliases: string[]; + }[]; getPropertyValue(property: string): string; } export declare const Root: RootClass; diff --git a/yarn.lock b/yarn.lock index c6bc523..82d398b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,19 +15,19 @@ integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.0.tgz#749e57c68778b73ad8082775561f67f5196aafa8" - integrity sha512-tXtmTminrze5HEUPn/a0JtOzzfp0nk+UEXQ/tqIJo3WDGypl/2OFQEMll/zSFU8f/lfmfLXvTaORHF3cfXIQMw== + version "7.15.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" + integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== dependencies: "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.0" - "@babel/helper-module-transforms" "^7.15.0" - "@babel/helpers" "^7.14.8" - "@babel/parser" "^7.15.0" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.15.0" - "@babel/types" "^7.15.0" + "@babel/generator" "^7.15.4" + "@babel/helper-compilation-targets" "^7.15.4" + "@babel/helper-module-transforms" "^7.15.4" + "@babel/helpers" "^7.15.4" + "@babel/parser" "^7.15.5" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -35,130 +35,130 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.0.tgz#a7d0c172e0d814974bad5aa77ace543b97917f15" - integrity sha512-eKl4XdMrbpYvuB505KTta4AV9g+wWzmVBW69tX0H2NwKVKd2YJbKgyK6M8j/rgLbmHOYJn6rUklV677nOyJrEQ== +"@babel/generator@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" + integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== dependencies: - "@babel/types" "^7.15.0" + "@babel/types" "^7.15.4" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-compilation-targets@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.0.tgz#973df8cbd025515f3ff25db0c05efc704fa79818" - integrity sha512-h+/9t0ncd4jfZ8wsdAsoIxSa61qhBYlycXiHWqJaQBCXAhDCMbPRSMTGnZIkkmt1u4ag+UQmuqcILwqKzZ4N2A== +"@babel/helper-compilation-targets@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" + integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== dependencies: "@babel/compat-data" "^7.15.0" "@babel/helper-validator-option" "^7.14.5" browserslist "^4.16.6" semver "^6.3.0" -"@babel/helper-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz#89e2c474972f15d8e233b52ee8c480e2cfcd50c4" - integrity sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ== +"@babel/helper-function-name@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" + integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== dependencies: - "@babel/helper-get-function-arity" "^7.14.5" - "@babel/template" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/helper-get-function-arity" "^7.15.4" + "@babel/template" "^7.15.4" + "@babel/types" "^7.15.4" -"@babel/helper-get-function-arity@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz#25fbfa579b0937eee1f3b805ece4ce398c431815" - integrity sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg== +"@babel/helper-get-function-arity@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" + integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.15.4" -"@babel/helper-hoist-variables@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz#e0dd27c33a78e577d7c8884916a3e7ef1f7c7f8d" - integrity sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ== +"@babel/helper-hoist-variables@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" + integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.15.4" -"@babel/helper-member-expression-to-functions@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.0.tgz#0ddaf5299c8179f27f37327936553e9bba60990b" - integrity sha512-Jq8H8U2kYiafuj2xMTPQwkTBnEEdGKpT35lJEQsRRjnG0LW3neucsaMWLgKcwu3OHKNeYugfw+Z20BXBSEs2Lg== +"@babel/helper-member-expression-to-functions@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" + integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== dependencies: - "@babel/types" "^7.15.0" + "@babel/types" "^7.15.4" -"@babel/helper-module-imports@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz#6d1a44df6a38c957aa7c312da076429f11b422f3" - integrity sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ== +"@babel/helper-module-imports@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" + integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.15.4" -"@babel/helper-module-transforms@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.0.tgz#679275581ea056373eddbe360e1419ef23783b08" - integrity sha512-RkGiW5Rer7fpXv9m1B3iHIFDZdItnO2/BLfWVW/9q7+KqQSDY5kUfQEbzdXM1MVhJGcugKV7kRrNVzNxmk7NBg== +"@babel/helper-module-transforms@^7.15.4": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" + integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-replace-supers" "^7.15.0" - "@babel/helper-simple-access" "^7.14.8" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.9" - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.15.0" - "@babel/types" "^7.15.0" + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" -"@babel/helper-optimise-call-expression@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz#f27395a8619e0665b3f0364cddb41c25d71b499c" - integrity sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA== +"@babel/helper-optimise-call-expression@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" + integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.15.4" "@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== -"@babel/helper-replace-supers@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.0.tgz#ace07708f5bf746bf2e6ba99572cce79b5d4e7f4" - integrity sha512-6O+eWrhx+HEra/uJnifCwhwMd6Bp5+ZfZeJwbqUTuqkhIT6YcRhiZCOOFChRypOIe0cV46kFrRBlm+t5vHCEaA== +"@babel/helper-replace-supers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" + integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.0" - "@babel/helper-optimise-call-expression" "^7.14.5" - "@babel/traverse" "^7.15.0" - "@babel/types" "^7.15.0" + "@babel/helper-member-expression-to-functions" "^7.15.4" + "@babel/helper-optimise-call-expression" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" -"@babel/helper-simple-access@^7.14.8": - version "7.14.8" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz#82e1fec0644a7e775c74d305f212c39f8fe73924" - integrity sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg== +"@babel/helper-simple-access@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" + integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== dependencies: - "@babel/types" "^7.14.8" + "@babel/types" "^7.15.4" -"@babel/helper-split-export-declaration@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz#22b23a54ef51c2b7605d851930c1976dd0bc693a" - integrity sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA== +"@babel/helper-split-export-declaration@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" + integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== dependencies: - "@babel/types" "^7.14.5" + "@babel/types" "^7.15.4" -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz#6654d171b2024f6d8ee151bf2509699919131d48" - integrity sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g== +"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" + integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== "@babel/helper-validator-option@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== -"@babel/helpers@^7.14.8": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.3.tgz#c96838b752b95dcd525b4e741ed40bb1dc2a1357" - integrity sha512-HwJiz52XaS96lX+28Tnbu31VeFSQJGOeKHJeaEPQlTl7PnlhFElWPj8tUXtqFIzeN86XxXoBr+WFAyK2PPVz6g== +"@babel/helpers@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== dependencies: - "@babel/template" "^7.14.5" - "@babel/traverse" "^7.15.0" - "@babel/types" "^7.15.0" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" "@babel/highlight@^7.14.5": version "7.14.5" @@ -169,10 +169,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.5", "@babel/parser@^7.15.0": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.3.tgz#3416d9bea748052cfcb63dbcc27368105b1ed862" - integrity sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA== +"@babel/parser@^7.1.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5": + version "7.15.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" + integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -258,34 +258,34 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/template@^7.14.5", "@babel/template@^7.3.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" - integrity sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g== +"@babel/template@^7.15.4", "@babel/template@^7.3.3": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== dependencies: "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.14.5" - "@babel/types" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.0.tgz#4cca838fd1b2a03283c1f38e141f639d60b3fc98" - integrity sha512-392d8BN0C9eVxVWd8H6x9WfipgVH5IaIoLp23334Sc1vbKKWINnvwRpb4us0xtPaCumlwbTtIYNA0Dv/32sVFw== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== dependencies: "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.0" - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-hoist-variables" "^7.14.5" - "@babel/helper-split-export-declaration" "^7.14.5" - "@babel/parser" "^7.15.0" - "@babel/types" "^7.15.0" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.14.5", "@babel/types@^7.14.8", "@babel/types@^7.15.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.0.tgz#61af11f2286c4e9c69ca8deb5f4375a73c72dcbd" - integrity sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ== +"@babel/types@^7.0.0", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== dependencies: "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" @@ -527,9 +527,9 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.15" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024" - integrity sha512-bxlMKPDbY8x5h6HBwVzEOk2C8fb6SLfYQ5Jw3uBYuYF1lfWk/kbLd81la82vrIkBb0l+JdmrZaDikPrNxpS/Ew== + version "7.1.16" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" + integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -591,9 +591,9 @@ "@types/istanbul-lib-report" "*" "@types/node@*": - version "16.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.6.0.tgz#0d5685f85066f94e97f19e8a67fe003c5fadacc4" - integrity sha512-OyiZPohMMjZEYqcVo/UJ04GyAxXOJEZO/FpzyXxcH4r/ArrVoXHf4MbUrkLp0Tz7/p1mMKpo5zJ6ZHl8XBNthQ== + version "16.9.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.2.tgz#81f5a039d6ed1941f8cc57506c74e7c2b8fc64b9" + integrity sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -646,9 +646,9 @@ acorn@^7.1.1: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" - integrity sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA== + version "8.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== agent-base@6: version "6.0.2" @@ -665,9 +665,9 @@ ansi-escapes@^4.2.1: type-fest "^0.21.3" ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" @@ -857,15 +857,15 @@ browser-process-hrtime@^1.0.0: integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== browserslist@^4.16.6: - version "4.16.7" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.7.tgz#108b0d1ef33c4af1b587c54f390e7041178e4335" - integrity sha512-7I4qVwqZltJ7j37wObBe3SoTz+nS8APaNcrBOlgoirb6/HbEU2XxW/LpUDTCngM6iauwFqmRTuOMfyKnFGY5JA== + version "4.17.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.0.tgz#1fcd81ec75b41d6d4994fb0831b92ac18c01649c" + integrity sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g== dependencies: - caniuse-lite "^1.0.30001248" - colorette "^1.2.2" - electron-to-chromium "^1.3.793" + caniuse-lite "^1.0.30001254" + colorette "^1.3.0" + electron-to-chromium "^1.3.830" escalade "^3.1.1" - node-releases "^1.1.73" + node-releases "^1.1.75" bser@2.1.1: version "2.1.1" @@ -909,10 +909,10 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== -caniuse-lite@^1.0.30001248: - version "1.0.30001251" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001251.tgz#6853a606ec50893115db660f82c094d18f096d85" - integrity sha512-HOe1r+9VkU4TFmnU70z+r7OLmtR+/chB1rdcJUeQlAinjEeb0cKL20tlAtOagNZhbrtLnCvV19B4FmF1rgzl6A== +caniuse-lite@^1.0.30001254: + version "1.0.30001258" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001258.tgz#b604eed80cc54a578e4bf5a02ae3ed49f869d252" + integrity sha512-RBByOG6xWXUp0CR2/WU2amXz3stjKpSl5J1xU49F1n2OxD//uBZO4wCKUiG+QMGf7CHGfDDcqoKriomoGVxTeA== capture-exit@^2.0.0: version "2.0.0" @@ -1014,10 +1014,10 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.2.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.3.0.tgz#ff45d2f0edb244069d3b772adeb04fed38d0a0af" - integrity sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w== +colorette@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" + integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== combined-stream@^1.0.8: version "1.0.8" @@ -1129,9 +1129,9 @@ decode-uri-component@^0.2.0: integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: version "4.2.2" @@ -1182,10 +1182,10 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" -electron-to-chromium@^1.3.793: - version "1.3.803" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.803.tgz#78993a991d096500f21a77e91cd2a44295fe3cbe" - integrity sha512-tmRK9qB8Zs8eLMtTBp+w2zVS9MUe62gQQQHjYdAc5Zljam3ZIokNb+vZLPRz9RCREp6EFRwyhOFwbt1fEriQ2Q== +electron-to-chromium@^1.3.830: + version "1.3.843" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.843.tgz#671489bd2f59fd49b76adddc1aa02c88cd38a5c0" + integrity sha512-OWEwAbzaVd1Lk9MohVw8LxMXFlnYd9oYTYxfX8KS++kLLjDfbovLOcEEXwRhG612dqGQ6+44SZvim0GXuBRiKg== emittery@^0.7.1: version "0.7.2" @@ -1641,9 +1641,9 @@ is-ci@^2.0.0: ci-info "^2.0.0" is-core-module@^2.2.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.5.0.tgz#f754843617c70bfd29b7bd87327400cda5c18491" - integrity sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg== + version "2.6.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.6.0.tgz#d7553b2526fe59b92ba3e40c8df757ec8a709e19" + integrity sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ== dependencies: has "^1.0.3" @@ -2476,10 +2476,10 @@ node-notifier@^8.0.0: uuid "^8.3.0" which "^2.0.2" -node-releases@^1.1.73: - version "1.1.74" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.74.tgz#e5866488080ebaa70a93b91144ccde06f3c3463e" - integrity sha512-caJBVempXZPepZoZAPCWRTNxYQ+xtG/KAi4ozTA5A+nJ7IU+kLQCbqaUjb5Rwy14M9upBWiQ4NutcmW04LJSRw== +node-releases@^1.1.75: + version "1.1.75" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.75.tgz#6dd8c876b9897a1b8e5a02de26afa79bb54ebbfe" + integrity sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw== normalize-package-data@^2.5.0: version "2.5.0" @@ -2827,9 +2827,9 @@ rollup-plugin-terser@^7.0.2: terser "^5.0.0" rollup@^2.36.1: - version "2.56.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.2.tgz#a045ff3f6af53ee009b5f5016ca3da0329e5470f" - integrity sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ== + version "2.56.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.56.3.tgz#b63edadd9851b0d618a6d0e6af8201955a77aeff" + integrity sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg== optionalDependencies: fsevents "~2.3.2" @@ -2951,9 +2951,9 @@ shellwords@^0.1.1: integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== + version "3.0.4" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7" + integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q== sisteransi@^1.0.5: version "1.0.5" @@ -3006,10 +3006,10 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@~0.5.19: - version "0.5.19" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" - integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== +source-map-support@^0.5.6, source-map-support@~0.5.20: + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -3073,9 +3073,9 @@ sprintf-js@~1.0.2: integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= stack-utils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.3.tgz#cd5f030126ff116b78ccb3c027fe302713b61277" - integrity sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw== + version "2.0.5" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" + integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== dependencies: escape-string-regexp "^2.0.0" @@ -3162,13 +3162,13 @@ terminal-link@^2.0.0: supports-hyperlinks "^2.0.0" terser@^5.0.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" - integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== + version "5.8.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.8.0.tgz#c6d352f91aed85cc6171ccb5e84655b77521d947" + integrity sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A== dependencies: commander "^2.20.0" source-map "~0.7.2" - source-map-support "~0.5.19" + source-map-support "~0.5.20" test-exclude@^6.0.0: version "6.0.0" @@ -3185,9 +3185,9 @@ throat@^5.0.0: integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== tmpl@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" - integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== to-fast-properties@^2.0.0: version "2.0.0" @@ -3282,9 +3282,9 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" typescript@^4.1.3: - version "4.3.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4" - integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA== + version "4.4.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324" + integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA== union-value@^1.0.0: version "1.0.1" @@ -3442,9 +3442,9 @@ write-file-atomic@^3.0.0: typedarray-to-buffer "^3.1.5" ws@^7.4.6: - version "7.5.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" - integrity sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg== + version "7.5.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" + integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== xml-name-validator@^3.0.0: version "3.0.0"