@spiffcommerce/core 28.0.0 → 28.0.1-beta.f5df4b3f-ec7b-542e-84ca-48ed7f2a1458

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/index.mjs CHANGED
@@ -13862,7 +13862,7 @@ class Ja extends Zn {
13862
13862
  * @param variant The variant to select.
13863
13863
  */
13864
13864
  async selectVariant(t, e) {
13865
- await Promise.all([
13865
+ console.log(`LOG: selecting variant ${t.getName()} (${t.getId()}) for property ${this.property.name}`), console.trace(), await Promise.all([
13866
13866
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13867
13867
  this.applyColorVariant(t, void 0, e)
13868
13868
  ]);
@@ -14730,17 +14730,18 @@ class Je {
14730
14730
  u([]);
14731
14731
  return;
14732
14732
  }
14733
- console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14734
- const g = m.map((p) => {
14735
- if (p.getType() === z.ColorOption || p.getType() === z.Option) {
14736
- const f = p;
14737
- if (this.globalPropertyStateManager.getGlobalPropertyState())
14738
- return f.initDefaultVariant();
14739
- console.log("Attempted to set global default variant before state was initialized.");
14733
+ console.log("Setting default global variants.");
14734
+ const m = this.globalPropertyStateManager.getGlobalPropertyState();
14735
+ m ? this.globalPropertyHandleService.getHandles().then((g) => {
14736
+ const p = g.map((f) => {
14737
+ if (f.getType() === z.ColorOption || f.getType() === z.Option) {
14738
+ const C = f;
14739
+ if (!m.aspects.find((S) => S.name === C.getName()))
14740
+ return C.initDefaultVariant();
14740
14741
  }
14741
14742
  });
14742
- Promise.all(g).then(u).catch(h);
14743
- });
14743
+ Promise.all(p).then(u).catch(h);
14744
+ }) : (console.log("Attempted to set global default variant before state was initialized."), u([]));
14744
14745
  });
14745
14746
  this.initializationPromise = Promise.all([
14746
14747
  this.loadExistingWorkflowExperiences(((A = e.transactions) == null ? void 0 : A.map((u) => u.id)) || [], {
@@ -15991,7 +15992,7 @@ class Ad {
15991
15992
  } catch (a) {
15992
15993
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15993
15994
  }
15994
- }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15995
+ }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15995
15996
  }
15996
15997
  configure(t) {
15997
15998
  mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Lr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);