@primestyleai/tryon 5.10.189 → 5.10.190

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.
@@ -1,4 +1,4 @@
1
- export type SocialProvider = "google" | "apple" | "facebook" | "linkedin";
1
+ export type SocialProvider = "google" | "apple" | "linkedin";
2
2
  export interface ProfileAuthSession {
3
3
  accessToken: string;
4
4
  isNewUser?: boolean;
@@ -10,6 +10,7 @@ export declare function clearProfileLocalStorage(): void;
10
10
  export declare function getProfiles(): Profile[];
11
11
  export declare function saveProfiles(profiles: Profile[]): void;
12
12
  export declare function getActiveProfileId(): string | null;
13
+ export declare function isActiveProfileExplicitlyCleared(): boolean;
13
14
  export declare function setActiveProfileId(id: string | null): void;
14
15
  /** Returns the active profile, or the most recently used one, or null. */
15
16
  export declare function getActiveProfile(): Profile | null;
@@ -10522,6 +10522,14 @@ function saveProfiles(profiles) {
10522
10522
  function getActiveProfileId() {
10523
10523
  return lsGet(ACTIVE_PROFILE_KEY, null);
10524
10524
  }
10525
+ function isActiveProfileExplicitlyCleared() {
10526
+ if (typeof window === "undefined") return false;
10527
+ try {
10528
+ return localStorage.getItem(LS_PREFIX + ACTIVE_PROFILE_KEY) === "null";
10529
+ } catch {
10530
+ return false;
10531
+ }
10532
+ }
10525
10533
  function setActiveProfileId(id2) {
10526
10534
  lsSet(ACTIVE_PROFILE_KEY, id2);
10527
10535
  emitStorageChange("active-profile");
@@ -11154,6 +11162,10 @@ async function recommendForProduct(input) {
11154
11162
  log("no signed-in profile session — returning null");
11155
11163
  return null;
11156
11164
  }
11165
+ if (!input.profile && isActiveProfileExplicitlyCleared()) {
11166
+ log("active profile explicitly cleared locally — returning null");
11167
+ return null;
11168
+ }
11157
11169
  let remoteProfiles = [];
11158
11170
  let activeProfileId = null;
11159
11171
  try {
@@ -12394,6 +12406,9 @@ const STYLES = `
12394
12406
  gap: 0.8vw; margin-bottom: 0.55vw;
12395
12407
  }
12396
12408
  .ps-tryon-v2-result-copy { min-width: 0; flex: 1 1 auto; }
12409
+ .ps-single-result-copy {
12410
+ margin: 0 0 clamp(24px, 1.8vw, 34px);
12411
+ }
12397
12412
  .ps-tryon-v2-profile-head {
12398
12413
  flex: 0 0 min(18vw, 48%);
12399
12414
  min-width: 15vw;
@@ -12718,11 +12733,16 @@ const STYLES = `
12718
12733
  }
12719
12734
  .ps-tryon-sr-card-v2.ps-full { flex: 1 1 100%; max-width: 100%; min-height: 5vw; padding: clamp(14px, 0.82vw, 18px); }
12720
12735
  .ps-tryon-sr-card-v2.ps-summary-card {
12721
- align-items: stretch;
12736
+ align-items: center;
12722
12737
  justify-content: center;
12723
- text-align: left;
12724
- min-height: clamp(112px, 7.4vw, 132px);
12725
- padding: clamp(18px, 1.12vw, 24px) clamp(20px, 1.3vw, 28px);
12738
+ text-align: center;
12739
+ min-height: clamp(154px, 10.4vw, 184px);
12740
+ padding: clamp(16px, 1vw, 22px) clamp(18px, 1.18vw, 26px);
12741
+ background: #FFFFFF;
12742
+ box-shadow: none;
12743
+ }
12744
+ .ps-tryon-sr-card-v2.ps-summary-card::after {
12745
+ display: none;
12726
12746
  }
12727
12747
  .ps-tryon-sr-card-v2:hover {
12728
12748
  border-color: var(--ps-accent);
@@ -12735,18 +12755,16 @@ const STYLES = `
12735
12755
  }
12736
12756
  .ps-summary-card-layout {
12737
12757
  width: 100%;
12738
- display: grid;
12739
- grid-template-columns: minmax(0, 1fr) auto;
12740
- grid-template-areas: "copy action";
12758
+ display: flex;
12759
+ flex-direction: column;
12760
+ justify-content: center;
12741
12761
  align-items: center;
12742
- column-gap: clamp(18px, 1.25vw, 28px);
12743
- row-gap: 0;
12762
+ gap: clamp(6px, 0.36vw, 10px);
12744
12763
  }
12745
12764
  .ps-summary-card-copy {
12746
- grid-area: copy;
12747
12765
  display: flex;
12748
12766
  flex-direction: column;
12749
- align-items: flex-start;
12767
+ align-items: center;
12750
12768
  justify-content: center;
12751
12769
  min-width: 0;
12752
12770
  gap: clamp(8px, 0.48vw, 12px);
@@ -12766,10 +12784,17 @@ const STYLES = `
12766
12784
  min-width: 0;
12767
12785
  }
12768
12786
  .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12769
- grid-area: action;
12770
12787
  margin-top: 0;
12771
12788
  white-space: nowrap;
12772
12789
  }
12790
+ .ps-tryon-sr-card-outside-label {
12791
+ margin: 0 0 clamp(8px, 0.5vw, 11px);
12792
+ font-size: clamp(10px, 0.62vw, 12px);
12793
+ font-weight: 780;
12794
+ color: rgba(15,23,42,0.56);
12795
+ letter-spacing: 0.13em;
12796
+ text-transform: uppercase;
12797
+ }
12773
12798
  .ps-tryon-sr-card-v2-summary-title {
12774
12799
  font-size: clamp(11px, 0.66vw, 12px);
12775
12800
  font-weight: 760;
@@ -12780,7 +12805,7 @@ const STYLES = `
12780
12805
  margin-bottom: clamp(2px, 0.08vw, 4px);
12781
12806
  }
12782
12807
  .ps-summary-card-layout .ps-tryon-sr-card-v2-summary-title {
12783
- margin-bottom: 0;
12808
+ margin-bottom: clamp(1px, 0.08vw, 3px);
12784
12809
  white-space: nowrap;
12785
12810
  color: rgba(15,23,42,0.58);
12786
12811
  font-size: clamp(11px, 0.66vw, 12px);
@@ -12819,10 +12844,9 @@ const STYLES = `
12819
12844
  }
12820
12845
  .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: clamp(30px, 2vw, 36px); }
12821
12846
  .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12822
- flex: 0 1 auto;
12823
- font-size: clamp(38px, 2.55vw, 48px);
12847
+ font-size: clamp(34px, 2.2vw, 42px);
12824
12848
  min-width: 0;
12825
- text-align: left;
12849
+ text-align: center;
12826
12850
  }
12827
12851
  /* Long combined labels ("MISSY 12 / Standard", "PLUS 16W / Extra Length")
12828
12852
  overflow the card at 2vw. Drop to ~1.3vw whenever the label is more
@@ -12852,7 +12876,7 @@ const STYLES = `
12852
12876
  }
12853
12877
  .ps-summary-card-layout .ps-tryon-sr-card-v2-rec-pill {
12854
12878
  align-self: center;
12855
- margin-top: 0;
12879
+ margin-top: clamp(1px, 0.1vw, 3px);
12856
12880
  white-space: nowrap;
12857
12881
  background: #fff;
12858
12882
  }
@@ -12907,27 +12931,22 @@ const STYLES = `
12907
12931
  }
12908
12932
  @media (max-width: 768px) {
12909
12933
  .ps-tryon-sr-card-v2.ps-summary-card {
12910
- min-height: 104px;
12934
+ min-height: 108px;
12911
12935
  padding: 16px;
12912
12936
  }
12913
12937
  .ps-summary-card-layout {
12914
- grid-template-columns: minmax(0, 1fr);
12915
- grid-template-areas:
12916
- "copy"
12917
- "action";
12918
- row-gap: 12px;
12919
- align-items: stretch;
12938
+ gap: 8px;
12939
+ align-items: center;
12920
12940
  }
12921
12941
  .ps-summary-card-layout .ps-tryon-sr-card-v2-main {
12922
12942
  width: 100%;
12923
- justify-content: space-between;
12943
+ justify-content: center;
12924
12944
  gap: 12px;
12925
12945
  }
12926
12946
  .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12927
12947
  font-size: 34px;
12928
12948
  }
12929
12949
  .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12930
- width: 100%;
12931
12950
  min-height: 38px;
12932
12951
  }
12933
12952
  }
@@ -14121,6 +14140,22 @@ const STYLES = `
14121
14140
  border-top-color: var(--ps-accent); border-radius: 50%;
14122
14141
  animation: ps-spin 0.7s linear infinite; margin: 0 auto;
14123
14142
  }
14143
+ .ps-bp-profile-hydrating {
14144
+ min-height: min(52vh, 420px);
14145
+ display: flex;
14146
+ align-items: center;
14147
+ justify-content: center;
14148
+ gap: clamp(10px, 0.7vw, 14px);
14149
+ color: var(--ps-text-secondary);
14150
+ font-size: clamp(13px, 0.82vw, 15px);
14151
+ font-weight: 650;
14152
+ }
14153
+ .ps-bp-profile-hydrating .ps-tryon-size-loading-spinner {
14154
+ width: clamp(18px, 1.25vw, 22px);
14155
+ height: clamp(18px, 1.25vw, 22px);
14156
+ flex-shrink: 0;
14157
+ margin: 0;
14158
+ }
14124
14159
  @keyframes ps-spin { to { transform: rotate(360deg); } }
14125
14160
  .ps-tryon-sr-loading-pulse { animation: ps-loading-pulse 2s ease-in-out infinite; }
14126
14161
  @keyframes ps-loading-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@@ -17052,10 +17087,10 @@ const STYLES = `
17052
17087
  display: flex;
17053
17088
  align-items: center;
17054
17089
  justify-content: space-between;
17055
- gap: clamp(8px, 0.65vw, 14px);
17090
+ gap: clamp(10px, 0.74vw, 16px);
17056
17091
  width: min(100%, 500px);
17057
- margin: 0 auto clamp(7px, 0.55vw, 12px);
17058
- padding: clamp(7px, 0.55vw, 11px) clamp(10px, 0.8vw, 16px);
17092
+ margin: 0 auto clamp(8px, 0.62vw, 13px);
17093
+ padding: clamp(8px, 0.62vw, 12px) clamp(12px, 0.9vw, 18px);
17059
17094
  border: 1px solid rgba(33, 84, 239, 0.18);
17060
17095
  border-radius: clamp(8px, 0.7vw, 12px);
17061
17096
  background: linear-gradient(135deg, rgba(33, 84, 239, 0.08), rgba(255, 255, 255, 0.96));
@@ -17068,14 +17103,14 @@ const STYLES = `
17068
17103
  min-width: 0;
17069
17104
  }
17070
17105
  .ps-bp-profile-card-eyebrow {
17071
- font-size: clamp(8px, 0.55vw, 10px);
17106
+ font-size: clamp(9px, 0.58vw, 11px);
17072
17107
  font-weight: 800;
17073
17108
  letter-spacing: 0.14em;
17074
17109
  text-transform: uppercase;
17075
17110
  color: var(--ps-accent);
17076
17111
  }
17077
17112
  .ps-bp-profile-card-copy strong {
17078
- font-size: clamp(12px, 0.85vw, 15px);
17113
+ font-size: clamp(13px, 0.9vw, 16px);
17079
17114
  line-height: 1.1;
17080
17115
  color: var(--ps-text-primary);
17081
17116
  overflow: hidden;
@@ -17083,7 +17118,7 @@ const STYLES = `
17083
17118
  white-space: nowrap;
17084
17119
  }
17085
17120
  .ps-bp-profile-card-copy span:last-child {
17086
- font-size: clamp(9px, 0.58vw, 11px);
17121
+ font-size: clamp(10px, 0.62vw, 12px);
17087
17122
  line-height: 1.25;
17088
17123
  color: var(--ps-text-secondary);
17089
17124
  }
@@ -17093,9 +17128,9 @@ const STYLES = `
17093
17128
  background: #FFFFFF;
17094
17129
  color: var(--ps-accent);
17095
17130
  border-radius: 999px;
17096
- padding: clamp(6px, 0.45vw, 8px) clamp(9px, 0.7vw, 14px);
17131
+ padding: clamp(7px, 0.5vw, 9px) clamp(10px, 0.76vw, 15px);
17097
17132
  font-family: inherit;
17098
- font-size: clamp(9px, 0.62vw, 11px);
17133
+ font-size: clamp(10px, 0.66vw, 12px);
17099
17134
  font-weight: 800;
17100
17135
  letter-spacing: 0.08em;
17101
17136
  text-transform: uppercase;
@@ -17108,8 +17143,8 @@ const STYLES = `
17108
17143
  }
17109
17144
  .ps-bp-profile-card-action:active { transform: scale(0.98); }
17110
17145
  .ps-bp-profile-card-compact {
17111
- margin: 0 auto clamp(3px, 0.32vw, 6px);
17112
- padding: clamp(4px, 0.34vw, 6px) clamp(8px, 0.62vw, 12px);
17146
+ margin: 0 auto clamp(4px, 0.36vw, 7px);
17147
+ padding: clamp(5px, 0.4vw, 8px) clamp(10px, 0.72vw, 14px);
17113
17148
  border-radius: clamp(7px, 0.55vw, 10px);
17114
17149
  box-shadow: none;
17115
17150
  }
@@ -17121,24 +17156,24 @@ const STYLES = `
17121
17156
  }
17122
17157
  .ps-bp-profile-card-compact .ps-bp-profile-card-eyebrow {
17123
17158
  grid-column: 1 / -1;
17124
- font-size: clamp(7px, 0.46vw, 9px);
17159
+ font-size: clamp(8px, 0.5vw, 10px);
17125
17160
  letter-spacing: 0.16em;
17126
17161
  line-height: 1;
17127
17162
  }
17128
17163
  .ps-bp-profile-card-compact .ps-bp-profile-card-copy strong {
17129
- font-size: clamp(11px, 0.72vw, 13px);
17164
+ font-size: clamp(12px, 0.78vw, 14px);
17130
17165
  line-height: 1.05;
17131
17166
  }
17132
17167
  .ps-bp-profile-card-compact .ps-bp-profile-card-copy span:last-child {
17133
- font-size: clamp(8px, 0.5vw, 10px);
17168
+ font-size: clamp(9px, 0.54vw, 11px);
17134
17169
  line-height: 1.1;
17135
17170
  overflow: hidden;
17136
17171
  text-overflow: ellipsis;
17137
17172
  white-space: nowrap;
17138
17173
  }
17139
17174
  .ps-bp-profile-card-compact .ps-bp-profile-card-action {
17140
- padding: clamp(4px, 0.3vw, 6px) clamp(7px, 0.55vw, 11px);
17141
- font-size: clamp(8px, 0.52vw, 10px);
17175
+ padding: clamp(5px, 0.36vw, 7px) clamp(8px, 0.62vw, 12px);
17176
+ font-size: clamp(9px, 0.56vw, 11px);
17142
17177
  }
17143
17178
 
17144
17179
  /* Typography */
@@ -21840,10 +21875,9 @@ function UserIcon({ size = 16 }) {
21840
21875
  }
21841
21876
  function ShoppingBagIcon({ size = 16 }) {
21842
21877
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21843
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M6 7h12l-1 14H7L6 7Z" }),
21844
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9 7a3 3 0 0 1 6 0" }),
21845
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M12 12v5" }),
21846
- /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M9.5 14.5h5" })
21878
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 10a4 4 0 0 1-8 0" }),
21879
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3.103 6.034h17.794" }),
21880
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z" })
21847
21881
  ] });
21848
21882
  }
21849
21883
  function ExternalLinkIcon({ size = 16 }) {
@@ -24215,7 +24249,7 @@ function SectionDetailView({
24215
24249
  if (isFootwear && fit === "good") return t2("BEST MATCH");
24216
24250
  if (isLen && fit === "good") return t2("EDITORIAL LENGTH");
24217
24251
  if (renderRaw && fit === "good") return t2("WITHIN RANGE");
24218
- if (fit === "good") return t2("PERFECT TENSION");
24252
+ if (fit === "good") return t2("WITHIN RANGE");
24219
24253
  if (fit === "a-bit-tight") return t2("SLIGHTLY TIGHT");
24220
24254
  if (fit === "a-bit-loose") return t2("SLIGHT EASE");
24221
24255
  if (fit.includes("tight")) return t2("TIGHT");
@@ -25820,40 +25854,44 @@ function SizeResultView({
25820
25854
  ) : (
25821
25855
  /* CARD VIEW — clickable summary card + gallery strip */
25822
25856
  /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
25823
- profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) }) : null,
25824
- profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }) : null,
25825
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
25826
- "button",
25827
- {
25828
- className: `ps-tryon-sr-card-v2 ps-summary-card ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25829
- onClick: () => setActiveSection(sectionName),
25830
- type: "button",
25831
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text ps-summary-card-layout", children: [
25832
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-summary-card-copy", children: [
25833
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-summary-title", children: guideOnlyResult ? t2("Product Size Guide") : t2("Recommended size") }),
25834
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-main", children: [
25835
- (() => {
25836
- const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "—");
25837
- const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25838
- const isLong = labelText.length > 12;
25839
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText });
25840
- })(),
25857
+ (() => {
25858
+ const cardTitle = guideOnlyResult ? t2("Size Guide") : t2("Your Fit");
25859
+ const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "");
25860
+ const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25861
+ const isLong = labelText.length > 12;
25862
+ const badgeText = guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED");
25863
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
25864
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-copy ps-single-result-copy", children: [
25865
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: t2("Your Size Recommendation") }),
25866
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: t2("Tap the card for detailed breakdown") })
25867
+ ] }),
25868
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }) : null,
25869
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
25870
+ "button",
25871
+ {
25872
+ className: `ps-tryon-sr-card-v2 ps-summary-card ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25873
+ onClick: () => setActiveSection(sectionName),
25874
+ type: "button",
25875
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text ps-summary-card-layout", children: [
25876
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-summary-title", children: cardTitle }),
25877
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText }),
25841
25878
  /* @__PURE__ */ jsxRuntimeExports.jsx(
25842
25879
  "span",
25843
25880
  {
25844
25881
  className: `ps-tryon-sr-card-v2-rec-pill${pendingCustomSizes[sectionName] ? " is-overridden" : ""}`,
25845
- children: guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED")
25882
+ children: badgeText
25846
25883
  }
25847
- )
25884
+ ),
25885
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-view", children: [
25886
+ guideOnlyResult ? t2("VIEW CHART") : t2("VIEW DETAILS"),
25887
+ " ",
25888
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "›" })
25889
+ ] })
25848
25890
  ] })
25849
- ] }),
25850
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-open-pill", children: [
25851
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: guideOnlyResult ? t2("View chart") : t2("View measurements") }),
25852
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "›" })
25853
- ] })
25854
- ] })
25855
- }
25856
- ) }),
25891
+ }
25892
+ ) })
25893
+ ] });
25894
+ })(),
25857
25895
  hasCarousel && /* @__PURE__ */ jsxRuntimeExports.jsx(ProductPhotoCarouselCard, { items: carouselItems.length > 0 ? carouselItems : void 0, photos: productImages, productTitle, t: t2 }),
25858
25896
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-actions", children: [
25859
25897
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -28961,12 +28999,10 @@ function MySizingProfilesView({
28961
28999
  const googleIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cpath%20fill='%23FFC107'%20d='M43.6%2020.5H42V20H24v8h11.3C33.7%2032.7%2029.3%2036%2024%2036c-6.6%200-12-5.4-12-12s5.4-12%2012-12c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2012.9%204%204%2012.9%204%2024s8.9%2020%2020%2020%2020-8.9%2020-20c0-1.3-.1-2.4-.4-3.5z'/%3e%3cpath%20fill='%23FF3D00'%20d='M6.3%2014.7l6.6%204.8C14.7%2015.1%2019%2012%2024%2012c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2016.2%204%209.5%208.5%206.3%2014.7z'/%3e%3cpath%20fill='%234CAF50'%20d='M24%2044c5.2%200%209.9-2%2013.4-5.2l-6.2-5.2C29.2%2035.1%2026.7%2036%2024%2036c-5.2%200-9.6-3.3-11.3-7.8l-6.5%205C9.4%2039.6%2016.1%2044%2024%2044z'/%3e%3cpath%20fill='%231976D2'%20d='M43.6%2020.5H42V20H24v8h11.3c-.8%202.3-2.3%204.2-4.1%205.6l6.2%205.2C36.9%2039.2%2044%2034%2044%2024c0-1.3-.1-2.4-.4-3.5z'/%3e%3c/svg%3e";
28962
29000
  const profileSyncIllustration = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20520%20420'%3e%3cdefs%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='1'%20y2='1'%3e%3cstop%20offset='0'%20stop-color='%23EFF6FF'/%3e%3cstop%20offset='1'%20stop-color='%23FFFFFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='blue'%20x1='0'%20y1='0'%20x2='1'%20y2='1'%3e%3cstop%20offset='0'%20stop-color='%2360A5FA'/%3e%3cstop%20offset='1'%20stop-color='%232563EB'/%3e%3c/linearGradient%3e%3cfilter%20id='shadow'%20x='-20%25'%20y='-20%25'%20width='140%25'%20height='140%25'%3e%3cfeDropShadow%20dx='0'%20dy='18'%20stdDeviation='22'%20flood-color='%231E3A8A'%20flood-opacity='0.14'/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='20'%20y='20'%20width='480'%20height='380'%20rx='44'%20fill='url(%23bg)'/%3e%3ccircle%20cx='118'%20cy='92'%20r='36'%20fill='%23DBEAFE'/%3e%3ccircle%20cx='420'%20cy='328'%20r='42'%20fill='%23E0F2FE'/%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='170'%20y='70'%20width='180'%20height='280'%20rx='34'%20fill='%23FFFFFF'/%3e%3crect%20x='186'%20y='88'%20width='148'%20height='246'%20rx='25'%20fill='%23F8FAFC'%20stroke='%23DBEAFE'/%3e%3ccircle%20cx='260'%20cy='161'%20r='38'%20fill='url(%23blue)'/%3e%3cpath%20fill='%23DBEAFE'%20d='M235%20246c3-25%2022-43%2025-43s22%2018%2025%2043c-13%2010-37%2010-50%200z'/%3e%3cpath%20fill='%23BFDBFE'%20d='M228%20284h64c8%200%2014%206%2014%2014s-6%2014-14%2014h-64c-8%200-14-6-14-14s6-14%2014-14z'/%3e%3c/g%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='62'%20y='172'%20width='130'%20height='94'%20rx='24'%20fill='%23FFFFFF'/%3e%3ccircle%20cx='102'%20cy='212'%20r='20'%20fill='%23EFF6FF'%20stroke='%23BFDBFE'/%3e%3crect%20x='132'%20y='196'%20width='36'%20height='8'%20rx='4'%20fill='%23BFDBFE'/%3e%3crect%20x='132'%20y='214'%20width='48'%20height='8'%20rx='4'%20fill='%23DBEAFE'/%3e%3crect%20x='88'%20y='240'%20width='76'%20height='10'%20rx='5'%20fill='%232563EB'%20opacity='0.88'/%3e%3c/g%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='328'%20y='172'%20width='130'%20height='94'%20rx='24'%20fill='%23FFFFFF'/%3e%3ccircle%20cx='368'%20cy='212'%20r='20'%20fill='%23EFF6FF'%20stroke='%23BFDBFE'/%3e%3crect%20x='398'%20y='196'%20width='36'%20height='8'%20rx='4'%20fill='%23BFDBFE'/%3e%3crect%20x='398'%20y='214'%20width='48'%20height='8'%20rx='4'%20fill='%23DBEAFE'/%3e%3crect%20x='354'%20y='240'%20width='76'%20height='10'%20rx='5'%20fill='%232563EB'%20opacity='0.88'/%3e%3c/g%3e%3cpath%20d='M194%20198c20-18%2038-27%2060-29'%20fill='none'%20stroke='%2393C5FD'%20stroke-width='7'%20stroke-linecap='round'%20stroke-dasharray='1%2016'/%3e%3cpath%20d='M326%20198c-20-18-38-27-60-29'%20fill='none'%20stroke='%2393C5FD'%20stroke-width='7'%20stroke-linecap='round'%20stroke-dasharray='1%2016'/%3e%3c/svg%3e";
28963
29001
  const appleIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23111111'%20d='M16.37%201.43c0%201.14-.46%202.23-1.19%203.05-.8.91-2.13%201.61-3.2%201.5-.14-1.09.4-2.25%201.12-3.06.8-.9%202.2-1.58%203.27-1.49zM20.2%2017.13c-.56%201.27-.83%201.84-1.55%202.96-1.01%201.56-2.44%203.5-4.21%203.52-1.58.02-1.98-1.03-4.12-1.02-2.14.01-2.59%201.05-4.17%201.03-1.77-.02-3.12-1.77-4.13-3.33-2.82-4.36-3.12-9.47-1.38-12.19%201.23-1.94%203.18-3.08%205.01-3.08%201.86%200%203.03%201.03%204.57%201.03%201.49%200%202.39-1.03%204.54-1.03%201.62%200%203.34.88%204.56%202.41-4%202.19-3.35%207.9.88%209.7z'/%3e%3c/svg%3e";
28964
- const facebookIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='12'%20cy='12'%20r='11'%20fill='%231877F2'/%3e%3cpath%20fill='%23fff'%20d='M14.9%2015.2l.5-3.2h-3v-2c0-.9.4-1.7%201.8-1.7h1.4V5.6s-1.2-.2-2.4-.2c-2.5%200-4.1%201.5-4.1%204.2V12H6.4v3.2h2.7V23c.5.1%201.1.1%201.7.1s1.1%200%201.7-.1v-7.8h2.4z'/%3e%3c/svg%3e";
28965
29002
  const linkedinIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='22'%20height='22'%20x='1'%20y='1'%20rx='4'%20fill='%230A66C2'/%3e%3cpath%20fill='%23fff'%20d='M7.3%209.8h-3v9h3v-9zM5.8%208.6c1%200%201.7-.7%201.7-1.6S6.8%205.4%205.8%205.4%204.1%206.1%204.1%207s.7%201.6%201.7%201.6zm4.1%201.2v9h3v-5c0-.3%200-.5.1-.7.2-.5.7-1.1%201.5-1.1%201.1%200%201.5.8%201.5%202v4.8h3v-5.2c0-2.8-1.5-4.1-3.5-4.1-1.6%200-2.3.9-2.7%201.5v-1.2h-2.9z'/%3e%3c/svg%3e";
28966
29003
  const PROVIDERS = [
28967
29004
  { id: "google", label: "Continue with Google", shortLabel: "Google", icon: googleIcon },
28968
29005
  { id: "apple", label: "Continue with Apple", shortLabel: "Apple", icon: appleIcon },
28969
- { id: "facebook", label: "Continue with Facebook", shortLabel: "Facebook", icon: facebookIcon },
28970
29006
  { id: "linkedin", label: "Continue with LinkedIn", shortLabel: "LinkedIn", icon: linkedinIcon }
28971
29007
  ];
28972
29008
  function SocialProfileAuthView({ loadingProvider, error, onLogin, t: t2 }) {
@@ -30069,6 +30105,47 @@ function BodyProfileView({
30069
30105
  const shoeSizeOptions = getShoeSizeOptions(shoeSizeSystem);
30070
30106
  const shoeReference = isShoeReferenceMode ? estimateShoeReference({ brandId: shoeBrandId, size: shoeSizeValue, sizeSystem: shoeSizeSystem, productTitle, gender: shoeGender }) : null;
30071
30107
  const selectedShoeBrand = SHOE_BRANDS.find((brand) => brand.id === shoeBrandId);
30108
+ const seededBasicsProfileIdRef = reactExports.useRef(null);
30109
+ reactExports.useEffect(() => {
30110
+ const profileId = activeProfile?.id ?? null;
30111
+ if (!profileId || seededBasicsProfileIdRef.current === profileId) return;
30112
+ seededBasicsProfileIdRef.current = profileId;
30113
+ const nextProfileHeight = activeProfile?.height ?? activeProfile?.heightCm;
30114
+ const nextProfileWeight = activeProfile?.weight ?? activeProfile?.weightKg;
30115
+ const nextProfileAge = activeProfile?.age;
30116
+ const nextProfileHeightUnit = activeProfile?.heightUnit === "ft" ? "in" : activeProfile?.heightUnit || (activeProfile?.heightCm ? "cm" : void 0);
30117
+ const nextProfileWeightUnit = activeProfile?.weightUnit || (activeProfile?.weightKg ? "kg" : void 0);
30118
+ if (nextProfileHeight != null && Number(nextProfileHeight) > 0) {
30119
+ if (nextProfileHeightUnit === "cm") {
30120
+ const cm = Math.round(Number(nextProfileHeight));
30121
+ const totalIn = Math.round(cm / 2.54);
30122
+ setHeight(String(cm));
30123
+ setHeightFeet(String(Math.floor(totalIn / 12)));
30124
+ setHeightInches(String(totalIn % 12));
30125
+ setPhotoStepHeight(String(cm));
30126
+ setHUnit("cm");
30127
+ setHeightUnit("cm");
30128
+ } else {
30129
+ const totalIn = Math.round(Number(nextProfileHeight));
30130
+ setHeightFeet(String(Math.floor(totalIn / 12)));
30131
+ setHeightInches(String(totalIn % 12));
30132
+ setHeight(String(Math.round(totalIn * 2.54)));
30133
+ setPhotoStepHeight(String(Math.round(totalIn * 2.54)));
30134
+ setHUnit("in");
30135
+ setHeightUnit("in");
30136
+ }
30137
+ }
30138
+ if (nextProfileWeight != null && Number(nextProfileWeight) > 0) {
30139
+ setWeight(String(Math.round(Number(nextProfileWeight))));
30140
+ if (nextProfileWeightUnit) {
30141
+ setWUnit(nextProfileWeightUnit);
30142
+ setWeightUnit(nextProfileWeightUnit);
30143
+ }
30144
+ }
30145
+ if (nextProfileAge != null && Number(nextProfileAge) > 0) {
30146
+ setAge(String(Math.round(Number(nextProfileAge))));
30147
+ }
30148
+ }, [activeProfile, setHeightUnit, setWeightUnit]);
30072
30149
  const [error, setError] = reactExports.useState("");
30073
30150
  const handlePhotoSelect = reactExports.useCallback(async (e) => {
30074
30151
  const file = e.target.files?.[0];
@@ -33363,7 +33440,8 @@ function PrimeStyleTryonInner({
33363
33440
  const [deleteConfirmId, setDeleteConfirmId] = reactExports.useState(null);
33364
33441
  const setActiveProfileId$1 = reactExports.useCallback((id2) => {
33365
33442
  setActiveProfileIdState(id2);
33366
- if (!profileSessionRef.current) setActiveProfileId(id2);
33443
+ if (!profileSessionRef.current || id2 === null) setActiveProfileId(id2);
33444
+ else lsRemove("active_profile_id");
33367
33445
  }, []);
33368
33446
  reactExports.useEffect(() => {
33369
33447
  profileSessionRef.current = profileSession;
@@ -33377,6 +33455,7 @@ function PrimeStyleTryonInner({
33377
33455
  });
33378
33456
  const profileSyncTimerRef = reactExports.useRef(null);
33379
33457
  const profileSyncHydratingRef = reactExports.useRef(false);
33458
+ const [profileStoreHydrating, setProfileStoreHydrating] = reactExports.useState(false);
33380
33459
  const profileSyncSnapshotRef = reactExports.useRef("");
33381
33460
  const handleRegisterProfilesBack = reactExports.useCallback((canGoBack, goBack) => {
33382
33461
  profilesCanGoBackRef.current = canGoBack;
@@ -33449,6 +33528,7 @@ function PrimeStyleTryonInner({
33449
33528
  }, []);
33450
33529
  const hydrateProfileStore = reactExports.useCallback(async (session, seedProfiles, seedActiveProfileId) => {
33451
33530
  profileSyncHydratingRef.current = true;
33531
+ setProfileStoreHydrating(true);
33452
33532
  try {
33453
33533
  const remoteStore = await fetchRemoteProfiles(apiUrl, session.accessToken);
33454
33534
  if (remoteStore.profiles.length > 0) {
@@ -33463,6 +33543,7 @@ function PrimeStyleTryonInner({
33463
33543
  applyProfileStore([], null, false);
33464
33544
  } finally {
33465
33545
  profileSyncHydratingRef.current = false;
33546
+ setProfileStoreHydrating(false);
33466
33547
  }
33467
33548
  }, [apiUrl, applyProfileStore]);
33468
33549
  const handleSocialProfileLogin = reactExports.useCallback(async (provider) => {
@@ -35702,6 +35783,14 @@ function PrimeStyleTryonInner({
35702
35783
  if (measurementType === "wrist") return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsx(WristSizeView, { ...accCommon }) }, "v-wrist");
35703
35784
  const isWomenProduct = effectiveProductGender === "female";
35704
35785
  const simplePhotoOnly = measurementType === "foot" || measurementType === "body-basic";
35786
+ const activeProfileForBody = profiles.find((x2) => x2.id === activeProfileId) || null;
35787
+ const waitingForActiveProfile = !!profileSession && profileStoreHydrating && profiles.length === 0 && !activeProfileForBody;
35788
+ if (waitingForActiveProfile) {
35789
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-hydrating", children: [
35790
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-size-loading-spinner", "aria-hidden": "true" }),
35791
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Loading your fit profile") })
35792
+ ] }) }, "v-bodyprofile-loading");
35793
+ }
35705
35794
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35706
35795
  BodyProfileView,
35707
35796
  {
@@ -35724,7 +35813,7 @@ function PrimeStyleTryonInner({
35724
35813
  apiUrl: getApiUrl(apiUrl),
35725
35814
  apiKey: getApiKey(),
35726
35815
  hasActiveProfileWithMeasurements: (() => {
35727
- const p2 = profiles.find((x2) => x2.id === activeProfileId);
35816
+ const p2 = activeProfileForBody;
35728
35817
  if (!p2) return false;
35729
35818
  const ph2 = p2.height ?? p2.heightCm ?? 0;
35730
35819
  const pw = p2.weight ?? p2.weightKg ?? 0;
@@ -35732,10 +35821,10 @@ function PrimeStyleTryonInner({
35732
35821
  })(),
35733
35822
  onUseActiveProfile: handleUseActiveProfile,
35734
35823
  activeProfileName: (() => {
35735
- const p2 = profiles.find((x2) => x2.id === activeProfileId);
35824
+ const p2 = activeProfileForBody;
35736
35825
  return p2?.name || null;
35737
35826
  })(),
35738
- activeProfile: profiles.find((x2) => x2.id === activeProfileId) || null,
35827
+ activeProfile: activeProfileForBody,
35739
35828
  onStartFresh: () => {
35740
35829
  setActiveProfileId$1(null);
35741
35830
  setBodyProfileInitialStep(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.189",
3
+ "version": "5.10.190",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",