@thefittingroom/shop-ui 5.0.31 → 5.0.33

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.
Files changed (2) hide show
  1. package/dist/index.js +833 -72
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14170,6 +14170,7 @@ async function addFittingRoomItem(productId, handle, isPdp) {
14170
14170
  colorwaySizeAssetId: null,
14171
14171
  addedAt: Date.now()
14172
14172
  });
14173
+ state.setLastAddEvent(productId);
14173
14174
  }
14174
14175
  async function syncCurrentProductSelection() {
14175
14176
  const {
@@ -19358,7 +19359,10 @@ const loading$1 = "Loading...";
19358
19359
  const add_to_fitting_room$1 = "Add to Fitting Room";
19359
19360
  const added_to_fitting_room$1 = "In Fitting Room";
19360
19361
  const view_fitting_room$1 = "Fitting Room";
19361
- const fitting_room$1 = { "title": "Fitting Room", "empty": "Your fitting room is empty.", "size_not_chosen": "Size not chosen — pick one before trying on.", "remove": "Remove", "ungrouped": "Other", "try_it_on": "Try it on", "view_product_details": "View product details", "hide_product_details": "Hide product details", "add_to_cart": "Add to cart", "recommended_sizes": "Recommended sizes", "shop_now": "Shop now", "sign_out": "Sign out", "clear_all": "Clear All", "try_it_tucked_in": "Try it tucked in", "try_it_untucked": "Try it untucked", "avatar_placeholder_empty": "Add clothes to try on by selecting items in the rails.", "avatar_placeholder_selected": "Avatar render will appear here once VTO is wired up.", "see_selected_items": "See Selected Items", "no_selection": "Nothing selected yet.", "tuck_in": "Tuck In", "untuck": "Untuck", "zoom_in": "Zoom In", "zoom_out": "Zoom Out", "vto_error": "Couldn't load the try-on. Please try again." };
19362
+ const first_visit_tooltip$1 = { "body": "See items added to your fitting room here", "dismiss": "Dismiss" };
19363
+ const first_add_tooltip$1 = { "body": "Add item to your fitting room here", "dismiss": "Dismiss" };
19364
+ const add_confirmation$1 = { "title": "Your Fitting Room", "added_header": "Added to your fitting room", "cta": "Go to your fitting room", "remove": "Remove from fitting room", "dismiss": "Dismiss" };
19365
+ const fitting_room$1 = { "title": "Fitting Room", "empty": "Your fitting room is empty.", "size_not_chosen": "Size not chosen — pick one before trying on.", "remove": "Remove", "ungrouped": "Other", "try_it_on": "Try it on", "view_product_details": "View product details", "hide_product_details": "Hide product details", "add_to_cart": "Add to cart", "recommended_sizes": "Recommended sizes", "shop_now": "Shop now", "sign_out": "Sign out", "clear_all": "Clear All", "try_it_tucked_in": "Try it tucked in", "try_it_untucked": "Try it untucked", "avatar_placeholder_empty": "Add clothes to try on by selecting items in the rails.", "avatar_placeholder_selected": "Avatar render will appear here once VTO is wired up.", "see_selected_items": "See Selected Items", "no_selection": "Nothing selected yet.", "toggle_selection": "Toggle try-on selection", "tuck_in": "Tuck In", "untuck": "Untuck", "zoom_in": "Zoom In", "zoom_out": "Zoom Out", "vto_error": "Couldn't load the try-on. Please try again." };
19362
19366
  const landing$1 = { "header": "Meet your mini me!", "description": "Loose on your waist but tight on your hips? We’ll show you.", "get_the_app": "Get the app", "already_have_account": "Already have an account?", "sign_in": "Sign in." };
19363
19367
  const en$1 = {
19364
19368
  try_it_on: try_it_on$1,
@@ -19367,6 +19371,9 @@ const en$1 = {
19367
19371
  add_to_fitting_room: add_to_fitting_room$1,
19368
19372
  added_to_fitting_room: added_to_fitting_room$1,
19369
19373
  view_fitting_room: view_fitting_room$1,
19374
+ first_visit_tooltip: first_visit_tooltip$1,
19375
+ first_add_tooltip: first_add_tooltip$1,
19376
+ add_confirmation: add_confirmation$1,
19370
19377
  fitting_room: fitting_room$1,
19371
19378
  landing: landing$1,
19372
19379
  "get-app": { "create_avatar": "Create your avatar" },
@@ -19382,7 +19389,10 @@ const loading = "Chargement...";
19382
19389
  const add_to_fitting_room = "Ajouter à la cabine d'essayage";
19383
19390
  const added_to_fitting_room = "Dans la cabine d'essayage";
19384
19391
  const view_fitting_room = "Cabine d'essayage";
19385
- const fitting_room = { "title": "Cabine d'essayage", "empty": "Votre cabine d'essayage est vide.", "size_not_chosen": "Taille non choisie — choisissez-en une avant l'essayage.", "remove": "Supprimer", "ungrouped": "Autres", "try_it_on": "Essayer", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit", "add_to_cart": "Ajouter au panier", "recommended_sizes": "Tailles recommandées", "shop_now": "Acheter", "sign_out": "Se déconnecter", "try_it_tucked_in": "Essayez-le rentré", "try_it_untucked": "Essayez-le non rentré", "avatar_placeholder_empty": "Ajoutez des vêtements à essayer en sélectionnant des articles.", "avatar_placeholder_selected": "L'avatar apparaîtra ici lorsque la VTO sera connectée.", "see_selected_items": "Voir la sélection", "no_selection": "Rien de sélectionné.", "tuck_in": "Rentrer", "untuck": "Sortir", "zoom_in": "Zoom +", "zoom_out": "Zoom −", "vto_error": "Impossible de charger l'essayage. Veuillez réessayer." };
19392
+ const first_visit_tooltip = { "body": "Voir les articles ajoutés à votre cabine d'essayage ici", "dismiss": "Fermer" };
19393
+ const first_add_tooltip = { "body": "Ajoutez un article à votre cabine d'essayage ici", "dismiss": "Fermer" };
19394
+ const add_confirmation = { "title": "Votre cabine d'essayage", "added_header": "Ajouté à votre cabine d'essayage", "cta": "Aller à votre cabine d'essayage", "remove": "Retirer de la cabine d'essayage", "dismiss": "Fermer" };
19395
+ const fitting_room = { "title": "Cabine d'essayage", "empty": "Votre cabine d'essayage est vide.", "size_not_chosen": "Taille non choisie — choisissez-en une avant l'essayage.", "remove": "Supprimer", "ungrouped": "Autres", "try_it_on": "Essayer", "view_product_details": "Voir les détails du produit", "hide_product_details": "Masquer les détails du produit", "add_to_cart": "Ajouter au panier", "recommended_sizes": "Tailles recommandées", "shop_now": "Acheter", "sign_out": "Se déconnecter", "try_it_tucked_in": "Essayez-le rentré", "try_it_untucked": "Essayez-le non rentré", "avatar_placeholder_empty": "Ajoutez des vêtements à essayer en sélectionnant des articles.", "avatar_placeholder_selected": "L'avatar apparaîtra ici lorsque la VTO sera connectée.", "see_selected_items": "Voir la sélection", "no_selection": "Rien de sélectionné.", "toggle_selection": "Activer/désactiver la sélection", "tuck_in": "Rentrer", "untuck": "Sortir", "zoom_in": "Zoom +", "zoom_out": "Zoom −", "vto_error": "Impossible de charger l'essayage. Veuillez réessayer." };
19386
19396
  const landing = { "header": "Rencontrez votre mini-moi !", "description": "Lâche à la taille mais serré aux hanches ? Nous allons vous montrer.", "get_the_app": "Obtenez l'application", "already_have_account": "Vous avez déjà un compte ?", "sign_in": "Connectez-vous." };
19387
19397
  const fr = {
19388
19398
  try_it_on,
@@ -19391,6 +19401,9 @@ const fr = {
19391
19401
  add_to_fitting_room,
19392
19402
  added_to_fitting_room,
19393
19403
  view_fitting_room,
19404
+ first_visit_tooltip,
19405
+ first_add_tooltip,
19406
+ add_confirmation,
19394
19407
  fitting_room,
19395
19408
  landing,
19396
19409
  "get-app": { "create_avatar": "Créez votre avatar" },
@@ -19594,6 +19607,7 @@ const SvgLoadingCircle = (props) => /* @__PURE__ */ reactExports.createElement("
19594
19607
  const SvgIconSelectedItems = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 25, height: 25, viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M1.00024 18.125L12.4169 23.8333L23.8336 18.125M1.00024 12.4167L12.4169 18.125L23.8336 12.4167M12.4169 1L1.00024 6.70833L12.4169 12.4167L23.8336 6.70833L12.4169 1Z", stroke: "#1E1E1E", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }));
19595
19608
  const SvgTfrIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 12, height: 24, viewBox: "0 0 12 24", fill: "#21201F", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M11.9082 4.0752V19.8516L0.161133 22.8545V1.05859L11.9082 4.0752ZM9.31836 10.8525C8.96951 10.8525 8.68661 11.206 8.68652 11.6416C8.68652 12.0773 8.96946 12.4307 9.31836 12.4307C9.6671 12.4304 9.9502 12.0771 9.9502 11.6416C9.95011 11.2062 9.66705 10.8528 9.31836 10.8525Z" }));
19596
19609
  const SvgTfrName = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 1584, height: 245, viewBox: "0 0 1584 245", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M131.362 34.4131V210.725L0 244.291V0.708984L131.362 34.4131ZM110.354 110.164C106.453 110.164 103.29 114.111 103.29 118.979C103.29 123.848 106.453 127.795 110.354 127.795C114.256 127.795 117.419 123.848 117.419 118.979C117.419 114.111 114.256 110.164 110.354 110.164Z", fill: "#265A64" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M175.848 76.9219V60.8636H271.533V76.9219H232.957V184.5H214.363V76.9219H175.848ZM309.279 129.443V184.5H291.229V60.8636H309.038V106.865H310.185C312.358 101.875 315.678 97.9103 320.146 94.9723C324.613 92.0343 330.449 90.5653 337.653 90.5653C344.012 90.5653 349.566 91.8733 354.315 94.4893C359.104 97.1053 362.807 101.009 365.423 106.201C368.079 111.353 369.407 117.792 369.407 125.519V184.5H351.356V127.692C351.356 120.891 349.606 115.619 346.104 111.876C342.603 108.093 337.733 106.201 331.495 106.201C327.229 106.201 323.406 107.107 320.025 108.918C316.684 110.729 314.048 113.385 312.116 116.886C310.225 120.348 309.279 124.533 309.279 129.443ZM433.459 186.371C424.323 186.371 416.455 184.42 409.854 180.516C403.294 176.571 398.223 171.038 394.641 163.914C391.1 156.75 389.329 148.359 389.329 138.74C389.329 129.242 391.1 120.871 394.641 113.626C398.223 106.382 403.214 100.728 409.613 96.6626C416.052 92.5978 423.578 90.5653 432.191 90.5653C437.423 90.5653 442.494 91.4306 447.404 93.1612C452.314 94.8918 456.721 97.6084 460.625 101.311C464.529 105.014 467.608 109.823 469.861 115.739C472.115 121.615 473.242 128.759 473.242 137.17V143.57H399.531V130.047H455.554C455.554 125.298 454.588 121.092 452.656 117.43C450.724 113.727 448.008 110.809 444.506 108.676C441.045 106.543 436.98 105.477 432.312 105.477C427.241 105.477 422.814 106.724 419.031 109.219C415.288 111.674 412.39 114.894 410.337 118.879C408.325 122.823 407.319 127.109 407.319 131.737V142.302C407.319 148.5 408.406 153.772 410.579 158.119C412.792 162.465 415.871 165.786 419.815 168.08C423.759 170.333 428.368 171.46 433.64 171.46C437.061 171.46 440.18 170.977 442.997 170.011C445.814 169.005 448.249 167.516 450.302 165.544C452.354 163.572 453.924 161.137 455.011 158.239L472.095 161.318C470.727 166.349 468.272 170.756 464.73 174.539C461.229 178.282 456.822 181.2 451.509 183.293C446.237 185.345 440.22 186.371 433.459 186.371ZM539.709 184.5V60.8636H616.378V76.9219H558.363V114.592H610.884V130.59H558.363V184.5H539.709ZM637.869 184.5V91.7727H655.92V184.5H637.869ZM646.985 77.4652C643.846 77.4652 641.149 76.4188 638.896 74.326C636.682 72.1929 635.575 69.6574 635.575 66.7195C635.575 63.7412 636.682 61.2057 638.896 59.1129C641.149 56.9799 643.846 55.9133 646.985 55.9133C650.124 55.9133 652.801 56.9799 655.014 59.1129C657.268 61.2057 658.395 63.7412 658.395 66.7195C658.395 69.6574 657.268 72.1929 655.014 74.326C652.801 76.4188 650.124 77.4652 646.985 77.4652ZM723.488 91.7727V106.261H672.838V91.7727H723.488ZM686.421 69.5568H704.472V157.273C704.472 160.775 704.995 163.411 706.041 165.182C707.088 166.912 708.436 168.1 710.086 168.744C711.776 169.347 713.608 169.649 715.58 169.649C717.029 169.649 718.296 169.549 719.383 169.347C720.47 169.146 721.315 168.985 721.918 168.864L725.178 183.776C724.132 184.178 722.643 184.58 720.711 184.983C718.779 185.426 716.364 185.667 713.467 185.707C708.718 185.788 704.291 184.943 700.186 183.172C696.08 181.401 692.76 178.664 690.225 174.962C687.689 171.259 686.421 166.611 686.421 161.016V69.5568ZM786.74 91.7727V106.261H736.09V91.7727H786.74ZM749.673 69.5568H767.724V157.273C767.724 160.775 768.247 163.411 769.293 165.182C770.34 166.912 771.688 168.1 773.338 168.744C775.028 169.347 776.86 169.649 778.832 169.649C780.281 169.649 781.548 169.549 782.635 169.347C783.722 169.146 784.567 168.985 785.17 168.864L788.43 183.776C787.384 184.178 785.895 184.58 783.963 184.983C782.031 185.426 779.616 185.667 776.719 185.707C771.97 185.788 767.543 184.943 763.437 183.172C759.332 181.401 756.012 178.664 753.477 174.962C750.941 171.259 749.673 166.611 749.673 161.016V69.5568ZM806.707 184.5V91.7727H824.758V184.5H806.707ZM815.823 77.4652C812.684 77.4652 809.987 76.4188 807.733 74.326C805.52 72.1929 804.413 69.6574 804.413 66.7195C804.413 63.7412 805.52 61.2057 807.733 59.1129C809.987 56.9799 812.684 55.9133 815.823 55.9133C818.962 55.9133 821.639 56.9799 823.852 59.1129C826.106 61.2057 827.233 63.7412 827.233 66.7195C827.233 69.6574 826.106 72.1929 823.852 74.326C821.639 76.4188 818.962 77.4652 815.823 77.4652ZM867.092 129.443V184.5H849.041V91.7727H866.367V106.865H867.514C869.647 101.955 872.988 98.0109 877.535 95.0327C882.124 92.0544 887.899 90.5653 894.861 90.5653C901.18 90.5653 906.714 91.8935 911.463 94.5497C916.212 97.1657 919.895 101.07 922.511 106.261C925.127 111.453 926.435 117.872 926.435 125.519V184.5H908.384V127.692C908.384 120.971 906.633 115.719 903.132 111.936C899.631 108.113 894.821 106.201 888.704 106.201C884.518 106.201 880.795 107.107 877.535 108.918C874.316 110.729 871.76 113.385 869.869 116.886C868.017 120.348 867.092 124.533 867.092 129.443ZM989.521 221.205C982.156 221.205 975.817 220.239 970.504 218.307C965.232 216.375 960.926 213.819 957.585 210.64C954.245 207.46 951.749 203.979 950.099 200.196L965.614 193.797C966.701 195.568 968.15 197.439 969.961 199.411C971.812 201.424 974.307 203.134 977.447 204.543C980.626 205.951 984.711 206.656 989.702 206.656C996.544 206.656 1002.2 204.985 1006.67 201.645C1011.13 198.345 1013.37 193.072 1013.37 185.828V167.597H1012.22C1011.13 169.569 1009.56 171.762 1007.51 174.177C1005.5 176.592 1002.72 178.684 999.18 180.455C995.638 182.226 991.03 183.112 985.355 183.112C978.03 183.112 971.43 181.401 965.554 177.98C959.718 174.519 955.09 169.428 951.669 162.707C948.288 155.945 946.598 147.634 946.598 137.774C946.598 127.914 948.268 119.462 951.609 112.419C954.989 105.376 959.618 99.983 965.494 96.2401C971.37 92.4569 978.03 90.5653 985.476 90.5653C991.231 90.5653 995.879 91.5312 999.421 93.4631C1002.96 95.3546 1005.72 97.5682 1007.69 100.104C1009.7 102.639 1011.25 104.873 1012.34 106.805H1013.67V91.7727H1031.36V186.553C1031.36 194.521 1029.51 201.061 1025.8 206.173C1022.1 211.284 1017.09 215.067 1010.77 217.522C1004.49 219.977 997.409 221.205 989.521 221.205ZM989.339 168.14C994.531 168.14 998.918 166.933 1002.5 164.518C1006.12 162.063 1008.86 158.561 1010.71 154.013C1012.6 149.425 1013.55 143.932 1013.55 137.533C1013.55 131.295 1012.62 125.801 1010.77 121.052C1008.92 116.303 1006.2 112.6 1002.62 109.944C999.039 107.247 994.612 105.899 989.339 105.899C983.906 105.899 979.379 107.308 975.756 110.125C972.134 112.902 969.397 116.685 967.546 121.474C965.735 126.264 964.83 131.616 964.83 137.533C964.83 143.61 965.755 148.942 967.606 153.531C969.458 158.119 972.195 161.701 975.817 164.276C979.479 166.852 983.987 168.14 989.339 168.14ZM1102 184.5V60.8636H1146.07C1155.65 60.8636 1163.6 62.5137 1169.92 65.8139C1176.28 69.1141 1181.03 73.6821 1184.17 79.5178C1187.31 85.3132 1188.88 92.0142 1188.88 99.6207C1188.88 107.187 1187.29 113.848 1184.11 119.603C1180.97 125.318 1176.22 129.765 1169.86 132.945C1163.54 136.124 1155.59 137.714 1146.01 137.714H1112.63V121.656H1144.32C1150.36 121.656 1155.27 120.79 1159.05 119.06C1162.88 117.329 1165.67 114.814 1167.44 111.513C1169.21 108.213 1170.1 104.249 1170.1 99.6207C1170.1 94.9522 1169.19 90.9074 1167.38 87.4865C1165.61 84.0656 1162.82 81.4496 1158.99 79.6385C1155.21 77.7872 1150.24 76.8615 1144.08 76.8615H1120.66V184.5H1102ZM1163.04 128.719L1193.58 184.5H1172.33L1142.39 128.719H1163.04ZM1248.02 186.371C1239.33 186.371 1231.74 184.379 1225.26 180.395C1218.78 176.411 1213.75 170.836 1210.17 163.673C1206.59 156.509 1204.8 148.138 1204.8 138.559C1204.8 128.94 1206.59 120.529 1210.17 113.325C1213.75 106.12 1218.78 100.526 1225.26 96.5419C1231.74 92.5575 1239.33 90.5653 1248.02 90.5653C1256.72 90.5653 1264.3 92.5575 1270.78 96.5419C1277.26 100.526 1282.29 106.12 1285.87 113.325C1289.46 120.529 1291.25 128.94 1291.25 138.559C1291.25 148.138 1289.46 156.509 1285.87 163.673C1282.29 170.836 1277.26 176.411 1270.78 180.395C1264.3 184.379 1256.72 186.371 1248.02 186.371ZM1248.08 171.219C1253.72 171.219 1258.39 169.73 1262.09 166.751C1265.79 163.773 1268.53 159.809 1270.3 154.859C1272.11 149.908 1273.01 144.455 1273.01 138.499C1273.01 132.582 1272.11 127.149 1270.3 122.199C1268.53 117.208 1265.79 113.204 1262.09 110.185C1258.39 107.167 1253.72 105.658 1248.08 105.658C1242.41 105.658 1237.7 107.167 1233.96 110.185C1230.25 113.204 1227.5 117.208 1225.69 122.199C1223.91 127.149 1223.03 132.582 1223.03 138.499C1223.03 144.455 1223.91 149.908 1225.69 154.859C1227.5 159.809 1230.25 163.773 1233.96 166.751C1237.7 169.73 1242.41 171.219 1248.08 171.219ZM1350.45 186.371C1341.76 186.371 1334.17 184.379 1327.69 180.395C1321.21 176.411 1316.18 170.836 1312.6 163.673C1309.02 156.509 1307.23 148.138 1307.23 138.559C1307.23 128.94 1309.02 120.529 1312.6 113.325C1316.18 106.12 1321.21 100.526 1327.69 96.5419C1334.17 92.5575 1341.76 90.5653 1350.45 90.5653C1359.15 90.5653 1366.73 92.5575 1373.21 96.5419C1379.69 100.526 1384.72 106.12 1388.31 113.325C1391.89 120.529 1393.68 128.94 1393.68 138.559C1393.68 148.138 1391.89 156.509 1388.31 163.673C1384.72 170.836 1379.69 176.411 1373.21 180.395C1366.73 184.379 1359.15 186.371 1350.45 186.371ZM1350.51 171.219C1356.15 171.219 1360.82 169.73 1364.52 166.751C1368.22 163.773 1370.96 159.809 1372.73 154.859C1374.54 149.908 1375.45 144.455 1375.45 138.499C1375.45 132.582 1374.54 127.149 1372.73 122.199C1370.96 117.208 1368.22 113.204 1364.52 110.185C1360.82 107.167 1356.15 105.658 1350.51 105.658C1344.84 105.658 1340.13 107.167 1336.39 110.185C1332.68 113.204 1329.93 117.208 1328.12 122.199C1326.35 127.149 1325.46 132.582 1325.46 138.499C1325.46 144.455 1326.35 149.908 1328.12 154.859C1329.93 159.809 1332.68 163.773 1336.39 166.751C1340.13 169.73 1344.84 171.219 1350.51 171.219ZM1413.83 184.5V91.7727H1431.15V106.865H1432.3C1434.23 101.754 1437.39 97.7694 1441.78 94.9119C1446.16 92.0142 1451.42 90.5653 1457.53 90.5653C1463.73 90.5653 1468.92 92.0142 1473.11 94.9119C1477.33 97.8097 1480.45 101.794 1482.47 106.865H1483.43C1485.65 101.915 1489.17 97.9706 1494 95.0327C1498.83 92.0544 1504.58 90.5653 1511.26 90.5653C1519.67 90.5653 1526.54 93.2015 1531.85 98.4737C1537.2 103.746 1539.88 111.695 1539.88 122.32V184.5H1521.83V124.01C1521.83 117.732 1520.12 113.184 1516.7 110.366C1513.27 107.549 1509.19 106.141 1504.44 106.141C1498.56 106.141 1494 107.952 1490.74 111.574C1487.48 115.156 1485.85 119.764 1485.85 125.398V184.5H1467.86V122.863C1467.86 117.832 1466.29 113.787 1463.15 110.729C1460.01 107.67 1455.92 106.141 1450.89 106.141C1447.47 106.141 1444.31 107.046 1441.42 108.857C1438.56 110.628 1436.24 113.103 1434.47 116.283C1432.74 119.462 1431.88 123.145 1431.88 127.33V184.5H1413.83Z", fill: "#265A64" }));
19610
+ const SvgTrashIcon = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M2.5 4H13.5", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M6 4V2.5C6 2.22386 6.22386 2 6.5 2H9.5C9.77614 2 10 2.22386 10 2.5V4", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M3.5 4V13C3.5 13.5523 3.94772 14 4.5 14H11.5C12.0523 14 12.5 13.5523 12.5 13V4", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M6.5 7V11", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }), /* @__PURE__ */ reactExports.createElement("path", { d: "M9.5 7V11", stroke: "#21201F", strokeWidth: 1.5, strokeLinecap: "round" }));
19597
19611
  const SvgIconTuck = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 18, height: 23, viewBox: "0 0 18 23", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M4.5 12.65V4.39875L1.60313 7.36L0 5.75L5.625 0L11.25 5.75L9.64687 7.36L6.75 4.39875V12.65H4.5ZM12.375 23L6.75 17.25L8.35313 15.64L11.25 18.6013V10.35H13.5V18.6013L16.3969 15.64L18 17.25L12.375 23Z", fill: "#21201F" }));
19598
19612
  const SvgIconZoom = (props) => /* @__PURE__ */ reactExports.createElement("svg", { width: 20, height: 20, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ reactExports.createElement("path", { d: "M19 19L14.65 14.65M9 6V12M6 9H12M17 9C17 13.4183 13.4183 17 9 17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1C13.4183 1 17 4.58172 17 9Z", stroke: "#1E1E1E", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }));
19599
19613
  let baseUrl$1;
@@ -41646,11 +41660,74 @@ async function loadProductData(externalId) {
41646
41660
  throw new Error(`Style not found for externalId: ${externalId}`);
41647
41661
  }
41648
41662
  const sizeFitRecommendation = await getSizeRecommendation(style.id);
41663
+ const container = style.is_container ? {
41664
+ children: style.children ?? [],
41665
+ setSizeMappings: style.set_size_mappings ?? []
41666
+ } : void 0;
41649
41667
  return {
41650
41668
  externalId,
41651
41669
  style,
41652
- sizeFitRecommendation
41653
- };
41670
+ sizeFitRecommendation,
41671
+ container
41672
+ };
41673
+ }
41674
+ function buildVtoWireItems(loaded, parentCsaId, untucked) {
41675
+ const untuckFrag = untucked ? {
41676
+ untucked: true
41677
+ } : {};
41678
+ if (!loaded.container) {
41679
+ return [{
41680
+ colorway_size_asset_id: parentCsaId,
41681
+ ...untuckFrag
41682
+ }];
41683
+ }
41684
+ const childCsaIds = resolveContainerExpansion(loaded, parentCsaId);
41685
+ if (!childCsaIds) {
41686
+ return null;
41687
+ }
41688
+ return childCsaIds.map((csaId) => ({
41689
+ colorway_size_asset_id: csaId,
41690
+ ...untuckFrag
41691
+ }));
41692
+ }
41693
+ function resolveContainerExpansion(loaded, parentCsaId) {
41694
+ if (!loaded.container) {
41695
+ return null;
41696
+ }
41697
+ for (const sz of loaded.sizeFitRecommendation.available_sizes) {
41698
+ const csa = sz.colorway_size_assets.find((c) => c.id === parentCsaId);
41699
+ if (!csa || !csa.colorway_name) {
41700
+ continue;
41701
+ }
41702
+ return resolveContainerChildCSAs(loaded.container, sz.id, csa.colorway_name);
41703
+ }
41704
+ return null;
41705
+ }
41706
+ function resolveContainerChildCSAs(container, parentSizeId, parentColorwayName) {
41707
+ const relevantMappings = container.setSizeMappings.filter((m) => m.parent_size_id === parentSizeId);
41708
+ if (relevantMappings.length === 0) {
41709
+ return null;
41710
+ }
41711
+ const csaIds = [];
41712
+ for (const mapping of relevantMappings) {
41713
+ let matchedCsaId = null;
41714
+ for (const child of container.children) {
41715
+ const size = (child.sizes ?? []).find((s) => s.id === mapping.child_size_id);
41716
+ if (!size) {
41717
+ continue;
41718
+ }
41719
+ const csa = (child.colorway_size_assets ?? []).find((a) => a.size_id === size.id && a.colorway_name === parentColorwayName);
41720
+ if (csa) {
41721
+ matchedCsaId = csa.id;
41722
+ }
41723
+ break;
41724
+ }
41725
+ if (matchedCsaId == null) {
41726
+ return null;
41727
+ }
41728
+ csaIds.push(matchedCsaId);
41729
+ }
41730
+ return csaIds;
41654
41731
  }
41655
41732
  function loadProductDataToStore(externalId) {
41656
41733
  async function loadAndStore() {
@@ -41734,6 +41811,9 @@ function peekStyleCategoryIndex() {
41734
41811
  return cached;
41735
41812
  }
41736
41813
  const logger$a = getLogger("fitting-room-data");
41814
+ function isItemTuckable(item) {
41815
+ return item.effective.some((e) => !!e.category.tuckable);
41816
+ }
41737
41817
  async function loadFittingRoomData() {
41738
41818
  const state = useMainStore.getState();
41739
41819
  const items = state.fittingRoom;
@@ -41745,6 +41825,10 @@ async function loadFittingRoomData() {
41745
41825
  for (const item of items) {
41746
41826
  loadProductDataToStore(item.externalId);
41747
41827
  }
41828
+ await loadMerchantProductData(items);
41829
+ }
41830
+ async function loadMerchantProductData(items) {
41831
+ const state = useMainStore.getState();
41748
41832
  const {
41749
41833
  productLookup
41750
41834
  } = getStaticData();
@@ -41813,10 +41897,28 @@ function resolveItem(item, merchantSlot, loadedSlot, index) {
41813
41897
  const loadedError = loadedSlot && isLoadedError(loadedSlot) ? loadedSlot.error : null;
41814
41898
  let styleCategory = null;
41815
41899
  let styleCategoryGroup = null;
41900
+ const effective = [];
41816
41901
  if (loadedProduct && index) {
41817
41902
  const categoryName = String(loadedProduct.style.style_category_name);
41818
41903
  styleCategory = index.byName(categoryName);
41819
41904
  styleCategoryGroup = index.groupForCategory(categoryName);
41905
+ if (loadedProduct.container) {
41906
+ for (const child of loadedProduct.container.children) {
41907
+ const childName = String(child.style_category_name);
41908
+ const childCat = index.byName(childName);
41909
+ if (childCat) {
41910
+ effective.push({
41911
+ category: childCat,
41912
+ group: index.groupForCategory(childName)
41913
+ });
41914
+ }
41915
+ }
41916
+ } else if (styleCategory) {
41917
+ effective.push({
41918
+ category: styleCategory,
41919
+ group: styleCategoryGroup
41920
+ });
41921
+ }
41820
41922
  }
41821
41923
  let needsResize = item.colorwaySizeAssetId == null;
41822
41924
  if (!needsResize && loadedProduct && item.colorwaySizeAssetId != null) {
@@ -41834,6 +41936,16 @@ function resolveItem(item, merchantSlot, loadedSlot, index) {
41834
41936
  needsResize = true;
41835
41937
  }
41836
41938
  }
41939
+ if (!needsResize && loadedProduct.container && item.colorwaySizeAssetId != null) {
41940
+ const expanded = resolveContainerExpansion(loadedProduct, item.colorwaySizeAssetId);
41941
+ if (!expanded) {
41942
+ needsResize = true;
41943
+ logger$a.logDebug("container mapping resolved to empty, marking needsResize", {
41944
+ externalId: item.externalId,
41945
+ csa: item.colorwaySizeAssetId
41946
+ });
41947
+ }
41948
+ }
41837
41949
  }
41838
41950
  const isReady = !!merchantProduct && !!loadedProduct && !!styleCategory && !needsResize;
41839
41951
  return {
@@ -41845,6 +41957,7 @@ function resolveItem(item, merchantSlot, loadedSlot, index) {
41845
41957
  loadedError,
41846
41958
  styleCategory,
41847
41959
  styleCategoryGroup,
41960
+ effective,
41848
41961
  isReady,
41849
41962
  needsResize
41850
41963
  };
@@ -42034,6 +42147,12 @@ function useMobileSheetSnap(initial = "collapsed") {
42034
42147
  };
42035
42148
  }
42036
42149
  const MAX_OUTFIT_ITEMS = 4;
42150
+ function getGarmentCount(item) {
42151
+ if (item.effective.length > 0) {
42152
+ return item.effective.length;
42153
+ }
42154
+ return item.styleCategory ? 1 : 0;
42155
+ }
42037
42156
  function asStringList(value) {
42038
42157
  if (!Array.isArray(value)) {
42039
42158
  return [];
@@ -42051,6 +42170,19 @@ function asStringList(value) {
42051
42170
  function catName(c) {
42052
42171
  return String(c.name);
42053
42172
  }
42173
+ function itemsCompatible(a, b) {
42174
+ if (a.effective.length === 0 || b.effective.length === 0) {
42175
+ return true;
42176
+ }
42177
+ for (const ae of a.effective) {
42178
+ for (const be of b.effective) {
42179
+ if (!pairCompatible(ae.category, be.category, ae.group)) {
42180
+ return false;
42181
+ }
42182
+ }
42183
+ }
42184
+ return true;
42185
+ }
42054
42186
  function pairCompatible(a, b, group) {
42055
42187
  const aName = catName(a);
42056
42188
  const bName = catName(b);
@@ -42103,11 +42235,7 @@ function computeAvailability(item, selectedExternalIds, resolved) {
42103
42235
  return "disabled";
42104
42236
  }
42105
42237
  const sameCategoryEvictions = new Set(getSameCategoryConflicts(item, selectedExternalIds, resolved));
42106
- const effectiveSize = selectedExternalIds.size - sameCategoryEvictions.size + 1;
42107
- if (effectiveSize > MAX_OUTFIT_ITEMS) {
42108
- return "disabled";
42109
- }
42110
- const itemCat = item.styleCategory;
42238
+ let effectiveGarments = getGarmentCount(item);
42111
42239
  for (const sel of resolved.items) {
42112
42240
  if (!selectedExternalIds.has(sel.externalId)) {
42113
42241
  continue;
@@ -42115,10 +42243,19 @@ function computeAvailability(item, selectedExternalIds, resolved) {
42115
42243
  if (sameCategoryEvictions.has(sel.externalId)) {
42116
42244
  continue;
42117
42245
  }
42118
- if (!sel.styleCategory) {
42246
+ effectiveGarments += getGarmentCount(sel);
42247
+ }
42248
+ if (effectiveGarments > MAX_OUTFIT_ITEMS) {
42249
+ return "disabled";
42250
+ }
42251
+ for (const sel of resolved.items) {
42252
+ if (!selectedExternalIds.has(sel.externalId)) {
42253
+ continue;
42254
+ }
42255
+ if (sameCategoryEvictions.has(sel.externalId)) {
42119
42256
  continue;
42120
42257
  }
42121
- if (!pairCompatible(sel.styleCategory, itemCat, sel.styleCategoryGroup)) {
42258
+ if (!itemsCompatible(sel, item)) {
42122
42259
  return "disabled";
42123
42260
  }
42124
42261
  }
@@ -42131,19 +42268,31 @@ function makeOutfitItem(r, forceUntuck) {
42131
42268
  if (r.storage.colorwaySizeAssetId == null) {
42132
42269
  return null;
42133
42270
  }
42134
- const tuckable = !!r.styleCategory.tuckable;
42271
+ const tuckable = isItemTuckable(r);
42135
42272
  const untucked = forceUntuck && tuckable;
42136
42273
  const layerOrder = untucked ? r.styleCategory.layer_order_untucked : r.styleCategory.layer_order;
42274
+ let childCsaIds;
42275
+ if (r.loadedProduct?.container) {
42276
+ const resolved = resolveContainerExpansion(r.loadedProduct, r.storage.colorwaySizeAssetId);
42277
+ if (!resolved) {
42278
+ return null;
42279
+ }
42280
+ childCsaIds = resolved;
42281
+ }
42137
42282
  const outfitItem = {
42138
42283
  externalId: r.externalId,
42139
42284
  colorwaySizeAssetId: r.storage.colorwaySizeAssetId,
42140
42285
  ...untucked ? {
42141
42286
  untucked: true
42287
+ } : {},
42288
+ ...childCsaIds ? {
42289
+ childCsaIds
42142
42290
  } : {}
42143
42291
  };
42144
42292
  return {
42145
42293
  outfitItem,
42146
- layerOrder
42294
+ layerOrder,
42295
+ garmentCount: childCsaIds?.length ?? 1
42147
42296
  };
42148
42297
  }
42149
42298
  function buildOutfit(selectedExternalIds, resolved, forceUntuck, lastAddedExternalId) {
@@ -42162,7 +42311,15 @@ function buildOutfit(selectedExternalIds, resolved, forceUntuck, lastAddedExtern
42162
42311
  }
42163
42312
  }
42164
42313
  entries.sort((a, b) => a.layerOrder - b.layerOrder);
42165
- const items = entries.slice(0, MAX_OUTFIT_ITEMS).map((e) => e.outfitItem);
42314
+ const items = [];
42315
+ let cumulativeGarments = 0;
42316
+ for (const entry of entries) {
42317
+ if (cumulativeGarments + entry.garmentCount > MAX_OUTFIT_ITEMS) {
42318
+ break;
42319
+ }
42320
+ items.push(entry.outfitItem);
42321
+ cumulativeGarments += entry.garmentCount;
42322
+ }
42166
42323
  const alternates = buildAlternateOutfits(items, lastAddedResolved);
42167
42324
  return {
42168
42325
  items,
@@ -42195,9 +42352,20 @@ function buildAlternateOutfits(primary, lastAddedResolved) {
42195
42352
  if (!altCsa) {
42196
42353
  continue;
42197
42354
  }
42355
+ let altChildCsaIds;
42356
+ if (lastAddedResolved.loadedProduct.container) {
42357
+ const resolved = resolveContainerExpansion(lastAddedResolved.loadedProduct, altCsa.id);
42358
+ if (!resolved) {
42359
+ continue;
42360
+ }
42361
+ altChildCsaIds = resolved;
42362
+ }
42198
42363
  const alternate = primary.map((it) => it.externalId === lastAddedResolved.externalId ? {
42199
42364
  ...it,
42200
- colorwaySizeAssetId: altCsa.id
42365
+ colorwaySizeAssetId: altCsa.id,
42366
+ ...altChildCsaIds ? {
42367
+ childCsaIds: altChildCsaIds
42368
+ } : {}
42201
42369
  } : it);
42202
42370
  out.push(alternate);
42203
42371
  }
@@ -42332,7 +42500,14 @@ function AvatarControls({
42332
42500
  border: "none",
42333
42501
  backgroundColor: "transparent",
42334
42502
  cursor: "pointer",
42335
- fontSize: "14px"
42503
+ display: "flex",
42504
+ alignItems: "center",
42505
+ justifyContent: "center",
42506
+ padding: 0
42507
+ },
42508
+ popoverRemoveIcon: {
42509
+ width: "14px",
42510
+ height: "14px"
42336
42511
  }
42337
42512
  }));
42338
42513
  const seeExpanded = expanded || popoverOpen;
@@ -42354,7 +42529,7 @@ function AvatarControls({
42354
42529
  popoverOpen ? /* @__PURE__ */ jsx$1("div", { css: css2.popover, children: selectedItems.length === 0 ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.popoverLabel, children: t("fitting_room.no_selection") }) : selectedItems.map((item) => /* @__PURE__ */ jsxs("div", { css: css2.popoverRow, children: [
42355
42530
  item.merchantProduct?.imageUrl ? /* @__PURE__ */ jsx$1("img", { src: item.merchantProduct.imageUrl, css: css2.popoverThumb, alt: "" }) : /* @__PURE__ */ jsx$1("div", { css: css2.popoverThumb }),
42356
42531
  /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.popoverLabel, children: item.merchantProduct?.productName ?? item.externalId }),
42357
- /* @__PURE__ */ jsx$1("button", { css: css2.popoverRemove, onClick: () => onRemoveItem(item.externalId), "aria-label": "Remove", children: "×" })
42532
+ /* @__PURE__ */ jsx$1("button", { css: css2.popoverRemove, onClick: () => onRemoveItem(item.externalId), "aria-label": "Remove", children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.popoverRemoveIcon }) })
42358
42533
  ] }, item.externalId)) }) : null
42359
42534
  ] });
42360
42535
  return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, children: [
@@ -42707,6 +42882,71 @@ function Chevron({
42707
42882
  transform: `rotate(${ROTATION_DEG[direction]}deg)`
42708
42883
  }, children: /* @__PURE__ */ jsx$1("path", { d: "M6 9L12 15L18 9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
42709
42884
  }
42885
+ function CardCheckbox({
42886
+ state,
42887
+ onClick,
42888
+ ariaLabel
42889
+ }) {
42890
+ const css2 = useCss((theme) => ({
42891
+ base: {
42892
+ position: "absolute",
42893
+ top: "8px",
42894
+ left: "8px",
42895
+ width: "36px",
42896
+ height: "20px",
42897
+ borderRadius: "10px",
42898
+ border: "none",
42899
+ padding: 0,
42900
+ zIndex: 1,
42901
+ transition: "background-color 150ms ease-out"
42902
+ },
42903
+ unselected: {
42904
+ backgroundColor: "#D4D4D4",
42905
+ cursor: "pointer"
42906
+ },
42907
+ selected: {
42908
+ backgroundColor: theme.color_tfr_800,
42909
+ cursor: "pointer"
42910
+ },
42911
+ disabled: {
42912
+ backgroundColor: "#EAEAEA",
42913
+ cursor: "not-allowed",
42914
+ pointerEvents: "none"
42915
+ },
42916
+ thumb: {
42917
+ position: "absolute",
42918
+ top: "2px",
42919
+ width: "16px",
42920
+ height: "16px",
42921
+ borderRadius: "8px",
42922
+ backgroundColor: "#FFFFFF",
42923
+ boxShadow: "0 1px 2px rgba(0, 0, 0, 0.2)",
42924
+ transition: "left 150ms ease-out"
42925
+ },
42926
+ thumbOff: {
42927
+ left: "2px"
42928
+ },
42929
+ thumbOn: {
42930
+ left: "18px"
42931
+ }
42932
+ }));
42933
+ const trackCss = state === "selected" ? css2.selected : state === "disabled" ? css2.disabled : css2.unselected;
42934
+ const thumbPosCss = state === "selected" ? css2.thumbOn : css2.thumbOff;
42935
+ const handleClick = (e) => {
42936
+ e.stopPropagation();
42937
+ if (state === "disabled" || !onClick) {
42938
+ return;
42939
+ }
42940
+ onClick();
42941
+ };
42942
+ return /* @__PURE__ */ jsx$1("button", { type: "button", css: /* @__PURE__ */ css$1({
42943
+ ...css2.base,
42944
+ ...trackCss
42945
+ }, "", ""), onClick: handleClick, "aria-pressed": state === "selected", "aria-disabled": state === "disabled", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx$1("span", { css: /* @__PURE__ */ css$1({
42946
+ ...css2.thumb,
42947
+ ...thumbPosCss
42948
+ }, "", "") }) });
42949
+ }
42710
42950
  function ColorSwatchRow({
42711
42951
  colors,
42712
42952
  selectedLabel,
@@ -42779,6 +43019,9 @@ function ProductCard({
42779
43019
  onRemove,
42780
43020
  onChangeColor
42781
43021
  }) {
43022
+ const {
43023
+ t
43024
+ } = useTranslation();
42782
43025
  const css2 = useCss((theme) => ({
42783
43026
  container: {
42784
43027
  position: "relative",
@@ -42787,13 +43030,14 @@ function ProductCard({
42787
43030
  display: "flex",
42788
43031
  flexDirection: "column",
42789
43032
  gap: "8px",
42790
- padding: "8px",
42791
- border: "1px solid transparent",
43033
+ padding: "12px 20px",
43034
+ border: "1.5px solid #E0E0E0",
43035
+ borderRadius: "8px",
42792
43036
  backgroundColor: "transparent",
42793
43037
  textAlign: "left"
42794
43038
  },
42795
43039
  containerSelected: {
42796
- border: `1px solid ${theme.color_fg_text}`
43040
+ borderColor: theme.color_tfr_800
42797
43041
  },
42798
43042
  containerDisabled: {
42799
43043
  opacity: 0.35
@@ -42834,8 +43078,8 @@ function ProductCard({
42834
43078
  },
42835
43079
  removeButton: {
42836
43080
  position: "absolute",
42837
- top: "4px",
42838
- right: "4px",
43081
+ top: "8px",
43082
+ right: "8px",
42839
43083
  width: "24px",
42840
43084
  height: "24px",
42841
43085
  borderRadius: "12px",
@@ -42849,26 +43093,8 @@ function ProductCard({
42849
43093
  zIndex: 1
42850
43094
  },
42851
43095
  removeIcon: {
42852
- width: "12px",
42853
- height: "12px"
42854
- },
42855
- // Selected badge — mirrors the X button at the top-right, green-filled
42856
- // circle at top-left with an inline white checkmark. Only rendered when
42857
- // availability === 'selected'. Decorative: pointer-events: none so the
42858
- // shopper still taps the card body underneath to toggle off.
42859
- selectedBadge: {
42860
- position: "absolute",
42861
- top: "4px",
42862
- left: "4px",
42863
- width: "24px",
42864
- height: "24px",
42865
- borderRadius: "12px",
42866
- backgroundColor: "#22C55E",
42867
- display: "flex",
42868
- alignItems: "center",
42869
- justifyContent: "center",
42870
- pointerEvents: "none",
42871
- zIndex: 1
43096
+ width: "14px",
43097
+ height: "14px"
42872
43098
  }
42873
43099
  }));
42874
43100
  const disabled = availability === "disabled";
@@ -42924,8 +43150,8 @@ function ProductCard({
42924
43150
  /* @__PURE__ */ jsx$1("button", { css: css2.removeButton, onClick: (e) => {
42925
43151
  e.stopPropagation();
42926
43152
  onRemove();
42927
- }, "aria-label": "Remove from fitting room", children: /* @__PURE__ */ jsx$1(SvgCloseIcon, { css: css2.removeIcon }) }),
42928
- selected ? /* @__PURE__ */ jsx$1("div", { css: css2.selectedBadge, "aria-hidden": "true", children: /* @__PURE__ */ jsx$1("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx$1("path", { d: "M3 8.5L6.5 12L13 4.5", stroke: "#FFFFFF", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : null,
43153
+ }, "aria-label": "Remove from fitting room", children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.removeIcon }) }),
43154
+ /* @__PURE__ */ jsx$1(CardCheckbox, { state: disabled ? "disabled" : selected ? "selected" : "unselected", onClick: handleClick, ariaLabel: t("fitting_room.toggle_selection") }),
42929
43155
  /* @__PURE__ */ jsxs(Button, { variant: "base", css: /* @__PURE__ */ css$1({
42930
43156
  ...css2.cardBody,
42931
43157
  ...disabled && css2.cardBodyDisabled
@@ -43014,7 +43240,7 @@ function CardRail({
43014
43240
  horizontal: {
43015
43241
  display: "flex",
43016
43242
  flexDirection: "row",
43017
- gap: "8px",
43243
+ gap: "16px",
43018
43244
  overflowX: "auto",
43019
43245
  padding: "4px 0",
43020
43246
  // Native scrollbar hidden — the chevron handles are the affordance.
@@ -43263,7 +43489,7 @@ function DetailAccordionItem({
43263
43489
  }, [productData, selectedSizeLabel]);
43264
43490
  const categoryLabel = item.styleCategory?.label_singular ?? item.styleCategory?.label ?? "";
43265
43491
  const productName = item.merchantProduct?.productName ?? item.externalId;
43266
- const tuckable = !!item.styleCategory?.tuckable && canTuck;
43492
+ const tuckable = isItemTuckable(item) && canTuck;
43267
43493
  if (platform === "desktop") {
43268
43494
  return /* @__PURE__ */ jsx$1(DesktopAccordionItem, { isOpen, categoryLabel, productData, currentPrice, selectedSizeLabel, availableColorLabels, selectedColorLabel: item.storage.color, onToggleOpen, onChangeSize, onChangeColor, onAddToCart });
43269
43495
  }
@@ -44442,12 +44668,21 @@ function useVtoRequests() {
44442
44668
  };
44443
44669
  }
44444
44670
  function toWireItems(items) {
44445
- return items.map((i) => ({
44446
- colorway_size_asset_id: i.colorwaySizeAssetId,
44447
- ...i.untucked ? {
44671
+ return items.flatMap((i) => {
44672
+ const untuckFrag = i.untucked ? {
44448
44673
  untucked: true
44449
- } : {}
44450
- }));
44674
+ } : {};
44675
+ if (i.childCsaIds && i.childCsaIds.length > 0) {
44676
+ return i.childCsaIds.map((csaId) => ({
44677
+ colorway_size_asset_id: csaId,
44678
+ ...untuckFrag
44679
+ }));
44680
+ }
44681
+ return [{
44682
+ colorway_size_asset_id: i.colorwaySizeAssetId,
44683
+ ...untuckFrag
44684
+ }];
44685
+ });
44451
44686
  }
44452
44687
  const logger$8 = getLogger("overlays/fitting-room");
44453
44688
  function measureTopOffset() {
@@ -45595,6 +45830,7 @@ function QuickViewOverlay() {
45595
45830
  const [selectedSizeLabel, setSelectedSizeLabel] = reactExports.useState(null);
45596
45831
  const [selectedColorLabel, setSelectedColorLabel] = reactExports.useState(null);
45597
45832
  const [modalStyle, setModalStyle] = reactExports.useState({});
45833
+ const [containerUntucked, setContainerUntucked] = reactExports.useState(false);
45598
45834
  const {
45599
45835
  request: vtoRequest,
45600
45836
  framesForOutfit,
@@ -45773,12 +46009,46 @@ function QuickViewOverlay() {
45773
46009
  availableColorLabels: availableColorLabels2
45774
46010
  };
45775
46011
  }, [vtoProductData, selectedSizeLabel, selectedColorLabel]);
46012
+ const loadedProduct = reactExports.useMemo(() => {
46013
+ const {
46014
+ currentProduct
46015
+ } = getStaticData();
46016
+ if (!currentProduct) {
46017
+ return null;
46018
+ }
46019
+ const entry = storeProductData[currentProduct.externalId];
46020
+ if (!entry || "error" in entry) {
46021
+ return null;
46022
+ }
46023
+ return entry;
46024
+ }, [storeProductData]);
46025
+ const containerHasTuckableChild = reactExports.useMemo(() => {
46026
+ if (!loadedProduct?.container) {
46027
+ return false;
46028
+ }
46029
+ const index = peekStyleCategoryIndex();
46030
+ if (!index) {
46031
+ return false;
46032
+ }
46033
+ return loadedProduct.container.children.some((c) => {
46034
+ const cat = index.byName(String(c.style_category_name));
46035
+ return !!cat?.tuckable;
46036
+ });
46037
+ }, [loadedProduct]);
46038
+ const handleToggleContainerUntucked = reactExports.useCallback(() => {
46039
+ setContainerUntucked((prev2) => !prev2);
46040
+ }, []);
45776
46041
  const requestVto2 = reactExports.useCallback((sizeColorRecord, priority) => {
45777
- vtoRequest([{
45778
- colorway_size_asset_id: sizeColorRecord.colorwaySizeAssetId,
45779
- untucked: false
45780
- }], priority);
45781
- }, [vtoRequest]);
46042
+ if (!loadedProduct) {
46043
+ return;
46044
+ }
46045
+ const untucked = loadedProduct.container ? containerUntucked : false;
46046
+ const wireItems = buildVtoWireItems(loadedProduct, sizeColorRecord.colorwaySizeAssetId, untucked);
46047
+ if (!wireItems) {
46048
+ return;
46049
+ }
46050
+ vtoRequest(wireItems, priority);
46051
+ }, [vtoRequest, loadedProduct, containerUntucked]);
45782
46052
  reactExports.useEffect(() => {
45783
46053
  if (selectedColorSizeRecord) {
45784
46054
  requestVto2(selectedColorSizeRecord, true);
@@ -45799,13 +46069,15 @@ function QuickViewOverlay() {
45799
46069
  }
45800
46070
  }, [requestVto2, vtoProductData, selectedColorLabel]);
45801
46071
  const frameUrls = reactExports.useMemo(() => {
45802
- if (!selectedColorSizeRecord) {
46072
+ if (!selectedColorSizeRecord || !loadedProduct) {
45803
46073
  return null;
45804
46074
  }
45805
- const rewritten = framesForOutfit([{
45806
- colorway_size_asset_id: selectedColorSizeRecord.colorwaySizeAssetId,
45807
- untucked: false
45808
- }]);
46075
+ const untucked = loadedProduct.container ? containerUntucked : false;
46076
+ const wireItems = buildVtoWireItems(loadedProduct, selectedColorSizeRecord.colorwaySizeAssetId, untucked);
46077
+ if (!wireItems) {
46078
+ return null;
46079
+ }
46080
+ const rewritten = framesForOutfit(wireItems);
45809
46081
  if (!rewritten) {
45810
46082
  return null;
45811
46083
  }
@@ -45815,7 +46087,7 @@ function QuickViewOverlay() {
45815
46087
  img.src = url;
45816
46088
  });
45817
46089
  return rewritten;
45818
- }, [selectedColorSizeRecord, framesForOutfit]);
46090
+ }, [selectedColorSizeRecord, framesForOutfit, loadedProduct, containerUntucked]);
45819
46091
  const handleSignOutClick = reactExports.useCallback(() => {
45820
46092
  closeOverlay();
45821
46093
  const authManager2 = getAuthManager();
@@ -45881,7 +46153,7 @@ function QuickViewOverlay() {
45881
46153
  Layout = DesktopLayout;
45882
46154
  }
45883
46155
  return /* @__PURE__ */ jsxs(SidecarModalFrame, { onRequestClose: closeOverlay, contentStyle: modalStyle, children: [
45884
- /* @__PURE__ */ jsx$1(Layout, { loadedProductData: vtoProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, frameUrls, setModalStyle, onClose: closeOverlay, onChangeColor: handleChangeColor, onChangeSize: setSelectedSizeLabel, onAddToCart: handleAddToCartClick, onSignOut: handleSignOutClick }),
46156
+ /* @__PURE__ */ jsx$1(Layout, { loadedProductData: vtoProductData, selectedColorSizeRecord, availableColorLabels, selectedColorLabel, selectedSizeLabel, frameUrls, setModalStyle, onClose: closeOverlay, onChangeColor: handleChangeColor, onChangeSize: setSelectedSizeLabel, onAddToCart: handleAddToCartClick, onSignOut: handleSignOutClick, containerTuckable: containerHasTuckableChild, containerUntucked, onToggleUntuck: handleToggleContainerUntucked }),
45885
46157
  vtoError ? /* @__PURE__ */ jsx$1(Snackbar, { messageKey: "quick-view.vto_error", onDismiss: clearVtoError }) : null
45886
46158
  ] });
45887
46159
  }
@@ -45968,6 +46240,31 @@ function FittingRoomToggleButton() {
45968
46240
  /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.text, t: isInFittingRoom ? "added_to_fitting_room" : "add_to_fitting_room" })
45969
46241
  ] });
45970
46242
  }
46243
+ function ContainerTuckToggleButton({
46244
+ untucked,
46245
+ onToggle
46246
+ }) {
46247
+ const css2 = useCss((theme) => ({
46248
+ button: {
46249
+ marginTop: "10px",
46250
+ width: "100%",
46251
+ display: "flex",
46252
+ alignItems: "center",
46253
+ justifyContent: "center",
46254
+ gap: "10px",
46255
+ padding: "13px",
46256
+ backgroundColor: "#FFFFFF",
46257
+ border: `1px solid ${theme.color_fg_text}`,
46258
+ borderRadius: "30px",
46259
+ cursor: "pointer"
46260
+ },
46261
+ text: {
46262
+ fontSize: "14px",
46263
+ textTransform: "uppercase"
46264
+ }
46265
+ }));
46266
+ return /* @__PURE__ */ jsx$1("button", { type: "button", onClick: onToggle, css: css2.button, children: /* @__PURE__ */ jsx$1(TextT, { variant: "base", css: css2.text, t: untucked ? "fitting_room.try_it_tucked_in" : "fitting_room.try_it_untucked" }) });
46267
+ }
45971
46268
  function MobileLayout({
45972
46269
  loadedProductData,
45973
46270
  selectedColorSizeRecord,
@@ -46317,7 +46614,10 @@ function DesktopLayout({
46317
46614
  onChangeColor,
46318
46615
  onChangeSize,
46319
46616
  onAddToCart,
46320
- onSignOut
46617
+ onSignOut,
46618
+ containerTuckable,
46619
+ containerUntucked,
46620
+ onToggleUntuck
46321
46621
  }) {
46322
46622
  const {
46323
46623
  t
@@ -46445,7 +46745,8 @@ function DesktopLayout({
46445
46745
  fitChartNode,
46446
46746
  /* @__PURE__ */ jsxs("div", { css: css2.buttonContainer, children: [
46447
46747
  /* @__PURE__ */ jsx$1(AddToCartButton, { onClick: onAddToCart }),
46448
- /* @__PURE__ */ jsx$1(FittingRoomToggleButton, {})
46748
+ /* @__PURE__ */ jsx$1(FittingRoomToggleButton, {}),
46749
+ containerTuckable ? /* @__PURE__ */ jsx$1(ContainerTuckToggleButton, { untucked: containerUntucked, onToggle: onToggleUntuck }) : null
46449
46750
  ] }),
46450
46751
  /* @__PURE__ */ jsx$1("div", { css: css2.descriptionContainer, children: /* @__PURE__ */ jsx$1(ProductDescriptionText, { loadedProductData }) })
46451
46752
  ] }),
@@ -46707,7 +47008,124 @@ function Footer({
46707
47008
  /* @__PURE__ */ jsx$1(SvgTfrName, { css: css2.tfrIcon })
46708
47009
  ] });
46709
47010
  }
47011
+ const TOOLTIP_WIDTH = 240;
47012
+ const VIEWPORT_PADDING = 12;
47013
+ const ARROW_WIDTH$1 = 32;
47014
+ const ARROW_HEIGHT$1 = 16;
47015
+ const ARROW_GAP = 14;
47016
+ function FirstVisitTooltip({
47017
+ text,
47018
+ dismissAriaLabel,
47019
+ onDismiss,
47020
+ anchorRef
47021
+ }) {
47022
+ const [pos, setPos] = reactExports.useState(null);
47023
+ reactExports.useEffect(() => {
47024
+ const compute = () => {
47025
+ const anchor = anchorRef.current;
47026
+ if (!anchor) {
47027
+ return;
47028
+ }
47029
+ const rect = anchor.getBoundingClientRect();
47030
+ const iconCentre = rect.left + rect.width / 2;
47031
+ let left = iconCentre - TOOLTIP_WIDTH / 2;
47032
+ const maxLeft = window.innerWidth - TOOLTIP_WIDTH - VIEWPORT_PADDING;
47033
+ if (left > maxLeft) {
47034
+ left = maxLeft;
47035
+ }
47036
+ if (left < VIEWPORT_PADDING) {
47037
+ left = VIEWPORT_PADDING;
47038
+ }
47039
+ const top = rect.bottom + ARROW_GAP;
47040
+ const arrowLeftRaw = iconCentre - left - ARROW_WIDTH$1 / 2;
47041
+ const arrowLeftClamped = Math.max(8, Math.min(TOOLTIP_WIDTH - ARROW_WIDTH$1 - 8, arrowLeftRaw));
47042
+ setPos({
47043
+ left,
47044
+ top,
47045
+ arrowLeft: arrowLeftClamped
47046
+ });
47047
+ };
47048
+ compute();
47049
+ window.addEventListener("resize", compute);
47050
+ window.addEventListener("scroll", compute, true);
47051
+ return () => {
47052
+ window.removeEventListener("resize", compute);
47053
+ window.removeEventListener("scroll", compute, true);
47054
+ };
47055
+ }, [anchorRef]);
47056
+ const css2 = useCss((theme) => ({
47057
+ wrapper: {
47058
+ position: "fixed",
47059
+ width: `${TOOLTIP_WIDTH}px`,
47060
+ zIndex: 2147483645,
47061
+ fontFamily: theme.font_family
47062
+ },
47063
+ arrow: {
47064
+ position: "absolute",
47065
+ top: `-${ARROW_HEIGHT$1 - 1}px`,
47066
+ width: `${ARROW_WIDTH$1}px`,
47067
+ height: `${ARROW_HEIGHT$1}px`,
47068
+ color: theme.color_tfr_800,
47069
+ pointerEvents: "none"
47070
+ },
47071
+ body: {
47072
+ backgroundColor: "#FFFFFF",
47073
+ color: theme.color_tfr_800,
47074
+ border: `2px solid ${theme.color_tfr_800}`,
47075
+ padding: "6px 10px",
47076
+ borderRadius: "8px",
47077
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.18)",
47078
+ display: "flex",
47079
+ alignItems: "center",
47080
+ gap: 0
47081
+ },
47082
+ text: {
47083
+ flex: 1,
47084
+ fontSize: "13px",
47085
+ lineHeight: "1.4",
47086
+ color: theme.color_tfr_800,
47087
+ textAlign: "center"
47088
+ },
47089
+ closeBtn: {
47090
+ width: "20px",
47091
+ height: "20px",
47092
+ borderRadius: "10px",
47093
+ border: "none",
47094
+ backgroundColor: "transparent",
47095
+ color: theme.color_tfr_800,
47096
+ cursor: "pointer",
47097
+ padding: 0,
47098
+ display: "flex",
47099
+ alignItems: "center",
47100
+ justifyContent: "center",
47101
+ flex: "none"
47102
+ }
47103
+ }));
47104
+ if (!pos) {
47105
+ return null;
47106
+ }
47107
+ return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, style: {
47108
+ left: `${pos.left}px`,
47109
+ top: `${pos.top}px`
47110
+ }, role: "dialog", "aria-label": text, children: [
47111
+ /* @__PURE__ */ jsx$1("svg", { css: css2.arrow, style: {
47112
+ left: `${pos.arrowLeft}px`
47113
+ }, viewBox: `0 0 ${ARROW_WIDTH$1} ${ARROW_HEIGHT$1}`, xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx$1("polygon", { points: `0,${ARROW_HEIGHT$1} ${ARROW_WIDTH$1 / 2},0 ${ARROW_WIDTH$1},${ARROW_HEIGHT$1}`, fill: "currentColor" }) }),
47114
+ /* @__PURE__ */ jsxs("div", { css: css2.body, children: [
47115
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.text, children: text }),
47116
+ /* @__PURE__ */ jsx$1("button", { css: css2.closeBtn, onClick: onDismiss, "aria-label": dismissAriaLabel, children: /* @__PURE__ */ jsx$1("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx$1("path", { d: "M1 1L9 9M9 1L1 9", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) }) })
47117
+ ] })
47118
+ ] });
47119
+ }
46710
47120
  const logger$4 = getLogger("widgets/add-to-fitting-room-compact");
47121
+ const FIRST_ADD_KEY = "tfr:first-add-tooltip-seen:v1";
47122
+ const TOOLTIP_AUTO_DISMISS_MS$1 = 1e4;
47123
+ let firstAddTooltipClaimed = false;
47124
+ const pulse$1 = keyframes`
47125
+ 0% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0.6); }
47126
+ 70% { box-shadow: 0 0 0 10px rgba(38, 90, 100, 0); }
47127
+ 100% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0); }
47128
+ `;
46711
47129
  function AddToFittingRoomCompactWidget({
46712
47130
  attributes
46713
47131
  }) {
@@ -46723,7 +47141,60 @@ function AddToFittingRoomCompactWidget({
46723
47141
  const isPdp = productId != null && productId === currentProduct?.externalId;
46724
47142
  const productHandle = attrProductHandle || (isPdp ? currentProduct?.handle ?? null : null);
46725
47143
  const isInFittingRoom = useMainStore((state) => productId == null ? false : state.fittingRoom.some((item) => item.externalId === productId));
47144
+ const [showTooltip, setShowTooltip] = reactExports.useState(false);
47145
+ const wrapperRef = reactExports.useRef(null);
47146
+ const buttonRef = reactExports.useRef(null);
47147
+ reactExports.useEffect(() => {
47148
+ if (firstAddTooltipClaimed) {
47149
+ return;
47150
+ }
47151
+ try {
47152
+ if (window.localStorage.getItem(FIRST_ADD_KEY)) {
47153
+ return;
47154
+ }
47155
+ } catch (error) {
47156
+ logger$4.logWarn("Failed to read first-add tooltip flag", {
47157
+ error
47158
+ });
47159
+ return;
47160
+ }
47161
+ firstAddTooltipClaimed = true;
47162
+ setShowTooltip(true);
47163
+ }, []);
47164
+ const dismissTooltip = reactExports.useCallback(() => {
47165
+ setShowTooltip(false);
47166
+ try {
47167
+ window.localStorage.setItem(FIRST_ADD_KEY, "true");
47168
+ } catch (error) {
47169
+ logger$4.logWarn("Failed to write first-add tooltip flag", {
47170
+ error
47171
+ });
47172
+ }
47173
+ }, []);
47174
+ reactExports.useEffect(() => {
47175
+ if (!showTooltip) {
47176
+ return;
47177
+ }
47178
+ const timer = window.setTimeout(dismissTooltip, TOOLTIP_AUTO_DISMISS_MS$1);
47179
+ return () => window.clearTimeout(timer);
47180
+ }, [showTooltip, dismissTooltip]);
47181
+ reactExports.useEffect(() => {
47182
+ if (!showTooltip) {
47183
+ return;
47184
+ }
47185
+ const onDocClick = (e) => {
47186
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
47187
+ dismissTooltip();
47188
+ }
47189
+ };
47190
+ document.addEventListener("mousedown", onDocClick);
47191
+ return () => document.removeEventListener("mousedown", onDocClick);
47192
+ }, [showTooltip, dismissTooltip]);
46726
47193
  const css2 = useCss((theme) => ({
47194
+ wrapper: {
47195
+ position: "relative",
47196
+ display: "inline-block"
47197
+ },
46727
47198
  button: {
46728
47199
  display: "inline-flex",
46729
47200
  alignItems: "center",
@@ -46739,6 +47210,9 @@ function AddToFittingRoomCompactWidget({
46739
47210
  buttonAdded: {
46740
47211
  backgroundColor: theme.color_fg_text
46741
47212
  },
47213
+ buttonPulsing: {
47214
+ animation: `${pulse$1} 1.8s ease-out infinite`
47215
+ },
46742
47216
  icon: {
46743
47217
  width: "24px",
46744
47218
  height: "24px",
@@ -46752,6 +47226,9 @@ function AddToFittingRoomCompactWidget({
46752
47226
  return null;
46753
47227
  }
46754
47228
  const handleClick = () => {
47229
+ if (showTooltip) {
47230
+ dismissTooltip();
47231
+ }
46755
47232
  toggleFittingRoomItem(productId, productHandle, isPdp).catch((error) => {
46756
47233
  logger$4.logError("toggleFittingRoomItem failed", {
46757
47234
  error
@@ -46759,9 +47236,190 @@ function AddToFittingRoomCompactWidget({
46759
47236
  });
46760
47237
  };
46761
47238
  const ariaLabel = t(isInFittingRoom ? "added_to_fitting_room" : "add_to_fitting_room");
46762
- return /* @__PURE__ */ jsx$1("button", { type: "button", onClick: handleClick, css: [css2.button, isInFittingRoom && css2.buttonAdded, "", ""], "aria-label": ariaLabel, "aria-pressed": isInFittingRoom, children: /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: [css2.icon, isInFittingRoom && css2.iconAdded, "", ""] }) });
47239
+ return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, css: css2.wrapper, children: [
47240
+ /* @__PURE__ */ jsx$1("button", { ref: buttonRef, type: "button", onClick: handleClick, css: [css2.button, isInFittingRoom && css2.buttonAdded, showTooltip && css2.buttonPulsing, "", ""], "aria-label": ariaLabel, "aria-pressed": isInFittingRoom, children: /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: [css2.icon, isInFittingRoom && css2.iconAdded, "", ""] }) }),
47241
+ showTooltip ? /* @__PURE__ */ jsx$1(FirstVisitTooltip, { text: t("first_add_tooltip.body"), dismissAriaLabel: t("first_add_tooltip.dismiss"), onDismiss: dismissTooltip, anchorRef: buttonRef }) : null
47242
+ ] });
47243
+ }
47244
+ const ARROW_WIDTH = 32;
47245
+ const ARROW_HEIGHT = 16;
47246
+ const ARROW_RIGHT = 6;
47247
+ function AddConfirmationDrawer({
47248
+ onDismiss,
47249
+ onOpenOverlay,
47250
+ onInteract
47251
+ }) {
47252
+ const {
47253
+ t
47254
+ } = useTranslation();
47255
+ const fittingRoom = useMainStore((state) => state.fittingRoom);
47256
+ const merchantProductData = useMainStore((state) => state.merchantProductData);
47257
+ const removeFromFittingRoom = useMainStore((state) => state.removeFromFittingRoom);
47258
+ reactExports.useEffect(() => {
47259
+ void loadMerchantProductData(fittingRoom);
47260
+ }, [fittingRoom]);
47261
+ const css2 = useCss((theme) => ({
47262
+ wrapper: {
47263
+ position: "absolute",
47264
+ top: "100%",
47265
+ right: 0,
47266
+ marginTop: `${ARROW_HEIGHT}px`,
47267
+ width: "320px",
47268
+ zIndex: 2147483646,
47269
+ fontFamily: theme.font_family
47270
+ },
47271
+ arrow: {
47272
+ position: "absolute",
47273
+ top: `-${ARROW_HEIGHT - 1}px`,
47274
+ right: `${ARROW_RIGHT}px`,
47275
+ width: `${ARROW_WIDTH}px`,
47276
+ height: `${ARROW_HEIGHT}px`,
47277
+ color: theme.color_tfr_800,
47278
+ pointerEvents: "none"
47279
+ },
47280
+ drawer: {
47281
+ width: "100%",
47282
+ maxHeight: "480px",
47283
+ backgroundColor: "#FFFFFF",
47284
+ border: `3px solid ${theme.color_tfr_800}`,
47285
+ borderRadius: "8px",
47286
+ boxShadow: "0 6px 20px rgba(0, 0, 0, 0.18)",
47287
+ display: "flex",
47288
+ flexDirection: "column",
47289
+ overflow: "hidden"
47290
+ },
47291
+ header: {
47292
+ position: "relative",
47293
+ padding: "12px 40px",
47294
+ borderBottom: `1px solid rgba(0, 0, 0, 0.1)`
47295
+ },
47296
+ title: {
47297
+ fontSize: "14px",
47298
+ fontWeight: "bold",
47299
+ textAlign: "center"
47300
+ },
47301
+ closeBtn: {
47302
+ position: "absolute",
47303
+ top: "8px",
47304
+ right: "8px",
47305
+ width: "24px",
47306
+ height: "24px",
47307
+ borderRadius: "12px",
47308
+ border: "none",
47309
+ backgroundColor: "transparent",
47310
+ color: theme.color_fg_text,
47311
+ cursor: "pointer",
47312
+ padding: 0,
47313
+ display: "flex",
47314
+ alignItems: "center",
47315
+ justifyContent: "center"
47316
+ },
47317
+ subheader: {
47318
+ padding: "10px 14px",
47319
+ fontSize: "12px",
47320
+ color: theme.color_fg_text,
47321
+ backgroundColor: "#F4F4F4",
47322
+ textAlign: "center"
47323
+ },
47324
+ list: {
47325
+ overflowY: "auto",
47326
+ flex: 1,
47327
+ display: "flex",
47328
+ flexDirection: "column"
47329
+ },
47330
+ item: {
47331
+ display: "flex",
47332
+ alignItems: "center",
47333
+ gap: "10px",
47334
+ padding: "10px 14px",
47335
+ borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
47336
+ },
47337
+ thumb: {
47338
+ width: "48px",
47339
+ height: "60px",
47340
+ backgroundColor: "#F4F4F4",
47341
+ flex: "none",
47342
+ objectFit: "cover"
47343
+ },
47344
+ itemBody: {
47345
+ flex: 1,
47346
+ display: "flex",
47347
+ flexDirection: "column",
47348
+ gap: "2px",
47349
+ minWidth: 0
47350
+ },
47351
+ itemName: {
47352
+ fontSize: "13px",
47353
+ lineHeight: "1.3",
47354
+ overflow: "hidden",
47355
+ textOverflow: "ellipsis",
47356
+ whiteSpace: "nowrap"
47357
+ },
47358
+ itemMeta: {
47359
+ fontSize: "12px",
47360
+ color: theme.color_fg_text,
47361
+ opacity: 0.7
47362
+ },
47363
+ removeBtn: {
47364
+ width: "32px",
47365
+ height: "32px",
47366
+ borderRadius: "16px",
47367
+ border: "none",
47368
+ backgroundColor: "transparent",
47369
+ cursor: "pointer",
47370
+ padding: 0,
47371
+ display: "flex",
47372
+ alignItems: "center",
47373
+ justifyContent: "center",
47374
+ flex: "none"
47375
+ },
47376
+ removeIcon: {
47377
+ width: "16px",
47378
+ height: "16px"
47379
+ },
47380
+ ctaWrapper: {
47381
+ padding: "12px 14px",
47382
+ borderTop: `1px solid rgba(0, 0, 0, 0.1)`
47383
+ }
47384
+ }));
47385
+ return /* @__PURE__ */ jsxs("div", { css: css2.wrapper, role: "dialog", "aria-label": t("add_confirmation.title"), onMouseEnter: onInteract, onPointerDown: onInteract, onFocus: onInteract, children: [
47386
+ /* @__PURE__ */ jsx$1("svg", { css: css2.arrow, viewBox: `0 0 ${ARROW_WIDTH} ${ARROW_HEIGHT}`, xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx$1("polygon", { points: `0,${ARROW_HEIGHT} ${ARROW_WIDTH / 2},0 ${ARROW_WIDTH},${ARROW_HEIGHT}`, fill: "currentColor" }) }),
47387
+ /* @__PURE__ */ jsxs("div", { css: css2.drawer, children: [
47388
+ /* @__PURE__ */ jsxs("div", { css: css2.header, children: [
47389
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.title, children: t("add_confirmation.title") }),
47390
+ /* @__PURE__ */ jsx$1("button", { css: css2.closeBtn, onClick: onDismiss, "aria-label": t("add_confirmation.dismiss"), children: /* @__PURE__ */ jsx$1("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx$1("path", { d: "M1 1L9 9M9 1L1 9", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) }) })
47391
+ ] }),
47392
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.subheader, children: t("add_confirmation.added_header") }),
47393
+ /* @__PURE__ */ jsx$1("div", { css: css2.list, children: fittingRoom.map((item) => {
47394
+ const merchant = merchantProductData[item.externalId];
47395
+ const product = merchant && !("error" in merchant) ? merchant : null;
47396
+ const variant = product?.variants.find((v) => v.color === item.color && (!item.size || v.size === item.size)) ?? product?.variants.find((v) => v.color === item.color) ?? null;
47397
+ const imageUrl = variant?.imageUrl ?? product?.imageUrl ?? null;
47398
+ const name2 = product?.productName ?? item.externalId;
47399
+ const price = variant?.priceFormatted ?? product?.variants[0]?.priceFormatted ?? null;
47400
+ const metaParts = [item.color, price].filter(Boolean);
47401
+ return /* @__PURE__ */ jsxs("div", { css: css2.item, children: [
47402
+ imageUrl ? /* @__PURE__ */ jsx$1("img", { src: imageUrl, css: css2.thumb, alt: "" }) : /* @__PURE__ */ jsx$1("div", { css: css2.thumb }),
47403
+ /* @__PURE__ */ jsxs("div", { css: css2.itemBody, children: [
47404
+ /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemName, children: name2 }),
47405
+ metaParts.length > 0 ? /* @__PURE__ */ jsx$1(Text, { variant: "base", css: css2.itemMeta, children: metaParts.join(" · ") }) : null
47406
+ ] }),
47407
+ /* @__PURE__ */ jsx$1("button", { css: css2.removeBtn, onClick: () => removeFromFittingRoom(item.externalId), "aria-label": t("add_confirmation.remove"), children: /* @__PURE__ */ jsx$1(SvgTrashIcon, { css: css2.removeIcon }) })
47408
+ ] }, item.externalId);
47409
+ }) }),
47410
+ /* @__PURE__ */ jsx$1("div", { css: css2.ctaWrapper, children: /* @__PURE__ */ jsx$1(Button, { variant: "primary", onClick: onOpenOverlay, children: t("add_confirmation.cta") }) })
47411
+ ] })
47412
+ ] });
46763
47413
  }
46764
47414
  const logger$3 = getLogger("widgets/fitting-room-icon");
47415
+ const DRAWER_AUTO_DISMISS_MS = 6e3;
47416
+ const TOOLTIP_AUTO_DISMISS_MS = 1e4;
47417
+ const FIRST_VISIT_KEY = "tfr:first-visit-tooltip-seen:v1";
47418
+ const pulse = keyframes`
47419
+ 0% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0.6); }
47420
+ 70% { box-shadow: 0 0 0 10px rgba(38, 90, 100, 0); }
47421
+ 100% { box-shadow: 0 0 0 0 rgba(38, 90, 100, 0); }
47422
+ `;
46765
47423
  function FittingRoomIconWidget(_props) {
46766
47424
  const {
46767
47425
  t
@@ -46770,7 +47428,85 @@ function FittingRoomIconWidget(_props) {
46770
47428
  const isOpen = useMainStore((state) => state.activeOverlay === OverlayName.FITTING_ROOM);
46771
47429
  const openOverlay = useMainStore((state) => state.openOverlay);
46772
47430
  const closeOverlay = useMainStore((state) => state.closeOverlay);
47431
+ const lastAddEvent = useMainStore((state) => state.lastAddEvent);
47432
+ const [drawerOpen, setDrawerOpen] = reactExports.useState(false);
47433
+ const [showTooltip, setShowTooltip] = reactExports.useState(false);
47434
+ const wrapperRef = reactExports.useRef(null);
47435
+ const buttonRef = reactExports.useRef(null);
47436
+ const drawerAutoDismissTimerRef = reactExports.useRef(null);
47437
+ reactExports.useEffect(() => {
47438
+ try {
47439
+ if (!window.localStorage.getItem(FIRST_VISIT_KEY)) {
47440
+ setShowTooltip(true);
47441
+ }
47442
+ } catch (error) {
47443
+ logger$3.logWarn("Failed to read first-visit flag", {
47444
+ error
47445
+ });
47446
+ }
47447
+ }, []);
47448
+ const dismissTooltip = reactExports.useCallback(() => {
47449
+ setShowTooltip(false);
47450
+ try {
47451
+ window.localStorage.setItem(FIRST_VISIT_KEY, "true");
47452
+ } catch (error) {
47453
+ logger$3.logWarn("Failed to write first-visit flag", {
47454
+ error
47455
+ });
47456
+ }
47457
+ }, []);
47458
+ reactExports.useEffect(() => {
47459
+ if (!showTooltip) {
47460
+ return;
47461
+ }
47462
+ const timer = window.setTimeout(dismissTooltip, TOOLTIP_AUTO_DISMISS_MS);
47463
+ return () => window.clearTimeout(timer);
47464
+ }, [showTooltip, dismissTooltip]);
47465
+ const cancelDrawerAutoDismiss = reactExports.useCallback(() => {
47466
+ if (drawerAutoDismissTimerRef.current !== null) {
47467
+ window.clearTimeout(drawerAutoDismissTimerRef.current);
47468
+ drawerAutoDismissTimerRef.current = null;
47469
+ }
47470
+ }, []);
47471
+ reactExports.useEffect(() => {
47472
+ if (!lastAddEvent) {
47473
+ return;
47474
+ }
47475
+ setDrawerOpen(true);
47476
+ cancelDrawerAutoDismiss();
47477
+ drawerAutoDismissTimerRef.current = window.setTimeout(() => {
47478
+ setDrawerOpen(false);
47479
+ drawerAutoDismissTimerRef.current = null;
47480
+ }, DRAWER_AUTO_DISMISS_MS);
47481
+ return cancelDrawerAutoDismiss;
47482
+ }, [lastAddEvent, cancelDrawerAutoDismiss]);
47483
+ reactExports.useEffect(() => {
47484
+ if (!drawerOpen && !showTooltip) {
47485
+ return;
47486
+ }
47487
+ const onDocClick = (e) => {
47488
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
47489
+ if (drawerOpen) {
47490
+ setDrawerOpen(false);
47491
+ }
47492
+ if (showTooltip) {
47493
+ dismissTooltip();
47494
+ }
47495
+ }
47496
+ };
47497
+ document.addEventListener("mousedown", onDocClick);
47498
+ return () => document.removeEventListener("mousedown", onDocClick);
47499
+ }, [drawerOpen, showTooltip, dismissTooltip]);
47500
+ reactExports.useEffect(() => {
47501
+ if (drawerOpen && count === 0) {
47502
+ setDrawerOpen(false);
47503
+ }
47504
+ }, [drawerOpen, count]);
46773
47505
  const css2 = useCss((theme) => ({
47506
+ wrapper: {
47507
+ position: "relative",
47508
+ display: "inline-block"
47509
+ },
46774
47510
  button: {
46775
47511
  position: "relative",
46776
47512
  display: "inline-flex",
@@ -46784,6 +47520,10 @@ function FittingRoomIconWidget(_props) {
46784
47520
  cursor: "pointer",
46785
47521
  color: "inherit"
46786
47522
  },
47523
+ buttonPulsing: {
47524
+ borderRadius: "50%",
47525
+ animation: `${pulse} 1.8s ease-out infinite`
47526
+ },
46787
47527
  icon: {
46788
47528
  width: "24px",
46789
47529
  height: "24px",
@@ -46806,6 +47546,9 @@ function FittingRoomIconWidget(_props) {
46806
47546
  }
46807
47547
  }));
46808
47548
  const handleClick = () => {
47549
+ if (showTooltip) {
47550
+ dismissTooltip();
47551
+ }
46809
47552
  if (isOpen) {
46810
47553
  logger$3.logDebug("{{ts}} - Closing fitting room overlay", {
46811
47554
  count
@@ -46817,10 +47560,21 @@ function FittingRoomIconWidget(_props) {
46817
47560
  count
46818
47561
  });
46819
47562
  openOverlay(OverlayName.FITTING_ROOM);
47563
+ setDrawerOpen(false);
46820
47564
  };
46821
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleClick, css: css2.button, "aria-label": t("view_fitting_room"), children: [
46822
- /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: css2.icon }),
46823
- count > 0 && /* @__PURE__ */ jsx$1("span", { css: css2.badge, children: count })
47565
+ const handleOpenFromDrawer = () => {
47566
+ openOverlay(OverlayName.FITTING_ROOM);
47567
+ setDrawerOpen(false);
47568
+ };
47569
+ return /* @__PURE__ */ jsxs("div", { ref: wrapperRef, css: css2.wrapper, children: [
47570
+ /* @__PURE__ */ jsxs("button", { ref: buttonRef, type: "button", onClick: handleClick, css: /* @__PURE__ */ css$1({
47571
+ ...css2.button,
47572
+ ...showTooltip && !drawerOpen ? css2.buttonPulsing : {}
47573
+ }, "", ""), "aria-label": t("view_fitting_room"), children: [
47574
+ /* @__PURE__ */ jsx$1(SvgFittingRoomIcon, { css: css2.icon }),
47575
+ count > 0 && /* @__PURE__ */ jsx$1("span", { css: css2.badge, children: count })
47576
+ ] }),
47577
+ drawerOpen ? /* @__PURE__ */ jsx$1(AddConfirmationDrawer, { onDismiss: () => setDrawerOpen(false), onOpenOverlay: handleOpenFromDrawer, onInteract: cancelDrawerAutoDismiss }) : showTooltip ? /* @__PURE__ */ jsx$1(FirstVisitTooltip, { text: t("first_visit_tooltip.body"), dismissAriaLabel: t("first_visit_tooltip.dismiss"), onDismiss: dismissTooltip, anchorRef: buttonRef }) : null
46824
47578
  ] });
46825
47579
  }
46826
47580
  const logger$2 = getLogger("widgets/fitting-room");
@@ -47204,6 +47958,13 @@ const useMainStore = create((set) => ({
47204
47958
  fittingRoom: []
47205
47959
  };
47206
47960
  }),
47961
+ lastAddEvent: null,
47962
+ setLastAddEvent: (externalId) => set({
47963
+ lastAddEvent: {
47964
+ externalId,
47965
+ at: Date.now()
47966
+ }
47967
+ }),
47207
47968
  // UI state:
47208
47969
  activeOverlay: null,
47209
47970
  activeOverlayProps: null,
@@ -47260,9 +48021,9 @@ const SHARED_CONFIG = {
47260
48021
  appGooglePlayUrl: "https://play.google.com/store/apps/details?id=com.thefittingroom.marketplace"
47261
48022
  },
47262
48023
  build: {
47263
- version: `${"5.0.31"}`,
47264
- commitHash: `${"992c5c6"}`,
47265
- date: `${"2026-06-07T14:43:50.848Z"}`
48024
+ version: `${"5.0.33"}`,
48025
+ commitHash: `${"afc37c2"}`,
48026
+ date: `${"2026-07-13T00:09:22.660Z"}`
47266
48027
  }
47267
48028
  };
47268
48029
  const CONFIGS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thefittingroom/shop-ui",
3
- "version": "5.0.31",
3
+ "version": "5.0.33",
4
4
  "description": "the fitting room UI library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",