@useinsider/guido 1.0.3-beta.3dd93d0 → 1.0.3-beta.3f12f40
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/README.md +32 -3
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +4 -4
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +41 -44
- package/dist/composables/useActionsApi.js +1 -1
- package/dist/composables/useHtmlCompiler.js +13 -15
- package/dist/composables/useHtmlValidator.js +35 -36
- package/dist/composables/useStripo.js +25 -29
- package/dist/enums/defaults.js +4 -5
- package/dist/enums/onboarding.js +2 -3
- package/dist/enums/unsubscribe.js +26 -27
- package/dist/extensions/Blocks/Checkbox/control.js +14 -15
- package/dist/extensions/Blocks/Checkbox/template.js +9 -14
- package/dist/extensions/Blocks/Items/block.js +26 -26
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +25 -25
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +129 -165
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -84
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -9
- package/dist/extensions/Blocks/Items/extension.js +6 -7
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +56 -57
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +56 -67
- package/dist/extensions/Blocks/Items/settingsPanel.js +43 -69
- package/dist/extensions/Blocks/Items/store/items-block.js +4 -8
- package/dist/extensions/Blocks/Items/template.js +62 -147
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +26 -35
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +27 -29
- package/dist/extensions/Blocks/RadioButton/control.js +17 -18
- package/dist/extensions/Blocks/RadioButton/template.js +9 -18
- package/dist/extensions/Blocks/Unsubscribe/block.js +41 -45
- package/dist/guido.css +1 -1
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
- package/dist/node_modules/lodash-es/keysIn.js +3 -3
- package/dist/services/stripoApi.js +26 -38
- package/dist/src/enums/defaults.d.ts +0 -1
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -14
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +2 -8
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -9
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -7
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -9
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -6
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +4 -3
- package/package.json +10 -5
- package/dist/config/compiler/itemsCompilerRules.js +0 -14
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +0 -92
- package/dist/node_modules/lodash-es/_DataView.js +0 -6
- package/dist/node_modules/lodash-es/_Promise.js +0 -6
- package/dist/node_modules/lodash-es/_Set.js +0 -6
- package/dist/node_modules/lodash-es/_SetCache.js +0 -13
- package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
- package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
- package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
- package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
- package/dist/node_modules/lodash-es/_arraySome.js +0 -9
- package/dist/node_modules/lodash-es/_baseEach.js +0 -6
- package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
- package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
- package/dist/node_modules/lodash-es/_baseGet.js +0 -11
- package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
- package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
- package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
- package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
- package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
- package/dist/node_modules/lodash-es/_baseMap.js +0 -11
- package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
- package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
- package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
- package/dist/node_modules/lodash-es/_baseRange.js +0 -9
- package/dist/node_modules/lodash-es/_baseToString.js +0 -18
- package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
- package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_castPath.js +0 -10
- package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
- package/dist/node_modules/lodash-es/_createRange.js +0 -11
- package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
- package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
- package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
- package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
- package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
- package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
- package/dist/node_modules/lodash-es/_getTag.js +0 -28
- package/dist/node_modules/lodash-es/_hasPath.js +0 -19
- package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
- package/dist/node_modules/lodash-es/_isKey.js +0 -12
- package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
- package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
- package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
- package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
- package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
- package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
- package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
- package/dist/node_modules/lodash-es/_setToArray.js +0 -9
- package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
- package/dist/node_modules/lodash-es/_toKey.js +0 -10
- package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/dist/node_modules/lodash-es/flatMap.js +0 -8
- package/dist/node_modules/lodash-es/get.js +0 -8
- package/dist/node_modules/lodash-es/hasIn.js +0 -8
- package/dist/node_modules/lodash-es/isSymbol.js +0 -9
- package/dist/node_modules/lodash-es/keys.js +0 -9
- package/dist/node_modules/lodash-es/map.js +0 -11
- package/dist/node_modules/lodash-es/property.js +0 -10
- package/dist/node_modules/lodash-es/range.js +0 -5
- package/dist/node_modules/lodash-es/stubArray.js +0 -6
- package/dist/node_modules/lodash-es/toFinite.js +0 -14
- package/dist/node_modules/lodash-es/toNumber.js +0 -22
- package/dist/node_modules/lodash-es/toString.js +0 -7
- package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -15
- package/dist/src/utils/environmentUtil.d.ts +0 -5
- package/dist/src/utils/pairProductVariables.d.ts +0 -7
- package/dist/utils/environmentUtil.js +0 -4
- package/dist/utils/pairProductVariables.js +0 -136
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import e from "./_DataView.js";
|
|
2
|
-
import a from "./_Map.js";
|
|
3
|
-
import o from "./_Promise.js";
|
|
4
|
-
import i from "./_Set.js";
|
|
5
|
-
import n from "./_WeakMap.js";
|
|
6
|
-
import S from "./_baseGetTag.js";
|
|
7
|
-
import t from "./_toSource.js";
|
|
8
|
-
var g = "[object Map]", j = "[object Object]", f = "[object Promise]", u = "[object Set]", w = "[object WeakMap]", b = "[object DataView]", T = t(e), C = t(a), M = t(o), d = t(i), v = t(n), r = S;
|
|
9
|
-
(e && r(new e(new ArrayBuffer(1))) != b || a && r(new a()) != g || o && r(o.resolve()) != f || i && r(new i()) != u || n && r(new n()) != w) && (r = function(m) {
|
|
10
|
-
var c = S(m), p = c == j ? m.constructor : void 0, s = p ? t(p) : "";
|
|
11
|
-
if (s)
|
|
12
|
-
switch (s) {
|
|
13
|
-
case T:
|
|
14
|
-
return b;
|
|
15
|
-
case C:
|
|
16
|
-
return g;
|
|
17
|
-
case M:
|
|
18
|
-
return f;
|
|
19
|
-
case d:
|
|
20
|
-
return u;
|
|
21
|
-
case v:
|
|
22
|
-
return w;
|
|
23
|
-
}
|
|
24
|
-
return c;
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
r as default
|
|
28
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import t from "./_castPath.js";
|
|
2
|
-
import a from "./isArguments.js";
|
|
3
|
-
import u from "./isArray.js";
|
|
4
|
-
import o from "./_isIndex.js";
|
|
5
|
-
import e from "./isLength.js";
|
|
6
|
-
import g from "./_toKey.js";
|
|
7
|
-
function P(r, m, s) {
|
|
8
|
-
m = t(m, r);
|
|
9
|
-
for (var n = -1, i = m.length, f = !1; ++n < i; ) {
|
|
10
|
-
var l = g(m[n]);
|
|
11
|
-
if (!(f = r != null && s(r, l)))
|
|
12
|
-
break;
|
|
13
|
-
r = r[l];
|
|
14
|
-
}
|
|
15
|
-
return f || ++n != i ? f : (i = r == null ? 0 : r.length, !!i && e(i) && o(l, i) && (u(r) || a(r)));
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
P as default
|
|
19
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import o from "./isArray.js";
|
|
2
|
-
import n from "./isSymbol.js";
|
|
3
|
-
var i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, s = /^\w*$/;
|
|
4
|
-
function m(r, e) {
|
|
5
|
-
if (o(r))
|
|
6
|
-
return !1;
|
|
7
|
-
var t = typeof r;
|
|
8
|
-
return t == "number" || t == "symbol" || t == "boolean" || r == null || n(r) ? !0 : s.test(r) || !i.test(r) || e != null && r in Object(e);
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
m as default
|
|
12
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import u from "./_memoizeCapped.js";
|
|
2
|
-
var c = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, d = /\\(\\)?/g, h = u(function(e) {
|
|
3
|
-
var r = [];
|
|
4
|
-
return e.charCodeAt(0) === 46 && r.push(""), e.replace(c, function(a, p, o, t) {
|
|
5
|
-
r.push(o ? t.replace(d, "$1") : p || a);
|
|
6
|
-
}), r;
|
|
7
|
-
});
|
|
8
|
-
export {
|
|
9
|
-
h as default
|
|
10
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import n from "./toNumber.js";
|
|
2
|
-
var t = 1 / 0, o = 17976931348623157e292;
|
|
3
|
-
function I(r) {
|
|
4
|
-
if (!r)
|
|
5
|
-
return r === 0 ? r : 0;
|
|
6
|
-
if (r = n(r), r === t || r === -t) {
|
|
7
|
-
var i = r < 0 ? -1 : 1;
|
|
8
|
-
return i * o;
|
|
9
|
-
}
|
|
10
|
-
return r === r ? r : 0;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
I as default
|
|
14
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import n from "./_baseTrim.js";
|
|
2
|
-
import f from "./isObject.js";
|
|
3
|
-
import o from "./isSymbol.js";
|
|
4
|
-
var s = NaN, m = /^[-+]0x[0-9a-f]+$/i, p = /^0b[01]+$/i, e = /^0o[0-7]+$/i, b = parseInt;
|
|
5
|
-
function O(r) {
|
|
6
|
-
if (typeof r == "number")
|
|
7
|
-
return r;
|
|
8
|
-
if (o(r))
|
|
9
|
-
return s;
|
|
10
|
-
if (f(r)) {
|
|
11
|
-
var t = typeof r.valueOf == "function" ? r.valueOf() : r;
|
|
12
|
-
r = f(t) ? t + "" : t;
|
|
13
|
-
}
|
|
14
|
-
if (typeof r != "string")
|
|
15
|
-
return r === 0 ? r : +r;
|
|
16
|
-
r = n(r);
|
|
17
|
-
var i = p.test(r);
|
|
18
|
-
return i || e.test(r) ? b(r.slice(2), i ? 2 : 8) : m.test(r) ? s : +r;
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
O as default
|
|
22
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../../common-control';
|
|
3
|
-
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
|
-
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_ORIENTATION;
|
|
5
|
-
export declare class PriceOrientationControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
|
-
getId(): string;
|
|
8
|
-
getTemplate(): string;
|
|
9
|
-
onRender(): void;
|
|
10
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
11
|
-
_onPriceOrientationChange(value: string): void;
|
|
12
|
-
private _updateHorizontalLayout;
|
|
13
|
-
private _updateVerticalLayout;
|
|
14
|
-
_getPriceOrientation(): string;
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transforms product-related HTML elements from default/dummy values to template variables.
|
|
3
|
-
* This method is called before saving email templates to ensure product data is properly templated.
|
|
4
|
-
* @param html - The HTML string containing product elements
|
|
5
|
-
* @returns The transformed HTML with template variables
|
|
6
|
-
*/
|
|
7
|
-
export declare function pairProductVariables(html: string): string;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { productPairs as w } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
-
function M(H) {
|
|
3
|
-
const m = H.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), $ = new DOMParser().parseFromString(m, "text/html"), C = w.PAIRS_FOR_EXTENSION;
|
|
4
|
-
Object.entries(C).forEach(([n, d]) => {
|
|
5
|
-
$.querySelectorAll(".ins-product-td").forEach((o) => {
|
|
6
|
-
const h = o.getAttribute("data-number") || "1", _ = o.getAttribute("data-type") || "CART_ITEMS";
|
|
7
|
-
o.querySelectorAll(`[product-attr="${n}"]`).forEach((e) => {
|
|
8
|
-
var y;
|
|
9
|
-
const b = e.getAttribute("data-type") || _, u = e.getAttribute("data-number") || h, p = d[b];
|
|
10
|
-
if (p)
|
|
11
|
-
switch (n) {
|
|
12
|
-
case "imageSrc": {
|
|
13
|
-
let t = null, i = null;
|
|
14
|
-
if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
|
|
15
|
-
break;
|
|
16
|
-
const c = p.DEFAULT, a = p.ATTR;
|
|
17
|
-
if (c && t.src) {
|
|
18
|
-
const r = t.src;
|
|
19
|
-
c.some((l) => {
|
|
20
|
-
const s = l.split("/").pop() || "", F = r.split("/").pop() || "";
|
|
21
|
-
return r.includes(l) || r.includes(s) || F === s;
|
|
22
|
-
}) && (t.src = `{{${a}_${u}}}`);
|
|
23
|
-
}
|
|
24
|
-
if (i) {
|
|
25
|
-
const r = (y = C.itemLink) == null ? void 0 : y[b];
|
|
26
|
-
if (r) {
|
|
27
|
-
const f = r.HREF, l = r.DEFAULT_HREF || "#!", s = i.href;
|
|
28
|
-
(s === "#" || s === "" || s.endsWith("#!") || s.endsWith(l) || s === `${window.location.href}${l}` || !s || s === window.location.href) && (i.href = `{{${f}_${u}}}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
case "name": {
|
|
34
|
-
const t = p, i = t.ATTR, c = t.DEFAULT_HREF || "#!", a = t.HREF;
|
|
35
|
-
e.textContent && (e.textContent = `{{${i}_${u}}}`);
|
|
36
|
-
const r = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
37
|
-
if (r && a) {
|
|
38
|
-
const f = r.href, l = `${window.location.href}${c}`;
|
|
39
|
-
(f === l || f.endsWith(c)) && (r.href = `{{${a}_${u}}}`);
|
|
40
|
-
}
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
case "price":
|
|
44
|
-
case "originalPrice": {
|
|
45
|
-
const t = p, c = e.getAttribute("data-formated") === "true", a = e.getAttribute("data-curency") || "before", r = c ? t.PRICE_FORMATTED : t.PRICE, f = t.CURRENCY;
|
|
46
|
-
let l = `{{${r}_${u}}}`;
|
|
47
|
-
if (f) {
|
|
48
|
-
const s = `{{${f}_${u}}}`;
|
|
49
|
-
l = a === "after" ? `${l} ${s}` : `${s} ${l}`;
|
|
50
|
-
}
|
|
51
|
-
e.textContent = l;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
case "quantity": {
|
|
55
|
-
const t = p, i = t.ATTR, c = t.DEFAULT;
|
|
56
|
-
e.textContent && e.textContent.trim() === c && (e.textContent = `{{${i}_${u}}}`);
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
case "button": {
|
|
60
|
-
const t = p, i = t.HREF, c = t.DEFAULT_HREF || "#!", a = e.tagName === "A" ? e : e.querySelector("a");
|
|
61
|
-
if (a) {
|
|
62
|
-
const r = a.href || "", f = `${window.location.href}${c}`;
|
|
63
|
-
(r === "" || r === "#" || r === f || r.endsWith(c) || r.endsWith("#!") || r === window.location.href) && (a.href = `{{${i}_${u}}}`);
|
|
64
|
-
}
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case "itemLink": {
|
|
68
|
-
const t = p, i = t.HREF, c = t.DEFAULT_HREF || "#!", a = e;
|
|
69
|
-
if (a.href) {
|
|
70
|
-
const r = a.href, f = `${window.location.href}${c}`;
|
|
71
|
-
(r === f || r.endsWith(c)) && (a.href = `{{${i}_${u}}}`);
|
|
72
|
-
}
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
default: {
|
|
76
|
-
if ("ATTR" in p) {
|
|
77
|
-
const t = p.ATTR;
|
|
78
|
-
e.textContent && (e.textContent = `{{${t}_${u}}}`);
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
const S = $.querySelectorAll(".ins-product-td"), R = [];
|
|
87
|
-
S.forEach((n) => {
|
|
88
|
-
const d = n.getAttribute("data-type") || "CART_ITEMS", A = n.getAttribute("data-number") || "1", o = n.getAttribute("data-nodup"), h = n.outerHTML;
|
|
89
|
-
R.push({
|
|
90
|
-
element: n,
|
|
91
|
-
outerHtml: h,
|
|
92
|
-
type: d,
|
|
93
|
-
number: A,
|
|
94
|
-
nodup: o || void 0
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
let E = $.body.innerHTML;
|
|
98
|
-
R.reverse().forEach(({ outerHtml: n, type: d, number: A }) => {
|
|
99
|
-
let o = "";
|
|
100
|
-
switch (d) {
|
|
101
|
-
case "CART_ITEMS":
|
|
102
|
-
o = "ins_apr_total_product_kind";
|
|
103
|
-
break;
|
|
104
|
-
case "BROWSED_ITEMS":
|
|
105
|
-
o = "browsed_item_total_product_kind";
|
|
106
|
-
break;
|
|
107
|
-
case "PURCHASED_ITEMS":
|
|
108
|
-
o = "purchased_item_total_product_kind";
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
if (o) {
|
|
112
|
-
const _ = parseInt(A) - 1, b = `${`{% if ${o} > ${_} %}`}${n}{% endif %}`;
|
|
113
|
-
E = E.replace(n, b);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
const k = $.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), T = [];
|
|
117
|
-
return k.forEach((n) => {
|
|
118
|
-
const d = n.getAttribute("data-number"), A = n.getAttribute("data-type");
|
|
119
|
-
if (!d || A !== "CART_ITEMS")
|
|
120
|
-
return;
|
|
121
|
-
const o = n.closest(".product-original-price-class");
|
|
122
|
-
if (o) {
|
|
123
|
-
const h = o.outerHTML;
|
|
124
|
-
T.some((g) => g.tdOuterHtml === h) || T.push({ tdOuterHtml: h, number: d });
|
|
125
|
-
}
|
|
126
|
-
}), T.reverse().forEach(({ tdOuterHtml: n, number: d }) => {
|
|
127
|
-
const A = `{% if ins_apr_price_${d} != ins_apr_originalprice_${d} %}`;
|
|
128
|
-
if (!E.includes(A) && !n.includes("{% if")) {
|
|
129
|
-
const h = `${A}${n}{% endif %}`;
|
|
130
|
-
E = E.replace(n, h);
|
|
131
|
-
}
|
|
132
|
-
}), E.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
133
|
-
}
|
|
134
|
-
export {
|
|
135
|
-
M as pairProductVariables
|
|
136
|
-
};
|