@thefittingroom/shop-ui 5.0.7 → 5.0.9
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.js +221 -133
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22677,7 +22677,7 @@ function isVersionServiceProvider(provider) {
|
|
|
22677
22677
|
}
|
|
22678
22678
|
const name$q = "@firebase/app";
|
|
22679
22679
|
const version$1$1 = "0.14.5";
|
|
22680
|
-
const logger$
|
|
22680
|
+
const logger$6 = new Logger$1("@firebase/app");
|
|
22681
22681
|
const name$p = "@firebase/app-compat";
|
|
22682
22682
|
const name$o = "@firebase/analytics-compat";
|
|
22683
22683
|
const name$n = "@firebase/analytics";
|
|
@@ -22744,13 +22744,13 @@ function _addComponent(app, component) {
|
|
|
22744
22744
|
try {
|
|
22745
22745
|
app.container.addComponent(component);
|
|
22746
22746
|
} catch (e) {
|
|
22747
|
-
logger$
|
|
22747
|
+
logger$6.debug(`Component ${component.name} failed to register with FirebaseApp ${app.name}`, e);
|
|
22748
22748
|
}
|
|
22749
22749
|
}
|
|
22750
22750
|
function _registerComponent(component) {
|
|
22751
22751
|
const componentName = component.name;
|
|
22752
22752
|
if (_components.has(componentName)) {
|
|
22753
|
-
logger$
|
|
22753
|
+
logger$6.debug(`There were multiple attempts to register component ${componentName}.`);
|
|
22754
22754
|
return false;
|
|
22755
22755
|
}
|
|
22756
22756
|
_components.set(componentName, component);
|
|
@@ -22959,7 +22959,7 @@ function registerVersion(libraryKeyOrName, version2, variant) {
|
|
|
22959
22959
|
if (versionMismatch) {
|
|
22960
22960
|
warning.push(`version name "${version2}" contains illegal characters (whitespace or "/")`);
|
|
22961
22961
|
}
|
|
22962
|
-
logger$
|
|
22962
|
+
logger$6.warn(warning.join(" "));
|
|
22963
22963
|
return;
|
|
22964
22964
|
}
|
|
22965
22965
|
_registerComponent(new Component(
|
|
@@ -23003,12 +23003,12 @@ async function readHeartbeatsFromIndexedDB(app) {
|
|
|
23003
23003
|
return result;
|
|
23004
23004
|
} catch (e) {
|
|
23005
23005
|
if (e instanceof FirebaseError) {
|
|
23006
|
-
logger$
|
|
23006
|
+
logger$6.warn(e.message);
|
|
23007
23007
|
} else {
|
|
23008
23008
|
const idbGetError = ERROR_FACTORY.create("idb-get", {
|
|
23009
23009
|
originalErrorMessage: e?.message
|
|
23010
23010
|
});
|
|
23011
|
-
logger$
|
|
23011
|
+
logger$6.warn(idbGetError.message);
|
|
23012
23012
|
}
|
|
23013
23013
|
}
|
|
23014
23014
|
}
|
|
@@ -23021,12 +23021,12 @@ async function writeHeartbeatsToIndexedDB(app, heartbeatObject) {
|
|
|
23021
23021
|
await tx.done;
|
|
23022
23022
|
} catch (e) {
|
|
23023
23023
|
if (e instanceof FirebaseError) {
|
|
23024
|
-
logger$
|
|
23024
|
+
logger$6.warn(e.message);
|
|
23025
23025
|
} else {
|
|
23026
23026
|
const idbGetError = ERROR_FACTORY.create("idb-set", {
|
|
23027
23027
|
originalErrorMessage: e?.message
|
|
23028
23028
|
});
|
|
23029
|
-
logger$
|
|
23029
|
+
logger$6.warn(idbGetError.message);
|
|
23030
23030
|
}
|
|
23031
23031
|
}
|
|
23032
23032
|
}
|
|
@@ -23075,7 +23075,7 @@ class HeartbeatServiceImpl {
|
|
|
23075
23075
|
}
|
|
23076
23076
|
return this._storage.overwrite(this._heartbeatsCache);
|
|
23077
23077
|
} catch (e) {
|
|
23078
|
-
logger$
|
|
23078
|
+
logger$6.warn(e);
|
|
23079
23079
|
}
|
|
23080
23080
|
}
|
|
23081
23081
|
/**
|
|
@@ -23106,7 +23106,7 @@ class HeartbeatServiceImpl {
|
|
|
23106
23106
|
}
|
|
23107
23107
|
return headerString;
|
|
23108
23108
|
} catch (e) {
|
|
23109
|
-
logger$
|
|
23109
|
+
logger$6.warn(e);
|
|
23110
23110
|
return "";
|
|
23111
23111
|
}
|
|
23112
23112
|
}
|
|
@@ -40670,103 +40670,144 @@ registerAuth(
|
|
|
40670
40670
|
"Browser"
|
|
40671
40671
|
/* ClientPlatform.BROWSER */
|
|
40672
40672
|
);
|
|
40673
|
-
let
|
|
40673
|
+
let debugSource = false;
|
|
40674
40674
|
function _init$4(debug) {
|
|
40675
40675
|
if (debug) {
|
|
40676
40676
|
let escapeRegExp = function(string) {
|
|
40677
|
-
return string.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
40677
|
+
return "^" + string.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".") + "$";
|
|
40678
40678
|
};
|
|
40679
40679
|
if (debug === true) {
|
|
40680
|
-
|
|
40680
|
+
debugSource = true;
|
|
40681
40681
|
} else if (debug instanceof RegExp) {
|
|
40682
|
-
|
|
40682
|
+
debugSource = debug;
|
|
40683
40683
|
} else if (Array.isArray(debug)) {
|
|
40684
|
-
|
|
40684
|
+
debugSource = new RegExp(debug.map((s) => escapeRegExp(s)).join("|"));
|
|
40685
40685
|
} else if (typeof debug === "string") {
|
|
40686
|
-
|
|
40686
|
+
debugSource = new RegExp(escapeRegExp(debug));
|
|
40687
40687
|
}
|
|
40688
40688
|
}
|
|
40689
40689
|
}
|
|
40690
40690
|
function isDebugSource(source) {
|
|
40691
|
-
if (
|
|
40692
|
-
return
|
|
40691
|
+
if (typeof debugSource === "boolean") {
|
|
40692
|
+
return debugSource;
|
|
40693
40693
|
}
|
|
40694
|
-
return
|
|
40694
|
+
return debugSource.test(source);
|
|
40695
40695
|
}
|
|
40696
40696
|
function log(entry) {
|
|
40697
40697
|
const {
|
|
40698
40698
|
source,
|
|
40699
40699
|
level,
|
|
40700
40700
|
message,
|
|
40701
|
-
data
|
|
40701
|
+
data,
|
|
40702
|
+
duration
|
|
40702
40703
|
} = entry;
|
|
40703
|
-
|
|
40704
|
+
if (level === "debug" && !isDebugSource(source)) {
|
|
40705
|
+
return;
|
|
40706
|
+
}
|
|
40707
|
+
let finalMessage = message;
|
|
40708
|
+
if (finalMessage.includes("{{")) {
|
|
40709
|
+
finalMessage = finalMessage.replace(/{{ts}}/g, (/* @__PURE__ */ new Date()).toISOString());
|
|
40710
|
+
}
|
|
40711
|
+
finalMessage = `[TFR ${source}][${level.toUpperCase()}] ${finalMessage}`;
|
|
40712
|
+
const logData = [finalMessage];
|
|
40713
|
+
if (duration !== void 0) {
|
|
40714
|
+
logData.push(`${duration.toFixed(2)} ms`);
|
|
40715
|
+
}
|
|
40716
|
+
if (data) {
|
|
40717
|
+
logData.push(data);
|
|
40718
|
+
}
|
|
40704
40719
|
switch (level) {
|
|
40705
40720
|
case "error":
|
|
40706
|
-
console.error(
|
|
40721
|
+
console.error(...logData);
|
|
40707
40722
|
break;
|
|
40708
40723
|
case "warn":
|
|
40709
|
-
console.warn(
|
|
40724
|
+
console.warn(...logData);
|
|
40710
40725
|
break;
|
|
40711
40726
|
case "info":
|
|
40712
|
-
console.info(
|
|
40727
|
+
console.info(...logData);
|
|
40713
40728
|
break;
|
|
40714
40729
|
case "debug":
|
|
40715
|
-
|
|
40716
|
-
console.debug(logMessage, ...data);
|
|
40717
|
-
}
|
|
40730
|
+
console.debug(...logData);
|
|
40718
40731
|
break;
|
|
40719
40732
|
default:
|
|
40720
|
-
console.log(
|
|
40733
|
+
console.log(...logData);
|
|
40721
40734
|
}
|
|
40722
40735
|
}
|
|
40723
|
-
function logError(source, message, ...data) {
|
|
40724
|
-
log({
|
|
40725
|
-
source,
|
|
40726
|
-
level: "error",
|
|
40727
|
-
message,
|
|
40728
|
-
data
|
|
40729
|
-
});
|
|
40730
|
-
}
|
|
40731
|
-
function logWarn(source, message, ...data) {
|
|
40732
|
-
log({
|
|
40733
|
-
source,
|
|
40734
|
-
level: "warn",
|
|
40735
|
-
message,
|
|
40736
|
-
data
|
|
40737
|
-
});
|
|
40738
|
-
}
|
|
40739
|
-
function logInfo(source, message, ...data) {
|
|
40740
|
-
log({
|
|
40741
|
-
source,
|
|
40742
|
-
level: "info",
|
|
40743
|
-
message,
|
|
40744
|
-
data
|
|
40745
|
-
});
|
|
40746
|
-
}
|
|
40747
|
-
function logDebug(source, message, ...data) {
|
|
40748
|
-
log({
|
|
40749
|
-
source,
|
|
40750
|
-
level: "debug",
|
|
40751
|
-
message,
|
|
40752
|
-
data
|
|
40753
|
-
});
|
|
40754
|
-
}
|
|
40755
40736
|
class Logger3 {
|
|
40756
40737
|
constructor(source) {
|
|
40738
|
+
this.timers = {};
|
|
40757
40739
|
this.source = source;
|
|
40758
40740
|
}
|
|
40759
|
-
logError(message,
|
|
40760
|
-
|
|
40741
|
+
logError(message, data = null) {
|
|
40742
|
+
log({
|
|
40743
|
+
source: this.source,
|
|
40744
|
+
level: "error",
|
|
40745
|
+
message,
|
|
40746
|
+
data
|
|
40747
|
+
});
|
|
40748
|
+
}
|
|
40749
|
+
logWarn(message, data = null) {
|
|
40750
|
+
log({
|
|
40751
|
+
source: this.source,
|
|
40752
|
+
level: "warn",
|
|
40753
|
+
message,
|
|
40754
|
+
data
|
|
40755
|
+
});
|
|
40756
|
+
}
|
|
40757
|
+
logInfo(message, data = null) {
|
|
40758
|
+
log({
|
|
40759
|
+
source: this.source,
|
|
40760
|
+
level: "info",
|
|
40761
|
+
message,
|
|
40762
|
+
data
|
|
40763
|
+
});
|
|
40764
|
+
}
|
|
40765
|
+
logDebug(message, data = null) {
|
|
40766
|
+
log({
|
|
40767
|
+
source: this.source,
|
|
40768
|
+
level: "debug",
|
|
40769
|
+
message,
|
|
40770
|
+
data
|
|
40771
|
+
});
|
|
40772
|
+
}
|
|
40773
|
+
logTimer(timerName, message, data = null) {
|
|
40774
|
+
const duration = this.getTimerDuration(timerName);
|
|
40775
|
+
log({
|
|
40776
|
+
source: this.source,
|
|
40777
|
+
level: "debug",
|
|
40778
|
+
message,
|
|
40779
|
+
data,
|
|
40780
|
+
duration: duration ?? void 0
|
|
40781
|
+
});
|
|
40782
|
+
}
|
|
40783
|
+
clearTimers() {
|
|
40784
|
+
this.timers = {};
|
|
40785
|
+
}
|
|
40786
|
+
timerStart(name2) {
|
|
40787
|
+
this.timers[name2] = [performance.now(), null];
|
|
40761
40788
|
}
|
|
40762
|
-
|
|
40763
|
-
|
|
40789
|
+
timerEnd(name2) {
|
|
40790
|
+
const timer = this.timers[name2];
|
|
40791
|
+
if (timer && timer[1] === null) {
|
|
40792
|
+
timer[1] = performance.now();
|
|
40793
|
+
}
|
|
40764
40794
|
}
|
|
40765
|
-
|
|
40766
|
-
|
|
40795
|
+
getTimers() {
|
|
40796
|
+
const result = {};
|
|
40797
|
+
for (const name2 in this.timers) {
|
|
40798
|
+
result[name2] = this.getTimerDuration(name2);
|
|
40799
|
+
}
|
|
40800
|
+
return result;
|
|
40767
40801
|
}
|
|
40768
|
-
|
|
40769
|
-
|
|
40802
|
+
getTimerDuration(name2) {
|
|
40803
|
+
const timer = this.timers[name2];
|
|
40804
|
+
if (timer && timer[1] !== null) {
|
|
40805
|
+
return timer[1] - timer[0];
|
|
40806
|
+
}
|
|
40807
|
+
return null;
|
|
40808
|
+
}
|
|
40809
|
+
isDebugEnabled() {
|
|
40810
|
+
return isDebugSource(this.source);
|
|
40770
40811
|
}
|
|
40771
40812
|
}
|
|
40772
40813
|
function getLogger(source) {
|
|
@@ -40776,7 +40817,7 @@ const firebaseDateToDayjs = (date) => {
|
|
|
40776
40817
|
return dayjs(date.seconds * 1e3);
|
|
40777
40818
|
};
|
|
40778
40819
|
const LOGIN_TRACKING_PERIOD_SECONDS = 1800;
|
|
40779
|
-
const logger$
|
|
40820
|
+
const logger$5 = getLogger("firebase");
|
|
40780
40821
|
let firebaseApp = null;
|
|
40781
40822
|
class FirestoreManager {
|
|
40782
40823
|
constructor(firestore) {
|
|
@@ -40904,6 +40945,9 @@ class AuthManager {
|
|
|
40904
40945
|
this.listenToUserProfileUnsub = null;
|
|
40905
40946
|
}
|
|
40906
40947
|
if (authUser) {
|
|
40948
|
+
logger$5.logDebug("User logged in:", {
|
|
40949
|
+
uid: authUser.uid
|
|
40950
|
+
});
|
|
40907
40951
|
this.listenToUserProfileUnsub = getFirestoreManager().listenToDoc("users", authUser.uid, (doc2) => {
|
|
40908
40952
|
this.userProfile = doc2;
|
|
40909
40953
|
this.userProfileChangeListeners.forEach((callback) => callback(this.userProfile));
|
|
@@ -40935,7 +40979,9 @@ class AuthManager {
|
|
|
40935
40979
|
await firestore.mergeDocData("user_logging", userLoggingDocId, userLoggingData);
|
|
40936
40980
|
}
|
|
40937
40981
|
} catch (error) {
|
|
40938
|
-
logger$
|
|
40982
|
+
logger$5.logError("Error logging user login activity:", {
|
|
40983
|
+
error
|
|
40984
|
+
});
|
|
40939
40985
|
}
|
|
40940
40986
|
})();
|
|
40941
40987
|
} else {
|
|
@@ -40982,7 +41028,7 @@ async function _init$3() {
|
|
|
40982
41028
|
}
|
|
40983
41029
|
}
|
|
40984
41030
|
const CONTACT_US_LINK = "mailto:info@thefittingroom.tech?subject=Forgot%20Password%20Assistance";
|
|
40985
|
-
const logger$
|
|
41031
|
+
const logger$4 = getLogger("forgot-password");
|
|
40986
41032
|
function ForgotPasswordOverlay({
|
|
40987
41033
|
returnToOverlay
|
|
40988
41034
|
}) {
|
|
@@ -41048,7 +41094,9 @@ function ForgotPasswordOverlay({
|
|
|
41048
41094
|
await authManager2.sendPasswordResetEmail(email2);
|
|
41049
41095
|
setLinkSent(true);
|
|
41050
41096
|
} catch (error) {
|
|
41051
|
-
logger$
|
|
41097
|
+
logger$4.logError("Error sending password reset email:", {
|
|
41098
|
+
error
|
|
41099
|
+
});
|
|
41052
41100
|
}
|
|
41053
41101
|
}
|
|
41054
41102
|
event.preventDefault();
|
|
@@ -41265,7 +41313,7 @@ function TfrTitle() {
|
|
|
41265
41313
|
}));
|
|
41266
41314
|
return /* @__PURE__ */ jsx$1("div", { css: css2.container, children: /* @__PURE__ */ jsx$1(SvgTfrName, { css: css2.nameIcon }) });
|
|
41267
41315
|
}
|
|
41268
|
-
const logger$
|
|
41316
|
+
const logger$3 = getLogger("sign-in");
|
|
41269
41317
|
function SignInOverlay({
|
|
41270
41318
|
returnToOverlay
|
|
41271
41319
|
}) {
|
|
@@ -41339,7 +41387,9 @@ function SignInOverlay({
|
|
|
41339
41387
|
closeOverlay();
|
|
41340
41388
|
}
|
|
41341
41389
|
} catch (error) {
|
|
41342
|
-
logger$
|
|
41390
|
+
logger$3.logError("Login failed:", {
|
|
41391
|
+
error
|
|
41392
|
+
});
|
|
41343
41393
|
setEmailError(" ");
|
|
41344
41394
|
setPasswordError(t("sign-in.login_failed"));
|
|
41345
41395
|
passwordEl.focus();
|
|
@@ -41801,12 +41851,6 @@ async function getSizeRecommendation(styleId) {
|
|
|
41801
41851
|
endpoint: `/v1/styles/${styleId}/recommendation`
|
|
41802
41852
|
});
|
|
41803
41853
|
}
|
|
41804
|
-
function getSizeLabelFromSize(size) {
|
|
41805
|
-
if (size.label) {
|
|
41806
|
-
return size.label;
|
|
41807
|
-
}
|
|
41808
|
-
return size.size_value?.name ?? null;
|
|
41809
|
-
}
|
|
41810
41854
|
async function requestVtoSingle(colorwaySizeAssetId) {
|
|
41811
41855
|
await execApiRequest({
|
|
41812
41856
|
useCache: true,
|
|
@@ -41844,10 +41888,16 @@ async function getStyleGarmentCategoryById(styleGarmentCategoryId) {
|
|
|
41844
41888
|
recordCache[cacheKey] = record;
|
|
41845
41889
|
return record;
|
|
41846
41890
|
}
|
|
41891
|
+
function getSizeLabelFromSize(size) {
|
|
41892
|
+
if (size.label) {
|
|
41893
|
+
return size.label;
|
|
41894
|
+
}
|
|
41895
|
+
return size.size_value?.name ?? null;
|
|
41896
|
+
}
|
|
41847
41897
|
const AVATAR_IMAGE_ASPECT_RATIO = 2 / 3;
|
|
41848
41898
|
const AVATAR_GUTTER_HEIGHT_PX = 100;
|
|
41849
41899
|
const CONTENT_AREA_WIDTH_PX = 550;
|
|
41850
|
-
const logger$
|
|
41900
|
+
const logger$2 = getLogger("overlays/vto-single");
|
|
41851
41901
|
function VtoSingleOverlay() {
|
|
41852
41902
|
const {
|
|
41853
41903
|
brandId
|
|
@@ -41862,6 +41912,8 @@ function VtoSingleOverlay() {
|
|
|
41862
41912
|
const [selectedSizeLabel, setSelectedSizeLabel] = reactExports.useState(null);
|
|
41863
41913
|
const [selectedColorLabel, setSelectedColorLabel] = reactExports.useState(null);
|
|
41864
41914
|
const [modalStyle, setModalStyle] = reactExports.useState({});
|
|
41915
|
+
const fetchedVtoSkus = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
41916
|
+
const readyVtoSkus = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
41865
41917
|
reactExports.useEffect(() => {
|
|
41866
41918
|
if (!userIsLoggedIn) {
|
|
41867
41919
|
openOverlay(OverlayName.LANDING, {
|
|
@@ -41880,6 +41932,10 @@ function VtoSingleOverlay() {
|
|
|
41880
41932
|
reactExports.useEffect(() => {
|
|
41881
41933
|
async function fetchInitialData() {
|
|
41882
41934
|
try {
|
|
41935
|
+
logger$2.clearTimers();
|
|
41936
|
+
logger$2.timerStart("fetchInitialData");
|
|
41937
|
+
logger$2.logDebug("{{ts}} - Starting fetch of initial data");
|
|
41938
|
+
logger$2.timerStart("fetchInitialData_1_getProductData");
|
|
41883
41939
|
const {
|
|
41884
41940
|
currentProduct
|
|
41885
41941
|
} = getStaticData();
|
|
@@ -41891,14 +41947,20 @@ function VtoSingleOverlay() {
|
|
|
41891
41947
|
const {
|
|
41892
41948
|
color: selectedColor
|
|
41893
41949
|
} = await currentProduct.getSelectedOptions();
|
|
41950
|
+
logger$2.timerEnd("fetchInitialData_1_getProductData");
|
|
41951
|
+
logger$2.timerStart("fetchInitialData_2_getStyleData");
|
|
41894
41952
|
const styleRec = await getStyleByExternalId(brandId, currentProduct.externalId);
|
|
41895
41953
|
if (!styleRec) {
|
|
41896
|
-
logger$
|
|
41954
|
+
logger$2.logError(`Style not found for externalId: ${currentProduct.externalId}`);
|
|
41897
41955
|
return;
|
|
41898
41956
|
}
|
|
41899
41957
|
const styleGarmentCategoryRec = await getStyleGarmentCategoryById(styleRec.style_garment_category_id);
|
|
41900
41958
|
const styleCategoryLabel = styleGarmentCategoryRec?.style_category_label ?? null;
|
|
41959
|
+
logger$2.timerEnd("fetchInitialData_2_getStyleData");
|
|
41960
|
+
logger$2.timerStart("fetchInitialData_3_getSizeRecommendation");
|
|
41901
41961
|
const sizeRecommendationRecord = await getSizeRecommendation(styleRec.id);
|
|
41962
|
+
logger$2.timerEnd("fetchInitialData_3_getSizeRecommendation");
|
|
41963
|
+
logger$2.timerStart("fetchInitialData_4_assembleLoadedData");
|
|
41902
41964
|
let productData;
|
|
41903
41965
|
const recommendedSizeLabel = getSizeLabelFromSize(sizeRecommendationRecord.recommended_size) ?? "(unknown)";
|
|
41904
41966
|
{
|
|
@@ -41959,14 +42021,23 @@ function VtoSingleOverlay() {
|
|
|
41959
42021
|
setLoadedProductData(productData);
|
|
41960
42022
|
setSelectedSizeLabel(recommendedSizeLabel);
|
|
41961
42023
|
setSelectedColorLabel(recommendedColorLabel);
|
|
42024
|
+
for (const sku in userProfile?.vto?.[brandId] ?? {}) {
|
|
42025
|
+
fetchedVtoSkus.current.add(sku);
|
|
42026
|
+
readyVtoSkus.current.add(sku);
|
|
42027
|
+
}
|
|
42028
|
+
logger$2.timerEnd("fetchInitialData_4_assembleLoadedData");
|
|
42029
|
+
logger$2.timerEnd("fetchInitialData");
|
|
42030
|
+
logger$2.logTimer("total", "{{ts}} - Completed fetch of initial data", logger$2.getTimers());
|
|
41962
42031
|
} catch (error) {
|
|
41963
|
-
logger$
|
|
42032
|
+
logger$2.logError("Error fetching initial data:", {
|
|
42033
|
+
error
|
|
42034
|
+
});
|
|
41964
42035
|
}
|
|
41965
42036
|
}
|
|
41966
|
-
if (userIsLoggedIn && userHasAvatar) {
|
|
42037
|
+
if (userIsLoggedIn && userHasAvatar && !loadedProductData) {
|
|
41967
42038
|
fetchInitialData();
|
|
41968
42039
|
}
|
|
41969
|
-
}, [userIsLoggedIn, userHasAvatar]);
|
|
42040
|
+
}, [userIsLoggedIn, userHasAvatar, loadedProductData, userProfile]);
|
|
41970
42041
|
const {
|
|
41971
42042
|
sizeColorRecord: selectedColorSizeRecord,
|
|
41972
42043
|
availableColorLabels
|
|
@@ -41991,25 +42062,54 @@ function VtoSingleOverlay() {
|
|
|
41991
42062
|
availableColorLabels: availableColorLabels2
|
|
41992
42063
|
};
|
|
41993
42064
|
}, [loadedProductData, selectedSizeLabel, selectedColorLabel]);
|
|
42065
|
+
const requestVto = reactExports.useCallback((sizeColorRecord) => {
|
|
42066
|
+
if (fetchedVtoSkus.current.has(sizeColorRecord.sku)) {
|
|
42067
|
+
return;
|
|
42068
|
+
}
|
|
42069
|
+
logger$2.timerStart(`requestVto_${sizeColorRecord.sku}`);
|
|
42070
|
+
logger$2.logDebug(`{{ts}} - Requesting VTO for sku: ${sizeColorRecord.sku}`, {
|
|
42071
|
+
sizeColorRecord
|
|
42072
|
+
});
|
|
42073
|
+
fetchedVtoSkus.current.add(sizeColorRecord.sku);
|
|
42074
|
+
requestVtoSingle(sizeColorRecord.colorwaySizeAssetId).catch((error) => {
|
|
42075
|
+
logger$2.logError("Error requesting VTO:", {
|
|
42076
|
+
error,
|
|
42077
|
+
sizeColorRecord
|
|
42078
|
+
});
|
|
42079
|
+
});
|
|
42080
|
+
}, []);
|
|
41994
42081
|
reactExports.useEffect(() => {
|
|
41995
42082
|
if (selectedColorSizeRecord) {
|
|
41996
|
-
|
|
42083
|
+
requestVto(selectedColorSizeRecord);
|
|
41997
42084
|
}
|
|
41998
|
-
}, [selectedColorSizeRecord]);
|
|
42085
|
+
}, [requestVto, selectedColorSizeRecord]);
|
|
41999
42086
|
reactExports.useEffect(() => {
|
|
42000
42087
|
if (!loadedProductData) {
|
|
42001
42088
|
return;
|
|
42002
42089
|
}
|
|
42003
42090
|
for (const sizeRecord of loadedProductData.sizes) {
|
|
42004
42091
|
const sizeColorRecord = sizeRecord.colors.find((c) => c.colorLabel === selectedColorLabel) ?? sizeRecord.colors[0];
|
|
42005
|
-
|
|
42092
|
+
requestVto(sizeColorRecord);
|
|
42006
42093
|
}
|
|
42007
|
-
}, [loadedProductData, selectedColorLabel]);
|
|
42094
|
+
}, [requestVto, loadedProductData, selectedColorLabel]);
|
|
42008
42095
|
const vtoData = reactExports.useMemo(() => {
|
|
42009
42096
|
if (!userProfile || !selectedColorSizeRecord) {
|
|
42010
42097
|
return null;
|
|
42011
42098
|
}
|
|
42012
|
-
const
|
|
42099
|
+
const availableSkuData = userProfile.vto?.[brandId];
|
|
42100
|
+
if (!availableSkuData) {
|
|
42101
|
+
return null;
|
|
42102
|
+
}
|
|
42103
|
+
if (logger$2.isDebugEnabled()) {
|
|
42104
|
+
for (const sku of fetchedVtoSkus.current) {
|
|
42105
|
+
if (!readyVtoSkus.current.has(sku) && availableSkuData[sku]) {
|
|
42106
|
+
readyVtoSkus.current.add(sku);
|
|
42107
|
+
logger$2.timerEnd(`requestVto_${sku}`);
|
|
42108
|
+
logger$2.logTimer(`requestVto_${sku}`, `{{ts}} - VTO data is loaded for sku: ${sku}`);
|
|
42109
|
+
}
|
|
42110
|
+
}
|
|
42111
|
+
}
|
|
42112
|
+
const vtoData2 = availableSkuData[selectedColorSizeRecord.sku];
|
|
42013
42113
|
if (!vtoData2) {
|
|
42014
42114
|
return null;
|
|
42015
42115
|
}
|
|
@@ -42026,7 +42126,9 @@ function VtoSingleOverlay() {
|
|
|
42026
42126
|
closeOverlay();
|
|
42027
42127
|
const authManager2 = getAuthManager();
|
|
42028
42128
|
authManager2.logout().catch((error) => {
|
|
42029
|
-
logger$
|
|
42129
|
+
logger$2.logError("Error during logout:", {
|
|
42130
|
+
error
|
|
42131
|
+
});
|
|
42030
42132
|
});
|
|
42031
42133
|
}, [closeOverlay, openOverlay]);
|
|
42032
42134
|
const handleAddToCartClick = reactExports.useCallback(async () => {
|
|
@@ -42043,7 +42145,9 @@ function VtoSingleOverlay() {
|
|
|
42043
42145
|
color: selectedColorLabel
|
|
42044
42146
|
});
|
|
42045
42147
|
} catch (error) {
|
|
42046
|
-
logger$
|
|
42148
|
+
logger$2.logError("Error adding to cart:", {
|
|
42149
|
+
error
|
|
42150
|
+
});
|
|
42047
42151
|
}
|
|
42048
42152
|
}, [selectedColorLabel, selectedSizeLabel]);
|
|
42049
42153
|
if (!userIsLoggedIn || !userHasAvatar || !loadedProductData || !selectedColorSizeRecord) {
|
|
@@ -42150,34 +42254,6 @@ function MobileLayout({
|
|
|
42150
42254
|
padding: "0 16px 16px 16px",
|
|
42151
42255
|
backgroundColor: "#FFFFFF",
|
|
42152
42256
|
overflowY: "auto"
|
|
42153
|
-
},
|
|
42154
|
-
sizeSelectorContainer: {},
|
|
42155
|
-
colorSelectorContainer: {
|
|
42156
|
-
marginTop: "16px"
|
|
42157
|
-
},
|
|
42158
|
-
itemFitTextContainer: {
|
|
42159
|
-
marginTop: "8px"
|
|
42160
|
-
},
|
|
42161
|
-
itemFitText: {},
|
|
42162
|
-
itemFitDetailsContainer: {
|
|
42163
|
-
marginTop: "8px",
|
|
42164
|
-
width: "70%"
|
|
42165
|
-
},
|
|
42166
|
-
buttonContainer: {
|
|
42167
|
-
marginTop: "16px",
|
|
42168
|
-
width: "100%"
|
|
42169
|
-
},
|
|
42170
|
-
productNameContainer: {
|
|
42171
|
-
marginTop: "16px"
|
|
42172
|
-
},
|
|
42173
|
-
productNameText: {},
|
|
42174
|
-
priceContainer: {},
|
|
42175
|
-
priceText: {},
|
|
42176
|
-
productDescriptionContainer: {
|
|
42177
|
-
marginTop: "8px"
|
|
42178
|
-
},
|
|
42179
|
-
footerContainer: {
|
|
42180
|
-
marginTop: "24px"
|
|
42181
42257
|
}
|
|
42182
42258
|
}));
|
|
42183
42259
|
reactExports.useEffect(() => {
|
|
@@ -42293,11 +42369,12 @@ function MobileContentExpanded({
|
|
|
42293
42369
|
itemFitText: {},
|
|
42294
42370
|
itemFitDetailsContainer: {
|
|
42295
42371
|
marginTop: "8px",
|
|
42296
|
-
width: "
|
|
42372
|
+
width: "min(100%, 220px)"
|
|
42297
42373
|
},
|
|
42298
42374
|
buttonContainer: {
|
|
42299
42375
|
marginTop: "24px",
|
|
42300
|
-
width: "100%"
|
|
42376
|
+
width: "100%",
|
|
42377
|
+
maxWidth: "375px"
|
|
42301
42378
|
},
|
|
42302
42379
|
productDetailsContainer: {
|
|
42303
42380
|
marginTop: "24px",
|
|
@@ -42337,10 +42414,11 @@ function MobileContentFull({
|
|
|
42337
42414
|
const css2 = useCss((_theme) => ({
|
|
42338
42415
|
sizeRecommendationFrame: {
|
|
42339
42416
|
marginTop: "16px",
|
|
42417
|
+
width: "min(100%, 375px)",
|
|
42340
42418
|
display: "flex",
|
|
42341
42419
|
flexDirection: "column",
|
|
42342
42420
|
border: "1px solid rgba(33, 32, 31, 0.2)",
|
|
42343
|
-
padding: "16px
|
|
42421
|
+
padding: "16px",
|
|
42344
42422
|
justifyContent: "center",
|
|
42345
42423
|
alignItems: "center"
|
|
42346
42424
|
},
|
|
@@ -42359,14 +42437,15 @@ function MobileContentFull({
|
|
|
42359
42437
|
itemFitText: {},
|
|
42360
42438
|
itemFitDetailsContainer: {
|
|
42361
42439
|
marginTop: "8px",
|
|
42362
|
-
width: "100
|
|
42440
|
+
width: "min(100%, 220px)"
|
|
42363
42441
|
},
|
|
42364
42442
|
fitChartContainer: {
|
|
42365
42443
|
marginTop: "16px"
|
|
42366
42444
|
},
|
|
42367
42445
|
buttonContainer: {
|
|
42368
42446
|
marginTop: "16px",
|
|
42369
|
-
width: "100%"
|
|
42447
|
+
width: "100%",
|
|
42448
|
+
maxWidth: "375px"
|
|
42370
42449
|
},
|
|
42371
42450
|
productDetailsContainer: {
|
|
42372
42451
|
marginTop: "24px",
|
|
@@ -43039,7 +43118,7 @@ function useSizeRecommendation(load) {
|
|
|
43039
43118
|
error
|
|
43040
43119
|
};
|
|
43041
43120
|
}
|
|
43042
|
-
const logger = getLogger("size-rec");
|
|
43121
|
+
const logger$1 = getLogger("size-rec");
|
|
43043
43122
|
function SizeRecWidget({}) {
|
|
43044
43123
|
const openOverlay = useMainStore((state) => state.openOverlay);
|
|
43045
43124
|
const openedOverlays = useMainStore((state) => state.openedOverlays);
|
|
@@ -43050,7 +43129,9 @@ function SizeRecWidget({}) {
|
|
|
43050
43129
|
} = useSizeRecommendation(hasOpenedVtoSingleOverlay);
|
|
43051
43130
|
reactExports.useEffect(() => {
|
|
43052
43131
|
if (sizeRecommendationError) {
|
|
43053
|
-
logger.logError("Error loading size recommendation:",
|
|
43132
|
+
logger$1.logError("Error loading size recommendation:", {
|
|
43133
|
+
error: sizeRecommendationError
|
|
43134
|
+
});
|
|
43054
43135
|
}
|
|
43055
43136
|
}, [sizeRecommendationError]);
|
|
43056
43137
|
const handleLinkClick = reactExports.useCallback(() => {
|
|
@@ -43067,6 +43148,7 @@ function SizeRecWidget({}) {
|
|
|
43067
43148
|
size: sizeLabel
|
|
43068
43149
|
} });
|
|
43069
43150
|
}
|
|
43151
|
+
const logger = getLogger("widgets/vto-button");
|
|
43070
43152
|
function VtoButtonWidget({}) {
|
|
43071
43153
|
const openOverlay = useMainStore((state) => state.openOverlay);
|
|
43072
43154
|
const css2 = useCss((theme) => ({
|
|
@@ -43096,6 +43178,7 @@ function VtoButtonWidget({}) {
|
|
|
43096
43178
|
}
|
|
43097
43179
|
}));
|
|
43098
43180
|
const openVto = () => {
|
|
43181
|
+
logger.logDebug("{{ts}} - Opening VTO overlay");
|
|
43099
43182
|
openOverlay(OverlayName.VTO_SINGLE);
|
|
43100
43183
|
};
|
|
43101
43184
|
return /* @__PURE__ */ jsxs("button", { type: "button", onClick: openVto, css: css2.button, children: [
|
|
@@ -43296,9 +43379,9 @@ const SHARED_CONFIG = {
|
|
|
43296
43379
|
appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
|
|
43297
43380
|
},
|
|
43298
43381
|
build: {
|
|
43299
|
-
version: `${"5.0.
|
|
43300
|
-
commitHash: `${"
|
|
43301
|
-
date: `${"2026-
|
|
43382
|
+
version: `${"5.0.9"}`,
|
|
43383
|
+
commitHash: `${"c1adffa"}`,
|
|
43384
|
+
date: `${"2026-02-01T12:11:06.704Z"}`
|
|
43302
43385
|
}
|
|
43303
43386
|
};
|
|
43304
43387
|
const CONFIGS = {
|
|
@@ -43380,7 +43463,9 @@ async function init(initParams) {
|
|
|
43380
43463
|
throw new Error(`Invalid environment "${environment}"`);
|
|
43381
43464
|
}
|
|
43382
43465
|
_init$4(debug);
|
|
43383
|
-
logger2.logDebug("
|
|
43466
|
+
logger2.logDebug("Starting SDK initialization:", {
|
|
43467
|
+
initParams
|
|
43468
|
+
});
|
|
43384
43469
|
const config = getConfig(environment);
|
|
43385
43470
|
if (lang) {
|
|
43386
43471
|
await instance.changeLanguage(lang);
|
|
@@ -43418,14 +43503,17 @@ async function init(initParams) {
|
|
|
43418
43503
|
logger2.logDebug("SDK initialized", config.build);
|
|
43419
43504
|
return true;
|
|
43420
43505
|
} catch (error) {
|
|
43421
|
-
logger2.logError("SDK initialization failed:",
|
|
43506
|
+
logger2.logError("SDK initialization failed:", {
|
|
43507
|
+
error
|
|
43508
|
+
});
|
|
43422
43509
|
return false;
|
|
43423
43510
|
}
|
|
43424
43511
|
}
|
|
43425
43512
|
async function logout() {
|
|
43426
43513
|
const authManager2 = getAuthManager();
|
|
43427
43514
|
await authManager2.logout();
|
|
43428
|
-
|
|
43515
|
+
const logger2 = getLogger("logout");
|
|
43516
|
+
logger2.logInfo("User logged out");
|
|
43429
43517
|
}
|
|
43430
43518
|
const TFR = {
|
|
43431
43519
|
init,
|