ui.shipaid.com 0.3.103 → 0.3.104

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
@@ -2406,6 +2406,8 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
2406
2406
  this.customerId = void 0;
2407
2407
  this.supportSubscriptions = false;
2408
2408
  this.dataSelector = "";
2409
+ this.buttonTitle = "";
2410
+ this.buttonClasses = "";
2409
2411
  this.shadowRootSelector = "";
2410
2412
  this.useShipAidCheckout = false;
2411
2413
  this._apiEndpoint = "/apps/shipaid";
@@ -3113,7 +3115,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3113
3115
  return null;
3114
3116
  }
3115
3117
  checkoutButtonTemplate() {
3116
- var _a, _b, _c, _d, _e, _f, _g;
3118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
3117
3119
  if (!document.getElementById("shipaid-styles")) {
3118
3120
  const style = document.createElement("style");
3119
3121
  style.id = "shipaid-styles";
@@ -3276,24 +3278,27 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
3276
3278
  </div>
3277
3279
  </div>
3278
3280
  ${this._sellingPlanId ? x`
3279
- <button id="shipaid-checkout-button" class="${originalClasses}" @click=${async () => {
3281
+ <button id="shipaid-checkout-button" variant="${(_d = this._protectionVariant) == null ? void 0 : _d.id}" class="${this.buttonClasses || originalClasses}" @click=${async () => {
3280
3282
  var _a2, _b2;
3281
3283
  sessionStorage.setItem("shipaid_variant", JSON.stringify((_a2 = this._protectionVariant) == null ? void 0 : _a2.id));
3282
3284
  await this.addCartProtectionVariant();
3283
3285
  window.location.href = `/checkout?attributes[_shipaid-internal]=1&updates[${(_b2 = this._protectionVariant) == null ? void 0 : _b2.id}]=1`;
3284
3286
  }}>
3285
- <slot name="checkout-button-text">CHECKOUT+</slot> ${cartTotal ? this._currencyFormat(cartTotal) : loading2}
3287
+ ${this.buttonTitle || x`<slot name="checkout-button-text">CHECKOUT+</slot> ${cartTotal ? this._currencyFormat(cartTotal) : loading2}`}
3286
3288
  </button>
3287
3289
  ` : x`
3288
- <a href="/checkout${((_d = this._protectionVariant) == null ? void 0 : _d.id) ? `?attributes[_shipaid-internal]=1&updates[${(_e = this._protectionVariant) == null ? void 0 : _e.id}]=1` : ""}" id="shipaid-checkout-button" class="${originalClasses}" @click=${() => {
3290
+ <a variant="${(_e = this._protectionVariant) == null ? void 0 : _e.id}" href="/checkout${((_f = this._protectionVariant) == null ? void 0 : _f.id) ? `?attributes[_shipaid-internal]=1&updates[${(_g = this._protectionVariant) == null ? void 0 : _g.id}]=1` : ""}" id="shipaid-checkout-button" class="${this.buttonClasses || originalClasses}" @click=${() => {
3289
3291
  var _a2;
3290
3292
  sessionStorage.setItem("shipaid_variant", JSON.stringify((_a2 = this._protectionVariant) == null ? void 0 : _a2.id));
3291
3293
  }}>
3294
+ ${this.buttonTitle || x`
3292
3295
  <span class="shipaid-checkout-text">${translate("checkout-plus.checkout")}+</span>
3293
3296
  <span class="shipaid-checkout-amount">${cartTotal ? this._currencyFormat(cartTotal) : loading2}</span>
3297
+ `}
3298
+
3294
3299
  </a>
3295
3300
  `}
3296
- <a href="/checkout${((_f = this._protectionVariant) == null ? void 0 : _f.id) ? `?attributes[_shipaid-internal]=1&updates[${(_g = this._protectionVariant) == null ? void 0 : _g.id}]=0` : ""}" class="continue-link">
3301
+ <a href="/checkout${((_h = this._protectionVariant) == null ? void 0 : _h.id) ? `?attributes[_shipaid-internal]=1&updates[${(_i = this._protectionVariant) == null ? void 0 : _i.id}]=0` : ""}" class="continue-link">
3297
3302
  <slot name="link-continue">${translate("checkout-plus.continue")}</slot>
3298
3303
  </a>
3299
3304
  </div>
@@ -4051,6 +4056,12 @@ __decorateClass([
4051
4056
  __decorateClass([
4052
4057
  n$7({ type: String, attribute: "data-selector" })
4053
4058
  ], ShipAidWidget.prototype, "dataSelector");
4059
+ __decorateClass([
4060
+ n$7({ type: String, attribute: "button-title" })
4061
+ ], ShipAidWidget.prototype, "buttonTitle");
4062
+ __decorateClass([
4063
+ n$7({ type: String, attribute: "button-classes" })
4064
+ ], ShipAidWidget.prototype, "buttonClasses");
4054
4065
  __decorateClass([
4055
4066
  n$7({ type: String, attribute: "shadow-root-selector" })
4056
4067
  ], ShipAidWidget.prototype, "shadowRootSelector");