@primestyleai/tryon 5.6.4 → 5.6.6
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/react/index.js
CHANGED
|
@@ -549,7 +549,8 @@ const STYLES = `
|
|
|
549
549
|
scrollbar-width: thin; scrollbar-color: var(--ps-border-color) transparent;
|
|
550
550
|
flex-shrink: 0;
|
|
551
551
|
}
|
|
552
|
-
.ps-tryon-modal-wide { max-width: 55vw; width: 55vw; height: 70vh; max-height: 70vh; display: flex; flex-direction: column; overflow: visible; }
|
|
552
|
+
.ps-tryon-modal-wide { max-width: 55vw; width: 55vw; height: 70vh; max-height: 70vh; display: flex; flex-direction: column; overflow: visible; transition: height 0.45s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.45s cubic-bezier(0.32, 0.72, 0, 1); }
|
|
553
|
+
.ps-tryon-modal-tall.ps-tryon-modal-wide { height: 88vh; max-height: 88vh; }
|
|
553
554
|
.ps-tryon-modal:has(.ps-tryon-drawer-open) { overflow: hidden; }
|
|
554
555
|
@keyframes ps-slide-up { from { transform: translateY(1.04vw) scale(0.97); opacity: 0; filter: blur(4px); } to { transform: none; opacity: 1; filter: none; } }
|
|
555
556
|
|
|
@@ -3846,6 +3847,10 @@ const STYLES = `
|
|
|
3846
3847
|
display: flex; align-items: center; justify-content: center;
|
|
3847
3848
|
margin-bottom: 12px;
|
|
3848
3849
|
color: var(--ps-text-secondary);
|
|
3850
|
+
overflow: hidden;
|
|
3851
|
+
}
|
|
3852
|
+
.ps-msp-card-photo {
|
|
3853
|
+
width: 100%; height: 100%; object-fit: cover; display: block;
|
|
3849
3854
|
}
|
|
3850
3855
|
.ps-msp-avatar {
|
|
3851
3856
|
position: relative;
|
|
@@ -4110,7 +4115,7 @@ const STYLES = `
|
|
|
4110
4115
|
outline: none;
|
|
4111
4116
|
transition: border-color 0.15s;
|
|
4112
4117
|
}
|
|
4113
|
-
.ps-cpw-input::placeholder { color: var(--ps-
|
|
4118
|
+
.ps-cpw-input::placeholder { color: var(--ps-text-muted); font-weight: 500; opacity: 0.7; }
|
|
4114
4119
|
.ps-cpw-input:focus { border-bottom-color: var(--ps-accent); }
|
|
4115
4120
|
.ps-cpw-input::-webkit-outer-spin-button,
|
|
4116
4121
|
.ps-cpw-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
|
|
@@ -4143,12 +4148,80 @@ const STYLES = `
|
|
|
4143
4148
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
4144
4149
|
gap: 24px;
|
|
4145
4150
|
}
|
|
4151
|
+
|
|
4152
|
+
/* Two-column split: inputs stacked left, photo right */
|
|
4153
|
+
.ps-cpw-split {
|
|
4154
|
+
display: grid;
|
|
4155
|
+
grid-template-columns: 1fr 280px;
|
|
4156
|
+
gap: 28px;
|
|
4157
|
+
align-items: start;
|
|
4158
|
+
}
|
|
4159
|
+
.ps-cpw-split-left {
|
|
4160
|
+
display: flex; flex-direction: column; gap: 22px;
|
|
4161
|
+
min-width: 0;
|
|
4162
|
+
}
|
|
4163
|
+
.ps-cpw-split-right {
|
|
4164
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
4165
|
+
min-width: 0;
|
|
4166
|
+
}
|
|
4146
4167
|
.ps-cpw-error {
|
|
4147
4168
|
font-size: 12px;
|
|
4148
4169
|
color: var(--ps-error-color);
|
|
4149
4170
|
margin-top: -6px;
|
|
4150
4171
|
}
|
|
4151
4172
|
|
|
4173
|
+
/* Optional photo upload (step 1) */
|
|
4174
|
+
.ps-cpw-photo {
|
|
4175
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
4176
|
+
margin-top: 4px;
|
|
4177
|
+
}
|
|
4178
|
+
.ps-cpw-photo-upload {
|
|
4179
|
+
display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
4180
|
+
gap: 6px; padding: 22px;
|
|
4181
|
+
background: var(--ps-bg-secondary);
|
|
4182
|
+
border: 2px dashed var(--ps-border-color);
|
|
4183
|
+
border-radius: 12px;
|
|
4184
|
+
color: var(--ps-text-secondary); cursor: pointer;
|
|
4185
|
+
font-family: inherit;
|
|
4186
|
+
transition: border-color 0.15s, background 0.15s;
|
|
4187
|
+
}
|
|
4188
|
+
.ps-cpw-photo-upload:hover {
|
|
4189
|
+
border-color: var(--ps-accent);
|
|
4190
|
+
background: rgba(33, 84, 239, 0.04);
|
|
4191
|
+
}
|
|
4192
|
+
.ps-cpw-photo-upload:disabled { opacity: 0.5; cursor: wait; }
|
|
4193
|
+
.ps-cpw-photo-upload svg { color: var(--ps-accent); }
|
|
4194
|
+
.ps-cpw-photo-upload-title {
|
|
4195
|
+
font-size: 13px; font-weight: 600;
|
|
4196
|
+
color: var(--ps-text-primary);
|
|
4197
|
+
}
|
|
4198
|
+
.ps-cpw-photo-upload-hint {
|
|
4199
|
+
font-size: 11px; font-weight: 400;
|
|
4200
|
+
color: var(--ps-text-muted);
|
|
4201
|
+
}
|
|
4202
|
+
.ps-cpw-photo-preview {
|
|
4203
|
+
position: relative;
|
|
4204
|
+
width: 100%;
|
|
4205
|
+
border-radius: 12px; overflow: hidden;
|
|
4206
|
+
background: var(--ps-bg-secondary);
|
|
4207
|
+
border: 1px solid var(--ps-border-subtle);
|
|
4208
|
+
aspect-ratio: 3 / 4;
|
|
4209
|
+
display: flex; align-items: center; justify-content: center;
|
|
4210
|
+
}
|
|
4211
|
+
.ps-cpw-photo-preview img {
|
|
4212
|
+
max-width: 100%; max-height: 100%;
|
|
4213
|
+
width: auto; height: 100%;
|
|
4214
|
+
object-fit: contain;
|
|
4215
|
+
}
|
|
4216
|
+
.ps-cpw-photo-remove {
|
|
4217
|
+
position: absolute; top: 8px; right: 8px;
|
|
4218
|
+
width: 28px; height: 28px; border-radius: 50%;
|
|
4219
|
+
background: rgba(0, 0, 0, 0.65); color: #FFFFFF;
|
|
4220
|
+
border: none; cursor: pointer;
|
|
4221
|
+
font-size: 18px; line-height: 1;
|
|
4222
|
+
display: flex; align-items: center; justify-content: center;
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4152
4225
|
/* Step 2 — Silhouette */
|
|
4153
4226
|
.ps-cpw-silhouette {
|
|
4154
4227
|
display: flex; flex-direction: column; gap: 28px;
|
|
@@ -4247,6 +4320,8 @@ const STYLES = `
|
|
|
4247
4320
|
.ps-cpw-progress { min-width: 0; width: 100%; align-items: flex-start; margin-top: 0; }
|
|
4248
4321
|
.ps-cpw-step-title { font-size: 22px; }
|
|
4249
4322
|
.ps-cpw-field-grid { grid-template-columns: 1fr; gap: 18px; }
|
|
4323
|
+
.ps-cpw-split { grid-template-columns: 1fr; gap: 18px; }
|
|
4324
|
+
.ps-cpw-photo-preview { max-width: 220px; }
|
|
4250
4325
|
.ps-cpw-card-row { gap: 8px; }
|
|
4251
4326
|
.ps-cpw-card { padding: 10px 6px 8px; }
|
|
4252
4327
|
.ps-cpw-card-thumb { height: 80px; }
|
|
@@ -4256,6 +4331,264 @@ const STYLES = `
|
|
|
4256
4331
|
.ps-cpw-back-btn { text-align: center; }
|
|
4257
4332
|
}
|
|
4258
4333
|
|
|
4334
|
+
/* ════════════════════════════════════════════════════════════════
|
|
4335
|
+
ProfileMeasurementsView (.ps-pmv-*) — full profile detail with
|
|
4336
|
+
all body measurements, basics, saved sizes history, and actions.
|
|
4337
|
+
════════════════════════════════════════════════════════════════ */
|
|
4338
|
+
.ps-pmv-root {
|
|
4339
|
+
display: flex; flex-direction: column; gap: 24px;
|
|
4340
|
+
padding: 4px 4px 24px;
|
|
4341
|
+
}
|
|
4342
|
+
.ps-pmv-hero {
|
|
4343
|
+
display: flex; align-items: center; gap: 18px;
|
|
4344
|
+
padding-bottom: 18px;
|
|
4345
|
+
border-bottom: 1px solid var(--ps-border-subtle);
|
|
4346
|
+
}
|
|
4347
|
+
.ps-pmv-hero-avatar {
|
|
4348
|
+
width: 76px; height: 76px;
|
|
4349
|
+
border-radius: 50%;
|
|
4350
|
+
background: var(--ps-bg-secondary);
|
|
4351
|
+
border: 2px solid var(--ps-accent);
|
|
4352
|
+
color: var(--ps-accent);
|
|
4353
|
+
display: flex; align-items: center; justify-content: center;
|
|
4354
|
+
overflow: hidden; flex-shrink: 0;
|
|
4355
|
+
}
|
|
4356
|
+
.ps-pmv-hero-avatar img {
|
|
4357
|
+
width: 100%; height: 100%; object-fit: cover;
|
|
4358
|
+
}
|
|
4359
|
+
.ps-pmv-hero-info { flex: 1; min-width: 0; }
|
|
4360
|
+
.ps-pmv-hero-eyebrow {
|
|
4361
|
+
font-size: 10px; font-weight: 700;
|
|
4362
|
+
letter-spacing: 0.16em; text-transform: uppercase;
|
|
4363
|
+
color: var(--ps-accent);
|
|
4364
|
+
margin-bottom: 6px;
|
|
4365
|
+
}
|
|
4366
|
+
.ps-pmv-hero-name {
|
|
4367
|
+
font-size: 28px; font-weight: 700;
|
|
4368
|
+
color: var(--ps-text-primary);
|
|
4369
|
+
margin: 0;
|
|
4370
|
+
letter-spacing: -0.01em;
|
|
4371
|
+
}
|
|
4372
|
+
|
|
4373
|
+
/* Basics row — height / weight / age stats */
|
|
4374
|
+
.ps-pmv-basics {
|
|
4375
|
+
display: grid;
|
|
4376
|
+
grid-template-columns: repeat(3, 1fr);
|
|
4377
|
+
gap: 14px;
|
|
4378
|
+
}
|
|
4379
|
+
.ps-pmv-basic {
|
|
4380
|
+
background: var(--ps-bg-secondary);
|
|
4381
|
+
border: 1px solid var(--ps-border-subtle);
|
|
4382
|
+
border-radius: 10px;
|
|
4383
|
+
padding: 16px 18px;
|
|
4384
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
4385
|
+
}
|
|
4386
|
+
.ps-pmv-basic-label {
|
|
4387
|
+
font-size: 10px; font-weight: 700;
|
|
4388
|
+
letter-spacing: 0.14em; text-transform: uppercase;
|
|
4389
|
+
color: var(--ps-text-muted);
|
|
4390
|
+
}
|
|
4391
|
+
.ps-pmv-basic-value {
|
|
4392
|
+
font-size: 22px; font-weight: 700;
|
|
4393
|
+
color: var(--ps-text-primary);
|
|
4394
|
+
font-feature-settings: "tnum" 1;
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
/* Section blocks */
|
|
4398
|
+
.ps-pmv-section {
|
|
4399
|
+
display: flex; flex-direction: column; gap: 14px;
|
|
4400
|
+
}
|
|
4401
|
+
.ps-pmv-section-head {
|
|
4402
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
4403
|
+
}
|
|
4404
|
+
.ps-pmv-section-title {
|
|
4405
|
+
font-size: 12px; font-weight: 700;
|
|
4406
|
+
letter-spacing: 0.14em; text-transform: uppercase;
|
|
4407
|
+
color: var(--ps-text-primary);
|
|
4408
|
+
}
|
|
4409
|
+
.ps-pmv-section-title-row {
|
|
4410
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
4411
|
+
gap: 12px;
|
|
4412
|
+
}
|
|
4413
|
+
.ps-pmv-loading-pill {
|
|
4414
|
+
display: inline-flex; align-items: center; gap: 8px;
|
|
4415
|
+
padding: 6px 12px;
|
|
4416
|
+
background: rgba(33, 84, 239, 0.08);
|
|
4417
|
+
color: var(--ps-accent);
|
|
4418
|
+
border-radius: 999px;
|
|
4419
|
+
font-size: 10px; font-weight: 700;
|
|
4420
|
+
letter-spacing: 0.1em; text-transform: uppercase;
|
|
4421
|
+
}
|
|
4422
|
+
.ps-pmv-loading-spinner {
|
|
4423
|
+
width: 12px; height: 12px;
|
|
4424
|
+
border: 2px solid rgba(33, 84, 239, 0.25);
|
|
4425
|
+
border-top-color: var(--ps-accent);
|
|
4426
|
+
border-radius: 50%;
|
|
4427
|
+
animation: ps-pmv-spin 0.8s linear infinite;
|
|
4428
|
+
}
|
|
4429
|
+
@keyframes ps-pmv-spin {
|
|
4430
|
+
to { transform: rotate(360deg); }
|
|
4431
|
+
}
|
|
4432
|
+
.ps-pmv-section-sub {
|
|
4433
|
+
font-size: 12px; font-weight: 400;
|
|
4434
|
+
color: var(--ps-text-muted);
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/* Body measurements grid */
|
|
4438
|
+
.ps-pmv-measure-grid {
|
|
4439
|
+
display: grid;
|
|
4440
|
+
grid-template-columns: repeat(4, 1fr);
|
|
4441
|
+
gap: 10px;
|
|
4442
|
+
}
|
|
4443
|
+
.ps-pmv-measure {
|
|
4444
|
+
background: var(--ps-bg-primary);
|
|
4445
|
+
border: 1px solid var(--ps-border-subtle);
|
|
4446
|
+
border-radius: 10px;
|
|
4447
|
+
padding: 12px 14px;
|
|
4448
|
+
display: flex; flex-direction: column; gap: 4px;
|
|
4449
|
+
}
|
|
4450
|
+
.ps-pmv-measure-label {
|
|
4451
|
+
font-size: 9px; font-weight: 700;
|
|
4452
|
+
letter-spacing: 0.12em; text-transform: uppercase;
|
|
4453
|
+
color: var(--ps-text-muted);
|
|
4454
|
+
}
|
|
4455
|
+
.ps-pmv-measure-value {
|
|
4456
|
+
font-size: 18px; font-weight: 700;
|
|
4457
|
+
color: var(--ps-text-primary);
|
|
4458
|
+
font-feature-settings: "tnum" 1;
|
|
4459
|
+
}
|
|
4460
|
+
.ps-pmv-measure-value.ps-loading {
|
|
4461
|
+
color: var(--ps-border-color);
|
|
4462
|
+
animation: ps-pmv-shimmer 1.4s ease-in-out infinite;
|
|
4463
|
+
}
|
|
4464
|
+
.ps-pmv-measure.ps-loading {
|
|
4465
|
+
background: linear-gradient(
|
|
4466
|
+
90deg,
|
|
4467
|
+
var(--ps-bg-primary) 0%,
|
|
4468
|
+
var(--ps-bg-secondary) 50%,
|
|
4469
|
+
var(--ps-bg-primary) 100%
|
|
4470
|
+
);
|
|
4471
|
+
background-size: 200% 100%;
|
|
4472
|
+
animation: ps-pmv-skeleton 1.6s ease-in-out infinite;
|
|
4473
|
+
}
|
|
4474
|
+
@keyframes ps-pmv-shimmer {
|
|
4475
|
+
0%, 100% { opacity: 0.5; }
|
|
4476
|
+
50% { opacity: 1; }
|
|
4477
|
+
}
|
|
4478
|
+
@keyframes ps-pmv-skeleton {
|
|
4479
|
+
0% { background-position: 200% 0; }
|
|
4480
|
+
100% { background-position: -200% 0; }
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
/* Saved sizes history (per-product cache) */
|
|
4484
|
+
.ps-pmv-history {
|
|
4485
|
+
display: flex; flex-direction: column; gap: 8px;
|
|
4486
|
+
}
|
|
4487
|
+
.ps-pmv-history-card {
|
|
4488
|
+
display: flex; align-items: center; gap: 12px;
|
|
4489
|
+
padding: 12px;
|
|
4490
|
+
background: var(--ps-bg-primary);
|
|
4491
|
+
border: 1px solid var(--ps-border-subtle);
|
|
4492
|
+
border-radius: 10px;
|
|
4493
|
+
}
|
|
4494
|
+
.ps-pmv-history-thumb {
|
|
4495
|
+
width: 44px; height: 44px;
|
|
4496
|
+
border-radius: 6px; overflow: hidden;
|
|
4497
|
+
background: var(--ps-bg-secondary);
|
|
4498
|
+
flex-shrink: 0;
|
|
4499
|
+
display: flex; align-items: center; justify-content: center;
|
|
4500
|
+
}
|
|
4501
|
+
.ps-pmv-history-thumb img {
|
|
4502
|
+
max-width: 100%; max-height: 100%; object-fit: contain;
|
|
4503
|
+
}
|
|
4504
|
+
.ps-pmv-history-info {
|
|
4505
|
+
flex: 1; min-width: 0;
|
|
4506
|
+
display: flex; flex-direction: column; gap: 2px;
|
|
4507
|
+
}
|
|
4508
|
+
.ps-pmv-history-name {
|
|
4509
|
+
font-size: 13px; font-weight: 600;
|
|
4510
|
+
color: var(--ps-text-primary);
|
|
4511
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
4512
|
+
}
|
|
4513
|
+
.ps-pmv-history-meta {
|
|
4514
|
+
font-size: 10px;
|
|
4515
|
+
color: var(--ps-text-muted);
|
|
4516
|
+
}
|
|
4517
|
+
.ps-pmv-history-size {
|
|
4518
|
+
font-size: 22px; font-weight: 700;
|
|
4519
|
+
color: var(--ps-accent);
|
|
4520
|
+
font-feature-settings: "tnum" 1;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
/* Actions */
|
|
4524
|
+
.ps-pmv-actions {
|
|
4525
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
4526
|
+
gap: 12px;
|
|
4527
|
+
padding-top: 18px;
|
|
4528
|
+
border-top: 1px solid var(--ps-border-subtle);
|
|
4529
|
+
margin-top: 4px;
|
|
4530
|
+
}
|
|
4531
|
+
.ps-pmv-actions-right {
|
|
4532
|
+
display: flex; align-items: center; gap: 8px;
|
|
4533
|
+
}
|
|
4534
|
+
.ps-pmv-btn-secondary,
|
|
4535
|
+
.ps-pmv-btn-edit,
|
|
4536
|
+
.ps-pmv-btn-delete {
|
|
4537
|
+
background: none; border: 1px solid var(--ps-border-color);
|
|
4538
|
+
border-radius: 6px;
|
|
4539
|
+
padding: 10px 16px;
|
|
4540
|
+
font-family: inherit; font-size: 11px; font-weight: 600;
|
|
4541
|
+
letter-spacing: 0.06em;
|
|
4542
|
+
color: var(--ps-text-secondary);
|
|
4543
|
+
cursor: pointer;
|
|
4544
|
+
transition: border-color 0.15s, color 0.15s;
|
|
4545
|
+
}
|
|
4546
|
+
.ps-pmv-btn-secondary:hover,
|
|
4547
|
+
.ps-pmv-btn-edit:hover {
|
|
4548
|
+
border-color: var(--ps-accent);
|
|
4549
|
+
color: var(--ps-accent);
|
|
4550
|
+
}
|
|
4551
|
+
.ps-pmv-btn-delete:hover {
|
|
4552
|
+
border-color: var(--ps-error-color);
|
|
4553
|
+
color: var(--ps-error-color);
|
|
4554
|
+
}
|
|
4555
|
+
.ps-pmv-btn-primary {
|
|
4556
|
+
background: var(--ps-accent); color: #FFFFFF;
|
|
4557
|
+
border: none; border-radius: 6px;
|
|
4558
|
+
padding: 11px 18px;
|
|
4559
|
+
font-family: inherit; font-size: 11px; font-weight: 700;
|
|
4560
|
+
letter-spacing: 0.12em; text-transform: uppercase;
|
|
4561
|
+
cursor: pointer;
|
|
4562
|
+
transition: opacity 0.15s, transform 0.15s, background 0.2s;
|
|
4563
|
+
box-shadow: 0 4px 14px rgba(33, 84, 239, 0.18);
|
|
4564
|
+
display: inline-flex; align-items: center; gap: 8px;
|
|
4565
|
+
justify-content: center;
|
|
4566
|
+
}
|
|
4567
|
+
.ps-pmv-btn-primary:hover:not(:disabled) { opacity: 0.92; }
|
|
4568
|
+
.ps-pmv-btn-primary:active:not(:disabled) { transform: scale(0.98); }
|
|
4569
|
+
.ps-pmv-btn-primary:disabled {
|
|
4570
|
+
background: var(--ps-text-muted);
|
|
4571
|
+
cursor: not-allowed;
|
|
4572
|
+
box-shadow: none;
|
|
4573
|
+
opacity: 0.65;
|
|
4574
|
+
}
|
|
4575
|
+
.ps-pmv-btn-spinner {
|
|
4576
|
+
width: 12px; height: 12px;
|
|
4577
|
+
border: 2px solid rgba(255, 255, 255, 0.35);
|
|
4578
|
+
border-top-color: #FFFFFF;
|
|
4579
|
+
border-radius: 50%;
|
|
4580
|
+
animation: ps-pmv-spin 0.8s linear infinite;
|
|
4581
|
+
}
|
|
4582
|
+
|
|
4583
|
+
@media (max-width: 768px) {
|
|
4584
|
+
.ps-pmv-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
|
|
4585
|
+
.ps-pmv-hero-name { font-size: 22px; }
|
|
4586
|
+
.ps-pmv-basics { grid-template-columns: 1fr; }
|
|
4587
|
+
.ps-pmv-measure-grid { grid-template-columns: repeat(2, 1fr); }
|
|
4588
|
+
.ps-pmv-actions { flex-direction: column; align-items: stretch; gap: 10px; }
|
|
4589
|
+
.ps-pmv-actions-right { flex-wrap: wrap; }
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4259
4592
|
/* Big product image */
|
|
4260
4593
|
.ps-msd-image {
|
|
4261
4594
|
width: 100%; height: 240px;
|
|
@@ -7361,6 +7694,35 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
|
|
|
7361
7694
|
const [weightVal, setWeightVal] = useState("");
|
|
7362
7695
|
const [ageVal, setAgeVal] = useState("");
|
|
7363
7696
|
const [error, setError] = useState("");
|
|
7697
|
+
const [photoBase64, setPhotoBase64] = useState(null);
|
|
7698
|
+
const [photoUploading, setPhotoUploading] = useState(false);
|
|
7699
|
+
const photoInputRef = useRef(null);
|
|
7700
|
+
const handlePhotoSelect = async (e) => {
|
|
7701
|
+
const file = e.target.files?.[0];
|
|
7702
|
+
if (!file) return;
|
|
7703
|
+
if (!file.type.startsWith("image/")) {
|
|
7704
|
+
setError(t("Please upload an image file"));
|
|
7705
|
+
return;
|
|
7706
|
+
}
|
|
7707
|
+
if (file.size > 10 * 1024 * 1024) {
|
|
7708
|
+
setError(t("Image must be under 10MB"));
|
|
7709
|
+
return;
|
|
7710
|
+
}
|
|
7711
|
+
setPhotoUploading(true);
|
|
7712
|
+
try {
|
|
7713
|
+
const base64 = await compressImage(file);
|
|
7714
|
+
setPhotoBase64(base64);
|
|
7715
|
+
setError("");
|
|
7716
|
+
} catch {
|
|
7717
|
+
setError(t("Failed to process image"));
|
|
7718
|
+
} finally {
|
|
7719
|
+
setPhotoUploading(false);
|
|
7720
|
+
}
|
|
7721
|
+
};
|
|
7722
|
+
const handleRemovePhoto = () => {
|
|
7723
|
+
setPhotoBase64(null);
|
|
7724
|
+
if (photoInputRef.current) photoInputRef.current.value = "";
|
|
7725
|
+
};
|
|
7364
7726
|
const [chestProfile, setChestProfile] = useState(null);
|
|
7365
7727
|
const [midsectionProfile, setMidsectionProfile] = useState(null);
|
|
7366
7728
|
const [seatProfile, setSeatProfile] = useState(null);
|
|
@@ -7411,7 +7773,8 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
|
|
|
7411
7773
|
age: parseFloat(ageVal),
|
|
7412
7774
|
chestProfile: chestProfile || void 0,
|
|
7413
7775
|
midsectionProfile: midsectionProfile || void 0,
|
|
7414
|
-
hipProfile: isWomen ? hipProfile || void 0 : seatProfile || void 0
|
|
7776
|
+
hipProfile: isWomen ? hipProfile || void 0 : seatProfile || void 0,
|
|
7777
|
+
photoBase64: photoBase64 || void 0
|
|
7415
7778
|
};
|
|
7416
7779
|
onSave(data);
|
|
7417
7780
|
};
|
|
@@ -7468,70 +7831,115 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
|
|
|
7468
7831
|
/* @__PURE__ */ jsx("button", { type: "button", className: `ps-cpw-pill${unit === "in" ? " ps-active" : ""}`, onClick: () => setUnit("in"), children: "in" })
|
|
7469
7832
|
] })
|
|
7470
7833
|
] }),
|
|
7471
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-
|
|
7472
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-
|
|
7473
|
-
/* @__PURE__ */ jsxs("
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7834
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-split", children: [
|
|
7835
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-split-left", children: [
|
|
7836
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
|
|
7837
|
+
/* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
|
|
7838
|
+
t("HEIGHT"),
|
|
7839
|
+
" (",
|
|
7840
|
+
unit,
|
|
7841
|
+
")"
|
|
7842
|
+
] }),
|
|
7843
|
+
/* @__PURE__ */ jsx(
|
|
7844
|
+
"input",
|
|
7845
|
+
{
|
|
7846
|
+
type: "number",
|
|
7847
|
+
inputMode: "numeric",
|
|
7848
|
+
className: "ps-cpw-input",
|
|
7849
|
+
value: heightVal,
|
|
7850
|
+
placeholder: unit === "cm" ? t("e.g. 173") : t("e.g. 68 in"),
|
|
7851
|
+
onChange: (e) => {
|
|
7852
|
+
setHeightVal(e.target.value);
|
|
7853
|
+
setError("");
|
|
7854
|
+
}
|
|
7855
|
+
}
|
|
7856
|
+
)
|
|
7478
7857
|
] }),
|
|
7479
|
-
/* @__PURE__ */
|
|
7480
|
-
"
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7858
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
|
|
7859
|
+
/* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
|
|
7860
|
+
t("WEIGHT"),
|
|
7861
|
+
" (",
|
|
7862
|
+
unit === "in" ? "lbs" : "kg",
|
|
7863
|
+
")"
|
|
7864
|
+
] }),
|
|
7865
|
+
/* @__PURE__ */ jsx(
|
|
7866
|
+
"input",
|
|
7867
|
+
{
|
|
7868
|
+
type: "number",
|
|
7869
|
+
inputMode: "numeric",
|
|
7870
|
+
className: "ps-cpw-input",
|
|
7871
|
+
value: weightVal,
|
|
7872
|
+
placeholder: unit === "in" ? t("e.g. 154") : t("e.g. 70"),
|
|
7873
|
+
onChange: (e) => {
|
|
7874
|
+
setWeightVal(e.target.value);
|
|
7875
|
+
setError("");
|
|
7876
|
+
}
|
|
7490
7877
|
}
|
|
7491
|
-
|
|
7492
|
-
)
|
|
7493
|
-
] }),
|
|
7494
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
|
|
7495
|
-
/* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
|
|
7496
|
-
t("WEIGHT"),
|
|
7497
|
-
" (",
|
|
7498
|
-
unit === "in" ? "lbs" : "kg",
|
|
7499
|
-
")"
|
|
7878
|
+
)
|
|
7500
7879
|
] }),
|
|
7501
|
-
/* @__PURE__ */
|
|
7502
|
-
"
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7880
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-field", children: [
|
|
7881
|
+
/* @__PURE__ */ jsxs("label", { className: "ps-cpw-field-label", children: [
|
|
7882
|
+
t("AGE"),
|
|
7883
|
+
" (",
|
|
7884
|
+
t("years"),
|
|
7885
|
+
")"
|
|
7886
|
+
] }),
|
|
7887
|
+
/* @__PURE__ */ jsx(
|
|
7888
|
+
"input",
|
|
7889
|
+
{
|
|
7890
|
+
type: "number",
|
|
7891
|
+
inputMode: "numeric",
|
|
7892
|
+
className: "ps-cpw-input",
|
|
7893
|
+
value: ageVal,
|
|
7894
|
+
placeholder: t("e.g. 30"),
|
|
7895
|
+
onChange: (e) => {
|
|
7896
|
+
setAgeVal(e.target.value);
|
|
7897
|
+
setError("");
|
|
7898
|
+
}
|
|
7512
7899
|
}
|
|
7513
|
-
|
|
7514
|
-
)
|
|
7900
|
+
)
|
|
7901
|
+
] })
|
|
7515
7902
|
] }),
|
|
7516
|
-
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-
|
|
7517
|
-
/* @__PURE__ */
|
|
7518
|
-
t("AGE"),
|
|
7519
|
-
" (",
|
|
7520
|
-
t("years"),
|
|
7521
|
-
")"
|
|
7522
|
-
] }),
|
|
7903
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-cpw-split-right", children: [
|
|
7904
|
+
/* @__PURE__ */ jsx("div", { className: "ps-cpw-field-label", children: t("PROFILE PHOTO (OPTIONAL)") }),
|
|
7523
7905
|
/* @__PURE__ */ jsx(
|
|
7524
7906
|
"input",
|
|
7525
7907
|
{
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7908
|
+
ref: photoInputRef,
|
|
7909
|
+
type: "file",
|
|
7910
|
+
accept: "image/*",
|
|
7911
|
+
onChange: handlePhotoSelect,
|
|
7912
|
+
style: { display: "none" }
|
|
7913
|
+
}
|
|
7914
|
+
),
|
|
7915
|
+
photoBase64 ? /* @__PURE__ */ jsxs("div", { className: "ps-cpw-photo-preview", children: [
|
|
7916
|
+
/* @__PURE__ */ jsx("img", { src: photoBase64, alt: t("Profile photo") }),
|
|
7917
|
+
/* @__PURE__ */ jsx(
|
|
7918
|
+
"button",
|
|
7919
|
+
{
|
|
7920
|
+
type: "button",
|
|
7921
|
+
className: "ps-cpw-photo-remove",
|
|
7922
|
+
onClick: handleRemovePhoto,
|
|
7923
|
+
"aria-label": t("Remove photo"),
|
|
7924
|
+
children: "×"
|
|
7534
7925
|
}
|
|
7926
|
+
)
|
|
7927
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
7928
|
+
"button",
|
|
7929
|
+
{
|
|
7930
|
+
type: "button",
|
|
7931
|
+
className: "ps-cpw-photo-upload",
|
|
7932
|
+
onClick: () => photoInputRef.current?.click(),
|
|
7933
|
+
disabled: photoUploading,
|
|
7934
|
+
children: [
|
|
7935
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "22", height: "22", children: [
|
|
7936
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
7937
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
|
|
7938
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
|
|
7939
|
+
] }),
|
|
7940
|
+
/* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-title", children: photoUploading ? t("Uploading...") : t("Upload a photo") }),
|
|
7941
|
+
/* @__PURE__ */ jsx("span", { className: "ps-cpw-photo-upload-hint", children: t("Helps refine your AI sizing — JPEG, PNG up to 10MB") })
|
|
7942
|
+
]
|
|
7535
7943
|
}
|
|
7536
7944
|
)
|
|
7537
7945
|
] })
|
|
@@ -7593,6 +8001,137 @@ function CreateProfileWizard({ onSave, onCancel, t }) {
|
|
|
7593
8001
|
] })
|
|
7594
8002
|
] });
|
|
7595
8003
|
}
|
|
8004
|
+
const FIELDS_MEN = [
|
|
8005
|
+
{ key: "chest", label: "CHEST" },
|
|
8006
|
+
{ key: "waist", label: "WAIST" },
|
|
8007
|
+
{ key: "hips", label: "HIPS" },
|
|
8008
|
+
{ key: "shoulderWidth", label: "SHOULDER" },
|
|
8009
|
+
{ key: "sleeveLength", label: "SLEEVE" },
|
|
8010
|
+
{ key: "neckCircumference", label: "NECK" },
|
|
8011
|
+
{ key: "inseam", label: "INSEAM" },
|
|
8012
|
+
{ key: "thighCircumference", label: "THIGH" }
|
|
8013
|
+
];
|
|
8014
|
+
const FIELDS_WOMEN = [
|
|
8015
|
+
{ key: "bust", label: "BUST" },
|
|
8016
|
+
{ key: "waist", label: "WAIST" },
|
|
8017
|
+
{ key: "hips", label: "HIPS" },
|
|
8018
|
+
{ key: "shoulderWidth", label: "SHOULDER" },
|
|
8019
|
+
{ key: "sleeveLength", label: "SLEEVE" },
|
|
8020
|
+
{ key: "neckCircumference", label: "NECK" },
|
|
8021
|
+
{ key: "inseam", label: "INSEAM" },
|
|
8022
|
+
{ key: "thighCircumference", label: "THIGH" }
|
|
8023
|
+
];
|
|
8024
|
+
function ProfileMeasurementsView({
|
|
8025
|
+
profile,
|
|
8026
|
+
isActive,
|
|
8027
|
+
onSelect,
|
|
8028
|
+
onEdit,
|
|
8029
|
+
onDelete,
|
|
8030
|
+
onBack,
|
|
8031
|
+
onSave,
|
|
8032
|
+
t
|
|
8033
|
+
}) {
|
|
8034
|
+
const fields = profile.gender === "female" ? FIELDS_WOMEN : FIELDS_MEN;
|
|
8035
|
+
const measurements = profile.measurements || {};
|
|
8036
|
+
const unit = profile.measurementsUnit || "cm";
|
|
8037
|
+
const hasMeasurements = Object.keys(measurements).some((k) => measurements[k] != null);
|
|
8038
|
+
const heightDisplay = (() => {
|
|
8039
|
+
const h = profile.height ?? profile.heightCm;
|
|
8040
|
+
if (!h) return "—";
|
|
8041
|
+
if (profile.heightUnit === "in" || profile.heightUnit === "ft") {
|
|
8042
|
+
const ft = Math.floor(h / 12);
|
|
8043
|
+
const inches = Math.round(h % 12);
|
|
8044
|
+
return `${ft}'${inches}"`;
|
|
8045
|
+
}
|
|
8046
|
+
return `${Math.round(h)} cm`;
|
|
8047
|
+
})();
|
|
8048
|
+
const weightDisplay = (() => {
|
|
8049
|
+
const w = profile.weight ?? profile.weightKg;
|
|
8050
|
+
if (!w) return "—";
|
|
8051
|
+
return `${Math.round(w)} ${profile.weightUnit || "kg"}`;
|
|
8052
|
+
})();
|
|
8053
|
+
const ageDisplay = profile.age ? `${profile.age}` : "—";
|
|
8054
|
+
return /* @__PURE__ */ jsxs("div", { className: "ps-pmv-root", children: [
|
|
8055
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-hero", children: [
|
|
8056
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-hero-avatar", children: profile.photoBase64 ? /* @__PURE__ */ jsx("img", { src: profile.photoBase64, alt: profile.name }) : /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", width: "32", height: "32", children: [
|
|
8057
|
+
/* @__PURE__ */ jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
8058
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
8059
|
+
] }) }),
|
|
8060
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-hero-info", children: [
|
|
8061
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-hero-eyebrow", children: isActive ? t("ACTIVE PROFILE") : profile.gender === "female" ? t("WOMEN'S FIT") : t("MEN'S FIT") }),
|
|
8062
|
+
/* @__PURE__ */ jsx("h2", { className: "ps-pmv-hero-name", children: profile.name })
|
|
8063
|
+
] })
|
|
8064
|
+
] }),
|
|
8065
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-basics", children: [
|
|
8066
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-basic", children: [
|
|
8067
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-label", children: t("HEIGHT") }),
|
|
8068
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-value", children: heightDisplay })
|
|
8069
|
+
] }),
|
|
8070
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-basic", children: [
|
|
8071
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-label", children: t("WEIGHT") }),
|
|
8072
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-value", children: weightDisplay })
|
|
8073
|
+
] }),
|
|
8074
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-basic", children: [
|
|
8075
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-label", children: t("AGE") }),
|
|
8076
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-basic-value", children: ageDisplay })
|
|
8077
|
+
] })
|
|
8078
|
+
] }),
|
|
8079
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-section", children: [
|
|
8080
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-section-head", children: [
|
|
8081
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-section-title-row", children: [
|
|
8082
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-section-title", children: t("BODY MEASUREMENTS") }),
|
|
8083
|
+
!hasMeasurements && /* @__PURE__ */ jsxs("div", { className: "ps-pmv-loading-pill", children: [
|
|
8084
|
+
/* @__PURE__ */ jsx("span", { className: "ps-pmv-loading-spinner" }),
|
|
8085
|
+
/* @__PURE__ */ jsx("span", { children: t("Calculating...") })
|
|
8086
|
+
] })
|
|
8087
|
+
] }),
|
|
8088
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-section-sub", children: hasMeasurements ? t("Calculated from your basics. Used to recommend the perfect size for any product.") : t("Our AI is computing your full body proportions — this usually takes a few seconds.") })
|
|
8089
|
+
] }),
|
|
8090
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-measure-grid", children: fields.map((f) => {
|
|
8091
|
+
const v = measurements[f.key];
|
|
8092
|
+
return /* @__PURE__ */ jsxs("div", { className: `ps-pmv-measure${v == null ? " ps-loading" : ""}`, children: [
|
|
8093
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-measure-label", children: t(f.label) }),
|
|
8094
|
+
/* @__PURE__ */ jsx("div", { className: `ps-pmv-measure-value${v == null ? " ps-loading" : ""}`, children: v != null ? `${Math.round(v * 10) / 10} ${unit}` : "—" })
|
|
8095
|
+
] }, f.key);
|
|
8096
|
+
}) })
|
|
8097
|
+
] }),
|
|
8098
|
+
profile.sizeHistory && profile.sizeHistory.length > 0 && /* @__PURE__ */ jsxs("div", { className: "ps-pmv-section", children: [
|
|
8099
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-section-head", children: [
|
|
8100
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-section-title", children: t("SAVED SIZES") }),
|
|
8101
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-section-sub", children: t("Recommendations from this profile across products") })
|
|
8102
|
+
] }),
|
|
8103
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-history", children: profile.sizeHistory.slice(0, 6).map((entry) => /* @__PURE__ */ jsxs("div", { className: "ps-pmv-history-card", children: [
|
|
8104
|
+
entry.productImage && /* @__PURE__ */ jsx("div", { className: "ps-pmv-history-thumb", children: /* @__PURE__ */ jsx("img", { src: entry.productImage, alt: entry.productTitle }) }),
|
|
8105
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-history-info", children: [
|
|
8106
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-history-name", children: entry.productTitle }),
|
|
8107
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-history-meta", children: new Date(entry.savedAt).toLocaleDateString(void 0, { month: "short", day: "numeric" }) })
|
|
8108
|
+
] }),
|
|
8109
|
+
/* @__PURE__ */ jsx("div", { className: "ps-pmv-history-size", children: entry.recommendedSize })
|
|
8110
|
+
] }, `${entry.productId}-${entry.savedAt}`)) })
|
|
8111
|
+
] }),
|
|
8112
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-actions", children: [
|
|
8113
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: onBack, children: t("Back") }),
|
|
8114
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-pmv-actions-right", children: [
|
|
8115
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-edit", onClick: onEdit, children: t("Edit") }),
|
|
8116
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-delete", onClick: onDelete, children: t("Delete") }),
|
|
8117
|
+
!isActive && /* @__PURE__ */ jsx("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: onSelect, children: t("USE THIS PROFILE") }),
|
|
8118
|
+
/* @__PURE__ */ jsx(
|
|
8119
|
+
"button",
|
|
8120
|
+
{
|
|
8121
|
+
type: "button",
|
|
8122
|
+
className: "ps-pmv-btn-primary",
|
|
8123
|
+
onClick: onSave,
|
|
8124
|
+
disabled: !hasMeasurements,
|
|
8125
|
+
children: hasMeasurements ? t("SAVE") : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8126
|
+
/* @__PURE__ */ jsx("span", { className: "ps-pmv-btn-spinner" }),
|
|
8127
|
+
t("CALCULATING")
|
|
8128
|
+
] })
|
|
8129
|
+
}
|
|
8130
|
+
)
|
|
8131
|
+
] })
|
|
8132
|
+
] })
|
|
8133
|
+
] });
|
|
8134
|
+
}
|
|
7596
8135
|
function ProfileAvatar({ gender }) {
|
|
7597
8136
|
return /* @__PURE__ */ jsxs("div", { className: "ps-msp-avatar", children: [
|
|
7598
8137
|
/* @__PURE__ */ jsx(UserIcon, { size: 28 }),
|
|
@@ -7604,6 +8143,7 @@ function ProfileCard({
|
|
|
7604
8143
|
isActive,
|
|
7605
8144
|
onSelect,
|
|
7606
8145
|
onEdit,
|
|
8146
|
+
onOpenDetail,
|
|
7607
8147
|
t
|
|
7608
8148
|
}) {
|
|
7609
8149
|
const heightDisplay = (() => {
|
|
@@ -7626,40 +8166,49 @@ function ProfileCard({
|
|
|
7626
8166
|
if (!ts) return null;
|
|
7627
8167
|
return new Date(ts).toLocaleDateString(void 0, { month: "short", day: "numeric" });
|
|
7628
8168
|
})();
|
|
7629
|
-
return /* @__PURE__ */ jsxs(
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
/* @__PURE__ */ jsx("
|
|
7640
|
-
/* @__PURE__ */
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
8169
|
+
return /* @__PURE__ */ jsxs(
|
|
8170
|
+
"div",
|
|
8171
|
+
{
|
|
8172
|
+
className: `ps-msp-card${isActive ? " ps-active" : ""}`,
|
|
8173
|
+
onClick: onOpenDetail,
|
|
8174
|
+
role: "button",
|
|
8175
|
+
tabIndex: 0,
|
|
8176
|
+
children: [
|
|
8177
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msp-card-header", children: /* @__PURE__ */ jsx("span", { className: "ps-msp-card-tag", children: isActive ? t("DEFAULT PROFILE") : profile.gender === "female" ? t("WOMEN'S FIT") : t("MEN'S FIT") }) }),
|
|
8178
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msp-card-thumb", children: profile.photoBase64 ? /* @__PURE__ */ jsx("img", { src: profile.photoBase64, alt: profile.name, className: "ps-msp-card-photo" }) : /* @__PURE__ */ jsx(ProfileAvatar, { gender: profile.gender }) }),
|
|
8179
|
+
/* @__PURE__ */ jsx("div", { className: "ps-msp-card-name", children: profile.name }),
|
|
8180
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-card-meta", children: [
|
|
8181
|
+
heightDisplay && /* @__PURE__ */ jsxs("div", { className: "ps-msp-meta-row", children: [
|
|
8182
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-label", children: t("HEIGHT") }),
|
|
8183
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-value", children: heightDisplay })
|
|
8184
|
+
] }),
|
|
8185
|
+
weightDisplay && /* @__PURE__ */ jsxs("div", { className: "ps-msp-meta-row", children: [
|
|
8186
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-label", children: t("WEIGHT") }),
|
|
8187
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-value", children: weightDisplay })
|
|
8188
|
+
] }),
|
|
8189
|
+
updatedDisplay && /* @__PURE__ */ jsxs("div", { className: "ps-msp-meta-row", children: [
|
|
8190
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-label", children: t("LAST UPDATE") }),
|
|
8191
|
+
/* @__PURE__ */ jsx("span", { className: "ps-msp-meta-value", children: updatedDisplay })
|
|
8192
|
+
] })
|
|
8193
|
+
] }),
|
|
8194
|
+
/* @__PURE__ */ jsxs("div", { className: "ps-msp-card-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
8195
|
+
/* @__PURE__ */ jsx(
|
|
8196
|
+
"button",
|
|
8197
|
+
{
|
|
8198
|
+
type: "button",
|
|
8199
|
+
className: `ps-msp-card-select${isActive ? " ps-active" : ""}`,
|
|
8200
|
+
onClick: onSelect,
|
|
8201
|
+
children: isActive ? t("SELECTED") : t("SELECT")
|
|
8202
|
+
}
|
|
8203
|
+
),
|
|
8204
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "ps-msp-card-edit", onClick: onEdit, "aria-label": t("Edit"), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
8205
|
+
/* @__PURE__ */ jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
|
|
8206
|
+
/* @__PURE__ */ jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
|
|
8207
|
+
] }) })
|
|
8208
|
+
] })
|
|
8209
|
+
]
|
|
8210
|
+
}
|
|
8211
|
+
);
|
|
7663
8212
|
}
|
|
7664
8213
|
function CreateProfileCard({ onClick, t }) {
|
|
7665
8214
|
return /* @__PURE__ */ jsxs("button", { type: "button", className: "ps-msp-card ps-msp-card-create", onClick, children: [
|
|
@@ -7701,6 +8250,8 @@ function MySizingProfilesView({
|
|
|
7701
8250
|
t
|
|
7702
8251
|
}) {
|
|
7703
8252
|
const [creating, setCreating] = useState(false);
|
|
8253
|
+
const [viewingId, setViewingId] = useState(null);
|
|
8254
|
+
const viewingProfile = viewingId ? profiles.find((p) => p.id === viewingId) || null : null;
|
|
7704
8255
|
const allHistory = useMemo(() => {
|
|
7705
8256
|
const items = [];
|
|
7706
8257
|
for (const p of profiles) {
|
|
@@ -7714,12 +8265,51 @@ function MySizingProfilesView({
|
|
|
7714
8265
|
onSaveNewProfile(data);
|
|
7715
8266
|
setCreating(false);
|
|
7716
8267
|
};
|
|
7717
|
-
return /* @__PURE__ */ jsx("div", { className: "ps-msp-root", children: /* @__PURE__ */ jsx("div", { className: "ps-msp-scroll", children:
|
|
8268
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-msp-root", children: /* @__PURE__ */ jsx("div", { className: "ps-msp-scroll", children: viewingProfile ? (
|
|
8269
|
+
/* ── Profile detail view (full body measurements) ── */
|
|
8270
|
+
/* @__PURE__ */ jsx(
|
|
8271
|
+
ProfileMeasurementsView,
|
|
8272
|
+
{
|
|
8273
|
+
profile: viewingProfile,
|
|
8274
|
+
isActive: viewingProfile.id === activeProfileId,
|
|
8275
|
+
onSelect: () => {
|
|
8276
|
+
onSelectProfile(viewingProfile.id);
|
|
8277
|
+
setViewingId(null);
|
|
8278
|
+
},
|
|
8279
|
+
onEdit: () => {
|
|
8280
|
+
onEditProfile(viewingProfile);
|
|
8281
|
+
},
|
|
8282
|
+
onDelete: () => {
|
|
8283
|
+
onDeleteProfile(viewingProfile.id);
|
|
8284
|
+
setViewingId(null);
|
|
8285
|
+
},
|
|
8286
|
+
onBack: () => setViewingId(null),
|
|
8287
|
+
onSave: () => setViewingId(null),
|
|
8288
|
+
t
|
|
8289
|
+
}
|
|
8290
|
+
)
|
|
8291
|
+
) : creating ? (
|
|
7718
8292
|
/* ── Multi-step create wizard (Identity → Silhouette) ── */
|
|
7719
8293
|
/* @__PURE__ */ jsx(
|
|
7720
8294
|
CreateProfileWizard,
|
|
7721
8295
|
{
|
|
7722
|
-
onSave:
|
|
8296
|
+
onSave: (data) => {
|
|
8297
|
+
handleSaveNewProfile(data);
|
|
8298
|
+
setTimeout(() => {
|
|
8299
|
+
const latest = typeof window !== "undefined" ? (() => {
|
|
8300
|
+
try {
|
|
8301
|
+
const raw = localStorage.getItem("primestyle_profiles");
|
|
8302
|
+
if (raw) {
|
|
8303
|
+
const list = JSON.parse(raw);
|
|
8304
|
+
if (list.length > 0) return list[0].id;
|
|
8305
|
+
}
|
|
8306
|
+
} catch {
|
|
8307
|
+
}
|
|
8308
|
+
return null;
|
|
8309
|
+
})() : null;
|
|
8310
|
+
if (latest) setViewingId(latest);
|
|
8311
|
+
}, 50);
|
|
8312
|
+
},
|
|
7723
8313
|
onCancel: () => setCreating(false),
|
|
7724
8314
|
t
|
|
7725
8315
|
}
|
|
@@ -7738,6 +8328,7 @@ function MySizingProfilesView({
|
|
|
7738
8328
|
isActive: p.id === activeProfileId,
|
|
7739
8329
|
onSelect: () => onSelectProfile(p.id),
|
|
7740
8330
|
onEdit: () => onEditProfile(p),
|
|
8331
|
+
onOpenDetail: () => setViewingId(p.id),
|
|
7741
8332
|
t
|
|
7742
8333
|
},
|
|
7743
8334
|
p.id
|
|
@@ -10031,7 +10622,9 @@ function PrimeStyleTryonInner({
|
|
|
10031
10622
|
createdAt: Date.now(),
|
|
10032
10623
|
lastUsedAt: Date.now()
|
|
10033
10624
|
};
|
|
10034
|
-
|
|
10625
|
+
const nextProfiles = [newProfile, ...profiles];
|
|
10626
|
+
lsSet("profiles", nextProfiles);
|
|
10627
|
+
setProfiles(nextProfiles);
|
|
10035
10628
|
setActiveProfileId$1(newProfile.id);
|
|
10036
10629
|
const heightVal = newProfile.heightCm || newProfile.height || 0;
|
|
10037
10630
|
const weightVal = newProfile.weightKg || newProfile.weight || 0;
|
|
@@ -10045,7 +10638,11 @@ function PrimeStyleTryonInner({
|
|
|
10045
10638
|
heightUnit: heightUnitVal,
|
|
10046
10639
|
weightUnit: weightUnitVal,
|
|
10047
10640
|
gender: newProfile.gender,
|
|
10048
|
-
age: newProfile.age
|
|
10641
|
+
age: newProfile.age,
|
|
10642
|
+
chestProfile: newProfile.chestProfile,
|
|
10643
|
+
midsectionProfile: newProfile.midsectionProfile,
|
|
10644
|
+
hipProfile: newProfile.hipProfile,
|
|
10645
|
+
bodyImage: newProfile.photoBase64
|
|
10049
10646
|
}).then((est) => {
|
|
10050
10647
|
if (est) {
|
|
10051
10648
|
updateProfileMeasurements(newProfile.id, est.estimates, est.unit);
|
|
@@ -10080,7 +10677,7 @@ function PrimeStyleTryonInner({
|
|
|
10080
10677
|
/* @__PURE__ */ jsx("span", { children: resolvedButtonText })
|
|
10081
10678
|
] }),
|
|
10082
10679
|
view !== "idle" && typeof document !== "undefined" && createPortal(
|
|
10083
|
-
/* @__PURE__ */ jsx("div", { className: cx("ps-tryon-overlay", cn.overlay), style: cssVars, "data-ps-tryon-portal": true, children: /* @__PURE__ */ jsxs("div", { className: cx(`ps-tryon-modal${view === "result" && resultImageUrl && sizingResult || view === "size-result" || view === "estimation-review" || view === "body-profile" || view === "profiles" ? " ps-tryon-modal-wide" : ""}`, cn.modal), onClick: (e) => e.stopPropagation(), children: [
|
|
10680
|
+
/* @__PURE__ */ jsx("div", { className: cx("ps-tryon-overlay", cn.overlay), style: cssVars, "data-ps-tryon-portal": true, children: /* @__PURE__ */ jsxs("div", { className: cx(`ps-tryon-modal${view === "result" && resultImageUrl && sizingResult || view === "size-result" || view === "estimation-review" || view === "body-profile" || view === "profiles" ? " ps-tryon-modal-wide" : ""}${view === "profiles" ? " ps-tryon-modal-tall" : ""}`, cn.modal), onClick: (e) => e.stopPropagation(), children: [
|
|
10084
10681
|
/* @__PURE__ */ jsxs("div", { className: cx("ps-tryon-header ps-tryon-header-minimal", cn.header), children: [
|
|
10085
10682
|
/* @__PURE__ */ jsx(LangSwitcher, { activeLocale, onSelect: setActiveLocale }),
|
|
10086
10683
|
/* @__PURE__ */ jsx("button", { className: "ps-tryon-header-icon", title: t("Profiles"), onClick: () => setView(view === "profiles" ? "body-profile" : "profiles"), children: /* @__PURE__ */ jsx(UserIcon, {}) }),
|