tempest-react-sdk 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -22
- package/dist/index.d.ts +91 -0
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +3 -3
- package/dist/tempest-react-sdk.cjs.map +1 -1
- package/dist/tempest-react-sdk.js +1073 -991
- package/dist/tempest-react-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),me=require("react-dom"),_e=require("@tanstack/react-query"),tt=require("zustand"),be=require("zustand/middleware"),nt=require("dexie"),rt=require("react-hook-form");function b(...e){const t=[];for(const n of e)if(!(n==null||n===!1||n===!0)){if(typeof n=="string")n&&t.push(n);else if(typeof n=="number"||typeof n=="bigint")t.push(String(n));else if(Array.isArray(n)){const r=b(...n);r&&t.push(r)}}return t.join(" ")}const st="tempest_avatar_3xMuZ",ot="tempest_image_ieqGp",it="tempest_xs_oSaLL",at="tempest_sm_sZ2bk",ct="tempest_md_Fdkbz",lt="tempest_lg_pTTUA",ut="tempest_xl_mW58F",dt="tempest_status_ISBnL",ft="tempest_dot_Wgfo-",pt="tempest_online_-aWoW",mt="tempest_offline_-StX3",ht="tempest_busy_TbwuF",J={avatar:st,image:ot,xs:it,sm:at,md:ct,lg:lt,xl:ut,status:dt,dot:ft,online:pt,offline:mt,busy:ht};function gt(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function yt({src:e,alt:t,name:n="",size:r="md",status:s,className:o,onClick:i}){const[l,c]=u.useState(!1),d=u.useMemo(()=>gt(n),[n]),f=e&&!l,p=i?"button":void 0,m=i?0:void 0;return a.jsxs("span",{className:b(J.avatar,J[r],s&&J.status,o),role:p,tabIndex:m,onClick:i,onKeyDown:i?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i())}:void 0,children:[f?a.jsx("img",{src:e,alt:t??n,className:J.image,onError:()=>c(!0)}):a.jsx("span",{"aria-label":t??n,children:d}),s&&a.jsx("span",{className:b(J.dot,J[s]),"aria-hidden":!0})]})}const _t="tempest_badge_RsuMz",bt="tempest_neutral_lulSm",wt="tempest_success_u9JiS",vt="tempest_warning_nsGp-",xt="tempest_danger_PD2hz",jt="tempest_info_na6DQ",we={badge:_t,neutral:bt,success:wt,warning:vt,danger:xt,info:jt};function St({variant:e="neutral",className:t,children:n,...r}){return a.jsx("span",{className:b(we.badge,we[e],t),...r,children:n})}const kt="tempest_nav_H4g6P",Et="tempest_item_O4g3P",Nt="tempest_link_7WM67",Ct="tempest_current_JdlcS",$t="tempest_separator_zGWyJ",K={nav:kt,item:Et,link:Nt,current:Ct,separator:$t};function Tt({items:e,separator:t="/",className:n}){return a.jsx("nav",{"aria-label":"breadcrumb",className:b(K.nav,n),children:e.map((r,s)=>{const o=s===e.length-1,i=!o&&(r.href||r.onClick);return a.jsxs(u.Fragment,{children:[a.jsx("span",{className:K.item,children:i?a.jsx("a",{href:r.href,onClick:l=>{r.onClick&&(l.preventDefault(),r.onClick())},className:K.link,children:r.label}):a.jsx("span",{"aria-current":o?"page":void 0,className:o?K.current:void 0,children:r.label})}),!o&&a.jsx("span",{className:K.separator,"aria-hidden":!0,children:t})]},s)})})}const It="tempest_button_2ZuB7",Lt="tempest_primary_s1sM6",Pt="tempest_secondary_R0waJ",Rt="tempest_danger_V4fX8",Mt="tempest_ghost_1KINV",Dt="tempest_sm_NhG0g",At="tempest_md_hH4h3",Ft="tempest_lg_2plQf",Wt="tempest_fullWidth_36oJT",Ot="tempest_loading_EQAt2",Bt="tempest_hiddenText_hIiJ2",Ut="tempest_spinner_ZExvW",Jt="tempest_tempest-spin_UOSVC",O={button:It,primary:Lt,secondary:Pt,danger:Rt,ghost:Mt,sm:Dt,md:At,lg:Ft,fullWidth:Wt,loading:Ot,hiddenText:Bt,spinner:Ut,tempestSpin:Jt};function te({variant:e="primary",size:t="md",loading:n=!1,fullWidth:r=!1,leftIcon:s,rightIcon:o,disabled:i,className:l,children:c,...d}){return a.jsxs("button",{className:b(O.button,O[e],O[t],n&&O.loading,r&&O.fullWidth,l),disabled:i||n,...d,children:[n&&a.jsx("span",{className:O.spinner,"aria-hidden":!0,children:a.jsx(qt,{})}),a.jsxs("span",{className:b(n&&O.hiddenText),children:[s,c,o]})]})}function qt(){return a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const zt="tempest_card_Cb1o4",Gt="tempest_padded_oOxwN",Ht="tempest_flush_aiDZi",Kt="tempest_header_PTXf2",Vt="tempest_title_mSgoo",Qt="tempest_body_W441Z",q={card:zt,padded:Gt,flush:Ht,header:Kt,title:Vt,body:Qt};function Yt({title:e,actions:t,flush:n=!1,className:r,children:s,...o}){const i=e||t;return a.jsxs("div",{className:b(q.card,!i&&!n&&q.padded,n&&q.flush,r),...o,children:[i&&a.jsxs("header",{className:q.header,children:[typeof e=="string"?a.jsx("h3",{className:q.title,children:e}):e,t]}),i?a.jsx("div",{className:q.body,children:s}):s]})}const Zt="tempest_wrapper_rpthW",Xt="tempest_disabled_x7-eg",en="tempest_input_2kt-h",tn="tempest_box_OCPee",nn="tempest_labelWrap_Ktbp0",rn="tempest_label_cwRtI",sn="tempest_description_rMhG1",B={wrapper:Zt,disabled:Xt,input:en,box:tn,labelWrap:nn,label:rn,description:sn},on=u.forwardRef(function({label:t,description:n,indeterminate:r,disabled:s,wrapperClassName:o,className:i,...l},c){const d=u.useRef(null);u.useEffect(()=>{d.current&&(d.current.indeterminate=!!r)},[r]);function f(p){d.current=p,typeof c=="function"?c(p):c&&(c.current=p)}return a.jsxs("label",{className:b(B.wrapper,s&&B.disabled,o),children:[a.jsx("input",{ref:f,type:"checkbox",disabled:s,className:b(B.input,i),...l}),a.jsx("span",{className:B.box,"aria-hidden":!0,children:r?a.jsx(cn,{}):a.jsx(an,{})}),(t||n)&&a.jsxs("span",{className:B.labelWrap,children:[t&&a.jsx("span",{className:B.label,children:t}),n&&a.jsx("span",{className:B.description,children:n})]})]})});function an(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function cn(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const ln="tempest_wrapper_KR4-F",un="tempest_label_Mz-wX",dn="tempest_field_iIBJw",fn="tempest_error_O9n-9",pn="tempest_chip_GEwrc",mn="tempest_remove_JYDIq",hn="tempest_input_frJmk",gn="tempest_helper_Yts53",yn="tempest_errorText_llJGq",P={wrapper:ln,label:un,field:dn,error:fn,chip:pn,remove:mn,input:hn,helper:gn,errorText:yn};function _n({value:e,onChange:t,label:n,placeholder:r="Adicionar e pressionar Enter…",helperText:s,error:o,commitKeys:i=["Enter",",","Tab"],normalize:l=!0,className:c}){const[d,f]=u.useState(""),p=u.useRef(null);function m(){const g=l?d.trim().toLowerCase():d.trim();if(g){if(e.includes(g)){f("");return}t([...e,g]),f("")}}function h(g){if(i.includes(g.key)){g.preventDefault(),m();return}g.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function y(g){const w=e.slice();w.splice(g,1),t(w)}return a.jsxs("div",{className:b(P.wrapper,o&&P.error,c),children:[n&&a.jsx("label",{className:P.label,children:n}),a.jsxs("div",{className:P.field,onClick:()=>p.current?.focus(),children:[e.map((g,w)=>a.jsxs("span",{className:P.chip,children:[g,a.jsx("button",{type:"button",className:P.remove,"aria-label":`Remover ${g}`,onClick:()=>y(w),children:"×"})]},`${g}-${w}`)),a.jsx("input",{ref:p,className:P.input,value:d,placeholder:e.length===0?r:"",onChange:g=>f(g.target.value),onKeyDown:h,onBlur:m})]}),o?a.jsx("span",{className:P.errorText,children:o}):s?a.jsx("span",{className:P.helper,children:s}):null]})}const bn="tempest_overlay_dd9h1",wn="tempest_tempest-fade-in_DvgSp",vn="tempest_dialog_ptM-K",xn="tempest_tempest-modal-in_UoxQC",jn="tempest_sm_K5k3W",Sn="tempest_md_gvyR7",kn="tempest_lg_BgB1a",En="tempest_xl_MR-68",Nn="tempest_header_ILG9i",Cn="tempest_title_A5OeE",$n="tempest_close_-ER1C",Tn="tempest_body_lVhql",In="tempest_footer_rro2w",A={overlay:bn,tempestFadeIn:wn,dialog:vn,tempestModalIn:xn,sm:jn,md:Sn,lg:kn,xl:En,header:Nn,title:Cn,close:$n,body:Tn,footer:In};function Ce({open:e,onClose:t,title:n,children:r,footer:s,size:o="md",closeOnBackdrop:i=!0,closeOnEsc:l=!0,className:c,hideCloseButton:d=!1}){return u.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const p=m=>{l&&m.key==="Escape"&&t()};return window.addEventListener("keydown",p),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",p)}},[e,l,t]),!e||typeof document>"u"?null:me.createPortal(a.jsx("div",{className:A.overlay,role:"presentation",onClick:()=>{i&&t()},children:a.jsxs("div",{role:"dialog","aria-modal":"true",className:b(A.dialog,A[o],c),onClick:f=>f.stopPropagation(),children:[(n||!d)&&a.jsxs("header",{className:A.header,children:[a.jsx("h3",{className:A.title,children:n}),!d&&a.jsx("button",{type:"button",className:A.close,"aria-label":"Fechar",onClick:t,children:a.jsx(Ln,{})})]}),a.jsx("div",{className:A.body,children:r}),s&&a.jsx("footer",{className:A.footer,children:s})]})}),document.body)}function Ln(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Pn({open:e,title:t,description:n,confirmLabel:r="Confirmar",cancelLabel:s="Cancelar",variant:o="primary",loading:i=!1,onConfirm:l,onCancel:c}){return a.jsx(Ce,{open:e,onClose:c,title:t,size:"sm",footer:a.jsxs(a.Fragment,{children:[a.jsx(te,{variant:"secondary",onClick:c,disabled:i,children:s}),a.jsx(te,{variant:o,loading:i,onClick:()=>{l()},children:r})]}),children:n})}const Rn="tempest_wrapper_iHNUs",Mn="tempest_label_-OEBL",Dn="tempest_required_CTss-",An="tempest_field_65yGJ",Fn="tempest_input_WjT81",Wn="tempest_hasLeftIcon_xYO-v",On="tempest_hasRightIcon_C7uyr",Bn="tempest_iconLeft_KrUhI",Un="tempest_iconRight_Ssr47",Jn="tempest_error_VLISa",qn="tempest_helper_7Vc-s",zn="tempest_errorText_xz4xS",T={wrapper:Rn,label:Mn,required:Dn,field:An,input:Fn,hasLeftIcon:Wn,hasRightIcon:On,iconLeft:Bn,iconRight:Un,error:Jn,helper:qn,errorText:zn},ne=u.forwardRef(function({label:t,helperText:n,error:r,leftIcon:s,rightIcon:o,wrapperClassName:i,className:l,id:c,required:d,...f},p){const m=u.useId(),h=c??m,y=r?`${h}-error`:n?`${h}-helper`:void 0;return a.jsxs("div",{className:b(T.wrapper,r&&T.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:T.label,children:[t,d&&a.jsx("span",{className:T.required,children:"*"})]}),a.jsxs("div",{className:T.field,children:[s&&a.jsx("span",{className:T.iconLeft,children:s}),a.jsx("input",{ref:p,id:h,"aria-invalid":!!r,"aria-describedby":y,required:d,className:b(T.input,s&&T.hasLeftIcon,o&&T.hasRightIcon,l),...f}),o&&a.jsx("span",{className:T.iconRight,children:o})]}),r?a.jsx("span",{id:`${h}-error`,className:T.errorText,children:r}):n?a.jsx("span",{id:`${h}-helper`,className:T.helper,children:n}):null]})}),Gn=u.forwardRef(function({value:t,onChange:n,mode:r="date",...s},o){return a.jsx(ne,{...s,ref:o,type:r,value:t,onChange:i=>n(i.target.value)})}),Hn="tempest_overlay_hcG1G",Kn="tempest_tempest-drawer-overlay_XFbxY",Vn="tempest_panel_wUX0N",Qn="tempest_right_-oX-6",Yn="tempest_tempest-drawer-in-right_pWYHv",Zn="tempest_left_xi3nD",Xn="tempest_tempest-drawer-in-left_o7JSb",er="tempest_top_7rGCn",tr="tempest_tempest-drawer-in-top_kn6AF",nr="tempest_bottom_zd-25",rr="tempest_tempest-drawer-in-bottom_0x3u7",sr="tempest_header_sYoP1",or="tempest_title_LqUOu",ir="tempest_close_tYPhU",ar="tempest_body_aV9FG",cr="tempest_footer_AuvUP",F={overlay:Hn,tempestDrawerOverlay:Kn,panel:Vn,right:Qn,tempestDrawerInRight:Yn,left:Zn,tempestDrawerInLeft:Xn,top:er,tempestDrawerInTop:tr,bottom:nr,tempestDrawerInBottom:rr,header:sr,title:or,close:ir,body:ar,footer:cr};function lr({open:e,onClose:t,placement:n="right",title:r,children:s,footer:o,closeOnBackdrop:i=!0,closeOnEsc:l=!0,hideCloseButton:c=!1,className:d}){return u.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const p=m=>{l&&m.key==="Escape"&&t()};return window.addEventListener("keydown",p),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",p)}},[e,l,t]),!e||typeof document>"u"?null:me.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:F.overlay,onClick:()=>{i&&t()}}),a.jsxs("aside",{role:"dialog","aria-modal":"true",className:b(F.panel,F[n],d),children:[(r||!c)&&a.jsxs("header",{className:F.header,children:[a.jsx("h3",{className:F.title,children:r}),!c&&a.jsx("button",{type:"button","aria-label":"Fechar",className:F.close,onClick:t,children:a.jsx(ur,{})})]}),a.jsx("div",{className:F.body,children:s}),o&&a.jsx("footer",{className:F.footer,children:o})]})]}),document.body)}function ur(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const dr="tempest_wrapper_gzyTd",fr="tempest_icon_qVCyh",pr="tempest_title_xPfUf",mr="tempest_description_oWwH1",hr="tempest_action_dqxw1",V={wrapper:dr,icon:fr,title:pr,description:mr,action:hr};function gr({icon:e,title:t,description:n,action:r,className:s}){return a.jsxs("div",{className:b(V.wrapper,s),children:[e&&a.jsx("div",{className:V.icon,children:e}),a.jsx("h4",{className:V.title,children:t}),n&&a.jsx("p",{className:V.description,children:n}),r&&a.jsx("div",{className:V.action,children:r})]})}const yr="tempest_wrapper_luRyF",_r="tempest_icon_dEdBl",br="tempest_title_StutD",wr="tempest_description_A2XCb",vr="tempest_action_vm1LC",Q={wrapper:yr,icon:_r,title:br,description:wr,action:vr};function xr({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:r="Tentar novamente",icon:s,className:o}){return a.jsxs("div",{className:b(Q.wrapper,o),children:[a.jsx("div",{className:Q.icon,children:s??a.jsx(jr,{})}),a.jsx("h4",{className:Q.title,children:e}),t&&a.jsx("p",{className:Q.description,children:t}),n&&a.jsx("div",{className:Q.action,children:a.jsx(te,{variant:"secondary",onClick:n,children:r})})]})}function jr(){return a.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Sr="tempest_wrapper_E0qHs",kr="tempest_label_lbMkx",Er="tempest_dropzone_jqua0",Nr="tempest_active_CG9Uk",Cr="tempest_disabled_WNUUl",$r="tempest_icon_i9fGH",Tr="tempest_title_bTVFl",Ir="tempest_subtitle_S54OV",Lr="tempest_files_WljYm",Pr="tempest_file_Lp-dR",Rr="tempest_fileMeta_LTnN2",Mr="tempest_remove_jskra",Dr="tempest_hidden_ReEq6",C={wrapper:Sr,label:kr,dropzone:Er,active:Nr,disabled:Cr,icon:$r,title:Tr,subtitle:Ir,files:Lr,file:Pr,fileMeta:Rr,remove:Mr,hidden:Dr};function Ar(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Fr(e,t){if(!t)return!0;const n=t.split(",").map(o=>o.trim().toLowerCase()),r=e.name.toLowerCase(),s=e.type.toLowerCase();return n.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?s.startsWith(o.replace("/*","/")):s===o)}function Wr({value:e,onChange:t,label:n,accept:r,multiple:s=!1,maxSize:o,onReject:i,disabled:l,title:c="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:f}){const[p,m]=u.useState(!1),h=u.useRef(null);function y(_){const v=[],x=[];for(const N of Array.from(_)){if(!Fr(N,r)){x.push({file:N,reason:"type"});continue}if(o&&N.size>o){x.push({file:N,reason:"size"});continue}v.push(N)}if(x.length>0&&i?.(x),v.length===0)return;const k=s?[...e,...v]:v.slice(0,1);t(k)}function g(_){_.preventDefault(),m(!1),!l&&_.dataTransfer?.files&&y(_.dataTransfer.files)}function w(_){const v=e.slice();v.splice(_,1),t(v)}return a.jsxs("div",{className:b(C.wrapper,f),children:[n&&a.jsx("label",{className:C.label,children:n}),a.jsxs("div",{className:b(C.dropzone,p&&C.active,l&&C.disabled),role:"button",tabIndex:l?-1:0,onClick:()=>!l&&h.current?.click(),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),h.current?.click())},onDragEnter:_=>{_.preventDefault(),l||m(!0)},onDragOver:_=>_.preventDefault(),onDragLeave:()=>m(!1),onDrop:g,children:[a.jsx("div",{className:C.icon,"aria-hidden":!0,children:a.jsx(Or,{})}),a.jsx("p",{className:C.title,children:c}),d&&a.jsx("p",{className:C.subtitle,children:d}),a.jsx("input",{ref:h,type:"file",accept:r,multiple:s,disabled:l,className:C.hidden,onChange:_=>{_.target.files&&y(_.target.files),_.target.value=""}})]}),e.length>0&&a.jsx("ul",{className:C.files,children:e.map((_,v)=>a.jsxs("li",{className:C.file,children:[a.jsxs("div",{children:[a.jsx("div",{children:_.name}),a.jsx("div",{className:C.fileMeta,children:Ar(_.size)})]}),a.jsx("button",{type:"button","aria-label":`Remover ${_.name}`,className:C.remove,onClick:()=>w(v),children:"×"})]},`${_.name}-${v}`))})]})}function Or(){return a.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Br="tempest_container_fJfOt",Ur="tempest_sm_k8D4-",Jr="tempest_md_EnpYy",qr="tempest_lg_UU-Ig",zr="tempest_xl_2TEWj",Gr="tempest_full_l8bvG",Hr="tempest_stack_sxR8u",Kr="tempest_vertical_2TMf5",Vr="tempest_horizontal_r7-c-",Qr="tempest_center_EDSAh",Yr="tempest_start_ucQ-K",Zr="tempest_end_pnKlF",Xr="tempest_stretch_pX6l7",es="tempest_justifyStart_lHYsS",ts="tempest_justifyCenter_JH2m6",ns="tempest_justifyEnd_EBisT",rs="tempest_justifyBetween_mAJwT",ss="tempest_wrap_-xxOh",os="tempest_grid_o-JIX",I={container:Br,sm:Ur,md:Jr,lg:qr,xl:zr,full:Gr,stack:Hr,vertical:Kr,horizontal:Vr,center:Qr,start:Yr,end:Zr,stretch:Xr,justifyStart:es,justifyCenter:ts,justifyEnd:ns,justifyBetween:rs,wrap:ss,grid:os};function is({size:e="lg",className:t,children:n,...r}){return a.jsx("div",{className:b(I.container,I[e],t),...r,children:n})}function as({direction:e="vertical",gap:t=2,align:n,justify:r,wrap:s=!1,className:o,style:i,children:l,...c}){const f={gap:typeof t=="number"?`${t*4}px`:t,...i},p=r==="between"?I.justifyBetween:r==="center"?I.justifyCenter:r==="end"?I.justifyEnd:r==="start"?I.justifyStart:void 0;return a.jsx("div",{className:b(I.stack,e==="vertical"?I.vertical:I.horizontal,n&&I[n],p,s&&I.wrap,o),style:f,...c,children:l})}function cs({columns:e=2,gap:t=4,className:n,style:r,children:s,...o}){const i=typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e,l=typeof t=="number"?`${t*4}px`:t;return a.jsx("div",{className:b(I.grid,n),style:{gridTemplateColumns:i,gap:l,...r},...o,children:s})}const ls="tempest_wrapper_cRGQm",us="tempest_controls_fdL-y",ds="tempest_page_WjG0l",fs="tempest_active_1kqsJ",ps="tempest_ellipsis_V294k",ms="tempest_sizeSelect_ZayTo",W={wrapper:ls,controls:us,page:ds,active:fs,ellipsis:ps,sizeSelect:ms};function hs(e,t,n){const r=n+4;if(t<=r)return Array.from({length:t},(l,c)=>c+1);const s=Math.max(2,e-Math.floor(n/2)),o=Math.min(t-1,s+n-1),i=[1];s>2&&i.push("...");for(let l=s;l<=o;l++)i.push(l);return o<t-1&&i.push("..."),i.push(t),i}function gs({page:e,totalPages:t,onPageChange:n,pageSize:r,onPageSizeChange:s,pageSizeOptions:o=[10,25,50,100],totalItems:i,siblingCount:l=3,className:c}){const d=u.useMemo(()=>hs(e,t,l),[e,t,l]);return t<=1&&!s?null:a.jsxs("div",{className:b(W.wrapper,c),children:[a.jsx("div",{children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:null}),a.jsxs("div",{className:W.controls,children:[a.jsx("button",{type:"button",className:W.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((f,p)=>f==="..."?a.jsx("span",{className:W.ellipsis,children:"…"},`ellipsis-${p}`):a.jsx("button",{type:"button",className:b(W.page,f===e&&W.active),onClick:()=>n(f),"aria-current":f===e?"page":void 0,children:f},f)),a.jsx("button",{type:"button",className:W.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),s&&a.jsx("select",{className:W.sizeSelect,value:r,onChange:f=>s(Number(f.target.value)),"aria-label":"Itens por página",children:o.map(f=>a.jsxs("option",{value:f,children:[f," / página"]},f))})]})]})}const ys="tempest_wrapper_BQek1",_s="tempest_bar_uC-0x",bs="tempest_fill_vmg7x",ws="tempest_success_gWJ8U",vs="tempest_warning_DGkPO",xs="tempest_danger_gfwHh",js="tempest_indeterminate_HojUj",Ss="tempest_tempest-progress-loop_0nEdF",ks="tempest_label_qqHJM",z={wrapper:ys,bar:_s,fill:bs,success:ws,warning:vs,danger:xs,indeterminate:js,tempestProgressLoop:Ss,label:ks};function Es({value:e=0,max:t=100,variant:n="primary",indeterminate:r=!1,showLabel:s=!1,label:o,className:i}){const l=r?0:Math.max(0,Math.min(100,e/t*100));return a.jsxs("div",{className:b(z.wrapper,i),children:[(s||o)&&a.jsxs("div",{className:z.label,children:[o&&a.jsx("span",{children:o}),s&&!r&&a.jsxs("span",{children:[Math.round(l),"%"]})]}),a.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":r?void 0:e,className:b(z.bar,r&&z.indeterminate),children:a.jsx("div",{className:b(z.fill,n!=="primary"&&z[n]),style:{width:r?void 0:`${l}%`}})})]})}const Ns="tempest_wrapper_P-gFm",Cs="tempest_disabled_0-cna",$s="tempest_input_7R8ZN",Ts="tempest_dot_P7ejP",Is="tempest_labelWrap_iQ1HR",Ls="tempest_label_vAFIP",Ps="tempest_description_bEB8u",Rs="tempest_group_oi329",Ms="tempest_horizontal_1Ovgu",D={wrapper:Ns,disabled:Cs,input:$s,dot:Ts,labelWrap:Is,label:Ls,description:Ps,group:Rs,horizontal:Ms},$e=u.createContext(null),Ds=u.forwardRef(function({label:t,description:n,value:r,disabled:s,name:o,checked:i,onChange:l,wrapperClassName:c,className:d,...f},p){const m=u.useContext($e),h=m?.name??o,y=m?.disabled??s,g=m?m.value===r:i;function w(_){m&&m.onChange?.(r),l?.(_)}return a.jsxs("label",{className:b(D.wrapper,y&&D.disabled,c),children:[a.jsx("input",{ref:p,type:"radio",name:h,value:r,checked:g,disabled:y,onChange:w,className:b(D.input,d),...f}),a.jsx("span",{className:D.dot,"aria-hidden":!0}),(t||n)&&a.jsxs("span",{className:D.labelWrap,children:[t&&a.jsx("span",{className:D.label,children:t}),n&&a.jsx("span",{className:D.description,children:n})]})]})});function As({value:e,defaultValue:t,onChange:n,name:r,disabled:s,horizontal:o=!1,className:i,children:l}){const c=u.useId(),d=r??c,[f,p]=u.useState(t),m=e!==void 0,h=m?e:f;function y(g){m||p(g),n?.(g)}return a.jsx($e.Provider,{value:{name:d,value:h,onChange:y,disabled:s},children:a.jsx("div",{role:"radiogroup",className:b(D.group,o&&D.horizontal,i),children:l})})}const Fs="tempest_wrapper_dKXJJ",Ws="tempest_input_m0lPc",Os="tempest_iconLeft_030-U",Bs="tempest_clear_nb6lG",ee={wrapper:Fs,input:Ws,iconLeft:Os,clear:Bs},Us=u.forwardRef(function({value:t,onChange:n,onClear:r,wrapperClassName:s,placeholder:o="Buscar...",className:i,...l},c){function d(){n(""),r?.()}return a.jsxs("div",{className:b(ee.wrapper,s),children:[a.jsx("span",{className:ee.iconLeft,"aria-hidden":!0,children:a.jsx(Js,{})}),a.jsx("input",{ref:c,type:"search",value:t,onChange:f=>n(f.target.value),placeholder:o,className:b(ee.input,i),...l}),t&&a.jsx("button",{type:"button",className:ee.clear,"aria-label":"Limpar busca",onClick:d,children:a.jsx(qs,{})})]})});function Js(){return a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),a.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function qs(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const zs="tempest_wrapper_KS2K3",Gs="tempest_label_Lmgos",Hs="tempest_required_PvDVJ",Ks="tempest_field_h-wBy",Vs="tempest_select_cjdcr",Qs="tempest_caret_MdCao",Ys="tempest_error_sw9MU",Zs="tempest_helper_frosK",Xs="tempest_errorText_-zd6i",R={wrapper:zs,label:Gs,required:Hs,field:Ks,select:Vs,caret:Qs,error:Ys,helper:Zs,errorText:Xs},eo=u.forwardRef(function({label:t,helperText:n,error:r,options:s,placeholder:o,wrapperClassName:i,className:l,children:c,id:d,required:f,...p},m){const h=u.useId(),y=d??h;return a.jsxs("div",{className:b(R.wrapper,r&&R.error,i),children:[t&&a.jsxs("label",{htmlFor:y,className:R.label,children:[t,f&&a.jsx("span",{className:R.required,children:"*"})]}),a.jsxs("div",{className:R.field,children:[a.jsxs("select",{ref:m,id:y,"aria-invalid":!!r,required:f,className:b(R.select,l),...p,children:[o&&a.jsx("option",{value:"",disabled:!0,hidden:!0,children:o}),s?.map(g=>a.jsx("option",{value:g.value,disabled:g.disabled,children:g.label},g.value)),c]}),a.jsx("span",{className:R.caret,"aria-hidden":!0,children:a.jsx(to,{})})]}),r?a.jsx("span",{className:R.errorText,children:r}):n?a.jsx("span",{className:R.helper,children:n}):null]})});function to(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const no="tempest_skeleton_CB4uF",ro="tempest_text_-A8IF",so="tempest_circle_DYcl8",ae={skeleton:no,text:ro,circle:so};function oo({variant:e="rect",width:t,height:n,className:r,style:s}){return a.jsx("span",{"aria-hidden":!0,className:b(ae.skeleton,e==="text"&&ae.text,e==="circle"&&ae.circle,r),style:{width:t,height:n,...s}})}const io="tempest_spinner_GpFZS",ao="tempest_tempest-spinner_wKVCY",co="tempest_sm_3sIoD",lo="tempest_md_M2sPj",uo="tempest_lg_IxTw2",ve={spinner:io,tempestSpinner:ao,sm:co,md:lo,lg:uo};function fo({size:e="md",className:t,label:n="Carregando"}){return a.jsx("span",{role:"status","aria-label":n,className:b(ve.spinner,ve[e],t)})}const po="tempest_stepper_w3qjQ",mo="tempest_vertical_d4mOs",ho="tempest_step_s2nqL",go="tempest_dot_d1bSL",yo="tempest_completed_gcFHM",_o="tempest_active_kL-CH",bo="tempest_label_8irAI",wo="tempest_connector_lyeWp",M={stepper:po,vertical:mo,step:ho,dot:go,completed:yo,active:_o,label:bo,connector:wo};function vo({steps:e,current:t,orientation:n="horizontal",className:r}){return a.jsx("ol",{className:b(M.stepper,n==="vertical"&&M.vertical,r),children:e.map((s,o)=>{const i=o<t,l=o===t;return a.jsxs(u.Fragment,{children:[a.jsxs("li",{className:b(M.step,i&&M.completed,l&&M.active),"aria-current":l?"step":void 0,children:[a.jsx("span",{className:M.dot,children:i?"✓":o+1}),a.jsx("span",{className:M.label,children:s.label})]}),o<e.length-1&&a.jsx("span",{className:b(M.connector,i&&M.completed),"aria-hidden":!0})]},o)})})}const xo="tempest_wrapper_kudO9",jo="tempest_disabled_2aZ0V",So="tempest_input_5BPNu",ko="tempest_track_7ObdZ",Eo="tempest_thumb_-FTeK",No="tempest_label_LrH7V",G={wrapper:xo,disabled:jo,input:So,track:ko,thumb:Eo,label:No},Co=u.forwardRef(function({label:t,disabled:n,wrapperClassName:r,className:s,...o},i){return a.jsxs("label",{className:b(G.wrapper,n&&G.disabled,r),children:[a.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:b(G.input,s),...o}),a.jsx("span",{className:G.track,"aria-hidden":!0,children:a.jsx("span",{className:G.thumb})}),t&&a.jsx("span",{className:G.label,children:t})]})}),$o="tempest_scroll_unrJp",To="tempest_table_Dkosn",Io="tempest_th_PNuEx",Lo="tempest_td_jv9tA",Po="tempest_tr_7UG8J",Ro="tempest_clickable_B6Si-",Mo="tempest_alignRight_9hY0G",Do="tempest_alignCenter_YiUQy",Ao="tempest_emptyRow_kdMiv",L={scroll:$o,table:To,th:Io,td:Lo,tr:Po,clickable:Ro,alignRight:Mo,alignCenter:Do,emptyRow:Ao};function Fo({columns:e,data:t,rowKey:n,onRowClick:r,emptyMessage:s="Nenhum registro encontrado.",className:o}){return a.jsx("div",{className:b(L.scroll,o),children:a.jsxs("table",{className:L.table,children:[a.jsx("thead",{children:a.jsx("tr",{children:e.map(i=>a.jsx("th",{className:b(L.th,i.align==="right"&&L.alignRight,i.align==="center"&&L.alignCenter),style:{width:i.width},children:i.header},i.key))})}),a.jsx("tbody",{children:t.length===0?a.jsx("tr",{children:a.jsx("td",{className:L.emptyRow,colSpan:e.length,children:s})}):t.map((i,l)=>a.jsx("tr",{className:b(L.tr,r&&L.clickable),onClick:r?()=>r(i):void 0,children:e.map(c=>{const d=c.render?c.render(i,l):i[c.key];return a.jsx("td",{className:b(L.td,c.align==="right"&&L.alignRight,c.align==="center"&&L.alignCenter,c.className),children:d},c.key)})},n(i,l)))})]})})}const Wo="tempest_tablist_WR6ag",Oo="tempest_tab_IdDYc",Bo="tempest_active_PTNtG",Uo="tempest_panel_08i9c",Jo="tempest_pill_lGuqn",Y={tablist:Wo,tab:Oo,active:Bo,panel:Uo,pill:Jo};function qo({items:e,defaultId:t,activeId:n,onChange:r,variant:s="underline",className:o}){const i=e.find(h=>!h.disabled),[l,c]=u.useState(t??i?.id),d=n!==void 0,f=d?n:l,p=e.find(h=>h.id===f)??i;function m(h){d||c(h),r?.(h)}return a.jsxs("div",{className:o,children:[a.jsx("div",{role:"tablist",className:b(Y.tablist,s==="pill"&&Y.pill),children:e.map(h=>{const y=h.id===p?.id;return a.jsx("button",{type:"button",role:"tab","aria-selected":y,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:b(Y.tab,y&&Y.active),onClick:()=>m(h.id),children:h.label},h.id)})}),p&&a.jsx("div",{role:"tabpanel",id:`panel-${p.id}`,"aria-labelledby":`tab-${p.id}`,className:Y.panel,children:p.content})]})}const zo="tempest_wrapper_C0gfg",Go="tempest_label_cWLXP",Ho="tempest_required_rDZXE",Ko="tempest_textarea_Z-y6g",Vo="tempest_error_NWC9f",Qo="tempest_helper_gedut",Yo="tempest_errorText_ey07q",U={wrapper:zo,label:Go,required:Ho,textarea:Ko,error:Vo,helper:Qo,errorText:Yo},Zo=u.forwardRef(function({label:t,helperText:n,error:r,wrapperClassName:s,className:o,id:i,required:l,...c},d){const f=u.useId(),p=i??f;return a.jsxs("div",{className:b(U.wrapper,r&&U.error,s),children:[t&&a.jsxs("label",{htmlFor:p,className:U.label,children:[t,l&&a.jsx("span",{className:U.required,children:"*"})]}),a.jsx("textarea",{ref:d,id:p,"aria-invalid":!!r,required:l,className:b(U.textarea,o),...c}),r?a.jsx("span",{className:U.errorText,children:r}):n?a.jsx("span",{className:U.helper,children:n}):null]})}),Xo="tempest_trigger_Dmc5E",ei="tempest_bubble_TPGHB",ti="tempest_tempest-tooltip-in_csYeZ",ni="tempest_top_m2tnn",ri="tempest_bottom_9Twz4",si="tempest_left_UPdrG",oi="tempest_right_CV--T",ce={trigger:Xo,bubble:ei,tempestTooltipIn:ti,top:ni,bottom:ri,left:si,right:oi};function ii({content:e,placement:t="top",children:n,disabled:r=!1,openDelay:s=150}){const[o,i]=u.useState(!1),l=u.useId();let c=null;function d(){r||(c&&clearTimeout(c),c=setTimeout(()=>i(!0),s))}function f(){c&&(clearTimeout(c),c=null),i(!1)}const p=u.cloneElement(n,{onMouseEnter:d,onMouseLeave:f,onFocus:d,onBlur:f,"aria-describedby":o?l:void 0});return a.jsxs("span",{className:ce.trigger,children:[p,o&&a.jsx("span",{id:l,role:"tooltip",className:b(ce.bubble,ce[t]),children:e})]})}const ai="tempest_container_x4-Qm",ci="tempest_toast_FLdHz",li="tempest_tempest-toast-in_E2d-A",ui="tempest_success_Oy694",di="tempest_warning_84GC8",fi="tempest_error_hrQAA",pi="tempest_info_eq5bQ",mi="tempest_title_-H6R2",hi="tempest_description_-QwfC",gi="tempest_close_i10-s",H={container:ai,toast:ci,tempestToastIn:li,success:ui,warning:di,error:fi,info:pi,title:mi,description:hi,close:gi},Te=u.createContext(null);function yi(){const e=u.useContext(Te);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function _i({children:e,defaultDuration:t=4e3}){const[n,r]=u.useState([]),s=u.useRef(0),o=u.useCallback(c=>{r(d=>d.filter(f=>f.id!==c))},[]),i=u.useCallback(c=>{const d=c.id??`toast-${++s.current}`,f={id:d,title:c.title,description:c.description,variant:c.variant??"info",duration:c.duration??t};return r(p=>[...p,f]),d},[t]),l=u.useMemo(()=>({show:i,dismiss:o,success:(c,d)=>i({...d,description:c,variant:"success"}),error:(c,d)=>i({...d,description:c,variant:"error"}),warning:(c,d)=>i({...d,description:c,variant:"warning"}),info:(c,d)=>i({...d,description:c,variant:"info"})}),[i,o]);return a.jsxs(Te.Provider,{value:l,children:[e,a.jsx(bi,{toasts:n,onDismiss:o})]})}function bi({toasts:e,onDismiss:t}){return typeof document>"u"?null:me.createPortal(a.jsx("div",{className:H.container,"aria-live":"polite","aria-atomic":"true",children:e.map(n=>a.jsx(wi,{toast:n,onDismiss:t},n.id))}),document.body)}function wi({toast:e,onDismiss:t}){return u.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),a.jsxs("div",{className:b(H.toast,H[e.variant]),role:"status",children:[a.jsxs("div",{children:[e.title&&a.jsx("p",{className:H.title,children:e.title}),e.description&&a.jsx("p",{className:H.description,children:e.description})]}),a.jsx("button",{type:"button",className:H.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:a.jsx(vi,{})})]})}function vi(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const xi="tempest_scroll_8Giwl",ji="tempest_spacer_P3Pvl",Si="tempest_row_Ff0VU",le={scroll:xi,spacer:ji,row:Si};function ki({items:e,itemHeight:t,renderItem:n,height:r,overscan:s=4,getKey:o,className:i,style:l}){const c=u.useRef(null),[d,f]=u.useState(0),[p,m]=u.useState(0);u.useEffect(()=>{const _=c.current;if(!_||(m(_.clientHeight),typeof ResizeObserver>"u"))return;const v=new ResizeObserver(()=>m(_.clientHeight));return v.observe(_),()=>v.disconnect()},[]);const h=e.length*t,y=Math.max(0,Math.floor(d/t)-s),g=Math.ceil(p/t)+s*2,w=Math.min(e.length,y+g);return a.jsx("div",{ref:c,className:b(le.scroll,i),style:{height:r,...l},onScroll:_=>f(_.target.scrollTop),role:"list",children:a.jsx("div",{className:le.spacer,style:{height:h},children:e.slice(y,w).map((_,v)=>{const x=y+v,k=o?o(_,x):x;return a.jsx("div",{role:"listitem",className:le.row,style:{top:x*t,height:t},children:n(_,x)},k)})})})}function Ei(e,t=300){const[n,r]=u.useState(e);return u.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function Ni(e=1,t=50){const[n,r]=u.useState(e),[s,o]=u.useState(t),i=u.useCallback(()=>r(1),[]);return{page:n,size:s,setPage:r,setSize:o,reset:i}}function Ci(e,t,n){return u.useMemo(()=>{const r=t.trim().toLowerCase();return r?typeof n=="function"?e.filter(s=>n(s,r)):e.filter(s=>n.some(o=>{const i=s[o];return i!=null&&String(i).toLowerCase().includes(r)})):e},[e,t,n])}function $i(e){const[t,n]=u.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return u.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(e),s=o=>n(o.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}function Ti(){const[e,t]=u.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return u.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}},[]),e}function Ii(){const[e,t]=u.useState(()=>typeof document>"u"?"visible":document.visibilityState);return u.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function Li(e,t={}){const[n,r]=u.useState(null),{once:s=!1,root:o,rootMargin:i,threshold:l}=t;return u.useEffect(()=>{const c=e.current;if(!c||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([f])=>{f&&(r(f),s&&f.isIntersecting&&d.unobserve(c))},{root:o,rootMargin:i,threshold:l});return d.observe(c),()=>d.disconnect()},[e,s,o,i,l]),n}function Pi(e){const[t,n]=u.useState(null);return u.useEffect(()=>{const r=e.current;if(!r||typeof ResizeObserver>"u")return;const s=new ResizeObserver(o=>{const i=o[0];if(!i)return;const l=i.contentRect;n({width:l.width,height:l.height})});return s.observe(r),()=>s.disconnect()},[e]),t}function Ri(e={}){const{resetAfter:t=1500}=e,[n,r]=u.useState(!1),s=u.useRef(null),o=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),r(!1)},[]);u.useEffect(()=>()=>o(),[o]);const i=u.useCallback(async l=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(l);else if(typeof document<"u"){const c=document.createElement("textarea");c.value=l,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c)}else return!1;return r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:o}}function Mi(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,r=!!t.meta,s=!!t.shift,o=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==r)return!1;return!(e.shiftKey!==s||e.altKey!==o)}function Di(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function Ai(e,t,n={}){const{disabled:r=!1,ignoreInput:s=!0}=n;u.useEffect(()=>{if(r||typeof window>"u")return;const o=i=>{s&&Di(i.target)||Mi(i,e)&&t(i)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r,s,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}function Fi(){const[e,t]=u.useState(null),[n,r]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const o=l=>{l.preventDefault(),t(l)},i=()=>{t(null),r(!0)};return window.addEventListener("beforeinstallprompt",o),window.addEventListener("appinstalled",i),()=>{window.removeEventListener("beforeinstallprompt",o),window.removeEventListener("appinstalled",i)}},[]);const s=u.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const o=await e.userChoice;return t(null),o.outcome==="accepted"&&r(!0),o.outcome},[e]);return{installable:!!e,installed:n,prompt:s}}const xe=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function Wi(e=6e4){const[t,n]=u.useState(!1);return u.useEffect(()=>{if(typeof window>"u")return;let r=setTimeout(()=>n(!0),e);function s(){n(!1),clearTimeout(r),r=setTimeout(()=>n(!0),e)}for(const o of xe)window.addEventListener(o,s,{passive:!0});return()=>{clearTimeout(r);for(const o of xe)window.removeEventListener(o,s)}},[e]),t}function Oi(e={}){const{watch:t=!1,disabled:n=!1,...r}=e,[s,o]=u.useState({loading:!n,error:null,coords:null,timestamp:null});return u.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){o(c=>({...c,loading:!1}));return}const i=c=>{o({loading:!1,error:null,coords:c.coords,timestamp:c.timestamp})},l=c=>{o(d=>({...d,loading:!1,error:c}))};if(t){const c=navigator.geolocation.watchPosition(i,l,r);return()=>navigator.geolocation.clearWatch(c)}navigator.geolocation.getCurrentPosition(i,l,r)},[n,t,r.enableHighAccuracy,r.maximumAge,r.timeout]),s}function Bi(e){u.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}const Ui=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Ji(e,t){u.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const r=document.activeElement;function s(){return Array.from(n?.querySelectorAll(Ui)??[]).filter(l=>{if(l.hasAttribute("aria-hidden"))return!1;const c=typeof window<"u"?window.getComputedStyle(l):null;return!(c&&(c.display==="none"||c.visibility==="hidden"))})}function o(l){if(l.key!=="Tab")return;const c=s();if(c.length===0){l.preventDefault();return}const d=c[0],f=c[c.length-1],p=document.activeElement;l.shiftKey?(p===d||!p||!n?.contains(p))&&(l.preventDefault(),f.focus()):p===f&&(l.preventDefault(),d.focus())}return s()[0]?.focus(),document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),r?.focus?.()}},[e,t])}function qi(e){const t=u.useRef(e);return t.current=e,u.useCallback((...n)=>t.current(...n),[])}function fe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>fe(s,t[o]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>fe(e[s],t[s]))}function zi(e){const t=u.useRef(e);return fe(t.current,e)||(t.current=e),t.current}function Gi(e,t,n){const r=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[s,o]of Object.entries(n))o!=null&&r.searchParams.set(s,String(o));return r.toString()}function Hi(e){return typeof FormData<"u"&&e instanceof FormData}async function je(e){let t=null;try{t=await e.clone().json()}catch{try{t=await e.text()}catch{t=null}}const n=(typeof t=="object"&&t!==null?t.detail??t.message:void 0)??`Erro ${e.status}`;return{status:e.status,detail:String(n),body:t}}function Ki(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function r(i,l){const{body:c,params:d,headers:f,...p}=l,m=Hi(c),h={...m?{}:{"Content-Type":"application/json"},...e.headers,...n(),...f},y={...p,headers:h,credentials:e.withCredentials?"include":p.credentials,body:c==null?void 0:m?c:JSON.stringify(c)};return t(Gi(e.baseURL,i,d),y)}async function s(i,l={}){let c=await r(i,l);if(c.status===401)if(e.refresh)try{await e.refresh(),c=await r(i,l)}catch{throw await e.onUnauthorized?.(c),await je(c)}else await e.onUnauthorized?.(c);if(!c.ok)throw await je(c);return c.status===204?void 0:(c.headers.get("content-type")??"").includes("application/json")?await c.json():await c.text()}async function o(i,l,c="POST"){return s(i,{method:c,body:l})}return{request:s,get:(i,l)=>s(i,{...l,method:"GET"}),post:(i,l)=>s(i,{...l,method:"POST"}),put:(i,l)=>s(i,{...l,method:"PUT"}),patch:(i,l)=>s(i,{...l,method:"PATCH"}),delete:(i,l)=>s(i,{...l,method:"DELETE"}),upload:o}}function Vi(e,t,n){const r=e.safeParse(t);if(r.success)return r.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const o=r.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),ge=require("react-dom"),we=require("@tanstack/react-query"),st=require("zustand"),ve=require("zustand/middleware"),ot=require("dexie"),it=require("react-hook-form");function y(...e){const t=[];for(const n of e)if(!(n==null||n===!1||n===!0)){if(typeof n=="string")n&&t.push(n);else if(typeof n=="number"||typeof n=="bigint")t.push(String(n));else if(Array.isArray(n)){const r=y(...n);r&&t.push(r)}}return t.join(" ")}const at="tempest_avatar_3xMuZ",ct="tempest_image_ieqGp",lt="tempest_xs_oSaLL",ut="tempest_sm_sZ2bk",dt="tempest_md_Fdkbz",pt="tempest_lg_pTTUA",ft="tempest_xl_mW58F",mt="tempest_status_ISBnL",ht="tempest_dot_Wgfo-",gt="tempest_online_-aWoW",_t="tempest_offline_-StX3",yt="tempest_busy_TbwuF",q={avatar:at,image:ct,xs:lt,sm:ut,md:dt,lg:pt,xl:ft,status:mt,dot:ht,online:gt,offline:_t,busy:yt};function bt(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function wt({src:e,alt:t,name:n="",size:r="md",status:s,className:o,onClick:i}){const[l,c]=u.useState(!1),d=u.useMemo(()=>bt(n),[n]),p=e&&!l,f=i?"button":void 0,m=i?0:void 0;return a.jsxs("span",{className:y(q.avatar,q[r],s&&q.status,o),role:f,tabIndex:m,onClick:i,onKeyDown:i?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i())}:void 0,children:[p?a.jsx("img",{src:e,alt:t??n,className:q.image,onError:()=>c(!0)}):a.jsx("span",{"aria-label":t??n,children:d}),s&&a.jsx("span",{className:y(q.dot,q[s]),"aria-hidden":!0})]})}const vt="tempest_badge_RsuMz",xt="tempest_neutral_lulSm",jt="tempest_success_u9JiS",St="tempest_warning_nsGp-",kt="tempest_danger_PD2hz",Nt="tempest_info_na6DQ",xe={badge:vt,neutral:xt,success:jt,warning:St,danger:kt,info:Nt};function Et({variant:e="neutral",className:t,children:n,...r}){return a.jsx("span",{className:y(xe.badge,xe[e],t),...r,children:n})}const $t="tempest_nav_H4g6P",Ct="tempest_item_O4g3P",Tt="tempest_link_7WM67",It="tempest_current_JdlcS",Lt="tempest_separator_zGWyJ",V={nav:$t,item:Ct,link:Tt,current:It,separator:Lt};function Pt({items:e,separator:t="/",className:n}){return a.jsx("nav",{"aria-label":"breadcrumb",className:y(V.nav,n),children:e.map((r,s)=>{const o=s===e.length-1,i=!o&&(r.href||r.onClick);return a.jsxs(u.Fragment,{children:[a.jsx("span",{className:V.item,children:i?a.jsx("a",{href:r.href,onClick:l=>{r.onClick&&(l.preventDefault(),r.onClick())},className:V.link,children:r.label}):a.jsx("span",{"aria-current":o?"page":void 0,className:o?V.current:void 0,children:r.label})}),!o&&a.jsx("span",{className:V.separator,"aria-hidden":!0,children:t})]},s)})})}const Rt="tempest_button_2ZuB7",Mt="tempest_primary_s1sM6",Dt="tempest_secondary_R0waJ",Ft="tempest_danger_V4fX8",At="tempest_ghost_1KINV",Wt="tempest_sm_NhG0g",Ot="tempest_md_hH4h3",Bt="tempest_lg_2plQf",Ut="tempest_fullWidth_36oJT",zt="tempest_loading_EQAt2",qt="tempest_hiddenText_hIiJ2",Jt="tempest_spinner_ZExvW",Gt="tempest_tempest-spin_UOSVC",B={button:Rt,primary:Mt,secondary:Dt,danger:Ft,ghost:At,sm:Wt,md:Ot,lg:Bt,fullWidth:Ut,loading:zt,hiddenText:qt,spinner:Jt,tempestSpin:Gt};function ne({variant:e="primary",size:t="md",loading:n=!1,fullWidth:r=!1,leftIcon:s,rightIcon:o,disabled:i,className:l,children:c,...d}){return a.jsxs("button",{className:y(B.button,B[e],B[t],n&&B.loading,r&&B.fullWidth,l),disabled:i||n,...d,children:[n&&a.jsx("span",{className:B.spinner,"aria-hidden":!0,children:a.jsx(Ht,{})}),a.jsxs("span",{className:y(n&&B.hiddenText),children:[s,c,o]})]})}function Ht(){return a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Kt="tempest_card_Cb1o4",Vt="tempest_padded_oOxwN",Qt="tempest_flush_aiDZi",Yt="tempest_header_PTXf2",Zt="tempest_title_mSgoo",Xt="tempest_body_W441Z",J={card:Kt,padded:Vt,flush:Qt,header:Yt,title:Zt,body:Xt};function en({title:e,actions:t,flush:n=!1,className:r,children:s,...o}){const i=e||t;return a.jsxs("div",{className:y(J.card,!i&&!n&&J.padded,n&&J.flush,r),...o,children:[i&&a.jsxs("header",{className:J.header,children:[typeof e=="string"?a.jsx("h3",{className:J.title,children:e}):e,t]}),i?a.jsx("div",{className:J.body,children:s}):s]})}const tn="tempest_wrapper_rpthW",nn="tempest_disabled_x7-eg",rn="tempest_input_2kt-h",sn="tempest_box_OCPee",on="tempest_labelWrap_Ktbp0",an="tempest_label_cwRtI",cn="tempest_description_rMhG1",U={wrapper:tn,disabled:nn,input:rn,box:sn,labelWrap:on,label:an,description:cn},ln=u.forwardRef(function({label:t,description:n,indeterminate:r,disabled:s,wrapperClassName:o,className:i,...l},c){const d=u.useRef(null);u.useEffect(()=>{d.current&&(d.current.indeterminate=!!r)},[r]);function p(f){d.current=f,typeof c=="function"?c(f):c&&(c.current=f)}return a.jsxs("label",{className:y(U.wrapper,s&&U.disabled,o),children:[a.jsx("input",{ref:p,type:"checkbox",disabled:s,className:y(U.input,i),...l}),a.jsx("span",{className:U.box,"aria-hidden":!0,children:r?a.jsx(dn,{}):a.jsx(un,{})}),(t||n)&&a.jsxs("span",{className:U.labelWrap,children:[t&&a.jsx("span",{className:U.label,children:t}),n&&a.jsx("span",{className:U.description,children:n})]})]})});function un(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function dn(){return a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const pn="tempest_wrapper_KR4-F",fn="tempest_label_Mz-wX",mn="tempest_field_iIBJw",hn="tempest_error_O9n-9",gn="tempest_chip_GEwrc",_n="tempest_remove_JYDIq",yn="tempest_input_frJmk",bn="tempest_helper_Yts53",wn="tempest_errorText_llJGq",R={wrapper:pn,label:fn,field:mn,error:hn,chip:gn,remove:_n,input:yn,helper:bn,errorText:wn};function vn({value:e,onChange:t,label:n,placeholder:r="Adicionar e pressionar Enter…",helperText:s,error:o,commitKeys:i=["Enter",",","Tab"],normalize:l=!0,className:c}){const[d,p]=u.useState(""),f=u.useRef(null);function m(){const g=l?d.trim().toLowerCase():d.trim();if(g){if(e.includes(g)){p("");return}t([...e,g]),p("")}}function h(g){if(i.includes(g.key)){g.preventDefault(),m();return}g.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function _(g){const w=e.slice();w.splice(g,1),t(w)}return a.jsxs("div",{className:y(R.wrapper,o&&R.error,c),children:[n&&a.jsx("label",{className:R.label,children:n}),a.jsxs("div",{className:R.field,onClick:()=>f.current?.focus(),children:[e.map((g,w)=>a.jsxs("span",{className:R.chip,children:[g,a.jsx("button",{type:"button",className:R.remove,"aria-label":`Remover ${g}`,onClick:()=>_(w),children:"×"})]},`${g}-${w}`)),a.jsx("input",{ref:f,className:R.input,value:d,placeholder:e.length===0?r:"",onChange:g=>p(g.target.value),onKeyDown:h,onBlur:m})]}),o?a.jsx("span",{className:R.errorText,children:o}):s?a.jsx("span",{className:R.helper,children:s}):null]})}const xn="tempest_overlay_dd9h1",jn="tempest_tempest-fade-in_DvgSp",Sn="tempest_dialog_ptM-K",kn="tempest_tempest-modal-in_UoxQC",Nn="tempest_sm_K5k3W",En="tempest_md_gvyR7",$n="tempest_lg_BgB1a",Cn="tempest_xl_MR-68",Tn="tempest_header_ILG9i",In="tempest_title_A5OeE",Ln="tempest_close_-ER1C",Pn="tempest_body_lVhql",Rn="tempest_footer_rro2w",A={overlay:xn,tempestFadeIn:jn,dialog:Sn,tempestModalIn:kn,sm:Nn,md:En,lg:$n,xl:Cn,header:Tn,title:In,close:Ln,body:Pn,footer:Rn};function Te({open:e,onClose:t,title:n,children:r,footer:s,size:o="md",closeOnBackdrop:i=!0,closeOnEsc:l=!0,className:c,hideCloseButton:d=!1}){return u.useEffect(()=>{if(!e)return;const p=document.body.style.overflow;document.body.style.overflow="hidden";const f=m=>{l&&m.key==="Escape"&&t()};return window.addEventListener("keydown",f),()=>{document.body.style.overflow=p,window.removeEventListener("keydown",f)}},[e,l,t]),!e||typeof document>"u"?null:ge.createPortal(a.jsx("div",{className:A.overlay,role:"presentation",onClick:()=>{i&&t()},children:a.jsxs("div",{role:"dialog","aria-modal":"true",className:y(A.dialog,A[o],c),onClick:p=>p.stopPropagation(),children:[(n||!d)&&a.jsxs("header",{className:A.header,children:[a.jsx("h3",{className:A.title,children:n}),!d&&a.jsx("button",{type:"button",className:A.close,"aria-label":"Fechar",onClick:t,children:a.jsx(Mn,{})})]}),a.jsx("div",{className:A.body,children:r}),s&&a.jsx("footer",{className:A.footer,children:s})]})}),document.body)}function Mn(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Dn({open:e,title:t,description:n,confirmLabel:r="Confirmar",cancelLabel:s="Cancelar",variant:o="primary",loading:i=!1,onConfirm:l,onCancel:c}){return a.jsx(Te,{open:e,onClose:c,title:t,size:"sm",footer:a.jsxs(a.Fragment,{children:[a.jsx(ne,{variant:"secondary",onClick:c,disabled:i,children:s}),a.jsx(ne,{variant:o,loading:i,onClick:()=>{l()},children:r})]}),children:n})}const Fn="tempest_wrapper_iHNUs",An="tempest_label_-OEBL",Wn="tempest_required_CTss-",On="tempest_field_65yGJ",Bn="tempest_input_WjT81",Un="tempest_hasLeftIcon_xYO-v",zn="tempest_hasRightIcon_C7uyr",qn="tempest_iconLeft_KrUhI",Jn="tempest_iconRight_Ssr47",Gn="tempest_error_VLISa",Hn="tempest_helper_7Vc-s",Kn="tempest_errorText_xz4xS",T={wrapper:Fn,label:An,required:Wn,field:On,input:Bn,hasLeftIcon:Un,hasRightIcon:zn,iconLeft:qn,iconRight:Jn,error:Gn,helper:Hn,errorText:Kn},re=u.forwardRef(function({label:t,helperText:n,error:r,leftIcon:s,rightIcon:o,wrapperClassName:i,className:l,id:c,required:d,...p},f){const m=u.useId(),h=c??m,_=r?`${h}-error`:n?`${h}-helper`:void 0;return a.jsxs("div",{className:y(T.wrapper,r&&T.error,i),children:[t&&a.jsxs("label",{htmlFor:h,className:T.label,children:[t,d&&a.jsx("span",{className:T.required,children:"*"})]}),a.jsxs("div",{className:T.field,children:[s&&a.jsx("span",{className:T.iconLeft,children:s}),a.jsx("input",{ref:f,id:h,"aria-invalid":!!r,"aria-describedby":_,required:d,className:y(T.input,s&&T.hasLeftIcon,o&&T.hasRightIcon,l),...p}),o&&a.jsx("span",{className:T.iconRight,children:o})]}),r?a.jsx("span",{id:`${h}-error`,className:T.errorText,children:r}):n?a.jsx("span",{id:`${h}-helper`,className:T.helper,children:n}):null]})}),Vn=u.forwardRef(function({value:t,onChange:n,mode:r="date",...s},o){return a.jsx(re,{...s,ref:o,type:r,value:t,onChange:i=>n(i.target.value)})}),Qn="tempest_overlay_hcG1G",Yn="tempest_tempest-drawer-overlay_XFbxY",Zn="tempest_panel_wUX0N",Xn="tempest_right_-oX-6",er="tempest_tempest-drawer-in-right_pWYHv",tr="tempest_left_xi3nD",nr="tempest_tempest-drawer-in-left_o7JSb",rr="tempest_top_7rGCn",sr="tempest_tempest-drawer-in-top_kn6AF",or="tempest_bottom_zd-25",ir="tempest_tempest-drawer-in-bottom_0x3u7",ar="tempest_header_sYoP1",cr="tempest_title_LqUOu",lr="tempest_close_tYPhU",ur="tempest_body_aV9FG",dr="tempest_footer_AuvUP",W={overlay:Qn,tempestDrawerOverlay:Yn,panel:Zn,right:Xn,tempestDrawerInRight:er,left:tr,tempestDrawerInLeft:nr,top:rr,tempestDrawerInTop:sr,bottom:or,tempestDrawerInBottom:ir,header:ar,title:cr,close:lr,body:ur,footer:dr};function pr({open:e,onClose:t,placement:n="right",title:r,children:s,footer:o,closeOnBackdrop:i=!0,closeOnEsc:l=!0,hideCloseButton:c=!1,className:d}){return u.useEffect(()=>{if(!e)return;const p=document.body.style.overflow;document.body.style.overflow="hidden";const f=m=>{l&&m.key==="Escape"&&t()};return window.addEventListener("keydown",f),()=>{document.body.style.overflow=p,window.removeEventListener("keydown",f)}},[e,l,t]),!e||typeof document>"u"?null:ge.createPortal(a.jsxs(a.Fragment,{children:[a.jsx("div",{className:W.overlay,onClick:()=>{i&&t()}}),a.jsxs("aside",{role:"dialog","aria-modal":"true",className:y(W.panel,W[n],d),children:[(r||!c)&&a.jsxs("header",{className:W.header,children:[a.jsx("h3",{className:W.title,children:r}),!c&&a.jsx("button",{type:"button","aria-label":"Fechar",className:W.close,onClick:t,children:a.jsx(fr,{})})]}),a.jsx("div",{className:W.body,children:s}),o&&a.jsx("footer",{className:W.footer,children:o})]})]}),document.body)}function fr(){return a.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const mr="tempest_wrapper_gzyTd",hr="tempest_icon_qVCyh",gr="tempest_title_xPfUf",_r="tempest_description_oWwH1",yr="tempest_action_dqxw1",Q={wrapper:mr,icon:hr,title:gr,description:_r,action:yr};function br({icon:e,title:t,description:n,action:r,className:s}){return a.jsxs("div",{className:y(Q.wrapper,s),children:[e&&a.jsx("div",{className:Q.icon,children:e}),a.jsx("h4",{className:Q.title,children:t}),n&&a.jsx("p",{className:Q.description,children:n}),r&&a.jsx("div",{className:Q.action,children:r})]})}const wr="tempest_wrapper_luRyF",vr="tempest_icon_dEdBl",xr="tempest_title_StutD",jr="tempest_description_A2XCb",Sr="tempest_action_vm1LC",Y={wrapper:wr,icon:vr,title:xr,description:jr,action:Sr};function kr({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:r="Tentar novamente",icon:s,className:o}){return a.jsxs("div",{className:y(Y.wrapper,o),children:[a.jsx("div",{className:Y.icon,children:s??a.jsx(Nr,{})}),a.jsx("h4",{className:Y.title,children:e}),t&&a.jsx("p",{className:Y.description,children:t}),n&&a.jsx("div",{className:Y.action,children:a.jsx(ne,{variant:"secondary",onClick:n,children:r})})]})}function Nr(){return a.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Er="tempest_wrapper_E0qHs",$r="tempest_label_lbMkx",Cr="tempest_dropzone_jqua0",Tr="tempest_active_CG9Uk",Ir="tempest_disabled_WNUUl",Lr="tempest_icon_i9fGH",Pr="tempest_title_bTVFl",Rr="tempest_subtitle_S54OV",Mr="tempest_files_WljYm",Dr="tempest_file_Lp-dR",Fr="tempest_fileMeta_LTnN2",Ar="tempest_remove_jskra",Wr="tempest_hidden_ReEq6",$={wrapper:Er,label:$r,dropzone:Cr,active:Tr,disabled:Ir,icon:Lr,title:Pr,subtitle:Rr,files:Mr,file:Dr,fileMeta:Fr,remove:Ar,hidden:Wr};function Or(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Br(e,t){if(!t)return!0;const n=t.split(",").map(o=>o.trim().toLowerCase()),r=e.name.toLowerCase(),s=e.type.toLowerCase();return n.some(o=>o.startsWith(".")?r.endsWith(o):o.endsWith("/*")?s.startsWith(o.replace("/*","/")):s===o)}function Ur({value:e,onChange:t,label:n,accept:r,multiple:s=!1,maxSize:o,onReject:i,disabled:l,title:c="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[f,m]=u.useState(!1),h=u.useRef(null);function _(b){const v=[],x=[];for(const E of Array.from(b)){if(!Br(E,r)){x.push({file:E,reason:"type"});continue}if(o&&E.size>o){x.push({file:E,reason:"size"});continue}v.push(E)}if(x.length>0&&i?.(x),v.length===0)return;const k=s?[...e,...v]:v.slice(0,1);t(k)}function g(b){b.preventDefault(),m(!1),!l&&b.dataTransfer?.files&&_(b.dataTransfer.files)}function w(b){const v=e.slice();v.splice(b,1),t(v)}return a.jsxs("div",{className:y($.wrapper,p),children:[n&&a.jsx("label",{className:$.label,children:n}),a.jsxs("div",{className:y($.dropzone,f&&$.active,l&&$.disabled),role:"button",tabIndex:l?-1:0,onClick:()=>!l&&h.current?.click(),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h.current?.click())},onDragEnter:b=>{b.preventDefault(),l||m(!0)},onDragOver:b=>b.preventDefault(),onDragLeave:()=>m(!1),onDrop:g,children:[a.jsx("div",{className:$.icon,"aria-hidden":!0,children:a.jsx(zr,{})}),a.jsx("p",{className:$.title,children:c}),d&&a.jsx("p",{className:$.subtitle,children:d}),a.jsx("input",{ref:h,type:"file",accept:r,multiple:s,disabled:l,className:$.hidden,onChange:b=>{b.target.files&&_(b.target.files),b.target.value=""}})]}),e.length>0&&a.jsx("ul",{className:$.files,children:e.map((b,v)=>a.jsxs("li",{className:$.file,children:[a.jsxs("div",{children:[a.jsx("div",{children:b.name}),a.jsx("div",{className:$.fileMeta,children:Or(b.size)})]}),a.jsx("button",{type:"button","aria-label":`Remover ${b.name}`,className:$.remove,onClick:()=>w(v),children:"×"})]},`${b.name}-${v}`))})]})}function zr(){return a.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const qr="tempest_form_jNBDR",Jr="tempest_stack_O1Hl-",Gr="tempest_inline_LBQAv",Hr="tempest_grid_-B86T",Kr="tempest_section_HGqw3",Vr="tempest_sectionHeader_ji9hQ",Qr="tempest_sectionTitle_GTPwe",Yr="tempest_sectionDescription_KjW7k",Zr="tempest_sectionBody_Vp2wz",Xr="tempest_row_1EkVR",es="tempest_actions_hK95I",ts="tempest_start_gXnm3",ns="tempest_center_mKkz4",rs="tempest_end_O3yDQ",ss="tempest_between_tte2z",P={form:qr,stack:Jr,inline:Gr,grid:Hr,section:Kr,sectionHeader:Vr,sectionTitle:Qr,sectionDescription:Yr,sectionBody:Zr,row:Xr,actions:es,start:ts,center:ns,end:rs,between:ss};function se(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function Ie(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const os=u.forwardRef(function({layout:t="stack",columns:n,gap:r,className:s,style:o,children:i,...l},c){const d={gap:se(r,4),...t==="grid"?{gridTemplateColumns:Ie(n)}:null,...o};return a.jsx("form",{ref:c,className:y(P.form,P[t],s),style:d,...l,children:i})});function is({title:e,description:t,layout:n="stack",columns:r,gap:s,className:o,style:i,children:l,...c}){const d={gap:se(s,4),...n==="grid"?{gridTemplateColumns:Ie(r)}:null};return a.jsxs("section",{className:y(P.section,o),style:i,...c,children:[(e||t)&&a.jsxs("header",{className:P.sectionHeader,children:[e&&a.jsx("h3",{className:P.sectionTitle,children:e}),t&&a.jsx("p",{className:P.sectionDescription,children:t})]}),a.jsx("div",{className:y(P.sectionBody,P[n]),style:d,children:l})]})}function as({gap:e,className:t,style:n,children:r,...s}){const o={gap:se(e,3),...n};return a.jsx("div",{className:y(P.row,t),style:o,...s,children:r})}function cs({align:e="end",gap:t,className:n,style:r,children:s,...o}){const i={gap:se(t,2),...r};return a.jsx("div",{className:y(P.actions,P[e],n),style:i,...o,children:s})}const ls="tempest_container_fJfOt",us="tempest_sm_k8D4-",ds="tempest_md_EnpYy",ps="tempest_lg_UU-Ig",fs="tempest_xl_2TEWj",ms="tempest_full_l8bvG",hs="tempest_stack_sxR8u",gs="tempest_vertical_2TMf5",_s="tempest_horizontal_r7-c-",ys="tempest_center_EDSAh",bs="tempest_start_ucQ-K",ws="tempest_end_pnKlF",vs="tempest_stretch_pX6l7",xs="tempest_justifyStart_lHYsS",js="tempest_justifyCenter_JH2m6",Ss="tempest_justifyEnd_EBisT",ks="tempest_justifyBetween_mAJwT",Ns="tempest_wrap_-xxOh",Es="tempest_grid_o-JIX",I={container:ls,sm:us,md:ds,lg:ps,xl:fs,full:ms,stack:hs,vertical:gs,horizontal:_s,center:ys,start:bs,end:ws,stretch:vs,justifyStart:xs,justifyCenter:js,justifyEnd:Ss,justifyBetween:ks,wrap:Ns,grid:Es};function $s({size:e="lg",className:t,children:n,...r}){return a.jsx("div",{className:y(I.container,I[e],t),...r,children:n})}function Cs({direction:e="vertical",gap:t=2,align:n,justify:r,wrap:s=!1,className:o,style:i,children:l,...c}){const p={gap:typeof t=="number"?`${t*4}px`:t,...i},f=r==="between"?I.justifyBetween:r==="center"?I.justifyCenter:r==="end"?I.justifyEnd:r==="start"?I.justifyStart:void 0;return a.jsx("div",{className:y(I.stack,e==="vertical"?I.vertical:I.horizontal,n&&I[n],f,s&&I.wrap,o),style:p,...c,children:l})}function Ts({columns:e=2,gap:t=4,className:n,style:r,children:s,...o}){const i=typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e,l=typeof t=="number"?`${t*4}px`:t;return a.jsx("div",{className:y(I.grid,n),style:{gridTemplateColumns:i,gap:l,...r},...o,children:s})}const Is="tempest_wrapper_cRGQm",Ls="tempest_controls_fdL-y",Ps="tempest_page_WjG0l",Rs="tempest_active_1kqsJ",Ms="tempest_ellipsis_V294k",Ds="tempest_sizeSelect_ZayTo",O={wrapper:Is,controls:Ls,page:Ps,active:Rs,ellipsis:Ms,sizeSelect:Ds};function Fs(e,t,n){const r=n+4;if(t<=r)return Array.from({length:t},(l,c)=>c+1);const s=Math.max(2,e-Math.floor(n/2)),o=Math.min(t-1,s+n-1),i=[1];s>2&&i.push("...");for(let l=s;l<=o;l++)i.push(l);return o<t-1&&i.push("..."),i.push(t),i}function As({page:e,totalPages:t,onPageChange:n,pageSize:r,onPageSizeChange:s,pageSizeOptions:o=[10,25,50,100],totalItems:i,siblingCount:l=3,className:c}){const d=u.useMemo(()=>Fs(e,t,l),[e,t,l]);return t<=1&&!s?null:a.jsxs("div",{className:y(O.wrapper,c),children:[a.jsx("div",{children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:null}),a.jsxs("div",{className:O.controls,children:[a.jsx("button",{type:"button",className:O.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,f)=>p==="..."?a.jsx("span",{className:O.ellipsis,children:"…"},`ellipsis-${f}`):a.jsx("button",{type:"button",className:y(O.page,p===e&&O.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),a.jsx("button",{type:"button",className:O.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),s&&a.jsx("select",{className:O.sizeSelect,value:r,onChange:p=>s(Number(p.target.value)),"aria-label":"Itens por página",children:o.map(p=>a.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const Ws="tempest_wrapper_BQek1",Os="tempest_bar_uC-0x",Bs="tempest_fill_vmg7x",Us="tempest_success_gWJ8U",zs="tempest_warning_DGkPO",qs="tempest_danger_gfwHh",Js="tempest_indeterminate_HojUj",Gs="tempest_tempest-progress-loop_0nEdF",Hs="tempest_label_qqHJM",G={wrapper:Ws,bar:Os,fill:Bs,success:Us,warning:zs,danger:qs,indeterminate:Js,tempestProgressLoop:Gs,label:Hs};function Ks({value:e=0,max:t=100,variant:n="primary",indeterminate:r=!1,showLabel:s=!1,label:o,className:i}){const l=r?0:Math.max(0,Math.min(100,e/t*100));return a.jsxs("div",{className:y(G.wrapper,i),children:[(s||o)&&a.jsxs("div",{className:G.label,children:[o&&a.jsx("span",{children:o}),s&&!r&&a.jsxs("span",{children:[Math.round(l),"%"]})]}),a.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":r?void 0:e,className:y(G.bar,r&&G.indeterminate),children:a.jsx("div",{className:y(G.fill,n!=="primary"&&G[n]),style:{width:r?void 0:`${l}%`}})})]})}const Vs="tempest_wrapper_P-gFm",Qs="tempest_disabled_0-cna",Ys="tempest_input_7R8ZN",Zs="tempest_dot_P7ejP",Xs="tempest_labelWrap_iQ1HR",eo="tempest_label_vAFIP",to="tempest_description_bEB8u",no="tempest_group_oi329",ro="tempest_horizontal_1Ovgu",F={wrapper:Vs,disabled:Qs,input:Ys,dot:Zs,labelWrap:Xs,label:eo,description:to,group:no,horizontal:ro},Le=u.createContext(null),so=u.forwardRef(function({label:t,description:n,value:r,disabled:s,name:o,checked:i,onChange:l,wrapperClassName:c,className:d,...p},f){const m=u.useContext(Le),h=m?.name??o,_=m?.disabled??s,g=m?m.value===r:i;function w(b){m&&m.onChange?.(r),l?.(b)}return a.jsxs("label",{className:y(F.wrapper,_&&F.disabled,c),children:[a.jsx("input",{ref:f,type:"radio",name:h,value:r,checked:g,disabled:_,onChange:w,className:y(F.input,d),...p}),a.jsx("span",{className:F.dot,"aria-hidden":!0}),(t||n)&&a.jsxs("span",{className:F.labelWrap,children:[t&&a.jsx("span",{className:F.label,children:t}),n&&a.jsx("span",{className:F.description,children:n})]})]})});function oo({value:e,defaultValue:t,onChange:n,name:r,disabled:s,horizontal:o=!1,className:i,children:l}){const c=u.useId(),d=r??c,[p,f]=u.useState(t),m=e!==void 0,h=m?e:p;function _(g){m||f(g),n?.(g)}return a.jsx(Le.Provider,{value:{name:d,value:h,onChange:_,disabled:s},children:a.jsx("div",{role:"radiogroup",className:y(F.group,o&&F.horizontal,i),children:l})})}const io="tempest_wrapper_dKXJJ",ao="tempest_input_m0lPc",co="tempest_iconLeft_030-U",lo="tempest_clear_nb6lG",te={wrapper:io,input:ao,iconLeft:co,clear:lo},uo=u.forwardRef(function({value:t,onChange:n,onClear:r,wrapperClassName:s,placeholder:o="Buscar...",className:i,...l},c){function d(){n(""),r?.()}return a.jsxs("div",{className:y(te.wrapper,s),children:[a.jsx("span",{className:te.iconLeft,"aria-hidden":!0,children:a.jsx(po,{})}),a.jsx("input",{ref:c,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:o,className:y(te.input,i),...l}),t&&a.jsx("button",{type:"button",className:te.clear,"aria-label":"Limpar busca",onClick:d,children:a.jsx(fo,{})})]})});function po(){return a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),a.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function fo(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const mo="tempest_wrapper_KS2K3",ho="tempest_label_Lmgos",go="tempest_required_PvDVJ",_o="tempest_field_h-wBy",yo="tempest_select_cjdcr",bo="tempest_caret_MdCao",wo="tempest_error_sw9MU",vo="tempest_helper_frosK",xo="tempest_errorText_-zd6i",M={wrapper:mo,label:ho,required:go,field:_o,select:yo,caret:bo,error:wo,helper:vo,errorText:xo},jo=u.forwardRef(function({label:t,helperText:n,error:r,options:s,placeholder:o,wrapperClassName:i,className:l,children:c,id:d,required:p,...f},m){const h=u.useId(),_=d??h;return a.jsxs("div",{className:y(M.wrapper,r&&M.error,i),children:[t&&a.jsxs("label",{htmlFor:_,className:M.label,children:[t,p&&a.jsx("span",{className:M.required,children:"*"})]}),a.jsxs("div",{className:M.field,children:[a.jsxs("select",{ref:m,id:_,"aria-invalid":!!r,required:p,className:y(M.select,l),...f,children:[o&&a.jsx("option",{value:"",disabled:!0,hidden:!0,children:o}),s?.map(g=>a.jsx("option",{value:g.value,disabled:g.disabled,children:g.label},g.value)),c]}),a.jsx("span",{className:M.caret,"aria-hidden":!0,children:a.jsx(So,{})})]}),r?a.jsx("span",{className:M.errorText,children:r}):n?a.jsx("span",{className:M.helper,children:n}):null]})});function So(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const ko="tempest_skeleton_CB4uF",No="tempest_text_-A8IF",Eo="tempest_circle_DYcl8",le={skeleton:ko,text:No,circle:Eo};function $o({variant:e="rect",width:t,height:n,className:r,style:s}){return a.jsx("span",{"aria-hidden":!0,className:y(le.skeleton,e==="text"&&le.text,e==="circle"&&le.circle,r),style:{width:t,height:n,...s}})}const Co="tempest_spinner_GpFZS",To="tempest_tempest-spinner_wKVCY",Io="tempest_sm_3sIoD",Lo="tempest_md_M2sPj",Po="tempest_lg_IxTw2",je={spinner:Co,tempestSpinner:To,sm:Io,md:Lo,lg:Po};function Ro({size:e="md",className:t,label:n="Carregando"}){return a.jsx("span",{role:"status","aria-label":n,className:y(je.spinner,je[e],t)})}const Mo="tempest_stepper_w3qjQ",Do="tempest_vertical_d4mOs",Fo="tempest_step_s2nqL",Ao="tempest_dot_d1bSL",Wo="tempest_completed_gcFHM",Oo="tempest_active_kL-CH",Bo="tempest_label_8irAI",Uo="tempest_connector_lyeWp",D={stepper:Mo,vertical:Do,step:Fo,dot:Ao,completed:Wo,active:Oo,label:Bo,connector:Uo};function zo({steps:e,current:t,orientation:n="horizontal",className:r}){return a.jsx("ol",{className:y(D.stepper,n==="vertical"&&D.vertical,r),children:e.map((s,o)=>{const i=o<t,l=o===t;return a.jsxs(u.Fragment,{children:[a.jsxs("li",{className:y(D.step,i&&D.completed,l&&D.active),"aria-current":l?"step":void 0,children:[a.jsx("span",{className:D.dot,children:i?"✓":o+1}),a.jsx("span",{className:D.label,children:s.label})]}),o<e.length-1&&a.jsx("span",{className:y(D.connector,i&&D.completed),"aria-hidden":!0})]},o)})})}const qo="tempest_wrapper_kudO9",Jo="tempest_disabled_2aZ0V",Go="tempest_input_5BPNu",Ho="tempest_track_7ObdZ",Ko="tempest_thumb_-FTeK",Vo="tempest_label_LrH7V",H={wrapper:qo,disabled:Jo,input:Go,track:Ho,thumb:Ko,label:Vo},Qo=u.forwardRef(function({label:t,disabled:n,wrapperClassName:r,className:s,...o},i){return a.jsxs("label",{className:y(H.wrapper,n&&H.disabled,r),children:[a.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:y(H.input,s),...o}),a.jsx("span",{className:H.track,"aria-hidden":!0,children:a.jsx("span",{className:H.thumb})}),t&&a.jsx("span",{className:H.label,children:t})]})}),Yo="tempest_scroll_unrJp",Zo="tempest_table_Dkosn",Xo="tempest_th_PNuEx",ei="tempest_td_jv9tA",ti="tempest_tr_7UG8J",ni="tempest_clickable_B6Si-",ri="tempest_alignRight_9hY0G",si="tempest_alignCenter_YiUQy",oi="tempest_emptyRow_kdMiv",L={scroll:Yo,table:Zo,th:Xo,td:ei,tr:ti,clickable:ni,alignRight:ri,alignCenter:si,emptyRow:oi};function ii({columns:e,data:t,rowKey:n,onRowClick:r,emptyMessage:s="Nenhum registro encontrado.",className:o}){return a.jsx("div",{className:y(L.scroll,o),children:a.jsxs("table",{className:L.table,children:[a.jsx("thead",{children:a.jsx("tr",{children:e.map(i=>a.jsx("th",{className:y(L.th,i.align==="right"&&L.alignRight,i.align==="center"&&L.alignCenter),style:{width:i.width},children:i.header},i.key))})}),a.jsx("tbody",{children:t.length===0?a.jsx("tr",{children:a.jsx("td",{className:L.emptyRow,colSpan:e.length,children:s})}):t.map((i,l)=>a.jsx("tr",{className:y(L.tr,r&&L.clickable),onClick:r?()=>r(i):void 0,children:e.map(c=>{const d=c.render?c.render(i,l):i[c.key];return a.jsx("td",{className:y(L.td,c.align==="right"&&L.alignRight,c.align==="center"&&L.alignCenter,c.className),children:d},c.key)})},n(i,l)))})]})})}const ai="tempest_tablist_WR6ag",ci="tempest_tab_IdDYc",li="tempest_active_PTNtG",ui="tempest_panel_08i9c",di="tempest_pill_lGuqn",Z={tablist:ai,tab:ci,active:li,panel:ui,pill:di};function pi({items:e,defaultId:t,activeId:n,onChange:r,variant:s="underline",className:o}){const i=e.find(h=>!h.disabled),[l,c]=u.useState(t??i?.id),d=n!==void 0,p=d?n:l,f=e.find(h=>h.id===p)??i;function m(h){d||c(h),r?.(h)}return a.jsxs("div",{className:o,children:[a.jsx("div",{role:"tablist",className:y(Z.tablist,s==="pill"&&Z.pill),children:e.map(h=>{const _=h.id===f?.id;return a.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:y(Z.tab,_&&Z.active),onClick:()=>m(h.id),children:h.label},h.id)})}),f&&a.jsx("div",{role:"tabpanel",id:`panel-${f.id}`,"aria-labelledby":`tab-${f.id}`,className:Z.panel,children:f.content})]})}const fi="tempest_wrapper_C0gfg",mi="tempest_label_cWLXP",hi="tempest_required_rDZXE",gi="tempest_textarea_Z-y6g",_i="tempest_error_NWC9f",yi="tempest_helper_gedut",bi="tempest_errorText_ey07q",z={wrapper:fi,label:mi,required:hi,textarea:gi,error:_i,helper:yi,errorText:bi},wi=u.forwardRef(function({label:t,helperText:n,error:r,wrapperClassName:s,className:o,id:i,required:l,...c},d){const p=u.useId(),f=i??p;return a.jsxs("div",{className:y(z.wrapper,r&&z.error,s),children:[t&&a.jsxs("label",{htmlFor:f,className:z.label,children:[t,l&&a.jsx("span",{className:z.required,children:"*"})]}),a.jsx("textarea",{ref:d,id:f,"aria-invalid":!!r,required:l,className:y(z.textarea,o),...c}),r?a.jsx("span",{className:z.errorText,children:r}):n?a.jsx("span",{className:z.helper,children:n}):null]})}),vi="tempest_trigger_Dmc5E",xi="tempest_bubble_TPGHB",ji="tempest_tempest-tooltip-in_csYeZ",Si="tempest_top_m2tnn",ki="tempest_bottom_9Twz4",Ni="tempest_left_UPdrG",Ei="tempest_right_CV--T",ue={trigger:vi,bubble:xi,tempestTooltipIn:ji,top:Si,bottom:ki,left:Ni,right:Ei};function $i({content:e,placement:t="top",children:n,disabled:r=!1,openDelay:s=150}){const[o,i]=u.useState(!1),l=u.useId();let c=null;function d(){r||(c&&clearTimeout(c),c=setTimeout(()=>i(!0),s))}function p(){c&&(clearTimeout(c),c=null),i(!1)}const f=u.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":o?l:void 0});return a.jsxs("span",{className:ue.trigger,children:[f,o&&a.jsx("span",{id:l,role:"tooltip",className:y(ue.bubble,ue[t]),children:e})]})}const Ci="tempest_container_x4-Qm",Ti="tempest_toast_FLdHz",Ii="tempest_tempest-toast-in_E2d-A",Li="tempest_success_Oy694",Pi="tempest_warning_84GC8",Ri="tempest_error_hrQAA",Mi="tempest_info_eq5bQ",Di="tempest_title_-H6R2",Fi="tempest_description_-QwfC",Ai="tempest_close_i10-s",K={container:Ci,toast:Ti,tempestToastIn:Ii,success:Li,warning:Pi,error:Ri,info:Mi,title:Di,description:Fi,close:Ai},Pe=u.createContext(null);function Wi(){const e=u.useContext(Pe);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function Oi({children:e,defaultDuration:t=4e3}){const[n,r]=u.useState([]),s=u.useRef(0),o=u.useCallback(c=>{r(d=>d.filter(p=>p.id!==c))},[]),i=u.useCallback(c=>{const d=c.id??`toast-${++s.current}`,p={id:d,title:c.title,description:c.description,variant:c.variant??"info",duration:c.duration??t};return r(f=>[...f,p]),d},[t]),l=u.useMemo(()=>({show:i,dismiss:o,success:(c,d)=>i({...d,description:c,variant:"success"}),error:(c,d)=>i({...d,description:c,variant:"error"}),warning:(c,d)=>i({...d,description:c,variant:"warning"}),info:(c,d)=>i({...d,description:c,variant:"info"})}),[i,o]);return a.jsxs(Pe.Provider,{value:l,children:[e,a.jsx(Bi,{toasts:n,onDismiss:o})]})}function Bi({toasts:e,onDismiss:t}){return typeof document>"u"?null:ge.createPortal(a.jsx("div",{className:K.container,"aria-live":"polite","aria-atomic":"true",children:e.map(n=>a.jsx(Ui,{toast:n,onDismiss:t},n.id))}),document.body)}function Ui({toast:e,onDismiss:t}){return u.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),a.jsxs("div",{className:y(K.toast,K[e.variant]),role:"status",children:[a.jsxs("div",{children:[e.title&&a.jsx("p",{className:K.title,children:e.title}),e.description&&a.jsx("p",{className:K.description,children:e.description})]}),a.jsx("button",{type:"button",className:K.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:a.jsx(zi,{})})]})}function zi(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:a.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const qi="tempest_scroll_8Giwl",Ji="tempest_spacer_P3Pvl",Gi="tempest_row_Ff0VU",de={scroll:qi,spacer:Ji,row:Gi};function Hi({items:e,itemHeight:t,renderItem:n,height:r,overscan:s=4,getKey:o,className:i,style:l}){const c=u.useRef(null),[d,p]=u.useState(0),[f,m]=u.useState(0);u.useEffect(()=>{const b=c.current;if(!b||(m(b.clientHeight),typeof ResizeObserver>"u"))return;const v=new ResizeObserver(()=>m(b.clientHeight));return v.observe(b),()=>v.disconnect()},[]);const h=e.length*t,_=Math.max(0,Math.floor(d/t)-s),g=Math.ceil(f/t)+s*2,w=Math.min(e.length,_+g);return a.jsx("div",{ref:c,className:y(de.scroll,i),style:{height:r,...l},onScroll:b=>p(b.target.scrollTop),role:"list",children:a.jsx("div",{className:de.spacer,style:{height:h},children:e.slice(_,w).map((b,v)=>{const x=_+v,k=o?o(b,x):x;return a.jsx("div",{role:"listitem",className:de.row,style:{top:x*t,height:t},children:n(b,x)},k)})})})}function Ki(e,t=300){const[n,r]=u.useState(e);return u.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),n}function Vi(e=1,t=50){const[n,r]=u.useState(e),[s,o]=u.useState(t),i=u.useCallback(()=>r(1),[]);return{page:n,size:s,setPage:r,setSize:o,reset:i}}function Qi(e,t,n){return u.useMemo(()=>{const r=t.trim().toLowerCase();return r?typeof n=="function"?e.filter(s=>n(s,r)):e.filter(s=>n.some(o=>{const i=s[o];return i!=null&&String(i).toLowerCase().includes(r)})):e},[e,t,n])}function Yi(e){const[t,n]=u.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return u.useEffect(()=>{if(typeof window>"u")return;const r=window.matchMedia(e),s=o=>n(o.matches);return n(r.matches),r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),t}function Zi(){const[e,t]=u.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return u.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}},[]),e}function Xi(){const[e,t]=u.useState(()=>typeof document>"u"?"visible":document.visibilityState);return u.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function ea(e,t={}){const[n,r]=u.useState(null),{once:s=!1,root:o,rootMargin:i,threshold:l}=t;return u.useEffect(()=>{const c=e.current;if(!c||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(r(p),s&&p.isIntersecting&&d.unobserve(c))},{root:o,rootMargin:i,threshold:l});return d.observe(c),()=>d.disconnect()},[e,s,o,i,l]),n}function ta(e){const[t,n]=u.useState(null);return u.useEffect(()=>{const r=e.current;if(!r||typeof ResizeObserver>"u")return;const s=new ResizeObserver(o=>{const i=o[0];if(!i)return;const l=i.contentRect;n({width:l.width,height:l.height})});return s.observe(r),()=>s.disconnect()},[e]),t}function na(e={}){const{resetAfter:t=1500}=e,[n,r]=u.useState(!1),s=u.useRef(null),o=u.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null),r(!1)},[]);u.useEffect(()=>()=>o(),[o]);const i=u.useCallback(async l=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(l);else if(typeof document<"u"){const c=document.createElement("textarea");c.value=l,c.style.position="fixed",c.style.opacity="0",document.body.appendChild(c),c.select(),document.execCommand("copy"),document.body.removeChild(c)}else return!1;return r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:o}}function ra(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,r=!!t.meta,s=!!t.shift,o=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==r)return!1;return!(e.shiftKey!==s||e.altKey!==o)}function sa(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function oa(e,t,n={}){const{disabled:r=!1,ignoreInput:s=!0}=n;u.useEffect(()=>{if(r||typeof window>"u")return;const o=i=>{s&&sa(i.target)||ra(i,e)&&t(i)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r,s,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}function ia(){const[e,t]=u.useState(null),[n,r]=u.useState(!1);u.useEffect(()=>{if(typeof window>"u")return;const o=l=>{l.preventDefault(),t(l)},i=()=>{t(null),r(!0)};return window.addEventListener("beforeinstallprompt",o),window.addEventListener("appinstalled",i),()=>{window.removeEventListener("beforeinstallprompt",o),window.removeEventListener("appinstalled",i)}},[]);const s=u.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const o=await e.userChoice;return t(null),o.outcome==="accepted"&&r(!0),o.outcome},[e]);return{installable:!!e,installed:n,prompt:s}}const Se=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function aa(e=6e4){const[t,n]=u.useState(!1);return u.useEffect(()=>{if(typeof window>"u")return;let r=setTimeout(()=>n(!0),e);function s(){n(!1),clearTimeout(r),r=setTimeout(()=>n(!0),e)}for(const o of Se)window.addEventListener(o,s,{passive:!0});return()=>{clearTimeout(r);for(const o of Se)window.removeEventListener(o,s)}},[e]),t}function ca(e={}){const{watch:t=!1,disabled:n=!1,...r}=e,[s,o]=u.useState({loading:!n,error:null,coords:null,timestamp:null});return u.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){o(c=>({...c,loading:!1}));return}const i=c=>{o({loading:!1,error:null,coords:c.coords,timestamp:c.timestamp})},l=c=>{o(d=>({...d,loading:!1,error:c}))};if(t){const c=navigator.geolocation.watchPosition(i,l,r);return()=>navigator.geolocation.clearWatch(c)}navigator.geolocation.getCurrentPosition(i,l,r)},[n,t,r.enableHighAccuracy,r.maximumAge,r.timeout]),s}function la(e){u.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}const ua=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function da(e,t){u.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const r=document.activeElement;function s(){return Array.from(n?.querySelectorAll(ua)??[]).filter(l=>{if(l.hasAttribute("aria-hidden"))return!1;const c=typeof window<"u"?window.getComputedStyle(l):null;return!(c&&(c.display==="none"||c.visibility==="hidden"))})}function o(l){if(l.key!=="Tab")return;const c=s();if(c.length===0){l.preventDefault();return}const d=c[0],p=c[c.length-1],f=document.activeElement;l.shiftKey?(f===d||!f||!n?.contains(f))&&(l.preventDefault(),p.focus()):f===p&&(l.preventDefault(),d.focus())}return s()[0]?.focus(),document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),r?.focus?.()}},[e,t])}function pa(e){const t=u.useRef(e);return t.current=e,u.useCallback((...n)=>t.current(...n),[])}function me(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>me(s,t[o]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>me(e[s],t[s]))}function fa(e){const t=u.useRef(e);return me(t.current,e)||(t.current=e),t.current}function ma(e,t,n){const r=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[s,o]of Object.entries(n))o!=null&&r.searchParams.set(s,String(o));return r.toString()}function ha(e){return typeof FormData<"u"&&e instanceof FormData}async function ke(e){let t=null;try{t=await e.clone().json()}catch{try{t=await e.text()}catch{t=null}}const n=(typeof t=="object"&&t!==null?t.detail??t.message:void 0)??`Erro ${e.status}`;return{status:e.status,detail:String(n),body:t}}function ga(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function r(i,l){const{body:c,params:d,headers:p,...f}=l,m=ha(c),h={...m?{}:{"Content-Type":"application/json"},...e.headers,...n(),...p},_={...f,headers:h,credentials:e.withCredentials?"include":f.credentials,body:c==null?void 0:m?c:JSON.stringify(c)};return t(ma(e.baseURL,i,d),_)}async function s(i,l={}){let c=await r(i,l);if(c.status===401)if(e.refresh)try{await e.refresh(),c=await r(i,l)}catch{throw await e.onUnauthorized?.(c),await ke(c)}else await e.onUnauthorized?.(c);if(!c.ok)throw await ke(c);return c.status===204?void 0:(c.headers.get("content-type")??"").includes("application/json")?await c.json():await c.text()}async function o(i,l,c="POST"){return s(i,{method:c,body:l})}return{request:s,get:(i,l)=>s(i,{...l,method:"GET"}),post:(i,l)=>s(i,{...l,method:"POST"}),put:(i,l)=>s(i,{...l,method:"PUT"}),patch:(i,l)=>s(i,{...l,method:"PATCH"}),delete:(i,l)=>s(i,{...l,method:"DELETE"}),upload:o}}function _a(e,t,n){const r=e.safeParse(t);if(r.success)return r.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const o=r.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
|
|
2
2
|
`);throw new Error(`[parseResponse] Contract drift on ${n}:
|
|
3
3
|
${o}
|
|
4
4
|
|
|
5
|
-
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function Qi(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function Yi(e){const{url:t,body:n,method:r="POST",headers:s={},getToken:o,withCredentials:i=!1,onProgress:l,signal:c,parser:d=JSON.parse}=e;return new Promise((f,p)=>{if(c?.aborted){p(new DOMException("Aborted","AbortError"));return}const m=new XMLHttpRequest;m.open(r,t),m.withCredentials=i;const h=o?.(),y={...s};h&&!("Authorization"in y)&&(y.Authorization=`Bearer ${h}`);for(const[w,_]of Object.entries(y))m.setRequestHeader(w,_);l&&(m.upload.onprogress=w=>{l({loaded:w.loaded,total:w.total,fraction:w.lengthComputable?w.loaded/w.total:null,lengthComputable:w.lengthComputable})});function g(){m.abort()}c?.addEventListener("abort",g),m.onload=()=>{c?.removeEventListener("abort",g);const w=m.status>=200&&m.status<300,_=m.getResponseHeader("content-type")??"";if(!w){const v=Qi(m.responseText),x=(typeof v=="object"&&v!==null?v.detail??v.message:void 0)??`Erro ${m.status}`,k={status:m.status,detail:String(x),body:v};p(k);return}if(m.status===204||!m.responseText){f(void 0);return}if(_.includes("application/json"))try{f(d(m.responseText))}catch(v){p(v)}else f(m.responseText)},m.onerror=()=>{c?.removeEventListener("abort",g),p({status:0,detail:"Falha de rede no upload."})},m.onabort=()=>{c?.removeEventListener("abort",g),p(new DOMException("Aborted","AbortError"))},m.send(n)})}function Zi(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new DOMException("Aborted","AbortError"));return}const s=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(s),r(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Xi(e,t={}){const{retries:n=3,initialDelay:r=300,maxDelay:s=1e4,shouldRetry:o=()=>!0,onRetry:i,signal:l}=t;let c=0,d;for(;c<n;){if(l?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(f){if(d=f,c+=1,c>=n||!o(f,c))throw f;const p=Math.min(r*2**(c-1),s);i?.({attempt:c,delay:p,error:f}),await Zi(p,l)}}throw d}function ea(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function ta(e,t){const{interval:n,disabled:r=!1,stopWhen:s,onError:o}=t,[i,l]=u.useState(null),[c,d]=u.useState(null),[f,p]=u.useState(!r),m=u.useRef(r),h=u.useRef(!1),y=u.useRef(null);async function g(){if(!(m.current||h.current)){h.current=!0;try{const w=await e();if(m.current)return;l(w),d(null),s?.(w)&&(m.current=!0)}catch(w){m.current||(d(w),o?.(w))}finally{h.current=!1,p(!1),m.current||(y.current=setTimeout(g,n))}}}return u.useEffect(()=>{if(m.current=r,r){y.current&&clearTimeout(y.current);return}return p(!0),g(),()=>{m.current=!0,y.current&&clearTimeout(y.current)}},[n,r]),{data:i,error:c,loading:f,stop:()=>{m.current=!0,y.current&&clearTimeout(y.current)},start:()=>{m.current&&(m.current=!1,g())}}}function na(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return tt.create()(be.persist(r=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:s,token:o})=>r({user:s,token:o,isAuthenticated:!0}),setUser:s=>r({user:s}),setToken:s=>r({token:s,isAuthenticated:!!s}),logout:()=>r({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:be.createJSONStorage(n),partialize:r=>({user:r.user,token:r.token}),onRehydrateStorage:()=>r=>{r&&(r.isAuthenticated=!!r.token)}}))}function ra({isAuthenticated:e,children:t,fallback:n}){return a.jsx(a.Fragment,{children:e?t:n})}function Se(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function Ie(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,r,s]=t;try{return{header:JSON.parse(Se(n)),payload:JSON.parse(Se(r)),signature:s}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function sa(e,t=0){try{const{payload:n}=Ie(e);if(typeof n.exp!="number")return!0;const r=Math.floor(Date.now()/1e3);return n.exp<=r+t}catch{return!0}}function oa(e,t={}){const{retries:n=3,initialDelay:r=400,reloadOnFinalFailure:s=!0}=t;async function o(i=1){try{return await e()}catch(l){if(i>=n)throw s&&typeof window<"u"&&window.location.reload(),l;return await new Promise(c=>setTimeout(c,r*2**(i-1))),o(i+1)}}return u.lazy(o)}function ia(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}const Le={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},Pe={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},aa={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function ca(e,t){const n={all:[e]};for(const[r,s]of Object.entries(t))typeof s=="function"?n[r]=(...o)=>[e,...s(...o)]:n[r]=[e,...s];return n}function la({children:e,client:t,defaultOptions:n}){const[r]=u.useState(()=>t??new _e.QueryClient({defaultOptions:{queries:{staleTime:Le.DEFAULT,gcTime:Pe.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return a.jsx(_e.QueryClientProvider,{client:r,children:e})}function ua(e){try{return JSON.parse(e)}catch{return e}}function Re(e,t={}){const{withCredentials:n=!1,namedEvents:r=[],heartbeatEvents:s=["ping"],maxRetries:o=10,initialBackoff:i=1e3,maxBackoff:l=3e4,parser:c=ua,onOpen:d,onMessage:f,onError:p,onStatusChange:m}=t;let h=null,y=null,g=0,w="idle",_=!1;function v(j){w!==j&&(w=j,m?.(j))}function x(j,E){s.includes(j)||f?.({event:j,data:c(E.data),id:E.lastEventId||void 0,raw:E})}function k(){if(_)return;if(g>=o){v("error");return}const j=Math.min(i*2**g,l);g+=1,y=setTimeout(N,j)}function N(){if(_)return;h&&h.close(),v("connecting");const j=new EventSource(e,{withCredentials:n});h=j,j.onopen=()=>{g=0,v("open"),d?.()},j.onmessage=E=>x("message",E);for(const E of r)j.addEventListener(E,ie=>x(E,ie));for(const E of s)j.addEventListener(E,()=>{});j.onerror=E=>{p?.(E),j.close(),h=null,v("closed"),k()}}function se(){_=!0,y&&(clearTimeout(y),y=null),g=0,h&&(h.close(),h=null),v("closed")}function oe(){y&&(clearTimeout(y),y=null),g=0,_=!1,N()}return N(),{close:se,reconnect:oe,get status(){return w}}}function da(e,t={}){const{enabled:n=!0,onMessage:r,...s}=t,[o,i]=u.useState("idle"),[l,c]=u.useState(null),d=u.useRef(null),f=u.useRef(r);return f.current=r,u.useEffect(()=>{if(!n||!e){i("idle");return}const p=Re(e,{...s,onStatusChange:i,onMessage:m=>{c(m),f.current?.(m)}});return d.current=p.reconnect,()=>{p.close(),d.current=null}},[e,n]),{status:o,lastMessage:l,reconnect:()=>d.current?.()}}function Me(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),s=new ArrayBuffer(r.length),o=new Uint8Array(s);for(let i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return o}function Z(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class pe extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class De extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class Ae{config;constructor(t){this.config=t}static isSupported(){return Z()}async registration(){if(!Z())throw new pe;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new pe;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return Z()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new De;const n=await this.registration(),r=await n.pushManager.getSubscription();if(r)return await this.config.onSubscribe(r.toJSON()),r;const s=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Me(this.config.vapidPublicKey)});return await this.config.onSubscribe(s.toJSON()),s}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function fa(e){const t=u.useRef(e);t.current=e;const n=u.useMemo(()=>new Ae({vapidPublicKey:e.vapidPublicKey,onSubscribe:g=>t.current.onSubscribe(g),onUnsubscribe:g=>t.current.onUnsubscribe?.(g),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[r]=u.useState(()=>Z()),[s,o]=u.useState(()=>n.permission()),[i,l]=u.useState(!1),[c,d]=u.useState(!1),[f,p]=u.useState(null),m=u.useCallback(async()=>{if(r){o(n.permission());try{const g=await n.isSubscribed();l(g)}catch(g){p(g instanceof Error?g:new Error(String(g)))}}},[n,r]);u.useEffect(()=>{m()},[m]);const h=u.useCallback(async()=>{if(r){d(!0),p(null);try{await n.subscribe(),l(!0),o(n.permission())}catch(g){throw p(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,r]),y=u.useCallback(async()=>{if(r){d(!0),p(null);try{await n.unsubscribe(),l(!1)}catch(g){throw p(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,r]);return{supported:r,permission:s,subscribed:i,loading:c,error:f,subscribe:h,unsubscribe:y,refresh:m}}async function pa(e){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{const t=await navigator.serviceWorker.register(e.url,{scope:e.scope});return t.active&&e.onReady?.(t),t.addEventListener("updatefound",()=>{const n=t.installing;n&&n.addEventListener("statechange",()=>{n.state==="installed"&&navigator.serviceWorker.controller&&e.onUpdate?.(n,t)})}),t}catch(t){return e.onError?.(t),null}}function ma(e){e.postMessage({type:"SKIP_WAITING"})}async function ha(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return 0;const e=await navigator.serviceWorker.getRegistrations();let t=0;for(const n of e)await n.unregister()&&(t+=1);return t}function he(){return globalThis}function ga(e={}){const t=he(),{defaultTitle:n="Notificação",defaultIcon:r,defaultBadge:s,transform:o}=e;t.addEventListener("push",i=>{if(!i.data)return;let l;try{l=i.data.json()}catch{l={title:n,body:i.data.text()}}const c=o?o(l):l;if(!c)return;const d=c.title??n,f={body:c.body,icon:c.icon??r,badge:c.badge??s,image:c.image,tag:c.tag,data:{url:c.url??"/",...c.data??{}}};i.waitUntil(t.registration.showNotification(d,f))})}function ya(e={}){const t=he(),n=e.resolveUrl??(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"&&"url"in r){const s=r.url;return typeof s=="string"?s:"/"}return"/"});t.addEventListener("notificationclick",r=>{r.notification.close();const s=n(r.notification.data);r.waitUntil((async()=>{const o=await t.clients.matchAll({type:"window",includeUncontrolled:!0});for(const i of o)if(i.url.includes(s))return i.focus();return t.clients.openWindow(s)})())})}function _a(){const e=he();e.addEventListener("message",t=>{t.data?.type==="SKIP_WAITING"&&e.skipWaiting()})}function ge(){let e=null;async function t(r,{volume:s=1,loop:o=!1,autoplay:i=!0,stopPrevious:l=!1,onEnded:c,onError:d}={}){try{l&&e&&(e.pause(),e.currentTime=0);const f=new Audio(r);return f.volume=Math.max(0,Math.min(1,s)),f.loop=o,f.preload="auto",c&&(f.onended=c),d&&(f.onerror=p=>d(p)),e=f,i&&await f.play(),f}catch(f){return d?.(f),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let ue=null;function Fe(){return ue||(ue=ge()),ue}async function ba(e,t){return Fe().play(e,t)}function wa(){Fe().stop()}function va(){const e=u.useRef(null),[t,n]=u.useState(!1);e.current||(e.current=ge()),u.useEffect(()=>()=>{e.current?.stop()},[]);const r=u.useCallback(async(o,i)=>{await e.current.play(o,i)&&n(!0)},[]),s=u.useCallback(()=>{e.current?.stop()},[]);return{play:r,stop:s,unlocked:t}}class xa extends nt{store;constructor(t,n,r,s){super(t),this.version(n).stores({[r]:s}),this.store=this.table(r)}}function ja(e){const{databaseName:t,version:n,tableName:r,indexes:s,keyPath:o="id",ownerField:i}=e,l=new xa(t,n,r,s),c=l.store;function d(p,m){return!i||!m?p:{...p,[i]:m}}async function f(p,m={}){const{orderBy:h=o,reverse:y=!1,limit:g,offset:w,filter:_}=m;let v=i&&p?c.where(i).equals(p):c.toCollection();_&&(v=v.filter(_));let x=h===o?await v.toArray():await v.sortBy(h);return y&&(x=x.reverse()),w&&(x=x.slice(w)),typeof g=="number"&&(x=x.slice(0,g)),x}return{put:(p,m)=>c.put(d(p,m)),bulkPut:(p,m)=>c.bulkPut(p.map(h=>d(h,m))),get:p=>c.get(p),list:f,update:(p,m)=>c.update(p,m),updateMany:async(p,m)=>{const h=m;return i&&p?c.where(i).equals(p).modify(h):c.toCollection().modify(h)},delete:p=>c.delete(p),clear:async p=>{if(i&&p){await c.where(i).equals(p).delete();return}await c.clear()},count:p=>i&&p?c.where(i).equals(p).count():c.count(),raw:c,db:l}}function Sa(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class ka extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&Sa(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function Ea(){const[,e]=u.useState(null);return u.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function Na(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const r={};for(const s of n.error.issues){const o=s.path.length===0?"_root":s.path.join(".");o in r||(r[o]=s.message)}return{success:!1,errors:r}}function We(e){return async(t,n,r)=>{const s=e.safeParse(t);if(s.success)return{values:s.data,errors:{}};const o={},i=r.criteriaMode??"firstError";for(const l of s.error.issues){const c=l.path.length===0?"_root":l.path.join(".");i==="firstError"&&o[c]||(o[c]={type:l.code,message:l.message})}return{values:{},errors:o}}}function Ca(e,t={}){return rt.useForm({...t,resolver:We(e)})}function X(e){return e.replace(/\D/g,"")}function $a(e){const t=X(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let r=0;for(let o=0;o<9;o++)r+=n[o]*(10-o);let s=r*10%11;if(s===10&&(s=0),s!==n[9])return!1;r=0;for(let o=0;o<10;o++)r+=n[o]*(11-o);return s=r*10%11,s===10&&(s=0),s===n[10]}function Ta(e){const t=X(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),r=[5,4,3,2,9,8,7,6,5,4,3,2],s=[6,5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let l=0;l<12;l++)o+=n[l]*r[l];let i=o%11;if(i=i<2?0:11-i,i!==n[12])return!1;o=0;for(let l=0;l<13;l++)o+=n[l]*s[l];return i=o%11,i=i<2?0:11-i,i===n[13]}function Oe(e){return X(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function Be(e){return X(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function Ia(e){return X(e)}function La(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function Pa(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function Ra(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function Ue(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function Je(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function Ma(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function re(e,t="numeric"){return u.forwardRef(function({value:r,onChange:s,...o},i){return a.jsx(ne,{...o,ref:i,value:e(r??""),inputMode:t,onChange:l=>s(e(l.target.value))})})}const Da=re(Je),Aa=re(Be),Fa=re(Ue,"tel"),Wa=re(Oe);function Oa(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function Ba(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const Ua=u.forwardRef(function({value:t,onChange:n,currency:r="BRL",locale:s="pt-BR",...o},i){return a.jsx(ne,{...o,ref:i,type:"text",inputMode:"numeric",value:Oa(t||0,s,r),onChange:l=>n(Ba(l.target.value))})});function Ja(){const[e,t]=u.useState(!1),[n,r]=u.useState(null),[s,o]=u.useState(null),i=u.useCallback(async c=>{const d=c.replace(/\D/g,"");if(d.length!==8)return r("CEP inválido."),null;t(!0),r(null);try{const p=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in p&&p.erro?(r("CEP não encontrado."),o(null),null):(o(p),p)}catch(f){return r(f instanceof Error?f.message:String(f)),null}finally{t(!1)}},[]),l=u.useCallback(()=>{t(!1),r(null),o(null)},[]);return{loading:e,error:n,data:s,lookup:i,reset:l}}function qa(e){try{return JSON.parse(e)}catch{return e}}function qe(e,t={}){const{protocols:n,maxRetries:r=10,initialBackoff:s=1e3,maxBackoff:o=3e4,pingInterval:i=0,pingPayload:l=JSON.stringify({type:"ping"}),parser:c=qa,onOpen:d,onMessage:f,onClose:p,onError:m,onStatusChange:h}=t;let y=null,g=null,w=null,_=0,v="idle",x=!1;function k(S){v!==S&&(v=S,h?.(S))}function N(){w&&(clearInterval(w),w=null)}function se(){!i||i<=0||(N(),w=setInterval(()=>{y?.readyState===WebSocket.OPEN&&y.send(l)},i))}function oe(){if(x)return;if(_>=r){k("error");return}const S=Math.min(s*2**_,o);_+=1,g=setTimeout(j,S)}function j(){if(x)return;y&&(y.onopen=null,y.onmessage=null,y.onclose=null,y.onerror=null,y.close()),k("connecting");const S=new WebSocket(e,n);y=S,S.onopen=$=>{_=0,k("open"),se(),d?.($)},S.onmessage=$=>{const et=typeof $.data=="string"?$.data:"";f?.({data:c(et),raw:$})},S.onerror=$=>{m?.($)},S.onclose=$=>{N(),p?.($),y=null,k("closed"),!x&&!$.wasClean&&oe()}}function E(S){return y?.readyState!==WebSocket.OPEN?!1:(y.send(S),!0)}function ie(S,$){x=!0,g&&(clearTimeout(g),g=null),N(),_=0,y&&(k("closing"),y.close(S,$),y=null),k("closed")}function Xe(){g&&(clearTimeout(g),g=null),_=0,x=!1,j()}return j(),{send:E,close:ie,reconnect:Xe,get status(){return v}}}function za(e,t={}){const{enabled:n=!0,onMessage:r,...s}=t,[o,i]=u.useState("idle"),[l,c]=u.useState(null),d=u.useRef(null),f=u.useRef(r);f.current=r,u.useEffect(()=>{if(!n||!e){i("idle");return}const h=qe(e,{...s,onStatusChange:i,onMessage:y=>{c(y),f.current?.(y)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const p=u.useCallback(h=>d.current?.send(h)??!1,[]),m=u.useCallback(()=>{d.current?.reconnect()},[]);return{status:o,lastMessage:l,send:p,reconnect:m}}const ze=u.createContext(null);function ke(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ga(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function Ha({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:r,attribute:s="data-tempest-theme"}){const[o,i]=u.useState(()=>Ga(n)??t),[l,c]=u.useState(()=>ke(o)),d=u.useRef(r);d.current=r,u.useEffect(()=>{const h=d.current?.()??document.documentElement;if(!h)return;const y=ke(o);h.setAttribute(s,y),c(y)},[o,s]),u.useEffect(()=>{if(o!=="system"||typeof window>"u")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{const g=d.current?.()??document.documentElement,w=h.matches?"dark":"light";g?.setAttribute(s,w),c(w)};return h.addEventListener("change",y),()=>h.removeEventListener("change",y)},[o,s]);const f=u.useCallback(h=>{if(i(h),n&&typeof window<"u")try{window.localStorage.setItem(n,h)}catch{}},[n]),p=u.useCallback(()=>{f(l==="dark"?"light":"dark")},[l,f]),m=u.useMemo(()=>({theme:o,resolvedTheme:l,setTheme:f,toggle:p}),[o,l,f,p]);return a.jsx(ze.Provider,{value:m,children:e})}function Ka(){const e=u.useContext(ze);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function Va(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let r=null;try{r=window.localStorage.getItem(t)}catch{r=null}const s=r??n;return s==="dark"||s==="light"?s:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Qa(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
5
|
+
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function ya(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function ba(e){const{url:t,body:n,method:r="POST",headers:s={},getToken:o,withCredentials:i=!1,onProgress:l,signal:c,parser:d=JSON.parse}=e;return new Promise((p,f)=>{if(c?.aborted){f(new DOMException("Aborted","AbortError"));return}const m=new XMLHttpRequest;m.open(r,t),m.withCredentials=i;const h=o?.(),_={...s};h&&!("Authorization"in _)&&(_.Authorization=`Bearer ${h}`);for(const[w,b]of Object.entries(_))m.setRequestHeader(w,b);l&&(m.upload.onprogress=w=>{l({loaded:w.loaded,total:w.total,fraction:w.lengthComputable?w.loaded/w.total:null,lengthComputable:w.lengthComputable})});function g(){m.abort()}c?.addEventListener("abort",g),m.onload=()=>{c?.removeEventListener("abort",g);const w=m.status>=200&&m.status<300,b=m.getResponseHeader("content-type")??"";if(!w){const v=ya(m.responseText),x=(typeof v=="object"&&v!==null?v.detail??v.message:void 0)??`Erro ${m.status}`,k={status:m.status,detail:String(x),body:v};f(k);return}if(m.status===204||!m.responseText){p(void 0);return}if(b.includes("application/json"))try{p(d(m.responseText))}catch(v){f(v)}else p(m.responseText)},m.onerror=()=>{c?.removeEventListener("abort",g),f({status:0,detail:"Falha de rede no upload."})},m.onabort=()=>{c?.removeEventListener("abort",g),f(new DOMException("Aborted","AbortError"))},m.send(n)})}function wa(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new DOMException("Aborted","AbortError"));return}const s=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(s),r(new DOMException("Aborted","AbortError"))},{once:!0})})}async function va(e,t={}){const{retries:n=3,initialDelay:r=300,maxDelay:s=1e4,shouldRetry:o=()=>!0,onRetry:i,signal:l}=t;let c=0,d;for(;c<n;){if(l?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(p){if(d=p,c+=1,c>=n||!o(p,c))throw p;const f=Math.min(r*2**(c-1),s);i?.({attempt:c,delay:f,error:p}),await wa(f,l)}}throw d}function xa(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function ja(e,t){const{interval:n,disabled:r=!1,stopWhen:s,onError:o}=t,[i,l]=u.useState(null),[c,d]=u.useState(null),[p,f]=u.useState(!r),m=u.useRef(r),h=u.useRef(!1),_=u.useRef(null);async function g(){if(!(m.current||h.current)){h.current=!0;try{const w=await e();if(m.current)return;l(w),d(null),s?.(w)&&(m.current=!0)}catch(w){m.current||(d(w),o?.(w))}finally{h.current=!1,f(!1),m.current||(_.current=setTimeout(g,n))}}}return u.useEffect(()=>{if(m.current=r,r){_.current&&clearTimeout(_.current);return}return f(!0),g(),()=>{m.current=!0,_.current&&clearTimeout(_.current)}},[n,r]),{data:i,error:c,loading:p,stop:()=>{m.current=!0,_.current&&clearTimeout(_.current)},start:()=>{m.current&&(m.current=!1,g())}}}function Sa(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return st.create()(ve.persist(r=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:s,token:o})=>r({user:s,token:o,isAuthenticated:!0}),setUser:s=>r({user:s}),setToken:s=>r({token:s,isAuthenticated:!!s}),logout:()=>r({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:ve.createJSONStorage(n),partialize:r=>({user:r.user,token:r.token}),onRehydrateStorage:()=>r=>{r&&(r.isAuthenticated=!!r.token)}}))}function ka({isAuthenticated:e,children:t,fallback:n}){return a.jsx(a.Fragment,{children:e?t:n})}function Ne(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function Re(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,r,s]=t;try{return{header:JSON.parse(Ne(n)),payload:JSON.parse(Ne(r)),signature:s}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function Na(e,t=0){try{const{payload:n}=Re(e);if(typeof n.exp!="number")return!0;const r=Math.floor(Date.now()/1e3);return n.exp<=r+t}catch{return!0}}function Ea(e,t={}){const{retries:n=3,initialDelay:r=400,reloadOnFinalFailure:s=!0}=t;async function o(i=1){try{return await e()}catch(l){if(i>=n)throw s&&typeof window<"u"&&window.location.reload(),l;return await new Promise(c=>setTimeout(c,r*2**(i-1))),o(i+1)}}return u.lazy(o)}function $a(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}const Me={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},De={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},Ca={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function Ta(e,t){const n={all:[e]};for(const[r,s]of Object.entries(t))typeof s=="function"?n[r]=(...o)=>[e,...s(...o)]:n[r]=[e,...s];return n}function Ia({children:e,client:t,defaultOptions:n}){const[r]=u.useState(()=>t??new we.QueryClient({defaultOptions:{queries:{staleTime:Me.DEFAULT,gcTime:De.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return a.jsx(we.QueryClientProvider,{client:r,children:e})}function La(e){try{return JSON.parse(e)}catch{return e}}function Fe(e,t={}){const{withCredentials:n=!1,namedEvents:r=[],heartbeatEvents:s=["ping"],maxRetries:o=10,initialBackoff:i=1e3,maxBackoff:l=3e4,parser:c=La,onOpen:d,onMessage:p,onError:f,onStatusChange:m}=t;let h=null,_=null,g=0,w="idle",b=!1;function v(j){w!==j&&(w=j,m?.(j))}function x(j,N){s.includes(j)||p?.({event:j,data:c(N.data),id:N.lastEventId||void 0,raw:N})}function k(){if(b)return;if(g>=o){v("error");return}const j=Math.min(i*2**g,l);g+=1,_=setTimeout(E,j)}function E(){if(b)return;h&&h.close(),v("connecting");const j=new EventSource(e,{withCredentials:n});h=j,j.onopen=()=>{g=0,v("open"),d?.()},j.onmessage=N=>x("message",N);for(const N of r)j.addEventListener(N,ce=>x(N,ce));for(const N of s)j.addEventListener(N,()=>{});j.onerror=N=>{f?.(N),j.close(),h=null,v("closed"),k()}}function ie(){b=!0,_&&(clearTimeout(_),_=null),g=0,h&&(h.close(),h=null),v("closed")}function ae(){_&&(clearTimeout(_),_=null),g=0,b=!1,E()}return E(),{close:ie,reconnect:ae,get status(){return w}}}function Pa(e,t={}){const{enabled:n=!0,onMessage:r,...s}=t,[o,i]=u.useState("idle"),[l,c]=u.useState(null),d=u.useRef(null),p=u.useRef(r);return p.current=r,u.useEffect(()=>{if(!n||!e){i("idle");return}const f=Fe(e,{...s,onStatusChange:i,onMessage:m=>{c(m),p.current?.(m)}});return d.current=f.reconnect,()=>{f.close(),d.current=null}},[e,n]),{status:o,lastMessage:l,reconnect:()=>d.current?.()}}function Ae(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(n),s=new ArrayBuffer(r.length),o=new Uint8Array(s);for(let i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return o}function X(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class he extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class We extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class Oe{config;constructor(t){this.config=t}static isSupported(){return X()}async registration(){if(!X())throw new he;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new he;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return X()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new We;const n=await this.registration(),r=await n.pushManager.getSubscription();if(r)return await this.config.onSubscribe(r.toJSON()),r;const s=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ae(this.config.vapidPublicKey)});return await this.config.onSubscribe(s.toJSON()),s}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function Ra(e){const t=u.useRef(e);t.current=e;const n=u.useMemo(()=>new Oe({vapidPublicKey:e.vapidPublicKey,onSubscribe:g=>t.current.onSubscribe(g),onUnsubscribe:g=>t.current.onUnsubscribe?.(g),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[r]=u.useState(()=>X()),[s,o]=u.useState(()=>n.permission()),[i,l]=u.useState(!1),[c,d]=u.useState(!1),[p,f]=u.useState(null),m=u.useCallback(async()=>{if(r){o(n.permission());try{const g=await n.isSubscribed();l(g)}catch(g){f(g instanceof Error?g:new Error(String(g)))}}},[n,r]);u.useEffect(()=>{m()},[m]);const h=u.useCallback(async()=>{if(r){d(!0),f(null);try{await n.subscribe(),l(!0),o(n.permission())}catch(g){throw f(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,r]),_=u.useCallback(async()=>{if(r){d(!0),f(null);try{await n.unsubscribe(),l(!1)}catch(g){throw f(g instanceof Error?g:new Error(String(g))),g}finally{d(!1)}}},[n,r]);return{supported:r,permission:s,subscribed:i,loading:c,error:p,subscribe:h,unsubscribe:_,refresh:m}}async function Ma(e){if(typeof navigator>"u"||!("serviceWorker"in navigator))return null;try{const t=await navigator.serviceWorker.register(e.url,{scope:e.scope});return t.active&&e.onReady?.(t),t.addEventListener("updatefound",()=>{const n=t.installing;n&&n.addEventListener("statechange",()=>{n.state==="installed"&&navigator.serviceWorker.controller&&e.onUpdate?.(n,t)})}),t}catch(t){return e.onError?.(t),null}}function Da(e){e.postMessage({type:"SKIP_WAITING"})}async function Fa(){if(typeof navigator>"u"||!("serviceWorker"in navigator))return 0;const e=await navigator.serviceWorker.getRegistrations();let t=0;for(const n of e)await n.unregister()&&(t+=1);return t}function _e(){return globalThis}function Aa(e={}){const t=_e(),{defaultTitle:n="Notificação",defaultIcon:r,defaultBadge:s,transform:o}=e;t.addEventListener("push",i=>{if(!i.data)return;let l;try{l=i.data.json()}catch{l={title:n,body:i.data.text()}}const c=o?o(l):l;if(!c)return;const d=c.title??n,p={body:c.body,icon:c.icon??r,badge:c.badge??s,image:c.image,tag:c.tag,data:{url:c.url??"/",...c.data??{}}};i.waitUntil(t.registration.showNotification(d,p))})}function Wa(e={}){const t=_e(),n=e.resolveUrl??(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"&&"url"in r){const s=r.url;return typeof s=="string"?s:"/"}return"/"});t.addEventListener("notificationclick",r=>{r.notification.close();const s=n(r.notification.data);r.waitUntil((async()=>{const o=await t.clients.matchAll({type:"window",includeUncontrolled:!0});for(const i of o)if(i.url.includes(s))return i.focus();return t.clients.openWindow(s)})())})}function Oa(){const e=_e();e.addEventListener("message",t=>{t.data?.type==="SKIP_WAITING"&&e.skipWaiting()})}function ye(){let e=null;async function t(r,{volume:s=1,loop:o=!1,autoplay:i=!0,stopPrevious:l=!1,onEnded:c,onError:d}={}){try{l&&e&&(e.pause(),e.currentTime=0);const p=new Audio(r);return p.volume=Math.max(0,Math.min(1,s)),p.loop=o,p.preload="auto",c&&(p.onended=c),d&&(p.onerror=f=>d(f)),e=p,i&&await p.play(),p}catch(p){return d?.(p),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let pe=null;function Be(){return pe||(pe=ye()),pe}async function Ba(e,t){return Be().play(e,t)}function Ua(){Be().stop()}function za(){const e=u.useRef(null),[t,n]=u.useState(!1);e.current||(e.current=ye()),u.useEffect(()=>()=>{e.current?.stop()},[]);const r=u.useCallback(async(o,i)=>{await e.current.play(o,i)&&n(!0)},[]),s=u.useCallback(()=>{e.current?.stop()},[]);return{play:r,stop:s,unlocked:t}}class qa extends ot{store;constructor(t,n,r,s){super(t),this.version(n).stores({[r]:s}),this.store=this.table(r)}}function Ja(e){const{databaseName:t,version:n,tableName:r,indexes:s,keyPath:o="id",ownerField:i}=e,l=new qa(t,n,r,s),c=l.store;function d(f,m){return!i||!m?f:{...f,[i]:m}}async function p(f,m={}){const{orderBy:h=o,reverse:_=!1,limit:g,offset:w,filter:b}=m;let v=i&&f?c.where(i).equals(f):c.toCollection();b&&(v=v.filter(b));let x=h===o?await v.toArray():await v.sortBy(h);return _&&(x=x.reverse()),w&&(x=x.slice(w)),typeof g=="number"&&(x=x.slice(0,g)),x}return{put:(f,m)=>c.put(d(f,m)),bulkPut:(f,m)=>c.bulkPut(f.map(h=>d(h,m))),get:f=>c.get(f),list:p,update:(f,m)=>c.update(f,m),updateMany:async(f,m)=>{const h=m;return i&&f?c.where(i).equals(f).modify(h):c.toCollection().modify(h)},delete:f=>c.delete(f),clear:async f=>{if(i&&f){await c.where(i).equals(f).delete();return}await c.clear()},count:f=>i&&f?c.where(i).equals(f).count():c.count(),raw:c,db:l}}function Ga(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class Ha extends u.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&Ga(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function Ka(){const[,e]=u.useState(null);return u.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function Va(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const r={};for(const s of n.error.issues){const o=s.path.length===0?"_root":s.path.join(".");o in r||(r[o]=s.message)}return{success:!1,errors:r}}function Ue(e){return async(t,n,r)=>{const s=e.safeParse(t);if(s.success)return{values:s.data,errors:{}};const o={},i=r.criteriaMode??"firstError";for(const l of s.error.issues){const c=l.path.length===0?"_root":l.path.join(".");i==="firstError"&&o[c]||(o[c]={type:l.code,message:l.message})}return{values:{},errors:o}}}function Qa(e,t={}){return it.useForm({...t,resolver:Ue(e)})}function ee(e){return e.replace(/\D/g,"")}function Ya(e){const t=ee(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let r=0;for(let o=0;o<9;o++)r+=n[o]*(10-o);let s=r*10%11;if(s===10&&(s=0),s!==n[9])return!1;r=0;for(let o=0;o<10;o++)r+=n[o]*(11-o);return s=r*10%11,s===10&&(s=0),s===n[10]}function Za(e){const t=ee(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),r=[5,4,3,2,9,8,7,6,5,4,3,2],s=[6,5,4,3,2,9,8,7,6,5,4,3,2];let o=0;for(let l=0;l<12;l++)o+=n[l]*r[l];let i=o%11;if(i=i<2?0:11-i,i!==n[12])return!1;o=0;for(let l=0;l<13;l++)o+=n[l]*s[l];return i=o%11,i=i<2?0:11-i,i===n[13]}function ze(e){return ee(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function qe(e){return ee(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function Xa(e){return ee(e)}function ec(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function tc(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function nc(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function Je(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function Ge(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function rc(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}function oe(e,t="numeric"){return u.forwardRef(function({value:r,onChange:s,...o},i){return a.jsx(re,{...o,ref:i,value:e(r??""),inputMode:t,onChange:l=>s(e(l.target.value))})})}const sc=oe(Ge),oc=oe(qe),ic=oe(Je,"tel"),ac=oe(ze);function cc(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function lc(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const uc=u.forwardRef(function({value:t,onChange:n,currency:r="BRL",locale:s="pt-BR",...o},i){return a.jsx(re,{...o,ref:i,type:"text",inputMode:"numeric",value:cc(t||0,s,r),onChange:l=>n(lc(l.target.value))})});function dc(){const[e,t]=u.useState(!1),[n,r]=u.useState(null),[s,o]=u.useState(null),i=u.useCallback(async c=>{const d=c.replace(/\D/g,"");if(d.length!==8)return r("CEP inválido."),null;t(!0),r(null);try{const f=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in f&&f.erro?(r("CEP não encontrado."),o(null),null):(o(f),f)}catch(p){return r(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),l=u.useCallback(()=>{t(!1),r(null),o(null)},[]);return{loading:e,error:n,data:s,lookup:i,reset:l}}function pc(e){try{return JSON.parse(e)}catch{return e}}function He(e,t={}){const{protocols:n,maxRetries:r=10,initialBackoff:s=1e3,maxBackoff:o=3e4,pingInterval:i=0,pingPayload:l=JSON.stringify({type:"ping"}),parser:c=pc,onOpen:d,onMessage:p,onClose:f,onError:m,onStatusChange:h}=t;let _=null,g=null,w=null,b=0,v="idle",x=!1;function k(S){v!==S&&(v=S,h?.(S))}function E(){w&&(clearInterval(w),w=null)}function ie(){!i||i<=0||(E(),w=setInterval(()=>{_?.readyState===WebSocket.OPEN&&_.send(l)},i))}function ae(){if(x)return;if(b>=r){k("error");return}const S=Math.min(s*2**b,o);b+=1,g=setTimeout(j,S)}function j(){if(x)return;_&&(_.onopen=null,_.onmessage=null,_.onclose=null,_.onerror=null,_.close()),k("connecting");const S=new WebSocket(e,n);_=S,S.onopen=C=>{b=0,k("open"),ie(),d?.(C)},S.onmessage=C=>{const rt=typeof C.data=="string"?C.data:"";p?.({data:c(rt),raw:C})},S.onerror=C=>{m?.(C)},S.onclose=C=>{E(),f?.(C),_=null,k("closed"),!x&&!C.wasClean&&ae()}}function N(S){return _?.readyState!==WebSocket.OPEN?!1:(_.send(S),!0)}function ce(S,C){x=!0,g&&(clearTimeout(g),g=null),E(),b=0,_&&(k("closing"),_.close(S,C),_=null),k("closed")}function nt(){g&&(clearTimeout(g),g=null),b=0,x=!1,j()}return j(),{send:N,close:ce,reconnect:nt,get status(){return v}}}function fc(e,t={}){const{enabled:n=!0,onMessage:r,...s}=t,[o,i]=u.useState("idle"),[l,c]=u.useState(null),d=u.useRef(null),p=u.useRef(r);p.current=r,u.useEffect(()=>{if(!n||!e){i("idle");return}const h=He(e,{...s,onStatusChange:i,onMessage:_=>{c(_),p.current?.(_)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const f=u.useCallback(h=>d.current?.send(h)??!1,[]),m=u.useCallback(()=>{d.current?.reconnect()},[]);return{status:o,lastMessage:l,send:f,reconnect:m}}const Ke=u.createContext(null);function Ee(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function mc(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function hc({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:r,attribute:s="data-tempest-theme"}){const[o,i]=u.useState(()=>mc(n)??t),[l,c]=u.useState(()=>Ee(o)),d=u.useRef(r);d.current=r,u.useEffect(()=>{const h=d.current?.()??document.documentElement;if(!h)return;const _=Ee(o);h.setAttribute(s,_),c(_)},[o,s]),u.useEffect(()=>{if(o!=="system"||typeof window>"u")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),_=()=>{const g=d.current?.()??document.documentElement,w=h.matches?"dark":"light";g?.setAttribute(s,w),c(w)};return h.addEventListener("change",_),()=>h.removeEventListener("change",_)},[o,s]);const p=u.useCallback(h=>{if(i(h),n&&typeof window<"u")try{window.localStorage.setItem(n,h)}catch{}},[n]),f=u.useCallback(()=>{p(l==="dark"?"light":"dark")},[l,p]),m=u.useMemo(()=>({theme:o,resolvedTheme:l,setTheme:p,toggle:f}),[o,l,p,f]);return a.jsx(Ke.Provider,{value:m,children:e})}function gc(){const e=u.useContext(Ke);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function _c(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let r=null;try{r=window.localStorage.getItem(t)}catch{r=null}const s=r??n;return s==="dark"||s==="light"?s:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function yc(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
6
6
|
(function(){try{
|
|
7
7
|
var key=${JSON.stringify(t)};
|
|
8
8
|
var def=${JSON.stringify(n)};
|
|
@@ -11,5 +11,5 @@ Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida d
|
|
|
11
11
|
var resolved=mode==="dark"||mode==="light"?mode:(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");
|
|
12
12
|
document.documentElement.setAttribute("data-tempest-theme",resolved);
|
|
13
13
|
}catch(e){}})();
|
|
14
|
-
`.trim()}function
|
|
14
|
+
`.trim()}function $e(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const s=t[r];return s===void 0?`{${r}}`:String(s)}):e}function fe(e,t,n,r){const s=e[t]?.[r];if(s!==void 0)return s;if(n){const o=e[n]?.[r];if(o!==void 0)return o}return null}function be(e){const{locale:t,fallbackLocale:n=null,messages:r}=e;function s(c,d){const p=fe(r,t,n,c);return p===null?c:$e(p,d)}function o(c,d,p){const m=fe(r,t,n,`${c}${d===1?"_one":"_other"}`)??fe(r,t,n,c);return m===null?c:$e(m,{count:d,...p??{}})}function i(c,d){return new Intl.NumberFormat(t,d).format(c)}function l(c,d){const p=typeof c=="string"?new Date(c):c;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:s,plural:o,formatNumber:i,formatDate:l,withLocale:c=>be({locale:c,fallbackLocale:n??void 0,messages:r})}}const Ve=u.createContext(null);function bc(e,t){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);return n&&t.includes(n)?n:null}catch{return null}}function wc({children:e,locale:t,fallbackLocale:n,messages:r,storageKey:s="tempest-locale"}){const o=u.useMemo(()=>Object.keys(r),[r]),[i,l]=u.useState(()=>bc(s,o)??t);u.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",i)},[i]);const c=u.useCallback(p=>{if(l(p),s&&typeof window<"u")try{window.localStorage.setItem(s,p)}catch{}},[s]),d=u.useMemo(()=>({...be({locale:i,fallbackLocale:n,messages:r}),setLocale:c,availableLocales:o}),[i,n,r,c,o]);return a.jsx(Ve.Provider,{value:d,children:e})}function Qe(){const e=u.useContext(Ve);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function vc(){return Qe().t}const Ce=["debug","info","warn","error"];function xc(e,t){return Ce.indexOf(t)>=Ce.indexOf(e)}const Ye=({level:e,message:t,context:n})=>{const r=e==="debug"?"log":e;n?console[r](t,n):console[r](t)};function Ze(e={}){const t=e.level??"info",n=e.sinks??[Ye],r=e.namespace??"";function s(o,i,l){if(!xc(t,o))return;const c={level:o,message:r?`[${r}] ${i}`:i,context:l,timestamp:Date.now()};for(const d of n)try{d(c)}catch{}}return{debug:(o,i)=>s("debug",o,i),info:(o,i)=>s("info",o,i),warn:(o,i)=>s("warn",o,i),error:(o,i)=>s("error",o,i),child:o=>Ze({level:t,sinks:n,namespace:r?`${r}:${o}`:o})}}const Xe=u.createContext(null);function jc({adapter:e,children:t}){u.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=u.useMemo(()=>e,[e]);return a.jsx(Xe.Provider,{value:n,children:t})}function Sc(){return u.useContext(Xe)}const kc={identify(e){console.info("[telemetry] identify",e)},track(e){console.info("[telemetry] track",e.name,e.properties)},captureException(e,t){console.error("[telemetry] exception",e,t)}},et=u.createContext(null);function Nc({adapter:e,children:t}){const n=u.useMemo(()=>e,[e]);return u.useEffect(()=>{},[n]),a.jsx(et.Provider,{value:n,children:t})}function tt(){const e=u.useContext(et);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function Ec(e,t=!1){const n=tt(),r=o=>n.onChange?n.onChange(o):()=>{},s=()=>n.isEnabled(e,t);return u.useSyncExternalStore(r,s,s)}function $c(e,t){const n=tt(),r=o=>n.onChange?n.onChange(o):()=>{},s=()=>n.get(e,t);return u.useSyncExternalStore(r,s,s)}function Cc(e={}){const t={...e.initial??{}},n=new Set;function r(){for(const s of n)s()}return{isEnabled(s,o=!1){return s in t?!!t[s]:o},get(s,o){return s in t?t[s]:o},onChange(s){return n.add(s),()=>n.delete(s)},set(s,o){t[s]=o,r()}}}async function Tc(e){if(typeof navigator>"u"||!("share"in navigator))return{shared:!1,unsupported:!0,cancelled:!1};if(e.files&&!navigator.canShare?.({files:e.files}))return{shared:!1,unsupported:!0,cancelled:!1};try{return await navigator.share(e),{shared:!0,unsupported:!1,cancelled:!1}}catch(t){return t instanceof DOMException&&t.name==="AbortError"?{shared:!1,unsupported:!1,cancelled:!0}:{shared:!1,unsupported:!1,cancelled:!1,error:t}}}function Ic(){return typeof navigator<"u"&&"share"in navigator}const Lc={get(e,t){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},remove(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}};exports.AuthGuard=ka;exports.Avatar=wt;exports.Badge=Et;exports.Breadcrumbs=Pt;exports.Button=ne;exports.CACHE_TIME=De;exports.CEPInput=ac;exports.CNPJInput=oc;exports.CPFInput=sc;exports.Card=en;exports.Checkbox=ln;exports.ChipInput=vn;exports.ConfirmDialog=Dn;exports.Container=$s;exports.DatePicker=Vn;exports.Drawer=pr;exports.EmptyState=br;exports.ErrorBoundary=Ha;exports.ErrorState=kr;exports.FeatureFlagsProvider=Nc;exports.FileUpload=Ur;exports.Form=os;exports.FormActions=cs;exports.FormRow=as;exports.FormSection=is;exports.Grid=Ts;exports.I18nProvider=wc;exports.Input=re;exports.Modal=Te;exports.MoneyInput=uc;exports.Pagination=As;exports.PhoneInput=ic;exports.Progress=Ks;exports.QueryProvider=Ia;exports.REFETCH_TIME=Ca;exports.Radio=so;exports.RadioGroup=oo;exports.STALE_TIME=Me;exports.SearchBar=uo;exports.Select=jo;exports.Skeleton=$o;exports.Spinner=Ro;exports.Stack=Cs;exports.Stepper=zo;exports.Switch=Qo;exports.Table=ii;exports.Tabs=pi;exports.TelemetryProvider=jc;exports.Textarea=wi;exports.ThemeProvider=hc;exports.ToastProvider=Oi;exports.Tooltip=$i;exports.VirtualList=Hi;exports.WebPushClient=Oe;exports.WebPushPermissionDeniedError=We;exports.WebPushUnsupportedError=he;exports.cn=y;exports.consoleSink=Ye;exports.consoleTelemetryAdapter=kc;exports.createApiClient=ga;exports.createAudioPlayer=ye;exports.createAuthStore=Sa;exports.createEventStream=Fe;exports.createI18n=be;exports.createInMemoryFlags=Cc;exports.createLogger=Ze;exports.createOfflineStore=Ja;exports.createQueryKeys=Ta;exports.createRefreshQueue=$a;exports.createWebSocket=He;exports.decodeJWT=Re;exports.formatCEP=ze;exports.formatCNPJ=qe;exports.formatCPF=Ge;exports.formatCurrency=ec;exports.formatDate=tc;exports.formatDateTime=nc;exports.formatPercent=rc;exports.formatPhone=Je;exports.generateIdempotencyKey=xa;exports.getInitialTheme=_c;exports.installNotificationClickHandler=Wa;exports.installPushHandler=Aa;exports.installSkipWaitingListener=Oa;exports.isJWTExpired=Na;exports.isPushSupported=X;exports.isShareSupported=Ic;exports.lazyWithRetry=Ea;exports.parseResponse=_a;exports.playAudio=Ba;exports.registerServiceWorker=Ma;exports.retry=va;exports.share=Tc;exports.skipWaiting=Da;exports.stopAudio=Ua;exports.storage=Lc;exports.themeInitScript=yc;exports.unmask=Xa;exports.unregisterAllServiceWorkers=Fa;exports.uploadWithProgress=ba;exports.urlBase64ToUint8Array=Ae;exports.useAudio=za;exports.useBeforeInstallPrompt=ia;exports.useClientFilter=Qi;exports.useClipboard=na;exports.useDebounce=Ki;exports.useDeepMemo=fa;exports.useDocumentVisibility=Xi;exports.useErrorHandler=Ka;exports.useEventStream=Pa;exports.useFeatureFlag=Ec;exports.useFlagValue=$c;exports.useFocusTrap=da;exports.useGeolocation=ca;exports.useI18n=Qe;exports.useIdle=aa;exports.useIntersectionObserver=ea;exports.useKeyboardShortcut=oa;exports.useMediaQuery=Yi;exports.useOnline=Zi;exports.usePagination=Vi;exports.usePoll=ja;exports.usePushSubscription=Ra;exports.useResizeObserver=ta;exports.useScrollLock=la;exports.useStableCallback=pa;exports.useTelemetry=Sc;exports.useTheme=gc;exports.useToast=Wi;exports.useTranslate=vc;exports.useViaCEP=dc;exports.useWebSocket=fc;exports.useZodForm=Qa;exports.validateCNPJ=Za;exports.validateCPF=Ya;exports.validateForm=Va;exports.zodResolver=Ue;
|
|
15
15
|
//# sourceMappingURL=tempest-react-sdk.cjs.map
|