PageSourceSearch

https://cdnv3.banlek.com/a4a5426f7312ce569f75a77c9ae8e5ca2b6a3b68-…/static/chunks/3674-95e8f7c51f41a103.js

js banlek.com collected 2026-10-01 10:44:46 UTC 97,013 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3674],{2561:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});let n={mask:e=>e.value.replace(/\D/g,"").length<=11?[/^\d{0,3}$/,/^\d{0,3}$/,/^\d{0,3}$/,".",/^\d{0,3}$/,/^\d{0,3}$/,/^\d{0,3}$/,".",/^\d{0,3}$/,/^\d{0,3}$/,/^\d{0,3}$/,"-",/^\d{0,2}$/,/^\d{0,2}$/]:[/^\d{0,2}$/,/^\d{0,2}$/,".",/^\d{0,3}$/,/^\d{0,3}$/,/^\d{0,3}$/,".",/^\d{0,3}$/,/^\d{0,3}$/,/^\d{0,3}$/,"/",/^\d{0,4}$/,/^\d{0,4}$/,/^\d{0,4}$/,/^\d{0,4}$/,"-",/^\d{0,2}$/,/^\d{0,2}$/]}},12482:(e,a,t)=>{"use strict";t.d(a,{f:()=>o});var n=t(81893);function o(e){let a="CLP"===e?"APP_USR-a73a8c81-3187-4d59-9b75-44d11882ada1":"APP_USR-193bdfe1-dbc8-48df-b6be-87d33dc0ff15";a&&(0,n.Lz)(a)}},21729:(e,a,t)=>{"use strict";t.d(a,{A:()=>E});var n=t(99807),o=t(81893),l=t(93658),r=t(21915),s=t(35312);function i(){let e=(0,r._)(["\n    mutation AddCreditCard(\n        $number: String!\n        $expiration: String!\n        $type: String!\n        $name: String!\n        $documentNumber: String\n        $email: String\n    ) {\n        addCreditCard(\n            credit_card: {\n                number: $number\n                expiration: $expiration\n                type: $type\n                name: $name\n                document_number: $documentNumber\n            }\n            email: $email\n        ) {\n            id\n            status\n        }\n    }\n"]);return i=function(){return e},e}let d=(0,s.J1)(i());function c(){let e=(0,r._)(["\n    mutation criarPedido(\n        $origem: String,\n        $proposalId: Int,\n        $documento: String,\n        $cartaoId: Int,\n        $impressao: [ImpressaoInput],\n        $email: String,\n        $sessaoTemporaria: String,\n        $nome: String,\n        $sobrenome: String,\n        $telefone: String,\n        $ddi: Int,\n        $carrinhoIds: [Int!],\n        $gorjeta: GorjetaInput,\n    ) {\n        criarPedido(\n            propostaId: $proposalId,\n            origem: $origem,\n            documento: $documento,\n            cartaoId: $cartaoId,\n            impressao: $impressao,\n            email: $email,\n            sessaoTemporaria: $sessaoTemporaria,\n            nome: $nome,\n            sobrenome: $sobrenome,\n            telefone: $telefone,\n            ddi: $ddi,\n            carrinhoIds: $carrinhoIds,\n            gorjeta: $gorjeta,\n        ) {\n            compra\n            token\n            status\n            message\n        }\n    }\n"]);return c=function(){return e},e}let u=(0,s.J1)(c());function m(){let e=(0,r._)(["\n    mutation ComprarPacotePreVenda(\n        $albumHash: String!,\n        $email: String,\n        $nome: String,\n        $sobrenome: String,\n        $idCupom: Int,\n        $telefone: String,\n        $ddi: Int,\n        $sessaoTemporaria: String\n        $faceId: String\n    ) {\n        comprarPacotePreVenda(\n            albumHash: $albumHash,\n            email: $email,\n            nome: $nome,\n            sobrenome: $sobrenome,\n            idCupom: $idCupom,\n            telefone: $telefone,\n            sessaoTemporaria: $sessaoTemporaria\n            faceId: $faceId\n            ddi: $ddi\n        ) {\n            status\n            message\n            albumId\n            carrinhoPacoteId\n            preVendaStatus\n            valorOriginal\n            valorComDesconto\n            descontoAplicado\n            descontoTipo\n            compraId\n            token\n        }\n    }\n"]);return m=function(){return e},e}let p=(0,s.J1)(m());var x=t(62231),h=t(32985),v=t(23091),f=t(97536);function g(){let e=(0,r._)(["\n    query GetOrderStatusByTokenQuery(\n        $id: Int\n        $sessaoTemporaria: String\n    ) {\n        minhasCompras(\n            id: $id\n            sessaoTemporaria: $sessaoTemporaria\n        ) {\n            items {\n                status\n            }\n        }\n    }\n"]);return g=function(){return e},e}let j=(0,s.J1)(g());var b=t(50910),y=t(65751),A=t(95631),N=t(2637),C=t(44399),w=t(12115);function _(){let e=(0,r._)(["\n    mutation ComprarProdutoMutation(\n        $email: String,\n        $username: String,\n        $nome: String,\n        $sobrenome: String,\n        $telefone: String,\n        $sessaoTemporaria: String\n        $ddi: Int,\n        $tamanho: String,\n        $cor: String,\n        $idProduto: Int,\n        $idFotoPersonalizada: Int,\n    ) {\n        comprarProduto(\n            email: $email,\n            username: $username,\n            nome: $nome,\n            sobrenome: $sobrenome,\n            telefone: $telefone,\n            sessaoTemporaria: $sessaoTemporaria,\n            ddi: $ddi,\n            tamanho: $tamanho,\n            cor: $cor,\n            idProduto: $idProduto,\n            idFotoPersonalizada: $idFotoPersonalizada\n        ) {\n            id\n            status\n            token\n        }\n    }\n"]);return _=function(){return e},e}let k=(0,s.J1)(_());var S=t(39453),$=t(76630),P=t(65988);let T=()=>({"Content-Type":"application/json","Accept-Language":(0,$.t)()}),E=()=>{let e=(0,b.c)("Common"),{state:{token:a,isAuthenticated:t}}=(0,h.A)(),[r]=(0,N.ZA)("entity",{defaultValue:"",history:"replace"}),[s]=(0,N.ZA)("entityId",{defaultValue:"",history:"replace"}),[i]=(0,N.ZA)("token",{defaultValue:"",history:"replace"}),c=w.useMemo(()=>
1{if(i)try{let e=atob(i);return JSON.parse(e)}catch(e){}return null},[i]),{document:m,email:g,name:_,lastname:$,phone:E,ddi:I,order:V,entity:F,entityId:R,list:M,checkoutList:z,selectedCartSummary:D,selectedCarrinhoIds:B,isCheckoutPricingStale:L,checkoutTipAmount:q,setPaymentStatus:O,setLoadingProcessPay:J,hasPrintPictures:U,selectedPicturesForPrint:X,selectedProductIdPrint:Q}=(0,v.Q)(),Z=(0,n.m)(),G=null!=z?z:M;return{createCardToken:async e=>{try{var a,t,n,o,r,s;let i=(null==G||null==(n=G.total)?void 0:n.moeda)==="CLP",d=i?(null!=(a=m.value)?a:"").replace(/[^0-9A-Z]/gi,"").toUpperCase():(null!=(t=m.value)?t:"").replace(/[^0-9]/g,""),c=i?"RUT":null==(o=m.type)?void 0:o.toLocaleUpperCase(),u=await (0,l.Y)({cardNumber:e.number,cardholderName:e.name,securityCode:e.cvv,cardExpirationMonth:null==(r=e.expiration)?void 0:r.split("/")[0],cardExpirationYear:null==(s=e.expiration)?void 0:s.split("/")[1],identificationNumber:d||void 0,identificationType:c});if(!u||!u.id)throw Error("Failed to create card token.");return u}catch(e){return console.error("Mercado Pago createCardToken error",e),null}},createOrder:async function(){var e,a,n,o;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i="u"<typeof localStorage?null:localStorage.getItem("sessaoTemporaria"),d=(0,S.OC)("SITE,".concat(null!=(e=window.navigator.userAgent)?e:"Desconhecido")," | "),h=(0,S.Sx)(),v=null==(a=y.X.find(e=>e.iso2===I))?void 0:a.phone_code;if(r&&"pre-venda"===r&&s){let e=(0,C.HU)();!t&&localStorage.getItem("sessaoTemporaria")&&(e=localStorage.getItem("sessaoTemporaria")||""),t||localStorage.getItem("sessaoTemporaria")||localStorage.setItem("sessaoTemporaria",e);let a=(0,x.cS)("u">typeof sessionStorage?sessionStorage.getItem((0,x.Vv)(s)):null),{data:n}=await Z.mutate({mutation:p,variables:{albumHash:s,email:g,nome:_,sobrenome:$,idCupom:null==c?void 0:c.idCupom,telefone:"".concat(E),ddi:Number(v),sessaoTemporaria:t?void 0:e,faceId:a},...Object.keys(h).length>0?{context:{headers:h}}:{}}),o=null==n?void 0:n.comprarPacotePreVenda;if((null==o?void 0:o.status)!=="success"||!o.token||!o.compraId)throw Error((null==o?void 0:o.message)||"N\xe3o foi poss\xedvel criar a compra da pr\xe9-venda.");return{token:o.token,compra:String(o.compraId)}}if(r&&"picture-shop"===r&&s){let e=(0,C.HU)();!t&&localStorage.getItem("sessaoTemporaria")&&(e=localStorage.getItem("sessaoTemporaria")||""),t||localStorage.getItem("sessaoTemporaria")||localStorage.setItem("sessaoTemporaria",e);let{data:a}=await Z.mutate({mutation:k,variables:{idProduto:Number(s),idFotoPersonalizada:null==c?void 0:c.image,tamanho:(null==c?void 0:c.size)||"",cor:(null==c?void 0:c.color)||"",username:(null==c?void 0:c.username)||"",email:g,nome:_,sobrenome:$,telefone:"".concat(E),ddi:Number(v),sessaoTemporaria:t?void 0:e},...Object.keys(h).length>0?{context:{headers:h}}:{}});return{token:a.comprarProduto.token,compra:a.comprarProduto.id}}if("carrinho"===F&&0===B.length)throw Error("No selected cart items to create order.");if("carrinho"===F&&L)throw Error("Checkout pricing is stale or errored, refusing to create order.");try{let e=null;"proposta"===F&&(e=R);let a=U?X.map(e=>({impressaoProdutoId:Number(Q),idFoto:e.id})):[],t=(null!=(n=null!=(o=null==D?void 0:D.items)?o:null==M?void 0:M.items)?n:[]).filter(e=>e.produtos.qtd>0).map(e=>e.produtos.itens.filter(e=>!1!==e.selecionado).map(e=>{var a;return{impressaoProdutoId:e.idProduto,idCarrinhoProduto:null!=(a=e.carrinhoId)?a:e.id,idFotoPersonalizada:e.idFotoPersonalizada}})).flat()||[],{data:r}=await Z.mutate({mutation:u,variables:{origem:d,proposalId:e,cartaoId:l,email:g,nome:_,sobrenome:$,ddi:Number(v),telefone:"".concat(E),documento:m.value,carrinhoIds:"carrinho"===F?B:void 0,gorjeta:"carrinho"===F&&q>0?{valor:q}:void 0,impressao:[...a,...t],sessaoTemporaria:i||void 0},...Object.keys(h).length>0?{context:{headers:h}}:{}});if(!r||!r.criarPedido||!r.criarPedido.token)throw Error("Failed to create order.");return{token:r.criarPedido.token,compra:r.criarPedido.compra}}catch(e){throw console.error(e),e}},createMercadoPagoWalletPreference:async e=>{if(!(0,P.O)())throw Error("Mercado Pago Wallet CLP is disabled.");let t=null,n=null;try{t="u"<typeof localStorage?null:localStorage.getItem("token"),n=(0,C.lS)()}catch(e){}let o=await fetch("".concat("https://api-pay.banlek.com","/api/pay/mp-clp/wallet/preference"),function(e){let{body:a,authToken:t,sessionToken:n}=e,o=null==t?void 0:t.replace(/^Bearer\s+/i,"").trim(),l=null==n?void 0:n.trim();return{method:"POST",body:JSON.stringify(a),headers:{"Content-Type":"application/json",...o?{Authorization:"Bearer ".concat(o)}:{},...l?{"X-Banlek-Checkout-Session":l}:{}}}}({body:e,authToken:a||t,sessionToken:n})),l=await o.json();if(!o.ok||!(null==l?void 0:l.preference_id))throw Error((null==l?void 0:l.message)||"Failed to create Mercado Pago Wallet preference.");return{preference_id:l.preference_id,init_point:l.init_point,expires_at:l.expires_at}},processCredit:async e=>{try{let a="CLP"===e.currency_id?"mp-clp":"mp",t=await fetch("".concat("https://api-pay.banlek.com","/api/pay/").concat(a),{method:"POST",body:JSON.stringify({...e,origin:(0,S.OC)(e.origin," | ")}),headers:T()}),n=await t.json();if(!n||!t.ok)return{status:"error",data:n};return{status:"success",data:n}}catch(e){return console.error(e),{status:"error",data:null}}},processPix:async e=>{try{let a=await fetch("".concat("https://api-pay.banlek.com","/api/pay"),{method:"POST",body:JSON.stringify({...e,origin:(0,S.OC)(e.origin," | ")}),headers:T()}
1),t=await a.json();if(!t||!a.ok)throw Error("Error on payment pix");return{status:"success",data:t}}catch(e){return console.error(e),{status:"error",data:null}}},processMbway:async e=>{try{let a=await fetch("".concat("https://api-pay.banlek.com","/api/pay"),{method:"POST",body:JSON.stringify({...e,origin:(0,S.OC)(e.origin," | ")}),headers:T()}),t=await a.json();if(!t||!a.ok)throw Error("Error on payment pix");return{status:"success",data:t}}catch(e){return console.error(e),{status:"error",data:null}}},verifyPaymentMbway:async()=>{try{let e="u"<typeof localStorage?null:localStorage.getItem("sessaoTemporaria"),{data:a}=await Z.query({query:j,variables:{id:null==V?void 0:V.compra,sessaoTemporaria:e||void 0},fetchPolicy:"no-cache"});if(a&&a.minhasCompras.items[0].status)return{status:a.minhasCompras.items[0].status};return!1}catch(e){return console.error(e),!1}},processPayPal:async e=>{try{var a;J(!0);let t=await fetch("".concat("https://api-pay.banlek.com","/api/notification/paypal")+"-".concat(null!=(a=e.currency)?a:"BRL"),{method:"POST",body:JSON.stringify(e),headers:T()}),n=await t.json();if(!n||!t.ok)throw Error("Error on payment pix");return J(!1),O(n.status),{status:"success",data:n}}catch(e){return J(!1),O("other"),{status:"error",data:null}}},processPayment:async e=>{try{J(!0);let a=await fetch("".concat("https://api-pay.banlek.com","/api/pay"),{method:"POST",body:JSON.stringify("object"==typeof e&&null!==e&&"origin"in e?{...e,origin:(0,S.OC)(e.origin," | ")}:e),headers:T()}),t=await a.json();if(!t||!a.ok)throw Error("Error on payment pix");return J(!1),{status:t.status,data:t}}catch(e){return J(!1),{status:"error",data:null}}},getPaymentMethods:async e=>{try{var a,t;e.number=null==(a=e.number)?void 0:a.replace(/[^0-9]/g,"");let n=null==(t=e.number)?void 0:t.substring(0,6);if(!n)throw Error("Invalid card number.");let l=await (0,o.J5)({bin:n});if(!l||!l.results||0===l.results.length)throw Error("No payment methods found for the provided card number.");return l}catch(e){return console.error(e),null}},verifyPayment:async()=>{try{let e="u"<typeof localStorage?null:localStorage.getItem("sessaoTemporaria"),{data:a}=await Z.query({query:j,variables:{id:null==V?void 0:V.compra,sessaoTemporaria:e||void 0},fetchPolicy:"no-cache"});if(!a||a.minhasCompras.items[0].status!==f.J.COMPRA_CONCLUIDA)return!1;return!0}catch(e){return console.error(e),!1}},getInstallments:async(a,t)=>{if(!(a=null==a?void 0:a.toString().replace(/\D/g,""))||!a.length)throw Error(e("N\xfamero do cart\xe3o inv\xe1lido"));try{let e=await (0,o.l$)({amount:t.toString(),bin:a.substring(0,6),paymentTypeId:"credit_card"});if(!e||!e.length||!e[0].payer_costs.length)throw Error("No installments found for the provided card number.");return e[0].payer_costs}catch(a){throw console.error(a),Error(e("N\xe3o foi poss\xedvel se conextar com a api do MP"))}},createCreditCard:async(e,a,t,n)=>{try{var o;let l=localStorage.getItem("token"),r={number:e.number,expiration:e.expiration,type:t,name:e.name,documentNumber:a},s={};null==l?(r.email=n,s={}):s={headers:{Authorization:"Bearer ".concat(l)}};let{data:i}=await Z.mutate({mutation:d,variables:r,...Object.keys(s).length>0?{context:s}:{}});if(!i)throw Error("Failed to create card.");return i.addCreditCard&&i.addCreditCard.id||console.error("Failed to create card.",{number:"censurado",expiration:e.expiration,type:t,name:e.name,documentNumber:a}),null!=(o=i.addCreditCard.id)?o:null}catch(e){return console.error(e),null}},checkEmail:async()=>{try{var e,a;if(!g)return!1;let{data:t}=await Z.query({query:A.X,variables:{email:g},fetchPolicy:"network-only"});if((null==t||null==(e=t.usuarios)?void 0:e.items)&&(null==t||null==(a=t.usuarios)?void 0:a.items.length)>0)return!0;return!1}catch(e){return console.error(e),!1}}}}},27971:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>n});let n={src:"https://cdnv3.banlek.com/a4a5426f7312ce569f75a77c9ae8e5ca2b6a3b68-36814368861-1/_next/static/media/metadata.e6ab1ae5.jpg",height:574,width:1070,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgs
1MDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAEAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAF/9oADAMBAAIQAxAAAACuEh//xAAeEAAABAcAAAAAAAAAAAAAAAAAAgMEAQUREzFhcf/aAAgBAQABPwCUOFXD+0oapIEU1jg//8QAGBEAAgMAAAAAAAAAAAAAAAAAAAEDEnL/2gAIAQIBAT8Ambusn//EABsRAAIBBQAAAAAAAAAAAAAAAAECAAQTITKx/9oACAEDAQE/AKZVtHA2PBP/2Q==",blurWidth:8,blurHeight:4}},29991:(e,a,t)=>{"use strict";t.d(a,{bq:()=>m,eb:()=>v,gC:()=>h,l6:()=>c,yv:()=>u});var n=t(95155),o=t(57568),l=t(66088),r=t(9921),s=t(94514),i=t(12115),d=t(40980);let c=o.bL;o.YJ;let u=o.WT,m=i.forwardRef((e,a)=>{let{className:t,children:r,...s}=e;return(0,n.jsxs)(o.l9,{ref:a,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-3 py-2 text-sm placeholder:text-slate-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:placeholder:text-slate-400",t),...s,children:[r,(0,n.jsx)(o.In,{asChild:!0,children:(0,n.jsx)(l.A,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=o.l9.displayName;let p=i.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,n.jsx)(o.PP,{ref:a,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...l,children:(0,n.jsx)(r.A,{className:"h-4 w-4"})})});p.displayName=o.PP.displayName;let x=i.forwardRef((e,a)=>{let{className:t,...r}=e;return(0,n.jsx)(o.wn,{ref:a,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",t),...r,children:(0,n.jsx)(l.A,{className:"h-4 w-4"})})});x.displayName=o.wn.displayName;let h=i.forwardRef((e,a)=>{let{className:t,children:l,position:r="popper",...s}=e;return(0,n.jsx)(o.ZL,{children:(0,n.jsxs)(o.UC,{ref:a,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white text-slate-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...s,children:[(0,n.jsx)(p,{}),(0,n.jsx)(o.LM,{className:(0,d.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:l}),(0,n.jsx)(x,{})]})})});h.displayName=o.UC.displayName,i.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,n.jsx)(o.JU,{ref:a,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...l})}).displayName=o.JU.displayName;let v=i.forwardRef((e,a)=>{let{className:t,children:l,value:r,disabled:i,textValue:c,...u}=e;return(0,n.jsxs)(o.q7,{ref:a,value:r,disabled:i,textValue:c,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-base outline-none focus:bg-slate-100 focus:text-slate-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-slate-800 dark:focus:text-slate-50",t),...u,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(o.VF,{children:(0,n.jsx)(s.A,{className:"h-4 w-4"})})}),(0,n.jsx)(o.p4,{children:l})]})});v.displayName=o.q7.displayName,i.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,n.jsx)(o.wv,{ref:a,className:(0,d.cn)("-mx-1 my-1 h-px bg-slate-100 dark:bg-slate-800",t),...l})}).displayName=o.wv.displayName},30103:e=>{e.exports={checkout_layout:"styles_checkout_layout__7T4Ny",left_side:"styles_left_side__4RMqY",left_side_header:"styles_left_side_header__RRXpC",left_side_body:"styles_left_side_body__2btgk",left_side_footer:"styles_left_side_footer__7i9ct",right_side:"styles_right_side__XRliM",right_side_header:"styles_right_side_header__Oj52f",right_side_body:"styles_right_side_body__cCtnh",right_side_footer:"styles_right_side_footer__WyppG"}},39204:(e,a,t)=>{"use strict";t.d(a,{default:()=>ep});var n=t(95155),o=t(14506),l=t(89239),r=t(47687),s=t(33546),i=t(12115),d=t(99003),c=t(64383),u=t(32777),m=t(29991),p=t(23091),x=t(97916),h=t(66569),v=t(782),f=t(21729),g=t(35521),j=t(32985),b=t(50910),y=t(21915),A=t(35312);function N(){let e=(0,y._)(["\n    mutation addCupomCarrinhoMutation(\n        $codigo: String!\n        $sessaoTemporaria: String\n    ) {\n        addCupomCarrinho(\n            codigo: $codigo,\n            sessaoTemporaria: $sessaoTemporaria\n        ) {\n            aplicado\n            codigo\n            error\n            carrinho {\n                comprasPendentes {\n                    id\n                    carrinho {\n                        qtdTotal\n                        qtdFotos\n                        total {\n                            venda\n                            moeda\n                            valor_frete\n                        }\n                    }\n                    capa {\n                        thumb\n                    }\n                }\n                cupom {\n                    codigo\n                    socio_torcedor\n                }\n                qtdFotos\n                qtdProdutos\n                qtdVideos\n                qtdTotal\n                items {\n                    fotografo {\n                        id\n                        nome\n                        img\n                        aceitaOferta\n                        aceitaImpressao\n                    }\n                    fotos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            img {\n                                mini\n                                med\n                            }\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                            album {\n                                id\n                                titulo\n                                slug\n                            }\n                            idCarrinhoPacote\n                            idSequencia\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                    videos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            img\n                            arquivo\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                            album {\n                                id\n                                titulo\n                                slug\n                            }\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                    produtos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            nome\n                            idProduto\n                            idFotoPersonalizada\n                            img\n                            variacao\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                }\n                total {\n                    moeda\n                    original\n                    promocional\n                    venda\n                    descontos {\n                        porcentagem\n                        valor\n                        itens {\n                            tipo\n                            descricao\n                            valor\n                        }\n                    }\n                    taxa_servico\n                    taxa_banlek_cliente_percentual\n                    taxa_banlek_cliente_valor\n                    valor_frete\n                }\n            }\n        }\n    }\n"]);return N=function(){return e},e}let C=(0,A.J1)(N());function w(){let e=(0,y._)(["\n    mutation removeCupomCarrinhoMutation($sessaoTemporaria: String) {\n        removeCupomCarrinho(sessaoTemporaria: $sessaoTemporaria) {\n            removido\n            carrinho {\n                comprasPendentes {\n                    id\n                    carrinho {\n                        qtdTotal\n                        qtdFotos\n                        total {\n                            moeda\n                            venda\n                            valor_frete\n                        }\n                    }\n                    capa {\n                        thumb\n                    }\n                }\n                cupom {\n                    codigo\n                    socio_torcedor\n                }\n                qtdFotos\n                qtdVideos\n                qtdProdutos\n                qtdTotal\n                items {\n                    fotografo {\n                        id\n                        nome\n                        img\n                        aceitaOferta\n                        aceitaImpressao\n                    }\n                    fotos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            img {\n                                mini\n                                med\n                            }\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                            album {\n                                id\n                                titulo\n                                slug\n                            }\n                            idCarrinhoPacote\n                            idSequencia\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                    videos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            img\n                            arquivo\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                            album {\n                                id\n                                titulo\n                                slug\n                            }\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                    produtos {\n                        qtd\n                        itens {\n                            id\n                            carrinhoId\n                            nome\n                            idProduto\n                            idFotoPersonalizada\n                            img\n                            variacao\n                            precos {\n                                moeda\n                                original\n                                promocional\n                                venda\n                                taxa_banlek_cliente_percentual\n                                taxa_banlek_cliente_valor\n                            }\n                        }\n                        subTotal {\n                            original\n                            promocional\n                            venda\n                            descontos {\n                                porcentagem\n                                valor\n                                itens {\n                                    tipo\n                                    descricao\n                                    valor\n                                }\n                            }\n                        }\n                    }\n                }\n                total {\n                    moeda\n                    original\n                    promocional\n                    venda\n                    descontos {\n                        porcentagem\n                        valor\n                        itens {\n                            tipo\n                            descricao\n                 
1           valor\n                        }\n                    }\n                    taxa_servico\n                    taxa_banlek_cliente_percentual\n                    taxa_banlek_cliente_valor\n                    valor_frete\n                }\n            }\n        }\n    }\n"]);return w=function(){return e},e}let _=(0,A.J1)(w());var k=t(99807),S=t(1930);let $=e=>{let{onRemove:a}=e,t=(0,b.c)("Checkout"),r=(0,k.m)(),{setCupom:c,setList:m,list:x,cupom:h}=(0,p.Q)(),[v,f]=(0,i.useState)(!1);i.useEffect(()=>{var e,a;x&&(null==x||null==(e=x.cupom)?void 0:e.codigo)&&c((null==x||null==(a=x.cupom)?void 0:a.codigo)||"")},[x]);let{state:{token:g}}=(0,j.A)(),[y,A]=i.useState(!1),N=S.Ik({cupom:S.Yj().optional()}),w=(0,d.mN)({resolver:(0,s.u)(N),defaultValues:{cupom:""}}),$=async()=>{A(!0);try{var e;let n="u"<typeof localStorage?null:localStorage.getItem("sessaoTemporaria"),{data:o}=await r.mutate({mutation:_,variables:{sessaoTemporaria:n||void 0}});if(!(null==o||null==(e=o.removeCupomCarrinho)?void 0:e.removido)){w.setError("cupom",{type:"manual",message:t("Erro ao remover cupom")}),A(!1);return}c(""),m(o.removeCupomCarrinho.carrinho),null==a||a()}catch(e){w.setError("cupom",{type:"manual",message:t("Erro ao remover cupom")}),A(!1);return}w.clearErrors("cupom"),A(!1)};if(h&&""!==h){var P;return(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6",children:t("Cupom aplicado")}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0004 2.40039C12.071 2.40039 2.40039 12.071 2.40039 24.0004C2.40039 35.9297 12.071 45.6004 24.0004 45.6004C35.9297 45.6004 45.6004 35.9297 45.6004 24.0004C45.6004 12.071 35.9297 2.40039 24.0004 2.40039ZM33.2247 18.501C33.8326 17.7144 33.6876 16.5839 32.901 15.9761C32.1144 15.3682 30.9839 15.5132 30.3761 16.2998L21.4952 27.7927L17.5383 23.3962C16.8733 22.6573 15.7352 22.5974 14.9963 23.2625C14.2573 23.9275 14.1974 25.0656 14.8625 25.8045L20.2625 31.8045C20.6196 32.2013 21.1344 32.4191 21.6678 32.3991C22.2013 32.3791 22.6983 32.1234 23.0247 31.701L33.2247 18.501Z",fill:"#30A94C"})}),(0,n.jsx)("span",{className:"font-bold",children:h})]}),(0,n.jsxs)(l.$,{loaderColor:"black",loading:y,onClick:()=>$(),variant:"link",children:[(0,n.jsx)("span",{className:"sr-only",children:t("Remover cupom")}),(0,n.jsx)("svg",{className:"w-5 h-5 stroke-[#798AA3] fill-none",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M13.25 6.75L10 10M10 10L6.75 13.25M10 10L6.75 6.75M10 10L13.25 13.25M18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),(null==(P=w.formState.errors.cupom)?void 0:P.message)&&(0,n.jsx)("p",{className:"text-sm font-medium text-red-500 dark:text-red-900",children:w.formState.errors.cupom.message})]})}return(0,n.jsx)("div",{children:v?(0,n.jsxs)(u.lV,{...w,children:[(0,n.jsxs)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6 cursor-pointer",onClick:()=>f(!0),children:[t("Informe o c\xf3digo do cupom")," ",(0,n.jsxs)("small",{className:"ms-1",children:["(",t("caso n\xe3o tenha, voc\xea pode prosseguir"),")"]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsx)(o.A,{control:w.control,id:"cupom",name:"cupom",placeholder:t("C\xf3digo do cupom"),className:w.formState.errors.cupom&&"border-red-500"}),(0,n.jsx)(l.$,{onClick:()=>void w.handleSubmit(async()=>{A(!0);let e=w.getValues();if(!e.cupom){w.setError("cupom",{type:"manual",message:t("Cupom inv\xe1lido")}),A(!1);return}try{let a="u"<typeof localStorage?null:localStorage.getItem("sessaoTemporaria"),{data:n}=await r.mutate({mutation:C,variables:{codigo:e.cupom,sessaoTemporaria:a||void 0}});if(!(null==n?void 0:n.addCupomCarrinho.aplicado)){w.setError("cupom",{type:"manual",message:(null==n?void 0:n.addCupomCarrinho.error)||t("Erro ao aplicar o cupom")}),A(!1);return}c(e.cupom),m(n.addCupomCarrinho.carrinho),w.reset()}catch(e){w.setError("cupom",{type:"manual",message:t("Erro ao aplicar o cupom")}),A(!1);return}A(!1)})(),loading:y,variant:"outline",className:"mt-2 text-[#475366]",loaderColor:"black",children:t("Aplicar")})]})]}):(0,n.jsx)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6 cursor-pointer",onClick:()=>f(!0),children:t("Tem cupom de desconto?")})})};var P=t(2561),T=t(52630);let E={mask:[...[,,,,].fill(/\d/)," ",...[,,,,].fill(/\d/)," ",...[,,,,].fill(/\d/)," ",...[,,,,].fill(/\d/)]},I=(0,T.GH)({mode:"mm/yy",separator:"/"}),V={mask:[...[,,,,].fill(/\d/)]};var F=t(82006),R=t(81477),M=t(60529),z=t(33418),D=t(40980),B=t(34394),L=t(97536),q=t(9192),O=t(5772);let J=()=>{let e=(0,b.c)("CheckPrint"),{setHasPrintPictures:a,hasPrintPictures:t}=(0,p.Q)();return(0,n.jsx)("div",{children:(0,n.jsx)(R.Zp,{onClick:()=>{a(!t)},className:"relative mt-3 w-full cursor-pointer rounded border border-[#
1E6EDF5] shadow-[0_2px_8px_rgba(40,47,61,0.08)]",children:(0,n.jsxs)(R.Wu,{className:"flex items-start justify-between gap-2 px-4 py-4",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-start",children:[(0,n.jsx)(q.S,{id:"check-print",className:"mt-1 h-[18px] w-[18px] min-h-[18px] min-w-[18px] rounded-[5px] border-[#D8E4F0]",checked:t}),(0,n.jsxs)("div",{className:"flex  min-w-0 flex-1 flex-col items-start gap-2 px-2",children:[(0,n.jsx)("span",{className:"text-sm mt-1 font-semibold  text-[#475366]",children:e("Quero fotos digitais + impressas")}),(0,n.jsx)("p",{className:"text-xs md:text-sm leading-relaxed font-normal  text-[#798AA3]",children:e("Al\xe9m das suas fotos digitais, receba tamb\xe9m suas fotos reveladas na sua casa")})]})]}),(0,n.jsx)("div",{className:"relative h-[76px] w-[76px] shrink-0 overflow-hidden rounded",children:(0,n.jsx)(O.default,{src:"https://d2lfc09o2kjf56.cloudfront.net/img/site/imagem-foto-impressa.jpg",alt:"Print",className:"object-cover",fill:!0,sizes:"76px"})})]})})})};var U=t(856),X=t(89976),Q=t(65751),Z=t(96609),G=t(35942),W=t(2637);function H(){let e=(0,y._)(["\n    query addCupomPreVendaMutation(\n        $codigo: String!\n        $valorTotal: Float!\n        $sessaoTemporaria: String\n    ) {\n        cupom(\n            codigo: $codigo,\n            valorTotal: $valorTotal,\n            sessaoTemporaria: $sessaoTemporaria\n        ) {\n            tipo\n            valido\n            id\n            codigo\n            valorTotal\n            valorTotalComDesconto\n            valorDesconto\n            error\n        }\n    }\n"]);return H=function(){return e},e}let Y=(0,A.J1)(H());var K=t(44399);let ee=()=>{let e=(0,b.c)("Checkout"),a=(0,k.m)(),[t,r]=(0,W.ZA)("token",{defaultValue:"",history:"replace"}),{state:{isAuthenticated:c}}=(0,j.A)(),[m,p]=(0,i.useState)(""),[x,h]=(0,i.useState)(!1),v=i.useMemo(()=>{if(t)try{let e=atob(t);return JSON.parse(e)}catch(e){}return null},[t]);i.useEffect(()=>{(null==v?void 0:v.cupom)&&p(v.cupom)},[v]);let[f,g]=i.useState(!1),y=S.Ik({cupom:S.Yj().optional()}),A=(0,d.mN)({resolver:(0,s.u)(y),defaultValues:{cupom:""}}),N=async()=>{g(!0),r(btoa(JSON.stringify({...v,precoOriginal:v.precoOriginalPreVenda,pre_venda_desconto_preco:v.precoOriginalPreVenda,idCupom:null,cupom:""}))),p(""),g(!1)};if(m&&""!==m){var C;return(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6",children:e("Cupom aplicado")}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0004 2.40039C12.071 2.40039 2.40039 12.071 2.40039 24.0004C2.40039 35.9297 12.071 45.6004 24.0004 45.6004C35.9297 45.6004 45.6004 35.9297 45.6004 24.0004C45.6004 12.071 35.9297 2.40039 24.0004 2.40039ZM33.2247 18.501C33.8326 17.7144 33.6876 16.5839 32.901 15.9761C32.1144 15.3682 30.9839 15.5132 30.3761 16.2998L21.4952 27.7927L17.5383 23.3962C16.8733 22.6573 15.7352 22.5974 14.9963 23.2625C14.2573 23.9275 14.1974 25.0656 14.8625 25.8045L20.2625 31.8045C20.6196 32.2013 21.1344 32.4191 21.6678 32.3991C22.2013 32.3791 22.6983 32.1234 23.0247 31.701L33.2247 18.501Z",fill:"#30A94C"})}),(0,n.jsx)("span",{className:"font-bold",children:m})]}),(0,n.jsxs)(l.$,{loaderColor:"black",loading:f,onClick:()=>N(),variant:"link",children:[(0,n.jsx)("span",{className:"sr-only",children:e("Remover cupom")}),(0,n.jsx)("svg",{className:"w-5 h-5 stroke-[#798AA3] fill-none",viewBox:"0 0 20 20",fill:"currentColor",stroke:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M13.25 6.75L10 10M10 10L6.75 13.25M10 10L6.75 6.75M10 10L13.25 13.25M18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),(null==(C=A.formState.errors.cupom)?void 0:C.message)&&(0,n.jsx)("p",{className:"text-sm font-medium text-red-500 dark:text-red-900",children:A.formState.errors.cupom.message})]})}return(0,n.jsx)("div",{children:x?(0,n.jsxs)(u.lV,{...A,children:[(0,n.jsxs)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6 cursor-pointer",onClick:()=>h(!0),children:[e("Informe o c\xf3digo do cupom")," ",(0,n.jsxs)("small",{className:"ms-1",children:["(",e("caso n\xe3o tenha, voc\xea pode prosseguir"),")"]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsx)(o.A,{control:A.control,id:"cupom",name:"cupom",placeholder:e("C\xf3digo do cupom"),className:A.formState.errors.cupom&&"border-red-500"}),(0,n.jsx)(l.$,{onClick:()=>void A.handleSubmit(async()=>{g(!0);let t=A.getValues();if(!t.cupom){A.setError("cupom",{type:"manual",message:e("Cupom inv\xe1lido")}),g(!1);return}try{let n=(0,K.HU)();!c&&localStorage.getItem("sessaoTemporaria")&&(n=localStorage.getItem("sessaoTemporaria")||""),c||localStorage.getItem("sessaoTemporaria")||localStorage.setItem("sessaoTemporaria",n);let{data:o}=await a.query({query:Y,variables:{codigo:t.cupom,valorTotal:(null==v?void 0:v.pre_venda_desconto_preco)||0,sessaoTemporaria:n||void 0}});if(!(null==o?void 0:o.cupom.valido)){A.setError("cupom",{type:"manual",message:(null==o?void 0:o.cupom.error)||e("Erro ao aplicar o cupom")}),g(!1);return}p(t.cupom);let l={...v,precoOriginalPreVenda:v.pre_venda_desconto_preco,pre_venda_desconto_preco:o.cupom.valorTotalComDesconto,idCupom:o.cupom.id,cupom:t.cupom},s=btoa(JSON.stringify(l));r(s),A.reset()}catch(a){console.log(a),A.setError("cupom",{type:"manual",message:e("Erro ao aplicar o cupom")}),g(!1);return}g(!1)})(),loading:f,variant:"outline",className:"mt-2 text-[#475366]",loaderColor:"black",children:e("Aplicar")})]})]}):(0,n.jsx)("h3",{className:"text-[#798AA3] font-medium text-[14px] leading-6 cursor-pointer",onClick:()=>h(!0),children:e("Tem cupom de desconto?")})})};var ea=t(12482),et=t(65988),en=t(19818),eo=t(34080);function el(){let e=(0,y._)(["\n    mutation ValidarSocioTorcedor($cpf: String!, $sessaoTemporaria: String) {\n        validarSocioTorcedor(cpf: $cpf, sessaoTemporaria: $sessaoTemporaria) {\n            message\n            status\n        }\n    }\n"]);return el=function(){return e},e}let er=(0,A.J1)(el());
1var es=t(37312),ei=t(70872),ed=t(66609),ec=t(95503),eu=t(4160);let em=e=>{let{id:a,checked:t,loading:o,disabled:l=!1,className:r="flex items-center space-x-2",onCheckedChange:s,t:i}=e;return(0,n.jsxs)("div",{className:r,children:[o?(0,n.jsx)(es.A,{color:"black",className:"w-4 h-4"}):(0,n.jsx)(q.S,{id:a,checked:t,disabled:l,onCheckedChange:s,className:"cursor-pointer border-[1px] border-[#DDE7F0]"}),(0,n.jsx)("div",{className:"grid gap-1.5 leading-none",children:(0,n.jsx)("label",{htmlFor:a,className:"cursor-pointer text-sm leading-[24px] font-medium text-[#798AA3] peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:i("Sou s\xf3cio torcedor")})}),(0,n.jsx)(ei.TooltipProvider,{children:(0,n.jsxs)(ei.Tooltip,{children:[(0,n.jsx)(ei.TooltipTrigger,{type:"button",className:"flex items-center",children:(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 text-slate-400 hover:text-slate-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("path",{d:"M12 16v-4M12 8h.01"})]})}),(0,n.jsx)(ei.TooltipContent,{className:"max-w-60",children:i("Informativo s\xf3cio torcedor")})]})})]})},ep=e=>{var a,t,y,A,N,C,w,S,T,O,H,Y,el,es,ei,ep,ex,eh,ev,ef,eg,ej,eb,ey,eA,eN,eC,ew,e_,ek,eS,e$,eP,eT;let{}=e,eE=(0,b.c)("Checkout"),eI=(0,b.c)("Navigation"),eV=(0,z.Ym)(),eF=(0,eu.Tl)(eV),[eR,eM]=(0,i.useState)(!1),[ez,eD]=(0,i.useState)(!1),eB=(0,g.M)({options:P.A}),eL=(0,g.M)({options:E}),eq=(0,g.M)({options:I}),eO=(0,g.M)({options:V}),eJ=(0,h.U)("(min-width: 1280px)"),[eU]=(0,W.ZA)("entity",{defaultValue:"",history:"replace"}),{state:{user:eX,isAuthenticated:eQ}}=(0,j.A)(),{list:eZ,checkoutList:eG,entity:eW,order:eH,paymentMethod:eY,loadingCards:eK,fetchCards:e0,cards:e1,card:e2,document:e3,step:e5,email:e4,name:e9,lastname:e6,phone:e7,ddi:e8,setName:ae,setLastname:aa,setPhone:at,setDdi:an,setPaymentMethod:ao,setDocument:al,setCard:ar,setEmail:as,setStep:ai,setInstallment:ad,hasPrintPictures:ac,printPrice:au,printShippingPrice:am,picturesForPrint:ap,selectedPicturesForPrint:ax,selectedProductIdPrint:ah,selectedCarrinhoIds:av,isCheckoutPricingStale:af,isSelectableCartEntity:ag,fetchEntity:aj,setList:ab,setSelectedProductIdPrint:ay,setPrintShippingPrice:aA,setPrintPrice:aN,checkoutTipAmount:aC,preSaleFaceId:aw}=(0,p.Q)(),a_=null!=eG?eG:eZ,ak=!ag||(null!=(a=null==av?void 0:av.length)?a:0)>0,aS="pre-venda"===eU&&!aw,a$=(0,k.m)(),aP=(null==a_||null==(H=a_.total)?void 0:H.moeda)==="CLP",aT=(0,en.M)()?"card-clp":"credit",aE=ac?au+am:0,aI="carrinho"===eW&&(null==a_?void 0:a_.qtdProdutos)&&a_.qtdProdutos>0?a_.total.valor_frete:0,aV=(null!=(t=null==a_||null==(Y=a_.total)?void 0:Y.venda)?t:0)+aC+aE+aI,aF=(0,et.O)(),aR=aP&&aF&&aV>0,aM=window.location.hostname.toLowerCase(),az=("fotos.tonomaraca.com"===aM||"fotos.tonocaldeirao.com"===aM)&&null!=(y=null==eZ||null==(el=eZ.items)?void 0:el.some(e=>{var a,t,n,o,l,r,s,i,d,c,u,m;return(null==(t=e.fotos)||null==(a=t.itens)?void 0:a.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("flamengo")}))||(null==(o=e.fotos)||null==(n=o.itens)?void 0:n.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("fluminense")}))||(null==(r=e.fotos)||null==(l=r.itens)?void 0:l.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("vasco")}))||(null==(i=e.videos)||null==(s=i.itens)?void 0:s.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("flamengo")}))||(null==(c=e.videos)||null==(d=c.itens)?void 0:d.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("fluminense")}))||(null==(m=e.videos)||null==(u=m.itens)?void 0:u.some(e=>{var a,t;return null==(t=e.album)||null==(a=t.titulo)?void 0:a.toLowerCase().includes("vasco")}))}))&&y,aD=!ez&&(eQ||"compra"===eW&&[L.J.PAGAMENTO_PENDENTE,L.J.PAGAMENTO_AGUARDANDO_COMPENSACAO,L.J.COMPRA_CANCELADA].includes(null==eH?void 0:eH.status)&&!!e4),aB=(0,i.useCallback)(()=>
1{if(e4)return!0},[e4]),aL=function(e){var a;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"BR";return null!=(a=(0,Q.s)(e))?a:t},aq=(e,a)=>{let t=null===X.R||void 0===X.R?void 0:X.R[a];if(!t)return(null!=e?e:"").toString();try{return(0,Z.bc)((null!=e?e:"").toString(),t)}catch(a){return(null!=e?e:"").toString()}},aO=(0,eu.nd)(eV),aJ=e8||aL(null==eX?void 0:eX.ddi,aO),aU=e8||aL(null==eX?void 0:eX.ddi,aO),aX=(0,d.mN)({resolver:(0,s.u)((0,B.H7)(aB()||!eQ)),defaultValues:{email:null!=(A=null==eX?void 0:eX.email)?A:"",nome:null!=(N=null==eX?void 0:eX.nome)?N:"",sobrenome:null!=(C=null==eX?void 0:eX.sobrenome)?C:"",ddi:aJ,telefone:aq(null!=(w=null!=e7?e7:null==eX?void 0:eX.telefone)?w:"",aJ)}}),aQ=(0,d.mN)({resolver:(0,s.u)((0,B.fu)(null==a_||null==(es=a_.total)?void 0:es.moeda)),defaultValues:{installment:e2&&e2.installment?e2.installment:"1",nameCard:e2&&e2.name?e2.name:"",cardNumber:e2&&e2.number?(0,Z.bc)(e2.number,E):"",expiration:e2&&e2.expiration?(0,Z.bc)(e2.expiration,I):"",cvv:e2&&e2.cvv?(0,Z.bc)(e2.cvv,V):"",document:aP?"":(0,Z.bc)(null!=(S=null==eX||null==(ei=eX.cpf)?void 0:ei.toString())?S:"",P.A),notBrazilian:!1}}),aZ=(0,d.mN)({resolver:(0,s.u)((0,B.FI)()),defaultValues:{document:(0,Z.bc)(null!=(T=null==eX||null==(ep=eX.cpf)?void 0:ep.toString())?T:"",P.A),notBrazilian:!1}}),aG=(0,d.mN)({resolver:(0,s.u)((0,B.O3)()),defaultValues:{ddi:aU,telefone:aq(null!=(O=null!=e7?e7:null==eX?void 0:eX.telefone)?O:"",aU)}});i.useEffect(()=>{var e;(0,ea.f)(null==a_||null==(e=a_.total)?void 0:e.moeda)},[null==a_||null==(ex=a_.total)?void 0:ex.moeda]),i.useEffect(()=>{var e,a;aG.getValues().ddi&&aG.watch("telefone")&&aG.setValue("telefone",(0,Z.bc)(null!=(e=aG.getValues().telefone)?e:"",X.R[null!=(a=aG.getValues().ddi)?a:"BR"]))},[aG.watch("ddi")]),i.useEffect(()=>{var e,a,t,n;aX.getValues().ddi&&aX.watch("telefone")&&("mbway"===eY&&(aG.setValue("ddi",aX.getValues().ddi),aG.setValue("telefone",(0,Z.bc)(null!=(t=aX.getValues().telefone)?t:"",X.R[null!=(n=aX.getValues().ddi)?n:""]))),aX.setValue("telefone",(0,Z.bc)(null!=(e=aX.getValues().telefone)?e:"",X.R[null!=(a=aX.getValues().ddi)?a:"BR"])))},[aX.watch("ddi"),aX.watch("telefone")]);let[aW,{loading:aH}]=(0,eo.n)(er),[aY,{loading:aK}]=(0,eo.n)(_),[a0,a1]=(0,i.useState)(!1),[a2,a3]=(0,i.useState)(!1),a5=aH||aK||a2;i.useEffect(()=>{var e;a1(!!(null==eZ||null==(e=eZ.cupom)?void 0:e.socio_torcedor))},[null==eZ||null==(eh=eZ.cupom)?void 0:eh.socio_torcedor]);let a4=async e=>{if(null==e?void 0:e.length)try{var a,t,n;let{data:o}=await a$.query({query:ec.S,variables:{quantidade:e.length,impressoes:e.map(e=>e.id)},fetchPolicy:"network-only"}),l=null!=(a=null==o||null==(n=o.cotacao)?void 0:n.items)?a:[];if(!l.length){ay(null),aA(0),aN(0);return}let r=null!=(t=l.find(e=>e.produto_id===ah))?t:l[0];ay(r.produto_id),aA(r.valor_frete||0),aN(r.valor_impressao||0)}catch(e){console.error("[recalculatePrintValues]",e)}},a9=async e=>{var a,t,n;if(a0){try{let{data:e}=await aY({variables:{sessaoTemporaria:(0,K.Ao)()}});if(null==e||null==(a=e.removeCupomCarrinho)?void 0:a.carrinho){ab(e.removeCupomCarrinho.carrinho),a3(!0);try{await aj()}finally{a3(!1)}}}catch(e){console.error("[removeCupomCarrinho]",e)}finally{a1(!1)}return}if(e.replace(/\D/g,"").length<11)return void ed.oR.error(eE("Digite seu CPF/CNPJ"));let o=null;try{let{data:a}=await aW({variables:{cpf:e,sessaoTemporaria:(0,K.Ao)()}});o=null==a?void 0:a.validarSocioTorcedor}catch(e){console.error("[validarSocioTorcedor]",e),ed.oR.error(eE("N\xe3o foi poss\xedvel validar o s\xf3cio torcedor"));return}if(null==o?void 0:o.status){a1(!0),ed.oR.success(null!=(t=o.message)?t:eE("S\xf3cio torcedor validado com sucesso")),a3(!0);try{await aj(),await a4(ax)}finally{a3(!1)}}else ed.oR.error(null!=(n=null==o?void 0:o.message)?n:eE("N\xe3o foi poss\xedvel validar o s\xf3cio torcedor"))},{getInstallments:a6}=(0,f.A)(),[a7,a8]=(0,i.useState)([]),[te,ta]=(0,i.useState)(!1),[tt,tn]=(0,i.useState)(!1),[to,tl]=(0,i.useState)(!1);i.useEffect(()=>{var e;(null==a_||null==(e=a_.total)?void 0:e.moeda)==="CLP"?ta(!1):e1&&e1.length>0&&ta(!0)},[e1,null==a_||null==(ev=a_.total)?void 0:ev.moeda]),i.useEffect(()=>{var e;let a=aQ.getValues();if(!a_||!a.cardNumber)return;let t=ac?au+am:0,n="carrinho"===eW&&(null==a_?void 0:a_.qtdProdutos)&&a_.qtdProdutos>0?a_.total.valor_frete:0;ti(a.cardNumber,(null!=(e=null==a_?void 0:a_.total.venda)?e:0)+t+n)},[a_,aQ,ac,eW]),i.useEffect(()=>{"mp-wallet"===eY?tl(aR):["pix","mbway","card-eur","sibs-card-eur","bizum","google-pay-eur","apple-pay-eur","card-usd","google-pay-usd","apple-pay-usd","card-clp","paypal"].includes(eY)||e2&&e2.id||!te?tl(!0):tl(!1)},[e2,eY,te,aR]),i.useEffect(()=>{"mp-wallet"!==eY||aR||ao(aP?aT:"pix")},[eY,aR,aP,aT,ao]),i.useEffect(()=>
1{e3.value&&(aZ.setValue("document",(0,Z.bc)(e3.value,P.A)),aQ.setValue("document",aP?e3.value:(0,Z.bc)(e3.value,P.A)),aX.setValue("email",e4),aX.setValue("nome",null!=e9?e9:""),aX.setValue("sobrenome",null!=e6?e6:""),aX.setValue("telefone",null!=e7?e7:""),aX.setValue("ddi",null!=e8?e8:aJ))},[e5,eY]),i.useEffect(()=>{aX.reset({...aX.getValues(),email:e4,nome:e9,sobrenome:e6,telefone:e7,ddi:null!=e8?e8:aJ})},[e4,e9,e6,e7,e8,aJ]);let tr=async()=>{await e0()};i.useEffect(()=>{tr()},[]),i.useEffect(()=>{(aX.formState.errors.email||aX.formState.errors.telefone||aX.formState.errors.ddi)&&eD(!0)},[aX.formState.errors]);let ts=async()=>{switch(eY){case"pix":await aX.handleSubmit(async()=>{let e=aX.getValues();as(e.email),ae(e.nome),aa(e.sobrenome),at(e.telefone),an(e.ddi),await aZ.handleSubmit(async()=>{let e=aZ.getValues();al(e.notBrazilian?void 0:e.document),c.Nk.scrollToTop({duration:0}),ai(eJ?1:2)},e=>{console.error("Erros de geracao de pix:",e)})()},e=>{console.error("Erros de valida\xe7\xe3o:",e),(null==e?void 0:e.telefone)&&aX.setError("telefone",{type:"manual",message:eE("Telefone \xe9 obrigat\xf3rio")})})();break;case"credit":await aX.handleSubmit(async()=>{let e=aX.getValues();as(e.email),ae(e.nome),aa(e.sobrenome),at(e.telefone),an(e.ddi),await aQ.handleSubmit(async()=>{let e=aQ.getValues();al(e.notBrazilian?void 0:e.document),ar({...e2,name:e.nameCard,number:e.cardNumber,expiration:e.expiration,cvv:e.cvv,installment:e.installment}),c.Nk.scrollToTop({duration:0}),ai(eJ?1:2)})()})();break;case"mbway":await aX.handleSubmit(async()=>{let e=aX.getValues();as(e.email),ae(e.nome),aa(e.sobrenome),await aG.handleSubmit(async e=>{at(e.telefone),an(e.ddi),ai(eJ?1:2)},e=>{console.error("Erros de valida\xe7\xe3o:",e)})()},e=>{console.error("Erros de valida\xe7\xe3o:",e),(null==e?void 0:e.telefone)&&aX.setError("telefone",{type:"manual",message:eE("Telefone \xe9 obrigat\xf3rio")})})();break;case"paypal":case"mp-wallet":case"bizum":case"card-eur":case"sibs-card-eur":case"google-pay-eur":case"apple-pay-eur":case"card-usd":case"google-pay-usd":case"apple-pay-usd":case"card-clp":c.Nk.scrollToTop({duration:0}),await aX.handleSubmit(async()=>{let e=aX.getValues();as(e.email),ae(e.nome),aa(e.sobrenome),at(e.telefone),an(e.ddi),ai(eJ?1:2)})();break;default:console.error("Payment method not found")}},ti=async(e,a)=>{let t=await a6(e,a);t?a8(t):console.error("Failed to get installments")},td=async e=>{let a=e.currentTarget.value.replace(/\D/g,"");aQ.setValue("cardNumber",(0,Z.bc)(e.currentTarget.value,E));let t=ac?au+am:0,n="carrinho"===eW&&(null==a_?void 0:a_.qtdProdutos)&&a_.qtdProdutos>0?a_.total.valor_frete:0;if(a.length>=6){let e=null==a_?void 0:a_.total.venda;if(!e)return void console.error("Amount not found");await ti(a,e+t+n)}},tc=async e=>{tn(!0);let a=null==e1?void 0:e1.find(a=>a.id===e);if(a){var t,n,o,l,r;if(ar({id:a.id,name:a.nome,number:a.numero.toString(),lastDigits:a.ultimos_4_digitos,expiration:a.validade,documentNumber:a.documento?a.documento.toString():null}),aQ.setValue("nameCard",a.nome),aQ.setValue("cardNumber",a.numero.toString()),aQ.setValue("expiration",a.validade),aQ.setValue("document",aP?null!=(t=a.documento?null==(l=a.documento)?void 0:l.toString():e3.value)?t:"":(0,Z.bc)(null!=(n=a.documento?null==(r=a.documento)?void 0:r.toString():e3.value)?n:"",P.A)),aQ.setValue("installment","1"),aQ.setValue("notBrazilian",!a.documento),ad(void 0),!eZ)return;let e=ac?au+am:0,s="carrinho"===eW&&(null==a_?void 0:a_.qtdProdutos)&&a_.qtdProdutos>0?a_.total.valor_frete:0;await ti(a.numero.toString(),(null!=(o=null==a_?void 0:a_.total.venda)?o:0)+e+s)}ta(!1),tn(!1)},tu=i.useCallback(()=>(null==ap?void 0:ap.length)>=5&&"carrinho"==eW&&(null==a_?void 0:a_.total.moeda)==="BRL",[eW,ap,a_]);(0,g.M)({options:X.R[aX.watch("ddi")]||X.Q});let tm=i.useMemo(()=>{var e;return!(!(e=window.navigator.userAgent)||/Android/i.test(e))&&/iPad|iPhone|iPod|Macintosh|Mac OS X/i.test(e)},[]);return(0,n.jsxs)("div",{className:"w-full relative  flex flex-col space-y-5 pb-28 md:space-y-7 xl:pb-0",children:[(0,n.jsxs)(r.tU,{value:eY,onValueChange:e=>ao(e),children:[tu()&&(0,n.jsx)(J,{}),(0,n.jsx)(u.lV,{...aX,children:(0,n.jsxs)("div",{className:tu()?"mt-4":"mt-0",children:[(0,n.jsx)(o.A,{control:aX.control,id:"email",name:"email",type:aD?"hidden":"email",placeholder:"[email protected]",label:"E-mail"}),(0,n.jsxs)("div",{className:"grid grid-cols-2 mt-3 gap-4",children:[(0,n.jsx)(o.A,{control:aX.control,id:"nome",name:"nome",type:aB()||eQ?"hidden":"text",className:"w-full",placeholder:eE("Nome"),label:eE("Nome")}
1),(0,n.jsx)(o.A,{control:aX.control,id:"sobrenome",name:"sobrenome",type:aB()||eQ?"hidden":"text",className:"w-full",placeholder:eE("Sobrenome"),label:eE("Sobrenome")}),(0,n.jsxs)("div",{className:(0,D.cn)("col-span-2 relative flex items-end gap-3 w-full",aX.formState.errors.telefone?"pb-5":"",!ez&&(aB()||eQ)?"hidden":""),children:[(0,n.jsx)(u.zB,{control:aX.control,name:"ddi",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{className:"flex flex-col",children:[(0,n.jsx)(u.lR,{children:eE("Celular")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(U.c,{countryCode:a.value,onSelectCountry:e=>a.onChange(e)})}),(0,n.jsx)(u.C5,{})]})}}),(0,n.jsx)(u.zB,{control:aX.control,name:"telefone",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{className:"w-full flex flex-col",children:[(0,n.jsx)(u.lR,{className:"opacity-0",children:eE("Telefone")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,className:(0,D.cn)(aX.formState.errors.telefone?"border-red-500":""),type:"text",id:"telefone",name:"telefone",onChange:e=>{var t,n;a.onChange((0,Z.bc)(null!=(t=e.currentTarget.value)?t:"",X.R[null!=(n=aX.getValues().ddi)?n:"BR"]))},placeholder:eE("N\xfamero de telefone")})}),(0,n.jsx)(u.C5,{className:"absolute left-0 -bottom-2"})]})}})]})]})]})}),(0,n.jsxs)(G.F,{children:[(0,n.jsxs)(r.j7,{position:"left",className:"flex items-center w-full mt-3",children:[(null==a_||null==(ef=a_.total)?void 0:ef.moeda)==="BRL"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Xi,{line:!0,value:"pix",children:eE("Pix")}),(0,n.jsx)(r.Xi,{line:!0,value:"credit",children:eE("Cart\xe3o de cr\xe9dito")}),(0,n.jsx)(r.Xi,{line:!0,value:"paypal",children:eE("PayPal")})]}),(null==a_||null==(eg=a_.total)?void 0:eg.moeda)==="CLP"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Xi,{line:!0,value:aT,children:eE("Cart\xe3o de cr\xe9dito")}),aR&&(0,n.jsx)(r.Xi,{line:!0,value:"mp-wallet",children:eE("Conta Mercado Pago")})]}),(null==a_||null==(ej=a_.total)?void 0:ej.moeda)==="EUR"&&(0,n.jsxs)(n.Fragment,{children:[eF&&(0,n.jsx)(r.Xi,{line:!0,value:"mbway",children:eE("MB Way")}),"es"===eV&&(0,n.jsx)(r.Xi,{line:!0,value:"bizum",children:eE("Bizum")}),(0,n.jsx)(r.Xi,{line:!0,value:"card-eur",children:eE("Cart\xe3o de cr\xe9dito")}),!1,(0,n.jsx)(r.Xi,{line:!0,value:"google-pay-eur",children:eE("Google Pay")}),tm&&(0,n.jsx)(r.Xi,{line:!0,value:"apple-pay-eur",children:eE("Apple Pay")}),(0,n.jsx)(r.Xi,{line:!0,value:"paypal",children:eE("PayPal")})]}),(null==a_||null==(eb=a_.total)?void 0:eb.moeda)==="USD"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Xi,{line:!0,value:"card-usd",children:eE("Cart\xe3o de cr\xe9dito")}),(0,n.jsx)(r.Xi,{line:!0,value:"google-pay-usd",children:eE("Google Pay")}),tm&&(0,n.jsx)(r.Xi,{line:!0,value:"apple-pay-usd",children:eE("Apple Pay")}),(0,n.jsx)(r.Xi,{line:!0,value:"paypal",children:eE("PayPal")})]})]}),(0,n.jsx)(G.$,{orientation:"horizontal"})]}),(null==a_||null==(ey=a_.total)?void 0:ey.moeda)==="BRL"&&(0,n.jsx)(r.av,{value:"pix",className:"w-full",children:(0,n.jsx)(u.lV,{...aZ,children:(0,n.jsx)("div",{className:"space-y-4",children:(0,n.jsx)(u.zB,{control:aZ.control,name:"document",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:eE("Digite seu CPF/CNPJ")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:eB,id:"document",name:"document",placeholder:"xxx.xxx.xxx-xx",type:"text",onInput:e=>{a.onChange((0,Z.bc)(e.currentTarget.value,P.A))},onChange:e=>{e.preventDefault(),e.stopPropagation()},disabled:aZ.getValues().notBrazilian})}),(0,n.jsx)(u.C5,{}),(0,n.jsx)(u.zB,{control:aZ.control,name:"notBrazilian",render:e=>{let{field:a}=e;return(0,n.jsx)(u.eI,{children:(0,n.jsx)(u.MJ,{children:(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(q.S,{checked:a.value,onCheckedChange:a.onChange,id:"not-brazilian",className:"cursor-pointer border-[1px] border-[#DDE7F0]"}),(0,n.jsx)("div",{className:"grid gap-1.5 leading-none",children:(0,n.jsx)(u.lR,{htmlFor:"not-brazilian",className:"cursor-pointer text-sm",children:eE("N\xe3o sou brasileiro")})})]}),az&&(0,n.jsx)(em,{id:"socio-torcedor-pix",checked:a0,loading:a5,disabled:aZ.watch("notBrazilian"),onCheckedChange:()=>a9(aZ.getValues().document),t:eE})]})})})}})]})}})})})}),((null==a_||null==(eA=a_.total)?void 0:eA.moeda)==="BRL"||(null==a_||null==(eN=a_.total)?void 0:eN.moeda)==="CLP"&&"credit"===aT)&&(0,n.jsxs)(r.av,{value:"credit",className:"w-full h-auto",children:[eK&&te&&(null==a_||null==(eC=a_.total)?void 0:eC.moeda)!=="CLP"&&(0,n.jsx)("div",{className:"w-full flex flex-col space-y-4",children:(0,n.jsx)("span",{className:"text-[#475366] text-sm leading-5 font-semibold",children:eE("Carregando cart\xf5es")})}
1),!eK&&te&&(null==a_||null==(ew=a_.total)?void 0:ew.moeda)!=="CLP"&&e1&&(null==e1?void 0:e1.length)>0&&(0,n.jsxs)("div",{className:"w-full flex flex-col space-y-4",children:[(0,n.jsx)("span",{className:"text-[#475366] text-sm leading-5 font-semibold",children:eE("Cart\xf5es salvos")}),(0,n.jsxs)("div",{className:"w-full flex flex-col space-y-4",children:[e1.map(e=>(0,n.jsx)(l.$,{onClick:()=>tc(e.id),loading:tt&&e.id==(null==e2?void 0:e2.id),loaderColor:"black",className:"flex disabled:justify-center justify-start items-center w-full bg-white p-4 h-16 rounded-lg",children:(0,n.jsxs)("div",{className:"flex flex-row items-center justify-between space-x-3 w-full",children:[(0,n.jsxs)("span",{className:"text-[#798AA3] text-sm leading-6 font-medium",children:["....",e.ultimos_4_digitos," ","-"," ",eE("Vence em {validade}",{validade:e.validade})]}),(0,v.V)(e.numero)]})},e.id)),(0,n.jsx)(l.$,{variant:"default",className:"w-full",onClick:()=>ta(!1),children:eE("Adicionar novo cart\xe3o")}),az&&!aP&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.w,{}),(0,n.jsx)(em,{id:"socio-torcedor-credit-saved-cards",checked:a0,loading:a5,className:"my-3 flex items-center space-x-2",onCheckedChange:()=>a9(aQ.getValues().document||aZ.getValues().document),t:eE})]})]})]}),!te&&(0,n.jsxs)(n.Fragment,{children:[(null==a_||null==(e_=a_.total)?void 0:e_.moeda)!=="CLP"&&e1&&(null==e1?void 0:e1.length)>0&&(0,n.jsxs)(l.$,{onClick:()=>{var e;aQ.reset(),aQ.clearErrors(),aQ.setValue("nameCard",""),aQ.setValue("cardNumber",""),aQ.setValue("expiration",""),aQ.setValue("cvv",""),aQ.setValue("document",aP?null!=(e=e3.value)?e:"":(0,Z.bc)(e3.value,P.A)),aQ.setValue("installment","1"),a8([]),ad(void 0),ar({}),ta(!0)},variant:"ghost",className:"flex space-x-2 px-0 items-center mb-3",children:[(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"#475366",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("span",{className:"text-[#475366] text-sm leading-5 font-semibold",children:e2&&e2.id?eE("Escolher outro cart\xe3o"):eE("Escolher um cart\xe3o")})]}),e2&&(null==e2?void 0:e2.id)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(R.Zp,{className:"p-4 min-h-36 relative flex flex-col items-center justify-end",children:[(0,n.jsx)("div",{className:"absolute top-4 right-4 w-auto h-8",children:(0,v.V)(e2.number)}),(0,n.jsx)("div",{className:"flex flex-row items-center justify-between space-x-3 w-full",children:(0,n.jsxs)("span",{className:"text-[#798AA3] text-xl leading-6 font-medium",children:["XXXX XXXX XXXX"," ",e2.lastDigits]})}),(0,n.jsxs)("div",{className:"mt-2 flex flex-row items-center space-x-3 w-full",children:[(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-[#798AA3]",children:eE("Nome impresso no cart\xe3o")}),(0,n.jsx)("span",{className:"text-base",children:e2.name})]}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{className:"text-xs font-medium text-[#798AA3]",children:eE("Vencimento")}),(0,n.jsx)("span",{children:e2.expiration})]})]})]}),(0,n.jsx)(u.lV,{...aQ,children:(0,n.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,n.jsx)(u.zB,{control:aQ.control,name:"cvv",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:"CVV"}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:eO,id:"cvv",name:"cvv",placeholder:"xxx",type:"text",onInput:e=>{a.onChange((0,Z.bc)(e.currentTarget.value,V))},onChange:e=>{e.preventDefault(),e.stopPropagation()}})}),(0,n.jsx)(u.C5,{})]})}}),a7.length>0&&(0,n.jsx)(u.zB,{control:aQ.control,name:"installment",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:eE("Parcelamento")}),(0,n.jsxs)(m.l6,{onValueChange:e=>{aQ.setValue("installment",e),ad(a7.find(a=>a.installments==e))},defaultValue:a.value,children:[(0,n.jsx)(u.MJ,{children:(0,n.jsx)(m.bq,{children:(0,n.jsx)(m.yv,{placeholder:eE("Escolha o parcelamento")})})}),(0,n.jsx)(m.gC,{children:a7.map(e=>(0,n.jsx)(m.eb,{value:e.installments.toString(),children:e.recommended_message},e.installments))})]}),(0,n.jsx)(u.C5,{})]})}})]})})]}),(0,n.jsx)(u.lV,{...aQ,children:(0,n.jsxs)("div",{className:(0,D.cn)("space-y-4",(null==e2?void 0:e2.id)&&"hidden"),children:[(0,n.jsx)(u.zB,{control:aQ.control,name:"cardNumber",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:eE("N\xfamero do cart\xe3o")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:eL,id:"cardNumber",name:"cardNumber",type:(null==e2?void 0:e2.id)?"password":"text",placeholder:"xxxx xxxx xxxx xxxx",onInput:td,onChange:e=>{e.preventDefault(),e.stopPropagation()},disabled:null!=e2&&!!e2.id})}),(0,n.jsx)(u.C5,{})]})}}),(0,n.jsxs)("div",{className:"grid grid-cols-2 space-x-6",children:[(0,n.jsx)(u.zB,{control:aQ.control,name:"expiration",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:eE("Data de validade")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:eq,id:"expiration",name:"expiration",placeholder:"mm/aa",type:"text",onInput:e=>{a.onChange((0,Z.bc)(e.currentTarget.value,I))},onChange:e=>{e.preventDefault(),e.stopPropagation()},disabled:null!=e2&&!!e2.id})}),(0,n.jsx)(u.C5,{})]})}}),!(null==e2?void 0:e2.id)&&(0,n.jsx)(u.zB,{control:aQ.control,name:"cvv",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:"CVV"}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:eO,id:"cvv",name:"cvv",placeholder:"xxx",type:"text",onInput:e=>{a.onChange((0,Z.bc)(e.currentTarget.value,V))},onChange:e=>{e.preventDefault(),e.stopPropagation()}})}),(0,n.jsx)(u.C5,{})]})}})]}),(0,n.jsx)(o.A,{control:aQ.control,id:"nameCard",name:"nameCard",placeholder:"John Doe",label:eE("Nome impresso no cart\xe3o"),disabled:null!=e2&&!!e2.id}),(0,n.jsx)(u.zB,{control:aQ.control,name:"document",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{children:[(0,n.jsx)(u.lR,{children:aP?eE("Digite seu RUT"):eE("Digite seu CPF/CNPJ")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,ref:aP?void 0:eB,id:"document",name:"document",placeholder:aP?eE("Exemplo de documento chileno"):"xxx.xxx.xxx-xx",type:"text",onInput:e=>{a.onChange(aP?e.currentTarget.value.toUpperCase():(0,Z.bc)(e.currentTarget.value,P.A))},onChange:e=>{e.preventDefault(),e.stopPropagation()},disabled:aQ.getValues().notBrazilian})}),(0,n.jsx)(u.C5,{}),(0,n.jsx)(u.zB,{control:aQ.control,name:"notBrazilian",render:e=>{let{field:a}=e;return(0,n.jsx)(u.eI,{children:(0,n.jsx)(u.MJ,{children:(0,n.jsxs)("div",{className:"mt-2 flex flex-col gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(q.S,{checked:a.value,onCheckedChange:a.onChange,id:"not-brazilian",className:"cursor-pointer border-[1px] border-[#DDE7F0]"}),(0,n.jsx)("div",{className:"grid gap-1.5 leading-none",children:(0,n.jsx)(u.lR,{htmlFor:"not-brazilian",className:"cursor-pointer text-sm",children:aP?eE("Sou estrangeiro"):eE("N\xe3o sou brasileiro")})})]}),az&&!aP&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.w,{}),(0,n.jsx)(em,{id:"socio-torcedor-credit",checked:a0,loading:a5,disabled:aQ.watch("notBrazilian"),onCheckedChange:()=>a9(aQ.getValues().document),t:eE})]})]})})})}})]})}})]})})]})]}),aR&&(0,n.jsx)(r.av,{value:"mp-wallet",className:"w-full h-auto",children:(0,n.jsx)("p",{className:"text-[#798AA3] text-sm leading-6",children:eE("Pague com o saldo ou os cart\xf5es salvos na sua conta Mercado Pago")})}),(null==a_||null==(ek=a_.total)?void 0:ek.moeda)==="CLP"&&"card-clp"===aT&&(0,n.jsx)(r.av,{id:"card-clp-form",value:"card-clp",className:"w-full h-auto",children:(0,n.jsx)("p",{className:"text-[#798AA3] text-[13px]",children:eE("Ao avan\xe7ar, voc\xea poder\xe1 realizar o pagamento utilizando o Cart\xe3o de Cr\xe9dito")})}),(null==a_||null==(eS=a_.total)?void 0:eS.moeda)==="EUR"&&eF&&(0,n.jsx)(r.av,{id:"mbway",value:"mbway",className:"w-full h-auto",children:(0,n.jsx)(u.lV,{...aG,children:(0,n.jsxs)("div",{className:(0,D.cn)("col-span-2 relative flex items-end gap-3 w-full",aG.formState.errors.telefone?"pb-5":""),children:[(0,n.jsx)(u.zB,{control:aG.control,name:"ddi",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{className:"flex flex-col",children:[(0,n.jsx)(u.lR,{children:eE("Celular")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(U.c,{countryCode:a.value,onSelectCountry:e=>a.onChange(e)}
1)}),(0,n.jsx)(u.C5,{})]})}}),(0,n.jsx)(u.zB,{control:aG.control,name:"telefone",render:e=>{let{field:a}=e;return(0,n.jsxs)(u.eI,{className:"w-full flex flex-col",children:[(0,n.jsx)(u.lR,{className:"opacity-0",children:eE("Telefone")}),(0,n.jsx)(u.MJ,{children:(0,n.jsx)(M.p,{...a,className:(0,D.cn)(aG.formState.errors.telefone?"border-red-500":""),type:"text",id:"telefone",name:"telefone",onChange:e=>{var a;aG.setValue("telefone",(0,Z.bc)(e.currentTarget.value,X.R[null!=(a=aG.watch("ddi"))?a:"BR"]))},placeholder:eE("N\xfamero de telefone")})}),(0,n.jsx)(u.C5,{className:"absolute left-0 -bottom-2"})]})}})]})})}),(null==a_||null==(e$=a_.total)?void 0:e$.moeda)==="EUR"&&"es"===eV&&(0,n.jsx)(r.av,{id:"bizum-form",value:"bizum",className:"w-full h-auto",children:(0,n.jsx)("p",{className:"text-[#798AA3] text-[13px]",children:eE("Ao avan\xe7ar, voc\xea poder\xe1 realizar o pagamento utilizando o Bizum")})}),(null==a_||null==(eP=a_.total)?void 0:eP.moeda)==="EUR"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.av,{id:"card-eur-form",value:"card-eur",className:"w-full h-auto",children:(0,n.jsx)("p",{className:"text-[#798AA3] text-[13px]",children:eE("Ao avan\xe7ar, voc\xea poder\xe1 realizar o pagamento utilizando o Cart\xe3o de Cr\xe9dito")})}),!1]}),(null==a_||null==(eT=a_.total)?void 0:eT.moeda)==="USD"&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.av,{id:"card-usd-form",value:"card-usd",className:"w-full h-auto",children:(0,n.jsx)("p",{className:"text-[#798AA3] text-[13px]",children:eE("Ao avan\xe7ar, voc\xea poder\xe1 realizar o pagamento utilizando o Cart\xe3o de Cr\xe9dito")})})}),(0,n.jsxs)(r.av,{id:"paypal-form",value:"paypal",className:"w-full h-auto",children:[(0,n.jsx)("p",{className:"text-[#798AA3] text-[13px]",children:eE("Ao avan\xe7ar, voc\xea poder\xe1 realizar o pagamento utilizando o PayPal")}),az&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.w,{className:"my-3"}),(0,n.jsx)(em,{id:"socio-torcedor-paypal",checked:a0,loading:a5,className:"my-3 flex items-center space-x-2",onCheckedChange:()=>a9(aZ.getValues().document||aQ.getValues().document),t:eE})]})]})]}),(0,n.jsx)(x.w,{}),"carrinho"===eW&&!eU&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($,{onRemove:()=>a1(!1)}),(0,n.jsx)(x.w,{})]}),!!eU&&"pre-venda"===eU&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ee,{}),(0,n.jsx)(x.w,{})]}),(0,n.jsx)("div",{className:"xl:hidden",children:(0,n.jsx)(F.A,{variant:"payment-summary"})}),(0,n.jsxs)("div",{className:"w-full xl:block hidden",children:[(0,n.jsx)(F.A,{variant:"payment-summary"}),(0,n.jsx)(l.$,{disabled:!eZ||!to||eR||!ak||af||aS,variant:"primary",className:"w-full disabled:bg-slate-300 disabled:cursor-not-allowed mt-2 h-12",onClick:()=>ts(),children:eI("Avan\xe7ar")}),aS&&(0,n.jsx)("p",{className:"mt-2 text-sm text-red-600",children:eE("Envie sua selfie para continuar a compra")})]}),(0,n.jsxs)("div",{className:"xl:hidden fixed border-t bottom-0 left-0 right-0 bg-white z-50 px-4 py-5",children:[(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-[480px] items-center justify-between gap-4",children:[(0,n.jsx)(F.A,{variant:"compact",className:"min-w-0"}),(0,n.jsx)(l.$,{disabled:!eZ||!to||!ak||af||aS,variant:"primary",className:"h-12 w-[152px] shrink-0 disabled:bg-slate-300 disabled:cursor-not-allowed",onClick:()=>ts(),children:eI("Avan\xe7ar")})]}),aS&&(0,n.jsx)("p",{className:"mt-2 text-center text-sm text-red-600",children:eE("Envie sua selfie para continuar a compra")})]})]})}},43882:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});var n=t(12115),o=t(23091),l=t(95503),r=t(85065);let s=()=>{var e,a;let{selectedPicturesForPrint:t,setPrintShippingPrice:s,setPrintPrice:i,setSelectedProductIdPrint:d,selectedProductIdPrint:c}=(0,o.Q)(),{loading:u,error:m,data:p,previousData:x}=(0,r.IT)(l.S,{skip:!t.length,variables:{quantidade:t.length,impressoes:t.map(e=>e.id)}}),h=null!=(e=null!=(a=null==p?void 0:p.cotacao.items)?a:null==x?void 0:x.cotacao.items)?e:[];return n.useEffect(()=>{if(p&&p.cotacao.items.length>0){let e=p.cotacao.items.find(e=>e.produto_id===c);if(e){s(e.valor_frete),i(e.valor_impressao);return}d(p.cotacao.items[0].produto_id),s(p.cotacao.items[0].valor_frete),i(p.cotacao.items[0].valor_impressao)}},[p,c,i,s,d]),{loading:u,error:m,products:h,isRefreshing:u&&h.length>0}}},46097:(e,a,t)=>{"use strict";t.d(a,{D:()=>o});let n={"gmail.com":["gmai.com","gmail.con","gmail.cm","gmail.co","gmal.com","gmil.com","gmaill.com","gmali.com"],"hotmail.com":["hotmai.com","hotmal.com","hotmil.com","hotmail.con","hotmail.co","hormail.com","hitmail.com"],"outlook.com":["otlook.com","outlok.com","outook.com","outloock.com","outlook.con","outlook.co"],"yahoo.com":["yaho.com","yahooo.com","yhoo.com","yahoo.con","yahoo.co"],"icloud.com":["icloude.com","icloud.con","icloud.co","icloud.cm","aicloud.com"]},o=e=>{if(!e||"string"!=typeof e)return null;let a=e.toLowerCase().trim().split("@");if(2!==a.length)return null;let t=a[1];if(!t)return null;for(let[e,a]of Object.entries(n))if(a.includes(t))return e;return null}},47687:(e,a,t)=>{"use strict";t.d(a,{Xi:()=>d,av:()=>c,j7:()=>i,tU:()=>s});var n=t(95155),o=t(57518),l=t(12115),r=t(40980);let s=o.bL,i=l.forwardRef((e,a)=>{let{className:t,position:l="center",...s}=e;return(0,n.jsx)(o.B8,{ref:a,className:(0,r.cn)("flex border-b-2","center"==l&&"justify-center","left"==l&&"justify-start","right"==l&&"justify-end",t),...s})});i.displayName=o.B8.displayName;let d=l.forwardRef((e,a)=>{let{className:t,line:l=!1,...s}=e;return(0,n.jsx)(o.l9,{ref:a,className:(0,r.cn)(!l&&"mx-2 border-transparent","disabled:pointer-events-none disabled:text-[#798AA3]","inline-flex items-center justify-center whitespace-nowrap","transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2","p-2 xl:p-4","relative text-sm leading-6 font-medium","data-[state=active]:text-[#2686EA] data-[state=active]:after:opacity-100 after:bg-[#2686EA] after:content-[''] after:opacity-0 after:absolute after:left-0 after:right-0 after:bottom-[-2px] after:h-[2px]",t),...s})});d.displayName=o.l9.displayName;let c=l.forwardRef((e,a)=>{let{className:t,...l}=e;return(0,n.jsx)(o.UC,{ref:a,className:(0,r.cn)("mt-4 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 dark:ring-offset-slate-950 dar
1k:focus-visible:ring-slate-300",t),...l})});c.displayName=o.UC.displayName},61086:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});let n={tax:"13.77",descriptor:"BANLEKFOTOS",getCartValue:function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0.00",n=(e?parseFloat(e):0)||(null!=a?a:0),o=n;return"0.00"!==t&&(o=n*parseFloat(t)/100),o.toFixed(2)},getCartDescription:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"Compra: #".concat(e)},sendPayment:async(e,a,t,n,o)=>{let l=a;l||n(l=await t()),o({gateway_id:e.orderID,cart_id:l.token,method_payment:"paypal"})}}},70872:(e,a,t)=>{"use strict";t.d(a,{Tooltip:()=>d,TooltipContent:()=>u,TooltipProvider:()=>s,TooltipTrigger:()=>c});var n=t(95155),o=t(30757),l=t(12115),r=t(40980);let s=o.Kq,i=l.createContext(null),d=e=>{let{children:a,delayDuration:t=0,...r}=e,[s,d]=l.useState(!1);return l.useEffect(()=>{if(s){let e=e=>{e.target.closest("[data-tooltip-root]")||d(!1)};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)}},[s]),(0,n.jsx)(i.Provider,{value:{isClickOpen:s,setIsClickOpen:d},children:(0,n.jsx)("div",{"data-tooltip-root":!0,children:(0,n.jsx)(o.bL,{delayDuration:t,open:s||void 0,onOpenChange:e=>{},...r,children:a})})})},c=l.forwardRef((e,a)=>{let{onClick:t,...r}=e,s=l.useContext(i),d=l.useCallback(e=>{s&&(e.preventDefault(),s.setIsClickOpen(!s.isClickOpen)),null==t||t(e)},[s,t]);return(0,n.jsx)(o.l9,{ref:a,onClick:d,...r})});c.displayName=o.l9.displayName;let u=l.forwardRef((e,a)=>{let{className:t,sideOffset:l=4,...s}=e;return(0,n.jsx)(o.UC,{ref:a,sideOffset:l,className:(0,r.cn)("z-50 overflow-hidden rounded-md border border-slate-200 bg-white px-3 py-1.5 text-sm text-slate-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin] dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",t),...s})});u.displayName=o.UC.displayName},76630:(e,a,t)=>{"use strict";function n(){var e;let a=null==(e=document.cookie.split(";").map(e=>e.trim()).find(e=>e.startsWith("locale=")))?void 0:e.slice(7);return a?decodeURIComponent(a):localStorage.getItem("locale")||"pt"}t.d(a,{t:()=>n})},82006:(e,a,t)=>{"use strict";t.d(a,{A:()=>j});var n=t(95155),o=t(23091),l=t(50910),r=t(98308),s=t(40980),i=t(61086),d=t(12115);let c=e=>{let{className:a}=e,t=(0,l.c)("Common");return(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-1",a),children:[(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsx)("p",{children:t("Itens")}),(0,n.jsx)("p",{children:t("Carregando")})]}),(0,n.jsxs)("div",{className:"text-[#282F3D] text-lg leading-7 flex items-center justify-between font-semibold",children:[(0,n.jsx)("p",{children:t("Total")}),(0,n.jsx)("p",{children:t("Carregando")})]})]})};var u=t(43882),m=t(66569),p=t(2637),x=t(23714),h=t(33210),v=t(99412),f=t(42763),g=t(86846);let j=e=>{var a,t,j,b,y,A,N,C,w,_,k,S,$,P,T,E,I,V,F,R,M,z,D,B;let{className:L,variant:q="default"}=e,[O]=(0,p.ZA)("entity",{defaultValue:"",history:"replace"}),[J]=(0,p.ZA)("token",{defaultValue:"",history:"replace"}),[U,X]=d.useState(null),Q=d.useMemo(()=>{if((O&&"pre-venda"===O||O&&"picture-shop"===O)&&J)try{let e=atob(J);return JSON.parse(e)}catch(e){}return null},[O,J]),{list:Z,checkoutList:G,entity:W,loading:H,loadingSelectedCartSummary:Y,installment:K,paymentMethod:ee,hasPrintPictures:ea,selectedPicturesForPrint:et,step:en,printShippingPrice:eo,printPrice:el,checkoutTipAmount:er}=(0,o.Q)(),es=null!=G?G:Z,ei=null==Z||null==(w=Z.items)||null==(C=w[0])||null==(N=C.fotos)?void 0:N.itens,ed=!!Array.isArray(ei)&&ei.some(e=>null==e?void 0:e.idCarrinhoPacote),{loading:ec}=(0,u.A)(),eu=(0,m.U)("(min-width: 640px)"),em=(0,l.c)("Checkout"),ep=(0,l.c)("Common"),ex=d.useCallback(()=>{if(!es)return 0;let e=ea?eo+el:0;return(null==K?void 0:K.total_amount)-((null==es?void 0:es.total.venda)+er+e)},[er,ea,null==K?void 0:K.total_amount,es,el,eo]),eh=d.useCallback(()=>{var e;if(!es)return 0;let a=ea?el+eo:0;return(null==es||null==(e=es.total)?void 0:e.moeda)==="BRL"?parseFloat(i.A.tax)/100*((null==es?void 0:es.total.venda)+er+a):0},[er,es,el,eo,ea]),ev=d.useCallback(()=>{var e,a,t;if(O&&"pre-venda"===O&&Q)return null!=(a=null==es||null==(t=es.total)?void 0:t.venda)?a:Number(Q.pre_venda_desconto_preco||0);if(O&&"picture-shop"===O&&Q)return(Q.preco||0)+(Q.valor_frete||0);if(!es)return 0;let n=ea&&(eu?en>=0:en>=1)&&!(null==K?void 0:K.total_amount)?el+eo:0,o="carrinho"===W&&(null==es?void 0:es.qtdProdutos)&&es.qtdProdutos>0?es.total.valor_frete:0;
1if("paypal"==ee)return(null==es?void 0:es.total.venda)+er+eh()+n+o;let l=null!=(e=null==K?void 0:K.total_amount)?e:(null==es?void 0:es.total.venda)+er;return(null==K?void 0:K.total_amount)?l+n:l+n+o},[O,Q,ea,null==K?void 0:K.total_amount,es,ee,el,eo,eh,er,W,eu,en]);if(!es)return null;let ef=!!(null==es||null==(k=es.total)||null==(_=k.descontos)?void 0:_.valor),eg=!!(null==es||null==(S=es.total)?void 0:S.promocional),ej=Array.isArray(et)?et.length:0,eb=Number(null!=(a=null==K?void 0:K.installments)?a:0),ey=(null==es||null==($=es.total)?void 0:$.original)||(null==es||null==(P=es.total)?void 0:P.venda)||0,eA=ev(),eN=er||(null!=(t=null==es||null==(T=es.total)?void 0:T.gorjeta)?t:0),eC=ea&&(eu?en>=0:en>=1),ew=eC?el:0,e_=(eC?eo:0)+("carrinho"===W&&(null==es?void 0:es.qtdProdutos)&&es.qtdProdutos>0?es.total.valor_frete:0),ek=Number(null!=(j=null==es||null==(I=es.total)||null==(E=I.descontos)?void 0:E.valor)?j:0),eS=eb>1?ex():0,e$="paypal"==ee&&(null==es?void 0:es.total.moeda)==="BRL"?eh():0,eP=G&&G!==Z?0:Number(((null==es?void 0:es.items)||[]).reduce((e,a)=>{var t,n;return e+[...(null==(t=a.fotos)?void 0:t.itens)||[],...(null==(n=a.videos)?void 0:n.itens)||[]].reduce((e,a)=>{var t,n,o;let l=Number((null==a||null==(t=a.precos)?void 0:t.taxa_banlek_cliente_valor)||0);return l>0?e+l:e+Math.max(0,Number((null==a||null==(n=a.precos)?void 0:n.venda)||0)-Number((null==a||null==(o=a.precos)?void 0:o.original)||0))},0)},0).toFixed(2)),eT=Number((null==es||null==(V=es.total)?void 0:V.taxa_banlek_cliente_valor)||0)||eP,eE=Number(null!=(b=null==es||null==(F=es.total)?void 0:F.taxa_servico)?b:0),eI=Math.max(0,Number(((null!=(y=null==es||null==(R=es.total)?void 0:R.original)?y:0)-((null!=(A=null==es||null==(M=es.total)?void 0:M.venda)?A:0)-eT-eE)-ek).toFixed(2))),eV=eS+e$+eE+eT-ek-eI,eF=(ek>0||eI>0||eS>0||e$>0||eE>0||eT>0)&&Math.abs(eV)>=.01,eR=function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"text-sm text-[#798AA3]",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:14;return(0,n.jsxs)("button",{type:"button",onClick:()=>X(a),className:"inline-flex items-center gap-1.5 text-left",children:[(0,n.jsx)("span",{className:t,children:e}),(0,n.jsx)(x.A,{size:o,className:"shrink-0 text-[#798AA3]"})]})},eM="adjustments"===U?em("Descontos e acr\xe9scimos"):"shipping"===U?em("Frete"):em("Taxa de servi\xe7o"),ez=()=>{if(!U)return null;let e=(0,n.jsxs)("div",{className:"relative px-6 pb-8 pt-6",children:[eu?(0,n.jsx)(f.HM,{className:"absolute left-6 top-6 text-[#282F3D]",children:(0,n.jsx)(h.A,{className:"h-7 w-7"})}):(0,n.jsx)(v.kN,{className:"absolute left-6 top-6 text-[#282F3D]",children:(0,n.jsx)(h.A,{className:"h-7 w-7"})}),(0,n.jsx)("div",{className:"flex items-center justify-center px-12",children:(0,n.jsx)("h3",{className:"text-center text-[1.1rem] font-semibold text-[#282F3D] sm:text-[1.35rem]",children:eM})}),(0,n.jsx)("div",{className:"mt-8",children:U?"adjustments"===U?(0,n.jsxs)("div",{className:"space-y-4 text-sm leading-relaxed text-[#475366] sm:text-base",children:[(0,n.jsx)("p",{children:em("Este valor \xe9 a combina\xe7\xe3o autom\xe1tica de benef\xedcios e taxas aplicadas ao seu pedido")}),(0,n.jsxs)("ul",{className:"list-disc space-y-4 pl-6",children:[(ek>0||eI>0)&&(0,n.jsxs)("li",{children:[(0,n.jsxs)("span",{className:"font-semibold text-[#282F3D]",children:[em("Desconto"),":"]})," ",em("Redu\xe7\xe3o aplicada sobre o pre\xe7o original de fotos em promo\xe7\xe3o ou pacotes especiais"),"."]}),eT>0&&(0,n.jsxs)("li",{children:[(0,n.jsxs)("span",{className:"font-semibold text-[#282F3D]",children:[em("Taxa transacional"),":"]})," ",em("Taxa aplicada pelo fot\xf3grafo ao pedido para cobrir custos operacionais e de processamento da transa\xe7\xe3o realizados atrav\xe9s da plataforma")]}),eE>0&&(0,n.jsxs)("li",{children:[(0,n.jsxs)("span",{className:"font-semibold text-[#282F3D]",children:[em("Taxa de servi\xe7o"),":"]})," ",em("Inclui o licenciamento de uso da Plataforma e contribui com custos operacionais, como desenvolvimento, atualiza\xe7\xe3o e suporte, al\xe9m de viabilizar investimentos cont\xednuos em seguran\xe7a e inova\xe7\xe3o")]}),(eS>0||e$>0)&&(0,n.jsxs)("li",{children:[(0,n.jsxs)("span",{className:"font-semibold text-[#282F3D]",children:[em("Outras taxas"),":"]}
1)," ",em("Acr\xe9scimos aplicados conforme a forma de pagamento escolhida, como parcelamento ou pagamento internacional"),"."]})]}),(0,n.jsx)("p",{children:em("Somamos todas as taxas e subtra\xedmos o valor total dos seus descontos para chegar ao balan\xe7o exibido no resumo")}),(0,n.jsxs)("div",{className:"rounded border border-[#DCE7F3] bg-[#F4F8FC] p-4",children:[(0,n.jsxs)("div",{className:"space-y-2 text-sm text-[#798AA3] sm:text-base",children:[(ek>0||eI>0)&&(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("p",{children:em("Descontos")}),(0,n.jsxs)("p",{children:["-"," ",(0,r.$)(ek+eI,{currency:null==es?void 0:es.total.moeda})]})]}),eT>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("p",{children:em("Taxa transacional")}),(0,n.jsxs)("p",{children:["+"," ",(0,r.$)(eT,{currency:null==es?void 0:es.total.moeda})]})]}),eE>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("p",{children:em("Taxa de servi\xe7o")}),(0,n.jsxs)("p",{children:["+"," ",(0,r.$)(eE,{currency:null==es?void 0:es.total.moeda})]})]}),eS>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("p",{children:em("Taxa de parcelamento")}),(0,n.jsxs)("p",{children:["+"," ",(0,r.$)(eS,{currency:null==es?void 0:es.total.moeda})]})]}),e$>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("p",{children:em("Taxa internacional")}),(0,n.jsxs)("p",{children:["+"," ",(0,r.$)(e$,{currency:null==es?void 0:es.total.moeda})]})]})]}),(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-between gap-4 text-base font-semibold text-[#282F3D]",children:[(0,n.jsx)("p",{children:em("Valor final")}),(0,n.jsx)("p",{children:(0,r.$)(eA,{currency:null==es?void 0:es.total.moeda})})]})]})]}):"shipping"===U?(0,n.jsx)("div",{className:"space-y-4 text-sm leading-relaxed text-[#475366] sm:text-base",children:(0,n.jsx)("p",{children:em("Este valor inclui o custo de envio de todos os itens do seu pedido, como fotos impressas e produtos f\xedsicos, consolidado para a sua regi\xe3o")})}):(0,n.jsx)("div",{className:"space-y-5 text-[15px] leading-8 text-[#475366] sm:text-base",children:(0,n.jsx)("p",{children:em("Inclui o licenciamento de uso da Plataforma e contribui com custos operacionais, como desenvolvimento, atualiza\xe7\xe3o e suporte, al\xe9m de viabilizar investimentos cont\xednuos em seguran\xe7a e inova\xe7\xe3o")})}):null})]});return eu?(0,n.jsx)(f.lG,{open:!!U,onOpenChange:e=>!e&&X(null),children:(0,n.jsx)(f.Cf,{className:"max-w-[680px] overflow-hidden rounded-[32px] border-none bg-white p-0 shadow-xl",children:e})}):(0,n.jsx)(v.cj,{open:!!U,onOpenChange:e=>!e&&X(null),children:(0,n.jsx)(v.h,{side:"bottom",close:!1,className:"max-h-[88dvh] overflow-y-auto rounded-t-[32px] border-none p-0",children:e})})};if(H||Y)return"compact"===q?(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-1",L),children:[(0,n.jsx)("p",{className:"text-sm font-medium text-[#798AA3]",children:em("Total a pagar")}),(0,n.jsx)("p",{className:"text-[1.1rem] font-semibold leading-none text-[#282F3D]",children:ep("Carregando")})]}):"payment-summary"===q?(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-5",L),children:[(0,n.jsx)("h3",{className:"text-[1.25rem] font-semibold leading-7 text-[#282F3D]",children:em("Resumo dos valores")}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Subtotal")}),(0,n.jsx)(g.E,{className:"h-5 w-20"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("p",{children:em("Descontos e acr\xe9scimos")}),(0,n.jsx)(x.A,{size:14,className:"text-[#798AA3]"})]}),(0,n.jsx)(g.E,{className:"h-5 w-20"})]}),eC&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Impress\xe3o de fotos")}),(0,n.jsx)(g.E,{className:"h-5 w-20"})]})}),e_>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Frete")}),(0,n.jsx)(g.E,{className:"h-5 w-20"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between text-[1.05rem] font-semibold text-[#282F3D]",children:[(0,n.jsx)("p",{children:em("Total a pagar")}),(0,n.jsx)(g.E,{className:"h-7 w-24"})]})]})]}):(0,n.jsx)(c,{className:L});if("compact"===q)return(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-1",L),children:[(0,n.jsx)("p",{className:"text-sm font-medium text-[#798AA3]",children:em("Total a pagar")}),(0,n.jsx)("p",{className:"text-[1.1rem] font-semibold leading-none text-[#282F3D]",children:(0,r.$)(ev(),{currency:null==es?void 0:es.total.moeda})})]});if("payment-summary"===q){let e=eV>0?"+ ".concat((0,r.$)(eV,{currency:null==es?void 0:es.total.moeda})):eV<0?"- ".concat((0,r.$)(Math.abs(eV),{currency:null==es?void 0:es.total.moeda})):(0,r.$)(0,{currency:null==es?void 0:es.total.moeda});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-5",L),children:[(0,n.jsx)("h3",{className:"text-[1.25rem] font-semibold leading-7 text-[#282F3D]",children:em("Resumo dos valores")}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Subtotal")}),(0,n.jsx)("p",{children:(0,r.$)(ey,{currency:null==es?void 0:es.total.moeda})})]}),eF&&(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[eR(em("Descontos e acr\xe9scimos"),"adjustments"),(0,n.jsx)("p",{className:(0,s.cn)(eV<0&&"text-[#2686EA]",eV>0&&"text-red-300"),children:e})]}),eN>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Extra")}),(0,n.jsx)("p",{children:(0,r.$)(eN,{currency:null==es?void 0:es.total.moeda})})]}),eC&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[(0,n.jsx)("p",{children:em("Impress\xe3o de fotos")}),ec?(0,n.jsx)(g.E,{className:"h-5 w-20"}):(0,n.jsx)("p",{children:(0,r.$)(ew,{currency:null==es?void 0:es.total.moeda})})]})}),e_>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm text-[#798AA3]",children:[eR(em("Frete"),"shipping"),ec?(0,n.jsx)(g.E,{className:"h-5 w-20"}):(0,n.jsx)("p",{children:(0,r.$)(e_,{currency:null==es?void 0:es.total.moeda})})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between text-[1.05rem] font-semibold text-[#282F3D]",children:[(0,n.jsx)("p",{children:em("Total a pagar")}),(0,n.jsx)("p",{children:(0,r.$)(eA,{currency:null==es?void 0:es.total.moeda})})]})]})]}),ez()]})}return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:(0,s.cn)("flex flex-col space-y-1",L),children:[("carrinho"===W||!!O&&"pre-venda"!==O&&"picture-shop"!==O)&&!ed&&(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsxs)("p",{className:"space-x-1 text-xs md:text-sm",children:["".concat(ep((null==es?void 0:es.qtdTotal)&&(null==es?void 0:es.qtdTotal)>1?"Itens":"Item")),(0,n.jsx)("span",{children:" (".concat(null==es?void 0:es.qtdTotal,")")})]}),(0,n.jsx)("div",{className:"space-x-1 flex items-center",children:(0,n.jsx)("span",{className:"font-medium text-xs text-[#798AA3] ".concat(eg||ef?"line-through":""),children:(0,r.$)(null==es||null==(z=es.total)?void 0:z.original,{currency:null==es?void 0:es.total.moeda})})})]}),ea&&(eu?en>=0:en>=1)&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsxs)("p",{className:"text-xs md:text-sm",children:[em("Impress\xe3o de fotos")," ","(".concat(ej,")")]}),ec?(0,n.jsx)("span",{className:"text-xs font-medium",children:ep("Carregando")}):(0,n.jsx)("span",{className:"text-xs font-medium",children:(0,r.$)(el)})]})}),e_>0&&(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[eR(em("Frete"),"shipping","text-xs md:text-sm text-[#798AA3]",12),ec?(0,n.jsx)("span",{className:"text-xs font-medium",children:ep("Carregando")}):(0,n.jsx)("span",{className:"text-xs font-medium",children:(0,r.$)(e_,{currency:null==es||null==(D=es.total)?void 0:D.moeda})})]}),eN>0&&(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-xs md:text-sm",children:em("Extra")}),(0,n.jsx)("span",{className:"text-xs font-medium",children:(0,r.$)(eN,{currency:null==es||null==(B=es.total)?void 0:B.moeda})})]}),!!O&&"picture-shop"===O&&Q&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-xs md:text-sm",children:em("Quadro")}),(0,n.jsx)("span",{className:"text-xs font-medium",children:(0,r.$)(Q.precoUnitario,{currency:null==Q?void 0:Q.moeda})})]}),(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-xs md:text-sm",children:em("Frete")}),(0,n.jsx)("span",{className:"text-xs font-medium",children:(0,r.$)(Q.frete,{currency:null==Q?void 0:Q.moeda})})]})]}),eF&&(0,n.jsxs)("div",{className:"text-[#798AA3] text-sm leading-6 flex items-center justify-between",children:[eR(em("Descontos e acr\xe9scimos"),"adjustments","text-xs md:text-sm text-[#798AA3]",12),(0,n.jsxs)("span",{className:(0,s.cn)("text-xs font-medium",eV<0?"text-[#2686EA]":"text-red-300"),children:[eV>0?"+":eV<0?"-":"",(0,r.$)(Math.abs(eV),{currency:null==es?void 0:es.total.moeda})]})]}),(0,n.jsxs)("div",{className:"text-[#282F3D] text-lg leading-7 flex items-center justify-between font-semibold",children:[(0,n.jsx)("p",{children:em("Total")}),(0,n.jsx)("span",{children:(0,r.$)(ev(),{currency:null==es?void 0:es.total.moeda})})]})]}),ez()]})}},95503:(e,a,t)=>{"use strict";t.d(a,{S:()=>l});var n=t(21915);function o(){let e=(0,n._)(["\n    query GetProductsPrint(\n        $quantidade: Int!,\n        $impressoes: [Int!],\n        $loja: Boolean,\n        $username: String\n    ) {\n        cotacao(\n            quantidade: $quantidade,\n            impressoes: $impressoes,\n            loja: $loja,\n            username: $username\n        ) {\n            items {\n                produto\n                produto_id\n                valor_impressao\n                valor_total\n                valor_unitario\n                quantidade\n                valor_frete\n                imagem\n                personalizado\n                id_foto_personalizada\n              	variacoes {\n                    tamanhos {\n                        tamanho\n                        preco\n                    }\n                    cores\n                }\n            }\n        }\n    }\n"]);return o=function(){return e},e}let l=(0,t(35312).J1)(o())},95631:(e,a,t)=>{"use strict";t.d(a,{X:()=>l});var n=t(21915);function o(){let e=(0,n._)(["\n    query GetUserByEmailQuery($email: String!) {\n        usuarios(email: $email) {\n            items {\n                email\n            }\n        }\n    }\n"]);return o=function(){return e},e}let l=(0,t(35312).J1)(o())},97916:(e,a,t)=>{"use strict";t.d(a,{w:()=>s});var n=t(95155),o=t(15763),l=t(12115),r=t(40980);let s=l.forwardRef((e,a)=>{let{className:t,orientation:l="horizontal",decorative:s=!0,...i}=e;return(0,n.jsx)(o.b,{ref:a,decorative:s,orientation:l,className:(0,r.cn)("shrink-0 bg-slate-200 dark:bg-slate-800","horizontal"===l?"h-[1px] w-full":"h-full w-[1px]",t),...i})});s.displayName=o.b.displayName}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.