@saasquatch/vanilla-components 1.2.4-4 → 1.2.4-7
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.
- package/LICENSE +21 -21
- package/dist/cjs/{WidgetHost-71b013eb.js → WidgetHost-d7b870ce.js} +615 -615
- package/dist/cjs/sqh-close-button.cjs.entry.js +25 -25
- package/dist/cjs/sqh-copy-button_12.cjs.entry.js +1134 -1050
- package/dist/cjs/sqh-referral-code.cjs.entry.js +22 -22
- package/dist/cjs/sqh-rewards-actions.cjs.entry.js +26 -26
- package/dist/collection/components/close-button/close-button.js +70 -70
- package/dist/collection/components/copy-button/copy-button.js +389 -389
- package/dist/collection/components/copy-link-button/copy-link-button.js +236 -233
- package/dist/collection/components/global-container/global-container.js +170 -170
- package/dist/collection/components/image-component/image-component.js +178 -175
- package/dist/collection/components/partner-stat-component/partner-stat-component.js +199 -193
- package/dist/collection/components/referral-code/referral-code.js +36 -36
- package/dist/collection/components/referral-component/referral-component.js +255 -255
- package/dist/collection/components/referral-list/referral-list.js +935 -932
- package/dist/collection/components/rewards-actions/rewards-actions.js +105 -105
- package/dist/collection/components/share-button/share-button.js +310 -310
- package/dist/collection/components/share-button-container/share-button-container.js +2457 -2470
- package/dist/collection/components/stat-component/stat-component.js +200 -194
- package/dist/collection/components/stats-container/stats-container.js +210 -208
- package/dist/collection/components/text-component/text-component.js +283 -280
- package/dist/collection/entrypoint.js +32 -32
- package/dist/collection/global/global.js +4 -4
- package/dist/collection/services/FormatJs.js +15 -15
- package/dist/collection/services/WidgetHost.js +621 -621
- package/dist/collection/utilities.js +81 -81
- package/dist/esm/{WidgetHost-9c337319.js → WidgetHost-a27e693d.js} +615 -615
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/sqh-close-button.entry.js +25 -25
- package/dist/esm/sqh-copy-button_12.entry.js +1134 -1050
- package/dist/esm/sqh-referral-code.entry.js +22 -22
- package/dist/esm/sqh-rewards-actions.entry.js +26 -26
- package/dist/esm-es5/{WidgetHost-9c337319.js → WidgetHost-a27e693d.js} +9432 -9432
- package/dist/esm-es5/_commonjsHelpers-1d681858.js +17 -17
- package/dist/esm-es5/css-shim-a659079f.js +122 -122
- package/dist/esm-es5/dom-4061ceba.js +468 -468
- package/dist/esm-es5/en-be593af0.js +1471 -1471
- package/dist/esm-es5/index-8ea8b6d8.js +1758 -1758
- package/dist/esm-es5/loader.mjs +11 -11
- package/dist/esm-es5/sqh-close-button.entry.js +35 -35
- package/dist/esm-es5/sqh-copy-button_12.entry.js +9643 -9571
- package/dist/esm-es5/sqh-referral-code.entry.js +29 -29
- package/dist/esm-es5/sqh-rewards-actions.entry.js +31 -31
- package/dist/esm-es5/widget-components.mjs +6 -6
- package/dist/types/components/close-button/close-button.d.ts +18 -18
- package/dist/types/components/copy-button/copy-button.d.ts +93 -107
- package/dist/types/components/copy-link-button/copy-link-button.d.ts +55 -62
- package/dist/types/components/global-container/global-container.d.ts +43 -47
- package/dist/types/components/image-component/image-component.d.ts +46 -51
- package/dist/types/components/partner-stat-component/partner-stat-component.d.ts +52 -54
- package/dist/types/components/referral-code/referral-code.d.ts +12 -12
- package/dist/types/components/referral-component/referral-component.d.ts +46 -46
- package/dist/types/components/referral-list/referral-list.d.ts +242 -251
- package/dist/types/components/rewards-actions/rewards-actions.d.ts +25 -25
- package/dist/types/components/share-button/share-button.d.ts +82 -82
- package/dist/types/components/share-button-container/share-button-container.d.ts +629 -684
- package/dist/types/components/stat-component/stat-component.d.ts +50 -54
- package/dist/types/components/stats-container/stats-container.d.ts +47 -48
- package/dist/types/components/text-component/text-component.d.ts +70 -81
- package/dist/types/components.d.ts +132 -234
- package/dist/types/global/global.d.ts +4 -4
- package/dist/types/saasquatch.d.ts +103 -103
- package/dist/types/services/FormatJs.d.ts +7 -7
- package/dist/types/services/WidgetHost.d.ts +45 -45
- package/dist/types/utilities.d.ts +7 -7
- package/dist/widget-components/entrypoint.js +32 -32
- package/dist/widget-components/p-24fc4ba9.js +1 -1
- package/dist/widget-components/p-46109683.js +3 -3
- package/dist/widget-components/p-58be1132.system.js +1 -1
- package/dist/widget-components/{p-54ea7a00.entry.js → p-650d012d.entry.js} +1 -1
- package/dist/widget-components/p-908068c2.system.entry.js +1 -0
- package/dist/widget-components/{p-edd43dbc.js → p-9525bf4a.js} +0 -0
- package/dist/widget-components/{p-8e232564.system.js → p-9adc7c50.system.js} +0 -0
- package/dist/widget-components/{p-b17efca4.system.entry.js → p-c0cdba77.system.entry.js} +1 -1
- package/dist/widget-components/{p-366f1663.entry.js → p-d4b27c72.entry.js} +1 -1
- package/dist/widget-components/{p-d416634a.entry.js → p-d7059393.entry.js} +16 -16
- package/dist/widget-components/p-fba5ea7f.system.entry.js +8 -0
- package/dist/widget-components/widget-components.esm.js +1 -1
- package/dist/widget-components/widget-components.js +1 -1
- package/docs/raisins.json +1 -1
- package/package.json +96 -96
- package/readme.md +52 -52
- package/dist/widget-components/p-c8bc8c77.system.entry.js +0 -1
- package/dist/widget-components/p-d97c955d.system.entry.js +0 -8
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
import { r as registerInstance, h, c as createEvent, g as getElement } from './index-8ea8b6d8.js';
|
|
2
2
|
import { c as createCommonjsModule, a as commonjsGlobal, u as unwrapExports } from './_commonjsHelpers-1d681858.js';
|
|
3
|
-
import { A as API } from './WidgetHost-
|
|
4
|
-
|
|
5
|
-
/////////////////////////////////////
|
|
6
|
-
////// ////
|
|
7
|
-
///// Color Utility Functions /////
|
|
8
|
-
//// //////
|
|
9
|
-
/////////////////////////////////////
|
|
10
|
-
const cutHex = (hex) => {
|
|
11
|
-
return hex.charAt(0) == "#" ? hex.substring(1) : hex;
|
|
12
|
-
};
|
|
13
|
-
const cutRgb = (rgb) => {
|
|
14
|
-
return rgb.substring(4, rgb.length - 1);
|
|
15
|
-
};
|
|
16
|
-
const hexToRgb = (hex) => {
|
|
17
|
-
const noHex = cutHex(hex);
|
|
18
|
-
const r = parseInt(noHex.substring(0, 2), 16);
|
|
19
|
-
const g = parseInt(noHex.substring(2, 4), 16);
|
|
20
|
-
const b = parseInt(noHex.substring(4, 6), 16);
|
|
21
|
-
return `rgb(${r}, ${g}, ${b})`;
|
|
22
|
-
};
|
|
23
|
-
const isHex = (string) => {
|
|
24
|
-
return !!string.match(/^#[0-9a-f]{6}$/i);
|
|
25
|
-
};
|
|
26
|
-
const isRgb = (string) => {
|
|
27
|
-
const rgbArray = cutRgb(string).split(", ");
|
|
28
|
-
if (rgbArray.length !== 3)
|
|
29
|
-
return false;
|
|
30
|
-
return rgbArray.every((x) => parseInt(x) >= 0 && parseInt(x) <= 255);
|
|
31
|
-
};
|
|
32
|
-
const shadeColor = (color, percent) => {
|
|
33
|
-
if (!isHex(color) && !isRgb(color))
|
|
34
|
-
return;
|
|
35
|
-
const rgb = isHex(color) ? hexToRgb(color) : color;
|
|
36
|
-
const decimalPercent = percent / 100;
|
|
37
|
-
const shadedArray = cutRgb(rgb)
|
|
38
|
-
.split(", ")
|
|
39
|
-
.map((n) => {
|
|
40
|
-
return Math.floor(parseInt(n) * (1 - decimalPercent));
|
|
41
|
-
});
|
|
42
|
-
return `rgb(${shadedArray.join(", ")})`;
|
|
43
|
-
};
|
|
44
|
-
/////////////////////
|
|
45
|
-
////// ////
|
|
46
|
-
///// Exports /////
|
|
47
|
-
//// //////
|
|
48
|
-
/////////////////////
|
|
49
|
-
const hasClass = (el, className) => {
|
|
50
|
-
if (el.classList)
|
|
51
|
-
return el.classList.contains(className);
|
|
52
|
-
else
|
|
53
|
-
return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
|
|
54
|
-
};
|
|
55
|
-
const addClass = (el, className) => {
|
|
56
|
-
if (el.classList) {
|
|
57
|
-
el.classList.add(className);
|
|
58
|
-
}
|
|
59
|
-
else if (!hasClass(el, className)) {
|
|
60
|
-
el.className += " " + className;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const removeClass = (el, className) => {
|
|
64
|
-
if (el.classList) {
|
|
65
|
-
el.classList.remove(className);
|
|
66
|
-
}
|
|
67
|
-
else if (hasClass(el, className)) {
|
|
68
|
-
const reg = new RegExp("(\\s|^)" + className + "(\\s|$)");
|
|
69
|
-
el.className = el.className.replace(reg, " ");
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const detectMobileSafari = () => {
|
|
73
|
-
return /iP(ad|hone|od).+Version\/[\d\.]+.*Safari/i.test(window.navigator.userAgent);
|
|
74
|
-
};
|
|
75
|
-
const detectMobileChrome = () => {
|
|
76
|
-
return window.navigator.userAgent.match("CriOS");
|
|
77
|
-
};
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
// https://gist.github.com/jed/982883
|
|
80
|
-
const uuid = function b(a = undefined) {
|
|
81
|
-
return a
|
|
82
|
-
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
83
|
-
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
3
|
+
import { A as API } from './WidgetHost-a27e693d.js';
|
|
4
|
+
|
|
5
|
+
/////////////////////////////////////
|
|
6
|
+
////// ////
|
|
7
|
+
///// Color Utility Functions /////
|
|
8
|
+
//// //////
|
|
9
|
+
/////////////////////////////////////
|
|
10
|
+
const cutHex = (hex) => {
|
|
11
|
+
return hex.charAt(0) == "#" ? hex.substring(1) : hex;
|
|
12
|
+
};
|
|
13
|
+
const cutRgb = (rgb) => {
|
|
14
|
+
return rgb.substring(4, rgb.length - 1);
|
|
15
|
+
};
|
|
16
|
+
const hexToRgb = (hex) => {
|
|
17
|
+
const noHex = cutHex(hex);
|
|
18
|
+
const r = parseInt(noHex.substring(0, 2), 16);
|
|
19
|
+
const g = parseInt(noHex.substring(2, 4), 16);
|
|
20
|
+
const b = parseInt(noHex.substring(4, 6), 16);
|
|
21
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
22
|
+
};
|
|
23
|
+
const isHex = (string) => {
|
|
24
|
+
return !!string.match(/^#[0-9a-f]{6}$/i);
|
|
25
|
+
};
|
|
26
|
+
const isRgb = (string) => {
|
|
27
|
+
const rgbArray = cutRgb(string).split(", ");
|
|
28
|
+
if (rgbArray.length !== 3)
|
|
29
|
+
return false;
|
|
30
|
+
return rgbArray.every((x) => parseInt(x) >= 0 && parseInt(x) <= 255);
|
|
31
|
+
};
|
|
32
|
+
const shadeColor = (color, percent) => {
|
|
33
|
+
if (!isHex(color) && !isRgb(color))
|
|
34
|
+
return;
|
|
35
|
+
const rgb = isHex(color) ? hexToRgb(color) : color;
|
|
36
|
+
const decimalPercent = percent / 100;
|
|
37
|
+
const shadedArray = cutRgb(rgb)
|
|
38
|
+
.split(", ")
|
|
39
|
+
.map((n) => {
|
|
40
|
+
return Math.floor(parseInt(n) * (1 - decimalPercent));
|
|
41
|
+
});
|
|
42
|
+
return `rgb(${shadedArray.join(", ")})`;
|
|
43
|
+
};
|
|
44
|
+
/////////////////////
|
|
45
|
+
////// ////
|
|
46
|
+
///// Exports /////
|
|
47
|
+
//// //////
|
|
48
|
+
/////////////////////
|
|
49
|
+
const hasClass = (el, className) => {
|
|
50
|
+
if (el.classList)
|
|
51
|
+
return el.classList.contains(className);
|
|
52
|
+
else
|
|
53
|
+
return !!el.className.match(new RegExp("(\\s|^)" + className + "(\\s|$)"));
|
|
54
|
+
};
|
|
55
|
+
const addClass = (el, className) => {
|
|
56
|
+
if (el.classList) {
|
|
57
|
+
el.classList.add(className);
|
|
58
|
+
}
|
|
59
|
+
else if (!hasClass(el, className)) {
|
|
60
|
+
el.className += " " + className;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const removeClass = (el, className) => {
|
|
64
|
+
if (el.classList) {
|
|
65
|
+
el.classList.remove(className);
|
|
66
|
+
}
|
|
67
|
+
else if (hasClass(el, className)) {
|
|
68
|
+
const reg = new RegExp("(\\s|^)" + className + "(\\s|$)");
|
|
69
|
+
el.className = el.className.replace(reg, " ");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const detectMobileSafari = () => {
|
|
73
|
+
return /iP(ad|hone|od).+Version\/[\d\.]+.*Safari/i.test(window.navigator.userAgent);
|
|
74
|
+
};
|
|
75
|
+
const detectMobileChrome = () => {
|
|
76
|
+
return window.navigator.userAgent.match("CriOS");
|
|
77
|
+
};
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
// https://gist.github.com/jed/982883
|
|
80
|
+
const uuid = function b(a = undefined) {
|
|
81
|
+
return a
|
|
82
|
+
? (a ^ ((Math.random() * 16) >> (a / 4))).toString(16)
|
|
83
|
+
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, b);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
/*
|
|
@@ -828,6 +828,21 @@ function stylis_min (W) {
|
|
|
828
828
|
return B;
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
+
var weakMemoize = function weakMemoize(func) {
|
|
832
|
+
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
833
|
+
var cache = new WeakMap();
|
|
834
|
+
return function (arg) {
|
|
835
|
+
if (cache.has(arg)) {
|
|
836
|
+
// $FlowFixMe
|
|
837
|
+
return cache.get(arg);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
var ret = func(arg);
|
|
841
|
+
cache.set(arg, ret);
|
|
842
|
+
return ret;
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
|
|
831
846
|
// https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
|
|
832
847
|
// inlined to avoid umd wrapper and peerDep warnings/installing stylis
|
|
833
848
|
// since we use stylis after closure compiler
|
|
@@ -902,6 +917,35 @@ var ruleSheet = function ruleSheet(context, content, selectors, parents, line, c
|
|
|
902
917
|
}
|
|
903
918
|
}
|
|
904
919
|
};
|
|
920
|
+
var removeLabel = function removeLabel(context, content) {
|
|
921
|
+
if (context === 1 && // charcode for l
|
|
922
|
+
content.charCodeAt(0) === 108 && // charcode for b
|
|
923
|
+
content.charCodeAt(2) === 98 // this ignores label
|
|
924
|
+
) {
|
|
925
|
+
return '';
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
var isBrowser = typeof document !== 'undefined';
|
|
930
|
+
var rootServerStylisCache = {};
|
|
931
|
+
var getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {
|
|
932
|
+
var getCache = weakMemoize(function () {
|
|
933
|
+
return {};
|
|
934
|
+
});
|
|
935
|
+
var prefixTrueCache = {};
|
|
936
|
+
var prefixFalseCache = {};
|
|
937
|
+
return function (prefix) {
|
|
938
|
+
if (prefix === undefined || prefix === true) {
|
|
939
|
+
return prefixTrueCache;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
if (prefix === false) {
|
|
943
|
+
return prefixFalseCache;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
return getCache(prefix);
|
|
947
|
+
};
|
|
948
|
+
});
|
|
905
949
|
|
|
906
950
|
var createCache = function createCache(options) {
|
|
907
951
|
if (options === undefined) options = {};
|
|
@@ -920,7 +964,7 @@ var createCache = function createCache(options) {
|
|
|
920
964
|
|
|
921
965
|
var container;
|
|
922
966
|
|
|
923
|
-
{
|
|
967
|
+
if (isBrowser) {
|
|
924
968
|
container = options.container || document.head;
|
|
925
969
|
var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
|
|
926
970
|
Array.prototype.forEach.call(nodes, function (node) {
|
|
@@ -938,7 +982,7 @@ var createCache = function createCache(options) {
|
|
|
938
982
|
|
|
939
983
|
var _insert;
|
|
940
984
|
|
|
941
|
-
{
|
|
985
|
+
if (isBrowser) {
|
|
942
986
|
stylis.use(options.stylisPlugins)(ruleSheet);
|
|
943
987
|
|
|
944
988
|
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
@@ -951,6 +995,54 @@ var createCache = function createCache(options) {
|
|
|
951
995
|
cache.inserted[name] = true;
|
|
952
996
|
}
|
|
953
997
|
};
|
|
998
|
+
} else {
|
|
999
|
+
stylis.use(removeLabel);
|
|
1000
|
+
var serverStylisCache = rootServerStylisCache;
|
|
1001
|
+
|
|
1002
|
+
if (options.stylisPlugins || options.prefix !== undefined) {
|
|
1003
|
+
stylis.use(options.stylisPlugins); // $FlowFixMe
|
|
1004
|
+
|
|
1005
|
+
serverStylisCache = getServerStylisCache(options.stylisPlugins || rootServerStylisCache)(options.prefix);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
var getRules = function getRules(selector, serialized) {
|
|
1009
|
+
var name = serialized.name;
|
|
1010
|
+
|
|
1011
|
+
if (serverStylisCache[name] === undefined) {
|
|
1012
|
+
serverStylisCache[name] = stylis(selector, serialized.styles);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
return serverStylisCache[name];
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
_insert = function _insert(selector, serialized, sheet, shouldCache) {
|
|
1019
|
+
var name = serialized.name;
|
|
1020
|
+
var rules = getRules(selector, serialized);
|
|
1021
|
+
|
|
1022
|
+
if (cache.compat === undefined) {
|
|
1023
|
+
// in regular mode, we don't set the styles on the inserted cache
|
|
1024
|
+
// since we don't need to and that would be wasting memory
|
|
1025
|
+
// we return them so that they are rendered in a style tag
|
|
1026
|
+
if (shouldCache) {
|
|
1027
|
+
cache.inserted[name] = true;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
return rules;
|
|
1031
|
+
} else {
|
|
1032
|
+
// in compat mode, we put the styles on the inserted cache so
|
|
1033
|
+
// that emotion-server can pull out the styles
|
|
1034
|
+
// except when we don't want to cache it which was in Global but now
|
|
1035
|
+
// is nowhere but we don't want to do a major right now
|
|
1036
|
+
// and just in case we're going to leave the case here
|
|
1037
|
+
// it's also not affecting client side bundle size
|
|
1038
|
+
// so it's really not a big deal
|
|
1039
|
+
if (shouldCache) {
|
|
1040
|
+
cache.inserted[name] = rules;
|
|
1041
|
+
} else {
|
|
1042
|
+
return rules;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
954
1046
|
}
|
|
955
1047
|
|
|
956
1048
|
var cache = {
|
|
@@ -1299,7 +1391,7 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
1299
1391
|
};
|
|
1300
1392
|
};
|
|
1301
1393
|
|
|
1302
|
-
var isBrowser =
|
|
1394
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
1303
1395
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
1304
1396
|
var rawClassName = '';
|
|
1305
1397
|
classNames.split(' ').forEach(function (className) {
|
|
@@ -1323,18 +1415,27 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
1323
1415
|
// in node since emotion-server relies on whether a style is in
|
|
1324
1416
|
// the registered cache to know whether a style is global or not
|
|
1325
1417
|
// also, note that this check will be dead code eliminated in the browser
|
|
1326
|
-
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
1418
|
+
isBrowser$1 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
1327
1419
|
cache.registered[className] = serialized.styles;
|
|
1328
1420
|
}
|
|
1329
1421
|
|
|
1330
1422
|
if (cache.inserted[serialized.name] === undefined) {
|
|
1423
|
+
var stylesForSSR = '';
|
|
1331
1424
|
var current = serialized;
|
|
1332
1425
|
|
|
1333
1426
|
do {
|
|
1334
1427
|
var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
|
|
1335
1428
|
|
|
1429
|
+
if (!isBrowser$1 && maybeStyles !== undefined) {
|
|
1430
|
+
stylesForSSR += maybeStyles;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1336
1433
|
current = current.next;
|
|
1337
1434
|
} while (current !== undefined);
|
|
1435
|
+
|
|
1436
|
+
if (!isBrowser$1 && stylesForSSR.length !== 0) {
|
|
1437
|
+
return stylesForSSR;
|
|
1438
|
+
}
|
|
1338
1439
|
}
|
|
1339
1440
|
};
|
|
1340
1441
|
|
|
@@ -2447,226 +2548,226 @@ const Clipboard = unwrapExports(clipboard);
|
|
|
2447
2548
|
|
|
2448
2549
|
const copyButtonCss = "sqh-copy-button{display:block}sqh-copy-button .sqh-align-button{text-align:center;position:relative;margin:20px 0}sqh-copy-button .sqh-align-button .sqh-copy-button{width:100%;text-align:center;padding:8px;cursor:pointer}sqh-copy-button .sqh-align-button .label{padding:0.2em 0.6em 0.3em;font-size:11px;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;border-radius:0.25em;background-color:#35b21e}sqh-copy-button .sqh-align-button .label:empty{display:none}sqh-copy-button .sqh-align-button .fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}sqh-copy-button .sqh-align-button .fade.in{opacity:1}sqh-copy-button .sqh-align-button #squatch-copy-notification{position:absolute;left:215px;bottom:35px;z-index:2}";
|
|
2449
2550
|
|
|
2450
|
-
const CopyButton = class {
|
|
2451
|
-
constructor(hostRef) {
|
|
2452
|
-
registerInstance(this, hostRef);
|
|
2453
|
-
}
|
|
2454
|
-
componentWillLoad() {
|
|
2455
|
-
if (!this.ishidden) {
|
|
2456
|
-
return API.graphql
|
|
2457
|
-
.getFueltankCode(this.rewardkey)
|
|
2458
|
-
.then((res) => {
|
|
2459
|
-
const fuelTank = res.rewards.data.length > 0
|
|
2460
|
-
? res.rewards.data[0].fuelTankCode
|
|
2461
|
-
: null;
|
|
2462
|
-
this.fueltankcode =
|
|
2463
|
-
fuelTank || res.referredByReferral.referrerUser.referralCode;
|
|
2464
|
-
})
|
|
2465
|
-
.catch((e) => {
|
|
2466
|
-
this.onError(e);
|
|
2467
|
-
});
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
onError(e) {
|
|
2471
|
-
console.log("Error loading via GraphQL.", e);
|
|
2472
|
-
}
|
|
2473
|
-
notify(clipboardNotification, notificationText) {
|
|
2474
|
-
const notification = document.getElementById(clipboardNotification.slice(1));
|
|
2475
|
-
notification.textContent = notificationText;
|
|
2476
|
-
addClass(notification, "in");
|
|
2477
|
-
setTimeout(() => {
|
|
2478
|
-
removeClass(notification, "in");
|
|
2479
|
-
}, 1400);
|
|
2480
|
-
}
|
|
2481
|
-
notifySuccess(e) {
|
|
2482
|
-
this.notify(e.trigger.dataset.clipboardNotification, this.copysuccess);
|
|
2483
|
-
}
|
|
2484
|
-
notifyFailure(e) {
|
|
2485
|
-
this.notify(e.trigger.dataset.clipboardNotification, this.copyfailure);
|
|
2486
|
-
}
|
|
2487
|
-
componentDidLoad() {
|
|
2488
|
-
const clipboard = new Clipboard("button");
|
|
2489
|
-
clipboard.on("success", this.notifySuccess.bind(this));
|
|
2490
|
-
clipboard.on("error", this.notifyFailure.bind(this));
|
|
2491
|
-
}
|
|
2492
|
-
render() {
|
|
2493
|
-
const style = css `
|
|
2494
|
-
max-width: ${this.width}px;
|
|
2495
|
-
background-color: ${this.backgroundcolor};
|
|
2496
|
-
border: ${this.backgroundcolor};
|
|
2497
|
-
color: ${this.textcolor};
|
|
2498
|
-
border-radius: ${this.borderradius}px;
|
|
2499
|
-
font-size: ${this.fontsize}px;
|
|
2500
|
-
|
|
2501
|
-
&:hover {
|
|
2502
|
-
background-color: ${shadeColor(this.backgroundcolor, 10)};
|
|
2503
|
-
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
2504
|
-
color: ${this.textcolor};
|
|
2505
|
-
}
|
|
2506
|
-
|
|
2507
|
-
&:focus {
|
|
2508
|
-
color: ${this.textcolor};
|
|
2509
|
-
}
|
|
2510
|
-
`;
|
|
2511
|
-
const code = css `
|
|
2512
|
-
text-align: center;
|
|
2513
|
-
font-weight: bold;
|
|
2514
|
-
font-size: ${this.codefontsize};
|
|
2515
|
-
color: ${this.codefontcolor};
|
|
2516
|
-
`;
|
|
2517
|
-
const classes = [`sqh-copy-button`, style].join(" ");
|
|
2518
|
-
return (!this.ishidden && (h("div", null, h("div", { class: code }, this.fueltankcode), h("div", { class: "sqh-align-button" }, h("span", { class: "label fade", id: "squatch-copy-notification" }, this.copysuccess), h("button", { class: classes, "data-clipboard-text": this.fueltankcode, "data-clipboard-notification": "#squatch-copy-notification" }, this.text)))));
|
|
2519
|
-
}
|
|
2520
|
-
};
|
|
2551
|
+
const CopyButton = class {
|
|
2552
|
+
constructor(hostRef) {
|
|
2553
|
+
registerInstance(this, hostRef);
|
|
2554
|
+
}
|
|
2555
|
+
componentWillLoad() {
|
|
2556
|
+
if (!this.ishidden) {
|
|
2557
|
+
return API.graphql
|
|
2558
|
+
.getFueltankCode(this.rewardkey)
|
|
2559
|
+
.then((res) => {
|
|
2560
|
+
const fuelTank = res.rewards.data.length > 0
|
|
2561
|
+
? res.rewards.data[0].fuelTankCode
|
|
2562
|
+
: null;
|
|
2563
|
+
this.fueltankcode =
|
|
2564
|
+
fuelTank || res.referredByReferral.referrerUser.referralCode;
|
|
2565
|
+
})
|
|
2566
|
+
.catch((e) => {
|
|
2567
|
+
this.onError(e);
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
onError(e) {
|
|
2572
|
+
console.log("Error loading via GraphQL.", e);
|
|
2573
|
+
}
|
|
2574
|
+
notify(clipboardNotification, notificationText) {
|
|
2575
|
+
const notification = document.getElementById(clipboardNotification.slice(1));
|
|
2576
|
+
notification.textContent = notificationText;
|
|
2577
|
+
addClass(notification, "in");
|
|
2578
|
+
setTimeout(() => {
|
|
2579
|
+
removeClass(notification, "in");
|
|
2580
|
+
}, 1400);
|
|
2581
|
+
}
|
|
2582
|
+
notifySuccess(e) {
|
|
2583
|
+
this.notify(e.trigger.dataset.clipboardNotification, this.copysuccess);
|
|
2584
|
+
}
|
|
2585
|
+
notifyFailure(e) {
|
|
2586
|
+
this.notify(e.trigger.dataset.clipboardNotification, this.copyfailure);
|
|
2587
|
+
}
|
|
2588
|
+
componentDidLoad() {
|
|
2589
|
+
const clipboard = new Clipboard("button");
|
|
2590
|
+
clipboard.on("success", this.notifySuccess.bind(this));
|
|
2591
|
+
clipboard.on("error", this.notifyFailure.bind(this));
|
|
2592
|
+
}
|
|
2593
|
+
render() {
|
|
2594
|
+
const style = css `
|
|
2595
|
+
max-width: ${this.width}px;
|
|
2596
|
+
background-color: ${this.backgroundcolor};
|
|
2597
|
+
border: ${this.backgroundcolor};
|
|
2598
|
+
color: ${this.textcolor};
|
|
2599
|
+
border-radius: ${this.borderradius}px;
|
|
2600
|
+
font-size: ${this.fontsize}px;
|
|
2601
|
+
|
|
2602
|
+
&:hover {
|
|
2603
|
+
background-color: ${shadeColor(this.backgroundcolor, 10)};
|
|
2604
|
+
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
2605
|
+
color: ${this.textcolor};
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
&:focus {
|
|
2609
|
+
color: ${this.textcolor};
|
|
2610
|
+
}
|
|
2611
|
+
`;
|
|
2612
|
+
const code = css `
|
|
2613
|
+
text-align: center;
|
|
2614
|
+
font-weight: bold;
|
|
2615
|
+
font-size: ${this.codefontsize};
|
|
2616
|
+
color: ${this.codefontcolor};
|
|
2617
|
+
`;
|
|
2618
|
+
const classes = [`sqh-copy-button`, style].join(" ");
|
|
2619
|
+
return (!this.ishidden && (h("div", null, h("div", { class: code }, this.fueltankcode), h("div", { class: "sqh-align-button" }, h("span", { class: "label fade", id: "squatch-copy-notification" }, this.copysuccess), h("button", { class: classes, "data-clipboard-text": this.fueltankcode, "data-clipboard-notification": "#squatch-copy-notification" }, this.text)))));
|
|
2620
|
+
}
|
|
2621
|
+
};
|
|
2521
2622
|
CopyButton.style = copyButtonCss;
|
|
2522
2623
|
|
|
2523
2624
|
const copyLinkButtonCss = "sqh-copy-link-button{display:block;text-align:center}sqh-copy-link-button .input-group{padding:8px 0 10px;position:relative;display:table;border-collapse:separate;width:100%;max-width:440px;margin:0 auto}sqh-copy-link-button #squatch-share-link{height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;border:1px solid #ccc;border-radius:4px 0 0 4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;-o-transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;-webkit-transition:border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;transition:border-color ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s, -webkit-box-shadow ease-in-out 0.15s;color:#5b6165;cursor:text;position:relative;z-index:2;width:100%;margin-bottom:0;display:table-cell}sqh-copy-link-button .label{padding:0.2em 0.6em 0.3em;font-size:11px;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;border-radius:0.25em;background-color:#737b80}sqh-copy-link-button .label:empty{display:none}sqh-copy-link-button .fade{opacity:0;-webkit-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear}sqh-copy-link-button .fade.in{opacity:1}sqh-copy-link-button #squatch-share-notification{position:absolute;top:16px;right:156px;z-index:2}sqh-copy-link-button .input-group-btn{display:table-cell;width:1%;white-space:nowrap;vertical-align:middle}sqh-copy-link-button .sqh-copy-btn{-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;border-radius:4px;border-bottom-left-radius:0;border-top-left-radius:0;height:34px}sqh-copy-link-button .sqh-copy-btn:focus{outline:0}sqh-copy-link-button .sqh-copy-btn.disabled,sqh-copy-link-button .sqh-copy-btn[disabled],fieldset[disabled] sqh-copy-link-button .sqh-copy-btn{cursor:not-allowed;pointer-events:none;opacity:0.65;-webkit-box-shadow:none;box-shadow:none}sqh-copy-link-button .icon-btn{width:139px;border-left:0;padding-left:0;padding-right:0;position:relative;text-align:left}sqh-copy-link-button .icon-btn:before{content:\"\";position:absolute;top:-1px;left:-3px;bottom:-1px;background:rgba(255, 255, 255, 0.18);width:40px}sqh-copy-link-button .icon-btn .icon{width:42px;margin-right:30px}sqh-copy-link-button .hidden-sm{text-align:center;padding-left:10px;font-size:14px}sqh-copy-link-button .icon-link:before{font-size:1.2em;padding-left:8px}@media (max-width: 499px){sqh-copy-link-button .input-group{max-width:100%}}@media (max-width: 499px){sqh-copy-link-button #squatch-share-notification{right:60px}}@media (max-width: 499px){sqh-copy-link-button .sqh-copy-btn{width:auto}sqh-copy-link-button .sqh-copy-btn .icon{width:39px;margin-right:0;padding-right:8px}}@media (min-width: 0px) and (max-width: 499px){sqh-copy-link-button .hidden-sm{display:none !important}}";
|
|
2524
2625
|
|
|
2525
|
-
const CopyLinkButton = class {
|
|
2526
|
-
constructor(hostRef) {
|
|
2527
|
-
registerInstance(this, hostRef);
|
|
2528
|
-
}
|
|
2529
|
-
componentWillLoad() {
|
|
2530
|
-
if (!this.ishidden) {
|
|
2531
|
-
return API.graphql
|
|
2532
|
-
.getShareLink()
|
|
2533
|
-
.then((res) => {
|
|
2534
|
-
this.sharelink = res;
|
|
2535
|
-
})
|
|
2536
|
-
.catch((e) => {
|
|
2537
|
-
this.onError(e);
|
|
2538
|
-
});
|
|
2539
|
-
}
|
|
2540
|
-
}
|
|
2541
|
-
onError(e) {
|
|
2542
|
-
console.log("Error loading via GraphQL.", e);
|
|
2543
|
-
}
|
|
2544
|
-
notify(clipboardNotification, notificationText) {
|
|
2545
|
-
const notification = document.getElementById(clipboardNotification.slice(1));
|
|
2546
|
-
notification.textContent = notificationText;
|
|
2547
|
-
addClass(notification, "in");
|
|
2548
|
-
setTimeout(() => {
|
|
2549
|
-
removeClass(notification, "in");
|
|
2550
|
-
}, 1400);
|
|
2551
|
-
API.analytics.shareEvent("DIRECT");
|
|
2552
|
-
}
|
|
2553
|
-
notifySuccess(e) {
|
|
2554
|
-
this.notify(e.trigger.dataset.clipboardNotification, this.copysuccess);
|
|
2555
|
-
}
|
|
2556
|
-
notifyFailure(e) {
|
|
2557
|
-
this.notify(e.trigger.dataset.clipboardNotification, this.copyfailure);
|
|
2558
|
-
}
|
|
2559
|
-
componentDidLoad() {
|
|
2560
|
-
const clipboard = new Clipboard("[data-clipboard-target]");
|
|
2561
|
-
clipboard.on("success", this.notifySuccess.bind(this));
|
|
2562
|
-
clipboard.on("error", this.notifyFailure.bind(this));
|
|
2563
|
-
}
|
|
2564
|
-
render() {
|
|
2565
|
-
const myStyle = css `
|
|
2566
|
-
background-color: ${this.buttoncolor};
|
|
2567
|
-
border: 1px solid ${this.buttoncolor};
|
|
2568
|
-
color: ${this.textcolor};
|
|
2569
|
-
font-family: ${"inherit"};
|
|
2570
|
-
|
|
2571
|
-
&:hover {
|
|
2572
|
-
background: ${shadeColor(this.buttoncolor, 10)};
|
|
2573
|
-
border-color: ${shadeColor(this.buttoncolor, 12)};
|
|
2574
|
-
color: ${this.textcolor};
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
&:focus {
|
|
2578
|
-
color: ${this.textcolor};
|
|
2579
|
-
}
|
|
2580
|
-
`;
|
|
2581
|
-
const buttonClass = [`sqh-copy-btn icon-btn`, myStyle].join(" ");
|
|
2582
|
-
return (!this.ishidden && (h("div", { class: "input-group" }, h("input", { id: "squatch-share-link", value: this.sharelink, readonly: "readonly" }), h("span", { class: "label fade", id: "squatch-share-notification" }, this.copysuccess), h("span", { class: "input-group-btn" }, h("button", { class: buttonClass, "data-clipboard-target": "#squatch-share-link", "data-clipboard-notification": "#squatch-share-notification" }, h("i", { class: "icon icon-link" }), h("span", { class: "hidden-sm" }, this.text))))));
|
|
2583
|
-
}
|
|
2584
|
-
};
|
|
2626
|
+
const CopyLinkButton = class {
|
|
2627
|
+
constructor(hostRef) {
|
|
2628
|
+
registerInstance(this, hostRef);
|
|
2629
|
+
}
|
|
2630
|
+
componentWillLoad() {
|
|
2631
|
+
if (!this.ishidden) {
|
|
2632
|
+
return API.graphql
|
|
2633
|
+
.getShareLink()
|
|
2634
|
+
.then((res) => {
|
|
2635
|
+
this.sharelink = res;
|
|
2636
|
+
})
|
|
2637
|
+
.catch((e) => {
|
|
2638
|
+
this.onError(e);
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
onError(e) {
|
|
2643
|
+
console.log("Error loading via GraphQL.", e);
|
|
2644
|
+
}
|
|
2645
|
+
notify(clipboardNotification, notificationText) {
|
|
2646
|
+
const notification = document.getElementById(clipboardNotification.slice(1));
|
|
2647
|
+
notification.textContent = notificationText;
|
|
2648
|
+
addClass(notification, "in");
|
|
2649
|
+
setTimeout(() => {
|
|
2650
|
+
removeClass(notification, "in");
|
|
2651
|
+
}, 1400);
|
|
2652
|
+
API.analytics.shareEvent("DIRECT");
|
|
2653
|
+
}
|
|
2654
|
+
notifySuccess(e) {
|
|
2655
|
+
this.notify(e.trigger.dataset.clipboardNotification, this.copysuccess);
|
|
2656
|
+
}
|
|
2657
|
+
notifyFailure(e) {
|
|
2658
|
+
this.notify(e.trigger.dataset.clipboardNotification, this.copyfailure);
|
|
2659
|
+
}
|
|
2660
|
+
componentDidLoad() {
|
|
2661
|
+
const clipboard = new Clipboard("[data-clipboard-target]");
|
|
2662
|
+
clipboard.on("success", this.notifySuccess.bind(this));
|
|
2663
|
+
clipboard.on("error", this.notifyFailure.bind(this));
|
|
2664
|
+
}
|
|
2665
|
+
render() {
|
|
2666
|
+
const myStyle = css `
|
|
2667
|
+
background-color: ${this.buttoncolor};
|
|
2668
|
+
border: 1px solid ${this.buttoncolor};
|
|
2669
|
+
color: ${this.textcolor};
|
|
2670
|
+
font-family: ${"inherit"};
|
|
2671
|
+
|
|
2672
|
+
&:hover {
|
|
2673
|
+
background: ${shadeColor(this.buttoncolor, 10)};
|
|
2674
|
+
border-color: ${shadeColor(this.buttoncolor, 12)};
|
|
2675
|
+
color: ${this.textcolor};
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
&:focus {
|
|
2679
|
+
color: ${this.textcolor};
|
|
2680
|
+
}
|
|
2681
|
+
`;
|
|
2682
|
+
const buttonClass = [`sqh-copy-btn icon-btn`, myStyle].join(" ");
|
|
2683
|
+
return (!this.ishidden && (h("div", { class: "input-group" }, h("input", { id: "squatch-share-link", value: this.sharelink, readonly: "readonly" }), h("span", { class: "label fade", id: "squatch-share-notification" }, this.copysuccess), h("span", { class: "input-group-btn" }, h("button", { class: buttonClass, "data-clipboard-target": "#squatch-share-link", "data-clipboard-notification": "#squatch-share-notification" }, h("i", { class: "icon icon-link" }), h("span", { class: "hidden-sm" }, this.text))))));
|
|
2684
|
+
}
|
|
2685
|
+
};
|
|
2585
2686
|
CopyLinkButton.style = copyLinkButtonCss;
|
|
2586
2687
|
|
|
2587
2688
|
const globalContainerCss = "body{margin:0px;padding:0px;font-family:sans-serif}sqh-global-container{display:block;max-width:500px;margin:0 auto}sqh-global-container *{-webkit-box-sizing:border-box;box-sizing:border-box}sqh-global-container>div{width:100%;display:block;padding:0 10px}sqh-global-container .sqh-attribution{display:inherit;text-align:center;font-size:10px;color:lightgray;text-decoration:none;padding-bottom:10px}sqh-global-container .container-loading{display:none;left:calc(50% - 50px);position:absolute;text-align:center;top:45%;width:100px}sqh-global-container:not(.hydrated) .container-loading{display:block;visibility:visible}sqh-global-container .loading-icon{height:40px;text-align:center;font-size:10px;position:absolute;left:0;width:100%;top:45%;z-index:1000}sqh-global-container .loading-icon-tr .loading-icon{position:relative;top:0}sqh-global-container .loading-icon>div{height:100%;margin:1px;width:6px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}sqh-global-container .loading-icon .bar2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}sqh-global-container .loading-icon .bar3{-webkit-animation-delay:-1s;animation-delay:-1s}sqh-global-container .loading-icon .bar4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}sqh-global-container .loading-icon .bar5{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}@-webkit-keyframes sk-stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.4)}20%{-webkit-transform:scaleY(1)}}@keyframes sk-stretchdelay{0%,40%,100%{transform:scaleY(0.4);-webkit-transform:scaleY(0.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}";
|
|
2588
2689
|
|
|
2589
|
-
const GlobalContainer = class {
|
|
2590
|
-
constructor(hostRef) {
|
|
2591
|
-
registerInstance(this, hostRef);
|
|
2592
|
-
}
|
|
2593
|
-
LoadingState(props) {
|
|
2594
|
-
const style = css `
|
|
2595
|
-
background-color: ${props.loadingcolor || "#439B76"};
|
|
2596
|
-
`;
|
|
2597
|
-
return (h("div", { class: "container-loading" }, h("div", { class: "loading-icon" }, h("div", { class: `bar1 ${style}` }), h("div", { class: `bar2 ${style}` }), h("div", { class: `bar3 ${style}` }), h("div", { class: `bar4 ${style}` }), h("div", { class: `bar5 ${style}` }))));
|
|
2598
|
-
}
|
|
2599
|
-
render() {
|
|
2600
|
-
const style = css `
|
|
2601
|
-
background-color: ${this.background};
|
|
2602
|
-
font-family: ${this.fontfamily};
|
|
2603
|
-
position: relative;
|
|
2604
|
-
max-width: ${this.maxwidth};
|
|
2605
|
-
`;
|
|
2606
|
-
const robotoFont = (h("link", { href: "https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap", rel: "stylesheet" }));
|
|
2607
|
-
const artifaktFont = (h("link", { href: "https://static-dc.autodesk.net/etc/designs/v201903181748/templates-general/structure/fonts/artifakt/clientlibs/artifakt.css", rel: "stylesheet" }));
|
|
2608
|
-
return (h("div", { class: style }, this.fontfamily == "Roboto" ? robotoFont : "", this.fontfamily == "Artifakt Element" ? artifaktFont : "", h("slot", null), this.poweredby ? (h("a", { class: "sqh-attribution", href: "https://www.saasquatch.com/?utm_source=app&utm_medium=user-widget&utm_campaign=referral-widget", target: "_blank" }, "Powered By Saasquatch")) : (""), h(this.LoadingState, { loadingcolor: this.loadingcolor })));
|
|
2609
|
-
}
|
|
2610
|
-
};
|
|
2690
|
+
const GlobalContainer = class {
|
|
2691
|
+
constructor(hostRef) {
|
|
2692
|
+
registerInstance(this, hostRef);
|
|
2693
|
+
}
|
|
2694
|
+
LoadingState(props) {
|
|
2695
|
+
const style = css `
|
|
2696
|
+
background-color: ${props.loadingcolor || "#439B76"};
|
|
2697
|
+
`;
|
|
2698
|
+
return (h("div", { class: "container-loading" }, h("div", { class: "loading-icon" }, h("div", { class: `bar1 ${style}` }), h("div", { class: `bar2 ${style}` }), h("div", { class: `bar3 ${style}` }), h("div", { class: `bar4 ${style}` }), h("div", { class: `bar5 ${style}` }))));
|
|
2699
|
+
}
|
|
2700
|
+
render() {
|
|
2701
|
+
const style = css `
|
|
2702
|
+
background-color: ${this.background};
|
|
2703
|
+
font-family: ${this.fontfamily};
|
|
2704
|
+
position: relative;
|
|
2705
|
+
max-width: ${this.maxwidth};
|
|
2706
|
+
`;
|
|
2707
|
+
const robotoFont = (h("link", { href: "https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap", rel: "stylesheet" }));
|
|
2708
|
+
const artifaktFont = (h("link", { href: "https://static-dc.autodesk.net/etc/designs/v201903181748/templates-general/structure/fonts/artifakt/clientlibs/artifakt.css", rel: "stylesheet" }));
|
|
2709
|
+
return (h("div", { class: style }, this.fontfamily == "Roboto" ? robotoFont : "", this.fontfamily == "Artifakt Element" ? artifaktFont : "", h("slot", null), this.poweredby ? (h("a", { class: "sqh-attribution", href: "https://www.saasquatch.com/?utm_source=app&utm_medium=user-widget&utm_campaign=referral-widget", target: "_blank" }, "Powered By Saasquatch")) : (""), h(this.LoadingState, { loadingcolor: this.loadingcolor })));
|
|
2710
|
+
}
|
|
2711
|
+
};
|
|
2611
2712
|
GlobalContainer.style = globalContainerCss;
|
|
2612
2713
|
|
|
2613
2714
|
const imageComponentCss = "sqh-image-component{display:block}sqh-image-component div{position:relative}sqh-image-component img{max-width:100%;height:auto}";
|
|
2614
2715
|
|
|
2615
|
-
const ImageComponent = class {
|
|
2616
|
-
constructor(hostRef) {
|
|
2617
|
-
registerInstance(this, hostRef);
|
|
2618
|
-
}
|
|
2619
|
-
render() {
|
|
2620
|
-
const imageString = this.url;
|
|
2621
|
-
const alignment = css `
|
|
2622
|
-
{
|
|
2623
|
-
text-align: ${this.alignment};
|
|
2624
|
-
}
|
|
2625
|
-
`;
|
|
2626
|
-
const myStyle = css `
|
|
2627
|
-
{
|
|
2628
|
-
width: ${this.width}px;
|
|
2629
|
-
border-radius: ${this.borderradius}px;
|
|
2630
|
-
${this.css}
|
|
2631
|
-
}
|
|
2632
|
-
`;
|
|
2633
|
-
return (!this.ishidden && (h("div", { class: alignment }, h("img", { src: imageString, class: myStyle }))));
|
|
2634
|
-
}
|
|
2635
|
-
};
|
|
2716
|
+
const ImageComponent = class {
|
|
2717
|
+
constructor(hostRef) {
|
|
2718
|
+
registerInstance(this, hostRef);
|
|
2719
|
+
}
|
|
2720
|
+
render() {
|
|
2721
|
+
const imageString = this.url;
|
|
2722
|
+
const alignment = css `
|
|
2723
|
+
{
|
|
2724
|
+
text-align: ${this.alignment};
|
|
2725
|
+
}
|
|
2726
|
+
`;
|
|
2727
|
+
const myStyle = css `
|
|
2728
|
+
{
|
|
2729
|
+
width: ${this.width}px;
|
|
2730
|
+
border-radius: ${this.borderradius}px;
|
|
2731
|
+
${this.css}
|
|
2732
|
+
}
|
|
2733
|
+
`;
|
|
2734
|
+
return (!this.ishidden && (h("div", { class: alignment }, h("img", { src: imageString, class: myStyle }))));
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2636
2737
|
ImageComponent.style = imageComponentCss;
|
|
2637
2738
|
|
|
2638
2739
|
const partnerStatComponentCss = "sqh-partner-stat-component{text-align:center;width:140px;float:left}sqh-partner-stat-component>div{padding:10px}sqh-partner-stat-component .stat-value{font-size:20px;line-height:20px;margin-top:20px;margin-bottom:8px;font-weight:300}sqh-partner-stat-component .stat-description{text-transform:uppercase;font-size:12px}@media (max-width: 499px){sqh-partner-stat-component{width:100%;text-align:left;background:#f2f2f2;border:1px solid #ddd}sqh-partner-stat-component:first-child{border-radius:4px 4px 0 0}sqh-partner-stat-component:last-child{border-radius:0 0 4px 4px}}@media (max-width: 499px){sqh-partner-stat-component .stat-value{font-size:22px;float:left;width:60px;text-align:center;margin:0 10px 0 0}}@media (max-width: 499px){sqh-partner-stat-component .stat-description{line-height:20px;padding-left:100px;overflow-wrap:break-word}}";
|
|
2639
2740
|
|
|
2640
|
-
const PartnerStatComponent = class {
|
|
2641
|
-
constructor(hostRef) {
|
|
2642
|
-
registerInstance(this, hostRef);
|
|
2643
|
-
this.statTypeUpdated = createEvent(this, "statTypeUpdated", 7);
|
|
2644
|
-
this.statAdded = createEvent(this, "statAdded", 7);
|
|
2645
|
-
}
|
|
2646
|
-
componentWillLoad() {
|
|
2647
|
-
this.statAddedHandler(this.elem);
|
|
2648
|
-
}
|
|
2649
|
-
stattypeHandler(newValue, oldValue) {
|
|
2650
|
-
if (newValue !== oldValue)
|
|
2651
|
-
this.statTypeUpdatedHandler(this.elem);
|
|
2652
|
-
}
|
|
2653
|
-
statAddedHandler(stat) {
|
|
2654
|
-
this.statAdded.emit(stat);
|
|
2655
|
-
}
|
|
2656
|
-
statTypeUpdatedHandler(stat) {
|
|
2657
|
-
this.statTypeUpdated.emit(stat);
|
|
2658
|
-
}
|
|
2659
|
-
render() {
|
|
2660
|
-
const clz = css `
|
|
2661
|
-
color: ${this.statcolor};
|
|
2662
|
-
`;
|
|
2663
|
-
return (!this.ishidden && (h("div", { class: clz }, h("div", { class: "stat-value" }, this.statvalue), h("div", { class: "stat-description" }, this.statdescription))));
|
|
2664
|
-
}
|
|
2665
|
-
get elem() { return getElement(this); }
|
|
2666
|
-
static get watchers() { return {
|
|
2667
|
-
"stattype": ["stattypeHandler"]
|
|
2668
|
-
}; }
|
|
2669
|
-
};
|
|
2741
|
+
const PartnerStatComponent = class {
|
|
2742
|
+
constructor(hostRef) {
|
|
2743
|
+
registerInstance(this, hostRef);
|
|
2744
|
+
this.statTypeUpdated = createEvent(this, "statTypeUpdated", 7);
|
|
2745
|
+
this.statAdded = createEvent(this, "statAdded", 7);
|
|
2746
|
+
}
|
|
2747
|
+
componentWillLoad() {
|
|
2748
|
+
this.statAddedHandler(this.elem);
|
|
2749
|
+
}
|
|
2750
|
+
stattypeHandler(newValue, oldValue) {
|
|
2751
|
+
if (newValue !== oldValue)
|
|
2752
|
+
this.statTypeUpdatedHandler(this.elem);
|
|
2753
|
+
}
|
|
2754
|
+
statAddedHandler(stat) {
|
|
2755
|
+
this.statAdded.emit(stat);
|
|
2756
|
+
}
|
|
2757
|
+
statTypeUpdatedHandler(stat) {
|
|
2758
|
+
this.statTypeUpdated.emit(stat);
|
|
2759
|
+
}
|
|
2760
|
+
render() {
|
|
2761
|
+
const clz = css `
|
|
2762
|
+
color: ${this.statcolor};
|
|
2763
|
+
`;
|
|
2764
|
+
return (!this.ishidden && (h("div", { class: clz }, h("div", { class: "stat-value" }, this.statvalue), h("div", { class: "stat-description" }, this.statdescription))));
|
|
2765
|
+
}
|
|
2766
|
+
get elem() { return getElement(this); }
|
|
2767
|
+
static get watchers() { return {
|
|
2768
|
+
"stattype": ["stattypeHandler"]
|
|
2769
|
+
}; }
|
|
2770
|
+
};
|
|
2670
2771
|
PartnerStatComponent.style = partnerStatComponentCss;
|
|
2671
2772
|
|
|
2672
2773
|
var TYPE;
|
|
@@ -6862,653 +6963,637 @@ RelativeFormat.thresholds = {
|
|
|
6862
6963
|
'month-short': 11 // months to year
|
|
6863
6964
|
};
|
|
6864
6965
|
|
|
6865
|
-
const FormatJS = {
|
|
6866
|
-
format(msg, values, userLocale) {
|
|
6867
|
-
var locale = (userLocale || "en-US").replace("_", "-");
|
|
6868
|
-
var format = new IntlMessageFormat(msg, locale);
|
|
6869
|
-
return format.format(values);
|
|
6870
|
-
},
|
|
6871
|
-
formatRelative(value, userLocale) {
|
|
6872
|
-
var locale = (userLocale || "en-US").replace("_", "-");
|
|
6873
|
-
var relative = new RelativeFormat(locale);
|
|
6874
|
-
return relative.format(value);
|
|
6875
|
-
},
|
|
6966
|
+
const FormatJS = {
|
|
6967
|
+
format(msg, values, userLocale) {
|
|
6968
|
+
var locale = (userLocale || "en-US").replace("_", "-");
|
|
6969
|
+
var format = new IntlMessageFormat(msg, locale);
|
|
6970
|
+
return format.format(values);
|
|
6971
|
+
},
|
|
6972
|
+
formatRelative(value, userLocale) {
|
|
6973
|
+
var locale = (userLocale || "en-US").replace("_", "-");
|
|
6974
|
+
var relative = new RelativeFormat(locale);
|
|
6975
|
+
return relative.format(value);
|
|
6976
|
+
},
|
|
6876
6977
|
};
|
|
6877
6978
|
|
|
6878
6979
|
const referralComponentCss = "sqh-referral-component:nth-child(3) .squatch-referrals-row{border-bottom:none}sqh-referral-component .squatch-referrals-row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:80px;border-bottom:1px solid #ececec;max-width:500px;margin:0 auto;padding:0 20px;line-height:1.6}sqh-referral-component .squatch-referrals-row>div:first-of-type{-ms-flex:1;flex:1}sqh-referral-component .squatch-referrals-row .icon{float:left;font-size:32px}sqh-referral-component .squatch-referrals-row .sqh-column-two{padding:10px 0}sqh-referral-component .squatch-referrals-value{width:175px;font-size:16px;float:left;margin:10px 0}sqh-referral-component .squatch-value-contents{font-size:13px;line-height:0px;padding-bottom:25px}sqh-referral-component .squatch-referrals-heading{font-size:16px}sqh-referral-component .squatch-referrals-description{font-size:13px}sqh-referral-component .squatch-customer-note{color:darkslategray;max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@media (max-width: 499px){sqh-referral-component .squatch-referrals-description{display:none}sqh-referral-component .squatch-referrals-row{padding:0}sqh-referral-component .squatch-referrals-row>div:first-of-type{width:100px;overflow:hidden}}";
|
|
6879
6980
|
|
|
6880
|
-
const ReferralComponent = class {
|
|
6881
|
-
constructor(hostRef) {
|
|
6882
|
-
registerInstance(this, hostRef);
|
|
6883
|
-
}
|
|
6884
|
-
getName() {
|
|
6885
|
-
const referral = this.referral;
|
|
6886
|
-
const referredByReferral = this.referral;
|
|
6887
|
-
// Referred User
|
|
6888
|
-
if (referral.referredUser) {
|
|
6889
|
-
return referral.referredUser.firstName || this.unknownuser;
|
|
6890
|
-
}
|
|
6891
|
-
// Referrer User
|
|
6892
|
-
if (referredByReferral.referrerUser) {
|
|
6893
|
-
return referredByReferral.referrerUser.firstName || this.unknownuser;
|
|
6894
|
-
}
|
|
6895
|
-
return this.unknownuser;
|
|
6896
|
-
}
|
|
6897
|
-
getIcon() {
|
|
6898
|
-
if ((this.referraltype === "converted" || this.referraltype === "referrer") &&
|
|
6899
|
-
!this.rewardIsExpired() &&
|
|
6900
|
-
!this.rewardIsCancelled()) {
|
|
6901
|
-
return `icon-ok-circled`;
|
|
6902
|
-
}
|
|
6903
|
-
return `icon-attention`;
|
|
6904
|
-
}
|
|
6905
|
-
getContent(formatVariables) {
|
|
6906
|
-
// When reward is expired and Expired Content was set
|
|
6907
|
-
if (this.rewardIsExpired() && this.referralvariables.expiredcontent) {
|
|
6908
|
-
return FormatJS.format(this.referralvariables.expiredcontent, formatVariables, this.locale);
|
|
6909
|
-
}
|
|
6910
|
-
// When reward is cancelled and Cancelled Content was set
|
|
6911
|
-
if (this.rewardIsCancelled() && this.referralvariables.cancelledcontent) {
|
|
6912
|
-
return FormatJS.format(this.referralvariables.cancelledcontent, formatVariables, this.locale);
|
|
6913
|
-
}
|
|
6914
|
-
if (this.referraltype) {
|
|
6915
|
-
return FormatJS.format(this.referralvariables[`${this.referraltype}content`], formatVariables, this.locale);
|
|
6916
|
-
}
|
|
6917
|
-
return ``;
|
|
6918
|
-
}
|
|
6919
|
-
rewardIsExpired() {
|
|
6920
|
-
const { rewards } = this.referral;
|
|
6921
|
-
const hasExpiry = rewards.length == 1 && rewards[0].statuses;
|
|
6922
|
-
const isExpired = hasExpiry && rewards[0].statuses.indexOf("EXPIRED") > -1;
|
|
6923
|
-
return isExpired;
|
|
6924
|
-
}
|
|
6925
|
-
rewardIsCancelled() {
|
|
6926
|
-
const { rewards } = this.referral;
|
|
6927
|
-
const hasStatuses = rewards.length == 1 && rewards[0].statuses;
|
|
6928
|
-
const isCancelled = hasStatuses && rewards[0].statuses.indexOf("CANCELLED") > -1;
|
|
6929
|
-
return isCancelled;
|
|
6930
|
-
}
|
|
6931
|
-
rewardIsRedeemed() {
|
|
6932
|
-
const { rewards } = this.referral;
|
|
6933
|
-
const hasStatuses = rewards.length == 1 && rewards[0].statuses;
|
|
6934
|
-
const isRedeemed = hasStatuses && rewards[0].statuses.indexOf("REDEEMED") > -1;
|
|
6935
|
-
return isRedeemed;
|
|
6936
|
-
}
|
|
6937
|
-
getValue() {
|
|
6938
|
-
const { rewards } = this.referral;
|
|
6939
|
-
const referrer = this.referralvariables.referrervalue;
|
|
6940
|
-
const pending = this.referralvariables.pendingvalue;
|
|
6941
|
-
// When we have no reward values to show
|
|
6942
|
-
if (rewards.length == 0) {
|
|
6943
|
-
return this.referraltype === "referrer" ||
|
|
6944
|
-
this.referraltype === "converted"
|
|
6945
|
-
? referrer
|
|
6946
|
-
: pending;
|
|
6947
|
-
}
|
|
6948
|
-
// When we want to use the first reward pretty value
|
|
6949
|
-
if (rewards.length > 0 && this.referralvariables.usefirstreward) {
|
|
6950
|
-
return rewards[rewards.length - 1].prettyValue || rewards[0].prettyValue;
|
|
6951
|
-
}
|
|
6952
|
-
// Use last reward pretty value
|
|
6953
|
-
return rewards[0].prettyValue;
|
|
6954
|
-
}
|
|
6955
|
-
getValueContent(formatVariables) {
|
|
6956
|
-
const { rewards } = this.referral;
|
|
6957
|
-
// When the reward is pending and there are no other rewards
|
|
6958
|
-
if (!rewards.length)
|
|
6959
|
-
return "";
|
|
6960
|
-
if (rewards.length == 1) {
|
|
6961
|
-
// Expired content only applies when there is 1 reward in the referral
|
|
6962
|
-
if (this.rewardIsExpired())
|
|
6963
|
-
return FormatJS.format(this.referralvariables.expiredvalue, formatVariables, this.locale);
|
|
6964
|
-
// Cancelled content only applies when there is 1 reward in the referral
|
|
6965
|
-
if (this.rewardIsCancelled())
|
|
6966
|
-
return FormatJS.format(this.referralvariables.cancelledvalue, formatVariables, this.locale);
|
|
6967
|
-
// Redeemed content only applies when there is 1 reward in the referral
|
|
6968
|
-
if (this.rewardIsRedeemed())
|
|
6969
|
-
return FormatJS.format(this.referralvariables.redeemedvalue || "Redeemed", formatVariables, this.locale);
|
|
6970
|
-
// Expiry date only shown if there is 1 reward with dateExpires set in the referral
|
|
6971
|
-
if (this.referralvariables.showexpiry && rewards[0].dateExpires) {
|
|
6972
|
-
const expiryDate = FormatJS.formatRelative(rewards[0].dateExpires, this.locale);
|
|
6973
|
-
return FormatJS.format(this.referralvariables.expiresvalue || `Expires ${expiryDate}`, Object.assign(Object.assign({}, formatVariables), { expiryDate }), this.locale);
|
|
6974
|
-
}
|
|
6975
|
-
return "";
|
|
6976
|
-
}
|
|
6977
|
-
return FormatJS.format(this.referralvariables.valuecontent, formatVariables, this.locale);
|
|
6978
|
-
}
|
|
6979
|
-
getNote() {
|
|
6980
|
-
const { rewards } = this.referral;
|
|
6981
|
-
const note = rewards[0] && rewards[0].meta && rewards[0].meta.message;
|
|
6982
|
-
return note || "";
|
|
6983
|
-
}
|
|
6984
|
-
render() {
|
|
6985
|
-
const { dateReferralStarted, rewards } = this.referral;
|
|
6986
|
-
const formatVariables = {
|
|
6987
|
-
date: FormatJS.formatRelative(dateReferralStarted, this.locale),
|
|
6988
|
-
extrarewards: rewards.length - 1,
|
|
6989
|
-
};
|
|
6990
|
-
const name = this.getName();
|
|
6991
|
-
const icon = this.getIcon();
|
|
6992
|
-
const content = this.getContent(formatVariables);
|
|
6993
|
-
const value = this.getValue();
|
|
6994
|
-
const valuecontent = this.getValueContent(formatVariables);
|
|
6995
|
-
const customernote = this.getNote();
|
|
6996
|
-
return (h("div", { class: "squatch-referrals-row" }, h("div", null, h("div", { class: "squatch-referrals-heading" }, name), h("div", { class: "squatch-referrals-description" }, content), this.referralvariables.shownotes && customernote && (h("div", { class: "squatch-referrals-description squatch-customer-note", title: customernote }, customernote))), h("i", { class: `icon squatch-referrals-icon ${icon} ${this.rewardIsExpired() && "expired"} ${this.rewardIsCancelled() && "cancelled"}` }), h("div", { class: "sqh-column-two" }, h("div", { class: `squatch-referrals-value ${this.rewardIsCancelled() && "cancelled"} ${rewards.length > 0
|
|
6997
|
-
? this.rewardIsExpired()
|
|
6998
|
-
? "expired"
|
|
6999
|
-
: ""
|
|
7000
|
-
: this.referraltype === "referrer" ||
|
|
7001
|
-
this.referraltype === "converted"
|
|
7002
|
-
? "referrer"
|
|
7003
|
-
: "pending"}` }, value), h("div", { class: `squatch-value-contents ${this.rewardIsExpired() && "expired"} ${this.rewardIsCancelled() && "cancelled"}` }, valuecontent))));
|
|
7004
|
-
}
|
|
7005
|
-
};
|
|
6981
|
+
const ReferralComponent = class {
|
|
6982
|
+
constructor(hostRef) {
|
|
6983
|
+
registerInstance(this, hostRef);
|
|
6984
|
+
}
|
|
6985
|
+
getName() {
|
|
6986
|
+
const referral = this.referral;
|
|
6987
|
+
const referredByReferral = this.referral;
|
|
6988
|
+
// Referred User
|
|
6989
|
+
if (referral.referredUser) {
|
|
6990
|
+
return referral.referredUser.firstName || this.unknownuser;
|
|
6991
|
+
}
|
|
6992
|
+
// Referrer User
|
|
6993
|
+
if (referredByReferral.referrerUser) {
|
|
6994
|
+
return referredByReferral.referrerUser.firstName || this.unknownuser;
|
|
6995
|
+
}
|
|
6996
|
+
return this.unknownuser;
|
|
6997
|
+
}
|
|
6998
|
+
getIcon() {
|
|
6999
|
+
if ((this.referraltype === "converted" || this.referraltype === "referrer") &&
|
|
7000
|
+
!this.rewardIsExpired() &&
|
|
7001
|
+
!this.rewardIsCancelled()) {
|
|
7002
|
+
return `icon-ok-circled`;
|
|
7003
|
+
}
|
|
7004
|
+
return `icon-attention`;
|
|
7005
|
+
}
|
|
7006
|
+
getContent(formatVariables) {
|
|
7007
|
+
// When reward is expired and Expired Content was set
|
|
7008
|
+
if (this.rewardIsExpired() && this.referralvariables.expiredcontent) {
|
|
7009
|
+
return FormatJS.format(this.referralvariables.expiredcontent, formatVariables, this.locale);
|
|
7010
|
+
}
|
|
7011
|
+
// When reward is cancelled and Cancelled Content was set
|
|
7012
|
+
if (this.rewardIsCancelled() && this.referralvariables.cancelledcontent) {
|
|
7013
|
+
return FormatJS.format(this.referralvariables.cancelledcontent, formatVariables, this.locale);
|
|
7014
|
+
}
|
|
7015
|
+
if (this.referraltype) {
|
|
7016
|
+
return FormatJS.format(this.referralvariables[`${this.referraltype}content`], formatVariables, this.locale);
|
|
7017
|
+
}
|
|
7018
|
+
return ``;
|
|
7019
|
+
}
|
|
7020
|
+
rewardIsExpired() {
|
|
7021
|
+
const { rewards } = this.referral;
|
|
7022
|
+
const hasExpiry = rewards.length == 1 && rewards[0].statuses;
|
|
7023
|
+
const isExpired = hasExpiry && rewards[0].statuses.indexOf("EXPIRED") > -1;
|
|
7024
|
+
return isExpired;
|
|
7025
|
+
}
|
|
7026
|
+
rewardIsCancelled() {
|
|
7027
|
+
const { rewards } = this.referral;
|
|
7028
|
+
const hasStatuses = rewards.length == 1 && rewards[0].statuses;
|
|
7029
|
+
const isCancelled = hasStatuses && rewards[0].statuses.indexOf("CANCELLED") > -1;
|
|
7030
|
+
return isCancelled;
|
|
7031
|
+
}
|
|
7032
|
+
rewardIsRedeemed() {
|
|
7033
|
+
const { rewards } = this.referral;
|
|
7034
|
+
const hasStatuses = rewards.length == 1 && rewards[0].statuses;
|
|
7035
|
+
const isRedeemed = hasStatuses && rewards[0].statuses.indexOf("REDEEMED") > -1;
|
|
7036
|
+
return isRedeemed;
|
|
7037
|
+
}
|
|
7038
|
+
getValue() {
|
|
7039
|
+
const { rewards } = this.referral;
|
|
7040
|
+
const referrer = this.referralvariables.referrervalue;
|
|
7041
|
+
const pending = this.referralvariables.pendingvalue;
|
|
7042
|
+
// When we have no reward values to show
|
|
7043
|
+
if (rewards.length == 0) {
|
|
7044
|
+
return this.referraltype === "referrer" ||
|
|
7045
|
+
this.referraltype === "converted"
|
|
7046
|
+
? referrer
|
|
7047
|
+
: pending;
|
|
7048
|
+
}
|
|
7049
|
+
// When we want to use the first reward pretty value
|
|
7050
|
+
if (rewards.length > 0 && this.referralvariables.usefirstreward) {
|
|
7051
|
+
return rewards[rewards.length - 1].prettyValue || rewards[0].prettyValue;
|
|
7052
|
+
}
|
|
7053
|
+
// Use last reward pretty value
|
|
7054
|
+
return rewards[0].prettyValue;
|
|
7055
|
+
}
|
|
7056
|
+
getValueContent(formatVariables) {
|
|
7057
|
+
const { rewards } = this.referral;
|
|
7058
|
+
// When the reward is pending and there are no other rewards
|
|
7059
|
+
if (!rewards.length)
|
|
7060
|
+
return "";
|
|
7061
|
+
if (rewards.length == 1) {
|
|
7062
|
+
// Expired content only applies when there is 1 reward in the referral
|
|
7063
|
+
if (this.rewardIsExpired())
|
|
7064
|
+
return FormatJS.format(this.referralvariables.expiredvalue, formatVariables, this.locale);
|
|
7065
|
+
// Cancelled content only applies when there is 1 reward in the referral
|
|
7066
|
+
if (this.rewardIsCancelled())
|
|
7067
|
+
return FormatJS.format(this.referralvariables.cancelledvalue, formatVariables, this.locale);
|
|
7068
|
+
// Redeemed content only applies when there is 1 reward in the referral
|
|
7069
|
+
if (this.rewardIsRedeemed())
|
|
7070
|
+
return FormatJS.format(this.referralvariables.redeemedvalue || "Redeemed", formatVariables, this.locale);
|
|
7071
|
+
// Expiry date only shown if there is 1 reward with dateExpires set in the referral
|
|
7072
|
+
if (this.referralvariables.showexpiry && rewards[0].dateExpires) {
|
|
7073
|
+
const expiryDate = FormatJS.formatRelative(rewards[0].dateExpires, this.locale);
|
|
7074
|
+
return FormatJS.format(this.referralvariables.expiresvalue || `Expires ${expiryDate}`, Object.assign(Object.assign({}, formatVariables), { expiryDate }), this.locale);
|
|
7075
|
+
}
|
|
7076
|
+
return "";
|
|
7077
|
+
}
|
|
7078
|
+
return FormatJS.format(this.referralvariables.valuecontent, formatVariables, this.locale);
|
|
7079
|
+
}
|
|
7080
|
+
getNote() {
|
|
7081
|
+
const { rewards } = this.referral;
|
|
7082
|
+
const note = rewards[0] && rewards[0].meta && rewards[0].meta.message;
|
|
7083
|
+
return note || "";
|
|
7084
|
+
}
|
|
7085
|
+
render() {
|
|
7086
|
+
const { dateReferralStarted, rewards } = this.referral;
|
|
7087
|
+
const formatVariables = {
|
|
7088
|
+
date: FormatJS.formatRelative(dateReferralStarted, this.locale),
|
|
7089
|
+
extrarewards: rewards.length - 1,
|
|
7090
|
+
};
|
|
7091
|
+
const name = this.getName();
|
|
7092
|
+
const icon = this.getIcon();
|
|
7093
|
+
const content = this.getContent(formatVariables);
|
|
7094
|
+
const value = this.getValue();
|
|
7095
|
+
const valuecontent = this.getValueContent(formatVariables);
|
|
7096
|
+
const customernote = this.getNote();
|
|
7097
|
+
return (h("div", { class: "squatch-referrals-row" }, h("div", null, h("div", { class: "squatch-referrals-heading" }, name), h("div", { class: "squatch-referrals-description" }, content), this.referralvariables.shownotes && customernote && (h("div", { class: "squatch-referrals-description squatch-customer-note", title: customernote }, customernote))), h("i", { class: `icon squatch-referrals-icon ${icon} ${this.rewardIsExpired() && "expired"} ${this.rewardIsCancelled() && "cancelled"}` }), h("div", { class: "sqh-column-two" }, h("div", { class: `squatch-referrals-value ${this.rewardIsCancelled() && "cancelled"} ${rewards.length > 0
|
|
7098
|
+
? this.rewardIsExpired()
|
|
7099
|
+
? "expired"
|
|
7100
|
+
: ""
|
|
7101
|
+
: this.referraltype === "referrer" ||
|
|
7102
|
+
this.referraltype === "converted"
|
|
7103
|
+
? "referrer"
|
|
7104
|
+
: "pending"}` }, value), h("div", { class: `squatch-value-contents ${this.rewardIsExpired() && "expired"} ${this.rewardIsCancelled() && "cancelled"}` }, valuecontent))));
|
|
7105
|
+
}
|
|
7106
|
+
};
|
|
7006
7107
|
ReferralComponent.style = referralComponentCss;
|
|
7007
7108
|
|
|
7008
7109
|
const referralListCss = "sqh-referral-list{display:block}sqh-referral-list .squatch-no-referrals-yet{background:white;border-color:#adadad;border:1px solid;border-color:#cccccc;border-radius:4px;font-size:14px;line-height:20px;margin:5px;padding:6px 12px;width:165px}sqh-referral-list .squatch-referrals-scroll-container{min-height:255px}sqh-referral-list .squatch-referrals-scroll-action-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:5px 0}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action{background:white;border:1px solid;border-color:#cccccc;border-radius:4px;cursor:pointer;font-size:14px;line-height:20px;margin:5px;padding:6px 12px;width:120px}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action.disabled{cursor:default;opacity:0.5}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action.disabled:hover{background:white;border-color:#cccccc}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action.disabled:active{border-style:solid}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action:hover{background:#e6e6e6;border-color:#adadad}sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action:active,sqh-referral-list .squatch-referrals-scroll-action-container .squatch-referrals-scroll-action:focus{outline:none}";
|
|
7009
7110
|
|
|
7010
|
-
const ReferralList = class {
|
|
7011
|
-
constructor(hostRef) {
|
|
7012
|
-
registerInstance(this, hostRef);
|
|
7013
|
-
this.offset = 0;
|
|
7014
|
-
this.loading = true;
|
|
7015
|
-
}
|
|
7016
|
-
componentWillLoad() {
|
|
7017
|
-
if (!this.ishidden) {
|
|
7018
|
-
return this.getReferrals(this.showreferrer)
|
|
7019
|
-
.then((res) => {
|
|
7020
|
-
this.referrals = res.referrals.data;
|
|
7021
|
-
this.referredBy = res.referredByReferral;
|
|
7022
|
-
this.referralsCount = res.referrals.totalCount;
|
|
7023
|
-
this.loading = false;
|
|
7024
|
-
this.locale = res.locale;
|
|
7025
|
-
})
|
|
7026
|
-
.catch((e) => {
|
|
7027
|
-
this.onError(e);
|
|
7028
|
-
});
|
|
7029
|
-
}
|
|
7030
|
-
}
|
|
7031
|
-
getReferrals(showReferrer, offset = 0) {
|
|
7032
|
-
return API.graphql.getReferrals(showReferrer, offset);
|
|
7033
|
-
}
|
|
7034
|
-
paginate(offset, event) {
|
|
7035
|
-
if (this.loading)
|
|
7036
|
-
return null;
|
|
7037
|
-
let { referralsCount } = this;
|
|
7038
|
-
if (this.showreferrer && this.referredBy)
|
|
7039
|
-
referralsCount++;
|
|
7040
|
-
if (offset >= referralsCount || offset < 0)
|
|
7041
|
-
return null;
|
|
7042
|
-
this.loading = true;
|
|
7043
|
-
const { target } = event;
|
|
7044
|
-
target.innerText = "...";
|
|
7045
|
-
this.getReferrals(this.showreferrer, offset).then((res) => {
|
|
7046
|
-
target.innerText =
|
|
7047
|
-
offset > this.offset ? this.paginatemore : this.paginateless;
|
|
7048
|
-
this.referrals = res.referrals.data;
|
|
7049
|
-
this.offset = offset;
|
|
7050
|
-
this.loading = false;
|
|
7051
|
-
});
|
|
7052
|
-
}
|
|
7053
|
-
onError(e) {
|
|
7054
|
-
console.error(e);
|
|
7055
|
-
this.loading = false;
|
|
7056
|
-
}
|
|
7057
|
-
render() {
|
|
7058
|
-
let referredByRow;
|
|
7059
|
-
let referralsRow;
|
|
7060
|
-
const referralvariables = {
|
|
7061
|
-
usefirstreward: this.usefirstreward,
|
|
7062
|
-
referrercontent: this.referrercontent,
|
|
7063
|
-
convertedcontent: this.convertedcontent,
|
|
7064
|
-
pendingcontent: this.pendingcontent,
|
|
7065
|
-
pendingvalue: this.pendingvalue,
|
|
7066
|
-
referrervalue: this.referrervalue,
|
|
7067
|
-
valuecontent: this.valuecontent,
|
|
7068
|
-
expiredcontent: this.expiredcontent,
|
|
7069
|
-
expiredvalue: this.expiredvalue,
|
|
7070
|
-
expiresvalue: this.expiresvalue,
|
|
7071
|
-
redeemedvalue: this.redeemedvalue,
|
|
7072
|
-
showexpiry: this.showexpiry,
|
|
7073
|
-
shownotes: this.shownotes,
|
|
7074
|
-
cancelledvalue: this.cancelledvalue,
|
|
7075
|
-
cancelledcontent: this.cancelledcontent,
|
|
7076
|
-
};
|
|
7077
|
-
if (this.referrals) {
|
|
7078
|
-
referralsRow = this.referrals.map((ref) => {
|
|
7079
|
-
const referraltype = ref.rewards.length > 0 || ref.dateConverted ? "converted" : "pending";
|
|
7080
|
-
return (h("sqh-referral-component", { id: uuid(), referral: ref, referralvariables: referralvariables, referraltype: referraltype, unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
|
|
7081
|
-
});
|
|
7082
|
-
}
|
|
7083
|
-
if (this.referrals.length < 3 && this.referredBy && this.showreferrer) {
|
|
7084
|
-
referredByRow = (h("sqh-referral-component", { id: uuid(), referral: this.referredBy, referralvariables: referralvariables, referraltype: "referrer", unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
|
|
7085
|
-
}
|
|
7086
|
-
const clz = css `
|
|
7087
|
-
.squatch-referrals-icon.icon-ok-circled {
|
|
7088
|
-
color: ${this.rewardcolor};
|
|
7089
|
-
}
|
|
7090
|
-
.squatch-referrals-icon.icon-attention {
|
|
7091
|
-
color: ${this.pendingcolor};
|
|
7092
|
-
}
|
|
7093
|
-
.squatch-referrals-value {
|
|
7094
|
-
color: ${this.rewardcolor};
|
|
7095
|
-
}
|
|
7096
|
-
.squatch-referrals-value.pending {
|
|
7097
|
-
color: ${this.pendingcolor};
|
|
7098
|
-
}
|
|
7099
|
-
.squatch-referrals-value.referrer {
|
|
7100
|
-
color: ${this.rewardcolor};
|
|
7101
|
-
}
|
|
7102
|
-
.squatch-referrals-value.expired {
|
|
7103
|
-
color: ${this.expiredcolor};
|
|
7104
|
-
}
|
|
7105
|
-
.squatch-value-contents.expired {
|
|
7106
|
-
color: ${this.expiredcolor};
|
|
7107
|
-
}
|
|
7108
|
-
.squatch-referrals-icon.icon-attention.expired {
|
|
7109
|
-
color: ${this.expiredcolor};
|
|
7110
|
-
}
|
|
7111
|
-
.squatch-referrals-value.cancelled {
|
|
7112
|
-
color: ${this.cancelledcolor};
|
|
7113
|
-
}
|
|
7114
|
-
.squatch-value-contents.cancelled {
|
|
7115
|
-
color: ${this.cancelledcolor};
|
|
7116
|
-
}
|
|
7117
|
-
.squatch-referrals-icon.icon-attention.cancelled {
|
|
7118
|
-
color: ${this.cancelledcolor};
|
|
7119
|
-
}
|
|
7120
|
-
.squatch-referrals-heading {
|
|
7121
|
-
color: ${this.referralnamecolor};
|
|
7122
|
-
}
|
|
7123
|
-
.squatch-referrals-description,
|
|
7124
|
-
.squatch-referrals-value-content {
|
|
7125
|
-
color: ${this.referraltextcolor};
|
|
7126
|
-
}
|
|
7127
|
-
.squatch-customer-note {
|
|
7128
|
-
color: ${this.customernotecolor || "darkslategray"};
|
|
7129
|
-
}
|
|
7130
|
-
.squatch-referrals-scroll-action {
|
|
7131
|
-
font-family: ${"inherit"};
|
|
7132
|
-
}
|
|
7133
|
-
`;
|
|
7134
|
-
const totalReferralsCount = this.showreferrer && this.referredBy
|
|
7135
|
-
? this.referralsCount + 1
|
|
7136
|
-
: this.referralsCount;
|
|
7137
|
-
return !this.ishidden && totalReferralsCount > 0 ? (
|
|
7138
|
-
// Referral List when not hidden and 1 or more referrals
|
|
7139
|
-
h("div", { class: `squatch-referrals ${clz}` }, h("div", { class: "squatch-referrals-scroll-container" }, referralsRow, referredByRow), h("div", { class: "squatch-referrals-scroll-action-container" }, h("button", { class: `
|
|
7140
|
-
squatch-referrals-scroll-action previous ${this.loading
|
|
7141
|
-
? "disabled"
|
|
7142
|
-
: this.offset === 0
|
|
7143
|
-
? "disabled"
|
|
7144
|
-
: ""}
|
|
7145
|
-
`, onClick: (event) => this.paginate(this.offset - 3, event) }, this.paginateless), h("button", { class: `
|
|
7146
|
-
squatch-referrals-scroll-action view-more ${this.loading
|
|
7147
|
-
? "disabled"
|
|
7148
|
-
: this.showreferrer && this.referredBy
|
|
7149
|
-
? this.offset >= this.referralsCount - 2
|
|
7150
|
-
? "disabled"
|
|
7151
|
-
: ""
|
|
7152
|
-
: this.offset >= this.referralsCount - 3
|
|
7153
|
-
? "disabled"
|
|
7154
|
-
: ""}
|
|
7155
|
-
`, "view-more": true, onClick: (event) => this.paginate(this.offset + 3, event) }, this.paginatemore)))) : (
|
|
7156
|
-
// 'No Referrals Yet' button if this.referralCount < 1
|
|
7157
|
-
h("div", { class: "squatch-referrals-scroll-action-container" }, h("button", { disabled: true, class: "squatch-no-referrals-yet" }, this.noreferralsyet)));
|
|
7158
|
-
}
|
|
7159
|
-
};
|
|
7111
|
+
const ReferralList = class {
|
|
7112
|
+
constructor(hostRef) {
|
|
7113
|
+
registerInstance(this, hostRef);
|
|
7114
|
+
this.offset = 0;
|
|
7115
|
+
this.loading = true;
|
|
7116
|
+
}
|
|
7117
|
+
componentWillLoad() {
|
|
7118
|
+
if (!this.ishidden) {
|
|
7119
|
+
return this.getReferrals(this.showreferrer)
|
|
7120
|
+
.then((res) => {
|
|
7121
|
+
this.referrals = res.referrals.data;
|
|
7122
|
+
this.referredBy = res.referredByReferral;
|
|
7123
|
+
this.referralsCount = res.referrals.totalCount;
|
|
7124
|
+
this.loading = false;
|
|
7125
|
+
this.locale = res.locale;
|
|
7126
|
+
})
|
|
7127
|
+
.catch((e) => {
|
|
7128
|
+
this.onError(e);
|
|
7129
|
+
});
|
|
7130
|
+
}
|
|
7131
|
+
}
|
|
7132
|
+
getReferrals(showReferrer, offset = 0) {
|
|
7133
|
+
return API.graphql.getReferrals(showReferrer, offset);
|
|
7134
|
+
}
|
|
7135
|
+
paginate(offset, event) {
|
|
7136
|
+
if (this.loading)
|
|
7137
|
+
return null;
|
|
7138
|
+
let { referralsCount } = this;
|
|
7139
|
+
if (this.showreferrer && this.referredBy)
|
|
7140
|
+
referralsCount++;
|
|
7141
|
+
if (offset >= referralsCount || offset < 0)
|
|
7142
|
+
return null;
|
|
7143
|
+
this.loading = true;
|
|
7144
|
+
const { target } = event;
|
|
7145
|
+
target.innerText = "...";
|
|
7146
|
+
this.getReferrals(this.showreferrer, offset).then((res) => {
|
|
7147
|
+
target.innerText =
|
|
7148
|
+
offset > this.offset ? this.paginatemore : this.paginateless;
|
|
7149
|
+
this.referrals = res.referrals.data;
|
|
7150
|
+
this.offset = offset;
|
|
7151
|
+
this.loading = false;
|
|
7152
|
+
});
|
|
7153
|
+
}
|
|
7154
|
+
onError(e) {
|
|
7155
|
+
console.error(e);
|
|
7156
|
+
this.loading = false;
|
|
7157
|
+
}
|
|
7158
|
+
render() {
|
|
7159
|
+
let referredByRow;
|
|
7160
|
+
let referralsRow;
|
|
7161
|
+
const referralvariables = {
|
|
7162
|
+
usefirstreward: this.usefirstreward,
|
|
7163
|
+
referrercontent: this.referrercontent,
|
|
7164
|
+
convertedcontent: this.convertedcontent,
|
|
7165
|
+
pendingcontent: this.pendingcontent,
|
|
7166
|
+
pendingvalue: this.pendingvalue,
|
|
7167
|
+
referrervalue: this.referrervalue,
|
|
7168
|
+
valuecontent: this.valuecontent,
|
|
7169
|
+
expiredcontent: this.expiredcontent,
|
|
7170
|
+
expiredvalue: this.expiredvalue,
|
|
7171
|
+
expiresvalue: this.expiresvalue,
|
|
7172
|
+
redeemedvalue: this.redeemedvalue,
|
|
7173
|
+
showexpiry: this.showexpiry,
|
|
7174
|
+
shownotes: this.shownotes,
|
|
7175
|
+
cancelledvalue: this.cancelledvalue,
|
|
7176
|
+
cancelledcontent: this.cancelledcontent,
|
|
7177
|
+
};
|
|
7178
|
+
if (this.referrals) {
|
|
7179
|
+
referralsRow = this.referrals.map((ref) => {
|
|
7180
|
+
const referraltype = ref.rewards.length > 0 || ref.dateConverted ? "converted" : "pending";
|
|
7181
|
+
return (h("sqh-referral-component", { id: uuid(), referral: ref, referralvariables: referralvariables, referraltype: referraltype, unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
|
|
7182
|
+
});
|
|
7183
|
+
}
|
|
7184
|
+
if (this.referrals.length < 3 && this.referredBy && this.showreferrer) {
|
|
7185
|
+
referredByRow = (h("sqh-referral-component", { id: uuid(), referral: this.referredBy, referralvariables: referralvariables, referraltype: "referrer", unknownuser: this.unknownuser, locale: this.internationalization ? this.locale : "en-US" }));
|
|
7186
|
+
}
|
|
7187
|
+
const clz = css `
|
|
7188
|
+
.squatch-referrals-icon.icon-ok-circled {
|
|
7189
|
+
color: ${this.rewardcolor};
|
|
7190
|
+
}
|
|
7191
|
+
.squatch-referrals-icon.icon-attention {
|
|
7192
|
+
color: ${this.pendingcolor};
|
|
7193
|
+
}
|
|
7194
|
+
.squatch-referrals-value {
|
|
7195
|
+
color: ${this.rewardcolor};
|
|
7196
|
+
}
|
|
7197
|
+
.squatch-referrals-value.pending {
|
|
7198
|
+
color: ${this.pendingcolor};
|
|
7199
|
+
}
|
|
7200
|
+
.squatch-referrals-value.referrer {
|
|
7201
|
+
color: ${this.rewardcolor};
|
|
7202
|
+
}
|
|
7203
|
+
.squatch-referrals-value.expired {
|
|
7204
|
+
color: ${this.expiredcolor};
|
|
7205
|
+
}
|
|
7206
|
+
.squatch-value-contents.expired {
|
|
7207
|
+
color: ${this.expiredcolor};
|
|
7208
|
+
}
|
|
7209
|
+
.squatch-referrals-icon.icon-attention.expired {
|
|
7210
|
+
color: ${this.expiredcolor};
|
|
7211
|
+
}
|
|
7212
|
+
.squatch-referrals-value.cancelled {
|
|
7213
|
+
color: ${this.cancelledcolor};
|
|
7214
|
+
}
|
|
7215
|
+
.squatch-value-contents.cancelled {
|
|
7216
|
+
color: ${this.cancelledcolor};
|
|
7217
|
+
}
|
|
7218
|
+
.squatch-referrals-icon.icon-attention.cancelled {
|
|
7219
|
+
color: ${this.cancelledcolor};
|
|
7220
|
+
}
|
|
7221
|
+
.squatch-referrals-heading {
|
|
7222
|
+
color: ${this.referralnamecolor};
|
|
7223
|
+
}
|
|
7224
|
+
.squatch-referrals-description,
|
|
7225
|
+
.squatch-referrals-value-content {
|
|
7226
|
+
color: ${this.referraltextcolor};
|
|
7227
|
+
}
|
|
7228
|
+
.squatch-customer-note {
|
|
7229
|
+
color: ${this.customernotecolor || "darkslategray"};
|
|
7230
|
+
}
|
|
7231
|
+
.squatch-referrals-scroll-action {
|
|
7232
|
+
font-family: ${"inherit"};
|
|
7233
|
+
}
|
|
7234
|
+
`;
|
|
7235
|
+
const totalReferralsCount = this.showreferrer && this.referredBy
|
|
7236
|
+
? this.referralsCount + 1
|
|
7237
|
+
: this.referralsCount;
|
|
7238
|
+
return !this.ishidden && totalReferralsCount > 0 ? (
|
|
7239
|
+
// Referral List when not hidden and 1 or more referrals
|
|
7240
|
+
h("div", { class: `squatch-referrals ${clz}` }, h("div", { class: "squatch-referrals-scroll-container" }, referralsRow, referredByRow), h("div", { class: "squatch-referrals-scroll-action-container" }, h("button", { class: `
|
|
7241
|
+
squatch-referrals-scroll-action previous ${this.loading
|
|
7242
|
+
? "disabled"
|
|
7243
|
+
: this.offset === 0
|
|
7244
|
+
? "disabled"
|
|
7245
|
+
: ""}
|
|
7246
|
+
`, onClick: (event) => this.paginate(this.offset - 3, event) }, this.paginateless), h("button", { class: `
|
|
7247
|
+
squatch-referrals-scroll-action view-more ${this.loading
|
|
7248
|
+
? "disabled"
|
|
7249
|
+
: this.showreferrer && this.referredBy
|
|
7250
|
+
? this.offset >= this.referralsCount - 2
|
|
7251
|
+
? "disabled"
|
|
7252
|
+
: ""
|
|
7253
|
+
: this.offset >= this.referralsCount - 3
|
|
7254
|
+
? "disabled"
|
|
7255
|
+
: ""}
|
|
7256
|
+
`, "view-more": true, onClick: (event) => this.paginate(this.offset + 3, event) }, this.paginatemore)))) : (
|
|
7257
|
+
// 'No Referrals Yet' button if this.referralCount < 1
|
|
7258
|
+
h("div", { class: "squatch-referrals-scroll-action-container" }, h("button", { disabled: true, class: "squatch-no-referrals-yet" }, this.noreferralsyet)));
|
|
7259
|
+
}
|
|
7260
|
+
};
|
|
7160
7261
|
ReferralList.style = referralListCss;
|
|
7161
7262
|
|
|
7162
7263
|
const shareButtonCss = "sqh-share-button{display:inline-block}sqh-share-button .squatch-share-btn{display:block;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.428571429;border-radius:4px;width:140px;margin:5px}sqh-share-button .squatch-share-btn .share-btn-text{text-align:center;padding-left:30px}sqh-share-button .squatch-share-btn:focus{outline:0}sqh-share-button .squatch-share-btn.disabled,sqh-share-button .squatch-share-btn[disabled],fieldset[disabled] sqh-share-button .squatch-share-btn{cursor:not-allowed;pointer-events:none;opacity:0.65;-webkit-box-shadow:none;box-shadow:none}sqh-share-button a{position:relative;text-decoration:none}sqh-share-button a .icon{position:absolute;left:10px;top:6px;width:16px}sqh-share-button a:before{bottom:-1px;background:rgba(255, 255, 255, 0.18);content:\"\";left:-1px;position:absolute;top:-1px;width:40px}@media (max-width: 499px){sqh-share-button{display:block}}@media (max-width: 499px){sqh-share-button .squatch-share-btn{margin:5px 0px;width:auto}}";
|
|
7163
7264
|
|
|
7164
|
-
const ShareButton = class {
|
|
7165
|
-
constructor(hostRef) {
|
|
7166
|
-
registerInstance(this, hostRef);
|
|
7167
|
-
}
|
|
7168
|
-
clickHandler(e) {
|
|
7169
|
-
if (window["widgetIdent"].env === "demo") {
|
|
7170
|
-
e.preventDefault();
|
|
7171
|
-
return;
|
|
7172
|
-
}
|
|
7173
|
-
// checking for null on closest 'a' tag makes click handler avoid firing when margin is clicked
|
|
7174
|
-
var anchor = e.target.closest("a");
|
|
7175
|
-
if (anchor !== null && this.buttonClassName !== "email-share") {
|
|
7176
|
-
e.preventDefault();
|
|
7177
|
-
const url = this.url;
|
|
7178
|
-
const target = "_blank";
|
|
7179
|
-
const features = "status=0,width=680,height=580";
|
|
7180
|
-
window.open(url, target, features);
|
|
7181
|
-
}
|
|
7182
|
-
}
|
|
7183
|
-
componentDidLoad() {
|
|
7184
|
-
let el = this.button;
|
|
7185
|
-
el.addEventListener("click", this.clickHandler.bind(this), false);
|
|
7186
|
-
}
|
|
7187
|
-
render() {
|
|
7188
|
-
const isMobileiOS = detectMobileSafari() || detectMobileChrome();
|
|
7189
|
-
const target = isMobileiOS ? "_parent" : "_blank";
|
|
7190
|
-
const iconClass = `icon icon-${this.icon}`;
|
|
7191
|
-
const style = css `
|
|
7192
|
-
background-color: ${this.backgroundcolor};
|
|
7193
|
-
border: 1px solid ${this.backgroundcolor};
|
|
7194
|
-
color: ${this.textcolor};
|
|
7195
|
-
|
|
7196
|
-
&:hover {
|
|
7197
|
-
background: ${shadeColor(this.backgroundcolor, 10)};
|
|
7198
|
-
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
7199
|
-
color: ${this.textcolor};
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
&:focus {
|
|
7203
|
-
color: ${this.textcolor};
|
|
7204
|
-
}
|
|
7205
|
-
.icon-${this.icon} {
|
|
7206
|
-
left: ${this.iconhorizontal}px;
|
|
7207
|
-
top: ${this.iconvertical}px;
|
|
7208
|
-
font-size: ${this.iconsize}em;
|
|
7209
|
-
}
|
|
7210
|
-
`;
|
|
7211
|
-
const classes = [
|
|
7212
|
-
`squatch-share-btn`,
|
|
7213
|
-
this.buttonClassName,
|
|
7214
|
-
this.displayrule,
|
|
7215
|
-
style,
|
|
7216
|
-
].join(" ");
|
|
7217
|
-
return (h("a", { class: classes, href: this.url, target: target }, h("i", { class: iconClass }), h("span", { class: "share-btn-text" }, this.text)));
|
|
7218
|
-
}
|
|
7219
|
-
get button() { return getElement(this); }
|
|
7220
|
-
};
|
|
7265
|
+
const ShareButton = class {
|
|
7266
|
+
constructor(hostRef) {
|
|
7267
|
+
registerInstance(this, hostRef);
|
|
7268
|
+
}
|
|
7269
|
+
clickHandler(e) {
|
|
7270
|
+
if (window["widgetIdent"].env === "demo") {
|
|
7271
|
+
e.preventDefault();
|
|
7272
|
+
return;
|
|
7273
|
+
}
|
|
7274
|
+
// checking for null on closest 'a' tag makes click handler avoid firing when margin is clicked
|
|
7275
|
+
var anchor = e.target.closest("a");
|
|
7276
|
+
if (anchor !== null && this.buttonClassName !== "email-share") {
|
|
7277
|
+
e.preventDefault();
|
|
7278
|
+
const url = this.url;
|
|
7279
|
+
const target = "_blank";
|
|
7280
|
+
const features = "status=0,width=680,height=580";
|
|
7281
|
+
window.open(url, target, features);
|
|
7282
|
+
}
|
|
7283
|
+
}
|
|
7284
|
+
componentDidLoad() {
|
|
7285
|
+
let el = this.button;
|
|
7286
|
+
el.addEventListener("click", this.clickHandler.bind(this), false);
|
|
7287
|
+
}
|
|
7288
|
+
render() {
|
|
7289
|
+
const isMobileiOS = detectMobileSafari() || detectMobileChrome();
|
|
7290
|
+
const target = isMobileiOS ? "_parent" : "_blank";
|
|
7291
|
+
const iconClass = `icon icon-${this.icon}`;
|
|
7292
|
+
const style = css `
|
|
7293
|
+
background-color: ${this.backgroundcolor};
|
|
7294
|
+
border: 1px solid ${this.backgroundcolor};
|
|
7295
|
+
color: ${this.textcolor};
|
|
7296
|
+
|
|
7297
|
+
&:hover {
|
|
7298
|
+
background: ${shadeColor(this.backgroundcolor, 10)};
|
|
7299
|
+
border-color: ${shadeColor(this.backgroundcolor, 12)};
|
|
7300
|
+
color: ${this.textcolor};
|
|
7301
|
+
}
|
|
7302
|
+
|
|
7303
|
+
&:focus {
|
|
7304
|
+
color: ${this.textcolor};
|
|
7305
|
+
}
|
|
7306
|
+
.icon-${this.icon} {
|
|
7307
|
+
left: ${this.iconhorizontal}px;
|
|
7308
|
+
top: ${this.iconvertical}px;
|
|
7309
|
+
font-size: ${this.iconsize}em;
|
|
7310
|
+
}
|
|
7311
|
+
`;
|
|
7312
|
+
const classes = [
|
|
7313
|
+
`squatch-share-btn`,
|
|
7314
|
+
this.buttonClassName,
|
|
7315
|
+
this.displayrule,
|
|
7316
|
+
style,
|
|
7317
|
+
].join(" ");
|
|
7318
|
+
return (h("a", { class: classes, href: this.url, target: target }, h("i", { class: iconClass }), h("span", { class: "share-btn-text" }, this.text)));
|
|
7319
|
+
}
|
|
7320
|
+
get button() { return getElement(this); }
|
|
7321
|
+
};
|
|
7221
7322
|
ShareButton.style = shareButtonCss;
|
|
7222
7323
|
|
|
7223
7324
|
const shareButtonContainerCss = "sqh-share-button-container{text-align:center;display:block;max-width:100%;padding-bottom:24px;border-bottom:1px solid lightgray}sqh-share-button-container .squatch-share-btn.hidden{display:none}sqh-share-button-container .squatch-share-btn.mobile-only{display:none}@media (max-width: 499px){sqh-share-button-container .squatch-share-btn.mobile-only{display:block}}@media (max-width: 499px){sqh-share-button-container .squatch-share-btn.desktop-only{display:none}}";
|
|
7224
7325
|
|
|
7225
|
-
const ShareButtonContainer = class {
|
|
7226
|
-
constructor(hostRef) {
|
|
7227
|
-
registerInstance(this, hostRef);
|
|
7228
|
-
/**
|
|
7229
|
-
* Email button icon
|
|
7230
|
-
*
|
|
7231
|
-
* @uiName Email Icon
|
|
7232
|
-
* @uiGroup Email
|
|
7233
|
-
*/
|
|
7234
|
-
this.emailicon = "mail";
|
|
7235
|
-
/**
|
|
7236
|
-
* CSS
|
|
7237
|
-
*
|
|
7238
|
-
* @uiName Email Class Name
|
|
7239
|
-
* @uiGroup Email
|
|
7240
|
-
*/
|
|
7241
|
-
this.emailclassName = "email-share";
|
|
7242
|
-
/**
|
|
7243
|
-
* Facebook button icon
|
|
7244
|
-
*
|
|
7245
|
-
* @uiName Facebook Icon
|
|
7246
|
-
* @uiGroup Facebook
|
|
7247
|
-
*/
|
|
7248
|
-
this.facebookicon = "facebook";
|
|
7249
|
-
/**
|
|
7250
|
-
* Number to horizontally align the facebook button icon
|
|
7251
|
-
*
|
|
7252
|
-
* @uiName Facebook Icon Horizontal
|
|
7253
|
-
* @uiGroup Facebook
|
|
7254
|
-
*/
|
|
7255
|
-
this.facebookiconhorizontal = 9;
|
|
7256
|
-
/**
|
|
7257
|
-
*
|
|
7258
|
-
*
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
* Twitter
|
|
7265
|
-
*
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
*
|
|
7272
|
-
*
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
*
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
* @
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
*
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
*
|
|
7297
|
-
*
|
|
7298
|
-
* @
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
*
|
|
7304
|
-
*
|
|
7305
|
-
* @
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
*
|
|
7311
|
-
*
|
|
7312
|
-
* @
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
*
|
|
7318
|
-
* @
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
*
|
|
7324
|
-
*
|
|
7325
|
-
* @
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
*
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
*
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
* Pinterest
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
*
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
*
|
|
7361
|
-
*
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
*
|
|
7368
|
-
*
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
*
|
|
7375
|
-
*
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
* @uiName Messenger Icon
|
|
7382
|
-
* @uiGroup Messenger
|
|
7383
|
-
*/
|
|
7384
|
-
this.
|
|
7385
|
-
/**
|
|
7386
|
-
*
|
|
7387
|
-
*
|
|
7388
|
-
* @uiName
|
|
7389
|
-
* @uiGroup Messenger
|
|
7390
|
-
*/
|
|
7391
|
-
this.
|
|
7392
|
-
/**
|
|
7393
|
-
*
|
|
7394
|
-
*
|
|
7395
|
-
* @uiName
|
|
7396
|
-
* @uiGroup Messenger
|
|
7397
|
-
*/
|
|
7398
|
-
this.
|
|
7399
|
-
/**
|
|
7400
|
-
* Line button icon
|
|
7401
|
-
*
|
|
7402
|
-
* @uiName Line Icon
|
|
7403
|
-
* @uiGroup Line Messenger
|
|
7404
|
-
*/
|
|
7405
|
-
this.
|
|
7406
|
-
/**
|
|
7407
|
-
*
|
|
7408
|
-
*
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
}
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
})
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
onError(e) {
|
|
7463
|
-
console.log("Error loading via GraphQL.", e);
|
|
7464
|
-
}
|
|
7465
|
-
render() {
|
|
7466
|
-
const emailBtn = (h("sqh-share-button", { displayrule: this.emaildisplayrule, text: this.emailtext, backgroundcolor: this.emailbackgroundcolor, textcolor: this.emailtextcolor, icon: this.emailicon, class: this.emailclassName, iconhorizontal: this.emailiconhorizontal, iconvertical: this.emailiconvertical, iconsize: this.emailiconsize, url: this.emailurl }));
|
|
7467
|
-
const facebookBtn = (h("sqh-share-button", { displayrule: this.facebookdisplayrule, text: this.facebooktext, backgroundcolor: this.facebookbackgroundcolor, textcolor: this.facebooktextcolor, icon: this.facebookicon, class: this.facebookclassName, iconhorizontal: this.facebookiconhorizontal, iconvertical: this.facebookiconvertical, iconsize: this.facebookiconsize, url: this.facebookurl }));
|
|
7468
|
-
const twitterBtn = (h("sqh-share-button", { displayrule: this.twitterdisplayrule, text: this.twittertext, backgroundcolor: this.twitterbackgroundcolor, textcolor: this.twittertextcolor, icon: this.twittericon, class: this.twitterclassName, iconhorizontal: this.twittericonhorizontal, iconvertical: this.twittericonvertical, iconsize: this.twittericonsize, url: this.twitterurl }));
|
|
7469
|
-
const smsBtn = (h("sqh-share-button", { displayrule: this.smsdisplayrule, text: this.smstext, backgroundcolor: this.smsbackgroundcolor, textcolor: this.smstextcolor, icon: this.smsicon, class: this.smsclassName, iconhorizontal: this.smsiconhorizontal, iconvertical: this.smsiconvertical, iconsize: this.smsiconsize, url: this.smsurl }));
|
|
7470
|
-
const whatsappBtn = (h("sqh-share-button", { displayrule: this.whatsappdisplayrule, text: this.whatsapptext, backgroundcolor: this.whatsappbackgroundcolor, textcolor: this.whatsapptextcolor, icon: this.whatsappicon, class: this.whatsappclassName, iconhorizontal: this.whatsappiconhorizontal, iconvertical: this.whatsappiconvertical, iconsize: this.whatsappiconsize, url: this.whatsappurl }));
|
|
7471
|
-
const linkedinBtn = (h("sqh-share-button", { displayrule: this.linkedindisplayrule, text: this.linkedintext, backgroundcolor: this.linkedinbackgroundcolor, textcolor: this.linkedintextcolor, icon: this.linkedinicon, class: this.linkedinclassName, iconhorizontal: this.linkediniconhorizontal, iconvertical: this.linkediniconvertical, iconsize: this.linkediniconsize, url: this.linkedinurl }));
|
|
7472
|
-
const pinterestBtn = (h("sqh-share-button", { displayrule: this.pinterestdisplayrule, text: this.pinteresttext, backgroundcolor: this.pinterestbackgroundcolor, textcolor: this.pinteresttextcolor, icon: this.pinteresticon, class: this.pinterestclassName, iconhorizontal: this.pinteresticonhorizontal, iconvertical: this.pinteresticonvertical, iconsize: this.pinteresticonsize, url: this.pinteresturl }));
|
|
7473
|
-
const messengerBtn = (h("sqh-share-button", { displayrule: this.messengerdisplayrule, text: this.messengertext, backgroundcolor: this.messengerbackgroundcolor, textcolor: this.messengertextcolor, icon: this.messengericon, class: this.messengerclassName, iconhorizontal: this.messengericonhorizontal, iconvertical: this.messengericonvertical, iconsize: this.messengericonsize, url: this.messengerurl }));
|
|
7474
|
-
const lineBtn = (h("sqh-share-button", { displayrule: this.linedisplayrule, text: this.linetext, backgroundcolor: this.linebackgroundcolor, textcolor: this.linetextcolor, icon: this.lineicon, class: this.lineclassName, iconhorizontal: this.lineiconhorizontal, iconvertical: this.lineiconvertical, iconsize: this.lineiconsize, url: this.lineurl }));
|
|
7475
|
-
return (!this.ishidden && (h("div", null, emailBtn, facebookBtn, twitterBtn, smsBtn, whatsappBtn, linkedinBtn, pinterestBtn, messengerBtn, lineBtn)));
|
|
7476
|
-
}
|
|
7477
|
-
};
|
|
7326
|
+
const ShareButtonContainer = class {
|
|
7327
|
+
constructor(hostRef) {
|
|
7328
|
+
registerInstance(this, hostRef);
|
|
7329
|
+
/**
|
|
7330
|
+
* Email button icon
|
|
7331
|
+
*
|
|
7332
|
+
* @uiName Email Icon
|
|
7333
|
+
* @uiGroup Email
|
|
7334
|
+
*/
|
|
7335
|
+
this.emailicon = "mail";
|
|
7336
|
+
/**
|
|
7337
|
+
* CSS class name for additional styling.
|
|
7338
|
+
*
|
|
7339
|
+
* @uiName Email Class Name
|
|
7340
|
+
* @uiGroup Email
|
|
7341
|
+
*/
|
|
7342
|
+
this.emailclassName = "email-share";
|
|
7343
|
+
/**
|
|
7344
|
+
* Facebook button icon
|
|
7345
|
+
*
|
|
7346
|
+
* @uiName Facebook Icon
|
|
7347
|
+
* @uiGroup Facebook
|
|
7348
|
+
*/
|
|
7349
|
+
this.facebookicon = "facebook";
|
|
7350
|
+
/**
|
|
7351
|
+
* Number to horizontally align the facebook button icon
|
|
7352
|
+
*
|
|
7353
|
+
* @uiName Facebook Icon Horizontal
|
|
7354
|
+
* @uiGroup Facebook
|
|
7355
|
+
*/
|
|
7356
|
+
this.facebookiconhorizontal = 9;
|
|
7357
|
+
/**
|
|
7358
|
+
* @uiName Facebook Icon Size
|
|
7359
|
+
* @uiGroup Facebook
|
|
7360
|
+
*/
|
|
7361
|
+
this.facebookiconsize = 1.2;
|
|
7362
|
+
/**
|
|
7363
|
+
* Twitter button icon
|
|
7364
|
+
*
|
|
7365
|
+
* @uiName Twitter Icon
|
|
7366
|
+
* @uiGroup Twitter
|
|
7367
|
+
*/
|
|
7368
|
+
this.twittericon = "twitter";
|
|
7369
|
+
/**
|
|
7370
|
+
* Number to horizontally align the twitter button icon
|
|
7371
|
+
*
|
|
7372
|
+
* @uiName Twitter Icon Horizontal
|
|
7373
|
+
* @uiGroup Twitter
|
|
7374
|
+
*/
|
|
7375
|
+
this.twittericonhorizontal = 9;
|
|
7376
|
+
/**
|
|
7377
|
+
* @uiName Twitter Icon Size
|
|
7378
|
+
* @uiGroup Twitter
|
|
7379
|
+
*/
|
|
7380
|
+
this.twittericonsize = 1.2;
|
|
7381
|
+
/**
|
|
7382
|
+
* SMS button icon
|
|
7383
|
+
*
|
|
7384
|
+
* @uiName SMS Icon
|
|
7385
|
+
* @uiGroup SMS
|
|
7386
|
+
*/
|
|
7387
|
+
this.smsicon = "chat";
|
|
7388
|
+
/**
|
|
7389
|
+
* @uiName WhatsApp Text Color
|
|
7390
|
+
* @uiGroup WhatsApp
|
|
7391
|
+
* @uiWidget color
|
|
7392
|
+
* @format color
|
|
7393
|
+
* @default "#ffffff"
|
|
7394
|
+
*/
|
|
7395
|
+
this.whatsapptextcolor = "#fff";
|
|
7396
|
+
/**
|
|
7397
|
+
* WhatsApp button icon
|
|
7398
|
+
*
|
|
7399
|
+
* @uiName WhatsApp Icon
|
|
7400
|
+
* @uiGroup WhatsApp
|
|
7401
|
+
*/
|
|
7402
|
+
this.whatsappicon = "whatsapp";
|
|
7403
|
+
/**
|
|
7404
|
+
* Number to horizontally align the WhatsApp button icon
|
|
7405
|
+
*
|
|
7406
|
+
* @uiName WhatsApp Icon Horizontal
|
|
7407
|
+
* @uiGroup WhatsApp
|
|
7408
|
+
*/
|
|
7409
|
+
this.whatsappiconhorizontal = 7;
|
|
7410
|
+
/**
|
|
7411
|
+
* Number to vertically align the WhatsApp button icon
|
|
7412
|
+
*
|
|
7413
|
+
* @uiName WhatsApp Icon Vertical
|
|
7414
|
+
* @uiGroup WhatsApp
|
|
7415
|
+
*/
|
|
7416
|
+
this.whatsappiconvertical = 2;
|
|
7417
|
+
/**
|
|
7418
|
+
* @uiName WhatsApp Icon Size
|
|
7419
|
+
* @uiGroup WhatsApp
|
|
7420
|
+
*/
|
|
7421
|
+
this.whatsappiconsize = 1.4;
|
|
7422
|
+
/**
|
|
7423
|
+
* Linkedin button icon
|
|
7424
|
+
*
|
|
7425
|
+
* @uiName Linkedin Icon
|
|
7426
|
+
* @uiGroup LinkedIn
|
|
7427
|
+
*/
|
|
7428
|
+
this.linkedinicon = "linkedin";
|
|
7429
|
+
/**
|
|
7430
|
+
* @uiName Linkedin Icon Size
|
|
7431
|
+
* @uiGroup LinkedIn
|
|
7432
|
+
*/
|
|
7433
|
+
this.linkediniconsize = 1.2;
|
|
7434
|
+
/**
|
|
7435
|
+
* Pinterest button icon
|
|
7436
|
+
*
|
|
7437
|
+
* @uiName Pinterest Icon
|
|
7438
|
+
* @uiGroup Pinterest
|
|
7439
|
+
*/
|
|
7440
|
+
this.pinteresticon = "pinterest";
|
|
7441
|
+
/**
|
|
7442
|
+
* Number to horizontally align the Pinterest button icon
|
|
7443
|
+
*
|
|
7444
|
+
* @uiName Pinterest Icon Horizontal
|
|
7445
|
+
* @uiGroup Pinterest
|
|
7446
|
+
*/
|
|
7447
|
+
this.pinteresticonhorizontal = 9;
|
|
7448
|
+
/**
|
|
7449
|
+
* Number to vertically align the Pinterest button icon
|
|
7450
|
+
*
|
|
7451
|
+
* @uiName Pinterest Icon Vertical
|
|
7452
|
+
* @uiGroup Pinterest
|
|
7453
|
+
*/
|
|
7454
|
+
this.pinteresticonvertical = 4;
|
|
7455
|
+
/**
|
|
7456
|
+
* @uiName Pinterest Icon Size
|
|
7457
|
+
* @uiGroup Pinterest
|
|
7458
|
+
*/
|
|
7459
|
+
this.pinteresticonsize = 1.2;
|
|
7460
|
+
/**
|
|
7461
|
+
* Messenger button icon
|
|
7462
|
+
*
|
|
7463
|
+
* @uiName Messenger Icon
|
|
7464
|
+
* @uiGroup Messenger
|
|
7465
|
+
*/
|
|
7466
|
+
this.messengericon = "messenger";
|
|
7467
|
+
/**
|
|
7468
|
+
* Number to horizontally align the Messenger button icon
|
|
7469
|
+
*
|
|
7470
|
+
* @uiName Messenger Icon Horizontal
|
|
7471
|
+
* @uiGroup Messenger
|
|
7472
|
+
*/
|
|
7473
|
+
this.messengericonhorizontal = 7;
|
|
7474
|
+
/**
|
|
7475
|
+
* Number to vertically align the Messenger button icon
|
|
7476
|
+
*
|
|
7477
|
+
* @uiName Messenger Icon Vertical
|
|
7478
|
+
* @uiGroup Messenger
|
|
7479
|
+
*/
|
|
7480
|
+
this.messengericonvertical = 3;
|
|
7481
|
+
/**
|
|
7482
|
+
* @uiName Messenger Icon Size
|
|
7483
|
+
* @uiGroup Messenger
|
|
7484
|
+
*/
|
|
7485
|
+
this.messengericonsize = 1.4;
|
|
7486
|
+
/**
|
|
7487
|
+
* Line button icon
|
|
7488
|
+
*
|
|
7489
|
+
* @uiName Line Icon
|
|
7490
|
+
* @uiGroup Line Messenger
|
|
7491
|
+
*/
|
|
7492
|
+
this.lineicon = "line";
|
|
7493
|
+
/**
|
|
7494
|
+
* Number to horizontally align the Line button icon
|
|
7495
|
+
*
|
|
7496
|
+
* @uiName Line Icon Horizontal
|
|
7497
|
+
* @uiGroup Line Messenger
|
|
7498
|
+
*/
|
|
7499
|
+
this.lineiconhorizontal = -2;
|
|
7500
|
+
/**
|
|
7501
|
+
* Number to vertically align the Line button icon
|
|
7502
|
+
*
|
|
7503
|
+
* @uiName Line Icon Vertical
|
|
7504
|
+
* @uiGroup Line Messenger
|
|
7505
|
+
*/
|
|
7506
|
+
this.lineiconvertical = -5;
|
|
7507
|
+
/**
|
|
7508
|
+
* @uiName Line Icon Size
|
|
7509
|
+
* @uiGroup Line Messenger
|
|
7510
|
+
*/
|
|
7511
|
+
this.lineiconsize = 2.2;
|
|
7512
|
+
}
|
|
7513
|
+
componentWillLoad() {
|
|
7514
|
+
if (!this.ishidden) {
|
|
7515
|
+
const mediums = [
|
|
7516
|
+
"EMAIL",
|
|
7517
|
+
"FACEBOOK",
|
|
7518
|
+
"TWITTER",
|
|
7519
|
+
"SMS",
|
|
7520
|
+
"WHATSAPP",
|
|
7521
|
+
"LINKEDIN",
|
|
7522
|
+
"PINTEREST",
|
|
7523
|
+
"FBMESSENGER",
|
|
7524
|
+
"LINEMESSENGER",
|
|
7525
|
+
];
|
|
7526
|
+
return this.getMessageLinks(mediums);
|
|
7527
|
+
}
|
|
7528
|
+
}
|
|
7529
|
+
getMessageLinks(mediums) {
|
|
7530
|
+
return API.graphql
|
|
7531
|
+
.getMessageLinks(mediums)
|
|
7532
|
+
.then((res) => {
|
|
7533
|
+
this.emailurl = res.EMAIL;
|
|
7534
|
+
this.facebookurl = res.FACEBOOK;
|
|
7535
|
+
this.twitterurl = res.TWITTER;
|
|
7536
|
+
this.smsurl = res.SMS;
|
|
7537
|
+
this.whatsappurl = res.WHATSAPP;
|
|
7538
|
+
this.linkedinurl = res.LINKEDIN;
|
|
7539
|
+
this.pinteresturl = res.PINTEREST;
|
|
7540
|
+
this.messengerurl = res.FBMESSENGER;
|
|
7541
|
+
this.lineurl = res.LINEMESSENGER;
|
|
7542
|
+
})
|
|
7543
|
+
.catch((e) => {
|
|
7544
|
+
this.onError(e);
|
|
7545
|
+
});
|
|
7546
|
+
}
|
|
7547
|
+
onError(e) {
|
|
7548
|
+
console.log("Error loading via GraphQL.", e);
|
|
7549
|
+
}
|
|
7550
|
+
render() {
|
|
7551
|
+
const emailBtn = (h("sqh-share-button", { displayrule: this.emaildisplayrule, text: this.emailtext, backgroundcolor: this.emailbackgroundcolor, textcolor: this.emailtextcolor, icon: this.emailicon, class: this.emailclassName, iconhorizontal: this.emailiconhorizontal, iconvertical: this.emailiconvertical, iconsize: this.emailiconsize, url: this.emailurl }));
|
|
7552
|
+
const facebookBtn = (h("sqh-share-button", { displayrule: this.facebookdisplayrule, text: this.facebooktext, backgroundcolor: this.facebookbackgroundcolor, textcolor: this.facebooktextcolor, icon: this.facebookicon, class: this.facebookclassName, iconhorizontal: this.facebookiconhorizontal, iconvertical: this.facebookiconvertical, iconsize: this.facebookiconsize, url: this.facebookurl }));
|
|
7553
|
+
const twitterBtn = (h("sqh-share-button", { displayrule: this.twitterdisplayrule, text: this.twittertext, backgroundcolor: this.twitterbackgroundcolor, textcolor: this.twittertextcolor, icon: this.twittericon, class: this.twitterclassName, iconhorizontal: this.twittericonhorizontal, iconvertical: this.twittericonvertical, iconsize: this.twittericonsize, url: this.twitterurl }));
|
|
7554
|
+
const smsBtn = (h("sqh-share-button", { displayrule: this.smsdisplayrule, text: this.smstext, backgroundcolor: this.smsbackgroundcolor, textcolor: this.smstextcolor, icon: this.smsicon, class: this.smsclassName, iconhorizontal: this.smsiconhorizontal, iconvertical: this.smsiconvertical, iconsize: this.smsiconsize, url: this.smsurl }));
|
|
7555
|
+
const whatsappBtn = (h("sqh-share-button", { displayrule: this.whatsappdisplayrule, text: this.whatsapptext, backgroundcolor: this.whatsappbackgroundcolor, textcolor: this.whatsapptextcolor, icon: this.whatsappicon, class: this.whatsappclassName, iconhorizontal: this.whatsappiconhorizontal, iconvertical: this.whatsappiconvertical, iconsize: this.whatsappiconsize, url: this.whatsappurl }));
|
|
7556
|
+
const linkedinBtn = (h("sqh-share-button", { displayrule: this.linkedindisplayrule, text: this.linkedintext, backgroundcolor: this.linkedinbackgroundcolor, textcolor: this.linkedintextcolor, icon: this.linkedinicon, class: this.linkedinclassName, iconhorizontal: this.linkediniconhorizontal, iconvertical: this.linkediniconvertical, iconsize: this.linkediniconsize, url: this.linkedinurl }));
|
|
7557
|
+
const pinterestBtn = (h("sqh-share-button", { displayrule: this.pinterestdisplayrule, text: this.pinteresttext, backgroundcolor: this.pinterestbackgroundcolor, textcolor: this.pinteresttextcolor, icon: this.pinteresticon, class: this.pinterestclassName, iconhorizontal: this.pinteresticonhorizontal, iconvertical: this.pinteresticonvertical, iconsize: this.pinteresticonsize, url: this.pinteresturl }));
|
|
7558
|
+
const messengerBtn = (h("sqh-share-button", { displayrule: this.messengerdisplayrule, text: this.messengertext, backgroundcolor: this.messengerbackgroundcolor, textcolor: this.messengertextcolor, icon: this.messengericon, class: this.messengerclassName, iconhorizontal: this.messengericonhorizontal, iconvertical: this.messengericonvertical, iconsize: this.messengericonsize, url: this.messengerurl }));
|
|
7559
|
+
const lineBtn = (h("sqh-share-button", { displayrule: this.linedisplayrule, text: this.linetext, backgroundcolor: this.linebackgroundcolor, textcolor: this.linetextcolor, icon: this.lineicon, class: this.lineclassName, iconhorizontal: this.lineiconhorizontal, iconvertical: this.lineiconvertical, iconsize: this.lineiconsize, url: this.lineurl }));
|
|
7560
|
+
return (!this.ishidden && (h("div", null, emailBtn, facebookBtn, twitterBtn, smsBtn, whatsappBtn, linkedinBtn, pinterestBtn, messengerBtn, lineBtn)));
|
|
7561
|
+
}
|
|
7562
|
+
};
|
|
7478
7563
|
ShareButtonContainer.style = shareButtonContainerCss;
|
|
7479
7564
|
|
|
7480
7565
|
const statComponentCss = "sqh-stat-component{text-align:center;width:140px;float:left}sqh-stat-component>div{padding:10px}sqh-stat-component .stat-value{white-space:nowrap;font-size:30px;line-height:20px;margin-top:20px;margin-bottom:8px;font-weight:300}sqh-stat-component .stat-description{text-transform:uppercase;font-size:12px}@media (max-width: 499px){sqh-stat-component{width:100%;text-align:left;background:#f2f2f2;border:1px solid #ddd}sqh-stat-component:first-child{border-radius:4px 4px 0 0}sqh-stat-component:last-child{border-radius:0 0 4px 4px}}@media (max-width: 499px){sqh-stat-component .stat-value{font-size:22px;float:left;width:60px;text-align:center;margin:0 10px 0 0}}@media (max-width: 499px){sqh-stat-component .stat-description{line-height:20px;padding-left:100px;overflow-wrap:break-word}}";
|
|
7481
7566
|
|
|
7482
|
-
const StatComponent = class {
|
|
7483
|
-
constructor(hostRef) {
|
|
7484
|
-
registerInstance(this, hostRef);
|
|
7485
|
-
this.statTypeUpdated = createEvent(this, "statTypeUpdated", 7);
|
|
7486
|
-
this.statAdded = createEvent(this, "statAdded", 7);
|
|
7487
|
-
}
|
|
7488
|
-
componentWillLoad() {
|
|
7489
|
-
this.statAddedHandler(this.elem);
|
|
7490
|
-
}
|
|
7491
|
-
stattypeHandler(newValue, oldValue) {
|
|
7492
|
-
if (newValue !== oldValue)
|
|
7493
|
-
this.statTypeUpdatedHandler(this.elem);
|
|
7494
|
-
}
|
|
7495
|
-
statAddedHandler(stat) {
|
|
7496
|
-
this.statAdded.emit(stat);
|
|
7497
|
-
}
|
|
7498
|
-
statTypeUpdatedHandler(stat) {
|
|
7499
|
-
this.statTypeUpdated.emit(stat);
|
|
7500
|
-
}
|
|
7501
|
-
render() {
|
|
7502
|
-
const clz = css `
|
|
7503
|
-
color: ${this.statcolor};
|
|
7504
|
-
`;
|
|
7505
|
-
return (!this.ishidden && (h("div", { class: clz }, h("div", { class: "stat-value" }, this.statvalue), h("div", { class: "stat-description" }, this.statdescription))));
|
|
7506
|
-
}
|
|
7507
|
-
get elem() { return getElement(this); }
|
|
7508
|
-
static get watchers() { return {
|
|
7509
|
-
"stattype": ["stattypeHandler"]
|
|
7510
|
-
}; }
|
|
7511
|
-
};
|
|
7567
|
+
const StatComponent = class {
|
|
7568
|
+
constructor(hostRef) {
|
|
7569
|
+
registerInstance(this, hostRef);
|
|
7570
|
+
this.statTypeUpdated = createEvent(this, "statTypeUpdated", 7);
|
|
7571
|
+
this.statAdded = createEvent(this, "statAdded", 7);
|
|
7572
|
+
}
|
|
7573
|
+
componentWillLoad() {
|
|
7574
|
+
this.statAddedHandler(this.elem);
|
|
7575
|
+
}
|
|
7576
|
+
stattypeHandler(newValue, oldValue) {
|
|
7577
|
+
if (newValue !== oldValue)
|
|
7578
|
+
this.statTypeUpdatedHandler(this.elem);
|
|
7579
|
+
}
|
|
7580
|
+
statAddedHandler(stat) {
|
|
7581
|
+
this.statAdded.emit(stat);
|
|
7582
|
+
}
|
|
7583
|
+
statTypeUpdatedHandler(stat) {
|
|
7584
|
+
this.statTypeUpdated.emit(stat);
|
|
7585
|
+
}
|
|
7586
|
+
render() {
|
|
7587
|
+
const clz = css `
|
|
7588
|
+
color: ${this.statcolor};
|
|
7589
|
+
`;
|
|
7590
|
+
return (!this.ishidden && (h("div", { class: clz }, h("div", { class: "stat-value" }, this.statvalue), h("div", { class: "stat-description" }, this.statdescription))));
|
|
7591
|
+
}
|
|
7592
|
+
get elem() { return getElement(this); }
|
|
7593
|
+
static get watchers() { return {
|
|
7594
|
+
"stattype": ["stattypeHandler"]
|
|
7595
|
+
}; }
|
|
7596
|
+
};
|
|
7512
7597
|
StatComponent.style = statComponentCss;
|
|
7513
7598
|
|
|
7514
7599
|
/**
|
|
@@ -7806,109 +7891,108 @@ function pathToRegexp(path, keys, options) {
|
|
|
7806
7891
|
|
|
7807
7892
|
const statsContainerCss = "sqh-stats-container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}@media (max-width: 499px){sqh-stats-container{-ms-flex-direction:column;flex-direction:column}sqh-stats-container div{-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%}}";
|
|
7808
7893
|
|
|
7809
|
-
const StatsContainer = class {
|
|
7810
|
-
constructor(hostRef) {
|
|
7811
|
-
registerInstance(this, hostRef);
|
|
7812
|
-
/**
|
|
7813
|
-
*
|
|
7814
|
-
*
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
this.
|
|
7818
|
-
|
|
7819
|
-
"
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
const
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
.
|
|
7833
|
-
.
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
.
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
.
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
const
|
|
7866
|
-
|
|
7867
|
-
child
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
const
|
|
7875
|
-
const
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
//
|
|
7888
|
-
//
|
|
7889
|
-
|
|
7890
|
-
const
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
padding-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
}
|
|
7910
|
-
|
|
7911
|
-
};
|
|
7894
|
+
const StatsContainer = class {
|
|
7895
|
+
constructor(hostRef) {
|
|
7896
|
+
registerInstance(this, hostRef);
|
|
7897
|
+
/**
|
|
7898
|
+
* @undocumented
|
|
7899
|
+
* @uiName Is Hidden
|
|
7900
|
+
*/
|
|
7901
|
+
this.ishidden = false;
|
|
7902
|
+
this.statPaths = [
|
|
7903
|
+
"/rewardBalance/:type/:unit/:valuetype?/:isGlobal?",
|
|
7904
|
+
"/:statName",
|
|
7905
|
+
];
|
|
7906
|
+
this.statPathRegexp = this.statPaths.map((path) => {
|
|
7907
|
+
const keys = [];
|
|
7908
|
+
const regexp = pathToRegexp(path, keys);
|
|
7909
|
+
return { regexp, keys };
|
|
7910
|
+
});
|
|
7911
|
+
this.loading = true;
|
|
7912
|
+
}
|
|
7913
|
+
componentWillLoad() {
|
|
7914
|
+
if (!this.ishidden) {
|
|
7915
|
+
return API.graphql
|
|
7916
|
+
.getStats()
|
|
7917
|
+
.then((res) => {
|
|
7918
|
+
this.stats = {
|
|
7919
|
+
referralsCount: res.referralsCount.totalCount,
|
|
7920
|
+
referralsMonth: res.referralsMonth.totalCount,
|
|
7921
|
+
referralsWeek: res.referralsWeek.totalCount,
|
|
7922
|
+
rewardsCount: res.rewardsCount.totalCount,
|
|
7923
|
+
rewardsMonth: res.rewardsMonth.totalCount,
|
|
7924
|
+
rewardsWeek: res.rewardsWeek.totalCount,
|
|
7925
|
+
rewardBalance: res.rewardBalances,
|
|
7926
|
+
rewardBalanceGlobal: res.rewardBalancesGlobal,
|
|
7927
|
+
};
|
|
7928
|
+
this.loading = false;
|
|
7929
|
+
})
|
|
7930
|
+
.then(() => {
|
|
7931
|
+
const children = Array.from(this.container.querySelectorAll("[stattype]"));
|
|
7932
|
+
children.map((child) => {
|
|
7933
|
+
this.setStatValue(child);
|
|
7934
|
+
});
|
|
7935
|
+
})
|
|
7936
|
+
.catch((e) => {
|
|
7937
|
+
this.onError(e);
|
|
7938
|
+
});
|
|
7939
|
+
}
|
|
7940
|
+
}
|
|
7941
|
+
statTypeUpdatedHandler(event) {
|
|
7942
|
+
this.setStatValue(event.detail);
|
|
7943
|
+
}
|
|
7944
|
+
statAddedHandler(event) {
|
|
7945
|
+
if (this.stats)
|
|
7946
|
+
this.setStatValue(event.detail);
|
|
7947
|
+
}
|
|
7948
|
+
setStatValue(child) {
|
|
7949
|
+
const path = child.getAttribute("stattype");
|
|
7950
|
+
const stat = this.getStatFromPath(path);
|
|
7951
|
+
child.setAttribute("statvalue", `${stat}`);
|
|
7952
|
+
return child;
|
|
7953
|
+
}
|
|
7954
|
+
getStatFromPath(path) {
|
|
7955
|
+
const statPath = this.statPathRegexp.find((stat) => stat.regexp.test(path));
|
|
7956
|
+
if (!statPath)
|
|
7957
|
+
return 0;
|
|
7958
|
+
const { keys, regexp } = statPath;
|
|
7959
|
+
const res = regexp.exec(path);
|
|
7960
|
+
const statVariables = {};
|
|
7961
|
+
keys.forEach((k, i) => (statVariables[k.name] = res[i + 1]));
|
|
7962
|
+
return this.getStatValue(statVariables);
|
|
7963
|
+
}
|
|
7964
|
+
getStatValue(statVariables) {
|
|
7965
|
+
if (statVariables.statName)
|
|
7966
|
+
return this.stats[statVariables.statName] || 0;
|
|
7967
|
+
return this.getRewardBalance(statVariables);
|
|
7968
|
+
}
|
|
7969
|
+
getRewardBalance(statVariables) {
|
|
7970
|
+
const { type, unit, valuetype, isGlobal } = statVariables;
|
|
7971
|
+
// passing in CASH/USD as CASH_USD into this webcomponent so pathToRegexp doesn't split it and it stays all in unit.
|
|
7972
|
+
// this converts the _ back to / so it matches the unit from the backend.
|
|
7973
|
+
// possibly change the unit in the backend to avoid this?
|
|
7974
|
+
const newUnit = unit.replace(/_/, "/");
|
|
7975
|
+
const rewardBalance = this.stats[isGlobal ? "rewardBalanceGlobal" : "rewardBalance"].find((rb) => rb.type === type && rb.unit === newUnit);
|
|
7976
|
+
if (!rewardBalance)
|
|
7977
|
+
return 0;
|
|
7978
|
+
if (valuetype)
|
|
7979
|
+
return rewardBalance[valuetype];
|
|
7980
|
+
return rewardBalance.value;
|
|
7981
|
+
}
|
|
7982
|
+
onError(e) {
|
|
7983
|
+
console.log("Error loading via GraphQL.", e);
|
|
7984
|
+
this.loading = false;
|
|
7985
|
+
}
|
|
7986
|
+
render() {
|
|
7987
|
+
const containerStyle = css `
|
|
7988
|
+
display: ${this.ishidden ? "none" : "inherit"};
|
|
7989
|
+
padding-top: ${this.paddingtop}px;
|
|
7990
|
+
padding-bottom: ${this.paddingbottom}px;
|
|
7991
|
+
`;
|
|
7992
|
+
return (h("div", { class: containerStyle }, h("slot", null)));
|
|
7993
|
+
}
|
|
7994
|
+
get container() { return getElement(this); }
|
|
7995
|
+
};
|
|
7912
7996
|
StatsContainer.style = statsContainerCss;
|
|
7913
7997
|
|
|
7914
7998
|
var marked = createCommonjsModule(function (module, exports) {
|
|
@@ -10509,37 +10593,37 @@ var marked = createCommonjsModule(function (module, exports) {
|
|
|
10509
10593
|
|
|
10510
10594
|
const textComponentCss = "sqh-text-component{display:block}sqh-text-component p{margin:0}";
|
|
10511
10595
|
|
|
10512
|
-
const TextComponent = class {
|
|
10513
|
-
constructor(hostRef) {
|
|
10514
|
-
registerInstance(this, hostRef);
|
|
10515
|
-
}
|
|
10516
|
-
render() {
|
|
10517
|
-
const regex = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
|
|
10518
|
-
const textStyle = css `
|
|
10519
|
-
font-family: ${this.fontfamily || "inherit"};
|
|
10520
|
-
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
10521
|
-
text-align: ${this.textalign};
|
|
10522
|
-
color: ${this.color || "inherit"};
|
|
10523
|
-
padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
|
|
10524
|
-
padding-bottom: ${this.paddingbottom
|
|
10525
|
-
? this.paddingbottom + "px"
|
|
10526
|
-
: "inherit"};
|
|
10527
|
-
overflow-wrap: break-word;
|
|
10528
|
-
`;
|
|
10529
|
-
const divStyle = css `
|
|
10530
|
-
background: ${this.background
|
|
10531
|
-
? this.background.match(regex)
|
|
10532
|
-
? `url(${this.background}) no-repeat center center;`
|
|
10533
|
-
: this.background
|
|
10534
|
-
: "inherit"};
|
|
10535
|
-
height: ${this.height || "inherit"};
|
|
10536
|
-
background-size: contain;
|
|
10537
|
-
`;
|
|
10538
|
-
const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
10539
|
-
return (!this.ishidden && (h("div", { class: divStyle }, h("p", { class: textStyle }, content))));
|
|
10540
|
-
}
|
|
10541
|
-
get textEl() { return getElement(this); }
|
|
10542
|
-
};
|
|
10596
|
+
const TextComponent = class {
|
|
10597
|
+
constructor(hostRef) {
|
|
10598
|
+
registerInstance(this, hostRef);
|
|
10599
|
+
}
|
|
10600
|
+
render() {
|
|
10601
|
+
const regex = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
|
|
10602
|
+
const textStyle = css `
|
|
10603
|
+
font-family: ${this.fontfamily || "inherit"};
|
|
10604
|
+
font-size: ${this.fontsize ? this.fontsize + "px" : "inherit"};
|
|
10605
|
+
text-align: ${this.textalign};
|
|
10606
|
+
color: ${this.color || "inherit"};
|
|
10607
|
+
padding-top: ${this.paddingtop ? this.paddingtop + "px" : "inherit"};
|
|
10608
|
+
padding-bottom: ${this.paddingbottom
|
|
10609
|
+
? this.paddingbottom + "px"
|
|
10610
|
+
: "inherit"};
|
|
10611
|
+
overflow-wrap: break-word;
|
|
10612
|
+
`;
|
|
10613
|
+
const divStyle = css `
|
|
10614
|
+
background: ${this.background
|
|
10615
|
+
? this.background.match(regex)
|
|
10616
|
+
? `url(${this.background}) no-repeat center center;`
|
|
10617
|
+
: this.background
|
|
10618
|
+
: "inherit"};
|
|
10619
|
+
height: ${this.height || "inherit"};
|
|
10620
|
+
background-size: contain;
|
|
10621
|
+
`;
|
|
10622
|
+
const content = this.ismarkdown ? (h("div", { innerHTML: marked(this.text) })) : (this.text);
|
|
10623
|
+
return (!this.ishidden && (h("div", { class: divStyle }, h("p", { class: textStyle }, content))));
|
|
10624
|
+
}
|
|
10625
|
+
get textEl() { return getElement(this); }
|
|
10626
|
+
};
|
|
10543
10627
|
TextComponent.style = textComponentCss;
|
|
10544
10628
|
|
|
10545
10629
|
export { CopyButton as sqh_copy_button, CopyLinkButton as sqh_copy_link_button, GlobalContainer as sqh_global_container, ImageComponent as sqh_image_component, PartnerStatComponent as sqh_partner_stat_component, ReferralComponent as sqh_referral_component, ReferralList as sqh_referral_list, ShareButton as sqh_share_button, ShareButtonContainer as sqh_share_button_container, StatComponent as sqh_stat_component, StatsContainer as sqh_stats_container, TextComponent as sqh_text_component };
|