"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6814],{75901:function(e,t,n){n.d(t,{t:function(){return r}});var r={ARTICULOS_PERMITIDOS:"ARTICULOS_PERMITIDOS",DIAS_DEL_PERIODO:"DIAS_DEL_PERIODO",ARTICULOS_POR_PERIODO:"ARTICULOS_POR_PERIODO",MONTO_POR_PERIODO:"MONTO_POR_PERIODO",DIAS_ENTREGA:"DIAS_ENTREGA",VIGENCIA_DECRETO:"VIGENCIA_DECRETO",UNIDADES_NO_DISPONIBLES:"UNIDADES_NO_DISPONIBLES",POCAS_UNIDADES_DISPONIBLES:"POCAS_UNIDADES_DISPONIBLES",ENTRE_UNIDADES_DISPONIBLES:"ENTRE_UNIDADES_DISPONIBLES",MAXIMO_UNIDADES_DISPONIBLES:"MAXIMO_UNIDADES_DISPONIBLES",DEFAULT_DISPONIBILIDAD:"DEFAULT_DISPONIBILIDAD"}},98421:function(e,t,n){n.d(t,{s:function(){return v}});var r=n(50029),i=n(87794),o=n.n(i),u=n(67294),a=n(12009),s=n(14416),c=n(26680),l=n(34975),d=function(e){return{type:l.Z.SAVE_SELL_LIMITS,payload:e}};function v(){var e=(0,s.I0)(),t=(0,s.v9)((function(e){var t;return(null===e||void 0===e||null===(t=e.SessionManager)||void 0===t?void 0:t.token)||""})),n=(0,s.v9)((function(e){var t,n;return null!==(t=null===e||void 0===e||null===(n=e.sellLimits)||void 0===n?void 0:n.limits)&&void 0!==t?t:[]})),i=(0,s.v9)((function(e){var t,n;return null!==(t=null===e||void 0===e||null===(n=e.sellLimits)||void 0===n?void 0:n.limitsError)&&void 0!==t?t:""}));function l(){return(l=(0,r.Z)(o().mark((function n(){var r,i,u,s,l,v,p,f,m,b,O;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,c.xn)({name:a.f.limites_de_venta,token:t});case 3:p=n.sent,f=(null===p||void 0===p||null===(r=p.MarketingSpotData)||void 0===r||null===(i=r[0])||void 0===i||null===(u=i.baseMarketingSpotActivityData)||void 0===u||null===(s=u[0])||void 0===s||null===(l=s.marketingContentDescription)||void 0===l||null===(v=l[0])||void 0===v?void 0:v.marketingText)||"[]",m=JSON.parse(f),b=m.limites_de_venta,e(d({limits:void 0===b?[]:b})),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),console.error("[limites_de_venta] ".concat(null!==(O=n.t0.message)&&void 0!==O?O:"spot is no available"," "));case 12:case"end":return n.stop()}}),n,null,[[0,9]])})))).apply(this,arguments)}function v(){return(v=(0,r.Z)(o().mark((function n(){var r,i,u,s,l,v,p,f,m;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,c.xn)({name:a.f.limiteVentasError,token:t});case 3:p=n.sent,f=(null===p||void 0===p||null===(r=p.MarketingSpotData)||void 0===r||null===(i=r[0])||void 0===i||null===(u=i.baseMarketingSpotActivityData)||void 0===u||null===(s=u[0])||void 0===s||null===(l=s.marketingContentDescription)||void 0===l||null===(v=l[0])||void 0===v?void 0:v.marketingText)||"",e(d({limitsError:f})),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("[limiteVentasError] ".concat(null!==(m=n.t0.message)&&void 0!==m?m:"spot is no available"));case 11:case"end":return n.stop()}}),n,null,[[0,8]])})))).apply(this,arguments)}return(0,u.useEffect)((function(){!n.length>0&&t&&function(){l.apply(this,arguments)}(),!i&&t&&function(){v.apply(this,arguments)}()}),[t]),{sellLimits:n,limitErrors:i}}},8943:function(e,t,n){n.d(t,{SR:function(){return k},ah:function(){return x},nX:function(){return j}});var r=n(83618),i=n(59499),o=n(50029),u=n(87794),a=n.n(u),s=n(91409),c=n(70197),l=n(32505),d=n(39415),v=n(21113),p=n(63112),f=n(9374),m=n(52865);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t7&&void 0!==m[7]?m[7]:[],e.prev=1,e.next=4,Promise.all(N(t));case 4:return l=e.sent,d=l.map((function(e){var t;return e?{seo:(null===e||void 0===e||null===(t=e.contents)||void 0===t?void 0:t[0])||null}:""})),e.next=8,Promise.all(h(d));case 8:v=e.sent,p=v.map((function(e){if(!e)return e;var t=e.error,n=e.product,r=e.inventory,i=(e.isBundle,e.dataServer);return t?console.error("Ocurrio un error al obtener el producto"):_(n,r,s,i)})),f=p.map((function(e){return e?g(e,o,u,s,c):{}})),I(f,n,r,i),e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",console.error(e.t0.message,e.t0.stack));case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t,n,r,i,o,u,a){return e.apply(this,arguments)}}(),x=function(){var e=(0,o.Z)(a().mark((function e(t,n,r,i,o,u,s){var c,l,d,v,p,f,m=arguments;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=m.length>7&&void 0!==m[7]?m[7]:[],e.prev=1,e.next=4,Promise.all(N(t));case 4:return l=e.sent,d=l.map((function(e){var t;return e?{seo:(null===e||void 0===e||null===(t=e.contents)||void 0===t?void 0:t[0])||null}:""})),e.next=8,Promise.all(h(d));case 8:v=e.sent,p=v.map((function(e){if(!e)return e;var t=e.error,n=e.product,r=e.inventory,i=(e.isBundle,e.dataServer);return t?console.error("Ocurrio un error al obtener el producto"):_(n,r,s,i)})),f=p.map((function(e){return e?g(e,o,u,s,c):{}})),E(f,n,r,i),e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",console.error(e.t0.message));case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t,n,r,i,o,u,a){return e.apply(this,arguments)}}(),j=function(){var e=(0,o.Z)(a().mark((function e(t,n,r,i,o,u,s){var c,l,d,v,p,f,m=arguments;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=m.length>7&&void 0!==m[7]?m[7]:[],e.prev=1,e.next=4,Promise.all(N(t));case 4:return l=e.sent,d=l.map((function(e){var t;return e?{seo:(null===e||void 0===e||null===(t=e.contents)||void 0===t?void 0:t[0])||null}:""})),e.next=8,Promise.all(h(d));case 8:v=e.sent,p=v.map((function(e){if(!e)return e;var t=e.error,n=e.product,r=e.inventory,i=(e.isBundle,e.dataServer);return t?console.error("Ocurrio un error al obtener el producto"):_(n,r,s,i)})),f=p.map((function(e){return e?g(e,o,u,s,c):{}})),P(f,n,r,i),e.next=17;break;case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",console.error(e.t0.message));case 17:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(t,n,r,i,o,u,a){return e.apply(this,arguments)}}()},63112:function(e,t,n){n.d(t,{O:function(){return a}});var r=n(59499),i=n(762);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;return d?(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{className:"availability2",children:"Disponible"})}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{className:"availability2",children:null!==e&&void 0!==e?e:"Disponible"})})},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return d?(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{className:"noAvailability",children:"No disponible"})}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("p",{className:"noAvailability",children:null!==e&&void 0!==e?e:"No disponible"})})};if(c.length>0){if(![t,n,r,i,o].every((function(e){return l(e)}))){var b=l(o),O=v(null===b||void 0===b?void 0:b.message,Number(s),"".concat(Number(s)," unidades disponibles"));return 0===Number(s)?m():!!a||f(O)}var y=l(t),D=Number(y.valor),S=(null===y||void 0===y?void 0:y.message)||"No disponible";if(s<=D)return!a&&m(S);var I=l(n),E=Number(I.min),P=Number(I.max),N=v(I.message,Number(P),"Quedan menos de ".concat(P," unidades disponibles"));if(s>=E&&s<=P)return!!a||f(N);var h=l(r),_=Number(h.min),g=Number(h.max),A=v(h.message,Number(s),"".concat(Number(s)," unidades disponibles"));if(s>=_&&s<=g)return!!a||f(A);var k=l(i),x=Number(k.max),j=v(k.message,x,"M\xe1s de ".concat(x," Unidades disponibles"));if(s>x)return!!a||f(j);var T=v(l(o).message,Number(s),"".concat(Number(s)," unidades disponibles"));return!!a||f(T)}return!a&&m()}))}function m(e){return b.apply(this,arguments)}function b(){return(b=(0,r.Z)(o().mark((function e(t){var n,r,i,u,a,s,c,v,p,f,m,b,O,y,D,S,I,E,P,N,h,_,g,A,k,x,j;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.shippingCost,r=void 0===n?{}:n,i=t.message,u=void 0===i?"":i,a=t.dataSelfcare,s=void 0===a?{}:a,c=t.partNumber,v=void 0===c?"":c,p=t.currentProductQuantity,f=t.procSales,m=t.typePayment,b=t.typePlan,O=t.typeSales,y=t.typeProduct,D=t.numberAccount,S=t.typeAccount,I=t.pAhT,E=t.pSIT,P=t.ivaT,N=t.dT,h=t.auditLogHeader,_=void 0===h?null:h,k={},x={isMigratedUser:"false"!==(null===s||void 0===s?void 0:s.isMigratedUser),termsConditions:!0,product:[{idProduct:(0,d.TS)(v),salesProducts:{procSales:f,typePayment:m,typePlan:b,typeSales:O,typeProduct:"Claro"},priceSale:{price:I,subPrice:E,iva:P,discount:N},typeProduct:y,quantity:p}],InfoUser:{typeDocument:"CC"===(null===s||void 0===s?void 0:s.documentType)?"1":"4",numberDocument:null===s||void 0===s?void 0:s.document,numberAccount:D,typeAccount:S}},e.next=5,l(x,_);case 5:if(200===(null===(j=e.sent)||void 0===j?void 0:j.status)){e.next=10;break}return e.abrupt("return","error");case 10:return g={pWTFin:j.documents.products[0].price,pWOTFin:j.documents.products[0].subPrice,fPWTFin:j.documents.total,fPWOTFin:j.documents.subTotal,ivaP:j.documents.products[0].iva,shippingCost:null===r||void 0===r?void 0:r.value,shippingWOTax:null===r||void 0===r?void 0:r.formatPrice,shippingTax:null===r||void 0===r?void 0:r.tax,message:u},A=j.documents.products[0].idProduct,k={prices:g,idProduct:A,appliesFinancing:j.documents.products[0].AppliesFinancing,products:j.documents.products[0]},e.abrupt("return",k);case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(e){return y.apply(this,arguments)}function y(){return(y=(0,r.Z)(o().mark((function e(t){var n,r,i,u,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.partNumber,r=void 0===n?"":n,i=t.typePlan,u=(0,d.TS)(r),a=i,e.next=5,(0,v.Ij)(u,a);case 5:if("OK"===(null===(s=e.sent)||void 0===s?void 0:s.status)){e.next=10;break}return e.abrupt("return","error");case 10:return e.abrupt("return",s);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}}}]);