@spiffcommerce/core 16.7.1-rc.0 → 16.8.0

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.d.ts CHANGED
@@ -2913,4 +2913,27 @@ declare class InformationStepHandle extends StepHandle<InformationStepData> {
2913
2913
  getContent(): string;
2914
2914
  }
2915
2915
 
2916
- export { AssetNotFoundError, BulkPriceCalculationStrategy, BulkStepHandle, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, VariationRecord, Vector3, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, gatherVaryingStepAspects, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
2916
+ /**
2917
+ * A simple cache for promises. Helpful to avoid making multiple requests for the same data.
2918
+ */
2919
+ declare class PromiseCache {
2920
+ private cache;
2921
+ private disabled;
2922
+ /**
2923
+ * Gets a promise from the cache, or undefined if it doesn't exist.
2924
+ */
2925
+ get(key: object): Promise<any> | undefined;
2926
+ /**
2927
+ * Sets a promise in the cache and returns it.
2928
+ */
2929
+ set(key: object, promise: Promise<any>): Promise<any>;
2930
+ /**
2931
+ * Some environments don't want workflows to be cached. An example is a server
2932
+ * that doesn't launch a fresh instance per request. This method allows disabling
2933
+ * caching in a transparent way.
2934
+ */
2935
+ disable(value: boolean): void;
2936
+ }
2937
+ declare const promiseCache: PromiseCache;
2938
+
2939
+ export { AssetNotFoundError, BulkPriceCalculationStrategy, BulkStepHandle, Bundle, CollectionProduct, ColorOption, ConversionConfiguration, ConversionData, ConversionDataType, ConversionLocation, Customer, CustomerDetailsInput, DesignCreationMessage, DesignCreationProgressUpdate, DesignInputStep, EditedSteps, FlowExecutionNodeResult, FlowExecutionResult, FlowService, FrameService, FrameStep, FrameStepHandle, GetWorkflowOptions, GlobalPropertyHandle, IllustrationStepHandle, InformationMessageType, InformationResult, InformationStepHandle, LayoutNotFoundError, MandatorySteps, MaterialStepHandle, MisconfigurationError, MockWorkflowManager, ModelStepHandle, NodeType, ObjectInput, ObjectInputType, OptionNotFoundError, ParseError, PictureStepHandle, Product, ProductCameraRig, ProductCollection, ProductWorkflow, promiseCache as PromiseCache, PromiseQueue, QuestionStepHandle, QueueablePromise, RegionElement, RenderableScene, ResourceNotFoundError, SavedDesign, SelectionStorage, ShapeStepHandle, SilentIllustrationStepData, SpiffCommerceClient, Stakeholder, StakeholderType, StateMutationFunc, StepElements, StepHandle, TextStepHandle, TextStepStorage, Transaction, Transform, TransformCollection, UnhandledBehaviorError, Variant, VariationRecord, Vector3, WorkflowExperience, WorkflowExperienceImpl, WorkflowManager, WorkflowMetadata, WorkflowScene, WorkflowSelections, WorkflowStorage, assetService, createDesign, designService, digitalContentStepService, frameStepService, gatherVaryingStepAspects, generateCommands, generateStateFromDesignInputSteps, getBoundedOffsets, getWorkflow, getWorkflows, graphQlManager, illustrationStepService, materialStepService, modelStepService, moduleStepService, optionService, persistenceService, pictureStepService, questionStepService, shapeStepService, shortenUrl, spiffCoreConfiguration, stepAspectValuesToDesignInputSteps, textStepService, toast };
package/dist/index.js CHANGED
@@ -190,8 +190,7 @@ class Kt {
190
190
  uri: `${xA.getServerUrl()}/graphql`,
191
191
  fetch: _A
192
192
  }), e = vt(async (s, i) => {
193
- var h, u, f, p, D, m, F;
194
- const { headers: o } = i, r = o || {}, c = await zt(), B = ((h = s.context) == null ? void 0 : h.bearer) ?? c.bearer, l = ((u = s.context) == null ? void 0 : u.partnerId) ?? c.partnerId, d = ((f = s.context) == null ? void 0 : f.activeIntegration) ?? c.activeIntegration, E = ((p = s.context) == null ? void 0 : p.transactionOwnerId) ?? c.transactionOwnerId, C = ((D = s.context) == null ? void 0 : D.customerToken) ?? c.customerToken, w = ((m = s.context) == null ? void 0 : m.applicationKey) ?? c.applicationKey, Q = ((F = s.context) == null ? void 0 : F.bundleOwnerId) ?? c.bundleOwnerId;
193
+ const { headers: o } = i, r = o || {}, c = await zt(), B = i.bearer ?? c.bearer, l = i.partnerId ?? c.partnerId, d = i.activeIntegration ?? c.activeIntegration, E = i.transactionOwnerId ?? c.transactionOwnerId, C = i.customerToken ?? c.customerToken, w = i.applicationKey ?? c.applicationKey, Q = i.bundleOwnerId ?? c.bundleOwnerId;
195
194
  return B && (r.Authorization = `Bearer ${B}`), l && (r.partnerId = l), d && (r.activeIntegration = d), E && (r.transactionOwnerId = E), C && (r.customerToken = C), w && (r["X-Application-Key"] = w), Q && (r.bundleOwnerId = Q), {
196
195
  headers: r
197
196
  };
@@ -530,12 +529,14 @@ class LA {
530
529
  const T = new $t();
531
530
  class _t {
532
531
  constructor() {
533
- this.cache = {};
532
+ this.cache = {}, this.disabled = !1;
534
533
  }
535
534
  /**
536
535
  * Gets a promise from the cache, or undefined if it doesn't exist.
537
536
  */
538
537
  get(A) {
538
+ if (this.disabled)
539
+ return;
539
540
  const e = JSON.stringify(A);
540
541
  return this.cache[e];
541
542
  }
@@ -543,9 +544,19 @@ class _t {
543
544
  * Sets a promise in the cache and returns it.
544
545
  */
545
546
  set(A, e) {
547
+ if (this.disabled)
548
+ return e;
546
549
  const t = JSON.stringify(A);
547
550
  return this.cache[t] = e, e;
548
551
  }
552
+ /**
553
+ * Some environments don't want workflows to be cached. An example is a server
554
+ * that doesn't launch a fresh instance per request. This method allows disabling
555
+ * caching in a transparent way.
556
+ */
557
+ disable(A) {
558
+ this.disabled = A;
559
+ }
549
560
  }
550
561
  const BA = new _t(), je = y`
551
562
  fragment OptionFields on Option {
@@ -3301,10 +3312,10 @@ class Ua {
3301
3312
  curved: t.curved,
3302
3313
  paths: t.paths,
3303
3314
  fillSpotColorDefinition: h
3304
- }, D = [], m = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
3315
+ }, D = [], m = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
3305
3316
  if (!p.fontData)
3306
3317
  throw new v("Failed to resolve font data for text.");
3307
- const [Y, M] = IA(
3318
+ const [Y, F] = IA(
3308
3319
  p.fontSize,
3309
3320
  p.fontData,
3310
3321
  {
@@ -3318,8 +3329,8 @@ class Ua {
3318
3329
  [r],
3319
3330
  { size: t.size, minSize: t.minSize, maxSize: t.maxSize }
3320
3331
  );
3321
- m.set(p.id, Y), F.set(p.id, M);
3322
- const U = t.curved || t.vertical ? r : (M || []).join(`
3332
+ m.set(p.id, Y), M.set(p.id, F);
3333
+ const U = t.curved || t.vertical ? r : (F || []).join(`
3323
3334
  `);
3324
3335
  D.push(
3325
3336
  this.generateTextChangeCommandsForRegion(Y, t, p.id, U, i)
@@ -3380,13 +3391,13 @@ class Ua {
3380
3391
  return c && c(!0), { info: "0" };
3381
3392
  const p = s.getProfanities(), D = XA(l.toLowerCase());
3382
3393
  for (const m of D)
3383
- for (const F in p) {
3384
- const Y = p[F].toLowerCase().replace(/\s/g, "");
3394
+ for (const M in p) {
3395
+ const Y = p[M].toLowerCase().replace(/\s/g, "");
3385
3396
  if (m === Y)
3386
3397
  return o(!0), { error: "Blocked profanity." };
3387
3398
  }
3388
3399
  return !A.data.vertical && !A.data.allowNewlines && (l.includes(`
3389
- `) || l.includes("\r")) ? (o(!0), { error: "Cannot span multiple lines." }) : !A.data.curved && !Array.from(C.values()).every((F) => F) ? (o(!0), { error: "Does not fit." }) : (o(!1), { info: (A.data.maxLength - l.length).toString() });
3400
+ `) || l.includes("\r")) ? (o(!0), { error: "Cannot span multiple lines." }) : !A.data.curved && !Array.from(C.values()).every((M) => M) ? (o(!0), { error: "Does not fit." }) : (o(!1), { info: (A.data.maxLength - l.length).toString() });
3390
3401
  })();
3391
3402
  if (Q.error) {
3392
3403
  r(Q.error);
@@ -4862,12 +4873,12 @@ class La extends ie {
4862
4873
  p.appendChild(D), D.appendChild(nt(3, 7, 4, "shadow"));
4863
4874
  const m = R("g");
4864
4875
  p.appendChild(m), m.setAttribute("filter", "url(#shadow)"), m.innerHTML = t;
4865
- const F = R("g");
4866
- p.appendChild(F), F.setAttribute("fill", "red"), F.setAttribute("stroke", "red"), F.setAttribute("stroke-width", "9"), F.innerHTML = t;
4876
+ const M = R("g");
4877
+ p.appendChild(M), M.setAttribute("fill", "red"), M.setAttribute("stroke", "red"), M.setAttribute("stroke-width", "9"), M.innerHTML = t;
4867
4878
  const Y = R("g");
4868
4879
  p.appendChild(Y), Y.setAttribute("fill", "#9d2621"), Y.setAttribute("transform", "translate(1,1)"), Y.innerHTML = t;
4869
- const M = R("g");
4870
- return p.appendChild(M), M.setAttribute("fill", "yellow"), M.innerHTML = t, new ce(p).transform(([S, b]) => [S, b + (n / 2 - S) ** 2 / (n * 2.9)]), p;
4880
+ const F = R("g");
4881
+ return p.appendChild(F), F.setAttribute("fill", "yellow"), F.innerHTML = t, new ce(p).transform(([S, b]) => [S, b + (n / 2 - S) ** 2 / (n * 2.9)]), p;
4871
4882
  }, [o, r, c] = tt(e);
4872
4883
  if (!o)
4873
4884
  return "";
@@ -4902,12 +4913,12 @@ class za extends ie {
4902
4913
  }
4903
4914
  brandSvg(A, e, t) {
4904
4915
  const a = A.toSVG(2), n = A.getBoundingBox(), s = n.y2 - n.y1, i = n.x2 - n.x1, o = A.toPathData(3), r = () => {
4905
- const m = R("g"), F = R("g");
4906
- m.appendChild(F), F.setAttribute("stroke", "#5C1A0D"), F.setAttribute("stroke-width", "4"), F.setAttribute("transform", "translate(1,1)"), F.innerHTML = a;
4916
+ const m = R("g"), M = R("g");
4917
+ m.appendChild(M), M.setAttribute("stroke", "#5C1A0D"), M.setAttribute("stroke-width", "4"), M.setAttribute("transform", "translate(1,1)"), M.innerHTML = a;
4907
4918
  const Y = R("g");
4908
4919
  m.appendChild(Y), Y.setAttribute("fill", "#FFE386"), Y.setAttribute("transform", "translate(1,1)"), Y.innerHTML = a;
4909
- const M = R("g");
4910
- m.appendChild(M), M.setAttribute("fill", "white"), M.innerHTML = a;
4920
+ const F = R("g");
4921
+ m.appendChild(F), F.setAttribute("fill", "white"), F.innerHTML = a;
4911
4922
  const U = new ce(m);
4912
4923
  return U.transform(([S, b]) => [S, b + ((i - S) * b) ** 2 / (i * 5e4)]), U.transform(([S, b]) => [
4913
4924
  S,
@@ -4956,8 +4967,8 @@ class ja extends ie {
4956
4967
  D.classList.add("module-layer0"), u.appendChild(D), D.setAttribute("filter", "url(#shadow)"), D.innerHTML = p.outerHTML;
4957
4968
  const m = R("g");
4958
4969
  m.classList.add("module-layer1"), u.appendChild(m), m.setAttribute("stroke-width", "3"), m.setAttribute("stroke", "rgb(45,41,38)"), m.setAttribute("fill", "rgb(45,41,38)"), m.setAttribute("transform", "translate(0.5,0)"), m.innerHTML = i;
4959
- const F = R("g");
4960
- F.classList.add("module-layer2"), u.appendChild(F), F.setAttribute("fill", "rgb(255,209,0)"), F.setAttribute("transform", "translate(1,-0.1)"), F.innerHTML = i;
4970
+ const M = R("g");
4971
+ M.classList.add("module-layer2"), u.appendChild(M), M.setAttribute("fill", "rgb(255,209,0)"), M.setAttribute("transform", "translate(1,-0.1)"), M.innerHTML = i;
4961
4972
  const Y = R("g");
4962
4973
  return Y.classList.add("module-layer3"), u.appendChild(Y), Y.setAttribute("fill", "white"), Y.innerHTML = i, new ce(u).transform(([U, S]) => [U, S + (r / 2 - U) ** 2 / (r * 6)]), u;
4963
4974
  }, l = R("g");
@@ -5454,7 +5465,7 @@ class Wa {
5454
5465
  this.stepSelections = {
5455
5466
  ...this.stepSelections,
5456
5467
  [A]: { selectedVariants: e }
5457
- }, this.selectionCost = Object.values(this.stepSelections).reduce((D, m) => D + m.selectedVariants.map((F) => F.priceModifier || 0).reduce((F, Y) => F + Y, 0), 0), this.workflow.steps.forEach((D) => {
5468
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((D, m) => D + m.selectedVariants.map((M) => M.priceModifier || 0).reduce((M, Y) => M + Y, 0), 0), this.workflow.steps.forEach((D) => {
5458
5469
  nA(D, this.stepSelections) || (this.stepInitialised[D.stepName] = !1, delete this.stepMetadata[D.stepName], delete this.stepSelections[D.stepName], delete this.storage[D.stepName]);
5459
5470
  });
5460
5471
  const s = this.allScenes, i = aA(s, n), o = aA(s, this.stepSelections), r = i.map((D) => D.silentSteps).flat(), B = o.map((D) => D.silentSteps).flat().filter(
@@ -6501,24 +6512,24 @@ const ct = y`
6501
6512
  i
6502
6513
  );
6503
6514
  }, Bt = async (g, A, e, t, a, n, s, i, o, r) => {
6504
- var F;
6515
+ var M;
6505
6516
  await (async () => {
6506
6517
  var S;
6507
6518
  if (r !== void 0)
6508
6519
  return r;
6509
6520
  await g.outstandingRequestsPromise();
6510
- const M = await N.getShadowGraphqlClient().query({
6521
+ const F = await N.getShadowGraphqlClient().query({
6511
6522
  query: Ve,
6512
6523
  variables: { ids: [a.id] },
6513
6524
  fetchPolicy: "no-cache",
6514
6525
  errorPolicy: "all"
6515
- }), U = (S = M.data) == null ? void 0 : S.transactions[0].workflowState;
6516
- return M.errors ? (M.errors.forEach((b) => {
6517
- M.errors && console.log("Server Error:", b.message);
6526
+ }), U = (S = F.data) == null ? void 0 : S.transactions[0].workflowState;
6527
+ return F.errors ? (F.errors.forEach((b) => {
6528
+ F.errors && console.log("Server Error:", b.message);
6518
6529
  }), null) : U ?? null;
6519
6530
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(t())), await g.updateStateWithServerImmediate(t), console.log("Server state is undefined @ Workflow completion"));
6520
- const l = g.getPreviewService(), d = (F = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : F.lookAtAnimation, E = l && A.showModelOnFinishStep && !!d, C = o && $A(o, A, !0), w = o && $A(o, A, !1), Q = async (Y) => {
6521
- const M = {};
6531
+ const l = g.getPreviewService(), d = (M = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : M.lookAtAnimation, E = l && A.showModelOnFinishStep && !!d, C = o && $A(o, A, !0), w = o && $A(o, A, !1), Q = async (Y) => {
6532
+ const F = {};
6522
6533
  let U = 0;
6523
6534
  if (Object.keys(n).length > 0)
6524
6535
  for (const S of Object.keys(n)) {
@@ -6527,11 +6538,11 @@ const ct = y`
6527
6538
  const q = b.selections[W];
6528
6539
  if (V && (!Y || V.option && (V.option.variants || []).length > 1 && !V.data.hideSelectionInCart && !V.data.hideSelectionsInCart)) {
6529
6540
  const bA = V.stepTitle;
6530
- M[bA] ? M[bA].push({
6541
+ F[bA] ? F[bA].push({
6531
6542
  id: q.id || "",
6532
6543
  name: q.name,
6533
6544
  priceModifier: q.priceModifier
6534
- }) : M[bA] = [
6545
+ }) : F[bA] = [
6535
6546
  {
6536
6547
  id: q.id || "",
6537
6548
  name: q.name,
@@ -6542,22 +6553,22 @@ const ct = y`
6542
6553
  U += q.priceModifier;
6543
6554
  }
6544
6555
  }
6545
- return [M, U];
6556
+ return [F, U];
6546
6557
  }, [h] = await Q(!0), u = Object.fromEntries(
6547
- Object.keys(h).map((Y) => [Y, h[Y].map((M) => M.id)])
6558
+ Object.keys(h).map((Y) => [Y, h[Y].map((F) => F.id)])
6548
6559
  ), [f] = await Q(!1), p = Object.fromEntries(
6549
6560
  Object.keys(f).map((Y) => [
6550
6561
  Y,
6551
- f[Y].map((M) => M.id)
6562
+ f[Y].map((F) => F.id)
6552
6563
  ])
6553
6564
  ), D = await i(E);
6554
6565
  return {
6555
6566
  designDetails: (() => {
6556
6567
  const Y = {
6557
6568
  name: s,
6558
- layouts: e.map((M) => ({
6559
- index: M.index,
6560
- panelId: M.panelId
6569
+ layouts: e.map((F) => ({
6570
+ index: F.index,
6571
+ panelId: F.panelId
6561
6572
  })),
6562
6573
  workflowId: A.id,
6563
6574
  transactionId: a.id,
@@ -6565,16 +6576,16 @@ const ct = y`
6565
6576
  previewImage: D
6566
6577
  };
6567
6578
  if (w) {
6568
- const M = [];
6579
+ const F = [];
6569
6580
  for (const [U, S] of Object.entries(w))
6570
- M.push({ key: U, value: S });
6571
- Y.metadata = M;
6581
+ F.push({ key: U, value: S });
6582
+ Y.metadata = F;
6572
6583
  }
6573
6584
  if (u) {
6574
- const M = [];
6585
+ const F = [];
6575
6586
  for (const [U, S] of Object.entries(p))
6576
- M.push({ key: U, ids: S });
6577
- Y.selectedVariants = M;
6587
+ F.push({ key: U, ids: S });
6588
+ Y.selectedVariants = F;
6578
6589
  }
6579
6590
  return Y;
6580
6591
  })(),
@@ -7143,29 +7154,29 @@ const En = [
7143
7154
  const C = {};
7144
7155
  Ht(E, (m) => {
7145
7156
  En.includes(m.tagName) && !m.attributes.getNamedItem("fill") && m.setAttribute("fill", "#000000");
7146
- const F = m.attributes.getNamedItem("fill");
7147
- if (F && F.value !== "none") {
7148
- const M = F.value, S = `spiff-fill-${M.replace(/\W/g, "")}`;
7149
- m.classList.add(S), C[S] = { browserValue: M };
7157
+ const M = m.attributes.getNamedItem("fill");
7158
+ if (M && M.value !== "none") {
7159
+ const F = M.value, S = `spiff-fill-${F.replace(/\W/g, "")}`;
7160
+ m.classList.add(S), C[S] = { browserValue: F };
7150
7161
  }
7151
7162
  const Y = m.attributes.getNamedItem("stroke");
7152
7163
  if (Y && Y.value !== "none") {
7153
- const M = Y.value, S = `spiff-stroke-${M.replace(/\W/g, "")}`;
7154
- m.classList.add(S), C[S] = { browserValue: M };
7164
+ const F = Y.value, S = `spiff-stroke-${F.replace(/\W/g, "")}`;
7165
+ m.classList.add(S), C[S] = { browserValue: F };
7155
7166
  }
7156
7167
  });
7157
7168
  const Q = Ue().serializeToString(E), h = a.colors;
7158
7169
  if (h) {
7159
- for (const [m, F] of Object.entries(C))
7170
+ for (const [m, M] of Object.entries(C))
7160
7171
  for (const Y of Object.keys(h))
7161
- if (F.browserValue === Y) {
7172
+ if (M.browserValue === Y) {
7162
7173
  C[m] = { browserValue: h[Y] };
7163
7174
  break;
7164
7175
  }
7165
7176
  }
7166
7177
  const u = (m) => {
7167
- const F = g.find((M) => M.panelId === m.panelId);
7168
- if (!F)
7178
+ const M = g.find((F) => F.panelId === m.panelId);
7179
+ if (!M)
7169
7180
  throw new L(m);
7170
7181
  const Y = k();
7171
7182
  return new J(
@@ -7183,7 +7194,7 @@ const En = [
7183
7194
  layerIndex: m.layerIndex,
7184
7195
  immutable: m.immutable
7185
7196
  },
7186
- F
7197
+ M
7187
7198
  );
7188
7199
  }, f = t.data.regions;
7189
7200
  try {
@@ -8812,22 +8823,19 @@ class fe {
8812
8823
  return this.workflowExperiences.length;
8813
8824
  }
8814
8825
  async addStakeholder(A, e) {
8815
- var i;
8816
- const t = x.getMap("bundleOwnerIds"), a = t == null ? void 0 : t.get(this.id), n = await N.getShadowGraphqlClient().mutate({
8826
+ var n;
8827
+ const t = await N.getShadowGraphqlClient().mutate({
8817
8828
  mutation: Ln,
8818
8829
  variables: {
8819
8830
  id: this.id,
8820
8831
  details: A,
8821
8832
  type: e || NA.Owner
8822
- },
8823
- context: {
8824
- bundleOwnerId: a
8825
8833
  }
8826
8834
  });
8827
- if (!((i = n.data) != null && i.bundleAddStakeholder))
8835
+ if (!((n = t.data) != null && n.bundleAddStakeholder))
8828
8836
  throw new Error("Bundle not found!");
8829
- const s = n.data.bundleAddStakeholder.bundleStakeholders || [];
8830
- this.storeStakeholderCustomers(s);
8837
+ const a = t.data.bundleAddStakeholder.bundleStakeholders || [];
8838
+ this.storeStakeholderCustomers(a);
8831
8839
  }
8832
8840
  async updateStakeholders(A) {
8833
8841
  var a;
@@ -10197,7 +10205,7 @@ class fs {
10197
10205
  const m = a.type === "integration" ? { integrationProductId: a.integrationProductId } : {
10198
10206
  externalIntegrationId: a.externalIntegrationId,
10199
10207
  externalProductId: a.externalProductId
10200
- }, F = await w.mutate({
10208
+ }, M = await w.mutate({
10201
10209
  mutation: ue,
10202
10210
  variables: {
10203
10211
  ...m,
@@ -10210,9 +10218,9 @@ class fs {
10210
10218
  // TODO: this should be changed to required once the API is updated. Should this also be moved to server.ts?
10211
10219
  context: this.options.applicationKey ? { headers: { "X-Application-Key": this.options.applicationKey } } : void 0
10212
10220
  });
10213
- if (!F.data || !F.data.transactionCreate)
10221
+ if (!M.data || !M.data.transactionCreate)
10214
10222
  throw new P("Failed to create transaction!");
10215
- const Y = F.data.transactionCreate;
10223
+ const Y = M.data.transactionCreate;
10216
10224
  if (!Y.product)
10217
10225
  throw new P("Failed to create transaction, product not available.");
10218
10226
  return Y;
@@ -10294,13 +10302,13 @@ class fs {
10294
10302
  const m = ((D = (p = u.errors) == null ? void 0 : p[0]) == null ? void 0 : D.message) || "Unknown error";
10295
10303
  throw new P(`Not all transactions were found: ${m}`);
10296
10304
  }
10297
- return f.map((m, F) => {
10305
+ return f.map((m, M) => {
10298
10306
  var Y;
10299
10307
  return {
10300
10308
  transaction: m,
10301
10309
  workflowId: m.workflowId,
10302
- readOnly: ((Y = n.find((M) => M.option.transactionId === m.id)) == null ? void 0 : Y.option.readOnly) ?? !1,
10303
- index: n[F].index
10310
+ readOnly: ((Y = n.find((F) => F.option.transactionId === m.id)) == null ? void 0 : Y.option.readOnly) ?? !1,
10311
+ index: n[M].index
10304
10312
  };
10305
10313
  });
10306
10314
  }, o = async () => {
@@ -10326,42 +10334,42 @@ class fs {
10326
10334
  const m = ((D = (p = h.errors) == null ? void 0 : p[0]) == null ? void 0 : D.message) || "Unknown error";
10327
10335
  throw new P(`Failed to create transactions: ${m}`);
10328
10336
  }
10329
- return u.map((m, F) => ({
10337
+ return u.map((m, M) => ({
10330
10338
  transaction: m,
10331
10339
  workflowId: m.workflowId,
10332
10340
  readOnly: !1,
10333
- index: s[F].index
10341
+ index: s[M].index
10334
10342
  }));
10335
10343
  }, r = (await Promise.all([i(), o()])).flat(), c = [...new Set(r.map((h) => h.workflowId))], B = await ht(c, e), l = new Map(B.map((h) => [h.id, h])), d = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), E = r.map(async (h) => {
10336
10344
  var U;
10337
- const { transaction: u, workflowId: f, readOnly: p, index: D } = h, m = l.get(f), F = A[D];
10345
+ const { transaction: u, workflowId: f, readOnly: p, index: D } = h, m = l.get(f), M = A[D];
10338
10346
  !d.get(u.id) && u.transactionOwnerId && d.set(u.id, u.transactionOwnerId);
10339
- const Y = d.get(u.id) || void 0, M = {
10347
+ const Y = d.get(u.id) || void 0, F = {
10340
10348
  product: u.product,
10341
10349
  transaction: u,
10342
10350
  layouts: [],
10343
- singleVariantsRenderable: (U = F == null ? void 0 : F.workflowConfiguration) == null ? void 0 : U.singleVariantsRenderable,
10351
+ singleVariantsRenderable: (U = M == null ? void 0 : M.workflowConfiguration) == null ? void 0 : U.singleVariantsRenderable,
10344
10352
  stateMutationFunc: p ? async () => {
10345
10353
  throw new v("State mutation is forbidden in read only mode!");
10346
10354
  } : async (S) => this.updateTransactionState({ ...S, context: { transactionOwnerId: Y } }),
10347
10355
  readOnly: p,
10348
10356
  workflow: m,
10349
- isReloadedTransaction: F.type === "transaction"
10357
+ isReloadedTransaction: M.type === "transaction"
10350
10358
  };
10351
- if (F.type === "transaction" && u.workflowState) {
10359
+ if (M.type === "transaction" && u.workflowState) {
10352
10360
  const S = JSON.parse(u.workflowState);
10353
- M.layouts = Object.values(S.layouts).map((b) => b.layout), await AA(S), await tA(S), M.reloadedState = S;
10354
- } else if (!p && F.workflowState) {
10355
- const S = JSON.parse(F.workflowState);
10356
- M.layouts = Object.values(S.layouts).map((b) => b.layout), await AA(S), await tA(S), M.reloadedState = S;
10361
+ F.layouts = Object.values(S.layouts).map((b) => b.layout), await AA(S), await tA(S), F.reloadedState = S;
10362
+ } else if (!p && M.workflowState) {
10363
+ const S = JSON.parse(M.workflowState);
10364
+ F.layouts = Object.values(S.layouts).map((b) => b.layout), await AA(S), await tA(S), F.reloadedState = S;
10357
10365
  } else
10358
- M.layouts = KA(
10359
- M.transaction,
10360
- M.workflow
10366
+ F.layouts = KA(
10367
+ F.transaction,
10368
+ F.workflow
10361
10369
  );
10362
- return M.renderableContextService = new QA(
10363
- M.layouts
10364
- ), this.initialized = !0, this.experienceOptions = M, { experienceOptions: M, index: D, options: F };
10370
+ return F.renderableContextService = new QA(
10371
+ F.layouts
10372
+ ), this.initialized = !0, this.experienceOptions = F, { experienceOptions: F, index: D, options: M };
10365
10373
  });
10366
10374
  x.setMap("transactionOwnerIds", d);
10367
10375
  const Q = (await Promise.all(E)).sort((h, u) => h.index - u.index).map(async (h) => {
@@ -10799,6 +10807,7 @@ export {
10799
10807
  sa as ProductCameraRig,
10800
10808
  As as ProductCollection,
10801
10809
  De as ProductWorkflow,
10810
+ BA as PromiseCache,
10802
10811
  qe as PromiseQueue,
10803
10812
  en as QuestionStepHandle,
10804
10813
  Xe as QueueablePromise,