"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9546],{69253:function(t,e,r){r.d(e,{Eo:function(){return b},Gq:function(){return p},MC:function(){return g},Pb:function(){return P},kW:function(){return m},xH:function(){return y},zi:function(){return v}});var n=r(17674),i=r(13311),u=r.n(i),o=(r(84486),r(76527)),a=r(43959),c="Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),s="enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),l="".concat("https://cdn.claro.com.co","/imagenes/v9/assets/no-image.jpeg"),d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("-"),r=(0,n.Z)(e,2),i=r[0],u=r[1];return u?"".concat(i,"-").concat(u.replace(/^0+/,"")):"".concat(i)},f=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.endsWith(".jpg")||(t=t.replace(/.(j|J)(p|P)(g|G)/,".jpg")),t},p=function(t){var e,r,n={},i=[],u=t.fullImage,a=void 0===u?"":u,c=t.thumbnail,s=void 0===c?"":c,p=t.attachments,v=void 0===p?[]:p;if(""!==a&&""!==s){e=a.split("/");var h=d(e[e.length-1]);e=s.split("/");var m=d(e[e.length-1]);h===m?(n[h]={fullImage:f((0,o.T)(a)),thumbnail:f((0,o.T)(s))},i.push({imgId:m,imgSrc:f((0,o.T)(s))})):n[h]={fullImage:f((0,o.T)(a)),thumbnail:l}}if(v.forEach((function(t){var u=t.attachmentAssetPath,a=t.usage;if(void 0!==u)if(u=f(u),e=u.split("/"),r=d(e[e.length-1]),Object.prototype.hasOwnProperty.call(n,r)||(n[r]={fullImage:l,thumbnail:l}),"ANGLEIMAGES_FULLIMAGE"===a)void 0!==n[r].thumbnail&&n[r].thumbnail!==l?n[r].fullImage=f((0,o.T)(u)):(n[r].fullImage=f((0,o.T)(u)),n[r].thumbnail=l);else if("ANGLEIMAGES_THUMBNAIL"===a){var c=f((0,o.T)(u));n[r].thumbnail=c,i.push({imgId:r,imgSrc:c})}})),0===i.length&&t.thumbnail){e=t.thumbnail.split("/"),r=d(e[e.length-1]);var g=f((0,o.T)(t.thumbnail));i.push({imgId:r,imgSrc:g})}return{images:n,thumbnails:i}},v=function(t){var e=t.holidays,r=void 0===e?[]:e,n=t.daysToShip,i=void 0===n?3:n,u=new Date;u.setHours(23,59,59);var o=0;do{h(u=new Date(u.getTime()+864e5),r)&&o++}while(o!==Number(i)&&0!==Number(i));return"".concat(u.getDate()," de ").concat(c[u.getMonth()]," del ").concat(u.getFullYear())};function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=!(0===t.getDay()||6===t.getDay()),n=!u()(e[t.getFullYear()],(function(e){return e.month===t.getMonth()+1&&e.day===t.getDate()}));return r&&n}var m=function(t,e){var r=(0,a.default)(t,"yyyyMMdd HH:mm:ss",new Date),n=(0,a.default)(e,"yyyyMMdd HH:mm:ss",new Date),i=new Date("2023-11-11"),u=r.getDate(),o=n.getDate(),c=s[n.getMonth()];n.getFullYear();return u===i.getDate()&&i.getMonth()===n.getMonth()?"\xa1RECIBE HOY!":"Env\xedo del ".concat(u," al ").concat(o," de ").concat(c)},g=function(t,e){var r=(0,a.default)(t,"yyyyMMdd HH:mm:ss",new Date),n=(0,a.default)(e,"yyyyMMdd HH:mm:ss",new Date),i=(new Date("2023-11-11"),r.getDate()),u=n.getDate(),o=s[n.getMonth()];n.getFullYear();return"Del ".concat(i," al ").concat(u," de ").concat(o)},b=function(t){return null===t||void 0===t?void 0:t.map((function(t){var e=t.dataPromiseSelected.split("-");return g(e[0],e[1])})).join(",")},y=function(t){var e=(t.getDate()<10?"0":"")+t.getDate(),r=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1);return t.getFullYear()+"-"+r+"-"+e},P=function(t){var e=c[t.getMonth()],r=t.getFullYear();return"".concat(e," ").concat(r)}},39415:function(t,e,r){r.d(e,{Nl:function(){return b},SM:function(){return i},_g:function(){return g},zs:function(){return n}});var n="|",i="defaultKey",u=function(t){return parseInt(t,10)},o=function(t,e){return t.sequence-e.sequence},a=function(t,e){return t.id.localeCompare(e.id)},c=function(t){return Object.hasOwnProperty.call(t,"attributes")},s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.filter((function(t){return"Defining"===t.usage&&t.values.length>0})).map((function(t){return{id:t.id,sequence:u(t.sequence),name:t.name,valueid:t.values[0].id}})).sort(a).map((function(t){return t.valueid})).join(n)},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.filter((function(t){return"Defining"===t.usage&&t.values.length>0})).map((function(t){return{identifier:t.identifier,sequence:u(t.sequence),id:t.id,name:t.name,values:t.values.map((function(t){return{identifier:t.identifier,sequence:u(t.sequence),id:t.id,value:t.value}})).sort(o)}})).sort(a)},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.filter((function(t){return"Descriptive"===t.usage&&t.values.length>0})).map((function(t){return{identifier:t.identifier,sequence:u(t.sequence),id:t.id,name:t.name,values:t.values.map((function(t){return{identifier:t.identifier,sequence:u(t.sequence),id:t.id,value:t.value}})).sort(o)}})).sort(a)},f=function(t){return!Object.hasOwnProperty.call(t,"items")||1===t.items.length},p=function(t){return t.singleSKUCatalogEntryID?t.singleSKUCatalogEntryID:t.id?t.id:t.productId},v=function(t){return t.singleSKUCatalogEntryID?t.singleSKUCatalogEntryID:(t.partNumber,t.partNumber)},h=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e={};return t.forEach((function(t){e[t.id]=t})),e},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e={};return t.forEach((function(t){e[t.identifier]=t.values[0].value})),e},g=function(t){var e={},r={},n=l(t.attributes),u=d(t.attributes),o=h(n),a=m(u),v="";if(f(t)){if(!c(t)||0===n.length)return e[i]=p(t),Object.hasOwnProperty.call(t,"items")&&1===t.items.length?r[e[i]]=t.items[0]:r[e[i]]=t,{skusMap:e,productsMap:r};v=s(t.attributes),e[v]=p(t),Object.hasOwnProperty.call(t,"items")&&1===t.items.length?r[e[v]]=t.items[0]:r[e[v]]=t}else{if(!c(t)||c(t)&&0===n.length)return e[i]=p(t),r[e[i]]=t,{skusMap:e,productsMap:r};t.items.filter((function(t){return n.every((function(e){return void 0!==t.attributes&&t.attributes.length>0&&t.attributes.some((function(t){return t.identifier===e.identifier}))}))})).forEach((function(t){l(t.attributes).forEach((function(t){t.sequence=o[t.id].sequence})),t.definingAttributes=h(t.attributes),v=s(t.attributes),e[v]=p(t),r[e[v]]=t}))}return{skusMap:e,productsMap:r,attributesMap:o,attributesDescriptiveMap:a}},b=function(t){var e={},r={},n={},u=l(t.attributes),o=d(t.attributes),a=h(u),g=m(o),b="";if(f(t)){var y;if(!c(t)||0===u.length)return Object.hasOwnProperty.call(t,"items")&&1===t.items.length?(e[i]=p(null===t||void 0===t?void 0:t.items[0]),r[i]=v(null===t||void 0===t?void 0:t.items[0]),n[e[i]]=null===t||void 0===t?void 0:t.items[0]):(e[i]=p(t),r[i]=v(t),n[e[i]]=t),{skusMap:e,productsMap:n};b=s(null===t||void 0===t||null===(y=t.items[0])||void 0===y?void 0:y.attributes),e[b]=p(null===t||void 0===t?void 0:t.items[0]),r[b]=v(null===t||void 0===t?void 0:t.items[0]),Object.hasOwnProperty.call(t,"items")&&1===t.items.length?n[e[b]]=null===t||void 0===t?void 0:t.items[0]:n[e[b]]=t}else{if(!c(t)||c(t)&&0===u.length)return e[i]=p(t),r[i]=v(t),n[e[i]]=t,{partNumberMap:r,skusMap:e,productsMap:n};t.items.filter((function(t){return u.every((function(e){return void 0!==t.attributes&&t.attributes.length>0&&t.attributes.some((function(t){return t.identifier===e.identifier}))}))})).forEach((function(t){l(t.attributes).forEach((function(t){t.sequence=a[t.id].sequence})),t.definingAttributes=h(t.attributes),b=s(t.attributes),e[b]=p(t),r[b]=v(t),n[e[b]]=t}))}return{partNumberMap:r,skusMap:e,productsMap:n,attributesMap:a,attributesDescriptiveMap:g}}},60323:function(t,e,r){r.d(e,{Z:function(){return B}});var n=r(50029),i=r(92777),u=r(82262),o=r(10748),a=r(81531),c=r(63553),s=r(37247),l=r(59499),d=r(87794),f=r.n(d),p=r(67294),v=r(14416),h=r(45217),m=r(50361),g=r.n(m),b=r(69253),y=r(70821),P=r(34975),O=function(){return{type:P.Z.BANNER_BY_NAME_REQUEST}},S=function(t){return{type:P.Z.BANNER_BY_NAME_SUCCESS,recommendProducts:t}},C=function(){return{type:P.Z.BANNER_BY_NAME_FAILURE}},E=r(48043),A=r(39415),D=r(85893);function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e0){r=t.MarketingSpotData[0].baseMarketingSpotActivityData;var n=[];r&&r.forEach((function(t){if(t.productDetail){var e,r=(0,A._g)(t.productDetail.contents[0]).productsMap,i=Object.values(r);i[0].attributes&&i[0].attributes.forEach((function(t){"Color"===t.identifier&&0!==t.values.length&&(e=t.values[0].id)}));var u,o=t.id;if(o){var a=(0,b.Gq)(r[o]);a&&a.thumbnails&&(u={thumbnail:a.thumbnails[0].imgSrc,price:r[o].price,name:r[o].name,attributeID:e})}var c={};c.product=t,c.productId=t.productId,c.name=t.productDetail.contents[0].name,c.attributes=t.productDetail.contents[0].attributes,c.partNumber=t.productDetail.contents[0].partNumber,u?(c.thumbnail=u.thumbnail,c.price=u.price,c.name=u.name,c.selectedProductId=o):(c.thumbnail=t.productDetail.contents[0].thumbnail,c.price=t.productDetail.contents[0].price),n.push(c)}})),e.setState({recommendProducts:n})}return o(t),t})).catch((function(t){throw i(),t}))})),e.state={recommendProducts:[]},e}return(0,u.Z)(n,[{key:"render",value:function(){var e=this.state.recommendProducts;return(0,D.jsx)(t,T(T({},this.props),{},{getBannerByName:this.getBannerByName,selectAttributeCard:this.selectAttributeCard,recommendProducts:e}))}}]),n}(p.Component);return(0,l.Z)(e,"getInitialProps",function(){var e=(0,n.Z)(f().mark((function e(r){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.getInitialProps){e.next=4;break}return e.next=3,t.getInitialProps(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Z(e)}},89181:function(t,e,r){r.d(e,{Z:function(){return At}});var n=r(50029),i=r(92777),u=r(82262),o=r(10748),a=r(81531),c=r(63553),s=r(37247),l=r(59499),d=r(87794),f=r.n(d),p=r(67294),v=r(14416),h=r(45217),m=r(17563),g=r(50361),b=r.n(g),y=r(70821),P=r(70197),O=r(59663),S=r(24872),C=r(97066),E=r(12039),A=r(90116),D=function(t,e){return t.name.localeCompare(e.name)},_=function(t,e){return e.name.localeCompare(t.name)},T=function(t,e){return t.manufacturer.localeCompare(e.manufacturer)},R=function(t,e){return e.manufacturer.localeCompare(t.manufacturer)},Z=function(t,e){var r,n,i,u,o,a,c,s,l=(null===t||void 0===t||null===(r=t.price)||void 0===r||null===(n=r[1])||void 0===n?void 0:n.value)||(null===t||void 0===t||null===(i=t.price)||void 0===i||null===(u=i[0])||void 0===u?void 0:u.value),d=(null===e||void 0===e||null===(o=e.price)||void 0===o||null===(a=o[1])||void 0===a?void 0:a.value)||(null===e||void 0===e||null===(c=e.price)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.value);return parseFloat(l)-parseFloat(d)},B=function(t,e){var r,n,i,u,o,a,c,s,l=(null===t||void 0===t||null===(r=t.price)||void 0===r||null===(n=r[1])||void 0===n?void 0:n.value)||(null===t||void 0===t||null===(i=t.price)||void 0===i||null===(u=i[0])||void 0===u?void 0:u.value),d=(null===e||void 0===e||null===(o=e.price)||void 0===o||null===(a=o[1])||void 0===a?void 0:a.value)||(null===e||void 0===e||null===(c=e.price)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.value);return parseFloat(d)-parseFloat(l)},M=function(t,e){var r,n,i=[],u=[];return t.attributes&&(i=t.attributes.filter((function(t){return"filtro_ofertas"===t.identifier}))),e.attributes&&(u=e.attributes.filter((function(t){return"filtro_ofertas"===t.identifier}))),i===u?0:0===(null===(r=i)||void 0===r?void 0:r.length)?1:0===(null===(n=u)||void 0===n?void 0:n.length)?-1:0},I=function(t,e){var r,n,i=[],u=[];return t.attributes&&(i=t.attributes.filter((function(t){return"filtro_novedades"===t.identifier}))),e.attributes&&(u=e.attributes.filter((function(t){return"filtro_novedades"===t.identifier}))),i===u?0:0===(null===(r=i)||void 0===r?void 0:r.length)?1:0===(null===(n=u)||void 0===n?void 0:n.length)?-1:0},N=r(39415),w=r(69253),j=r(34975),k=function(){return{type:j.Z.DEPARTMENTS_REQUEST}},U=function(t){return{type:j.Z.DEPARTMENTS_SUCCESS,departmentsInfo:t}},F=function(){return{type:j.Z.DEPARTMENTS_FAILURE}},x=function(){return{type:j.Z.PRODUCT_BY_PARTNUMBER_REQUEST}},q=function(){return{type:j.Z.PRODUCT_BY_PARTNUMBER_SUCCESS}},G=function(){return{type:j.Z.PRODUCT_BY_PARTNUMBER_FAILURE}},L=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_REQUEST}},Y=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_SUCCESS}},H=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_FAILURE}},V=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_REQUEST}},z=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_SUCCESS}},Q=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_FAILURE}},K=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_REQUEST}},W=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_SUCCESS}},J=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_FAILURE}},$=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_REQUEST}},X=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_SUCCESS}},tt=function(){return{type:j.Z.FETCH_CATALOG_PRODUCTS_FAILURE}},et=r(48043),rt=r(74497),nt=r(4730),it=r(33191),ut=r(21113),ot=r(28709),at=r(31939),ct=r(76688),st=["contents"];function lt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[],e=(0,ut.VV)({attributes:t,identifier:ct.s.DatosComercial}),r=(0,ut.VV)({attributes:t,identifier:ct.s.LdiMovilComercial});return{datosComercial:e,ldiMovilComercial:r}}(O.attributes);g=E.datosComercial,b=E.ldiMovilComercial,m=C,y=p.includes("BUPOR")?"PORTABILIDAD_POST":"POSTPAGO_LINEA_NUEVA"}return dt(dt({},t),{},{name:m||u,gigas:g||"",minLDI:b||"",purchaseFlow:y||""})}var vt=r(85406),ht=["contents"];function mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function gt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[],e=(0,ut.VV)({attributes:t,identifier:ct.s.DatosComercial}),r=(0,ut.VV)({attributes:t,identifier:ct.s.LdiMovilComercial});return{datosComercial:e,ldiMovilComercial:r}}(y.attributes);h=S.datosComercial,m=S.ldiMovilComercial,v=O,g="POSTPAGO_LINEA_NUEVA"}return gt(gt({},t),{},{name:v||u,gigas:h||"",minLDI:m||"",purchaseFlow:g||""})}var Pt=r(85893);function Ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function St(t){for(var e=1;e0?s.thumbnails[0].imgSrc:"",price:u[c].price,name:u[c].name,attributeID:i})}var l={};l.product=t,l.productId=t.productDetail.contents[0].id,l.selectedProductId=l.productId;var d=(0,rt.wo)({product:(null===t||void 0===t||null===(e=t.productDetail)||void 0===e||null===(n=e.contents)||void 0===n?void 0:n[0])||{}});l.name=d||t.productDetail.contents[0].name,l.attributes=t.productDetail.contents[0].attributes,l.partNumber=t.productDetail.contents[0].partNumber,a?(l.thumbnail=a.thumbnail,l.price=a.price,l.name=a.name,l.selectedProductId=c,l.selectedAttributeID=a.attributeID):(l.thumbnail=t.productDetail.contents[0].thumbnail,l.price=t.productDetail.contents[0].price),r.push(l)}})),e.setState({products:r}),r})),(0,l.Z)((0,o.Z)(e),"handleClickOnOrderOption",(function(t){var r,n,i=e.state.products;t.preventDefault();var u,o,a=Object.assign([],i),c=(null===t||void 0===t||null===(r=t.target)||void 0===r?void 0:r.value)||(null===t||void 0===t||null===(n=t.currentTarget)||void 0===n?void 0:n.getAttribute("value")),s=c||"";switch(c){case"NAMEASC":default:u="NAME",o="ASC";break;case"NAMEDES":u="NAME",o="DES";break;case"PRICEASC":u="PRICE",o="ASC";break;case"PRICEDES":u="PRICE",o="DES";break;case"OFFERS":u="OFFERS",o="";break;case"NEWS":u="NEWS",o=""}if(a){var l=function(t,e,r){var n=(0,A.Z)(t);if("NEWS"===e)return n.sort(I);if("OFFERS"===e)return n.sort(M);if("ASC"===r){if("NAME"===e)return n.sort(D);if("MANUFACTURER"===e)return n.sort(T);if("PRICE"===e)return n.sort(Z)}else if("DES"===r){if("NAME"===e)return n.sort(_);if("MANUFACTURER"===e)return n.sort(R);if("PRICE"===e)return n.sort(B)}return n}(a,u,o);e.setState({products:l,currentPage:1,currentOrderOption:"Price",valueCurrentOrderOption:s})}})),(0,l.Z)((0,o.Z)(e),"handleOnClickPaginator",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e.setState({currentPage:t},(function(){}))})),(0,l.Z)((0,o.Z)(e),"handleOnClickPaginatorSearch",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;e.setState({currentPage:t},(function(){window.scrollTo(0,0)}))})),(0,l.Z)((0,o.Z)(e),"handleOnclickFacetCategory",(function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9999,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;return e.setState({currentPage:n}),e.getProductsByCategory(t,r,n,i)})),(0,l.Z)((0,o.Z)(e),"handleOnclickFacetSearch",function(){var t=(0,n.Z)(f().mark((function t(r){var n,i,u,o,a,c=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:9999,i=c.length>2&&void 0!==c[2]?c[2]:1,u=c.length>3?c[3]:void 0,e.setState({currentPage:i}),o=m.stringify(u),t.next=7,(0,P.nx)({searchTerm:r,pageSize:n,pageNumber:i,querys:o});case 7:return a=t.sent,t.abrupt("return",bt(a));case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),(0,l.Z)((0,o.Z)(e),"getCategories",(0,n.Z)(f().mark((function t(){var e,r,n,i;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(null!==(r=(0,E.Gg)(C.t.categories))&&((null===r||void 0===r?void 0:r.length)||0)>0)){t.next=3;break}return t.abrupt("return",r);case 3:return t.next=5,(0,S.C)();case 5:return n=t.sent,i=(null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e.catalogGroupView)||[],(0,E.KY)(C.t.categories,i),t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})))),(0,l.Z)((0,o.Z)(e),"getCategoryById",(function(t){return(0,e.props.get)("".concat(et.default.CATEGORY_BY_ID).concat(t),{}).then((function(t){return t}))})),(0,l.Z)((0,o.Z)(e),"getProductsByCategory",function(){var t=(0,n.Z)(f().mark((function t(r){var n,i,u,o,a,c,s,l,d,p=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:9999,i=p.length>2&&void 0!==p[2]?p[2]:1,u=p.length>3&&void 0!==p[3]?p[3]:{},o=e.props,a=o.dfetchProductsByCategoryRequestAction,c=o.dfetchProductByPartNumberSuccessAction,s=o.dfetchProductsByCategoryFailureAction,l=o.get,a(),t.prev=5,t.next=8,l("".concat(et.default.PRODUCTS_BY_CATEGORY).concat(r,"?limit=").concat(n,"&offset=").concat(n*(i-1),"&").concat(m.stringify(u)),{});case 8:if(!(d=t.sent)){t.next=12;break}return c(),t.abrupt("return",ft(d));case 12:s(),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(5),s(),t.t0;case 19:return t.abrupt("return",null);case 20:case"end":return t.stop()}}),t,null,[[5,15]])})));return function(e){return t.apply(this,arguments)}}()),(0,l.Z)((0,o.Z)(e),"getProductsBySearchTerm",function(){var t=(0,n.Z)(f().mark((function t(r){var n,i,u,o,a,c,s,l,d;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(null===r||void 0===r?void 0:r.searchTerm)||"",i=(null===r||void 0===r?void 0:r.pageSize)||9999,u=(null===r||void 0===r?void 0:r.pageNumber)||1,o=e.props,a=o.dfetchProductsBySearchTermRequestAction,c=o.dfetchProductsBySearchTermSuccessAction,s=o.dfetchProductsBySearchTermFailureAction,l=o.get,a(),t.prev=5,t.next=8,l("".concat(et.default.BYTERMS).concat(n,"?pageSize=").concat(i,"&pageNumber=").concat(u,"&").concat(r.querys),{});case 8:if(!(d=t.sent)){t.next=12;break}return c(),t.abrupt("return",d);case 12:s(),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(5),s(),t.t0;case 19:return t.abrupt("return",null);case 20:case"end":return t.stop()}}),t,null,[[5,15]])})));return function(e){return t.apply(this,arguments)}}()),(0,l.Z)((0,o.Z)(e),"getProductByPartNumber",function(){var t=(0,n.Z)(f().mark((function t(r){var n,i,u,o,a,c;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.props,i=n.dfetchProductByPartNumberRequestAction,u=n.dfetchProductByPartNumberSuccessAction,o=n.dfetchProductByPartNumberFailureAction,a=n.get,i(),t.prev=2,t.next=5,a("".concat(et.default.PRODUCT_BY_PARTNUMBER).concat(r),{});case 5:if(!(c=t.sent)){t.next=9;break}return u(),t.abrupt("return",c.contents[0]);case 9:i(),t.next=16;break;case 12:throw t.prev=12,t.t0=t.catch(2),o(),t.t0;case 16:return t.abrupt("return",null);case 17:case"end":return t.stop()}}),t,null,[[2,12]])})));return function(e){return t.apply(this,arguments)}}()),e.state={departmentsInfo:{},categories:{},products:[],currentPage:1,recordSetTotal:0,recordSetCount:0,productsPerPage:O.Z.PRODUCTS_PAGES.PRODUCTS_PER_PAGE.INITIAL_PRODUCT_PER_PAGE,currentOrderOption:"NAMEASC"},e}return(0,u.Z)(c,[{key:"render",value:function(){var e=this.state,r=e.departmentsInfo,n=e.categories,i=e.products,u=e.currentPage,o=e.productsPerPage,a=e.currentOrderOption,c=e.valueCurrentOrderOption,s=e.recordSetTotal,l=e.recordSetCount;return(0,Pt.jsx)(t,St(St({},this.props),{},{departments:r,categories:n,products:i,currentPage:u,productsPerPage:o,currentOrderOption:a,valueCurrentOrderOption:c,recordSetTotal:s,recordSetCount:l,setRecordSetCount:this.setRecordSetCount,setProducts:this.setProducts,setRecordSetTotal:this.setRecordSetTotal,handleClickOnOrderOption:this.handleClickOnOrderOption,handleOnClickPaginator:this.handleOnClickPaginator,handleOnClickPaginatorSearch:this.handleOnClickPaginatorSearch,handleOnclickFacetCategory:this.handleOnclickFacetCategory,handleOnclickFacetSearch:this.handleOnclickFacetSearch,handleOnclickFacetSearchPostpago:this.handleOnclickFacetSearchPostpago,getCategories:this.getCategories,getCategoryById:this.getCategoryById,getProductByPartNumber:this.getProductByPartNumber,getProductsByCategory:this.getProductsByCategory,getProductsBySearchTerm:this.getProductsBySearchTerm,selectAttributeCard:this.selectAttributeCard}))}}]),c}(p.Component);return(0,l.Z)(e,"getInitialProps",function(){var e=(0,n.Z)(f().mark((function e(r){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.getInitialProps){e.next=4;break}return e.next=3,t.getInitialProps(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Et(e)}},24872:function(t,e,r){r.d(e,{C:function(){return a}});var n=r(50029),i=r(87794),u=r.n(i),o=r(48043),a=function(){var t=(0,n.Z)(u().mark((function t(){var e,r,n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={method:"GET",url:"".concat(o.default.CATEGORY_BY_ID),headers:{Accept:"application/json","Content-Type":"application/json"}},t.prev=1,t.next=4,fetch(e.url,e);case 4:return r=t.sent,t.next=7,r.json();case 7:return n=t.sent,t.abrupt("return",n);case 11:return t.prev=11,t.t0=t.catch(1),console.error("error request getCategories:",t.t0),t.abrupt("return",!1);case 15:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(){return t.apply(this,arguments)}}()},70197:function(t,e,r){r.d(e,{Qt:function(){return s},ew:function(){return f},nx:function(){return d},w1:function(){return l}});var n=r(50029),i=r(87794),u=r.n(i),o=r(63144),a=r.n(o),c=r(48043),s=function(){var t=(0,n.Z)(u().mark((function t(e){var r,n,i;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={method:"GET",url:"".concat(c.default.BYTERMS+e,"?pageSize=5")},t.next=3,a()(r.url);case 3:return n=t.sent,t.next=6,n.json();case 6:return i=t.sent,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),l=function(){var t=(0,n.Z)(u().mark((function t(e){var r,n,i;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={method:"GET",url:"".concat(c.default.SEO_URL_INFO,"?identifier=").concat(e)},t.next=3,a()(r.url);case 3:return n=t.sent,t.next=6,n.json();case 6:return i=t.sent,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=(0,n.Z)(u().mark((function t(e){var r,n,i;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={method:"GET",url:"".concat(c.default.BYTERMS).concat(e.searchTerm,"?pageSize=").concat(e.pageSize,"&pageNumber=").concat(e.pageNumber,"&").concat(e.querys)},t.next=3,a()(r.url);case 3:return n=t.sent,t.next=6,n.json();case 6:return i=t.sent,t.abrupt("return",i);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),f=function(){var t=(0,n.Z)(u().mark((function t(e){var r,n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={method:"GET",url:"".concat(c.default.BYKEYWORDS+e,"?limit=5")},t.next=3,a()(r.url);case 3:return n=t.sent,t.abrupt("return",n.json());case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}}]);