@saasquatch/vanilla-components 1.2.4-24 → 1.2.4-25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/LICENSE +21 -21
  3. package/dist/cjs/{WidgetHost-f349e877.js → WidgetHost-d7b870ce.js} +615 -772
  4. package/dist/cjs/{en-3a7cb52e.js → en-a49a5ef5.js} +2 -2
  5. package/dist/cjs/{index-09a04159.js → index-deb40352.js} +3 -54
  6. package/dist/cjs/loader.cjs.js +3 -3
  7. package/dist/cjs/sqh-close-button.cjs.entry.js +26 -26
  8. package/dist/cjs/{sqh-copy-button_14.cjs.entry.js → sqh-copy-button_12.cjs.entry.js} +1213 -2287
  9. package/dist/cjs/sqh-referral-code.cjs.entry.js +23 -23
  10. package/dist/cjs/sqh-rewards-actions.cjs.entry.js +27 -27
  11. package/dist/cjs/widget-components.cjs.js +3 -3
  12. package/dist/collection/collection-manifest.json +0 -2
  13. package/dist/collection/components/close-button/close-button.js +68 -70
  14. package/dist/collection/components/copy-button/copy-button.js +380 -380
  15. package/dist/collection/components/copy-link-button/copy-link-button.js +230 -230
  16. package/dist/collection/components/global-container/global-container.js +158 -158
  17. package/dist/collection/components/image-component/image-component.js +175 -175
  18. package/dist/collection/components/partner-stat-component/partner-stat-component.js +196 -196
  19. package/dist/collection/components/referral-code/referral-code.js +36 -36
  20. package/dist/collection/components/referral-component/referral-component.js +255 -255
  21. package/dist/collection/components/referral-list/referral-list.js +911 -911
  22. package/dist/collection/components/rewards-actions/rewards-actions.js +105 -105
  23. package/dist/collection/components/share-button/share-button.js +301 -301
  24. package/dist/collection/components/share-button-container/share-button-container.js +2384 -2384
  25. package/dist/collection/components/stat-component/stat-component.js +196 -197
  26. package/dist/collection/components/stats-container/stats-container.js +210 -210
  27. package/dist/collection/components/text-component/text-component.js +304 -301
  28. package/dist/collection/entrypoint.js +34 -34
  29. package/dist/collection/global/global.js +4 -4
  30. package/dist/collection/services/FormatJs.js +15 -15
  31. package/dist/collection/services/WidgetHost.js +621 -778
  32. package/dist/collection/utilities.js +81 -81
  33. package/dist/esm/{WidgetHost-c033b6ac.js → WidgetHost-a27e693d.js} +615 -772
  34. package/dist/esm/{en-a652ab83.js → en-be593af0.js} +1 -1
  35. package/dist/esm/{index-342d7c26.js → index-8ea8b6d8.js} +3 -54
  36. package/dist/esm/loader.mjs +3 -3
  37. package/dist/esm/polyfills/core-js.js +0 -0
  38. package/dist/esm/polyfills/dom.js +0 -0
  39. package/dist/esm/polyfills/es5-html-element.js +0 -0
  40. package/dist/esm/polyfills/index.js +0 -0
  41. package/dist/esm/polyfills/system.js +0 -0
  42. package/dist/esm/sqh-close-button.entry.js +26 -26
  43. package/dist/esm/{sqh-copy-button_14.entry.js → sqh-copy-button_12.entry.js} +1214 -2286
  44. package/dist/esm/sqh-referral-code.entry.js +23 -23
  45. package/dist/esm/sqh-rewards-actions.entry.js +27 -27
  46. package/dist/esm/widget-components.mjs +3 -3
  47. package/dist/esm-es5/{WidgetHost-c033b6ac.js → WidgetHost-a27e693d.js} +9432 -9524
  48. package/dist/esm-es5/_commonjsHelpers-1d681858.js +17 -17
  49. package/dist/esm-es5/css-shim-a659079f.js +122 -122
  50. package/dist/esm-es5/dom-4061ceba.js +468 -468
  51. package/dist/esm-es5/{en-a652ab83.js → en-be593af0.js} +1471 -1471
  52. package/dist/esm-es5/{index-342d7c26.js → index-8ea8b6d8.js} +1758 -1808
  53. package/dist/esm-es5/loader.mjs +11 -11
  54. package/dist/esm-es5/sqh-close-button.entry.js +35 -35
  55. package/dist/esm-es5/{sqh-copy-button_14.entry.js → sqh-copy-button_12.entry.js} +9624 -10588
  56. package/dist/esm-es5/sqh-referral-code.entry.js +29 -29
  57. package/dist/esm-es5/sqh-rewards-actions.entry.js +31 -31
  58. package/dist/esm-es5/widget-components.mjs +6 -6
  59. package/dist/types/components/close-button/close-button.d.ts +16 -18
  60. package/dist/types/components/copy-button/copy-button.d.ts +90 -90
  61. package/dist/types/components/copy-link-button/copy-link-button.d.ts +53 -53
  62. package/dist/types/components/global-container/global-container.d.ts +39 -39
  63. package/dist/types/components/image-component/image-component.d.ts +45 -45
  64. package/dist/types/components/partner-stat-component/partner-stat-component.d.ts +51 -51
  65. package/dist/types/components/referral-code/referral-code.d.ts +12 -12
  66. package/dist/types/components/referral-component/referral-component.d.ts +46 -46
  67. package/dist/types/components/referral-list/referral-list.d.ts +234 -234
  68. package/dist/types/components/rewards-actions/rewards-actions.d.ts +25 -25
  69. package/dist/types/components/share-button/share-button.d.ts +77 -77
  70. package/dist/types/components/share-button-container/share-button-container.d.ts +593 -593
  71. package/dist/types/components/stat-component/stat-component.d.ts +48 -49
  72. package/dist/types/components/stats-container/stats-container.d.ts +47 -47
  73. package/dist/types/components/text-component/text-component.d.ts +74 -73
  74. package/dist/types/components.d.ts +2 -292
  75. package/dist/types/global/global.d.ts +4 -4
  76. package/dist/types/saasquatch.d.ts +105 -105
  77. package/dist/types/services/FormatJs.d.ts +7 -7
  78. package/dist/types/services/WidgetHost.d.ts +45 -51
  79. package/dist/types/utilities.d.ts +7 -7
  80. package/dist/widget-components/entrypoint.js +34 -34
  81. package/dist/widget-components/p-0bfec452.entry.js +149 -0
  82. package/dist/widget-components/p-24fc4ba9.js +1 -1
  83. package/dist/widget-components/{p-17d80384.js → p-44a6559d.js} +1 -1
  84. package/dist/widget-components/p-46109683.js +3 -3
  85. package/dist/widget-components/p-485eaf44.js +1 -0
  86. package/dist/widget-components/{p-e82def83.system.js → p-58be1132.system.js} +1 -1
  87. package/dist/widget-components/{p-3ba562d0.entry.js → p-650d012d.entry.js} +1 -1
  88. package/dist/widget-components/p-796dc228.system.entry.js +8 -0
  89. package/dist/widget-components/{p-d9e9c55c.system.entry.js → p-908068c2.system.entry.js} +1 -1
  90. package/dist/widget-components/{p-6e753d23.js → p-9525bf4a.js} +3 -68
  91. package/dist/widget-components/{p-fb528be6.entry.js → p-9746ae26.entry.js} +1 -1
  92. package/dist/widget-components/{p-54e83dfb.system.js → p-9adc7c50.system.js} +2 -2
  93. package/dist/widget-components/{p-aaf44379.system.js → p-a846f503.system.js} +1 -1
  94. package/dist/widget-components/{p-abf8a511.system.entry.js → p-c0cdba77.system.entry.js} +1 -1
  95. package/dist/widget-components/{p-4293e873.entry.js → p-d4b27c72.entry.js} +1 -1
  96. package/dist/widget-components/{p-665b8d42.system.entry.js → p-e2b4739f.system.entry.js} +1 -1
  97. package/dist/widget-components/p-e61a8100.system.js +1 -0
  98. package/dist/widget-components/widget-components.esm.js +1 -1
  99. package/dist/widget-components/widget-components.js +1 -1
  100. package/docs/raisins.json +1 -1
  101. package/package.json +97 -98
  102. package/readme.md +52 -52
  103. package/dist/collection/components/cta-component/cta-component.css +0 -6
  104. package/dist/collection/components/cta-component/cta-component.js +0 -396
  105. package/dist/collection/components/progress-indicator/progress-indicator.css +0 -73
  106. package/dist/collection/components/progress-indicator/progress-indicator.js +0 -557
  107. package/dist/types/components/cta-component/cta-component.d.ts +0 -95
  108. package/dist/types/components/progress-indicator/progress-indicator.d.ts +0 -94
  109. package/dist/widget-components/p-9fb4b935.system.entry.js +0 -10
  110. package/dist/widget-components/p-ad5121cf.system.js +0 -1
  111. package/dist/widget-components/p-d9a22d83.entry.js +0 -233
  112. package/dist/widget-components/p-fbf0c7fe.js +0 -1
@@ -1,17 +1,17 @@
1
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
- function unwrapExports(x) {
3
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
4
- }
5
- function createCommonjsModule(fn, basedir, module) {
6
- return module = {
7
- path: basedir,
8
- exports: {},
9
- require: function (path, base) {
10
- return commonjsRequire();
11
- }
12
- }, fn(module, module.exports), module.exports;
13
- }
14
- function commonjsRequire() {
15
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
16
- }
17
- export { commonjsGlobal as a, createCommonjsModule as c, unwrapExports as u };
1
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
+ function unwrapExports(x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
4
+ }
5
+ function createCommonjsModule(fn, basedir, module) {
6
+ return module = {
7
+ path: basedir,
8
+ exports: {},
9
+ require: function (path, base) {
10
+ return commonjsRequire();
11
+ }
12
+ }, fn(module, module.exports), module.exports;
13
+ }
14
+ function commonjsRequire() {
15
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
16
+ }
17
+ export { commonjsGlobal as a, createCommonjsModule as c, unwrapExports as u };
@@ -1,122 +1,122 @@
1
- /*
2
- Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com
3
- */
4
- var StyleNode = function () { this.start = 0, this.end = 0, this.previous = null, this.parent = null, this.rules = null, this.parsedCssText = "", this.cssText = "", this.atRule = !1, this.type = 0, this.keyframesName = "", this.selector = "", this.parsedSelector = ""; };
5
- function parse(e) { return parseCss(lex(e = clean(e)), e); }
6
- function clean(e) { return e.replace(RX.comments, "").replace(RX.port, ""); }
7
- function lex(e) { var t = new StyleNode; t.start = 0, t.end = e.length; for (var r = t, n = 0, s = e.length; n < s; n++)
8
- if (e[n] === OPEN_BRACE) {
9
- r.rules || (r.rules = []);
10
- var o = r, a = o.rules[o.rules.length - 1] || null;
11
- (r = new StyleNode).start = n + 1, r.parent = o, r.previous = a, o.rules.push(r);
12
- }
13
- else
14
- e[n] === CLOSE_BRACE && (r.end = n + 1, r = r.parent || t); return t; }
15
- function parseCss(e, t) { var r = t.substring(e.start, e.end - 1); if (e.parsedCssText = e.cssText = r.trim(), e.parent) {
16
- var n = e.previous ? e.previous.end : e.parent.start;
17
- r = (r = (r = _expandUnicodeEscapes(r = t.substring(n, e.start - 1))).replace(RX.multipleSpaces, " ")).substring(r.lastIndexOf(";") + 1);
18
- var s = e.parsedSelector = e.selector = r.trim();
19
- e.atRule = 0 === s.indexOf(AT_START), e.atRule ? 0 === s.indexOf(MEDIA_START) ? e.type = types.MEDIA_RULE : s.match(RX.keyframesRule) && (e.type = types.KEYFRAMES_RULE, e.keyframesName = e.selector.split(RX.multipleSpaces).pop()) : 0 === s.indexOf(VAR_START) ? e.type = types.MIXIN_RULE : e.type = types.STYLE_RULE;
20
- } var o = e.rules; if (o)
21
- for (var a = 0, i = o.length, l = void 0; a < i && (l = o[a]); a++)
22
- parseCss(l, t); return e; }
23
- function _expandUnicodeEscapes(e) { return e.replace(/\\([0-9a-f]{1,6})\s/gi, (function () { for (var e = arguments[1], t = 6 - e.length; t--;)
24
- e = "0" + e; return "\\" + e; })); }
25
- var types = { STYLE_RULE: 1, KEYFRAMES_RULE: 7, MEDIA_RULE: 4, MIXIN_RULE: 1e3 }, OPEN_BRACE = "{", CLOSE_BRACE = "}", RX = { comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, port: /@import[^;]*;/gim, customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, keyframesRule: /^@[^\s]*keyframes/, multipleSpaces: /\s+/g }, VAR_START = "--", MEDIA_START = "@media", AT_START = "@";
26
- function findRegex(e, t, r) { e.lastIndex = 0; var n = t.substring(r).match(e); if (n) {
27
- var s = r + n.index;
28
- return { start: s, end: s + n[0].length };
29
- } return null; }
30
- var VAR_USAGE_START = /\bvar\(/, VAR_ASSIGN_START = /\B--[\w-]+\s*:/, COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, TRAILING_LINES = /^[\t ]+\n/gm;
31
- function resolveVar(e, t, r) { return e[t] ? e[t] : r ? executeTemplate(r, e) : ""; }
32
- function findVarEndIndex(e, t) { for (var r = 0, n = t; n < e.length; n++) {
33
- var s = e[n];
34
- if ("(" === s)
35
- r++;
36
- else if (")" === s && --r <= 0)
37
- return n + 1;
38
- } return n; }
39
- function parseVar(e, t) { var r = findRegex(VAR_USAGE_START, e, t); if (!r)
40
- return null; var n = findVarEndIndex(e, r.start), s = e.substring(r.end, n - 1).split(","), o = s[0], a = s.slice(1); return { start: r.start, end: n, propName: o.trim(), fallback: a.length > 0 ? a.join(",").trim() : void 0 }; }
41
- function compileVar(e, t, r) { var n = parseVar(e, r); if (!n)
42
- return t.push(e.substring(r, e.length)), e.length; var s = n.propName, o = null != n.fallback ? compileTemplate(n.fallback) : void 0; return t.push(e.substring(r, n.start), (function (e) { return resolveVar(e, s, o); })), n.end; }
43
- function executeTemplate(e, t) { for (var r = "", n = 0; n < e.length; n++) {
44
- var s = e[n];
45
- r += "string" == typeof s ? s : s(t);
46
- } return r; }
47
- function findEndValue(e, t) { for (var r = !1, n = !1, s = t; s < e.length; s++) {
48
- var o = e[s];
49
- if (r)
50
- n && '"' === o && (r = !1), n || "'" !== o || (r = !1);
51
- else if ('"' === o)
52
- r = !0, n = !0;
53
- else if ("'" === o)
54
- r = !0, n = !1;
55
- else {
56
- if (";" === o)
57
- return s + 1;
58
- if ("}" === o)
59
- return s;
60
- }
61
- } return s; }
62
- function removeCustomAssigns(e) { for (var t = "", r = 0;;) {
63
- var n = findRegex(VAR_ASSIGN_START, e, r), s = n ? n.start : e.length;
64
- if (t += e.substring(r, s), !n)
65
- break;
66
- r = findEndValue(e, s);
67
- } return t; }
68
- function compileTemplate(e) { var t = 0; e = removeCustomAssigns(e = e.replace(COMMENTS, "")).replace(TRAILING_LINES, ""); for (var r = []; t < e.length;)
69
- t = compileVar(e, r, t); return r; }
70
- function resolveValues(e) { var t = {}; e.forEach((function (e) { e.declarations.forEach((function (e) { t[e.prop] = e.value; })); })); for (var r = {}, n = Object.entries(t), s = function (e) { var t = !1; if (n.forEach((function (e) { var n = e[0], s = executeTemplate(e[1], r); s !== r[n] && (r[n] = s, t = !0); })), !t)
71
- return "break"; }, o = 0; o < 10; o++) {
72
- if ("break" === s())
73
- break;
74
- } return r; }
75
- function getSelectors(e, t) { if (void 0 === t && (t = 0), !e.rules)
76
- return []; var r = []; return e.rules.filter((function (e) { return e.type === types.STYLE_RULE; })).forEach((function (e) { var n = getDeclarations(e.cssText); n.length > 0 && e.parsedSelector.split(",").forEach((function (e) { e = e.trim(), r.push({ selector: e, declarations: n, specificity: computeSpecificity(), nu: t }); })), t++; })), r; }
77
- function computeSpecificity(e) { return 1; }
78
- var IMPORTANT = "!important", FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;
79
- function getDeclarations(e) { for (var t, r = []; t = FIND_DECLARATIONS.exec(e.trim());) {
80
- var n = normalizeValue(t[2]), s = n.value, o = n.important;
81
- r.push({ prop: t[1].trim(), value: compileTemplate(s), important: o });
82
- } return r; }
83
- function normalizeValue(e) { var t = (e = e.replace(/\s+/gim, " ").trim()).endsWith(IMPORTANT); return t && (e = e.substr(0, e.length - IMPORTANT.length).trim()), { value: e, important: t }; }
84
- function getActiveSelectors(e, t, r) { var n = [], s = getScopesForElement(t, e); return r.forEach((function (e) { return n.push(e); })), s.forEach((function (e) { return n.push(e); })), sortSelectors(getSelectorsForScopes(n).filter((function (t) { return matches(e, t.selector); }))); }
85
- function getScopesForElement(e, t) { for (var r = []; t;) {
86
- var n = e.get(t);
87
- n && r.push(n), t = t.parentElement;
88
- } return r; }
89
- function getSelectorsForScopes(e) { var t = []; return e.forEach((function (e) { t.push.apply(t, e.selectors); })), t; }
90
- function sortSelectors(e) { return e.sort((function (e, t) { return e.specificity === t.specificity ? e.nu - t.nu : e.specificity - t.specificity; })), e; }
91
- function matches(e, t) { return ":root" === t || "html" === t || e.matches(t); }
92
- function parseCSS(e) { var t = parse(e), r = compileTemplate(e); return { original: e, template: r, selectors: getSelectors(t), usesCssVars: r.length > 1 }; }
93
- function addGlobalStyle(e, t) { if (e.some((function (e) { return e.styleEl === t; })))
94
- return !1; var r = parseCSS(t.textContent); return r.styleEl = t, e.push(r), !0; }
95
- function updateGlobalScopes(e) { var t = resolveValues(getSelectorsForScopes(e)); e.forEach((function (e) { e.usesCssVars && (e.styleEl.textContent = executeTemplate(e.template, t)); })); }
96
- function reScope(e, t) { var r = e.template.map((function (r) { return "string" == typeof r ? replaceScope(r, e.scopeId, t) : r; })), n = e.selectors.map((function (r) { return Object.assign(Object.assign({}, r), { selector: replaceScope(r.selector, e.scopeId, t) }); })); return Object.assign(Object.assign({}, e), { template: r, selectors: n, scopeId: t }); }
97
- function replaceScope(e, t, r) { return e = replaceAll(e, "\\." + t, "." + r); }
98
- function replaceAll(e, t, r) { return e.replace(new RegExp(t, "g"), r); }
99
- function loadDocument(e, t) { return loadDocumentStyles(e, t), loadDocumentLinks(e, t).then((function () { updateGlobalScopes(t); })); }
100
- function startWatcher(e, t) { "undefined" != typeof MutationObserver && new MutationObserver((function () { loadDocumentStyles(e, t) && updateGlobalScopes(t); })).observe(document.head, { childList: !0 }); }
101
- function loadDocumentLinks(e, t) { for (var r = [], n = e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'), s = 0; s < n.length; s++)
102
- r.push(addGlobalLink(e, t, n[s])); return Promise.all(r); }
103
- function loadDocumentStyles(e, t) { return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function (e) { return addGlobalStyle(t, e); })).some(Boolean); }
104
- function addGlobalLink(e, t, r) { var n = r.href; return fetch(n).then((function (e) { return e.text(); })).then((function (s) { if (hasCssVariables(s) && r.parentNode) {
105
- hasRelativeUrls(s) && (s = fixRelativeUrls(s, n));
106
- var o = e.createElement("style");
107
- o.setAttribute("data-styles", ""), o.textContent = s, addGlobalStyle(t, o), r.parentNode.insertBefore(o, r), r.remove();
108
- } })).catch((function (e) { console.error(e); })); }
109
- var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m;
110
- function hasCssVariables(e) { return e.indexOf("var(") > -1 || CSS_VARIABLE_REGEXP.test(e); }
111
- var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;
112
- function hasRelativeUrls(e) { return CSS_URL_REGEXP.lastIndex = 0, CSS_URL_REGEXP.test(e); }
113
- function fixRelativeUrls(e, t) { var r = t.replace(/[^/]*$/, ""); return e.replace(CSS_URL_REGEXP, (function (e, t) { var n = r + t; return e.replace(t, n); })); }
114
- var CustomStyle = function () { function e(e, t) { this.win = e, this.doc = t, this.count = 0, this.hostStyleMap = new WeakMap, this.hostScopeMap = new WeakMap, this.globalScopes = [], this.scopesMap = new Map, this.didInit = !1; } return e.prototype.i = function () { var e = this; return this.didInit || !this.win.requestAnimationFrame ? Promise.resolve() : (this.didInit = !0, new Promise((function (t) { e.win.requestAnimationFrame((function () { startWatcher(e.doc, e.globalScopes), loadDocument(e.doc, e.globalScopes).then((function () { return t(); })); })); }))); }, e.prototype.addLink = function (e) { var t = this; return addGlobalLink(this.doc, this.globalScopes, e).then((function () { t.updateGlobal(); })); }, e.prototype.addGlobalStyle = function (e) { addGlobalStyle(this.globalScopes, e) && this.updateGlobal(); }, e.prototype.createHostStyle = function (e, t, r, n) { if (this.hostScopeMap.has(e))
115
- throw new Error("host style already created"); var s = this.registerHostTemplate(r, t, n), o = this.doc.createElement("style"); return o.setAttribute("data-no-shim", ""), s.usesCssVars ? n ? (o["s-sc"] = t = s.scopeId + "-" + this.count, o.textContent = "/*needs update*/", this.hostStyleMap.set(e, o), this.hostScopeMap.set(e, reScope(s, t)), this.count++) : (s.styleEl = o, s.usesCssVars || (o.textContent = executeTemplate(s.template, {})), this.globalScopes.push(s), this.updateGlobal(), this.hostScopeMap.set(e, s)) : o.textContent = r, o; }, e.prototype.removeHost = function (e) { var t = this.hostStyleMap.get(e); t && t.remove(), this.hostStyleMap.delete(e), this.hostScopeMap.delete(e); }, e.prototype.updateHost = function (e) { var t = this.hostScopeMap.get(e); if (t && t.usesCssVars && t.isScoped) {
116
- var r = this.hostStyleMap.get(e);
117
- if (r) {
118
- var n = resolveValues(getActiveSelectors(e, this.hostScopeMap, this.globalScopes));
119
- r.textContent = executeTemplate(t.template, n);
120
- }
121
- } }, e.prototype.updateGlobal = function () { updateGlobalScopes(this.globalScopes); }, e.prototype.registerHostTemplate = function (e, t, r) { var n = this.scopesMap.get(t); return n || ((n = parseCSS(e)).scopeId = t, n.isScoped = r, this.scopesMap.set(t, n)), n; }, e; }();
122
- !function (e) { !e || e.__cssshim || e.CSS && e.CSS.supports && e.CSS.supports("color", "var(--c)") || (e.__cssshim = new CustomStyle(e, e.document)); }("undefined" != typeof window && window);
1
+ /*
2
+ Stencil Client Patch v1.17.3 | MIT Licensed | https://stenciljs.com
3
+ */
4
+ var StyleNode = function () { this.start = 0, this.end = 0, this.previous = null, this.parent = null, this.rules = null, this.parsedCssText = "", this.cssText = "", this.atRule = !1, this.type = 0, this.keyframesName = "", this.selector = "", this.parsedSelector = ""; };
5
+ function parse(e) { return parseCss(lex(e = clean(e)), e); }
6
+ function clean(e) { return e.replace(RX.comments, "").replace(RX.port, ""); }
7
+ function lex(e) { var t = new StyleNode; t.start = 0, t.end = e.length; for (var r = t, n = 0, s = e.length; n < s; n++)
8
+ if (e[n] === OPEN_BRACE) {
9
+ r.rules || (r.rules = []);
10
+ var o = r, a = o.rules[o.rules.length - 1] || null;
11
+ (r = new StyleNode).start = n + 1, r.parent = o, r.previous = a, o.rules.push(r);
12
+ }
13
+ else
14
+ e[n] === CLOSE_BRACE && (r.end = n + 1, r = r.parent || t); return t; }
15
+ function parseCss(e, t) { var r = t.substring(e.start, e.end - 1); if (e.parsedCssText = e.cssText = r.trim(), e.parent) {
16
+ var n = e.previous ? e.previous.end : e.parent.start;
17
+ r = (r = (r = _expandUnicodeEscapes(r = t.substring(n, e.start - 1))).replace(RX.multipleSpaces, " ")).substring(r.lastIndexOf(";") + 1);
18
+ var s = e.parsedSelector = e.selector = r.trim();
19
+ e.atRule = 0 === s.indexOf(AT_START), e.atRule ? 0 === s.indexOf(MEDIA_START) ? e.type = types.MEDIA_RULE : s.match(RX.keyframesRule) && (e.type = types.KEYFRAMES_RULE, e.keyframesName = e.selector.split(RX.multipleSpaces).pop()) : 0 === s.indexOf(VAR_START) ? e.type = types.MIXIN_RULE : e.type = types.STYLE_RULE;
20
+ } var o = e.rules; if (o)
21
+ for (var a = 0, i = o.length, l = void 0; a < i && (l = o[a]); a++)
22
+ parseCss(l, t); return e; }
23
+ function _expandUnicodeEscapes(e) { return e.replace(/\\([0-9a-f]{1,6})\s/gi, (function () { for (var e = arguments[1], t = 6 - e.length; t--;)
24
+ e = "0" + e; return "\\" + e; })); }
25
+ var types = { STYLE_RULE: 1, KEYFRAMES_RULE: 7, MEDIA_RULE: 4, MIXIN_RULE: 1e3 }, OPEN_BRACE = "{", CLOSE_BRACE = "}", RX = { comments: /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, port: /@import[^;]*;/gim, customProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim, mixinProp: /(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim, mixinApply: /@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim, varApply: /[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim, keyframesRule: /^@[^\s]*keyframes/, multipleSpaces: /\s+/g }, VAR_START = "--", MEDIA_START = "@media", AT_START = "@";
26
+ function findRegex(e, t, r) { e.lastIndex = 0; var n = t.substring(r).match(e); if (n) {
27
+ var s = r + n.index;
28
+ return { start: s, end: s + n[0].length };
29
+ } return null; }
30
+ var VAR_USAGE_START = /\bvar\(/, VAR_ASSIGN_START = /\B--[\w-]+\s*:/, COMMENTS = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim, TRAILING_LINES = /^[\t ]+\n/gm;
31
+ function resolveVar(e, t, r) { return e[t] ? e[t] : r ? executeTemplate(r, e) : ""; }
32
+ function findVarEndIndex(e, t) { for (var r = 0, n = t; n < e.length; n++) {
33
+ var s = e[n];
34
+ if ("(" === s)
35
+ r++;
36
+ else if (")" === s && --r <= 0)
37
+ return n + 1;
38
+ } return n; }
39
+ function parseVar(e, t) { var r = findRegex(VAR_USAGE_START, e, t); if (!r)
40
+ return null; var n = findVarEndIndex(e, r.start), s = e.substring(r.end, n - 1).split(","), o = s[0], a = s.slice(1); return { start: r.start, end: n, propName: o.trim(), fallback: a.length > 0 ? a.join(",").trim() : void 0 }; }
41
+ function compileVar(e, t, r) { var n = parseVar(e, r); if (!n)
42
+ return t.push(e.substring(r, e.length)), e.length; var s = n.propName, o = null != n.fallback ? compileTemplate(n.fallback) : void 0; return t.push(e.substring(r, n.start), (function (e) { return resolveVar(e, s, o); })), n.end; }
43
+ function executeTemplate(e, t) { for (var r = "", n = 0; n < e.length; n++) {
44
+ var s = e[n];
45
+ r += "string" == typeof s ? s : s(t);
46
+ } return r; }
47
+ function findEndValue(e, t) { for (var r = !1, n = !1, s = t; s < e.length; s++) {
48
+ var o = e[s];
49
+ if (r)
50
+ n && '"' === o && (r = !1), n || "'" !== o || (r = !1);
51
+ else if ('"' === o)
52
+ r = !0, n = !0;
53
+ else if ("'" === o)
54
+ r = !0, n = !1;
55
+ else {
56
+ if (";" === o)
57
+ return s + 1;
58
+ if ("}" === o)
59
+ return s;
60
+ }
61
+ } return s; }
62
+ function removeCustomAssigns(e) { for (var t = "", r = 0;;) {
63
+ var n = findRegex(VAR_ASSIGN_START, e, r), s = n ? n.start : e.length;
64
+ if (t += e.substring(r, s), !n)
65
+ break;
66
+ r = findEndValue(e, s);
67
+ } return t; }
68
+ function compileTemplate(e) { var t = 0; e = removeCustomAssigns(e = e.replace(COMMENTS, "")).replace(TRAILING_LINES, ""); for (var r = []; t < e.length;)
69
+ t = compileVar(e, r, t); return r; }
70
+ function resolveValues(e) { var t = {}; e.forEach((function (e) { e.declarations.forEach((function (e) { t[e.prop] = e.value; })); })); for (var r = {}, n = Object.entries(t), s = function (e) { var t = !1; if (n.forEach((function (e) { var n = e[0], s = executeTemplate(e[1], r); s !== r[n] && (r[n] = s, t = !0); })), !t)
71
+ return "break"; }, o = 0; o < 10; o++) {
72
+ if ("break" === s())
73
+ break;
74
+ } return r; }
75
+ function getSelectors(e, t) { if (void 0 === t && (t = 0), !e.rules)
76
+ return []; var r = []; return e.rules.filter((function (e) { return e.type === types.STYLE_RULE; })).forEach((function (e) { var n = getDeclarations(e.cssText); n.length > 0 && e.parsedSelector.split(",").forEach((function (e) { e = e.trim(), r.push({ selector: e, declarations: n, specificity: computeSpecificity(), nu: t }); })), t++; })), r; }
77
+ function computeSpecificity(e) { return 1; }
78
+ var IMPORTANT = "!important", FIND_DECLARATIONS = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;
79
+ function getDeclarations(e) { for (var t, r = []; t = FIND_DECLARATIONS.exec(e.trim());) {
80
+ var n = normalizeValue(t[2]), s = n.value, o = n.important;
81
+ r.push({ prop: t[1].trim(), value: compileTemplate(s), important: o });
82
+ } return r; }
83
+ function normalizeValue(e) { var t = (e = e.replace(/\s+/gim, " ").trim()).endsWith(IMPORTANT); return t && (e = e.substr(0, e.length - IMPORTANT.length).trim()), { value: e, important: t }; }
84
+ function getActiveSelectors(e, t, r) { var n = [], s = getScopesForElement(t, e); return r.forEach((function (e) { return n.push(e); })), s.forEach((function (e) { return n.push(e); })), sortSelectors(getSelectorsForScopes(n).filter((function (t) { return matches(e, t.selector); }))); }
85
+ function getScopesForElement(e, t) { for (var r = []; t;) {
86
+ var n = e.get(t);
87
+ n && r.push(n), t = t.parentElement;
88
+ } return r; }
89
+ function getSelectorsForScopes(e) { var t = []; return e.forEach((function (e) { t.push.apply(t, e.selectors); })), t; }
90
+ function sortSelectors(e) { return e.sort((function (e, t) { return e.specificity === t.specificity ? e.nu - t.nu : e.specificity - t.specificity; })), e; }
91
+ function matches(e, t) { return ":root" === t || "html" === t || e.matches(t); }
92
+ function parseCSS(e) { var t = parse(e), r = compileTemplate(e); return { original: e, template: r, selectors: getSelectors(t), usesCssVars: r.length > 1 }; }
93
+ function addGlobalStyle(e, t) { if (e.some((function (e) { return e.styleEl === t; })))
94
+ return !1; var r = parseCSS(t.textContent); return r.styleEl = t, e.push(r), !0; }
95
+ function updateGlobalScopes(e) { var t = resolveValues(getSelectorsForScopes(e)); e.forEach((function (e) { e.usesCssVars && (e.styleEl.textContent = executeTemplate(e.template, t)); })); }
96
+ function reScope(e, t) { var r = e.template.map((function (r) { return "string" == typeof r ? replaceScope(r, e.scopeId, t) : r; })), n = e.selectors.map((function (r) { return Object.assign(Object.assign({}, r), { selector: replaceScope(r.selector, e.scopeId, t) }); })); return Object.assign(Object.assign({}, e), { template: r, selectors: n, scopeId: t }); }
97
+ function replaceScope(e, t, r) { return e = replaceAll(e, "\\." + t, "." + r); }
98
+ function replaceAll(e, t, r) { return e.replace(new RegExp(t, "g"), r); }
99
+ function loadDocument(e, t) { return loadDocumentStyles(e, t), loadDocumentLinks(e, t).then((function () { updateGlobalScopes(t); })); }
100
+ function startWatcher(e, t) { "undefined" != typeof MutationObserver && new MutationObserver((function () { loadDocumentStyles(e, t) && updateGlobalScopes(t); })).observe(document.head, { childList: !0 }); }
101
+ function loadDocumentLinks(e, t) { for (var r = [], n = e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'), s = 0; s < n.length; s++)
102
+ r.push(addGlobalLink(e, t, n[s])); return Promise.all(r); }
103
+ function loadDocumentStyles(e, t) { return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function (e) { return addGlobalStyle(t, e); })).some(Boolean); }
104
+ function addGlobalLink(e, t, r) { var n = r.href; return fetch(n).then((function (e) { return e.text(); })).then((function (s) { if (hasCssVariables(s) && r.parentNode) {
105
+ hasRelativeUrls(s) && (s = fixRelativeUrls(s, n));
106
+ var o = e.createElement("style");
107
+ o.setAttribute("data-styles", ""), o.textContent = s, addGlobalStyle(t, o), r.parentNode.insertBefore(o, r), r.remove();
108
+ } })).catch((function (e) { console.error(e); })); }
109
+ var CSS_VARIABLE_REGEXP = /[\s;{]--[-a-zA-Z0-9]+\s*:/m;
110
+ function hasCssVariables(e) { return e.indexOf("var(") > -1 || CSS_VARIABLE_REGEXP.test(e); }
111
+ var CSS_URL_REGEXP = /url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;
112
+ function hasRelativeUrls(e) { return CSS_URL_REGEXP.lastIndex = 0, CSS_URL_REGEXP.test(e); }
113
+ function fixRelativeUrls(e, t) { var r = t.replace(/[^/]*$/, ""); return e.replace(CSS_URL_REGEXP, (function (e, t) { var n = r + t; return e.replace(t, n); })); }
114
+ var CustomStyle = function () { function e(e, t) { this.win = e, this.doc = t, this.count = 0, this.hostStyleMap = new WeakMap, this.hostScopeMap = new WeakMap, this.globalScopes = [], this.scopesMap = new Map, this.didInit = !1; } return e.prototype.i = function () { var e = this; return this.didInit || !this.win.requestAnimationFrame ? Promise.resolve() : (this.didInit = !0, new Promise((function (t) { e.win.requestAnimationFrame((function () { startWatcher(e.doc, e.globalScopes), loadDocument(e.doc, e.globalScopes).then((function () { return t(); })); })); }))); }, e.prototype.addLink = function (e) { var t = this; return addGlobalLink(this.doc, this.globalScopes, e).then((function () { t.updateGlobal(); })); }, e.prototype.addGlobalStyle = function (e) { addGlobalStyle(this.globalScopes, e) && this.updateGlobal(); }, e.prototype.createHostStyle = function (e, t, r, n) { if (this.hostScopeMap.has(e))
115
+ throw new Error("host style already created"); var s = this.registerHostTemplate(r, t, n), o = this.doc.createElement("style"); return o.setAttribute("data-no-shim", ""), s.usesCssVars ? n ? (o["s-sc"] = t = s.scopeId + "-" + this.count, o.textContent = "/*needs update*/", this.hostStyleMap.set(e, o), this.hostScopeMap.set(e, reScope(s, t)), this.count++) : (s.styleEl = o, s.usesCssVars || (o.textContent = executeTemplate(s.template, {})), this.globalScopes.push(s), this.updateGlobal(), this.hostScopeMap.set(e, s)) : o.textContent = r, o; }, e.prototype.removeHost = function (e) { var t = this.hostStyleMap.get(e); t && t.remove(), this.hostStyleMap.delete(e), this.hostScopeMap.delete(e); }, e.prototype.updateHost = function (e) { var t = this.hostScopeMap.get(e); if (t && t.usesCssVars && t.isScoped) {
116
+ var r = this.hostStyleMap.get(e);
117
+ if (r) {
118
+ var n = resolveValues(getActiveSelectors(e, this.hostScopeMap, this.globalScopes));
119
+ r.textContent = executeTemplate(t.template, n);
120
+ }
121
+ } }, e.prototype.updateGlobal = function () { updateGlobalScopes(this.globalScopes); }, e.prototype.registerHostTemplate = function (e, t, r) { var n = this.scopesMap.get(t); return n || ((n = parseCSS(e)).scopeId = t, n.isScoped = r, this.scopesMap.set(t, n)), n; }, e; }();
122
+ !function (e) { !e || e.__cssshim || e.CSS && e.CSS.supports && e.CSS.supports("color", "var(--c)") || (e.__cssshim = new CustomStyle(e, e.document)); }("undefined" != typeof window && window);