(window.webpackJsonpbelcorp_firework_components_container_0_0_5=window.webpackJsonpbelcorp_firework_components_container_0_0_5||[]).push([[0],{13:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_PRODUCTS_BY_ID"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"salesChannel"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"belcorp.firework-components-container@0.0.5",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productsByIdentifier"},arguments:[{kind:"Argument",name:{kind:"Name",value:"field"},value:{kind:"EnumValue",value:"id"}},{kind:"Argument",name:{kind:"Name",value:"values"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"salesChannel"},value:{kind:"Variable",name:{kind:"Name",value:"salesChannel"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.search-graphql",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"c5580965eee5b79efb70b06851cce733a00ea48314e32d3b4a74a1e1d7cc4a1d",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"brand"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"titleTag"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"metaTagDescription"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"link"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceRange"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"sellingPrice"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lowPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"itemId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"nameComplete"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"complementName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"measurementUnit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sellerId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellerDefault"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"commertialOffer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"Price"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ListPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"spotPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"PriceWithoutDiscount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"AvailableQuantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"variations"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"values"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"unitMultiplier"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"estimatedDateArrival"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"images"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"imageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1249}};i.loc.source={body:'query GET_PRODUCTS_BY_ID($id: [ID!], $salesChannel: String) @context(sender: "belcorp.firework-components-container@0.0.5") {\n productsByIdentifier(field: id, values: $id, salesChannel: $salesChannel) @context(provider: "vtex.search-graphql") @runtimeMeta(hash: "c5580965eee5b79efb70b06851cce733a00ea48314e32d3b4a74a1e1d7cc4a1d") {\n brand\n description\n titleTag\n metaTagDescription\n productName\n productId\n link\n priceRange {\n listPrice {\n highPrice\n lowPrice\n __typename\n }\n sellingPrice {\n highPrice\n lowPrice\n __typename\n }\n __typename\n }\n items {\n itemId\n name\n nameComplete\n complementName\n measurementUnit\n sellers {\n sellerId\n sellerName\n sellerDefault\n commertialOffer {\n Price\n ListPrice\n spotPrice\n PriceWithoutDiscount\n AvailableQuantity\n __typename\n }\n __typename\n }\n variations {\n values\n name\n __typename\n }\n unitMultiplier\n estimatedDateArrival\n images {\n imageId\n imageUrl\n __typename\n }\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var u=l;l=new Set,u.forEach((function(e){d.has(e)||(d.add(e),(a[e]||new Set).forEach((function(e){l.add(e)})))}))}return d.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"GET_PRODUCTS_BY_ID")},15:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_ORDERFORM"},variableDefinitions:[],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"belcorp.firework-components-container@0.0.5",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"orderForm"},arguments:[],directives:[{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"87b71fd11b803049f489da04dd2613129d0052496e232251a4d8d4e068e0a4bd",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"items"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"additionalInfo"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"brandName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"attachments"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"content"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"attachmentOfferings"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"required"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"bundleItems"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"parentItemIndex"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellingPriceWithAssemblies"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"options"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"availability"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"detailUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"imageUrls"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"at1x"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"at2x"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"at3x"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"listPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"manualPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"measurementUnit"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"modalType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"offerings"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"price"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceTags"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"identifier"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isPercentual"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"rawValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"productCategories"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productCategoryIds"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productRefId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"productId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"quantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"seller"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellingPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"skuName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"skuSpecifications"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fieldName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"unitMultiplier"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"uniqueId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"refId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isGift"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"priceDefinition"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"calculatedSellingPrice"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sellingPrices"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"quantity"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"total"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:1532}};i.loc.source={body:'query GET_ORDERFORM @context(sender: "belcorp.firework-components-container@0.0.5") {\n orderForm @runtimeMeta(hash: "87b71fd11b803049f489da04dd2613129d0052496e232251a4d8d4e068e0a4bd") {\n id\n items {\n additionalInfo {\n brandName\n __typename\n }\n attachments {\n name\n content\n __typename\n }\n attachmentOfferings {\n name\n required\n schema\n __typename\n }\n bundleItems {\n id\n __typename\n }\n parentItemIndex\n sellingPriceWithAssemblies\n options {\n id\n __typename\n }\n availability\n detailUrl\n id\n imageUrls {\n at1x\n at2x\n at3x\n __typename\n }\n listPrice\n manualPrice\n measurementUnit\n modalType\n name\n offerings {\n id\n __typename\n }\n price\n priceTags {\n identifier\n isPercentual\n name\n rawValue\n value\n __typename\n }\n productCategories\n productCategoryIds\n productRefId\n productId\n quantity\n seller\n sellingPrice\n skuName\n skuSpecifications {\n fieldName\n __typename\n }\n unitMultiplier\n uniqueId\n refId\n isGift\n priceDefinition {\n calculatedSellingPrice\n sellingPrices {\n quantity\n value\n __typename\n }\n total\n __typename\n }\n __typename\n }\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var u=l;l=new Set,u.forEach((function(e){d.has(e)||(d.add(e),(a[e]||new Set).forEach((function(e){l.add(e)})))}))}return d.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"GET_ORDERFORM")},16:function(e,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ADD_TO_CART"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"items"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"ItemInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"marketingData"}},type:{kind:"NamedType",name:{kind:"Name",value:"MarketingDataInput"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"salesChannel"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"allowedOutdatedData"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"belcorp.firework-components-container@0.0.5",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"ed69fb63783030234c93092aa3eac804c7500d07c77b79916a5d1861eb290b5c",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"items"},value:{kind:"Variable",name:{kind:"Name",value:"items"}}},{kind:"Argument",name:{kind:"Name",value:"marketingData"},value:{kind:"Variable",name:{kind:"Name",value:"marketingData"}}},{kind:"Argument",name:{kind:"Name",value:"salesChannel"},value:{kind:"Variable",name:{kind:"Name",value:"salesChannel"}}},{kind:"Argument",name:{kind:"Name",value:"allowedOutdatedData"},value:{kind:"Variable",name:{kind:"Name",value:"allowedOutdatedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:447}};i.loc.source={body:'mutation ADD_TO_CART($items: [ItemInput], $marketingData: MarketingDataInput, $salesChannel: String, $allowedOutdatedData: [String!]) @context(sender: "belcorp.firework-components-container@0.0.5") @runtimeMeta(hash: "ed69fb63783030234c93092aa3eac804c7500d07c77b79916a5d1861eb290b5c") {\n addToCart(items: $items, marketingData: $marketingData, salesChannel: $salesChannel, allowedOutdatedData: $allowedOutdatedData) {\n id\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function t(e,n){for(var i=0;i0;){var u=l;l=new Set,u.forEach((function(e){d.has(e)||(d.add(e),(a[e]||new Set).forEach((function(e){l.add(e)})))}))}return d.forEach((function(n){var a=t(e,n);a&&i.definitions.push(a)})),i}(i,"ADD_TO_CART")},6:function(e,n,i){"use strict";var a=i(20),t=i(2),r=i(4),d=i.n(r),l=i(7),u=i(0),m=i(8),s=i(11),o=i(3),c=i(5),v=i.n(c),k=i(15),f=i.n(k),p=i(13),g=i.n(p),N=i(16),y=i.n(N),b=function(){var e=Object(u.useState)({}),n=Object(t.a)(e,2),i=n[0],a=n[1],r=Object(u.useState)({}),d=Object(t.a)(r,2),l=d[0],m=d[1];return Object(u.useEffect)((function(){var e;null===(e=function(){var e;return null===(e=window.__RENDER_8_SESSION__)||void 0===e?void 0:e.sessionPromise}())||void 0===e||e.then((function(e){var n,i,t,r=null!==(t=null===(i=null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.namespaces)||void 0===i?void 0:i.public)&&void 0!==t?t:{};0!==Object.keys(r).length&&(a(function(e){var n,i,a,t,r,d;return{utmSource:null!==(i=null===(n=e.utm_source)||void 0===n?void 0:n.value)&&void 0!==i?i:"",utmMedium:null!==(t=null===(a=e.utm_medium)||void 0===a?void 0:a.value)&&void 0!==t?t:"",utmCampaign:null!==(d=null===(r=e.utm_campaign)||void 0===r?void 0:r.value)&&void 0!==d?d:""}}(r)),m(function(e){var n,i,a,t,r,d;return{utmiPage:null!==(i=null===(n=e.utmi_p)||void 0===n?void 0:n.value)&&void 0!==i?i:"",utmiPart:null!==(t=null===(a=e.utmi_pc)||void 0===a?void 0:a.value)&&void 0!==t?t:"",utmiCampaign:null!==(d=null===(r=e.utmi_cp)||void 0===r?void 0:r.value)&&void 0!==d?d:""}}(r)))})).catch((function(){}))}),[]),{utmParams:i,utmiParams:l}};function _(e,n){var i;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(i=function(e,n){if(!e)return;if("string"==typeof e)return h(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(e,n)}(e))||n&&e&&"number"==typeof e.length){i&&(e=i);var a=0,t=function(){};return{s:t,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,d=!0,l=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return d=e.done,e},e:function(e){l=!0,r=e},f:function(){try{d||null==i.return||i.return()}finally{if(l)throw r}}}}function h(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,a=new Array(n);i1?[o[0]].concat(Object(a.a)(o)):o;e.variant((function(e){var n,a,t;e.extId(l).price(k||p||r.isAvailable?c:m.sellingPrice.lowPrice).originalPrice(k||p||r.isAvailable?v:m.listPrice.lowPrice).isAvailable(N).name(null!==(t=null===(a=null===(n=null==g?void 0:g[0])||void 0===n?void 0:n.values)||void 0===a?void 0:a[0])&&void 0!==t?t:f).sku(s).url(u);var d,o=_(h);try{var y=function(){var n=d.value.imageUrl;e.image((function(e){e.extId(b).url(n).position(b++)}))};for(o.s();!(d=o.n()).done;)y()}catch(e){o.e(e)}finally{o.f()}var F,S=_(null!=g?g:[]);try{for(S.s();!(F=S.n()).done;){var w=F.value,P=w.name,O=w.values;e.option({name:P,value:O[0]})}}catch(e){S.e(e)}finally{S.f()}e.unit.image_ext_id=0===i?0:b-(h.length-1),e.unit.image_id=e.images[0].image_id}))};for(h.s();!(y=h.n()).done;)F()}catch(e){h.e(e)}finally{h.f()}}),!0)};function D(e){var n=e.currency,i=e.gqlClient,a=e.orderFormId,r=e.params,u=r.utmParams,m=r.utmiParams,s=e.getOrderForm;window._fwn.shopping.configureCart({url:"".concat(v()("checkout"),"/checkout#/cart"),currency:n,addToCartText:"Agregar a la bolsa"}),window._fwn.shopping.onCartUpdated(function(){var e=Object(l.a)(d.a.mark((function e(n){var r,l,o,c,v,k,f,p,N,b,_,h;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.product,l=n.productUnit,o=n.quantity,e.prev=1,e.next=4,i.query({query:g.a,variables:{id:[r.product_ext_id],salesChannel:"1"}});case 4:if(f=e.sent,p=Object(t.a)(f.data.productsByIdentifier,1),N=p[0],0!==o){e.next=17;break}return e.next=10,S(a);case 10:return b=e.sent,_=b.items.findIndex((function(e){return e.id===l.unit_ext_id})),e.next=14,w({orderFormId:a,quantity:o,index:_});case 14:return e.next=16,s();case 16:return e.abrupt("return",o);case 17:return h=null,h=1===N.items.length?{quantity:o,id:Number(N.items[0].itemId),seller:null===(v=null===(c=null==N?void 0:N.items[0])||void 0===c?void 0:c.sellers[0])||void 0===v?void 0:v.sellerId,index:0,options:[]}:{quantity:o,id:Number(l.unit_ext_id),seller:(null===(k=N.items.find((function(e){return e.itemId===l.unit_ext_id})))||void 0===k?void 0:k.sellers[0].sellerId)||"1",index:0,options:[]},e.prev=19,e.next=22,i.mutate({mutation:y.a,variables:Object.assign({items:[h],marketingData:Object.assign(Object.assign({},u),m)},P)});case 22:return e.next=24,s();case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(19),console.log("Error updating cart: ",{error:e.t0});case 29:return e.abrupt("return",o);case 32:return e.prev=32,e.t1=e.catch(1),console.log("Error: ",{error:e.t1}),e.abrupt("return",o);case 36:case"end":return e.stop()}}),e,null,[[1,32],[19,26]])})));return function(n){return e.apply(this,arguments)}}()),window._fwn.shopping.onCartDisplayed(Object(l.a)(d.a.mark((function e(){var r,u;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,S(a);case 3:return r=e.sent,e.next=6,Promise.all(r.items.filter((function(e){return!e.isGift})).map(function(){var e=Object(l.a)(d.a.mark((function e(n){var a,r,l,u,m,s,o,c;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.query({query:g.a,variables:{id:[n.productId],salesChannel:"1"},fetchPolicy:"no-cache"});case 2:return l=e.sent,u=Object(t.a)(l.data.productsByIdentifier,1),m=u[0],s=n.quantity,o=null===(a=null==m?void 0:m.items)||void 0===a?void 0:a.find((function(e){return e.itemId===n.id})),c=1===m.items.length?m.items:m.items.filter((function(e){return e.variations.length})),e.abrupt("return",{quantity:s,unitId:null!==(r=null==o?void 0:o.itemId)&&void 0!==r?r:"",id:m.productId,name:m.productName,priceRange:m.priceRange,description:m.description,url:"".concat(v()(I(m.brand))).concat(new URL(m.link).pathname),variations:c.map((function(e){var n,i,a,t,r,d,l,u,s,o,c,v,k=e.sellers.find((function(e){return e.sellerDefault})),f=null!==(r=null!==(t=null!==(n=null==k?void 0:k.commertialOffer.Price)&&void 0!==n?n:null===(a=null===(i=e.sellers)||void 0===i?void 0:i[0])||void 0===a?void 0:a.commertialOffer.Price)&&void 0!==t?t:m.priceRange.sellingPrice.lowPrice)&&void 0!==r?r:0,p=null!==(o=null!==(s=null!==(d=null==k?void 0:k.commertialOffer.ListPrice)&&void 0!==d?d:null===(u=null===(l=e.sellers)||void 0===l?void 0:l[0])||void 0===u?void 0:u.commertialOffer.ListPrice)&&void 0!==s?s:m.priceRange.listPrice.lowPrice)&&void 0!==o?o:0,g=(null!==(v=null===(c=null==k?void 0:k.commertialOffer)||void 0===c?void 0:c.AvailableQuantity)&&void 0!==v?v:1)>0;return{variationId:e.itemId,price:f,name:e.name,isAvailable:g,originalPrice:p,sku:e.itemId,images:e.images.map((function(e){return{imageId:e.imageId,imageUrl:e.imageUrl}})),options:e.variations.map((function(e){return{name:e.name,values:e.values}}))}}))});case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()));case 6:return u=e.sent,e.abrupt("return",u.map((function(e){var i=e.quantity,a=e.unitId,t=F(e,["quantity","unitId"]);return{product:O(t,n),unitId:a,quantity:i}})));case 10:return e.prev=10,e.t0=e.catch(0),console.log("Error building the cart: ",{error:e.t0}),e.abrupt("return",[]);case 14:case"end":return e.stop()}}),e,null,[[0,10]])}))))}var I=function(e){return"cyzone"===e.toLowerCase()?"cyzone":"lbel"===e.toLowerCase()||"l'bel"===e.toLowerCase()?"lbel":"esika"};n.a=function(){var e=Object(m.useApolloClient)(),n=Object(o.useRuntime)().culture,i=Object(s.useOrderForm)(),a=i.orderForm,r=i.loading,c=i.setOrderForm,k=b(),p=k.utmParams,N=k.utmiParams,y=Object(m.useLazyQuery)(f.a,{fetchPolicy:"no-cache"}),_=Object(t.a)(y,2),h=_[0],F=_[1].data;Object(u.useEffect)((function(){if(F){var e=F.orderForm,n=(e=void 0===e?{}:e).items;c({items:void 0===n?[]:n})}}),[F,c]);var S=Object(u.useCallback)((function(){window._fwn.shopping.onProductsLoaded(function(){var i=Object(l.a)(d.a.mark((function i(a){var t,r,l,u,m,s;return d.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=a.products,r=t.map((function(e){return e.product_ext_id})),i.prev=2,i.next=5,e.query({query:g.a,variables:{id:r,salesChannel:"1"},fetchPolicy:"no-cache"});case 5:return l=i.sent,u=l.data,m=u.productsByIdentifier.map((function(e){var n=1===e.items.length?e.items:e.items.filter((function(e){return e.variations.length}));return{id:e.productId,name:e.productName,description:e.description,url:"".concat(v()(I(e.brand))).concat(new URL(e.link).pathname),priceRange:e.priceRange,variations:n.map((function(n){var i,a,t,r,d,l,u,m,s,o,c,v,k=n.sellers.find((function(e){return e.sellerDefault})),f=null!==(d=null!==(r=null!==(i=null==k?void 0:k.commertialOffer.Price)&&void 0!==i?i:null===(t=null===(a=n.sellers)||void 0===a?void 0:a[0])||void 0===t?void 0:t.commertialOffer.Price)&&void 0!==r?r:e.priceRange.sellingPrice.lowPrice)&&void 0!==d?d:0,p=null!==(o=null!==(s=null!==(l=null==k?void 0:k.commertialOffer.ListPrice)&&void 0!==l?l:null===(m=null===(u=n.sellers)||void 0===u?void 0:u[0])||void 0===m?void 0:m.commertialOffer.ListPrice)&&void 0!==s?s:e.priceRange.listPrice.lowPrice)&&void 0!==o?o:0,g=(null!==(v=null===(c=null==k?void 0:k.commertialOffer)||void 0===c?void 0:c.AvailableQuantity)&&void 0!==v?v:1)>0;return{variationId:n.itemId,price:f,name:n.name,originalPrice:p,isAvailable:g,sku:n.itemId,images:n.images.map((function(e){return{imageId:e.imageId,imageUrl:e.imageUrl}})),options:n.variations.map((function(e){return{name:e.name,values:e.values}}))}}))}})),s=m.map((function(e){return O(e,n.currency)})),window._fwn.shopping.hydrateProducts(s),i.abrupt("return",s);case 13:return i.prev=13,i.t0=i.catch(2),console.error("Error loading product card: ",{error:i.t0}),i.abrupt("return",[]);case 17:case"end":return i.stop()}}),i,null,[[2,13]])})));return function(e){return i.apply(this,arguments)}}())}),[e,n.currency]);Object(u.useEffect)((function(){var e;(null===(e=window._fwn)||void 0===e?void 0:e.shopping)?S():document.addEventListener("fw:ready",(function(){S()}))}),[e,n.currency]),Object(u.useEffect)((function(){var i;r||((null===(i=window._fwn)||void 0===i?void 0:i.shopping)?D({currency:n.currency,gqlClient:e,orderFormId:a.id,getOrderForm:h,params:{utmParams:p,utmiParams:N}}):document.addEventListener("fw:ready",(function(){D({currency:n.currency,gqlClient:e,orderFormId:a.id,getOrderForm:h,params:{utmParams:p,utmiParams:N}})})))}),[e,n.currency,r,a,h,p,N])}}}]);