1"use strict";(self.webpackChunkmeuecomm=self.webpackChunkmeuecomm||[]).push([[5124],{16461:(e,a,t)=>{t.d(a,{A:()=>i});t(9950);var r=t(85494),s=t.n(r),l=t(18743),o=t(63184),n=t(44414);const i=function(e){let{...a}=e;const{inputName:t,setData:r,onChange:i}=a,d=e=>{const s=e.target.value;if("numeric"===a.mask||"currency"===a.mask){let e=s;e=e.replace("R$ ",""),e=parseFloat(e.replace(".","").replace(",",".")),isNaN(e)&&(e=0),"function"===typeof r&&(a.useDirectUpdate?r({[t]:e}):r((a=>({...a,[t]:e})))),void 0!==i&&i(e)}else"function"===typeof r&&(a.useDirectUpdate?r({[t]:s}):r((e=>({...e,[t]:s})))),void 0!==i&&i(s)};return"numeric"===a.mask?(0,n.jsx)(o.HG,{className:a.className?a.className:a.isDisabled?"block w-full text-sm focus:outline-none dark:text-gray-300 form-input leading-5 cursor-not-allowed opacity-50 bg-gray-300 dark:bg-gray-800":"block w-full text-sm focus:outline-none dark:text-gray-300 form-input leading-5 focus:border-purple-400 dark:border-gray-600 focus:shadow-outline-purple dark:focus:border-gray-600 dark:focus:shadow-outline-gray dark:bg-gray-700",value:"number"===typeof a.value?a.value:"",thousandSeparator:"",decimalSeparator:",",maxLength:a.maxLength,placeholder:a.placeholder,onKeyDown:a.onKeyDown,style:a.style,onBlur:a.onBlur,disabled:a.isDisabled,required:a.isRequired,allowNegative:!!a.allowNegative&&a.allowNegative,onChange:d,getInputRef:""!==a.refInput||void 0!==a.refInput?a.refInput:null,decimalScale:a.decimalScale}):"currency"===a.mask?(0,n.jsx)(o.HG,{className:a.className?a.className:a.isDisabled?"block w-full text-sm focus:outline-none dark:text-gray-300 form-input leading-5 cursor-not-allowed opacity-50 bg-gray-300 dark:bg-gray-800":"block w-full text-sm focus:outline-none dark:text-gray-300 form-input leading-5 focus:border-purple-400 dark:border-gray-600 focus:shadow-outline-purple dark:focus:border-gray-600 dark:focus:shadow-outline-gray dark:bg-gray-700",value:"number"===typeof a.value?a.value.toFixed(a.decimalScale):0,thousandSeparator:".",decimalSeparator:",",prefix:void 0!==a.prefix?a.prefix:"R$ ",placeholder:a.placeholder,onKeyDown:a.onKeyDown,onBlur:a.onBlur,required:a.isRequired,disabled:a.isDisabled,getInputRef:a.refInput,onChange:d,allowNegative:!!a.allowNegative&&a.allowNegative,decimalScale:a.decimalScale,style:a.style}):"text"===a.mask?(0,n.jsx)("span",{className:a.className,children:(0,n.jsx)(o.HG,{value:"number"===typeof a.value?a.value.toFixed(a.decimalScale):"0,00",className:"bg-white "+a.className,thousandSeparator:".",decimalSeparator:",",required:a.isRequired,prefix:a.prefix,placeholder:a.placeholder,onKeyDown:a.onKeyDown,disabled:a.isDisabled,onChange:d,style:a.style,decimalScale:a.decimalScale})}):"date"===a.mask?(0,n.jsx)(s(),{mask:"99/99/9999",type:a.type?a.type:"text",maskChar:null,placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled,children:e=>(0,n.jsx)(l.Input,{...e,type:a.type?a.type:"text",placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled})}):"phone"===a.mask?(0,n.jsx)(s(),{mask:"(99) 99999-9999",type:a.type?a.type:"text",maskChar:null,placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled,children:e=>(0,n.jsx)(l.Input,{...e,type:a.type?a.type:"text",placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled})}):"cep"===a.mask?(0,n.jsx)(s(),{mask:"99999-999",type:a.type?a.type:"text",maskChar:null,placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled,children:e=>(0,n.jsx)(l.Input,{...e,type:a.type?a.type:"text",placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled})}):"time"===a.mask?(0,n.jsx)(s(),{mask:"99:99",type:a.type?a.type:"text",maskChar:null,placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled,children:e=>(0,n.jsx)(l.Input,{...e,type:a.type?a.type:"text",placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled})}):(0,n.jsx)(s(),{mask:a.mask,type:a.type?a.type:"text",maskChar:null,placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled,children:e=>(0,n.jsx)(l.Input,{...e,name:a.inputName||a.name,id:a.id,onKeyDown:a.onKeyDown,type:a.type?a.type:"text",placeholder:a.placeholder,value:a.value?a.value:"",onChange:d,disabled:a.isDisabled})})}},82341:(e,a,t)=>{t.d(a,{A:()=>l});t(9950);var r=t(18743),s=t(44414);const l=function(e){let{isOpen:a,closeModal:t,titulo:l,children:o,onConfirm:n,style:i={maxHeight:"90vh",overflowY:"auto"},confirmText:d="Confirmar",hasCloseModal:c=!0,closeText:u="Fechar"}=e;return a?(0,s.jsxs)(r.Modal,{isOpen:a,onClose:t,style:i,children:[(0,s.jsx)(r.ModalHeader,{children:l}),(0,s.jsx)(r.ModalBody,{children:o}),c||n?(0,s.jsxs)(r.ModalFooter,{children:[c&&(0,s.jsx)(r.Button,{className:"w-full sm:w-auto",onClick:t,layout:"outline",children:u}),n&&(0,s.jsx)(r.Button,{className:"w-full sm:w-auto",onClick:n,children:d})]}):null]}):null}},73978:(e,a,t)=>{t.d(a,{A:()=>l});t(9950);var r=t(18743),s=t(44414);const l=function(e){let{isOpen:a,setIsOpen:t,onConfirm:l,titulo:o,mensagem:n}=e;function i(){t(!1)}return(0,s.jsxs)(r.Modal,{isOpen:a,onClose:i,children:[(0,s.jsx)(r.ModalHeader,{children:o}),(0,s.jsx)(r.ModalBody,{children:n}),(0,s.jsxs)(r.ModalFooter,{children:[(0,s.jsx)(r.Button,{className:"w-full sm:w-auto",layout:"outline",onClick:()=>i(),children:"Cancelar"}),(0,s.jsx)(r.Button,{className:"w-full sm:w-auto",onClick:()=>l(a),children:"Confirmar"})]})]})}},54986:(e,a,t)=>{t.d(a,{A:()=>l});t(9950);var r=t(93047),s=(t(18743),t(44414));const l=function(e){let{activePage:a,className:t=""}=e;return(0,s.jsx)("div",{className:"bg-purple-50 dark:bg-purple-900 dark:bg-opacity-30 rounded-lg p-2 mb-4 border border-purple-200 dark:border-purple-800 ".concat(t),children:(0,s.jsx)("div",{className:"flex flex-row flex-wrap",style:{gap:"8px"},children:[{to:"/app/account",label:"Conta",key:"account",icon:"bi-gear"},{to:"/app/faturas",label:"Faturas",key:"faturas",icon:"bi-receipt"},{to:"/app/extra-fields",label:"Campos extras",key:"extra-fields",icon:"bi-ui-checks-grid"},{to:"/app/webhooks",label:"Webhooks",key:"webhooks",icon:"bi-plug"},{to:"/app/messages",label:"Mensagens",key:"messages",icon:"bi-chat-dots"},{to:"/app/data-import",label:"Importar dados",key:"data-import",icon:"bi-file-earmark-arrow-up"},{to:"/app/parameters",label:"Par\xe2metros",key:"parameters",icon:"bi-sliders"},{to:"/app/tables",label:"Tabelas, tipos de pedido e etiquetas",key:"tables",icon:"bi-table"},{to:"/app/configuracao-pdf-pedido",label:"Configurar PDF do Pedido",key:"configuracao-pdf-pedido",icon:"bi-file-earmark-text"},{to:"/app/company",label:"Usu\xe1rios",key:"company",icon:"bi-people"}].map((e=>{const t=a===e.key;return(0,s.jsx)(r.N_,{to:e.to,children:(0,s.jsxs)("button",{className:"px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200 flex items-center ".concat(t?"bg-purple-600 text-white shadow-sm":"text-purple-700 dark:text-purple-300 hover:bg-purple-100 dar
1k:hover:bg-purple-800"),children:[e.icon&&(0,s.jsx)("i",{className:"".concat(e.icon," mr-2")}),e.label]})},e.key)}))})})}},30385:(e,a,t)=>{t.d(a,{A:()=>s});var r=t(12449);const s=function(e,a){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"success"===e?r.oR.success(a,{icon:t||"\ud83d\udc4f",theme:"colored",position:"bottom-center",autoClose:5e3,hideProgressBar:!0,closeOnClick:!0}):"error"===e?r.oR.error(a,{icon:t||"\ud83d\ude22",theme:"colored",position:"bottom-center",autoClose:5e3,hideProgressBar:!0,closeOnClick:!0}):"info"===e?r.oR.info(a,{icon:t||"\u2139\ufe0f",theme:"colored",position:"bottom-center",autoClose:5e3,hideProgressBar:!0,closeOnClick:!0}):"warning"===e?r.oR.warning(a,{icon:t||"\u26a0\ufe0f",theme:"colored",position:"bottom-center",autoClose:5e3,hideProgressBar:!0,closeOnClick:!0}):(0,r.oR)(a,{icon:t||"\ud83e\udd14",theme:"colored",position:"bottom-center",autoClose:5e3,hideProgressBar:!0,closeOnClick:!0})}},54812:(e,a,t)=>{t.r(a),t.d(a,{default:()=>ye});var r=t(9950),s=t(18743),l=t(65155),o=t(75266),n=t(73978);function i(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const d=r.forwardRef(i);function c(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const u=r.forwardRef(c);function m(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const p=r.forwardRef(m);function x(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const g=r.forwardRef(x);function h(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5
1h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const b=r.forwardRef(h);function f(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"}))}const v=r.forwardRef(f);function j(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const y=r.forwardRef(j);function k(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const w=r.forwardRef(k);function N(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const _=r.forwardRef(N);function C(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"}))}const A=r.forwardRef(C);var S=t(63075);function E(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"}))}const I=r.forwardRef(E);function L(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"}))}const M=r.forwardRef(L);function P(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.
1056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"}))}const B=r.forwardRef(P);function O(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.348 14.652a3.75 3.75 0 0 1 0-5.304m5.304 0a3.75 3.75 0 0 1 0 5.304m-7.425 2.121a6.75 6.75 0 0 1 0-9.546m9.546 0a6.75 6.75 0 0 1 0 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const D=r.forwardRef(O);function R(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const T=r.forwardRef(R);function F(e,a){let{title:t,titleId:s,...l}=e;return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":s},l),t?r.createElement("title",{id:s},t):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const z=r.forwardRef(F);var W=t(876),q=t(55966),Z=t(44414);const H=function(e){let{isOpen:a,setIsOpen:t,onConfirm:l,data:o,planoSelecionado:n,setPlanoSelecionado:i,confirmText:c,isLoading:m=!1}=e;const[x,h]=(0,r.useState)([]);function f(){t(!1)}(0,r.useEffect)((()=>{!async function(){try{const e=await(0,W.A)("get",{},"/plano/listar");e.data&&(i({id:o.plano.id_plano}),h(e.data))}catch(e){console.error(e)}}()}),[o]);const j=e=>{let{icon:a,label:t,value:r,enabled:s=!0}=e;const l=s?d:u,o=s?"text-green-500":"text-red-400";return(0,Z.jsxs)("div",{className:"flex items-start space-x-2 py-1",children:[(0,Z.jsx)(l,{className:"w-4 h-4 ".concat(o," flex-shrink-0 mt-0.5")}),(0,Z.jsx)("div",{className:"flex-1",children:(0,Z.jsxs)("p",{className:"text-xs text-gray-700 dark:text-gray-300",children:[t,": ",(0,Z.jsx)("span",{className:"font-semibold",children:r})]})})]})},k=()=>(0,Z.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3",children:x.map((e=>{const a=n.id===e.id,t=e.highlighted;return(0,Z.jsxs)(s.Label,{className:"\n relative flex flex-col p-4 rounded-xl shadow-lg cursor-pointer \n transition-all duration-200 hover:shadow-2xl hover:scale-105\n bg-white dark:bg-gray-800 border-2 border-gray-200 dark:border-gray-600\n ".concat(t&&!a?"ring-4 ring-purple-300 dark:ring-purple-600":"","\n "),children:[t&&(0,Z.jsx)("div",{className:"absolute",style:{top:"-10px",right:"-10px"},children:(0,Z.jsxs)(s.Badge,{type:"success",className:"flex items-center space-x-1 px-2 py-0.5 bg-gradient-to-r from-purple-600 to-purple-800 text-white rounded-full shadow-md",children:[(0,Z.jsx)(p,{className:"w-3 h-3 text-white"}),(0,Z.jsx)("span",{className:"text-white",children:"RECOMENDADO"})]})}),(0,Z.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,Z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Z.jsx)("input",{type:"radio",className:"form-radio h-4 w-4 text-purple-600",name:"plano",value:e.id,checked:a,onChange:a=>((e,a)=>{i(a)})(0,e)}),(0,Z.jsx)("div",{children:(0,Z.jsx)("h3",{className:"text-base font-bold text-gray-900 dark:text-white",children:e.nome_plano})})]})}),(0,Z.jsx)("p",{className:"text-xs mb-3 text-gray-600 dark:text-gray-400 flex-grow",children:e.descricao_plano}),(0,Z.jsx)("div",{className:"mb-3 pb-3 border-b border-gray-200 dark:border-gray-600",children:(0,Z.jsx)("div",{className:"flex items-baseline space-x-1",children:0===e.valor_plano_mensal?(0,Z.jsx)("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Gr\xe1tis"}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("span",{className:"text-2xl font-bold text-purple-600 dar
1k:text-purple-400",children:e.valor_plano_mensal_formatado}),(0,Z.jsx)("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"/m\xeas"})]})})}),(0,Z.jsxs)("div",{className:"space-y-1 flex-grow",children:[(0,Z.jsx)("div",{className:"mb-2",children:(0,Z.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide mb-1 text-gray-500 dark:text-gray-400",children:"Limites & Recursos"})}),(0,Z.jsx)(j,{icon:g,label:"Usu\xe1rios",value:e.limite_usuario}),(0,Z.jsx)(j,{icon:b,label:"Produtos",value:e.limite_produto}),(0,Z.jsx)(j,{icon:v,label:"Pedidos",value:"".concat(e.limite_pedido,"/m\xeas")}),(0,Z.jsx)(j,{icon:y,label:"Clientes",value:e.limite_cliente}),(0,Z.jsx)(j,{icon:w,label:"Site/Loja virtual",value:e.limite_loja_virtual}),(0,Z.jsx)(j,{icon:_,label:"Posts no blog",value:"".concat(e.limite_postagens_blog_loja," postagens")}),(0,Z.jsx)(j,{icon:A,label:"Requisi\xe7\xf5es IA",value:"".concat(e.limite_ia,"/m\xeas")}),(0,Z.jsx)("div",{className:"pt-2 mt-2 border-t border-gray-200 dark:border-gray-600",children:(0,Z.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide mb-1 text-gray-500 dark:text-gray-400",children:"Funcionalidades"})}),(0,Z.jsx)(j,{icon:S.A,label:"Consulta CNPJ",value:e.permite_consulta_cnpj?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_consulta_cnpj}),(0,Z.jsx)(j,{icon:_,label:"Cat\xe1logo PDF",value:e.permite_catalogo_pdf?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_catalogo_pdf}),(0,Z.jsx)(j,{icon:w,label:"Dom\xednio pr\xf3prio (N\xe3o inclui custo de registro, apenas permiss\xe3o para usar)",value:e.permite_dominio_proprio?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_dominio_proprio}),(0,Z.jsx)(j,{icon:I,label:"Campos extras",value:e.permite_campo_extra?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_campo_extra}),(0,Z.jsx)(j,{icon:g,label:"Empresas representadas",value:e.permite_representadas?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_representadas}),(0,Z.jsx)(j,{icon:_,label:"Customiza\xe7\xe3o PDF pedido",value:e.permite_customizar_pdf_pedido?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_customizar_pdf_pedido}),(0,Z.jsx)(j,{icon:y,label:"Operadores",value:e.permite_operadores?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_operadores}),(0,Z.jsx)(j,{icon:I,label:"Customiza\xe7\xe3o loja",value:e.permite_alterar_campos_loja?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_alterar_campos_loja}),(0,Z.jsx)(j,{icon:M,label:"Integra\xe7\xe3o API & Webhooks",value:e.permite_api?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_api}),(0,Z.jsx)(j,{icon:B,label:"MeuEcomm Connect (ASAAS, PrintNode, Frenet)",value:e.permite_connect?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_connect}),(0,Z.jsx)(j,{icon:D,label:"Ao Vivo (acompanhamento em tempo real)",value:e.permite_tempo_real?"Inclu\xeddo":"N\xe3o inclu\xeddo",enabled:e.permite_tempo_real})]})]},e.id)}))});return(0,Z.jsxs)(s.Modal,{isOpen:a,onClose:f,style:{maxWidth:"1400px",width:"100%"},children:[(0,Z.jsx)(s.ModalHeader,{className:"text-lg font-bold",children:(0,Z.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Z.jsx)(T,{className:"w-8 h-8 text-purple-600"}),(0,Z.jsx)("span",{children:"Escolha seu plano ideal"})]})}),(0,Z.jsxs)(s.ModalBody,{style:{maxHeight:"calc(100vh - 200px)",overflowY:"auto"},children:[(0,Z.jsx)("div",{className:"mb-6 p-4 bg-purple-50 dark:bg-purple-900 rounded-lg border-l-4 border-purple-600",children:(0,Z.jsxs)("p",{className:"text-center text-gray-700 dark:text-gray-200",children:[(0,Z.jsx)("span",{className:"font-semibold",children:"\u2728 Melhore sua experi\xeancia!"})," Selecione o plano ideal para o seu neg\xf3cio e desbloqueie recursos incr\xedveis. Ap\xf3s a confirma\xe7\xe3o do pagamento, os recursos ser\xe3o ",(0,Z.jsx)("span",{className:"font-bold text-purple-600 dark:text-purple-400",children:"ativados imediatamente"}),"."]})}),(0,Z.jsx)(k,{}),(0,Z.jsx)("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900 rounded-lg border-l-4 border-yellow-600",children:(0,Z.jsx)("p",{className:"text-center text-yellow-700 dark:text-yellow-300",children:"\u26a0\ufe0f Ap\xf3s alterar o plano, por favor, saia e entre novamente na plataforma e no aplicativo para que todas as funcionalidades sejam atualizadas corretamente."})}),(0,Z.jsx)("div",{className:"mt-4 p-6 bg-gray-50 dark:bg-gray-800 rounded-xl border-2 border-dashed border-gray-300 dark:border-gray-600",children:(0,Z.jsxs)("div",{className:"flex items-start space-x-4",children:[(0,Z.jsx)(z,{className:"w-8 h-8 text-purple-600 flex-shrink-0"}),(0,Z.jsxs)("div",{className:"flex-1",children:[(0,Z.jsx)("h4",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"Ainda tem d\xfavidas?"}),(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Nossa equipe est\xe1 pronta para ajudar voc\xea a escolher o melhor plano, oferecer um per\xedodo de experi\xeancia ou criar uma solu\xe7\xe3o personalizada para seu neg\xf3cio."}),(0,Z.jsxs)("a",{href:q.pz,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white font-medium rounded-lg transition-colors duration-200",children:[(0,Z.jsx)(z,{className:"w-5 h-5 mr-2"}),"Falar com o suporte"]})]})]})})]}),(0,Z.jsxs)(s.ModalFooter,{className:"flex justify-between items-center",children:[(0,Z.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:(0,Z.jsxs)("span",{className:"flex items-center space-x-1",children:[(0,Z.jsx)(d,{className:"w-4 h-4 text-green-500"}),(0,Z.jsx)("span",{children:"Ativa\xe7\xe3o imediata"})]})}),(0,Z.jsxs)("div",{className:"flex space-x-2",children:[(0,Z.jsx)(s.Button,{className:"w-full sm:w-auto",layout:"outline",onClick:()=>f(),children:"Cancelar"}),(0,Z.jsx)(s.Button,{className:"w-full sm:w-auto bg-gradient-to-r from-purple-600 to-purple-700 hover:from-purple-700 hover:to-purple-800",onClick:()=>l(a),disabled:m,children:c||"Confirmar altera\xe7\xe3o"})]})]})]})};var V=t(82341);const X=function(e){let{text:a,type:t}=e;return"success"===t?(0,Z.jsx)("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-2 mb-4 rounded relative",role:"alert",children:(0,Z.jsx)("span",{className:"block text-xs sm:inline",children:a})}):"error"===t?(0,Z.jsx)("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-2 mb-4 rounded relative",role:"alert",children:(0,Z.jsx)("span",{className:"block text-xs sm:inline",children:a})}):"warning"===t?(0,Z.jsx)("div",{className:"bg-yellow-100 border border-yellow-400 text-yellow-700 px-4 py-2 mb-4 rounded relative",role:"alert",children:(0,Z.jsx)("span",{className:"block text-xs sm:inline",children:a})}):(0,Z.jsx)("div",{className:"bg-blue-100 border border-blue-400 text-blue-700 px-4 py-2 mb-4 rounded relative",role:"alert",children:(0,Z.jsx)("span",{className:"block text-xs sm:inline",children:a})})};var K,G=t(28793),U=t(54986),J=t(16461),Y=t(41274),$=t(30385),Q=t(12449),ee=(t(47705),t(66495)),ae=t(19390),te=t(49058),re="basil",se="https://js.stripe.com",le="".concat(se,"/").concat(re,"/stripe.js"),oe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,ne=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,ie="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",de=function(e){var a=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(le).concat(a);var r=document.head||document.body;if(!r)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return r.appendChild(t),t},ce=null,ue=null,me=null,pe=function(e){return null!==ce?ce:(ce=new Promise((function(a,t){if("undefined"!==typeof window&&"undefined"!==typeof document)if(window.Stripe&&e&&console.warn(ie),window.Stripe)a(window.Stripe);else try{var r=function(){for(var e,a=document.querySelectorAll('script[src^="'.concat(se,'"]')),t=0;t<a.length;t++){var r=a[t];if(e=r.src,oe.test(e)||ne.test(e))return r}return null}();if(r&&e)console.warn(ie);else if(r){if(r&&null!==me&&null!==ue){var s;r.removeEventListener("load",me),r.removeEventListener("error",ue),null===(s=r.parentNode)||void 0===s||s.removeChild(r),r=de(e)}}else r=de(e);me=function(e,a){return function(){window.Stripe?e(window.Stripe):a(new Error("Stripe.js not available"))}}(a,t),ue=function(e){return function(a){e(new Error("Failed to load Stripe.js",{cause:a}))}}(t),r.addEventListener("load",me),r.addEventListener("error",ue)}catch(l){return void t(l)}else a(null)}))).catch((function(e){return ce=null,Promise.reject(e)}))}
1,xe=!1,ge=function(){return K||(K=pe(null).catch((function(e){return K=null,Promise.reject(e)})))};Promise.resolve().then((function(){return ge()})).catch((function(e){xe||console.warn(e)}));var he=function(){for(var e=arguments.length,a=new Array(e),t=0;t<e;t++)a[t]=arguments[t];xe=!0;var r=Date.now();return ge().then((function(e){return function(e,a,t){if(null===e)return null;var r=a[0].match(/^pk_test/),s=function(e){return 3===e?"v3":e}(e.version),l=re;r&&s!==l&&console.warn("Stripe.js@".concat(s," was loaded on the page, but @stripe/stripe-js@").concat("7.5.0"," expected Stripe.js@").concat(l,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var o=e.apply(void 0,a);return function(e,a){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"7.5.0",startTime:a})}(o,t),o}(e,a,r)}))},be=t(70347),fe=t(41397),ve=t.n(fe);function je(e){let{label:a,atual:t=0,limite:r,tooltipLimite:s}=e;const l=""===r||null===r||void 0===r,o=Number(r),n=Number(t)||0,i=!l&&o>0?n/o*100:0,d=Math.min(Math.max(i,0),100),c=!l&&o>0&&n>o,u=!c&&i>=80,m=e=>Number(e).toLocaleString("pt-BR"),p=c?"text-red-600 dark:text-red-400 font-medium":u?"text-yellow-600 dark:text-yellow-400 font-medium":"text-gray-700 dark:text-gray-300",x=c?"bg-red-600 bg-gradient-to-r from-red-500 to-red-600":u?"bg-yellow-500 bg-gradient-to-r from-yellow-400 to-yellow-500":"bg-purple-600 bg-gradient-to-r from-purple-500 to-purple-600";return(0,Z.jsxs)("div",{children:[(0,Z.jsxs)("div",{className:"flex flex-row justify-between items-center mb-2",children:[(0,Z.jsxs)("span",{className:"text-sm ".concat(p),children:[a,": ",(0,Z.jsx)("span",{className:"font-semibold",children:m(n)}),c?(0,Z.jsx)(G.A,{content:s,direction:"top",children:(0,Z.jsx)("i",{className:"bi bi-exclamation-circle text-xs text-red-500 ml-2"})}):null]}),l?(0,Z.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-medium text-purple-700 dark:text-purple-300 bg-purple-100 dark:bg-purple-900 rounded-full",children:[(0,Z.jsx)("i",{className:"bi bi-infinity mr-1"}),"Ilimitado"]}):(0,Z.jsxs)("span",{className:"text-sm font-medium tabular-nums ".concat(p),children:[Math.round(i),"%"]})]}),(0,Z.jsx)("div",{className:"h-2 w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:l?(0,Z.jsx)("div",{className:"h-full w-full rounded-full bg-purple-200 dark:bg-purple-800"}):(0,Z.jsx)("div",{className:"h-full rounded-full transition-all duration-500 ease-out ".concat(x),style:{width:"".concat(d,"%"),minWidth:d>0?"0.5rem":0}})}),(0,Z.jsxs)("div",{className:"flex flex-row justify-between mt-1.5",children:[(0,Z.jsx)("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:"0"}),(0,Z.jsx)("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:l?"\u221e":m(o)})]})]})}const ye=function(){var e,a,t;const{userData:i,companyId:d,updateUserData:c}=(0,r.useContext)(te.ContextData),[u,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)({status:!1,message:""}),[g,h]=(0,r.useState)({imagem:[]}),[b,f]=(0,r.useState)(!1),[v,j]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1),[w,N]=(0,r.useState)(""),_=(0,l.W6)(),C=(0,l.zy)(),[A,S]=(0,r.useState)({nome_responsavel:"",email_responsavel:"",telefone:"",logo:""}),[E,I]=(0,r.useState)({telefone:""}),[L,M]=(0,r.useState)(!1),[P,B]=(0,r.useState)(null),[O,D]=(0,r.useState)(!1),[R,T]=(0,r.useState)({}),[F,z]=(0,r.useState)(!1),[K,G]=(0,r.useState)(!1),[re,se]=(0,r.useState)(!1),[le,oe]=(0,r.useState)(!1),[ne,ie]=(0,r.useState)(!1),[de,ce]=(0,r.useState)(!1),[ue,me]=(0,r.useState)(!1),[pe,xe]=(0,r.useState)(!1),[ge,fe]=(0,r.useState)({open:!1,titulo:"",mensagem:""}),[ye,ke]=(0,r.useState)({open:!1}),[we,Ne]=(0,r.useState)(null),_e=(0,be.A)((e=>e.data)),[Ce,Ae]=(0,r.useState)({email_cobranca:"",plano:{id_plano:"",nome_plano:"",valor_contrato:"",data_cadastro_formatado:"",cancelar_conta_formatado:"",cancelar_conta:"",limites_atuais:{total_usuarios:"",total_produtos:"",total_pedidos:""},limite_usuario:"",limite_produto:"",limite_pedido:"",limite_ia:""}}),Se=he("pk_live_51R2GOKF1gafKIwTRuCW7Zk33IRzT9s9rSmpBSPfuCDSwxy0cnDtuTWFolQsYOtVl3HcB7GdkVOQSleD3SFNq1hOA006XrIxGDo"),{status:Ee,sessionId:Ie}=(0,l.g)(),Le="asaas"===((null===A||void 0===A||null===(e=A.plano)||void 0===e?void 0:e.origem_assinatura)||"");let Me={};i&&i.empresas&&i.empresas.map((e=>{e.id.toString()===d.toString()&&(Me=e)})),!1===(0,ae.A)("/app/account")&&_.push("/app/dashboard"),(0,r.useEffect)((()=>{ve().isEmpty(Ie)||"undefined"===Ie||"null"===Ie||(async()=>{try{if("pix-success"===Ee&&Ie)console.log("Ativando plano para pagamento PIX com sessionId:",Ie),(0,$.A)("info","Pagamento PIX recebido! Sua assinatura ser\xe1 atualizada em breve, isso pode levar alguns minutos. Agradecemos pela sua paci\xeancia.");else{const e=await(0,W.A)("POST",{session_id:Ie},"/plano/confirmar-sessao-stripe");"success"!==e.status?(console.error("Erro ao ativar plano:",e.data),(0,$.A)("error",e.data)):((0,$.A)("success",e.data),_.push("/app/account/success/"),Be())}}catch(e){console.error("Erro ao confirmar:",e),(0,$.A)("error","Erro ao ativar plano. Tente novamente mais tarde.")}})()}),[Ie]),(0,r.useEffect)((()=>{"1"===new URLSearchParams(C.search).get("plano")&&D(!0)}),[C.search]),(0,r.useEffect)((()=>{k(!0),Pe(),Be()}),[]);const Pe=async()=>{try{const e=await(0,W.A)("POST",{},"/empresa/token-api");"success"===e.status?(k(!1),N(e.data)):(k(!1),N(""))}catch(e){console.log(e),k(!1),N("")}},Be=async()=>{xe(!0);try{const e=await(0,W.A)("POST",{},"/empresa/responsavel");"success"===e.status?(console.log(e.data),S(e.data),I({telefone:e.data.telefone||""}),Ae({...Ce,email_cobranca:e.data.email_cobranca,plano:{id_plano:e.data.plano.id_plano,data_cadastro_formatado:e.data.plano.data_cadastro_formatado,nome_plano:e.data.plano.nome_plano,valor_contrato:e.data.plano.valor_contrato,plano_inicial:e.data.plano.plano_inicial,cancelar_conta_formatado:e.data.plano.cancelar_conta_formatado,cancelar_conta:e.data.plano.cancelar_conta,limites_atuais:e.data.plano.limites_atuais,limite_usuario:e.data.plano.limite_usuario,limite_produto:e.data.plano.limite_produto,limite_pedido:e.data.plano.limite_pedido,limite_ia:e.data.plano.limite_ia}})):console.log("Erro ao buscar respons\xe1vel")}catch(e){xe(!1),console.log(e)}finally{xe(!1)}},Oe=async()=>{G(!0);try{const e=await(0,W.A)("POST",{id_plano:R.id},"/plano/checkout-session");if(G(!1),"success"!==e.status)return void(0,$.A)("error",e.data);D(!1),(0,$.A)("success",e.data),_.push("/app/account"),Be()}catch(e){G(!1),console.error("Erro ao alterar plano:",e),(0,$.A)("error","Erro ao alterar plano. Tente novamente mais tarde.")}};return pe?(0,Z.jsx)(Y.A,{}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q.N9,{icon:!1}),(0,Z.jsx)(o.A,{children:"Dados da conta"}),(0,Z.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-300 mb-4",children:"Gerencie as informa\xe7\xf5es da sua conta, plano e token de API."}),""!==Ce.plano.cancelar_conta_formatado?(0,Z.jsx)(X,{text:"Uma solicita\xe7\xe3o de cancelamento de conta foi realizada, portanto, os dados ser\xe3o apagados no dia "+Ce.plano.cancelar_conta_formatado+". Caso deseje reativar a conta, altere seu plano.",type:"error",className:"mb-2"}):null,(0,Z.jsx)(U.A,{activePage:"account"}),"success"===Ee&&ve().isEmpty(Ie)?(0,Z.jsx)("div",{className:"w-full bg-green-500 text-white text-center p-4 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm",children:"Plano ativado com sucesso, as novas configura\xe7\xf5es entrar\xe3o em vigor imediatamente."})}
1):null,"success"!==Ee||ve().isEmpty(Ie)?null:(0,Z.jsx)("div",{className:"w-full bg-blue-500 text-white text-center p-4 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm",children:"Aguarde, estamos processando a altera\xe7\xe3o do seu plano..."})}),"cancel"===Ee&&ve().isEmpty(Ie)?(0,Z.jsx)("div",{className:"w-full bg-red-500 text-white text-center p-4 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm",children:"A altera\xe7\xe3o do plano foi cancelada, voc\xea pode tentar novamente quando desejar."})}):null,"pix-success"===Ee?(0,Z.jsx)("div",{className:"w-full bg-green-500 text-white text-center p-4 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm",children:"Pagamento PIX recebido com sucesso! Sua fatura foi atualizada."})}):null,1===(null===A||void 0===A||null===(a=A.plano)||void 0===a?void 0:a.cancelar_assinatura)?(()=>{var e;return(0,Z.jsxs)("div",{className:"w-full bg-red-500 text-white text-center p-4 rounded font-semibold mb-2",children:[(0,Z.jsx)("p",{className:"text-sm",children:"A assinatura atual foi cancelada, voc\xea n\xe3o ser\xe1 mais cobrado e poder\xe1 continuar utilizando o plano atual at\xe9 o final do per\xedodo."}),(0,Z.jsxs)("h2",{className:"text-sm font-semibold mt-2",children:["Seu plano ficar\xe1 ativo at\xe9 o dia ",null===A||void 0===A||null===(e=A.plano)||void 0===e?void 0:e.data_cancelar_assinatura_formatada,", voc\xea pode reverter o cancelamento at\xe9 essa data."]})]})})():null,_e.faturas_vencidas&&_e.faturas_vencidas.length>0&&(0,Z.jsx)("div",{className:"bg-red-50 dark:bg-red-900 border-l-4 border-red-500 dark:border-red-600 p-4 mb-6 rounded-lg shadow-sm",children:(0,Z.jsxs)("div",{className:"flex items-start",children:[(0,Z.jsx)("div",{className:"flex-shrink-0",children:(0,Z.jsx)("svg",{className:"h-6 w-6 text-red-500 dark:text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Z.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,Z.jsxs)("div",{className:"ml-3 flex-1",children:[(0,Z.jsxs)("h3",{className:"text-sm font-semibold text-red-800 dark:text-red-200 mb-2",children:["\u26a0\ufe0f Voc\xea possui ",_e.faturas_vencidas.length," fatura",_e.faturas_vencidas.length>1?"s":""," vencida",_e.faturas_vencidas.length>1?"s":""]}),(0,Z.jsxs)("div",{className:"space-y-2",children:[_e.faturas_vencidas.slice(0,3).map(((e,a)=>(0,Z.jsxs)("div",{className:"text-xs text-red-700 dark:text-red-300 bg-white dark:bg-red-800 p-2 rounded",children:[(0,Z.jsxs)("div",{className:"flex justify-between items-center",children:[(0,Z.jsx)("span",{className:"font-medium",children:e.codigo_fatura}),(0,Z.jsx)("span",{className:"font-bold",children:e.valor_fatura})]}),(0,Z.jsxs)("div",{className:"flex justify-between items-center mt-1 text-red-600 dark:text-red-400",children:[(0,Z.jsxs)("span",{children:["Vencimento: ",e.data_vencimento]}),(0,Z.jsxs)("span",{className:"font-semibold",children:[e.dias_atraso," dia",e.dias_atraso>1?"s":""," de atraso"]})]})]},a))),_e.faturas_vencidas.length>3&&(0,Z.jsxs)("p",{className:"text-xs text-red-600 dark:text-red-400 mt-2",children:["E mais ",_e.faturas_vencidas.length-3," fatura",_e.faturas_vencidas.length-3>1?"s":"","..."]})]}),(0,Z.jsxs)("button",{onClick:()=>_.push("/app/faturas"),className:"mt-3 inline-flex items-center px-3 py-1.5 text-xs font-medium text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors",children:[(0,Z.jsx)("i",{className:"bi bi-receipt mr-2"}),"Ver e pagar faturas"]})]})]})}),(0,Z.jsxs)("div",{className:"grid mb-2 gap-6 md:grid-cols-2 xl:grid-cols-2",children:[(0,Z.jsxs)("div",{className:"px-4 py-3 mb-4 bg-white rounded-lg shadow-md dark:bg-gray-800",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-600 dark:text-gray-300 mb-4",children:"Dados gerais"}),(0,Z.jsxs)("div",{className:"grid mb-4 gap-6",children:[(0,Z.jsxs)("div",{className:"flex flex-col items-center p-4 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:[(0,Z.jsx)("div",{className:"mb-4",children:P?(0,Z.jsx)("img",{src:P,alt:"Preview logo",className:"w-32 h-32 object-contain rounded-lg border border-gray-200 dark:border-gray-600"}):null!==A.logo&&""!==A.logo?(0,Z.jsx)("img",{src:A.logo,alt:"Logo da empresa",className:"w-32 h-32 object-contain rounded-lg border border-gray-200 dark:border-gray-600"}):(0,Z.jsx)("div",{className:"w-32 h-32 flex items-center justify-center bg-gray-200 dark:bg-gray-600 rounded-lg",children:(0,Z.jsx)("i",{className:"bi bi-image text-4xl text-gray-400 dark:text-gray-500"})})}),(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3 text-center",children:P?"Nova imagem selecionada":"Clique para selecionar"}),(0,Z.jsxs)("div",{className:"flex flex-wrap gap-2 justify-center",children:[(0,Z.jsxs)("label",{className:"cursor-pointer",children:[(0,Z.jsx)(s.Input,{type:"file",name:"imagem",id:"imagem",onCh
1ange:e=>{if("file"===e.target.type){const a=e.target.files[0];if(a){h({...g,imagem:[a]});const e=new FileReader;e.onloadend=()=>{B(e.result)},e.readAsDataURL(a)}}else h({...g,[e.target.name]:e.target.value})},accept:"image/*",className:"hidden"}),(0,Z.jsxs)("span",{className:"inline-flex items-center px-4 py-2 text-sm font-medium text-purple-600 bg-purple-100 dark:bg-purple-900 dark:text-purple-300 rounded-lg hover:bg-purple-200 dark:hover:bg-purple-800 transition-colors",children:[(0,Z.jsx)("i",{className:"bi bi-upload mr-2"}),"Selecionar imagem"]})]}),g.imagem.length>0&&(0,Z.jsxs)(s.Button,{onClick:()=>(async()=>{m(!0);let e=new FormData;e.append("imagem",g.imagem[0]);try{x({status:!0,message:"Salvando imagem..."});let a={"Content-Type":"multipart/form-data",Accept:"multipart/form-data",boundary:"----WebKitFormBoundary7MA4YWxkTrZu0gW"};const t=await(0,W.A)("post",e,"/empresa/cadastro-logo",a);if("success"===t.status){m(!1),x({status:!0,message:t.data}),B(null),h({imagem:[]}),Be(),(0,$.A)("success","Logo atualizado com sucesso!");const e=JSON.parse(localStorage.getItem("userData"));if(e&&e.empresas){const a=e.empresas.map((e=>e.id.toString()===d.toString()?{...e,logo:t.logo}:e));localStorage.setItem("userData",JSON.stringify({...e,empresas:a})),c&&c()}}else m(!1),x({status:!1,message:t.data})}catch(a){console.log(a),m(!1),x({status:!1,message:"Erro ao salvar registro!"})}})(),size:"small",disabled:u,children:[(0,Z.jsx)("i",{className:"bi bi-check-lg mr-1"}),u?"Salvando...":"Salvar logo"]}),null!==A.logo&&""!==A.logo&&0===g.imagem.length&&(0,Z.jsxs)(s.Button,{layout:"outline",size:"small",onClick:()=>(async()=>{m(!0);try{x({status:!0,message:"Removendo logo..."});const e=await(0,W.A)("delete",{},"/empresa/excluir-logo");if("success"===e.status){S({...A,logo:""});const a=JSON.parse(localStorage.getItem("userData"));if(a&&a.empresas){const e=a.empresas.map((e=>e.id.toString()===d.toString()?{...e,logo:""}:e));localStorage.setItem("userData",JSON.stringify({...a,empresas:e})),c&&c()}m(!1),x({status:!0,message:e.data})}else m(!1),x({status:!1,message:e.data})}catch(e){console.log(e),m(!1),x({status:!1,message:"Erro ao remover logo!"})}})(),disabled:u,children:[(0,Z.jsx)("i",{className:"bi bi-trash mr-1"}),"Remover"]}),P&&(0,Z.jsx)(s.Button,{layout:"link",size:"small",onClick:()=>{B(null),h({imagem:[]})},children:"Cancelar"})]})]}),(0,Z.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Raz\xe3o social"}),(0,Z.jsx)(s.Input,{type:"text",value:Me.razao_social||"",disabled:!0,className:"bg-gray-100 dark:bg-gray-700"})]}),(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Documento"}),(0,Z.jsx)(s.Input,{type:"text",value:Me.documento||"",disabled:!0,className:"bg-gray-100 dark:bg-gray-700"})]})]}),(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Nome fantasia"}),(0,Z.jsx)(s.Input,{type:"text",value:Me.nome_fantasia||"",disabled:!0,className:"bg-gray-100 dark:bg-gray-700"})]}),(0,Z.jsx)("div",{className:"flex flex-row items-center justify-between mt-4 mb-2",children:(0,Z.jsxs)("div",{className:"grid md:grid-cols-3 gap-4 w-full",children:[(0,Z.jsxs)(s.Label,{className:"col-span-2",children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Telefone"}),(0,Z.jsx)(J.A,{mask:"phone",value:E.telefone,inputName:"telefone",setData:I,placeholder:"(00) 00000-0000"})]}),(0,Z.jsx)(s.Button,{onClick:()=>(async()=>{M(!0);try{const e=await(0,W.A)("POST",{telefone:E.telefone},"/empresa/atualizar-dados-empresa");"success"===e.status?((0,$.A)("success","Dados atualizados com sucesso!"),M(!1)):((0,$.A)("error",e.data||"Erro ao salvar dados!"),M(!1))}catch(e){console.log(e),M(!1),(0,$.A)("error","Erro ao salvar dados!")}})(),disabled:L,className:"ml-4 mt-5",children:L?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Salvando..."]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("i",{className:"bi bi-check-lg mr-2"}),"Salvar telefone"]})})]})}),(0,Z.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Respons\xe1vel"}),(0,Z.jsx)(s.Input,{type:"text",value:A.nome_responsavel||"",disabled:!0,className:"bg-gray-100 dark:bg-gray-700"})]}),(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"E-mail do respons\xe1vel"}),(0,Z.jsx)(s.Input,{type:"text",value:A.email_responsavel||"",disabled:!0,className:"bg-gray-100 dark:bg-gray-700"})]})]})]}),!0===p.status?(0,Z.jsx)("div",{className:"dark:text-white text-green-600 text-xs",children:p.message}):(0,Z.jsx)("div",{className:"dark:text-white text-red-600 text-xs",children:p.message})]}),(0,Z.jsxs)("div",{className:"",children:[(0,Z.jsxs)("div",{className:"px-4 py-3 mb-4 bg-white rounded-lg shadow-md dark:bg-gray-800",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-600 dark:text-gray-300 mb-4",children:"Meu plano"}),(0,Z.jsxs)("div",{className:"grid gap-6",children:[(0,Z.jsxs)("div",{className:"flex flex-row justify-between items-center",children:[(0,Z.jsxs)("div",{className:"flex flex-col",children:[(0,Z.jsx)("h1",{className:"text-2xl font-semibold text-gray-800 dark:text-gray-200",children:Ce.plano.nome_plano}),(0,Z.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Data ades\xe3o: ",Ce.plano.data_cadastro_formatado]}),Le&&(0,Z.jsxs)("span",{className:"inline-flex items-center w-max mt-1 px-2 py-0.5 text-xs font-medium text-purple-700 dark:text-purple-300 bg-purple-100 dar
1k:bg-purple-900 rounded-full",children:[(0,Z.jsx)("i",{className:"bi bi-qr-code mr-1"}),"Cobran\xe7a via PIX/Boleto"]})]}),(0,Z.jsx)("h1",{className:"text-3xl font-semibold text-gray-800 dark:text-gray-200",children:Ce.plano.valor_contrato})]}),(0,Z.jsxs)("div",{className:"flex flex-col mt-2",children:[(0,Z.jsx)("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"E-mail para assuntos financeiros"}),(0,Z.jsxs)("div",{className:"flex flex-row justify-between items-center space-x-2",children:[(0,Z.jsx)(s.Input,{type:"text",value:Ce.email_cobranca,onChange:e=>Ae({...Ce,email_cobranca:e.target.value})}),(0,Z.jsx)(s.Button,{onClick:()=>(async()=>{me(!0);try{const e=await(0,W.A)("POST",{email_cobranca:Ce.email_cobranca},"/plano/salvar-email-cobranca");"success"===e.status?(me(!1),(0,$.A)("success","E-mail de cobran\xe7a salvo com sucesso!"),Be()):(me(!1),(0,$.A)("error",e.data))}catch(e){console.log(e),me(!1),(0,$.A)("error","Erro ao salvar e-mail de cobran\xe7a!")}})(),disabled:ue,children:ue?"Salvando...":"Salvar"})]}),(0,Z.jsx)("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Este e-mail ser\xe1 utilizado para tratar assuntos relacionados a cobran\xe7a, como envio de faturas e notifica\xe7\xf5es."})]}),(0,Z.jsx)(je,{label:"Total de usu\xe1rios",atual:Ce.plano.limites_atuais.total_usuarios,limite:Ce.plano.limite_usuario,tooltipLimite:"Limite de usu\xe1rios atingido"}),(0,Z.jsx)(je,{label:"Total de produtos",atual:Ce.plano.limites_atuais.total_produtos,limite:Ce.plano.limite_produto,tooltipLimite:"Limite de produtos atingido"}),(0,Z.jsx)(je,{label:"Total de pedidos no m\xeas",atual:Ce.plano.limites_atuais.total_pedidos,limite:Ce.plano.limite_pedido,tooltipLimite:"Limite de pedidos atingido"}),(0,Z.jsx)(je,{label:"Requisi\xe7\xf5es feitas para a IA",atual:Ce.plano.limites_atuais.total_ia,limite:Ce.plano.limite_ia,tooltipLimite:"Limite de requisi\xe7\xf5es IA atingido"}),F?(0,Z.jsx)("div",{className:"dark:text-white text-green-600 text-xs",children:"Realizando opera\xe7\xe3o, aguarde..."}):null,Le&&(0,Z.jsxs)("div",{className:"text-xs text-gray-600 dark:text-gray-300 bg-purple-50 dark:bg-purple-900 dark:bg-opacity-30 border border-purple-200 dark:border-purple-800 rounded-lg p-3",children:[(0,Z.jsx)("i",{className:"bi bi-info-circle mr-1"}),"Sua assinatura \xe9 cobrada via ",(0,Z.jsx)("strong",{children:"PIX/Boleto"}),". A cobran\xe7a mensal \xe9 gerada automaticamente \u2014 pague suas faturas na tela de ",(0,Z.jsx)("button",{onClick:()=>_.push("/app/faturas"),className:"text-purple-700 dark:text-purple-300 font-medium hover:underline",children:"Faturas"}),"."]}),(0,Z.jsxs)("div",{className:"flex flex-row flex-wrap justify-left gap-2",children:[(0,Z.jsx)(s.Button,{onClick:()=>D(!0),disabled:F,children:"Alterar plano"}),1!==Ce.plano.plano_inicial?Le?(0,Z.jsx)(s.Button,{onClick:()=>fe({open:!0,titulo:"Cancelamento \u2014 cobran\xe7a via PIX/Boleto",mensagem:"Sua assinatura \xe9 cobrada via PIX/Boleto (ASAAS). Para cancelar, fale com o nosso suporte. Lembre-se: o acesso n\xe3o \xe9 suspenso automaticamente por falta de pagamento."}),disabled:F,children:"Cancelar assinatura"}):0===(null===A||void 0===A||null===(t=A.plano)||void 0===t?void 0:t.cancelar_assinatura)?(0,Z.jsx)(s.Button,{onClick:()=>se(!0),disabled:F,children:"Cancelar assinatura"}):(0,Z.jsx)(s.Button,{onClick:()=>ie(!0),disabled:F,children:"Reverter cancelamento"}):null,(0,Z.jsxs)(s.Button,{layout:"outline",onClick:()=>_.push("/app/faturas"),disabled:F,children:[(0,Z.jsx)("i",{className:"bi bi-receipt mr-2"}),"Ver faturas"]}),""!==Ce.plano.cancelar_conta_formatado?(0,Z.jsx)(s.Button,{layout:"outline",disabled:!0,children:"Em processo de cancelamento"}):(0,Z.jsx)(s.Button,{layout:"outline",onClick:()=>j(!0),disabled:F,children:"Excluir conta"})]})]})]}),""!==w?(0,Z.jsxs)("div",{className:"px-4 py-3 mb-4 bg-white rounded-lg shadow-md dark:bg-gray-800",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-600 dark:text-gray-300",children:"Integra\xe7\xe3o"}),(0,Z.jsxs)("p",{className:"text-xs text-gray-600 dark:text-gray-300 mb-4",children:["Para utilizar a API do MeuEcomm, utilize o token abaixo, caso voc\xea possuir d\xfavidas, consulte a nossa ",(0,Z.jsx)("a",{href:q._l,target:"_blank",rel:"noreferrer",className:"text-blue-600 dar
1k:text-blue-400",children:"documenta\xe7\xe3o"}),"."]}),(0,Z.jsxs)("div",{className:"grid gap-6",children:[(0,Z.jsxs)(s.Label,{children:[(0,Z.jsx)("span",{children:"Token da API"}),(0,Z.jsx)(s.Input,{type:"text",value:w.substring(0,5)+"**************************************************",disabled:!0})]}),(0,Z.jsxs)("div",{className:"flex flex-row justify-left",children:[(0,Z.jsxs)(s.Button,{onClick:()=>(navigator.clipboard.writeText(w),void(0,$.A)("success","Token copiado para a \xe1rea de transfer\xeancia!")),className:"mt-2 mr-2",disabled:y,children:[(0,Z.jsx)(ee.DocumentDuplicate,{className:"w-5 h-5 cursor-pointer mr-2","aria-hidden":"true"}),"Copiar token"]}),(0,Z.jsx)(s.Button,{onClick:()=>f(!0),className:"mt-2",disabled:y,children:"Gerar novo token"})]})]})]}):(0,Z.jsxs)("div",{className:"px-4 py-3 mb-4 bg-white rounded-lg shadow-md dark:bg-gray-800",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-600 dark:text-gray-300",children:"Integra\xe7\xe3o"}),(0,Z.jsx)("p",{className:"text-xs text-gray-600 dark:text-gray-300 mb-4",children:"A API do MeuEcomm n\xe3o est\xe1 dispon\xedvel no seu plano atual, para utilizar a API, altere o seu plano para um que possua essa funcionalidade."}),(0,Z.jsx)(s.Button,{onClick:()=>D(!0),className:"mt-2",disabled:F,children:"Alterar plano"})]})]})]}),(0,Z.jsx)(n.A,{isOpen:b,setIsOpen:f,onConfirm:async()=>{k(!0);const e=await(0,W.A)("POST",{},"/empresa/gerar-token-api");"success"===e.status?((0,$.A)("success","Token gerado com sucesso!"),k(!1),N(e.data),f(!1)):((0,$.A)("error","Erro ao gerar token!"),k(!1),f(!1),N(""))},titulo:"Gerar novo token de API",mensagem:"Deseja gerar um novo token de API? Caso voc\xea j\xe1 tenha uma integra\xe7\xe3o ativa, ser\xe1 necess\xe1rio atualizar o token na mesma. Deseja continuar?"}),(0,Z.jsx)(n.A,{isOpen:v,setIsOpen:j,onConfirm:async()=>{z(!0),j(!1);try{const e=await(0,W.A)("POST",{},"/plano/cancelar-conta");"success"===e.status?((0,$.A)("success",e.data),Be(),z(!1)):((0,$.A)("error",e.data),z(!1))}catch(e){z(!1),console.log(e),(0,$.A)("error","Erro ao cancelar plano!")}},titulo:"Deseja realmente cancelar a conta?",mensagem:"Ao cancelar a conta, seus dados ser\xe3o apagados em 7 dias e n\xe3o ser\xe1 poss\xedvel recuper\xe1-los, antes disso, voc\xea pode reativar a conta. Deseja continuar?"}),(0,Z.jsx)(H,{isOpen:O,setIsOpen:D,onClose:()=>D(!1),onConfirm:async()=>{R&&R.id?1!==R.plano_inicial?(D(!1),ke({open:!0})):await Oe():(0,$.A)("error","Selecione um plano.")},data:Ce,planoSelecionado:R,confirmText:K?"Aguarde...":"Alterar plano",isLoading:K,setPlanoSelecionado:T}),(0,Z.jsx)(V.A,{titulo:"Cancelar assinatura",isOpen:re,closeModal:()=>se(!1),onConfirm:()=>le?null:(async()=>{oe(!0);try{const e=await(0,W.A)("POST",{},"/plano/cancelar-assinatura");"success"===e.status?((0,$.A)("success",e.data),Be(),oe(!1),se(!1)):((0,$.A)("error",e.data),oe(!1))}catch(e){oe(!1),console.log(e),(0,$.A)("error","Erro ao cancelar assinatura!")}})(),confirmText:le?"Aguarde...":"Cancelar assinatura",children:(0,Z.jsx)("div",{className:"",children:le?(0,Z.jsxs)("div",{className:"p-4 bg-gray-100 dark:bg-gray-700 rounded-lg shadow-md text-center",children:[(0,Z.jsx)("div",{className:"flex justify-center mb-2",children:(0,Z.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"})}),(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Aguarde, estamos processando o cancelamento da assinatura..."})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Voc\xea tem certeza que deseja cancelar a assinatura? Ao cancelar sua asssinatura, voc\xea perder\xe1 o acesso aos recursos do plano contratado."}),(0,Z.jsx)("div",{className:"bg-red-500 text-white text-left p-2 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm text-white",children:"Lembre-se que ao cancelar a assinatura, recursos do plano contratado ser\xe3o desativados, podendo impactar na usabilidade do sistema."})})]})})}),(0,Z.jsx)(V.A,{titulo:"Reverter cancelamento da assinatura",isOpen:ne,closeModal:()=>ie(!1),onConfirm:()=>de?null:(async()=>{ce(!0);try{const e=await(0,W.A)("POST",{},"/plano/reverter-cancelamento-assinatura");"success"===e.status?((0,$.A)("success",e.data),Be(),ce(!1),ie(!1)):((0,$.A)("error",e.data),ce(!1))}catch(e){ce(!1),console.log(e),(0,$.A)("error","Erro ao reverter cancelamento da assinatura!")}})(),confirmText:de?"Aguarde...":"Reverter cancelamento",children:(0,Z.jsx)("div",{className:"",children:de?(0,Z.jsxs)("div",{className:"p-4 bg-gray-100 dark:bg-gray-700 rounded-lg shadow-md text-center",children:[(0,Z.jsx)("div",{className:"flex justify-center mb-2",children:(0,Z.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-purple-600"})}),(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Aguarde, estamos processando a revers\xe3o do cancelamento da assinatura..."})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-4",children:"Voc\xea tem certeza que deseja reverter o cancelamento da assinatura? Ao reverter o cancelamento, voc\xea ter\xe1 acesso novamente aos recursos do plano contratado."}),(0,Z.jsx)("div",{className:"bg-green-500 text-white text-left p-2 rounded font-semibold mb-2",children:(0,Z.jsx)("p",{className:"text-sm text-white",children:"As cobran\xe7as continuar\xe3o normalmente e voc\xea poder\xe1 utilizar todos os recursos do plano contratado."})})]})})}),(0,Z.jsx)(V.A,{titulo:ge.titulo,isOpen:ge.open,closeModal:()=>
1fe({...ge,open:!1}),hasCloseModal:!0,closeText:"Fechar",children:(0,Z.jsxs)("div",{className:"space-y-4",children:[(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:ge.mensagem}),(0,Z.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Z.jsxs)("a",{href:q.pz,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-white bg-purple-600 hover:bg-purple-700 rounded-lg transition-colors",children:[(0,Z.jsx)("i",{className:"bi bi-headset mr-2"}),"Falar com o suporte"]}),(0,Z.jsxs)(s.Button,{layout:"outline",onClick:()=>{fe({...ge,open:!1}),_.push("/app/faturas")},children:[(0,Z.jsx)("i",{className:"bi bi-receipt mr-2"}),"Ver minhas faturas"]})]})]})}),(0,Z.jsx)(V.A,{titulo:"Como voc\xea quer pagar?",isOpen:ye.open,closeModal:()=>{we||ke({open:!1})},hasCloseModal:!0,closeText:"Cancelar",children:(0,Z.jsxs)("div",{className:"space-y-4",children:[R&&R.nome_plano?(0,Z.jsxs)("div",{className:"text-center bg-gray-50 dark:bg-gray-700 rounded-lg p-3",children:[(0,Z.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Plano selecionado"}),(0,Z.jsx)("p",{className:"text-lg font-semibold text-gray-800 dark:text-gray-200",children:R.nome_plano}),R.valor_plano_mensal_formatado?(0,Z.jsxs)("p",{className:"text-sm text-purple-600 dark:text-purple-400 font-medium",children:[R.valor_plano_mensal_formatado,"/m\xeas"]}):null]}):null,(0,Z.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Escolha a forma de pagamento da sua assinatura mensal:"}),(0,Z.jsxs)("button",{onClick:()=>(async()=>{Ne("cartao");try{const e=await(0,W.A)("POST",{id_plano:R.id},"/plano/checkout-session");if("success"!==e.status)return(0,$.A)("error",e.data),void Ne(null);const a=await Se;await a.redirectToCheckout({sessionId:e.data.sessionId})}catch(e){Ne(null),console.error("Erro no checkout:",e),(0,$.A)("error","Erro ao iniciar o checkout. Tente novamente mais tarde.")}})(),disabled:!!we,className:"w-full flex items-center text-left p-4 border-2 border-gray-200 dark:border-gray-600 rounded-xl hover:border-purple-500 dark:hover:border-purple-400 transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,Z.jsx)("div",{className:"flex-shrink-0 w-12 h-12 flex items-center justify-center rounded-full bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-300 mr-4",children:(0,Z.jsx)("i",{className:"bi bi-credit-card-2-front text-xl"})}),(0,Z.jsxs)("div",{className:"flex-1",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-800 dark:text-gray-200",children:"Cart\xe3o de cr\xe9dito"}),(0,Z.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Ativa\xe7\xe3o imediata. Cobran\xe7a recorrente autom\xe1tica no seu cart\xe3o."})]}),"cartao"===we?(0,Z.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-purple-600 ml-2"}):(0,Z.jsx)("i",{className:"bi bi-chevron-right text-gray-400 ml-2"})]}),(0,Z.jsxs)("button",{onClick:()=>(async()=>{Ne("asaas");try{const e=await(0,W.A)("POST",{id_plano:R.id},"/plano/assinar-asaas");if(Ne(null),"success"!==e.status)return void(0,$.A)("error",e.data||"Erro ao ativar a cobran\xe7a PIX/Boleto.");ke({open:!1}),(0,$.A)("success","string"===typeof e.data?e.data:"Assinatura via PIX/Boleto ativada! Pague sua primeira fatura agora."),Be();const a=e.id_fatura||e.data&&e.data.id_fatura||null;a?_.push("/app/faturas",{pagarFaturaId:a}):_.push("/app/faturas")}catch(e){Ne(null),console.error("Erro ao assinar via ASAAS:",e),(0,$.A)("error","Erro ao ativar a cobran\xe7a PIX/Boleto. Tente novamente mais tarde.")}})(),disabled:!!we,className:"w-full flex items-center text-left p-4 border-2 border-gray-200 dark:border-gray-600 rounded-xl hover:border-purple-500 dark:hover:border-purple-400 transition-colors disabled:opacity-60 disabled:cursor-not-allowed",children:[(0,Z.jsx)("div",{className:"flex-shrink-0 w-12 h-12 flex items-center justify-center rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-300 mr-4",children:(0,Z.jsx)("i",{className:"bi bi-qr-code text-xl"})}),(0,Z.jsxs)("div",{className:"flex-1",children:[(0,Z.jsx)("p",{className:"font-semibold text-gray-800 dark:text-gray-200",children:"PIX ou Boleto"}),(0,Z.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Voc\xea recebe a fatura mensal para pagar via PIX ou boleto. Confirma\xe7\xe3o autom\xe1tica."})]}
1),"asaas"===we?(0,Z.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-green-600 ml-2"}):(0,Z.jsx)("i",{className:"bi bi-chevron-right text-gray-400 ml-2"})]}),(0,Z.jsx)("p",{className:"text-xs text-gray-400 dark:text-gray-500 text-center",children:"Voc\xea poder\xe1 trocar a forma de pagamento depois, alterando o plano novamente."})]})})]})}}}]);
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.