enqueueScripts([function(){ (window.webpackJsonpvtex_menu_2_35_3=window.webpackJsonpvtex_menu_2_35_3||[]).push([["Submenu"],{0:function(e,n){e.exports=React},1:function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},29:function(e,n,t){"use strict";t.r(n),function(e){var n=t(3);t.p=Object(n.getPublicPath)("vtex.menu@2.35.3");var i=Object(n.register)((function(){return t(30)}),e,"vtex.menu@2.35.3","vtex.menu@2.x","Submenu");i.renderHotReload,i.setupHMR}.call(this,t(7)(e))},30:function(e,n,t){"use strict";t.r(n);var i,a=t(0),s=t.n(a),u=t(6),o=t.n(u),r=t(5),c=t(1),l=t.n(c),d=["submenu","submenuWrapper","submenuContainer"],m=function(e,n){if(!e)return 0;var t="string"==typeof e?parseInt(e,10):e;return isNaN(t)||String(t)!==String(e)||t<0||t>11?(n&&console.warn("Invalid ".concat(n," value. It should be an integer between 0 and ").concat(11,".")),0):t},b=function(e){var n=e.isOpen,t=e.width,a=e.children,u=e.classes,r=e.orientation,c=void 0===r?i.horizontal:r,b=e.paddingTop,p=void 0===b?4:b,v=e.paddingBottom,f=void 0===v?4:v,h=l()(d,{classes:u}),x=h.handles,w=h.withModifiers;return s.a.createElement("div",{className:"".concat(x.submenuContainer," ").concat("100%"===t?"":"relative")},s.a.createElement("div",{className:o()(w("submenuWrapper",n?"isOpen":"isClosed"),"absolute left-0 bg-base pt".concat(m(p,"paddingTop")," pb").concat(m(f,"paddingBottom")," bw1 bb b--muted-3 z-2"),n?"flex":"dn",{"100%":"w-100",auto:"w-auto ml6"}[t])},s.a.createElement("section",{className:o()(x.submenu,"w-100 flex justify-center",c===i.vertical&&"flex-column")},a)))};!function(e){e.horizontal="horizontal",e.vertical="vertical"}(i||(i={}));var p=Object(r.defineMessages)({submenuTitle:{id:"admin/editor.menu.submenu.title"},submenuWidthTitle:{id:"admin/editor.menu.item.submenuWidth.title"}});b.getSchema=function(){return{title:p.submenuTitle.id}},n.default=b},5:function(e,n){e.exports=ReactIntl},6:function(e,n){e.exports=Classnames}},[[29,"common"]]]); },function(){ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([function(e,t){e.exports=React},function(e,t,n){!function(t){"use strict";var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:b,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:b,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:b,lheading:/^([^\n]+)\n {0,3}(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function r(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||k.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=p(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=p(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=p(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=p(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=p(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag",n._tag).getRegex(),n.blockquote=p(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=m({},n),n.gfm=m({},n.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=p(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=m({},n.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=m({},n.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),r.rules=n,r.lex=function(e,t){return new r(t).lex(e)},r.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},r.prototype.token=function(e,t){var r,i,s,a,o,l,c,u,h,p,g,d,f,b,m,v;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){var k=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),k&&"paragraph"===k.type?k.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:_(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(l={type:"table",header:x(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(s[0].length),g=0;g ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),c={type:"list_start",ordered:b=(a=s[2]).length>1,start:b?+a:"",loose:!1},this.tokens.push(c),u=[],r=!1,f=(s=s[0].match(this.rules.item)).length,g=0;g1?1===o.length:o.length>1||this.options.smartLists&&o!==a)&&(e=s.slice(g+1).join("\n")+e,g=f-1)),i=r||/\n\n(?!\s*$)/.test(l),g!==f-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),i&&(c.loose=!0),v=void 0,(m=/^\[[ xX]\] /.test(l))&&(v=" "!==l[1],l=l.replace(/^\[[ xX]\] +/,"")),h={type:"list_item_start",task:m,checked:v,loose:i},u.push(h),this.tokens.push(h),this.token(l,!1),this.tokens.push({type:"list_item_end"});if(c.loose)for(f=u.length,g=0;g?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:b,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:b,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",i.em=p(i.em).replace(/punctuation/g,i._punctuation).getRegex(),i._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,i._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,i.autolink=p(i.autolink).replace("scheme",i._scheme).replace("email",i._email).getRegex(),i._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,i.tag=p(i.tag).replace("comment",n._comment).replace("attribute",i._attribute).getRegex(),i._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,i._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,i._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,i.link=p(i.link).replace("label",i._label).replace("href",i._href).replace("title",i._title).getRegex(),i.reflink=p(i.reflink).replace("label",i._label).getRegex(),i.normal=m({},i),i.pedantic=m({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",i._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",i._label).getRegex()}),i.gfm=m({},i.normal,{escape:p(i.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),e=e.substring(a[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):u(a[0]):a[0];else if(a=this.rules.link.exec(e)){var c=v(a[2],"()");if(c>-1){var h=a[0].length-(a[2].length-c)-(a[3]||"").length;a[2]=a[2].substring(0,c),a[0]=a[0].substring(0,h).trim(),a[3]=""}e=e.substring(a[0].length),this.inLink=!0,r=a[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(a,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1}else if((a=this.rules.reflink.exec(e))||(a=this.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=a[0].charAt(0),e=a[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(a,t),this.inLink=!1}else if(a=this.rules.strong.exec(e))e=e.substring(a[0].length),l+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(e))e=e.substring(a[0].length),l+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(e))e=e.substring(a[0].length),l+=this.renderer.codespan(u(a[2].trim(),!0));else if(a=this.rules.br.exec(e))e=e.substring(a[0].length),l+=this.renderer.br();else if(a=this.rules.del.exec(e))e=e.substring(a[0].length),l+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=u(this.mangle(a[1]))):n=u(a[1]),l+=this.renderer.link(r,null,n);else if(this.inLink||!(a=this.rules.url.exec(e))){if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.inRawBlock?l+=this.renderer.text(a[0]):l+=this.renderer.text(u(this.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=u(a[0]));else{do{o=a[0],a[0]=this.rules._backpedal.exec(a[0])[0]}while(o!==a[0]);n=u(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),l+=this.renderer.link(r,null,n)}return l},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,u(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},a.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'
'+(n?e:u(e,!0))+"
\n":"
"+(n?e:u(e,!0))+"
"},a.prototype.blockquote=function(e){return"
\n"+e+"
\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},a.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},a.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},a.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},a.prototype.checkbox=function(e){return" "},a.prototype.paragraph=function(e){return"

    "+e+"

    \n"},a.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},a.prototype.tablerow=function(e){return"\n"+e+"\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},a.prototype.strong=function(e){return""+e+""},a.prototype.em=function(e){return""+e+""},a.prototype.codespan=function(e){return""+e+""},a.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},a.prototype.del=function(e){return""+e+""},a.prototype.link=function(e,t,n){if(null===(e=g(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},a.prototype.image=function(e,t,n){if(null===(e=g(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},a.prototype.text=function(e){return e},o.prototype.strong=o.prototype.em=o.prototype.codespan=o.prototype.del=o.prototype.text=function(e){return e},o.prototype.link=o.prototype.image=function(e,t,n){return""+n},o.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,m({},this.options,{renderer:new o})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop(),this.token},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",s="";for(n="",e=0;e?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},u.escapeTest=/[&<>"']/,u.escapeReplace=/[&<>"']/g,u.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},u.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,u.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var d={},f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(){}function m(e){for(var t,n,r=1;r=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.lengthAn error occurred:

    "+u(e.message+"",!0)+"
    ";throw e}}b.exec=b,k.options=k.setOptions=function(e){return m(k.defaults,e),k},k.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new a,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},k.defaults=k.getDefaults(),k.Parser=l,k.parser=l.parse,k.Renderer=a,k.TextRenderer=o,k.Lexer=r,k.lexer=r.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.Slugger=c,k.parse=k,e.exports=k}(this||("undefined"!=typeof window?window:global))},function(e,t,n){"use strict";var r={"&":"&","<":"<",">":">",'"':""","'":"'"},i={"&":"&","<":"<",">":">",""":'"',"'":"'"},s=/(&|<|>|"|')/g,a=/[&<>"']/g;function o(e){return r[e]}function l(e){return i[e]}function c(e){return null==e?"":String(e).replace(a,o)}function u(e){return null==e?"":String(e).replace(s,l)}c.options=u.options={},e.exports={encode:c,escape:c,decode:u,unescape:u,version:"1.0.0-browser"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPublicPath=t.register=void 0;var r="__RENDER_8_RUNTIME__",i="__RENDER_8_COMPONENTS__",s=!("undefined"==typeof window||!window.document);s&&!window.global&&(window.global=window),window[i]=window[i]||{},t.register=function(e,t,n,s,a){var o="".concat(n,"/").concat(a),l="".concat(s,"/").concat(a),c=function(){return function(e,t){try{var n=e();return n.__esModule?n.default:n.default||n}catch(e){throw new Error("An error happened while requiring the app ".concat(t,", please check your app's code.\\n").concat(e.stack))}}(e,o)};if(window[r]&&window[r].registerComponent){var u=!!window.__RENDER_LAZY__;window[r].registerComponent(t,u?c:c(),n,a,u)}else{var h=c();window[r]&&window[r].withHMR?window[i][o]=window[i][l]=window[r].withHMR(t,h):window[i][o]=window[i][l]=h}return{}},t.getPublicPath=function(e){var t=window.__hostname__,n="/_v/public/assets/v1/published/";return s&&window.__RUNTIME__&&(t=__RUNTIME__.assetServerPublishedHost||window.location.hostname,n=__RUNTIME__.assetServerPublishedPath||"/_v/public/assets/v1/published/"),"https://"+t+n+"".concat(e,"/public/react/")}},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e?e.toLowerCase():e}},function(e,t,n){"use strict";var r=n(6);e.exports={uris:r(["background","base","cite","href","longdesc","src","usemap"])}},function(e,t,n){"use strict";function r(e,t){return e[t]=!0,e}e.exports=function(e){return e.reduce(r,{})}},function(e,t,n){"use strict";var r=n(6);e.exports={voids:r(["area","br","col","hr","img","wbr","input","base","basefont","link","meta"])}},function(e,t){e.exports=ReactIntl},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){var t,n=""+e,i=r.exec(n);if(!i)return n;var s="",a=0,o=0;for(a=i.index;a\s]+))?)*)\s*(\/?)\s*>/,o=/^<\s*\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,c=/^/i,h=/^<\s*\//;e.exports=function(e,t){for(var n,p=function(){var e=[];return e.lastItem=function(){return e[e.length-1]},e}(),g=e;e;)d();function d(){n=!0,function(){"\x3c!--"===e.substr(0,4)?(i=e.indexOf("--\x3e"))>=0&&(t.comment&&t.comment(e.substring(4,i)),e=e.substring(i+3),n=!1):u.test(e)?(r=e.match(u),n=!1,e=e.substring(r[0].length)):h.test(e)?f(o,m):c.test(e)&&f(a,b);var r;var i;!function(){if(!n)return;var r,i=e.indexOf("<");i>=0?(r=e.substring(0,i),e=e.substring(i)):(r=e,e="");t.chars&&t.chars(r)}()}();var r=e===g;g=e,r&&(e="")}function f(t,r){var i=e.match(t);i&&(e=e.substring(i[0].length),i[0].replace(t,r),n=!1)}function b(e,n,a,o){var c={},u=i(n),h=s.voids[u]||!!o;a.replace(l,(function(e,t,n,i,s){c[t]=void 0===n&&void 0===i&&void 0===s?void 0:r.decode(n||i||s||"")})),h||p.push(u),t.start&&t.start(u,c,h)}function m(e,n){var r,s=0,a=i(n);if(a)for(s=p.length-1;s>=0&&p[s]!==a;s--);if(s>=0){for(r=p.length-1;r>=s;r--)t.end&&t.end(p[r]);p.length=s}}m()}},function(e,t,n){"use strict";var r=n(2),i=n(4),s=n(5),a=n(7);e.exports=function(e,t){var n,o=t||{};return h(),{start:function(e,t,a){var u=i(e);if(n.ignoring)return void c(u);if(-1===(o.allowedTags||[]).indexOf(u))return void c(u);if(o.filter&&!o.filter({tag:u,attrs:t}))return void c(u);l("<"),l(u),Object.keys(t).forEach((function(e){var n=t[e],a=(o.allowedClasses||{})[u]||[],c=(o.allowedAttributes||{})[u]||[];c=c.concat((o.allowedAttributes||{})["*"]||[]);var h=i(e);("class"===h&&-1===c.indexOf(h)?(n=n.split(" ").filter((function(e){return a&&-1!==a.indexOf(e)})).join(" ").trim()).length:-1!==c.indexOf(h)&&(!0!==s.uris[h]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var n=e.indexOf(":");if(-1===n)return!0;var r=e.indexOf("?");if(-1!==r&&n>r)return!0;var i=e.indexOf("#");if(-1!==i&&n>i)return!0;return o.allowedSchemes.some((function(t){return 0===e.indexOf(t+":")}))}(n)))&&(l(" "),l(e),"string"==typeof n&&(l('="'),l(r.encode(n)),l('"')))})),l(a?"/>":">")},end:function(e){var t=i(e);-1!==(o.allowedTags||[]).indexOf(t)&&!1===n.ignoring?(l("")):u(t)},chars:function(e){!1===n.ignoring&&l(o.transformText?o.transformText(e):e)}};function l(t){e.push(t)}function c(e){a.voids[e]||(!1===n.ignoring?n={ignoring:e,depth:1}:n.ignoring===e&&n.depth++)}function u(e){n.ignoring===e&&--n.depth<=0&&h()}function h(){n={ignoring:!1,depth:0}}}},function(e,t,n){"use strict";e.exports={allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n').concat(e,"

    ")},I.current.strong=function(e){return'').concat(e,"")},I.current.em=function(e){return'').concat(e,"")},I.current.heading=function(e){return function(t,n){var r=function(e){return e>0&&e<=6?e:6}(n),i="".concat(e.heading," t-heading-").concat(r," ").concat(function(e,t){return 1===t?e.headingLevel1:2===t?e.headingLevel2:3===t?e.headingLevel3:4===t?e.headingLevel4:5===t?e.headingLevel5:6===t?e.headingLevel6:""}(e,r)," ").concat(A.a["heading-level-".concat(r)]);return"').concat(t,"")}}(E),I.current.link=function(e,t,n){var r,s=(r=e.split("?")).length<2?"":i(r,2)[1].includes("target=_blank")?"target=_blank":"",a=(s?e.replace(/target=_blank/,"").replace(/\?&/,"?"):e).replace(/(\?|&)$/,""),o=t?'title="'.concat(t,'"'):"",l='
    ")},I.current.html=function(e){return d()(e)},I.current.table=function(e,t){return'\n \n \n ').concat(e,'\n \n \n ').concat(t,"\n \n
    ")},I.current.tablerow=function(e){return"\n").concat(e,"\n")},I.current.tablecell=function(e,t){var n=t.header?"th":"td",r="<".concat(n,' class="').concat("th"===n?E.tableTh:E.tableTd,'"\n ').concat(t.align?' align="'.concat(t.align,'"'):"",">");return"".concat(r+e,"\n")},I.current.image=function(e,t,n){return'').concat(n,'")},I.current.list=function(e,t){var n=t?"ol":"ul";return"<".concat(n,' class="').concat(E.list," ").concat(t?E.listOrdered:"",'">').concat(e,"")},I.current.listitem=function(e){return'
  • ').concat(e,"
  • ")});var H=C(N,f,"textAlignment"),F=C(P,o,"textPosition"),G=C(L,o,"textPosition"),D=Object(l.useMemo)((function(){return p.a.setOptions({gfm:!0,breaks:!0,sanitize:!1,smartLists:!0,renderer:I.current}),b()(p()(y()({id:s,intl:T})),z)}),[s,T]);return c.a.createElement("div",{id:k,className:"".concat(E.container," flex ").concat(H," ").concat(F," ").concat(G," ").concat(M(q)," ").concat(Z(_))},c.a.createElement("div",{className:E.wrapper,dangerouslySetInnerHTML:{__html:D}}))}var H=Object(l.memo)(q);H.schema={title:"admin/editor.rich-text.title"};t.default=H}]); },function(){ !function(e){function t(t){for(var n,a,u=t[0],c=t[1],l=t[2],d=0,s=[];de.length)&&(t=e.length);for(var r=0,n=new Array(t);r{let n=e.slice(0);for(let e=0;e<=_^]/g,"-")).toLowerCase()}!function(){for(var e=arguments.length,n=new Array(e),t=0;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}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 o,c=!0,i=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return c=e.done,e},e:function(e){i=!0,o=e},f:function(){try{c||null==t.return||t.return()}finally{if(i)throw o}}}}function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t0}},function(e,n,t){"use strict";t.d(n,"a",(function(){return c}));var r=t(0),a=t(1),o=t.n(a);function c(e){return Object(r.useMemo)((function(){var n=e.variant,t=void 0===n?"primary":n,r=e.disabled,a=void 0!==r&&r,c=e.size,i=void 0===c?"regular":c,u=function(e,n){var t;switch(e){case"primary":t=n?"bg-disabled b--muted-5 c-on-disabled":"bg-action-primary b--action-primary c-on-action-primary hover-bg-action-primary hover-b--action-primary hover-c-on-action-primary";break;case"secondary":t="bg-action-secondary b--action-secondary c-on-action-secondary hover-bg-action-secondary hover-b--action-secondary hover-c-on-action-secondary"}return{container:t}}(t,a),l=function(e){var n,t;switch(e){case"small":n="min-h-small t-action--small",t="ph5";break;case"large":n="min-h-large t-action--large",t="ph7";break;default:n="min-h-regular t-action",t="ph6"}return{container:n,label:t}}(i);return{container:o()("bw1 fw5 ba v-mid pa0 lh-solid br2","inline-flex items-center no-underline",u.container,l.container),label:o()("w-100 tc",l.label)}}),[e])}},,,function(e,n,t){"use strict";t.d(n,"a",(function(){return u}));var r=t(17),a=t(13),o=t(2),c=t(0),i=t(4);var u=function(e,n,t){var u=Object(c.useState)("#"),l=Object(a.a)(u,2),s=l[0],d=l[1],f=Object(o.useRuntime)().route.queryString;return Object(c.useEffect)((function(){if(e){var a=[{type:i.a.queryString,namespace:"queryString",context:f}].concat(Object(r.a)(null!=t?t:[])).reduce((function(e,t){return function(e){for(var n=e.link,t=e.namespace,r=e.context,a=e.contextType,o=e.escapeLinkRegex,c=Object(i.b)(a)(r),u=n,l=0,s=Object.keys(c);le.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var f=function(e,t,n){var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return m(i)},v=n(12);const h=async()=>{},p=Object(r.createContext)({addItem:h,addItems:h,updateQuantity:h,removeItem:h,setManualPrice:h}),I=()=>Object(r.useContext)(p),g={queue:[]},y=e=>{var t;let n=null;try{n=JSON.parse(null!==(t=localStorage.getItem("orderQueue"))&&void 0!==t?t:"null")}catch{}if(!n)try{localStorage.setItem("orderQueue",JSON.stringify(g))}catch(t){null==e||e({type:"Error",level:"Critical",event:t,workflowType:"OrderItems",workflowInstance:"get-local-order-queue"})}return null!=n?n:g},w=(e,t)=>{try{localStorage.setItem("orderQueue",JSON.stringify(e))}catch(e){null==t||t({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"save-local-order-queue"})}},b=(e,t)=>{const n=y(),i=n.queue.push(e);return w(n,t),i},k=(e=0,t)=>{const n=y(t),i=n.queue[e];if(i)return n.queue.splice(e,1),w(n,t),i},T="available",q=(e,t,n)=>{var i,r,a;const u=(null===(i=e.id)||void 0===i?void 0:i.toString())===t.id,s=e.seller===t.seller;if(t.isGift)return!1;if(null==e.options||!(null===(r=e.options)||void 0===r?void 0:r.length))return!(null===(a=t.attachments)||void 0===a?void 0:a.length)&&(u&&s);const o=e.options.every(e=>n.find(t=>t.id===e.id));return u&&s&&o},O=e=>{var t;return{id:+(null!==(t=e.id)&&void 0!==t?t:0),index:e.index,quantity:e.quantity,seller:e.seller,options:e.options}},M=(e,t)=>{var n,i,r,a;return{id:t.id,productId:t.productId,name:t.name,skuName:t.skuName,skuSpecifications:t.skuSpecifications,imageUrls:{at1x:t.imageUrl,at2x:t.imageUrl,at3x:t.imageUrl},price:t.price,listPrice:t.listPrice,sellingPrice:t.sellingPrice,measurementUnit:t.measurementUnit,quantity:null!==(n=t.quantity)&&void 0!==n?n:1,unitMultiplier:null!==(i=t.unitMultiplier)&&void 0!==i?i:1,uniqueId:null!==(r=e.uniqueId)&&void 0!==r?r:f(),detailUrl:t.detailUrl,availability:null!==(a=t.availability)&&void 0!==a?a:T,additionalInfo:t.additionalInfo,options:t.options,seller:t.seller,attachmentOfferings:[],attachments:[],bundleItems:[],offerings:[],priceTags:[],isGift:!1}},x=e=>void 0!==e;function C({useMutateAddItems:e,useOrderForm:t,useLogger:n}){return i=>{var a;const{setOrderForm:u}=t(),s=e(),{log:o}=null!==(a=null==n?void 0:n())&&void 0!==a?a:{};return Object(r.useCallback)(({mutationInputItems:e,mutationInputMarketingData:t,orderFormItems:n,salesChannel:r,allowedOutdatedData:a})=>({execute:async()=>{var l;const{data:d,errors:c}=await s({items:e,marketingData:t,salesChannel:r,allowedOutdatedData:a});if(!d||(null!==(l=null==c?void 0:c.length)&&void 0!==l?l:0)>0)throw null==c?void 0:c[0];return n.forEach(e=>{const t=null==d?void 0:d.items.find(t=>t.id===e.id);if(!t)return;const n=e.uniqueId;(({fakeUniqueId:e,uniqueId:t},n)=>{const i=y(n);i.queue=i.queue.map(n=>{if("update_mutation"!==n.type)return n;const i=n.variables.orderItems.findIndex(t=>"uniqueId"in t&&t.uniqueId===e);return i>-1&&(n.variables.orderItems[i]={...n.variables.orderItems[i],uniqueId:t}),n}),w(i,n)})({fakeUniqueId:n,uniqueId:t.uniqueId},o),i.current[n]=t.uniqueId}),u(n=>({...n,items:n.items.map(t=>{if(-1===e.findIndex(e=>q(e,t,n.items)))return t;const i=d.items.find(e=>e.id===t.id);return i?{...t,uniqueId:i.uniqueId}:null}).filter(e=>null!=e),marketingData:null!=t?t:n.marketingData})),d},rollback:()=>{u(t=>{const n=e.map(({id:e})=>e.toString());return{...t,items:t.items.filter(e=>!n.includes(e.id))}})}}),[i,o,s,u])}}const _=({totalizers:e,currentValue:t=0,newItem:n,oldItem:i})=>{var r,a,u,s,o;if((null==i?void 0:i.availability)!==T)return{totalizers:e,value:t};const l=(null!==(r=i.price)&&void 0!==r?r:0)*(null!==(a=i.unitMultiplier)&&void 0!==a?a:1),d=null!==(u=i.quantity)&&void 0!==u?u:0,c=null!==(s=i.sellingPrice)&&void 0!==s?s:0,m=l*d,f=n.price*(null!==(o=n.unitMultiplier)&&void 0!==o?o:1),v=f*n.quantity-m,h=(c-l)*d,p=(n.sellingPrice-f)*n.quantity-h,I=t+v+p;if(!e.length)return{totalizers:[{id:"Items",name:"Items Total",value:v},{id:"Discounts",name:"Discounts Total",value:p}],value:I};return{totalizers:e.map(e=>{switch(e.id){case"Items":return{...e,value:e.value+v};case"Discounts":return{...e,value:e.value+p};default:return e}}),value:I}},D=async()=>{};function E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}){const l=C({useMutateAddItems:e,useOrderForm:i}),d=function({useMutateSetManualPrice:e}){return()=>{const t=e();return Object(r.useCallback)((e,n)=>{if(t)return{execute:async()=>{var i;const{data:r,errors:a}=await t({itemIndex:n,price:e});if(!r||(null!==(i=null==a?void 0:a.length)&&void 0!==i?i:0)>0)throw null==a?void 0:a[0];return r}}},[t])}}({useMutateSetManualPrice:n}),c=function({useMutateUpdateQuantity:e,useOrderForm:t}){return n=>{const{setOrderForm:i}=t(),a=e();return Object(r.useCallback)(({items:e,orderFormItems:t,id:r,allowedOutdatedData:u,splitItem:s})=>({id:r,execute:async()=>{var t;const i={orderItems:e.map(e=>{if("uniqueId"in e){return{uniqueId:n.current[e.uniqueId]||e.uniqueId,quantity:e.quantity}}return e}),allowedOutdatedData:u,splitItem:s},{data:r,errors:o}=await a(i);if(!r||(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0)throw null==o?void 0:o[0];return r},rollback:()=>{const n=e.filter(({quantity:e})=>0===e),r=e.filter(({quantity:e})=>0!==e),a=n.map(e=>t.find((t,n)=>"uniqueId"in e?t.uniqueId===e.uniqueId:e.index===n)).filter(x);i(e=>({...e,items:e.items.map(e=>{const n=r.findIndex((t,n)=>"uniqueId"in t?e.uniqueId===t.uniqueId:n===t.index);if(-1!==n){const i=r[n],a=t.find((e,t)=>"uniqueId"in i?e.uniqueId===i.uniqueId:t===i.index);return{...e,quantity:a.quantity}}return e}).concat(a)}))}}),[n,a,i])}}({useMutateUpdateQuantity:t,useOrderForm:i});return{OrderItemsProvider:({children:e})=>{const{orderForm:t,setOrderForm:n}=i(),{log:m}=u(),h=function({useOrderQueue:e}){const t=Object(r.useRef)({}),{listen:n}=e();return Object(r.useEffect)(()=>n("Fulfilled",()=>{t.current={}}),[n]),t}({useOrderQueue:s}),I=(({useOrderForm:e,useLogger:t,useOrderQueue:n,useQueueStatus:i})=>{const{log:a}=t(),{enqueue:u}=n(),s=i(),{setOrderForm:o}=e();return Object(r.useCallback)(e=>u(e.execute,e.id).then(e=>{k(0,a),"Fulfilled"===s.current?o(e):o(t=>{var n;return{...t,messages:{...e.messages,generalMessages:null===(n=e.messages)||void 0===n?void 0:n.generalMessages}}})},e=>{if(!e||e.code!==v.a)throw k(0,a),a({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"enqueue-task-error"}),e;k(e.index,a)}),[u,s,o,a])})({useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}),g=l(h),w=c(h),T=d(),x=Object(r.useRef)(t.items);Object(r.useEffect)(()=>{x.current=t.items},[t.items]);const C=Object(r.useCallback)(async(e,t)=>{var i,r,a;let u,s="";const o=x.current;if(e.id?u=o.findIndex(t=>q(e,t,o)):e.uniqueId?(s=e.uniqueId,u=o.findIndex(t=>t.uniqueId===e.uniqueId)):u=null!==(i=null==e?void 0:e.index)&&void 0!==i?i:-1,u<0||u>=o.length)throw new Error(`Item ${null!==(r=e.id)&&void 0!==r?r:e.uniqueId} not found`);s||(s=o[u].uniqueId);const l=null!==(a=e.quantity)&&void 0!==a?a:1;let d;n(e=>{const t=e.items.slice(),n=t[u],i={...n,quantity:l};return l>0?t[u]=i:t.splice(u,1),{...e,..._({totalizers:e.totalizers,currentValue:e.value,newItem:i,oldItem:n}),items:t}});let c=f();if(l>0){const n=y(m).queue;let i=-1;const r=c;for(let e=1;ee.quantity>0)?(i=e,c=t.id):(i=-1,c=r)}const a=-1===i?void 0:n[i],o="update_mutation"===(null==a?void 0:a.type)?a.variables.orderItems:[],f=o.findIndex(e=>"uniqueId"in e?e.uniqueId===s:e.index===u);let v={uniqueId:s,quantity:l};"index"in e&&(v={index:u,quantity:l}),d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:f>-1?o.map((e,t)=>t===f?v:e):o.concat([v])}}else d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:[{uniqueId:s,quantity:l}]};return b({id:c,type:"update_mutation",variables:d,orderFormItems:o},m),I(w({items:d.orderItems,orderFormItems:o,id:c,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem}))},[I,m,n,w]),E=Object(r.useCallback)(async(e,t)=>{const{salesChannel:i,marketingData:r,allowedOutdatedData:a,splitItem:u}=null!=t?t:{},{newItems:s,updatedItems:o}=e.reduce((t,n)=>{var i;const{newItems:r,updatedItems:a}=t,u=n.options&&n.options.length>0?void 0:x.current.find(t=>q(n,t,e));return null==u?r.push(n):a.push({...n,quantity:(null!==(i=n.quantity)&&void 0!==i?i:1)+u.quantity}),t},{newItems:[],updatedItems:[]}),l=[];if(o.length&&o.forEach(e=>{const t=C(e,{allowedOutdatedData:a,splitItem:u});l.push(t)}),0===s.length)return Promise.all(l).then(D);const d=s.map(O),c=s.map((e,t)=>M(d[t],e));n(e=>{var t;return{...e,items:[...x.current,...c],totalizers:c.reduce((e,t)=>_({totalizers:e,newItem:t}).totalizers,null!==(t=e.totalizers)&&void 0!==t?t:[]),marketingData:null!=r?r:e.marketingData,value:e.value+c.reduce((e,t)=>e+t.sellingPrice*t.quantity,0)}}),b({type:"add_mutation",variables:{items:d,marketingData:r,salesChannel:i,allowedOutdatedData:a},orderFormItems:c},m);const f=I(g({mutationInputItems:d,mutationInputMarketingData:r,orderFormItems:c,salesChannel:i,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData}));return Promise.all([...l,f]).then(D)},[g,I,m,n,C]),F=Object(r.useCallback)((e,t,n)=>E(e,{marketingData:t,salesChannel:n}),[E]),S=Object(r.useCallback)((e,t)=>{const n=T(e,t);n&&I(n)},[I,T]),j=Object(r.useCallback)((e,t)=>C({...e,quantity:0},t),[C]),P=Object(r.useMemo)(()=>({addItem:F,addItems:E,updateQuantity:C,removeItem:j,setManualPrice:S}),[F,E,C,j,S]);return Object(r.useEffect)(()=>{y(m).queue.forEach(e=>{"add_mutation"===e.type?I(g({mutationInputItems:e.variables.items,mutationInputMarketingData:e.variables.marketingData,orderFormItems:e.orderFormItems,salesChannel:e.variables.salesChannel,allowedOutdatedData:e.variables.allowedOutdatedData})):"update_mutation"===e.type&&I(w({items:e.variables.orderItems,orderFormItems:e.orderFormItems,allowedOutdatedData:e.variables.allowedOutdatedData,splitItem:e.variables.splitItem,id:e.id}))})},[g,I,m,w]),a.a.createElement(p.Provider,{value:P},e)}}}function F({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u}){return E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u})}},,,,,,,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(0);const r={cancel:Object.create(null),timeout:Object.create(null)},a="drained",u="error",s="timeout";function o(){}class l{constructor(e){var t,n;this.queue=[],this._isClosed=!1,this.waiters=[],e||(e={}),this.defaultTimeout=e.timeout,this.name=null!==(t=e.name)&&void 0!==t?t:"SequentialTaskQueue",this.scheduler=null!==(n=e.scheduler)&&void 0!==n?n:l.defaultScheduler}get isClosed(){return this._isClosed}push(e,t){if(this._isClosed)throw new Error(this.name+" has been previously closed");const n={callback:e,args:(null==t?void 0:t.args)?Array.isArray(t.args)?t.args.slice():[t.args]:[],timeout:void 0!==(null==t?void 0:t.timeout)?t.timeout:this.defaultTimeout,cancellationToken:{cancel:e=>this.cancelTask(n,e)},resolve:void 0,reject:void 0};n.args.push(n.cancellationToken),this.queue.push(n),this.scheduler.schedule(()=>this.next());const i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return i.cancel=e=>n.cancellationToken.cancel(e),i}cancel(){this.currentTask&&this.cancelTask(this.currentTask,r.cancel);const e=this.queue.splice(0);return e.length&&(e.forEach(e=>this.cancelTask(e,r.cancel)),this.emit(a)),this.wait()}indexOf(e){var t;if((null===(t=this.currentTask)||void 0===t?void 0:t.callback)===e)return 0;const n=this.queue.filter(e=>{var t;return!(null===(t=e.cancellationToken)||void 0===t?void 0:t.cancelled)}).findIndex(t=>t.callback===e);return n<0?n:n+(void 0!==this.currentTask?1:0)}close(e){return!this._isClosed&&(this._isClosed=!0,e)?this.cancel():this.wait()}async wait(){return this.currentTask||0!==this.queue.length?new Promise(e=>{this.waiters.push(e)}):Promise.resolve()}on(e,t){var n;this.events=null!==(n=this.events)&&void 0!==n?n:{},(this.events[e]||(this.events[e]=[])).push(t)}once(e,t){const n=(...i)=>{this.removeListener(e,n),t.apply(this,i)};this.on(e,n)}removeListener(e,t){if(this.events){const n=this.events[e];if(n){let e=0;for(;ee.apply(this,t))}catch(t){console.error(`${this.name}: Exception in '${e}' event handler`,t)}}next(){if(!this.currentTask){let t=this.queue.shift();for(;null==t?void 0:t.cancellationToken.cancelled;)t=this.queue.shift();if(t)try{this.currentTask=t,t.timeout&&(t.timeoutHandle=setTimeout(()=>{this.emit(s),this.cancelTask(t,r.timeout)},t.timeout));const n=t.callback.apply(void 0,t.args);n&&((e=n)&&"function"==typeof e.then)?n.then(e=>{t.result=e,this.doneTask(t)},e=>{this.doneTask(t,e)}):(t.result=n,this.doneTask(t))}catch(e){this.doneTask(t,e)}else this.callWaiters()}var e}cancelTask(e,t){e.cancellationToken.cancelled=!0,e.cancellationToken.reason=t,this.doneTask(e)}doneTask(e,t){e.timeoutHandle&&clearTimeout(e.timeoutHandle),e.cancellationToken.cancel=o,t?(this.emit(u,t),e.reject.call(void 0,t)):e.cancellationToken.cancelled?e.reject.call(void 0,e.cancellationToken.reason):e.resolve.call(void 0,e.result),this.currentTask===e&&(this.currentTask=void 0,this.queue.length?this.scheduler.schedule(()=>this.next()):(this.emit(a),this.callWaiters()))}callWaiters(){this.waiters.splice(0).forEach(e=>e())}}l.defaultScheduler={schedule:e=>setTimeout(()=>e(),0)},l.defaultScheduler={schedule:"function"==typeof e?t=>e(()=>t()):e=>setTimeout(()=>e(),0)};const d="TASK_CANCELLED",c={id:"default-order-form",items:[],value:-1,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};Object(i.createContext)(void 0);var m,f,v,h,p;p=!("undefined"==typeof window||!window.document||!window.document.createElement)&&(null===(h=null===(v=null===(f=null===(m=window)||void 0===m?void 0:m.__RUNTIME__)||void 0===f?void 0:f.settings)||void 0===v?void 0:v["vtex.store"])||void 0===h?void 0:h.enableOrderFormOptimization),Object(i.createContext)({orderForm:c,setOrderForm:()=>{},error:void 0,loading:!1})}).call(this,n(15).setImmediate)},,,function(e,t,n){var i="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new a(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(16),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof global&&global.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof global&&global.clearImmediate||this&&this.clearImmediate},function(e,t,n){(function(e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,a,u,s,o=1,l={},d=!1,c=t.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(t);m=m&&m.setTimeout?m:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){v(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){v(e.data)},i=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(e){var t=c.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(v,0,e)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&v(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(u+e,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?a:[""],utmiCampaign:null}))}).then((function(n){return n.json()})).catch((function(n){return console.error(n)}));case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),_=function(){return window.location.hostname.split(".").slice(1).join(".")},j=function(){var n=Object(i.a)(o.a.mark((function n(t){var e,r;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch("/_v/public/getRandomConsultant".concat(t?"QA":"Prod"),{method:"POST"});case 2:return e=n.sent,n.next=5,e.json();case 5:return r=n.sent,n.abrupt("return",r);case 7:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),k=function(){var n=Object(i.a)(o.a.mark((function n(t,e){var r,i,a,u,c;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((r=null==t?void 0:t.trim())&&e){n.next=3;break}return n.abrupt("return",[]);case 3:if(!l.includes(r.toLowerCase())){n.next=5;break}return n.abrupt("return",[]);case 5:return"/api/dataentities/MS/search",i=e.replace(/(esika|lbel|cyzone)/gm,"belcorp"),a="?an=".concat(i,"&_fields=consultantCode&_where=storeUrl=").concat(r),n.next=10,fetch("".concat("/api/dataentities/MS/search").concat(a),{headers:{"Content-Type":"application/json",Accept:"application/json "},method:"GET"});case 10:return u=n.sent,n.next=13,u.json();case 13:return c=n.sent,n.abrupt("return",c);case 15:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),O=function(){var n,t,e=null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.href,r=new URL(e);return r.searchParams.delete(s),null!==(t=null==r?void 0:r.href)&&void 0!==t?t:e},y=function(n){var t,e,r=null==n?void 0:n.trim(),o=null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.href;if(!r)return console.error("Invalid search parameter."),o;var i=new URL(o);return i.searchParams.append(s,window.encodeURI(r)),null!==(e=null==i?void 0:i.href)&&void 0!==e?e:o},x=function(n){var t,e=null==n?void 0:n.trim();e?e!==(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.href)&&(null===window||void 0===window||window.history.replaceState(null,"",window.encodeURI(e))):console.error("Invalid URL.")},C=function(){var n,t=""===f("consultantUrl")?[]:null===(n=f("consultora"))||void 0===n?void 0:n.split(",");return(null==t?void 0:t[((null==t?void 0:t.length)||0)-2])||""},U=function(){return{section:window.vtex_current_section_page_view,location:window.vtex_current_location_page_view}},I=function(){var n,t;return null===(t=null===(n=window.__RUNTIME__)||void 0===n?void 0:n.culture)||void 0===t?void 0:t.currency}}]]); },function(){ (window.webpackJsonpbelcorp_belcorp_consultant_0_8_11=window.webpackJsonpbelcorp_belcorp_consultant_0_8_11||[]).push([[1],{16:function(t,e,c){"use strict";c.r(e),c.d(e,"useConsultantCookieContext",(function(){return m}));var n=c(3),o=c.n(n),a=c(10),r=c(2),u=c(0),i=c.n(u),l=c(11),d=c(7),s=c(1),b=Object(u.createContext)(null),m=function(){var t=Object(u.useContext)(b);if(!t)throw new Error("useConsultantCookieContext must be used within an ConsultantPersistenceLayer");return t};e.default=function(t){var e=Object(u.useState)(),c=Object(r.a)(e,2)[1],n=Object(u.useState)({data:""}),m=Object(r.a)(n,2),O=m[0],j=m[1],v=Object(u.useState)(""),f=Object(r.a)(v,2),h=f[0],p=f[1],k=Object(u.useState)({}),x=Object(r.a)(k,2),g=x[0],U=x[1],w=Object(l.useOrderForm)().orderForm,C=(w||{}).id,_=Object(d.useRuntime)(),y=_.route,E=_.account,P=_.culture;return Object(u.useEffect)((function(){C!==h&&"default-order-form"!==C&&p(C)}),[C]),Object(u.useEffect)((function(){var t,e,n;if(h){var r=function(){var t=Object(a.a)(o.a.mark((function t(e,n,a){var r,u,l,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(s.d)(e,n);case 2:if(!(l=t.sent).error){t.next=6;break}return d="".concat(l.error.status,' " - " message: ').concat(l.error.detail),t.abrupt("return",c(d));case 6:if(!Boolean(null==l?void 0:l.length)||!Object(s.m)(e)){t.next=14;break}return j({data:"storeUrl"}),document.cookie="consultantUrl=".concat(e,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultant_code=".concat(null!==(u=null===(r=l[0])||void 0===r?void 0:r.consultantCode)&&void 0!==u?u:"",";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultora=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),Object(s.r)(i,C),t.abrupt("return");case 14:Object(s.t)(Object(s.l)()),Object(s.t)(Object(s.k)(a)),Object(s.m)(a)&&(document.cookie="consultantUrl=".concat(a,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;")),j({data:""});case 18:case"end":return t.stop()}}),t)})));return function(e,c,n){return t.apply(this,arguments)}}(),u=function(){var t=Object(a.a)(o.a.mark((function t(e){var n,a,r,u,i;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(s.e)(e);case 2:if(!(null==(r=t.sent)?void 0:r.error)){t.next=6;break}return u="".concat(null===(n=null==r?void 0:r.error)||void 0===n?void 0:n.status,' " - " message: ').concat(null===(a=null==r?void 0:r.error)||void 0===a?void 0:a.detail),t.abrupt("return",c(u));case 6:i=r.data.consultantCode,document.cookie="consultant_code=".concat(i,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),U(r);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),i=null!==(t=new URLSearchParams(window.location.search).get(s.b))&&void 0!==t?t:"",l=null!==(n=null===(e=Object(s.n)(document.cookie))||void 0===e?void 0:e.consultantUrl)&&void 0!==n?n:"";if(s.a.includes(i))return j({data:""}),Object(s.t)(Object(s.l)()),void Object(s.c)(w);if(s.a.includes(l))return j({data:i}),document.cookie="consultantUrl=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultant_code=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultora=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),void Object(s.c)(w);if("ECU"===(null==P?void 0:P.country)||"PAN"===(null==P?void 0:P.country)){if(!i&&!l){if(!(null==g?void 0:g.storeUrl))return void u(E.includes("qa"));if((null==g?void 0:g.storeUrl)&&Object(s.m)(null==g?void 0:g.storeUrl))return document.cookie="consultantUrl=".concat(null==g?void 0:g.storeUrl,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),Object(s.r)(null==g?void 0:g.storeUrl,C),void j({data:null==g?void 0:g.storeUrl})}if(i&&!l)return void r(i,E,l)}if((!i&&l||i!==O.data)&&j({data:i}),!i&&l)return Object(s.t)(Object(s.l)()),Object(s.t)(Object(s.k)(l)),void Object(s.r)(l,C);if(i&&!l&&Object(s.m)(i)&&(document.cookie="consultantUrl=".concat(i,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),Object(s.r)(i,C)),i&&l){if(("ECU"===(null==P?void 0:P.country)||"PAN"===(null==P?void 0:P.country))&&i!==l)return void r(i,E,l);var d=Object(s.g)("consultantUrl");i!==d&&Object(s.m)(i)&&(document.cookie="consultantUrl=".concat(i,";domain=").concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultant_code=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),document.cookie="consultora=;domain=".concat(Object(s.h)(),";path=/;max-age=7776000;secure;"),Object(s.r)(i,C))}}}),[h,y,O,g]),i.a.createElement(b.Provider,{value:{utmiCpParam:O}},t.children)}}}]); },function(){ (window.webpackJsonpbelcorp_belcorp_consultant_0_8_11=window.webpackJsonpbelcorp_belcorp_consultant_0_8_11||[]).push([["ConsultantPersistenceLayer"],{0:function(e,t){e.exports=React},11:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},20:function(e,t){e.exports=regeneratorRuntime},40:function(e,t,n){"use strict";n.r(t),function(e){var t=n(9);n.p=Object(t.getPublicPath)("belcorp.belcorp-consultant@0.8.11");var o=Object(t.register)((function(){return n(16)}),e,"belcorp.belcorp-consultant@0.8.11","belcorp.belcorp-consultant@0.x","ConsultantPersistenceLayer");o.renderHotReload,o.setupHMR}.call(this,n(18)(e))},7:function(e,t){e.exports=__RENDER_8_RUNTIME__}},[[40,"common",0,1]]]); },function(){ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t){e.exports=React},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPublicPath=t.register=void 0;var r="__RENDER_8_RUNTIME__",o="__RENDER_8_COMPONENTS__",i=!("undefined"==typeof window||!window.document);i&&!window.global&&(window.global=window),window[o]=window[o]||{},t.register=function(e,t,n,i,a){var c="".concat(n,"/").concat(a),u="".concat(i,"/").concat(a),l=function(){return function(e,t){try{var n=e();return n.__esModule?n.default:n.default||n}catch(e){throw new Error("An error happened while requiring the app ".concat(t,", please check your app's code.\\n").concat(e.stack))}}(e,c)};if(window[r]&&window[r].registerComponent){var d=!!window.__RENDER_LAZY__;window[r].registerComponent(t,d?l:l(),n,a,d)}else{var s=l();window[r]&&window[r].withHMR?window[o][c]=window[o][u]=window[r].withHMR(t,s):window[o][c]=window[o][u]=s}return{}},t.getPublicPath=function(e){var t=window.__hostname__,n="/_v/public/assets/v1/published/";return i&&window.__RUNTIME__&&(t=__RUNTIME__.assetServerPublishedHost||window.location.hostname,n=__RUNTIME__.assetServerPublishedPath||"/_v/public/assets/v1/published/"),"https://"+t+n+"".concat(e,"/public/react/")}},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["belcorp.utilitary-functions@0.x/formatBelcorpDomainUrl"]},function(e,t){e.exports=__RENDER_8_RUNTIME__},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1);n.p=Object(t.getPublicPath)("belcorp.header-cart-button@0.4.2");var r=Object(t.register)((function(){return n(8)}),e,"belcorp.header-cart-button@0.4.2","belcorp.header-cart-button@0.x","CartButton");r.renderHotReload,r.setupHMR}.call(this,n(7)(e))},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0;){var s=c;c=new Set,s.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){c.add(e)})))}))}return o.forEach((function(n){var i=r(e,n);i&&t.definitions.push(i)})),t}(t,"GET_IS_CONSULTANT")},15:function(e,n,t){"use strict";t.d(n,"b",(function(){return l}));var i=t(0),r=t.n(i),a=t(2),o=t(12),c=t.n(o),s=function(){var e=Object(a.useQuery)(c.a),n=e.data,t=e.loading;return{isConsultantData:Object(i.useMemo)((function(){if(!t&&n){var e=n.profile,i=(e=void 0===e?{}:e).isConsultant,r=void 0!==i&&i,a=e.email;return{isConsultant:r,email:void 0===a?"":a}}return{isConsultant:!1,email:""}}),[n,t]),loading:t}},u=Object(i.createContext)({}),l=function(){var e=Object(i.useContext)(u);if(!e)throw new Error("useConsultant must be used inside a ConsultantContext");return e};n.a=function(e){var n=e.children,t=s(),i=t.isConsultantData,a=t.loading,o=i.isConsultant,c=i.email;return r.a.createElement(u.Provider,{value:{isConsultant:o,email:c,loading:a}},n)}},4:function(e,n,t){"use strict";t.d(n,"b",(function(){return p}));var i=t(5),r=t(0),a=t.n(r),o=t(6),c=t.n(o),s=t(11),u=t.n(s),l=t(16),d=t(15),f=function(e,n){var t=Object(r.useState)(null),a=Object(i.a)(t,2),o=a[0],c=a[1],s=Object(r.useState)(null),f=Object(i.a)(s,2),v=f[0],m=f[1],p=function(){var e=Object(r.useState)(),n=Object(i.a)(e,2),t=n[0],a=n[1],o=Object(r.useState)(),c=Object(i.a)(o,2),s=c[0],d=c[1],f=Object(r.useState)(!1),v=Object(i.a)(f,2),m=v[0],p=v[1],b=Object(r.useState)(""),h=Object(i.a)(b,2),k=h[0],g=h[1];return Object(r.useEffect)((function(){(function(){var e=Object(l.a)(u.a.mark((function e(){var n,t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),e.prev=1,e.next=4,window.fetch("/api/sessions?items=*");case 4:if((n=e.sent).ok){e.next=7;break}throw new Error("Http status ".concat(n.status));case 7:return e.next=9,n.json();case 9:t=e.sent,a(t.namespaces.store.channel.value),d(t.namespaces.store.countryCode.value),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(1),console.error(e.t0.message),g(e.t0.message);case 18:p(!1);case 19:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}})()()}),[]),{sc:t,countryCode:s,loading:m,error:k}}().countryCode,b=Object(d.b)(),h=b.isConsultant,k=b.email,g=b.loading;return Object(r.useEffect)((function(){function t(){return(t=Object(l.a)(u.a.mark((function t(){var i,r;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!h||g){t.next=13;break}return t.prev=1,t.next=4,fetch("/api/sessions?items=store.channel").then((function(e){return e.json()}));case 4:return i=t.sent,r=i.namespaces.store.channel.value,t.next=8,fetch("/api/checkout/pub/orderforms/simulation?sc=".concat(r),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:[{id:e,quantity:1,seller:n.sellerId}],clientProfileData:{email:k},country:p})}).then((function(e){return e.json()})).then((function(e){if(e.error){var n="".concat(e.error.code,' " - " message: ').concat(e.error.message);m(n)}c(e)}));case 8:t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),m(t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})))).apply(this,arguments)}!function(){t.apply(this,arguments)}()}),[e,h,g,k,p,n.sellerId]),{simulation:o,error:v}};var v=function(e){return e/100},m=Object(r.createContext)({}),p=function(){var e=Object(r.useContext)(m);if(!e)throw new Error("usePricesProduct must be used inside a PricesContext");return e};n.a=function(e){var n,t,r,o=e.children,s=c()(),u=s.selectedItem,l=(u=void 0===u?{}:u).itemId,d=void 0===l?"":l,p=u.sellers,b=void 0===p?[]:p,h=s.product,k=((null===(n=null==h?void 0:h.specificationGroups)||void 0===n?void 0:n[0])||{}).specifications,g=null===(t=null==k?void 0:k.find((function(e){return"Unidad de medida del contenido"===e.name})))||void 0===t?void 0:t.values[0],O=+((null===(r=null==k?void 0:k.find((function(e){return"Contenido Neto"===e.name})))||void 0===r?void 0:r.values[0])||0);O=isNaN(O)||O<=0?0:O;var S=function(e){if(!e||0===e.length)return{sellerId:"",sellerName:"",addToCartLink:"",sellerDefault:!0,commertialOffer:{Price:0,ListPrice:0}};var n=e.find((function(e){return e.sellerDefault}));return n||e[0]}(b),C=S.commertialOffer,j=function(e,n){var t=n.ListPrice,r=n.Price,a=n.taxPercentage;if(!e||!e.items.length)return{sellingPrice:r,listPrice:t,taxPercentage:a};var o=Object(i.a)(e.items,1)[0],c=o.sellingPrice,s=o.listPrice;return{sellingPrice:v(c),listPrice:v(s),taxPercentage:a}}(f(d,S).simulation,C),P=j.sellingPrice,x=j.listPrice,w=j.taxPercentage,N=function(e,n){return e&&n?(e-n)/e:0}(x,P),_=x-P,y=Math.round(100*w)/100;return a.a.createElement(m.Provider,{value:{itemId:d,listPrice:x,sellingPrice:P,savingsPrice:_,discount:N,taxPercentage:y,measurementUnit:g,netContent:O}},o)}}}]); },function(){ (window.webpackJsonpbelcorp_belcorp_product_price_0_2_6=window.webpackJsonpbelcorp_belcorp_product_price_0_2_6||[]).push([["PricesContext"],{0:function(e,c){e.exports=React},10:function(e,c){e.exports=regeneratorRuntime},2:function(e,c){e.exports=ReactApollo},24:function(e,c,r){"use strict";r.r(c),function(e){var c=r(1);r.p=Object(c.getPublicPath)("belcorp.belcorp-product-price@0.2.6");var t=Object(c.register)((function(){return r(25)}),e,"belcorp.belcorp-product-price@0.2.6","belcorp.belcorp-product-price@0.x","PricesContext");t.renderHotReload,t.setupHMR}.call(this,r(9)(e))},25:function(e,c,r){"use strict";r.r(c);var t=r(4);c.default=t.a},6:function(e,c){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]}},[[24,"common",0]]]); },function(){ (window.webpackJsonpbelcorp_belcorp_product_price_0_2_6=window.webpackJsonpbelcorp_belcorp_product_price_0_2_6||[]).push([["ListPrice"],{0:function(e,t){e.exports=React},10:function(e,t){e.exports=regeneratorRuntime},2:function(e,t){e.exports=ReactApollo},23:function(e,t,c){"use strict";c.r(t),function(e){var t=c(1);c.p=Object(t.getPublicPath)("belcorp.belcorp-product-price@0.2.6");var r=Object(t.register)((function(){return c(33)}),e,"belcorp.belcorp-product-price@0.2.6","belcorp.belcorp-product-price@0.x","ListPrice");r.renderHotReload,r.setupHMR}.call(this,c(9)(e))},3:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},33:function(e,t,c){"use strict";c.r(t);var r=c(0),n=c.n(r),o=c(7),u=c.n(o),i=c(3),s=c.n(i),p=c(8),_=c(4),a=["listPriceValue"],l=function(){var e,t,c=s()(a).handles,r=Object(_.b)(),o=r.listPrice,i=r.sellingPrice,l=r.taxPercentage,b=Object(p.useRuntime)().account,d=(t=o,(e=l)?t*e:0),x=b.includes("ecuador")?o+d:o;return i&&o<=i||!o||Number.isNaN(o)?null:n.a.createElement("span",{className:c.listPriceValue},n.a.createElement(u.a,{value:x}))};t.default=l},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},7:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.format-currency@0.x/FormattedCurrency"]},8:function(e,t){e.exports=__RENDER_8_RUNTIME__}},[[23,"common",0]]]); },function(){ (window.webpackJsonpbelcorp_belcorp_product_price_0_2_6=window.webpackJsonpbelcorp_belcorp_product_price_0_2_6||[]).push([["SellingPrice"],{0:function(e,c){e.exports=React},10:function(e,c){e.exports=regeneratorRuntime},2:function(e,c){e.exports=ReactApollo},27:function(e,c,r){"use strict";r.r(c),function(e){var c=r(1);r.p=Object(c.getPublicPath)("belcorp.belcorp-product-price@0.2.6");var t=Object(c.register)((function(){return r(35)}),e,"belcorp.belcorp-product-price@0.2.6","belcorp.belcorp-product-price@0.x","SellingPrice");t.renderHotReload,t.setupHMR}.call(this,r(9)(e))},3:function(e,c){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},35:function(e,c,r){"use strict";r.r(c);var t=r(0),n=r.n(t),o=r(7),u=r.n(o),l=r(3),i=r.n(l),p=r(8),_=r(4),s=["sellingPriceValue"],a=function(){var e,c,r=i()(s).handles,t=Object(_.b)(),o=t.sellingPrice,l=t.taxPercentage,a=Object(p.useRuntime)().account,b=(c=o,(e=l)?c*e:0),d=a.includes("ecuador")?o+b:o;return!o||Number.isNaN(o)?null:n.a.createElement("span",{className:r.sellingPriceValue},n.a.createElement(u.a,{value:d}))};c.default=a},6:function(e,c){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},7:function(e,c){e.exports=__RENDER_8_COMPONENTS__["vtex.format-currency@0.x/FormattedCurrency"]},8:function(e,c){e.exports=__RENDER_8_RUNTIME__}},[[27,"common",0]]]); }], document.currentScript.dataset.index)