@neurodyn/react-ai-try-on 0.0.1 → 0.0.3
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 +7 -3
- package/dist/index.js +95 -29
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import { JSX } from 'react/jsx-runtime';
|
|
3
3
|
import * as React_2 from 'react';
|
|
4
4
|
|
|
5
|
-
export declare function AiTryOnDialog({ defaultOpen, language, onOpenChange, open, productImageSrc, productName, productType, productUrl, apiKey, ...props }: AiTryOnDialogProps): JSX.Element;
|
|
5
|
+
export declare function AiTryOnDialog({ defaultOpen, language, onOpenChange, open, productImageSrc, productName, productPrice, productType, productUrl, apiKey, ...props }: AiTryOnDialogProps): JSX.Element;
|
|
6
6
|
|
|
7
7
|
declare interface AiTryOnDialogOwnProps extends Omit<DialogProps, 'children' | 'modal'> {
|
|
8
8
|
/** UI language override. */
|
|
@@ -11,6 +11,8 @@ declare interface AiTryOnDialogOwnProps extends Omit<DialogProps, 'children' | '
|
|
|
11
11
|
productImageSrc: string;
|
|
12
12
|
/** Product name for product preview alt text and product page CTA. */
|
|
13
13
|
productName: string;
|
|
14
|
+
/** Optional already-formatted product price shown in Add-to-Cart CTAs. */
|
|
15
|
+
productPrice?: string;
|
|
14
16
|
/** Canonical product category sent unchanged to AI try-on generation. */
|
|
15
17
|
productType: ProductType;
|
|
16
18
|
/** Product page URL opened from the result product CTA. */
|
|
@@ -115,7 +117,8 @@ declare const resources: {
|
|
|
115
117
|
readonly resultReset: "Save";
|
|
116
118
|
readonly resultShare: "Share";
|
|
117
119
|
readonly resultTitle: "Here's how it looks on you";
|
|
118
|
-
readonly resultTryAnother: "Add To Cart
|
|
120
|
+
readonly resultTryAnother: "Add To Cart";
|
|
121
|
+
readonly resultTryAnotherWithPrice: "Add To Cart – {{price}}";
|
|
119
122
|
readonly share: "Share";
|
|
120
123
|
readonly startHistory: "View previous results";
|
|
121
124
|
readonly startTitle: "Want to see it on you?";
|
|
@@ -226,7 +229,8 @@ declare const resources: {
|
|
|
226
229
|
readonly resultReset: "Сохранить";
|
|
227
230
|
readonly resultShare: "Поделиться";
|
|
228
231
|
readonly resultTitle: "Вот как это выглядит на вас";
|
|
229
|
-
readonly resultTryAnother: "Add To Cart
|
|
232
|
+
readonly resultTryAnother: "Add To Cart";
|
|
233
|
+
readonly resultTryAnotherWithPrice: "Add To Cart – {{price}}";
|
|
230
234
|
readonly share: "Поделиться";
|
|
231
235
|
readonly startHistory: "Смотреть прошлые результаты";
|
|
232
236
|
readonly startTitle: "Хотите увидеть это на себе?";
|
package/dist/index.js
CHANGED
|
@@ -1047,6 +1047,10 @@ var __webpack_modules__ = {
|
|
|
1047
1047
|
width: 56px;
|
|
1048
1048
|
}
|
|
1049
1049
|
|
|
1050
|
+
.w-\\[90\\%\\] {
|
|
1051
|
+
width: 90%;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1050
1054
|
.w-\\[340px\\] {
|
|
1051
1055
|
width: 340px;
|
|
1052
1056
|
}
|
|
@@ -10222,7 +10226,8 @@ const ns1 = {
|
|
|
10222
10226
|
resultReset: 'Save',
|
|
10223
10227
|
resultShare: 'Share',
|
|
10224
10228
|
resultTitle: 'Here\'s how it looks on you',
|
|
10225
|
-
resultTryAnother: 'Add To Cart
|
|
10229
|
+
resultTryAnother: 'Add To Cart',
|
|
10230
|
+
resultTryAnotherWithPrice: 'Add To Cart – {{price}}',
|
|
10226
10231
|
share: 'Share',
|
|
10227
10232
|
startHistory: 'View previous results',
|
|
10228
10233
|
startTitle: 'Want to see it on you?',
|
|
@@ -10331,7 +10336,8 @@ const ru_ns1 = {
|
|
|
10331
10336
|
resultReset: 'Сохранить',
|
|
10332
10337
|
resultShare: 'Поделиться',
|
|
10333
10338
|
resultTitle: 'Вот как это выглядит на вас',
|
|
10334
|
-
resultTryAnother: 'Add To Cart
|
|
10339
|
+
resultTryAnother: 'Add To Cart',
|
|
10340
|
+
resultTryAnotherWithPrice: 'Add To Cart – {{price}}',
|
|
10335
10341
|
share: 'Поделиться',
|
|
10336
10342
|
startHistory: 'Смотреть прошлые результаты',
|
|
10337
10343
|
startTitle: 'Хотите увидеть это на себе?',
|
|
@@ -18079,21 +18085,30 @@ function ProductThumbnail({ className, imageSrc, name }) {
|
|
|
18079
18085
|
});
|
|
18080
18086
|
}
|
|
18081
18087
|
function GuidanceCard({ good, imageSrc, label }) {
|
|
18082
|
-
return /*#__PURE__*/ jsxs("
|
|
18083
|
-
className: "
|
|
18088
|
+
return /*#__PURE__*/ jsxs("figure", {
|
|
18089
|
+
className: "flex min-w-0 flex-col items-start gap-2",
|
|
18084
18090
|
children: [
|
|
18085
|
-
/*#__PURE__*/
|
|
18086
|
-
|
|
18087
|
-
|
|
18088
|
-
|
|
18091
|
+
/*#__PURE__*/ jsxs("div", {
|
|
18092
|
+
className: "relative aspect-square w-full overflow-hidden rounded-xl border border-border-light bg-background-base",
|
|
18093
|
+
children: [
|
|
18094
|
+
/*#__PURE__*/ jsx_runtime_jsx("img", {
|
|
18095
|
+
alt: label,
|
|
18096
|
+
className: "size-full object-cover",
|
|
18097
|
+
src: imageSrc
|
|
18098
|
+
}),
|
|
18099
|
+
/*#__PURE__*/ jsx_runtime_jsx("span", {
|
|
18100
|
+
className: utils_cn('absolute right-2 top-2 flex size-7 items-center justify-center rounded-full', good ? 'bg-background-green' : 'bg-background-red'),
|
|
18101
|
+
children: good ? /*#__PURE__*/ jsx_runtime_jsx(CheckDone, {
|
|
18102
|
+
className: "size-5 text-background-containers"
|
|
18103
|
+
}) : /*#__PURE__*/ jsx_runtime_jsx(close_Close, {
|
|
18104
|
+
className: "size-5 text-background-containers"
|
|
18105
|
+
})
|
|
18106
|
+
})
|
|
18107
|
+
]
|
|
18089
18108
|
}),
|
|
18090
|
-
/*#__PURE__*/ jsx_runtime_jsx("
|
|
18091
|
-
className:
|
|
18092
|
-
children:
|
|
18093
|
-
className: "size-5 text-background-containers"
|
|
18094
|
-
}) : /*#__PURE__*/ jsx_runtime_jsx(close_Close, {
|
|
18095
|
-
className: "size-5 text-background-containers"
|
|
18096
|
-
})
|
|
18109
|
+
/*#__PURE__*/ jsx_runtime_jsx("figcaption", {
|
|
18110
|
+
className: "w-[90%] break-words text-xs font-medium leading-[1.6] tracking-[0.02em] text-text-base",
|
|
18111
|
+
children: label
|
|
18097
18112
|
})
|
|
18098
18113
|
]
|
|
18099
18114
|
});
|
|
@@ -18166,9 +18181,13 @@ function ResultImagePanel({ className, onOpenComparison, productLabel, productUr
|
|
|
18166
18181
|
});
|
|
18167
18182
|
}
|
|
18168
18183
|
const COMPARISON_DIALOG_BACKGROUND_CLASS_NAME = 'bg-[#212124E5]';
|
|
18169
|
-
function ComparisonDialog({ onAddToCart, onClose, onDeleteResult, onSaveResult, onShareResult, portalContainer, productName, productUrl, result }) {
|
|
18184
|
+
function ComparisonDialog({ onAddToCart, onClose, onDeleteResult, onSaveResult, onShareResult, portalContainer, productName, productPrice, productUrl, result }) {
|
|
18170
18185
|
const { t } = useTranslation();
|
|
18171
18186
|
const productLabel = productName ?? t('resultProductLink');
|
|
18187
|
+
const normalizedProductPrice = normalizeProductPrice(productPrice);
|
|
18188
|
+
const addToCartLabel = normalizedProductPrice ? t('resultTryAnotherWithPrice', {
|
|
18189
|
+
price: normalizedProductPrice
|
|
18190
|
+
}) : t('resultTryAnother');
|
|
18172
18191
|
function handleDelete() {
|
|
18173
18192
|
onDeleteResult();
|
|
18174
18193
|
}
|
|
@@ -18293,7 +18312,7 @@ function ComparisonDialog({ onAddToCart, onClose, onDeleteResult, onSaveResult,
|
|
|
18293
18312
|
}),
|
|
18294
18313
|
/*#__PURE__*/ jsx_runtime_jsx("span", {
|
|
18295
18314
|
className: "truncate",
|
|
18296
|
-
children:
|
|
18315
|
+
children: addToCartLabel
|
|
18297
18316
|
})
|
|
18298
18317
|
]
|
|
18299
18318
|
}),
|
|
@@ -18334,6 +18353,10 @@ function ComparisonDialog({ onAddToCart, onClose, onDeleteResult, onSaveResult,
|
|
|
18334
18353
|
})
|
|
18335
18354
|
});
|
|
18336
18355
|
}
|
|
18356
|
+
function normalizeProductPrice(value) {
|
|
18357
|
+
const normalized = value?.trim();
|
|
18358
|
+
return normalized || void 0;
|
|
18359
|
+
}
|
|
18337
18360
|
const badgeVariants = cva('inline-flex w-fit items-center justify-center overflow-hidden rounded-full whitespace-nowrap', {
|
|
18338
18361
|
variants: {
|
|
18339
18362
|
variant: {
|
|
@@ -18518,6 +18541,17 @@ function Vizbl({ className, ...props }) {
|
|
|
18518
18541
|
]
|
|
18519
18542
|
});
|
|
18520
18543
|
}
|
|
18544
|
+
const DEFAULT_LEGAL_LINKS = {
|
|
18545
|
+
privacy: 'https://vizbl.com/legal/privacy-policy',
|
|
18546
|
+
terms: 'https://vizbl.com/legal/terms-of-use'
|
|
18547
|
+
};
|
|
18548
|
+
const RUSSIAN_LEGAL_LINKS = {
|
|
18549
|
+
privacy: 'https://arizo.ru/privacy-policy/',
|
|
18550
|
+
terms: 'https://arizo.ru/terms-of-use/'
|
|
18551
|
+
};
|
|
18552
|
+
function getLegalLinks(language) {
|
|
18553
|
+
return language?.startsWith('ru') ? RUSSIAN_LEGAL_LINKS : DEFAULT_LEGAL_LINKS;
|
|
18554
|
+
}
|
|
18521
18555
|
import bag_bad_cropped_namespaceObject from "./static/image/bag-bad-cropped.webp";
|
|
18522
18556
|
import bag_bad_hands_full_namespaceObject from "./static/image/bag-bad-hands-full.webp";
|
|
18523
18557
|
import bag_good_angle_namespaceObject from "./static/image/bag-good-angle.webp";
|
|
@@ -19145,6 +19179,10 @@ function ErrorScreen({ view }) {
|
|
|
19145
19179
|
}
|
|
19146
19180
|
function ResultScreen({ view }) {
|
|
19147
19181
|
const { t } = useTranslation();
|
|
19182
|
+
const normalizedProductPrice = try_on_screens_normalizeProductPrice(view.productPrice);
|
|
19183
|
+
const addToCartLabel = normalizedProductPrice ? t('resultTryAnotherWithPrice', {
|
|
19184
|
+
price: normalizedProductPrice
|
|
19185
|
+
}) : t('resultTryAnother');
|
|
19148
19186
|
if (view.myFitsOpen) return /*#__PURE__*/ jsx_runtime_jsx("div", {
|
|
19149
19187
|
className: "min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain pb-4",
|
|
19150
19188
|
children: /*#__PURE__*/ jsx_runtime_jsx("div", {
|
|
@@ -19153,6 +19191,7 @@ function ResultScreen({ view }) {
|
|
|
19153
19191
|
compact: index > 0,
|
|
19154
19192
|
onAddToCart: view.addToCart,
|
|
19155
19193
|
productName: historyItem.productName ?? view.productName,
|
|
19194
|
+
productPrice: historyItem.productPrice,
|
|
19156
19195
|
productUrl: historyItem.productUrl ?? view.productUrl,
|
|
19157
19196
|
result: historyItem,
|
|
19158
19197
|
onDeleteResult: view.deleteResult,
|
|
@@ -19188,7 +19227,7 @@ function ResultScreen({ view }) {
|
|
|
19188
19227
|
/*#__PURE__*/ jsx_runtime_jsx(Cart, {
|
|
19189
19228
|
"data-icon": "inline-start"
|
|
19190
19229
|
}),
|
|
19191
|
-
|
|
19230
|
+
addToCartLabel
|
|
19192
19231
|
]
|
|
19193
19232
|
}),
|
|
19194
19233
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -19234,9 +19273,13 @@ function ResultScreen({ view }) {
|
|
|
19234
19273
|
]
|
|
19235
19274
|
});
|
|
19236
19275
|
}
|
|
19237
|
-
function ResultFitCard({ compact = false, onAddToCart, onDeleteResult, onOpenComparison, onSaveResult, onShareResult, productName, productUrl, result }) {
|
|
19276
|
+
function ResultFitCard({ compact = false, onAddToCart, onDeleteResult, onOpenComparison, onSaveResult, onShareResult, productName, productPrice, productUrl, result }) {
|
|
19238
19277
|
const { t } = useTranslation();
|
|
19239
19278
|
const productLabel = productName ?? t('resultProductLink');
|
|
19279
|
+
const normalizedProductPrice = try_on_screens_normalizeProductPrice(productPrice);
|
|
19280
|
+
const addToCartLabel = normalizedProductPrice ? t('resultTryAnotherWithPrice', {
|
|
19281
|
+
price: normalizedProductPrice
|
|
19282
|
+
}) : t('resultTryAnother');
|
|
19240
19283
|
return /*#__PURE__*/ jsxs("div", {
|
|
19241
19284
|
className: "flex flex-col gap-4",
|
|
19242
19285
|
children: [
|
|
@@ -19262,7 +19305,7 @@ function ResultFitCard({ compact = false, onAddToCart, onDeleteResult, onOpenCom
|
|
|
19262
19305
|
}),
|
|
19263
19306
|
/*#__PURE__*/ jsx_runtime_jsx("span", {
|
|
19264
19307
|
className: "truncate",
|
|
19265
|
-
children:
|
|
19308
|
+
children: addToCartLabel
|
|
19266
19309
|
})
|
|
19267
19310
|
]
|
|
19268
19311
|
}),
|
|
@@ -19342,7 +19385,8 @@ function ActionStack({ children, className }) {
|
|
|
19342
19385
|
});
|
|
19343
19386
|
}
|
|
19344
19387
|
function TermsCopy({ className }) {
|
|
19345
|
-
const { t } = useTranslation();
|
|
19388
|
+
const { i18n, t } = useTranslation();
|
|
19389
|
+
const legalLinks = getLegalLinks(i18n.resolvedLanguage ?? i18n.language);
|
|
19346
19390
|
return /*#__PURE__*/ jsxs("p", {
|
|
19347
19391
|
className: utils_cn('pt-1 text-center text-xs font-medium text-text-base', className),
|
|
19348
19392
|
children: [
|
|
@@ -19350,7 +19394,7 @@ function TermsCopy({ className }) {
|
|
|
19350
19394
|
' ',
|
|
19351
19395
|
/*#__PURE__*/ jsx_runtime_jsx("a", {
|
|
19352
19396
|
className: "underline underline-offset-2",
|
|
19353
|
-
href:
|
|
19397
|
+
href: legalLinks.terms,
|
|
19354
19398
|
rel: "noopener noreferrer",
|
|
19355
19399
|
target: "_blank",
|
|
19356
19400
|
children: t('termsLink')
|
|
@@ -19360,7 +19404,7 @@ function TermsCopy({ className }) {
|
|
|
19360
19404
|
' ',
|
|
19361
19405
|
/*#__PURE__*/ jsx_runtime_jsx("a", {
|
|
19362
19406
|
className: "underline underline-offset-2",
|
|
19363
|
-
href:
|
|
19407
|
+
href: legalLinks.privacy,
|
|
19364
19408
|
rel: "noopener noreferrer",
|
|
19365
19409
|
target: "_blank",
|
|
19366
19410
|
children: t('privacyLink')
|
|
@@ -19368,6 +19412,10 @@ function TermsCopy({ className }) {
|
|
|
19368
19412
|
]
|
|
19369
19413
|
});
|
|
19370
19414
|
}
|
|
19415
|
+
function try_on_screens_normalizeProductPrice(value) {
|
|
19416
|
+
const normalized = value?.trim();
|
|
19417
|
+
return normalized || void 0;
|
|
19418
|
+
}
|
|
19371
19419
|
const REQUIRED_UPLOAD_COUNT = 2;
|
|
19372
19420
|
function createNanoBananaAiTryOnProcessor({ createObjectUrl = defaultCreateObjectUrl, fetch: fetchImpl, productImageSrc, productType, tryOnClient, apiKey }) {
|
|
19373
19421
|
assertProductType(productType);
|
|
@@ -19703,6 +19751,7 @@ async function toStoredResult(result) {
|
|
|
19703
19751
|
id: result.id,
|
|
19704
19752
|
productImageSrc: result.productImageSrc,
|
|
19705
19753
|
productName: result.productName,
|
|
19754
|
+
productPrice: result.productPrice,
|
|
19706
19755
|
productUrl: result.productUrl
|
|
19707
19756
|
};
|
|
19708
19757
|
}
|
|
@@ -19792,7 +19841,7 @@ class AiTryOnSession {
|
|
|
19792
19841
|
createObjectUrl;
|
|
19793
19842
|
tipStore;
|
|
19794
19843
|
state;
|
|
19795
|
-
constructor({ createObjectUrl, productImageSrc, productName, productType, productUrl, tipStore }){
|
|
19844
|
+
constructor({ createObjectUrl, productImageSrc, productName, productPrice, productType, productUrl, tipStore }){
|
|
19796
19845
|
this.createObjectUrl = createObjectUrl;
|
|
19797
19846
|
this.tipStore = tipStore;
|
|
19798
19847
|
this.state = {
|
|
@@ -19805,6 +19854,7 @@ class AiTryOnSession {
|
|
|
19805
19854
|
processingProgress: 0,
|
|
19806
19855
|
productImageSrc,
|
|
19807
19856
|
productName,
|
|
19857
|
+
productPrice: ai_try_on_session_normalizeProductPrice(productPrice),
|
|
19808
19858
|
productType,
|
|
19809
19859
|
productUrl,
|
|
19810
19860
|
result: null,
|
|
@@ -19840,6 +19890,7 @@ class AiTryOnSession {
|
|
|
19840
19890
|
canOpenMyFits: this.state.history.length > 0,
|
|
19841
19891
|
myFitsOpen: this.state.myFitsOpen,
|
|
19842
19892
|
productName: this.state.result?.productName ?? this.state.productName,
|
|
19893
|
+
productPrice: this.state.result ? ai_try_on_session_normalizeProductPrice(this.state.result.productPrice) : this.state.productPrice,
|
|
19843
19894
|
productUrl: this.state.result?.productUrl ?? this.state.productUrl,
|
|
19844
19895
|
result: this.state.result,
|
|
19845
19896
|
resultHistory: getResultHistory(this.state.result, this.state.history),
|
|
@@ -19862,6 +19913,7 @@ class AiTryOnSession {
|
|
|
19862
19913
|
return {
|
|
19863
19914
|
open: this.state.comparisonOpen && null !== result,
|
|
19864
19915
|
productName: result?.productName ?? this.state.productName,
|
|
19916
|
+
productPrice: result ? ai_try_on_session_normalizeProductPrice(result.productPrice) : this.state.productPrice,
|
|
19865
19917
|
productUrl: result?.productUrl ?? this.state.productUrl,
|
|
19866
19918
|
result
|
|
19867
19919
|
};
|
|
@@ -19872,11 +19924,12 @@ class AiTryOnSession {
|
|
|
19872
19924
|
get history() {
|
|
19873
19925
|
return this.state.history;
|
|
19874
19926
|
}
|
|
19875
|
-
updateProduct({ productImageSrc, productName, productType, productUrl }) {
|
|
19927
|
+
updateProduct({ productImageSrc, productName, productPrice, productType, productUrl }) {
|
|
19876
19928
|
this.state = {
|
|
19877
19929
|
...this.state,
|
|
19878
19930
|
productImageSrc,
|
|
19879
19931
|
productName,
|
|
19932
|
+
productPrice: ai_try_on_session_normalizeProductPrice(productPrice),
|
|
19880
19933
|
productType,
|
|
19881
19934
|
productUrl
|
|
19882
19935
|
};
|
|
@@ -20177,6 +20230,7 @@ class AiTryOnSession {
|
|
|
20177
20230
|
return {
|
|
20178
20231
|
productImageSrc: this.state.productImageSrc,
|
|
20179
20232
|
productName: this.state.productName,
|
|
20233
|
+
productPrice: this.state.productPrice,
|
|
20180
20234
|
productUrl: this.state.productUrl
|
|
20181
20235
|
};
|
|
20182
20236
|
}
|
|
@@ -20195,10 +20249,15 @@ function createAiTryOnHistoryItem(result, metadata, createdAt = Date.now()) {
|
|
|
20195
20249
|
return {
|
|
20196
20250
|
...result,
|
|
20197
20251
|
...metadata,
|
|
20252
|
+
productPrice: ai_try_on_session_normalizeProductPrice(metadata.productPrice),
|
|
20198
20253
|
createdAt,
|
|
20199
20254
|
id: `${result.before.id}-result-${createdAt}`
|
|
20200
20255
|
};
|
|
20201
20256
|
}
|
|
20257
|
+
function ai_try_on_session_normalizeProductPrice(value) {
|
|
20258
|
+
const normalized = value?.trim();
|
|
20259
|
+
return normalized || void 0;
|
|
20260
|
+
}
|
|
20202
20261
|
function getResultHistory(result, history) {
|
|
20203
20262
|
if (!result) return [];
|
|
20204
20263
|
const results = [
|
|
@@ -20310,6 +20369,7 @@ function reviveStoredResult(result, createObjectUrl) {
|
|
|
20310
20369
|
id: result.id,
|
|
20311
20370
|
productImageSrc: result.productImageSrc,
|
|
20312
20371
|
productName: result.productName,
|
|
20372
|
+
productPrice: result.productPrice,
|
|
20313
20373
|
productUrl: result.productUrl
|
|
20314
20374
|
};
|
|
20315
20375
|
}
|
|
@@ -20364,7 +20424,7 @@ function collectPhotoObjectUrl(photo) {
|
|
|
20364
20424
|
photo.src
|
|
20365
20425
|
] : null;
|
|
20366
20426
|
}
|
|
20367
|
-
function useAiTryOnSession({ historyStore = indexedDbAiTryOnHistoryStore, objectUrls = browserAiTryOnObjectUrls, onRequestClose, onRequestFileInput, processPhoto, productImageSrc, productName, productType, productUrl, tryOnClient, resultActions = browserAiTryOnResultActions, tipStore = browserAiTryOnTipStore }) {
|
|
20427
|
+
function useAiTryOnSession({ historyStore = indexedDbAiTryOnHistoryStore, objectUrls = browserAiTryOnObjectUrls, onRequestClose, onRequestFileInput, processPhoto, productImageSrc, productName, productPrice, productType, productUrl, tryOnClient, resultActions = browserAiTryOnResultActions, tipStore = browserAiTryOnTipStore }) {
|
|
20368
20428
|
const [, rerender] = (0, __rspack_external_react.useReducer)((value)=>value + 1, 0);
|
|
20369
20429
|
const trackedObjectUrls = (0, __rspack_external_react.useRef)(new Set());
|
|
20370
20430
|
const createTrackedObjectUrl = (0, __rspack_external_react.useCallback)((blob)=>{
|
|
@@ -20379,6 +20439,7 @@ function useAiTryOnSession({ historyStore = indexedDbAiTryOnHistoryStore, object
|
|
|
20379
20439
|
createObjectUrl: createTrackedObjectUrl,
|
|
20380
20440
|
productImageSrc,
|
|
20381
20441
|
productName,
|
|
20442
|
+
productPrice,
|
|
20382
20443
|
productType,
|
|
20383
20444
|
productUrl,
|
|
20384
20445
|
tipStore
|
|
@@ -20387,6 +20448,7 @@ function useAiTryOnSession({ historyStore = indexedDbAiTryOnHistoryStore, object
|
|
|
20387
20448
|
session.updateProduct({
|
|
20388
20449
|
productImageSrc,
|
|
20389
20450
|
productName,
|
|
20451
|
+
productPrice,
|
|
20390
20452
|
productType,
|
|
20391
20453
|
productUrl
|
|
20392
20454
|
});
|
|
@@ -20578,7 +20640,7 @@ function useAiTryOnSession({ historyStore = indexedDbAiTryOnHistoryStore, object
|
|
|
20578
20640
|
function waitForRemainingProcessingDuration(startedAt) {
|
|
20579
20641
|
return waitForProcessingDuration(getRemainingProcessingDuration(startedAt));
|
|
20580
20642
|
}
|
|
20581
|
-
function AiTryOnRoot({ dialogPortalContainer, language, onClose, processPhoto, productImageSrc, productName, productType, productUrl, tryOnClient: providedTryOnClient, apiKey, showDialogCloseButton = false }) {
|
|
20643
|
+
function AiTryOnRoot({ dialogPortalContainer, language, onClose, processPhoto, productImageSrc, productName, productPrice, productType, productUrl, tryOnClient: providedTryOnClient, apiKey, showDialogCloseButton = false }) {
|
|
20582
20644
|
assertProductType(productType);
|
|
20583
20645
|
const { i18n, t } = useTranslation();
|
|
20584
20646
|
const fileInputRef = (0, __rspack_external_react.useRef)(null);
|
|
@@ -20601,6 +20663,7 @@ function AiTryOnRoot({ dialogPortalContainer, language, onClose, processPhoto, p
|
|
|
20601
20663
|
processPhoto,
|
|
20602
20664
|
productImageSrc,
|
|
20603
20665
|
productName,
|
|
20666
|
+
productPrice,
|
|
20604
20667
|
productType,
|
|
20605
20668
|
productUrl,
|
|
20606
20669
|
tryOnClient
|
|
@@ -20678,6 +20741,7 @@ function AiTryOnRoot({ dialogPortalContainer, language, onClose, processPhoto, p
|
|
|
20678
20741
|
}, stage),
|
|
20679
20742
|
session.comparison.open && /*#__PURE__*/ jsx_runtime_jsx(ComparisonDialog, {
|
|
20680
20743
|
productName: session.comparison.productName,
|
|
20744
|
+
productPrice: session.comparison.productPrice,
|
|
20681
20745
|
productUrl: session.comparison.productUrl,
|
|
20682
20746
|
portalContainer: dialogPortalContainer ?? void 0,
|
|
20683
20747
|
result: session.comparison.result,
|
|
@@ -20721,7 +20785,7 @@ function getBadgeTone(stage) {
|
|
|
20721
20785
|
configureNodeApiClient({
|
|
20722
20786
|
baseURL: "https://api.neurodyn.ai/"
|
|
20723
20787
|
});
|
|
20724
|
-
function AiTryOnDialog({ defaultOpen = false, language, onOpenChange, open, productImageSrc, productName, productType, productUrl, apiKey, ...props }) {
|
|
20788
|
+
function AiTryOnDialog({ defaultOpen = false, language, onOpenChange, open, productImageSrc, productName, productPrice, productType, productUrl, apiKey, ...props }) {
|
|
20725
20789
|
assertProductType(productType);
|
|
20726
20790
|
const i18n = (0, __rspack_external_react.useMemo)(()=>createAiTryOnI18n(language), [
|
|
20727
20791
|
language
|
|
@@ -20782,6 +20846,7 @@ function AiTryOnDialog({ defaultOpen = false, language, onOpenChange, open, prod
|
|
|
20782
20846
|
portalContainer: themeRoot,
|
|
20783
20847
|
productImageSrc: productImageSrc,
|
|
20784
20848
|
productName: productName,
|
|
20849
|
+
productPrice: productPrice,
|
|
20785
20850
|
productType: productType,
|
|
20786
20851
|
productUrl: productUrl,
|
|
20787
20852
|
tryOnClient: tryOnClient,
|
|
@@ -20796,7 +20861,7 @@ function AiTryOnDialog({ defaultOpen = false, language, onOpenChange, open, prod
|
|
|
20796
20861
|
]
|
|
20797
20862
|
});
|
|
20798
20863
|
}
|
|
20799
|
-
function AiTryOnDialogContent({ language, onRequestClose, portalContainer, productImageSrc, productName, productType, productUrl, tryOnClient, ...props }) {
|
|
20864
|
+
function AiTryOnDialogContent({ language, onRequestClose, portalContainer, productImageSrc, productName, productPrice, productType, productUrl, tryOnClient, ...props }) {
|
|
20800
20865
|
const { t } = useTranslation();
|
|
20801
20866
|
return /*#__PURE__*/ jsx_runtime_jsx(Dialog, {
|
|
20802
20867
|
...props,
|
|
@@ -20825,6 +20890,7 @@ function AiTryOnDialogContent({ language, onRequestClose, portalContainer, produ
|
|
|
20825
20890
|
language: language,
|
|
20826
20891
|
productImageSrc: productImageSrc,
|
|
20827
20892
|
productName: productName,
|
|
20893
|
+
productPrice: productPrice,
|
|
20828
20894
|
productType: productType,
|
|
20829
20895
|
productUrl: productUrl,
|
|
20830
20896
|
tryOnClient: tryOnClient,
|