1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38416],{70003(t,e,a){a.d(e,{xM:()=>c});var r=a(3219),n=a(94389);let o=(0,r.Ay)` 2 mutation AddProductsToCart($cartId: String!, $cartItems: [CartItemInput!]!) { 3 addProductsToCart(cartId: $cartId, cartItems: $cartItems) { 4 cart { 5 ...CartContentLightFragment 6 } 7 user_errors { 8 code 9 message 10 } 11 } 12} 13 ${n.I2}`,i=(t,e,a,r)=>t();function c(t,e=i){return{AddProductsToCart:(a,r,n)=>e(e=>t.request({document:o,variables:a,requestHeaders:{...r,...e},signal:n}),"AddProductsToCart","mutation",a)}}},94389(t,e,a){a.d(e,{I2:()=>g});var r=a(3219),n=a(95441),o=a(63434),i=a(13031),c=a(58263),u=a(17531);let s=(0,r.Ay)` 14 fragment CartContentItemProductFragment on ProductInterface { 15 __typename 16 uid 17 attribute_set_id 18 name 19 sku 20 product_sku 21 case_dimension 22 case_material 23 case_glass 24 case_weight 25 dial_color 26 filter_width_strap 27 dimensions_width_bracelet 28 information_movement 29 url_key 30 custom_watch_collection 31 small_image { 32 ...MediaGalleryItem 33 } 34 thumbnail { 35 ...MediaGalleryItem 36 } 37 image { 38 ...MediaGalleryItem 39 } 40 preferred_category { 41 ...PreferredCategoryFragment 42 } 43 ...ProductDataLayerAttributes 44 ... on SimpleProduct { 45 options { 46 ...ProductCustomizableOptionFragment 47 } 48 } 49 ... on ConfigurableProduct { 50 variants { 51 attributes { 52 uid 53 label 54 } 55 ...ConfigurableProductCardOptionsFragment 56 } 57 } 58} 59 ${n.uT} 60${o.cr} 61${i.SX} 62${c.po} 63${u.Bg}`;var l=a(80221);let d=(0,r.Ay)` 64 fragment ConfigurableCartItemFragment on ConfigurableCartItem { 65 configurable_options { 66 configurable_product_option_uid 67 option_label 68 configurable_product_option_value_uid 69 value_label 70 } 71 configured_variant { 72 image { 73 ...MediaGalleryItem 74 } 75 small_image { 76 ...MediaGalleryItem 77 } 78 thumbnail { 79 ...MediaGalleryItem 80 } 81 base_price { 82 ...CartMoneyFragment 83 } 84 special_price 85 } 86} 87 ${n.uT} 88${l.pS}`,m=(0,r.Ay)` 89 fragment SimpleCartItemFragment on SimpleCartItem { 90 customizable_options { 91 customizable_option_uid 92 label 93 values { 94 value 95 label 96 } 97 } 98} 99 `,_=(0,r.Ay)` 100 fragment CartContentItemFragment on CartItemInterface { 101 __typename 102 id 103 uid 104 quantity 105 product { 106 ...CartContentItemProductFragment 107 base_price { 108 ...CartMoneyFragment 109 } 110 special_price 111 } 112 ...ConfigurableCartItemFragment 113 ...SimpleCartItemFragment 114 prices { 115 price { 116 ...CartMoneyFragment 117 } 118 row_total { 119 ...CartMoneyFragment 120 } 121 row_total_including_tax { 122 ...CartMoneyFragment 123 } 124 } 125 is_preorder 126 preorder_estimate_shipping_date 127 errors { 128 code 129 message 130 } 131} 132 ${s} 133${l.pS} 134${d} 135${m}`,p=(0,r.Ay)` 136 fragment CartPricesFragment on CartPrices { 137 __typename 138 grand_total { 139 ...CartMoneyFragment 140 } 141 subtotal_excluding_tax { 142 ...CartMoneyFragment 143 } 144 subtotal_including_tax { 145 ...CartMoneyFragment 146 } 147 subtotal_with_discount_excluding_tax { 148 ...CartMoneyFragment 149 } 150 tax_amount { 151 ...CartMoneyFragment 152 } 153 applied_taxes { 154 amount { 155 ...CartMoneyFragment 156 } 157 label 158 percent 159 } 160 discounts { 161 label 162 amount { 163 ...CartMoneyFragment 164 } 165 } 166 shipping_amount { 167 ...CartMoneyFragment 168 } 169 shipping_incl_tax { 170 ...CartMoneyFragment 171 } 172 delivery_fee { 173 label 174 amount { 175 ...CartMoneyFragment 176 } 177 } 178 sustainability_fee { 179 label 180 amount { 181 ...CartMoneyFragment 182 } 183 } 184 pay_later_excluding_tax { 185 ...CartMoneyFragment 186 } 187 pay_later_including_tax { 188 ...CartMoneyFragment 189 } 190 pay_now_excluding_tax { 191 ...CartMoneyFragment 192 } 193 pay_now_including_tax { 194 ...CartMoneyFragment 195 } 196} 197 ${l.pS}`,g=(0,r.Ay)` 198 fragment CartContentLightFragment on Cart { 199 __typename 200 id 201 email 202 total_quantity 203 is_virtual 204 items { 205 uid 206 ...CartContentItemFragment 207 } 208 prices { 209 ...CartPricesFragment 210 } 211 applied_coupons { 212 code 213 } 214 gift_message { 215 from 216 message 217 } 218 is_preorder 219 preorder_info { 220 mode 221 down_payment 222 delivery_date 223 } 224} 225 ${_} 226${p}`},17531(t,e,a){a.d(e,{Bg:()=>
226o});var r=a(3219),n=a(2028);let o=(0,r.Ay)` 227 fragment ConfigurableProductCardOptionsFragment on ConfigurableVariant { 228 product { 229 uid 230 product_sku 231 sku 232 stock_status 233 ...ProductPrice 234 } 235} 236 ${n.F6}`},58366(t,e,a){a.d(e,{A:()=>n});var r=a(49171);function n(t,e){let a=(0,r.A)(t);return{currency:a?.currency,value:a?.value,items:e}}},38416(t,e,a){a.d(e,{A:()=>f});var r=a(89099),n=a(14232),o=a(73668),i=a(52306),c=a(39822),u=a(39914),s=a(95334),l=a(93972),d=a(56034),m=a(58366),_=a(26819),p=a(61539),g=a(19238),y=a(47614),C=a(49171);function f(t){let{addToCart:e}=(0,u.A)(),{isOpen:a,display:f,close:b}=(0,l.cB)("add-to-cart-simple"),{setAddedDialogOpened:A}=(0,c.r)(),{pathname:P}=(0,r.useRouter)(),F=P.startsWith("/p/"),{productAttributesDefaultData:h}=(0,d.A)(),{sizeOptions:I}=(0,s.A)(t),[k,M]=(0,n.useState)(!1),S=t?.sku??"",v=I?.uid??"",w=(0,n.useCallback)(()=>{if(!t)return;let e=(0,y.TJ)(t.attribute_set_id),a=(0,y.uU)(t.attribute_set_id),r=e?"Watch":a?"Strap":null;r&&((0,p.A)("dataLayer",`Popin Addtocart ${r} 1`),(0,g.A)("add_to_cart_popin_1",{element_id:e?"watches":"strap"})),f()},[t,f]),$=(0,n.useCallback)(async(a,r)=>{if(t&&t.sku){if(k)return console.warn("Add to cart loading ...");try{M(!0);let n={quantity:1,sku:S};a&&(n.entered_options=a),await e({cartItemInput:n,product:t}),b(),F&&A(!0),(0,p.A)("dataLayerGA4","add_to_cart",{ecommerce:(0,m.A)(t,[(0,_.v)(h,t)])}),(0,p.A)("dataLayer","addToCart",{ecommerce:{currencyCode:t.base_price?.currency||"",add:{actionField:{step:"1",description:"Add to Cart"},products:[{id:t.sku,name:t.name,collection:t.preferred_category?.name,price:(0,C.A)(t)?.value,quantity:1}]}}}),r?.()}catch(t){o.o.error((0,i.A)(t))}finally{M(!1)}}},[t,k,S,e,b,F,A,h]),x=(0,n.useCallback)(async t=>{v&&await $([{uid:v,value:t.size}])},[$,v]);return{addToCartLoading:k,isOpen:a,productSizeOptions:I,handleOpenOptions:w,triggerAddToCart:$,onSubmitSelectOption:x,close:b}}},39914(t,e,a){a.d(e,{A:()=>b});var r=a(20998),n=a(97209),o=a(14232),i=a(90936),c=a(42570),u=a(39822),s=a(40374),l=a(51701),d=a(70003),m=a(9799);let _=async(t,e)=>{let a=await (0,d.xM)(t).AddProductsToCart(e),r=(0,m.A)(a.addProductsToCart?.user_errors);if(r.length)throw r;return a};var p=a(91447),g=a(79829),y=a(96268),C=a(33264),f=a(47614);function b(){let{getClient:t}=(0,p.o)(),{getCartId:e}=(0,s.A)(),{mutateCart:a}=(0,l.A)(),{setAddedToCartItems:d,setAddedDialogPreload:m}=(0,u.r)(),{t:b}=(0,n.Bd)(),{pathname:A}=(0,i.m)(),P=A.startsWith("/p/"),{mutateTags:F}=(0,c.A)(),h=function(){let{getClient:t}=(0,y.o)(),e=t();return(0,o.useCallback)(async t=>{let a=t?.filter(t=>(0,f.TJ)(t.product.attribute_set_id)),r=a?.[0]?.product.sku;if(r){let t={skus:[r]},a=await (0,C.xM)(e).GetSimulatorBySkus(t);await (0,g.j)(["GetSimulatorBySkusDocument",t],a)}},[e])}(),I=(0,o.useCallback)(async(n,o=!1)=>{try{let{client:r}=t(),i=await e(o);P&&m(!0);let[,c]=await Promise.all([h([n]),_(r,{cartId:i,cartItems:n.cartItemInput})]);d([n]);let u=c.addProductsToCart?.cart;return a(u).catch(),await F("#checkout"),b("common:messages.addToCartSuccess")}
236catch(t){if(!o&&t instanceof r.MZ&&t.response.errors?.some(t=>t.path?.includes("addProductsToCart")&&t.extensions?.category==="graphql-no-such-entity"))return I(n,!0);throw t.message?t:t.map(t=>t?.message).join("\r\n")}},[e,t,P,a,F,h,m,d,b]);return{addToCart:I}}},51701(t,e,a){a.d(e,{A:()=>c});var r=a(14232),n=a(52561),o=a(40374),i=a(68376);function c(){let{cartId:t}=(0,o.A)(),e=(0,i.A)(),{setCount:a}=(0,n.A)();return{mutateCart:(0,r.useCallback)(async r=>{let n=r?.id||t;return a(r?.total_quantity??0),e(n,r)},[t,e,a])}}},9799(t,e,a){a.d(e,{A:()=>r});let r=t=>t?.filter(t=>t)||[]},95334(t,e,a){a.d(e,{A:()=>l});var r=a(14232),n=a(96268),o=a(3219),i=a(58263),c=a(75656);let u=(0,o.Ay)` 237 query LoadProductSizeOptions($sku: String!) { 238 product(sku: $sku) { 239 __typename 240 id 241 uid 242 ... on SimpleProduct { 243 options { 244 ...ProductCustomizableOptionFragment 245 } 246 } 247 } 248} 249 ${i.po}`,s=(t,e,a,r)=>t();function l(t){let{getClient:e}=(0,n.o)(),{data:a,error:o,isLoading:i}=(function(t,e=s){let a=function(t,e=s){return{LoadProductSizeOptions:(a,r,n)=>e(e=>t.request({document:u,variables:a,requestHeaders:{...r,...e},signal:n}),"LoadProductSizeOptions","query",a)}}(t,e);return{...a,useLoadProductSizeOptions:(t,e,r)=>(0,c.Ay)(t,()=>a.LoadProductSizeOptions(e),r)}})(e({akamaiTags:["L-PDP-Size-Options"]})).useLoadProductSizeOptions(t?.sku?["LoadProductSizeOptions",t.sku]:null,{sku:t?.sku||""});return{sizeOptions:(0,r.useMemo)(()=>{let t=a?.product;if(t?.__typename!=="SimpleProduct")return null;let e=t.options&&t.options.length?t.options[0]:null;return e||null},[a]),error:o,isLoading:i}}},13031(t,e,a){a.d(e,{PF:()=>o,SX:()=>n});var r=a(3219);let n=(0,r.Ay)` 250 fragment ProductDataLayerAttributes on ProductInterface { 251 bracelet_color 252 bracelet_interchangeability 253 bracelet_material 254 case_dimension 255 case_material 256 case_shape 257 case_water_resistance 258 description_color 259 dial_color 260 dial_specificities 261 dimensions_width_bracelet 262 filter_related_collections 263 mvt_fct_functions 264 mvt_fct_type 265} 266 `,o=(0,r.Ay)` 267 fragment SRProductDataLayerAttributes on SRProductInterface { 268 bracelet_color 269 bracelet_interchangeability 270 bracelet_material 271 case_dimension 272 case_material 273 case_shape 274 case_water_resistance 275 description_color 276 dial_color 277 dial_specificities 278 dimensions_width_bracelet 279 mvt_fct_functions 280 mvt_fct_type 281} 282 `}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.