ui.shipaid.com 0.3.115 → 0.3.116
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/dist/widget.es.js
CHANGED
|
@@ -2862,6 +2862,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
2862
2862
|
this.buttonClasses = "";
|
|
2863
2863
|
this.shadowRootSelector = "";
|
|
2864
2864
|
this.useShipAidCheckout = false;
|
|
2865
|
+
this.previewGreenShipAid = false;
|
|
2865
2866
|
this._apiEndpoint = "/apps/shipaid";
|
|
2866
2867
|
this._storeDomain = ((_a = window.Shopify) == null ? void 0 : _a.shop) ?? ((_c = (_b = window.Shopify) == null ? void 0 : _b.Checkout) == null ? void 0 : _c.apiHost);
|
|
2867
2868
|
this._hasFinishedSetup = false;
|
|
@@ -3420,7 +3421,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3420
3421
|
return x`
|
|
3421
3422
|
<shipaid-learn-more-carousel
|
|
3422
3423
|
carousel-state=${this._popup === "learn-more" ? "open" : "close"}
|
|
3423
|
-
carousel-type=${((_a = this._store) == null ? void 0 : _a.greenProtection.enabled) ? "green-protection" : "standard-protection"}
|
|
3424
|
+
carousel-type=${((_a = this._store) == null ? void 0 : _a.greenProtection.enabled) || this.previewGreenShipAid ? "green-protection" : "standard-protection"}
|
|
3424
3425
|
>
|
|
3425
3426
|
</shipaid-learn-more-carousel>
|
|
3426
3427
|
`;
|
|
@@ -3494,7 +3495,9 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3494
3495
|
</path>
|
|
3495
3496
|
</svg>
|
|
3496
3497
|
`;
|
|
3497
|
-
const isGreenProtectionEnabled = (
|
|
3498
|
+
const isGreenProtectionEnabled = Boolean(
|
|
3499
|
+
((_d = (_c = this._store) == null ? void 0 : _c.greenProtection) == null ? void 0 : _d.enabled) || this.previewGreenShipAid
|
|
3500
|
+
);
|
|
3498
3501
|
D(
|
|
3499
3502
|
x`
|
|
3500
3503
|
<style>
|
|
@@ -3694,7 +3697,9 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3694
3697
|
const protectionPrice = Number((_b = this._protectionVariant) == null ? void 0 : _b.price) || 0;
|
|
3695
3698
|
const cartPrice = (Number((_c = this._cart) == null ? void 0 : _c.total_price) || 0) / 100;
|
|
3696
3699
|
const cartTotal = !this._hasProtectionInCart ? protectionPrice + cartPrice : cartPrice;
|
|
3697
|
-
const isGreenProtectionEnabled = (
|
|
3700
|
+
const isGreenProtectionEnabled = Boolean(
|
|
3701
|
+
((_e = (_d = this._store) == null ? void 0 : _d.greenProtection) == null ? void 0 : _e.enabled) || this.previewGreenShipAid
|
|
3702
|
+
);
|
|
3698
3703
|
const loading2 = x`
|
|
3699
3704
|
<svg
|
|
3700
3705
|
width="1.5rem"
|
|
@@ -3963,7 +3968,9 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3963
3968
|
return this.checkoutButtonTemplate();
|
|
3964
3969
|
}
|
|
3965
3970
|
const { useToggle, leftCheckbox } = ((_b = (_a = this._store) == null ? void 0 : _a.widgetConfigurations) == null ? void 0 : _b.widget) || { useToggle: false, leftCheckbox: false };
|
|
3966
|
-
const isGreenProtectionEnabled = (
|
|
3971
|
+
const isGreenProtectionEnabled = Boolean(
|
|
3972
|
+
((_d = (_c = this._store) == null ? void 0 : _c.greenProtection) == null ? void 0 : _d.enabled) || this.previewGreenShipAid
|
|
3973
|
+
);
|
|
3967
3974
|
return x`
|
|
3968
3975
|
<div class="shipaid-prompt ${isGreenProtectionEnabled ? "green" : ""}">
|
|
3969
3976
|
<div class="prompt-product">
|
|
@@ -4841,6 +4848,9 @@ __decorateClass([
|
|
|
4841
4848
|
__decorateClass([
|
|
4842
4849
|
n$7({ type: Boolean, attribute: "use-shipaid-checkout" })
|
|
4843
4850
|
], ShipAidWidget.prototype, "useShipAidCheckout");
|
|
4851
|
+
__decorateClass([
|
|
4852
|
+
n$7({ type: Boolean, attribute: "preview-green-shipaid" })
|
|
4853
|
+
], ShipAidWidget.prototype, "previewGreenShipAid");
|
|
4844
4854
|
__decorateClass([
|
|
4845
4855
|
t$3()
|
|
4846
4856
|
], ShipAidWidget.prototype, "_storeDomain");
|