tempest-react-sdk 0.19.1 → 0.20.0

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.
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./sw.cjs"),o=require("react/jsx-runtime"),l=require("react"),w=require("./cn-CNScIEB4.cjs"),Ln=require("lucide-react"),Q=require("@tanstack/react-query"),A=require("react-router-dom"),Ve=require("react-dom"),P=require("./projection-CILVBdpd.cjs"),he=require("react-hook-form"),Ot=require("zustand"),wt=require("zustand/middleware"),Ws=require("dexie"),qs="tempest_accordion_LVhhv",Ks="tempest_item_7ryVk",Us="tempest_header_WaTdJ",Hs="tempest_trigger_9BYFY",Gs="tempest_chevron_i-HVZ",Qs="tempest_open_98jLY",Js="tempest_panel_Wx50w",Te={accordion:qs,item:Ks,header:Us,trigger:Hs,chevron:Gs,open:Qs,panel:Js};function Ys({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:a}){const i=l.useId(),c=n!==void 0,[u,d]=l.useState(s),p=c?n:u,m=l.useCallback(f=>{const h=p.includes(f),_=t?h?p.filter(v=>v!==f):[...p,f]:h?[]:[f];c||d(_),r?.(_)},[p,t,c,r]);return o.jsx("div",{className:w.cn(Te.accordion,a),children:e.map(f=>{const h=p.includes(f.id),_=`${i}-${f.id}-panel`,v=`${i}-${f.id}-trigger`;return o.jsxs("div",{className:w.cn(Te.item,h&&Te.open),children:[o.jsx("h3",{className:Te.header,children:o.jsxs("button",{type:"button",id:v,className:Te.trigger,"aria-expanded":h,"aria-controls":_,disabled:f.disabled,onClick:()=>m(f.id),children:[o.jsx("span",{children:f.title}),o.jsx(Xs,{className:Te.chevron})]})}),h&&o.jsx("div",{id:_,role:"region","aria-labelledby":v,className:Te.panel,children:f.children})]},f.id)})})}function Xs({className:e}){return o.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Vs="tempest_alert_7cYyI",Zs="tempest_content_UXnmZ",er="tempest_title_abGgF",tr="tempest_description_pXPvw",nr="tempest_icon_Zg6SB",sr="tempest_close_narep",rr="tempest_neutral_J7MH1",or="tempest_solid_s-oW5",ar="tempest_outline_v7w9b",ir="tempest_info_9r3r1",cr="tempest_success_1bzoB",lr="tempest_warning_q-j1Q",ur="tempest_danger_CiZkW",be={alert:Vs,content:Zs,title:er,description:tr,icon:nr,close:sr,neutral:rr,solid:or,outline:ar,info:ir,success:cr,warning:lr,danger:ur};function dr({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:a,closeLabel:i="Dismiss",className:c,children:u,...d}){return o.jsxs("div",{role:"alert",className:w.cn(be.alert,be[e],t==="solid"&&be.solid,t==="outline"&&be.outline,c),...d,children:[r&&o.jsx("span",{className:be.icon,children:r}),o.jsxs("div",{className:be.content,children:[n&&o.jsx("p",{className:be.title,children:n}),s&&o.jsx("p",{className:be.description,children:s}),u]}),a&&o.jsx("button",{type:"button",className:be.close,onClick:a,"aria-label":i,children:o.jsx(pr,{})})]})}function pr(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const mr="tempest_bar_SHqWS",fr="tempest_centered_S0CCw",hr="tempest_surface_fusKb",_r="tempest_primary_QcCyN",gr="tempest_transparent_uGrsu",br="tempest_bordered_5M9FZ",yr="tempest_sticky_DStUO",vr="tempest_safeArea_Vo3Bi",xr="tempest_leading_mXv-d",wr="tempest_actions_x7tMx",jr="tempest_title_qaMMQ",$r="tempest_brand_xKt54",kr="tempest_iconBtn_S-BTg",te={bar:mr,centered:fr,surface:hr,primary:_r,transparent:gr,bordered:br,sticky:yr,safeArea:vr,leading:xr,actions:wr,title:jr,brand:$r,iconBtn:kr};function Nr({title:e,leading:t,showBack:n=!1,onBack:s,backLabel:r="Go back",backIcon:a,brand:i,actions:c,centered:u=!1,sticky:d=!0,tone:p="surface",bordered:m=!0,safeArea:f=!0,className:h,..._}){const v=s??(()=>window.history.back()),y=t??o.jsxs(o.Fragment,{children:[n&&o.jsx("button",{type:"button",className:te.iconBtn,onClick:v,"aria-label":r,children:a??o.jsx(Ln.ArrowLeft,{size:22,"aria-hidden":"true"})}),i&&o.jsx("span",{className:te.brand,children:i})]});return o.jsxs("header",{className:w.cn(te.bar,te[p],u&&te.centered,d&&te.sticky,m&&te.bordered,f&&te.safeArea,h),..._,children:[o.jsx("div",{className:te.leading,children:y}),e!=null&&e!==""&&o.jsx("h1",{className:te.title,"aria-live":"polite",children:e}),o.jsx("div",{className:te.actions,children:c})]})}const jt={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Sr=["xs","sm","md","lg","xl","2xl"];function Cr(e){let t="xs";for(const n of Sr)e>=jt[n]&&(t=n);return t}function ze(){const[e,t]=l.useState(()=>typeof window>"u"?0:window.innerWidth);l.useEffect(()=>{if(typeof window>"u")return;const a=()=>t(window.innerWidth);return a(),window.addEventListener("resize",a,{passive:!0}),()=>window.removeEventListener("resize",a)},[]);const n=Cr(e),s=a=>e>=jt[a],r=a=>e<jt[a];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const Er="tempest_shell_-xp0O",Tr="tempest_navbar_liTKV",Mr="tempest_row_PE41P",Rr="tempest_sidebar_wyx-V",Lr="tempest_main_O3GFv",Dr="tempest_footer_IFW4q",Pr="tempest_bottomNav_pKJ1v",Me={shell:Er,navbar:Tr,row:Mr,sidebar:Rr,main:Lr,footer:Dr,bottomNav:Pr};function Ar({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:a,children:i,...c}){const d=ze().above(r);return o.jsxs("div",{className:w.cn(Me.shell,a),...c,children:[e&&o.jsx("div",{className:Me.navbar,children:e}),o.jsxs("div",{className:Me.row,children:[t&&d&&o.jsx("div",{className:Me.sidebar,children:t}),o.jsx("main",{className:Me.main,children:i})]}),s&&o.jsx("div",{className:Me.footer,children:s}),n&&!d&&o.jsx("div",{className:Me.bottomNav,children:n})]})}const Ir="tempest_aspect_GnAJt",Fr={aspect:Ir};function Or({ratio:e=16/9,className:t,style:n,children:s,...r}){const a={aspectRatio:String(e),...n};return o.jsx("div",{className:w.cn(Fr.aspect,t),style:a,...r,children:s})}const Br="tempest_avatar_3xMuZ",zr="tempest_image_ieqGp",Wr="tempest_xs_oSaLL",qr="tempest_sm_sZ2bk",Kr="tempest_md_Fdkbz",Ur="tempest_lg_pTTUA",Hr="tempest_xl_mW58F",Gr="tempest_status_ISBnL",Qr="tempest_dot_Wgfo-",Jr="tempest_online_-aWoW",Yr="tempest_offline_-StX3",Xr="tempest_busy_TbwuF",qe={avatar:Br,image:zr,xs:Wr,sm:qr,md:Kr,lg:Ur,xl:Hr,status:Gr,dot:Qr,online:Jr,offline:Yr,busy:Xr};function Vr(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 Zr({src:e,alt:t,name:n="",size:s="md",status:r,className:a,onClick:i}){const[c,u]=l.useState(!1),d=l.useMemo(()=>Vr(n),[n]),p=e&&!c,m=i?"button":void 0,f=i?0:void 0;return o.jsxs("span",{className:w.cn(qe.avatar,qe[s],r&&qe.status,a),role:m,tabIndex:f,onClick:i,onKeyDown:i?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i())}:void 0,children:[p?o.jsx("img",{src:e,alt:t??n,className:qe.image,onError:()=>u(!0)}):o.jsx("span",{"aria-label":t??n,children:d}),r&&o.jsx("span",{className:w.cn(qe.dot,qe[r]),"aria-hidden":!0})]})}const eo="tempest_badge_RsuMz",to="tempest_sm_LYsCn",no="tempest_md_4Or8q",so="tempest_lg_Bseje",ro="tempest_square_l63D-",oo="tempest_neutral_lulSm",ao="tempest_solid_0Leug",io="tempest_outline_x06HL",co="tempest_success_u9JiS",lo="tempest_warning_nsGp-",uo="tempest_danger_PD2hz",po="tempest_info_na6DQ",mo="tempest_primary_S0WCS",fo="tempest_dot_i0c-G",Re={badge:eo,sm:to,md:no,lg:so,square:ro,neutral:oo,solid:ao,outline:io,success:co,warning:lo,danger:uo,info:po,primary:mo,dot:fo};function ho({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:a,children:i,...c}){return o.jsxs("span",{className:w.cn(Re.badge,Re[e],t==="solid"&&Re.solid,t==="outline"&&Re.outline,Re[n],s==="square"&&Re.square,a),...c,children:[r&&o.jsx("span",{className:Re.dot,"aria-hidden":!0}),i]})}const _o="tempest_banner_oyoWE",go="tempest_info_s2q0P",bo="tempest_success_uLYQ3",yo="tempest_warning_9rua8",vo="tempest_danger_Uzb-6",xo="tempest_icon_vzKmx",wo="tempest_body_-Qm4K",jo="tempest_title_AeTHT",$o="tempest_description_nbyf-",ko="tempest_action_47P8e",No="tempest_close_Iy2oN",Ne={banner:_o,info:go,success:bo,warning:yo,danger:vo,icon:xo,body:wo,title:jo,description:$o,action:ko,close:No};function So({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:a,className:i,children:c,...u}){const[d,p]=l.useState(!0);return d?o.jsxs("div",{className:w.cn(Ne.banner,Ne[e],i),role:"status",...u,children:[t&&o.jsx("span",{className:Ne.icon,children:t}),o.jsxs("div",{className:Ne.body,children:[n&&o.jsx("p",{className:Ne.title,children:n}),c&&o.jsx("p",{className:Ne.description,children:c})]}),s&&o.jsx("div",{className:Ne.action,children:s}),r&&o.jsx("button",{type:"button",className:Ne.close,"aria-label":"Fechar",onClick:()=>{p(!1),a?.()},children:"×"})]}):null}const Co="tempest_bar_kp35Q",Eo="tempest_item_XfDIW",To="tempest_active_sK54f",Mo="tempest_iconWrap_yJ20b",Ro="tempest_icon_TAjtI",Lo="tempest_badge_-c3Do",Do="tempest_label_qJj3L",Le={bar:Co,item:Eo,active:To,iconWrap:Mo,icon:Ro,badge:Lo,label:Do};function Po({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...a}){return o.jsx("nav",{className:w.cn(Le.bar,r),"aria-label":"Navegação principal",...a,children:e.map(i=>{const c=i.key===t;return o.jsxs("button",{type:"button",className:w.cn(Le.item,c&&Le.active),"aria-current":c?"page":void 0,disabled:i.disabled,onClick:()=>n(i.key),children:[o.jsxs("span",{className:Le.iconWrap,children:[i.icon&&o.jsx("span",{className:Le.icon,children:i.icon}),i.badge!==void 0&&o.jsx("span",{className:Le.badge,children:i.badge})]}),s&&o.jsx("span",{className:Le.label,children:i.label})]},i.key)})})}const Ao="tempest_root_qXce2",Io="tempest_backdrop_WLqh0",Fo="tempest_sheet_Okz1P",Oo="tempest_handle_GWCoK",Bo="tempest_handleBar_XPPiI",zo="tempest_title_i5Vuc",Wo="tempest_body_bgDhJ",De={root:Ao,backdrop:Io,sheet:Fo,handle:Oo,handleBar:Bo,title:zo,body:Wo};function qo({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:a=!0,className:i,children:c,...u}){return l.useEffect(()=>{if(!e||!a)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,a,t]),l.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:Ve.createPortal(o.jsxs("div",{className:De.root,role:"dialog","aria-modal":"true",children:[o.jsx("div",{className:De.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),o.jsxs("div",{className:w.cn(De.sheet,i),...u,children:[s&&o.jsx("button",{type:"button",className:De.handle,"aria-label":"Arrastar para fechar",onClick:t,children:o.jsx("span",{className:De.handleBar})}),n&&o.jsx("div",{className:De.title,children:n}),o.jsx("div",{className:De.body,children:c})]})]}),document.body)}const Ko="tempest_nav_H4g6P",Uo="tempest_item_O4g3P",Ho="tempest_link_7WM67",Go="tempest_current_JdlcS",Qo="tempest_separator_zGWyJ",et={nav:Ko,item:Uo,link:Ho,current:Go,separator:Qo};function Jo({items:e,separator:t="/",className:n}){return o.jsx("nav",{"aria-label":"breadcrumb",className:w.cn(et.nav,n),children:e.map((s,r)=>{const a=r===e.length-1,i=!a&&(s.href||s.onClick);return o.jsxs(l.Fragment,{children:[o.jsx("span",{className:et.item,children:i?o.jsx("a",{href:s.href,onClick:c=>{s.onClick&&(c.preventDefault(),s.onClick())},className:et.link,children:s.label}):o.jsx("span",{"aria-current":a?"page":void 0,className:a?et.current:void 0,children:s.label})}),!a&&o.jsx("span",{className:et.separator,"aria-hidden":!0,children:t})]},r)})})}const Yo="tempest_button_2ZuB7",Xo="tempest_primary_s1sM6",Vo="tempest_secondary_R0waJ",Zo="tempest_danger_V4fX8",ea="tempest_success_w6qB6",ta="tempest_ghost_1KINV",na="tempest_soft_c3kzm",sa="tempest_outline_F5jq-",ra="tempest_link_Zt5hw",oa="tempest_xs_cF6m0",aa="tempest_sm_NhG0g",ia="tempest_md_hH4h3",ca="tempest_lg_2plQf",la="tempest_xl_nx4V0",ua="tempest_iconOnly_WCpTS",da="tempest_pill_lx8lt",pa="tempest_fullWidth_36oJT",ma="tempest_content_EKXmF",fa="tempest_loading_EQAt2",ha="tempest_hiddenText_hIiJ2",_a="tempest_spinner_ZExvW",ga="tempest_tempest-spin_UOSVC",ue={button:Yo,primary:Xo,secondary:Vo,danger:Zo,success:ea,ghost:ta,soft:na,outline:sa,link:ra,xs:oa,sm:aa,md:ia,lg:ca,xl:la,iconOnly:ua,pill:da,fullWidth:pa,content:ma,loading:fa,hiddenText:ha,spinner:_a,tempestSpin:ga};function Xe({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:a=!1,leftIcon:i,rightIcon:c,disabled:u,className:d,children:p,...m}){return o.jsxs("button",{className:w.cn(ue.button,ue[e],ue[t],r&&ue.iconOnly,a&&ue.pill,n&&ue.loading,s&&ue.fullWidth,d),disabled:u||n,...m,children:[n&&o.jsx("span",{className:ue.spinner,"aria-hidden":!0,children:o.jsx(ba,{})}),o.jsxs("span",{className:w.cn(ue.content,n&&ue.hiddenText),children:[i,p,c]})]})}function ba(){return o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const ya="tempest_card_Cb1o4",va="tempest_flat_LRpce",xa="tempest_raised_WmIqk",wa="tempest_elevated_5VEDw",ja="tempest_interactive_B8Tah",$a="tempest_padded_oOxwN",ka="tempest_flush_aiDZi",Na="tempest_header_PTXf2",Sa="tempest_title_mSgoo",Ca="tempest_body_W441Z",Ea="tempest_footer_Mu-JC",ne={card:ya,flat:va,raised:xa,elevated:wa,interactive:ja,padded:$a,flush:ka,header:Na,title:Sa,body:Ca,footer:Ea};function Ta({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:a="default",className:i,children:c,...u}){const d=!!(e||t);return o.jsxs("div",{className:w.cn(ne.card,a==="flat"&&ne.flat,a==="raised"&&ne.raised,a==="elevated"&&ne.elevated,r&&ne.interactive,!d&&!s&&ne.padded,s&&ne.flush,i),tabIndex:r?u.tabIndex??0:u.tabIndex,...u,children:[d&&o.jsxs("header",{className:ne.header,children:[typeof e=="string"?o.jsx("h3",{className:ne.title,children:e}):e,t]}),d?o.jsx("div",{className:ne.body,children:c}):c,n&&o.jsx("footer",{className:ne.footer,children:n})]})}const Ma="tempest_center_Pu1Pf",Ra="tempest_both_53GWn",La="tempest_horizontal_94-Bt",Da="tempest_vertical_Q7Kyg",nn={center:Ma,both:Ra,horizontal:La,vertical:Da};function Pa({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:a,...i}){const c={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return o.jsx("div",{className:w.cn(nn.center,nn[e],s),style:c,...i,children:a})}const Aa="tempest_wrapper_rpthW",Ia="tempest_disabled_x7-eg",Fa="tempest_input_2kt-h",Oa="tempest_box_OCPee",Ba="tempest_labelWrap_Ktbp0",za="tempest_label_cwRtI",Wa="tempest_description_rMhG1",Pe={wrapper:Aa,disabled:Ia,input:Fa,box:Oa,labelWrap:Ba,label:za,description:Wa},qa=l.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:a,className:i,...c},u){const d=l.useRef(null);l.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(m){d.current=m,typeof u=="function"?u(m):u&&(u.current=m)}return o.jsxs("label",{className:w.cn(Pe.wrapper,r&&Pe.disabled,a),children:[o.jsx("input",{ref:p,type:"checkbox",disabled:r,className:w.cn(Pe.input,i),...c}),o.jsx("span",{className:Pe.box,"aria-hidden":!0,children:s?o.jsx(Ua,{}):o.jsx(Ka,{})}),(t||n)&&o.jsxs("span",{className:Pe.labelWrap,children:[t&&o.jsx("span",{className:Pe.label,children:t}),n&&o.jsx("span",{className:Pe.description,children:n})]})]})});function Ka(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ua(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const Ha="tempest_wrapper_KR4-F",Ga="tempest_label_Mz-wX",Qa="tempest_field_iIBJw",Ja="tempest_error_O9n-9",Ya="tempest_chip_GEwrc",Xa="tempest_remove_JYDIq",Va="tempest_input_frJmk",Za="tempest_helper_Yts53",ei="tempest_errorText_llJGq",ye={wrapper:Ha,label:Ga,field:Qa,error:Ja,chip:Ya,remove:Xa,input:Va,helper:Za,errorText:ei};function ti({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:a,commitKeys:i=["Enter",",","Tab"],normalize:c=!0,className:u}){const[d,p]=l.useState(""),m=l.useRef(null);function f(){const v=c?d.trim().toLowerCase():d.trim();if(v){if(e.includes(v)){p("");return}t([...e,v]),p("")}}function h(v){if(i.includes(v.key)){v.preventDefault(),f();return}v.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function _(v){const y=e.slice();y.splice(v,1),t(y)}return o.jsxs("div",{className:w.cn(ye.wrapper,a&&ye.error,u),children:[n&&o.jsx("label",{className:ye.label,children:n}),o.jsxs("div",{className:ye.field,onClick:()=>m.current?.focus(),children:[e.map((v,y)=>o.jsxs("span",{className:ye.chip,children:[v,o.jsx("button",{type:"button",className:ye.remove,"aria-label":`Remover ${v}`,onClick:()=>_(y),children:"×"})]},`${v}-${y}`)),o.jsx("input",{ref:m,className:ye.input,value:d,placeholder:e.length===0?s:"",onChange:v=>p(v.target.value),onKeyDown:h,onBlur:f})]}),a?o.jsx("span",{className:ye.errorText,children:a}):r?o.jsx("span",{className:ye.helper,children:r}):null]})}const ni="tempest_wrapper_TNvle",si="tempest_label_KVkZO",ri="tempest_field_BenH0",oi="tempest_input_-HTv1",ai="tempest_caret_jRplQ",ii="tempest_menu_zPQG3",ci="tempest_option_vhhn5",li="tempest_active_XCgtX",ui="tempest_selected_T6nm2",di="tempest_empty_Ahw5K",pi="tempest_helper_OzB7V",mi="tempest_errorText_X18sQ",fi="tempest_error_bnVuM",K={wrapper:ni,label:si,field:ri,input:oi,caret:ai,menu:ii,option:ci,active:li,selected:ui,empty:di,helper:pi,errorText:mi,error:fi};function hi(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function _i({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:i,disabled:c,filter:u=hi,emptyMessage:d="Nenhuma opção encontrada",className:p}){const m=l.useId(),f=l.useRef(null),h=l.useRef(null),[_,v]=l.useState(!1),[y,g]=l.useState(""),[x,b]=l.useState(0),j=l.useMemo(()=>e.find(S=>S.value===t)?.label??"",[e,t]),k=l.useMemo(()=>e.filter(S=>u(S,y)),[e,u,y]),M=l.useCallback(()=>{v(!1),g(""),b(0)},[]),E=l.useCallback(S=>{S.disabled||(n(S.value),M())},[n,M]);l.useEffect(()=>{if(!_)return;const S=T=>{f.current&&!f.current.contains(T.target)&&M()};return window.addEventListener("mousedown",S),()=>window.removeEventListener("mousedown",S)},[_,M]);const N=S=>{if(S.key==="ArrowDown")S.preventDefault(),v(!0),b(T=>Math.min(k.length-1,T+1));else if(S.key==="ArrowUp")S.preventDefault(),b(T=>Math.max(0,T-1));else if(S.key==="Enter"){S.preventDefault();const T=k[x];T&&E(T)}else S.key==="Escape"&&M()};return o.jsxs("div",{ref:f,className:w.cn(K.wrapper,i&&K.error,p),children:[s&&o.jsx("label",{htmlFor:m,className:K.label,children:s}),o.jsxs("div",{className:K.field,children:[o.jsx("input",{id:m,ref:h,type:"text",role:"combobox","aria-expanded":_,"aria-controls":`${m}-listbox`,"aria-autocomplete":"list",className:K.input,placeholder:r,disabled:c,value:_?y:j,onFocus:()=>v(!0),onChange:S=>{g(S.target.value),v(!0),b(0)},onKeyDown:N}),o.jsx("span",{className:K.caret,"aria-hidden":!0,children:"▾"})]}),_&&o.jsx("ul",{id:`${m}-listbox`,role:"listbox",className:K.menu,children:k.length===0?o.jsx("li",{className:K.empty,children:d}):k.map((S,T)=>o.jsx("li",{role:"option","aria-selected":S.value===t,className:w.cn(K.option,T===x&&K.active,S.value===t&&K.selected),onMouseEnter:()=>b(T),onMouseDown:D=>{D.preventDefault(),E(S)},children:S.label},S.value))}),i?o.jsx("span",{className:K.errorText,children:i}):a?o.jsx("span",{className:K.helper,children:a}):null]})}const gi="tempest_overlay_dd9h1",bi="tempest_tempest-fade-in_DvgSp",yi="tempest_dialog_ptM-K",vi="tempest_tempest-modal-in_UoxQC",xi="tempest_sm_K5k3W",wi="tempest_md_gvyR7",ji="tempest_lg_BgB1a",$i="tempest_xl_MR-68",ki="tempest_size2xl_-PH9e",Ni="tempest_size3xl_iqDwN",Si="tempest_fullscreen_o84Xi",Ci="tempest_fullscreenOnMobile_0bDwe",Ei="tempest_body_lVhql",Ti="tempest_header_ILG9i",Mi="tempest_footer_rro2w",Ri="tempest_title_A5OeE",Li="tempest_close_-ER1C",V={overlay:gi,tempestFadeIn:bi,dialog:yi,tempestModalIn:vi,sm:xi,md:wi,lg:ji,xl:$i,size2Xl:ki,size3Xl:Ni,fullscreen:Si,fullscreenOnMobile:Ci,body:Ei,header:Ti,footer:Mi,title:Ri,close:Li};function Gt({open:e,onClose:t,title:n,children:s,footer:r,size:a="md",closeOnBackdrop:i=!0,closeOnEsc:c=!0,className:u,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:m=!1}){return l.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const h=_=>{c&&_.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",h)}},[e,c,t]),!e||typeof document>"u"?null:Ve.createPortal(o.jsx("div",{className:V.overlay,role:"presentation",onClick:()=>{i&&t()},children:o.jsxs("div",{role:"dialog","aria-modal":"true",className:w.cn(V.dialog,Di(a),p&&V.fullscreen,m&&V.fullscreenOnMobile,u),onClick:f=>f.stopPropagation(),children:[(n||!d)&&o.jsxs("header",{className:V.header,children:[o.jsx("h3",{className:V.title,children:n}),!d&&o.jsx("button",{type:"button",className:V.close,"aria-label":"Fechar",onClick:t,children:o.jsx(Pi,{})})]}),o.jsx("div",{className:V.body,children:s}),r&&o.jsx("footer",{className:V.footer,children:r})]})}),document.body)}function Di(e){return e==="2xl"?V.size2xl:e==="3xl"?V.size3xl:V[e]}function Pi(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Dn({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:a="primary",loading:i=!1,onConfirm:c,onCancel:u}){return o.jsx(Gt,{open:e,onClose:u,title:t,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(Xe,{variant:"secondary",onClick:u,disabled:i,children:r}),o.jsx(Xe,{variant:a,loading:i,onClick:()=>{c()},children:s})]}),children:n})}const Ai=l.forwardRef(function({value:t,onChange:n,mode:s="date",...r},a){return o.jsx(P.Input,{...r,ref:a,type:s,value:t,onChange:i=>n(i.target.value)})}),Ii="tempest_divider_KSGsi",Fi="tempest_horizontal_pZ05Y",Oi="tempest_bare_elDbS",Bi="tempest_vertical_p-jD4",zi="tempest_dashed_JWxCU",Wi="tempest_alignStart_QAIi1",qi="tempest_alignEnd_eZDwa",J={divider:Ii,horizontal:Fi,bare:Oi,vertical:Bi,dashed:zi,alignStart:Wi,alignEnd:qi};function Ki({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...a}){return e==="vertical"?o.jsx("span",{role:"separator","aria-orientation":"vertical",className:w.cn(J.divider,J.vertical,t==="dashed"&&J.dashed,r),...a}):n?o.jsx("div",{role:"separator","aria-orientation":"horizontal",className:w.cn(J.divider,J.horizontal,t==="dashed"&&J.dashed,s==="start"&&J.alignStart,s==="end"&&J.alignEnd,r),...a,children:n}):o.jsx("hr",{className:w.cn(J.divider,J.horizontal,J.bare,t==="dashed"&&J.dashed,r)})}const Ui="tempest_overlay_hcG1G",Hi="tempest_tempest-drawer-overlay_XFbxY",Gi="tempest_panel_wUX0N",Qi="tempest_right_-oX-6",Ji="tempest_tempest-drawer-in-right_pWYHv",Yi="tempest_left_xi3nD",Xi="tempest_tempest-drawer-in-left_o7JSb",Vi="tempest_top_7rGCn",Zi="tempest_tempest-drawer-in-top_kn6AF",ec="tempest_bottom_zd-25",tc="tempest_tempest-drawer-in-bottom_0x3u7",nc="tempest_handle_5B-TB",sc="tempest_handleTop_7aMf-",rc="tempest_header_sYoP1",oc="tempest_title_LqUOu",ac="tempest_close_tYPhU",ic="tempest_body_aV9FG",cc="tempest_footer_AuvUP",de={overlay:Ui,tempestDrawerOverlay:Hi,panel:Gi,right:Qi,tempestDrawerInRight:Ji,left:Yi,tempestDrawerInLeft:Xi,top:Vi,tempestDrawerInTop:Zi,bottom:ec,tempestDrawerInBottom:tc,handle:nc,handleTop:sc,header:rc,title:oc,close:ac,body:ic,footer:cc};function lc({open:e,onClose:t,placement:n="right",title:s,children:r,footer:a,closeOnBackdrop:i=!0,closeOnEsc:c=!0,hideCloseButton:u=!1,className:d,mobilePlacement:p,showHandle:m=!1}){const{isMobile:f}=ze(),h=f&&p?p:n;return l.useEffect(()=>{if(!e)return;const _=document.body.style.overflow;document.body.style.overflow="hidden";const v=y=>{c&&y.key==="Escape"&&t()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",v)}},[e,c,t]),!e||typeof document>"u"?null:Ve.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:de.overlay,onClick:()=>{i&&t()}}),o.jsxs("aside",{role:"dialog","aria-modal":"true",className:w.cn(de.panel,de[h],d),children:[m&&(h==="bottom"||h==="top")&&o.jsx("div",{className:w.cn(de.handle,h==="top"&&de.handleTop),"aria-hidden":!0}),(s||!u)&&o.jsxs("header",{className:de.header,children:[o.jsx("h3",{className:de.title,children:s}),!u&&o.jsx("button",{type:"button","aria-label":"Fechar",className:de.close,onClick:t,children:o.jsx(uc,{})})]}),o.jsx("div",{className:de.body,children:r}),a&&o.jsx("footer",{className:de.footer,children:a})]})]}),document.body)}function uc(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const dc="tempest_root_5ZetV",pc="tempest_menu_-RiRW",mc="tempest_bottomStart_z60h9",fc="tempest_bottomEnd_b1tmU",hc="tempest_topStart_A0em2",_c="tempest_topEnd_cFA5-",gc="tempest_item_T-QPZ",bc="tempest_active_WNqoX",yc="tempest_danger_C0jN3",vc="tempest_separator_RimQa",xc="tempest_label_6yP76",ie={root:dc,menu:pc,bottomStart:mc,bottomEnd:fc,topStart:hc,topEnd:_c,item:gc,active:bc,danger:yc,separator:vc,label:xc};function wc(e){switch(e){case"bottom-end":return ie.bottomEnd;case"top-start":return ie.topStart;case"top-end":return ie.topEnd;default:return ie.bottomStart}}function jc({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,a]=l.useState(!1),[i,c]=l.useState(-1),u=l.useId(),d=l.useRef(null),p=l.useRef([]),m=t.map((y,g)=>y.type==="item"&&!y.disabled?g:-1).filter(y=>y!==-1),f=l.useCallback(()=>{a(!1),c(-1)},[]);l.useEffect(()=>{if(!r)return;const y=x=>{if(x.key==="Escape"){f();return}if(x.key==="ArrowDown"){x.preventDefault();const b=m.indexOf(i),j=m[(b+1)%m.length]??-1;c(j),p.current[j]?.focus()}if(x.key==="ArrowUp"){x.preventDefault();const b=m.indexOf(i),j=m[(b-1+m.length)%m.length]??-1;c(j),p.current[j]?.focus()}},g=x=>{d.current&&!d.current.contains(x.target)&&f()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[r,i,m,f]);const h=y=>{e.props.onClick?.(y),a(g=>!g)},_={...e,props:{...e.props,onClick:h,"aria-expanded":r,"aria-controls":u,"aria-haspopup":"menu"}},v=y=>{y.onSelect(),f()};return o.jsxs("span",{ref:d,className:ie.root,children:[_,r&&o.jsx("ul",{id:u,role:"menu",className:w.cn(ie.menu,wc(n),s),children:t.map((y,g)=>y.type==="separator"?o.jsx("li",{role:"separator",className:ie.separator,"aria-hidden":!0},y.id):y.type==="label"?o.jsx("li",{role:"presentation",className:ie.label,children:y.label},y.id):o.jsx("li",{role:"none",children:o.jsxs("button",{ref:x=>{p.current[g]=x},type:"button",role:"menuitem",className:w.cn(ie.item,y.danger&&ie.danger,i===g&&ie.active),disabled:y.disabled,onClick:()=>v(y),onMouseEnter:()=>c(g),children:[y.icon&&o.jsx("span",{"aria-hidden":!0,children:y.icon}),y.label]})},y.id))})]})}const $c="tempest_zone_u04pu",kc="tempest_dragging_uGtl4",Nc="tempest_disabled_GTKfV",Sc="tempest_input_qhJ1u",Cc="tempest_prompt_mlpWz",tt={zone:$c,dragging:kc,disabled:Nc,input:Sc,prompt:Cc};function Ec({onDrop:e,accept:t,multiple:n=!0,disabled:s=!1,maxSize:r,onReject:a,children:i,className:c}){const u=l.useRef(null),[d,p]=l.useState(!1),m=x=>{if(!x||x.length===0)return;const b=Array.from(x),j=n?b:b.slice(0,1);if(r===void 0){e(j);return}const k=[],M=[];for(const E of j)E.size>r?M.push(E):k.push(E);M.length>0&&a?.(M),k.length>0&&e(k)},f=()=>{s||u.current?.click()},h=x=>{x.preventDefault(),!s&&p(!0)},_=x=>{x.preventDefault()},v=x=>{x.preventDefault(),p(!1)},y=x=>{x.preventDefault(),p(!1),!s&&m(x.dataTransfer.files)},g=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f())};return o.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,className:w.cn(tt.zone,d&&tt.dragging,s&&tt.disabled,c),onClick:f,onKeyDown:g,onDragEnter:h,onDragOver:_,onDragLeave:v,onDrop:y,children:[o.jsx("input",{ref:u,type:"file",className:tt.input,accept:t,multiple:n,disabled:s,onChange:x=>{m(x.target.files),x.target.value=""}}),i??o.jsx("span",{className:tt.prompt,children:"Arraste arquivos aqui ou clique para selecionar"})]})}const Tc="tempest_wrapper_gzyTd",Mc="tempest_icon_qVCyh",Rc="tempest_title_xPfUf",Lc="tempest_description_oWwH1",Dc="tempest_action_dqxw1",nt={wrapper:Tc,icon:Mc,title:Rc,description:Lc,action:Dc};function Pc({icon:e,title:t,description:n,action:s,className:r}){return o.jsxs("div",{className:w.cn(nt.wrapper,r),children:[e&&o.jsx("div",{className:nt.icon,children:e}),o.jsx("h4",{className:nt.title,children:t}),n&&o.jsx("p",{className:nt.description,children:n}),s&&o.jsx("div",{className:nt.action,children:s})]})}const Ac="tempest_wrapper_luRyF",Ic="tempest_icon_dEdBl",Fc="tempest_title_StutD",Oc="tempest_description_A2XCb",Bc="tempest_action_vm1LC",st={wrapper:Ac,icon:Ic,title:Fc,description:Oc,action:Bc};function zc({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:a}){return o.jsxs("div",{className:w.cn(st.wrapper,a),children:[o.jsx("div",{className:st.icon,children:r??o.jsx(Wc,{})}),o.jsx("h4",{className:st.title,children:e}),t&&o.jsx("p",{className:st.description,children:t}),n&&o.jsx("div",{className:st.action,children:o.jsx(Xe,{variant:"secondary",onClick:n,children:s})})]})}function Wc(){return o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:o.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 qc="tempest_wrapper_E0qHs",Kc="tempest_label_lbMkx",Uc="tempest_dropzone_jqua0",Hc="tempest_active_CG9Uk",Gc="tempest_disabled_WNUUl",Qc="tempest_icon_i9fGH",Jc="tempest_title_bTVFl",Yc="tempest_subtitle_S54OV",Xc="tempest_files_WljYm",Vc="tempest_file_Lp-dR",Zc="tempest_fileMeta_LTnN2",el="tempest_remove_jskra",tl="tempest_hidden_ReEq6",U={wrapper:qc,label:Kc,dropzone:Uc,active:Hc,disabled:Gc,icon:Qc,title:Jc,subtitle:Yc,files:Xc,file:Vc,fileMeta:Zc,remove:el,hidden:tl};function nl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function sl(e,t){if(!t)return!0;const n=t.split(",").map(a=>a.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(a=>a.startsWith(".")?s.endsWith(a):a.endsWith("/*")?r.startsWith(a.replace("/*","/")):r===a)}function rl({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:a,onReject:i,disabled:c,title:u="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[m,f]=l.useState(!1),h=l.useRef(null);function _(g){const x=[],b=[];for(const k of Array.from(g)){if(!sl(k,s)){b.push({file:k,reason:"type"});continue}if(a&&k.size>a){b.push({file:k,reason:"size"});continue}x.push(k)}if(b.length>0&&i?.(b),x.length===0)return;const j=r?[...e,...x]:x.slice(0,1);t(j)}function v(g){g.preventDefault(),f(!1),!c&&g.dataTransfer?.files&&_(g.dataTransfer.files)}function y(g){const x=e.slice();x.splice(g,1),t(x)}return o.jsxs("div",{className:w.cn(U.wrapper,p),children:[n&&o.jsx("label",{className:U.label,children:n}),o.jsxs("div",{className:w.cn(U.dropzone,m&&U.active,c&&U.disabled),role:"button",tabIndex:c?-1:0,onClick:()=>!c&&h.current?.click(),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h.current?.click())},onDragEnter:g=>{g.preventDefault(),c||f(!0)},onDragOver:g=>g.preventDefault(),onDragLeave:()=>f(!1),onDrop:v,children:[o.jsx("div",{className:U.icon,"aria-hidden":!0,children:o.jsx(ol,{})}),o.jsx("p",{className:U.title,children:u}),d&&o.jsx("p",{className:U.subtitle,children:d}),o.jsx("input",{ref:h,type:"file",accept:s,multiple:r,disabled:c,className:U.hidden,onChange:g=>{g.target.files&&_(g.target.files),g.target.value=""}})]}),e.length>0&&o.jsx("ul",{className:U.files,children:e.map((g,x)=>o.jsxs("li",{className:U.file,children:[o.jsxs("div",{children:[o.jsx("div",{children:g.name}),o.jsx("div",{className:U.fileMeta,children:nl(g.size)})]}),o.jsx("button",{type:"button","aria-label":`Remover ${g.name}`,className:U.remove,onClick:()=>y(x),children:"×"})]},`${g.name}-${x}`))})]})}function ol(){return o.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const al="tempest_form_jNBDR",il="tempest_stack_O1Hl-",cl="tempest_inline_LBQAv",ll="tempest_grid_-B86T",ul="tempest_section_HGqw3",dl="tempest_sectionHeader_ji9hQ",pl="tempest_sectionTitle_GTPwe",ml="tempest_sectionDescription_KjW7k",fl="tempest_sectionBody_Vp2wz",hl="tempest_row_1EkVR",_l="tempest_actions_hK95I",gl="tempest_start_gXnm3",bl="tempest_center_mKkz4",yl="tempest_end_O3yDQ",vl="tempest_between_tte2z",ce={form:al,stack:il,inline:cl,grid:ll,section:ul,sectionHeader:dl,sectionTitle:pl,sectionDescription:ml,sectionBody:fl,row:hl,actions:_l,start:gl,center:bl,end:yl,between:vl};function Nt(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function Pn(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const xl=l.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:a,children:i,...c},u){const d={gap:Nt(s,4),...t==="grid"?{gridTemplateColumns:Pn(n)}:null,...a};return o.jsx("form",{ref:u,className:w.cn(ce.form,ce[t],r),style:d,...c,children:i})});function wl({title:e,description:t,layout:n="stack",columns:s,gap:r,className:a,style:i,children:c,...u}){const d={gap:Nt(r,4),...n==="grid"?{gridTemplateColumns:Pn(s)}:null};return o.jsxs("section",{className:w.cn(ce.section,a),style:i,...u,children:[(e||t)&&o.jsxs("header",{className:ce.sectionHeader,children:[e&&o.jsx("h3",{className:ce.sectionTitle,children:e}),t&&o.jsx("p",{className:ce.sectionDescription,children:t})]}),o.jsx("div",{className:w.cn(ce.sectionBody,ce[n]),style:d,children:c})]})}function jl({gap:e,className:t,style:n,children:s,...r}){const a={gap:Nt(e,3),...n};return o.jsx("div",{className:w.cn(ce.row,t),style:a,...r,children:s})}function $l({align:e="end",gap:t,className:n,style:s,children:r,...a}){const i={gap:Nt(t,2),...s};return o.jsx("div",{className:w.cn(ce.actions,ce[e],n),style:i,...a,children:r})}const kl="tempest_container_fJfOt",Nl="tempest_sm_k8D4-",Sl="tempest_md_EnpYy",Cl="tempest_lg_UU-Ig",El="tempest_xl_2TEWj",Tl="tempest_full_l8bvG",Ml="tempest_stack_sxR8u",Rl="tempest_vertical_2TMf5",Ll="tempest_horizontal_r7-c-",Dl="tempest_center_EDSAh",Pl="tempest_start_ucQ-K",Al="tempest_end_pnKlF",Il="tempest_stretch_pX6l7",Fl="tempest_justifyStart_lHYsS",Ol="tempest_justifyCenter_JH2m6",Bl="tempest_justifyEnd_EBisT",zl="tempest_justifyBetween_mAJwT",Wl="tempest_wrap_-xxOh",ql="tempest_grid_o-JIX",Z={container:kl,sm:Nl,md:Sl,lg:Cl,xl:El,full:Tl,stack:Ml,vertical:Rl,horizontal:Ll,center:Dl,start:Pl,end:Al,stretch:Il,justifyStart:Fl,justifyCenter:Ol,justifyEnd:Bl,justifyBetween:zl,wrap:Wl,grid:ql};function Kl({size:e="lg",className:t,children:n,...s}){return o.jsx("div",{className:w.cn(Z.container,Z[e],t),...s,children:n})}function Ul(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function $t(e,t){if(e!==void 0)return Ul(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function An(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function In(e,t){return e?"mobile":t?"tablet":"desktop"}function Hl({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:a,style:i,children:c,...u}){const{isMobile:d,isTablet:p}=ze(),m=In(d,p),f=$t(e,m)??"vertical",_={gap:An($t(t,m)),...i},v=s==="between"?Z.justifyBetween:s==="center"?Z.justifyCenter:s==="end"?Z.justifyEnd:s==="start"?Z.justifyStart:void 0;return o.jsx("div",{className:w.cn(Z.stack,f==="vertical"?Z.vertical:Z.horizontal,n&&Z[n],v,r&&Z.wrap,a),style:_,...u,children:c})}function Gl(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function Ql({columns:e=2,gap:t=4,className:n,style:s,children:r,...a}){const{isMobile:i,isTablet:c}=ze(),u=In(i,c),d=Gl($t(e,u)),p=An($t(t,u));return o.jsx("div",{className:w.cn(Z.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...a,children:r})}function sn(){if(typeof window>"u")return!1;const t=["standalone","fullscreen","minimal-ui"].some(s=>window.matchMedia?.(`(display-mode: ${s})`)?.matches),n=window.navigator.standalone===!0;return t||n}function Qt(){const[e,t]=l.useState(null),[n,s]=l.useState(!1),[r,a]=l.useState(sn);l.useEffect(()=>{if(typeof window>"u")return;const c=m=>{m.preventDefault(),t(m)},u=()=>{t(null),s(!0),a(!0)},d=window.matchMedia?.("(display-mode: standalone)"),p=()=>a(sn());return window.addEventListener("beforeinstallprompt",c),window.addEventListener("appinstalled",u),d?.addEventListener("change",p),()=>{window.removeEventListener("beforeinstallprompt",c),window.removeEventListener("appinstalled",u),d?.removeEventListener("change",p)}},[]);const i=l.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const c=await e.userChoice;return t(null),c.outcome==="accepted"&&s(!0),c.outcome},[e]);return{installable:!!e,installed:n,isStandalone:r,prompt:i}}const Jl="tempest_banner_0oCIc",Yl="tempest_icon_izjRL",Xl="tempest_body_9JAQv",Vl="tempest_title_1E50X",Zl="tempest_description_QY25-",eu="tempest_close_RN6FO",Ke={banner:Jl,icon:Yl,body:Xl,title:Vl,description:Zl,close:eu};function tu(e){if(!e||typeof window>"u")return!1;try{return window.localStorage.getItem(e)==="1"}catch{return!1}}function nu({title:e="Instale o app",description:t,installLabel:n="Instalar",dismissLabel:s="Dispensar",icon:r,storageKey:a,onResult:i,className:c}){const{installable:u,installed:d,isStandalone:p,prompt:m}=Qt(),[f,h]=l.useState(()=>tu(a));if(!u||d||p||f)return null;const _=()=>{if(h(!0),a&&typeof window<"u")try{window.localStorage.setItem(a,"1")}catch{}};return o.jsxs("div",{className:w.cn(Ke.banner,c),role:"region","aria-label":String(e),children:[r&&o.jsx("span",{className:Ke.icon,children:r}),o.jsxs("div",{className:Ke.body,children:[o.jsx("p",{className:Ke.title,children:e}),t&&o.jsx("p",{className:Ke.description,children:t})]}),o.jsx(Xe,{size:"sm",onClick:async()=>{i?.(await m())},children:n}),o.jsx("button",{type:"button",className:Ke.close,"aria-label":s,onClick:_,children:o.jsx(Ln.X,{size:18,"aria-hidden":!0})})]})}function su({label:e="Instalar app",onResult:t,...n}){const{installable:s,installed:r,isStandalone:a,prompt:i}=Qt();return!s||r||a?null:o.jsx(Xe,{onClick:async()=>{t?.(await i())},...n,children:e})}const ru="tempest_kbd_jgbYx",ou="tempest_sm_9WPWA",au="tempest_md_BePC0",iu="tempest_lg_cBKum",rn={kbd:ru,sm:ou,md:au,lg:iu};function cu({size:e="md",className:t,children:n,...s}){return o.jsx("kbd",{className:w.cn(rn.kbd,rn[e],t),...s,children:n})}const lu="tempest_stack_zYzdv",uu={stack:lu},Fn=l.createContext(null);function du({children:e}){const[t,n]=l.useState([]),s=l.useRef(0),r=l.useCallback(()=>(s.current+=1,`modal-${s.current}`),[]),a=l.useCallback(p=>{n(m=>m.filter(f=>f.id!==p))},[]),i=l.useCallback(()=>{n([])},[]),c=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"content",id:m,options:p}]),m},[r]),u=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"confirm",id:m,options:p}]),m},[r]),d=l.useMemo(()=>({open:c,confirm:u,close:a,closeAll:i}),[c,u,a,i]);return o.jsxs(Fn.Provider,{value:d,children:[e,o.jsx("div",{className:uu.stack,children:t.map(p=>p.kind==="content"?o.jsx(pu,{entry:p,close:a},p.id):o.jsx(mu,{entry:p,close:a},p.id))})]})}function pu({entry:e,close:t}){const{options:n,id:s}=e,r=()=>{n.onClose?.(),t(s)};return o.jsx(Gt,{open:!0,onClose:r,title:n.title,size:n.size,closeOnBackdrop:n.closeOnBackdrop,closeOnEsc:n.closeOnEsc,hideCloseButton:n.hideCloseButton,children:n.children})}function mu({entry:e,close:t}){const{options:n,id:s}=e,[r,a]=l.useState(!1),i=async()=>{try{a(!0),await n.onConfirm?.()}finally{a(!1),t(s)}},c=()=>{n.onCancel?.(),t(s)};return o.jsx(Dn,{open:!0,title:n.title??"",description:n.message,confirmLabel:n.confirmLabel,cancelLabel:n.cancelLabel,variant:n.danger?"danger":"primary",loading:r,onConfirm:i,onCancel:c})}function fu(){const e=l.useContext(Fn);if(e===null)throw new Error("useModals must be used within a <ModalsProvider>");return e}const hu="tempest_navbar_Ey25T",_u="tempest_surface_xyKhM",gu="tempest_primary_w3ft-",bu="tempest_transparent_N1vMR",yu="tempest_bordered_HD49R",vu="tempest_sticky_0XsOs",xu="tempest_logo_O9j3q",wu="tempest_nav_0oisE",ju="tempest_actions_8BNWJ",Ae={navbar:hu,surface:_u,primary:gu,transparent:bu,bordered:yu,sticky:vu,logo:xu,nav:wu,actions:ju};function $u({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:a=!0,className:i,...c}){return o.jsxs("header",{className:w.cn(Ae.navbar,Ae[r],s&&Ae.sticky,a&&Ae.bordered,i),...c,children:[e&&o.jsx("div",{className:Ae.logo,children:e}),t&&o.jsx("nav",{className:Ae.nav,children:t}),n&&o.jsx("div",{className:Ae.actions,children:n})]})}const ku="tempest_bar_zxTqx",Nu={bar:ku},Su=300,on=.9,Cu=300;function an(e){return e<0?0:e>1?1:e}function Eu(){let e={value:0,active:!1};const t=new Set;let n=null,s=null;const r=()=>{for(const h of t)h(e)},a=h=>{e={...e,...h},r()},i=()=>{n!==null&&(clearInterval(n),n=null)},c=()=>{s!==null&&(clearTimeout(s),s=null)},u=h=>{const _=e.value;if(_>=on)return;const v=h??(1-_)*.1+.01;a({value:Math.min(an(_+v),on)})};return{start:()=>{c(),!e.active&&(a({active:!0,value:e.value>0?e.value:.08}),i(),n=setInterval(()=>u(),Su))},done:()=>{i(),c(),a({value:1,active:!0}),s=setTimeout(()=>{a({active:!1,value:0}),s=null},Cu)},set:h=>{c();const _=an(h);a({value:_,active:_<1?!0:e.active})},inc:u,subscribe:h=>(t.add(h),h(e),()=>{t.delete(h)})}}const On=Eu();function Tu({color:e,height:t=3,className:n}){const[s,r]=l.useState({value:0,active:!1});if(l.useEffect(()=>On.subscribe(r),[]),!s.active)return null;const a={width:`${Math.round(s.value*100)}%`,height:`${t}px`,background:e??"var(--tempest-primary)"};return o.jsx("div",{className:w.cn(Nu.bar,n),style:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s.value*100)})}const Mu="tempest_page_THNNc",Ru="tempest_padded_bzjoF",Lu="tempest_header_PZEzk",Du="tempest_headerText_qYXFI",Pu="tempest_eyebrow_651RV",Au="tempest_title_2oGnT",Iu="tempest_description_YzmWl",Fu="tempest_actions_-rB3U",Ou="tempest_toolbar_sA7sD",Bu="tempest_content_RCB4b",zu="tempest_footer_540pQ",se={page:Mu,padded:Ru,header:Lu,headerText:Du,eyebrow:Pu,title:Au,description:Iu,actions:Fu,toolbar:Ou,content:Bu,footer:zu};function Wu({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:a,padded:i=!0,className:c,children:u,...d}){const p=e||t||n||s;return o.jsxs("main",{className:w.cn(se.page,i&&se.padded,c),...d,children:[p&&o.jsxs("header",{className:se.header,children:[o.jsxs("div",{className:se.headerText,children:[t&&o.jsx("div",{className:se.eyebrow,children:t}),e&&o.jsx("h1",{className:se.title,children:e}),n&&o.jsx("p",{className:se.description,children:n})]}),s&&o.jsx("div",{className:se.actions,children:s})]}),r&&o.jsx("div",{className:se.toolbar,children:r}),o.jsx("div",{className:se.content,children:u}),a&&o.jsx("footer",{className:se.footer,children:a})]})}const qu="tempest_wrapper_cRGQm",Ku="tempest_controls_fdL-y",Uu="tempest_page_WjG0l",Hu="tempest_active_1kqsJ",Gu="tempest_ellipsis_V294k",Qu="tempest_sizeSelect_ZayTo",Ju="tempest_numeric_ztI0I",Yu="tempest_summary_ZTggV",re={wrapper:qu,controls:Ku,page:Uu,active:Hu,ellipsis:Gu,sizeSelect:Qu,numeric:Ju,summary:Yu};function Xu(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(c,u)=>u+1);const r=Math.max(2,e-Math.floor(n/2)),a=Math.min(t-1,r+n-1),i=[1];r>2&&i.push("...");for(let c=r;c<=a;c++)i.push(c);return a<t-1&&i.push("..."),i.push(t),i}function Bn({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:a=[10,25,50,100],totalItems:i,siblingCount:c=3,className:u}){const d=l.useMemo(()=>Xu(e,t,c),[e,t,c]);return t<=1&&!r?null:o.jsxs("div",{className:w.cn(re.wrapper,u),children:[o.jsx("div",{className:re.summary,children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:`Página ${e} de ${t}`}),o.jsxs("div",{className:re.controls,children:[o.jsx("button",{type:"button",className:re.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,m)=>p==="..."?o.jsx("span",{className:w.cn(re.ellipsis,re.numeric),children:"…"},`ellipsis-${m}`):o.jsx("button",{type:"button",className:w.cn(re.page,re.numeric,p===e&&re.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),o.jsx("button",{type:"button",className:re.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&o.jsx("select",{className:re.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:a.map(p=>o.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const Vu="tempest_wrapper_zEU-L",Zu="tempest_label_ps3gD",ed="tempest_field_7taZG",td="tempest_input_FWEvb",nd="tempest_sm_3-CZz",sd="tempest_md_ReV0O",rd="tempest_lg_DiTiB",od="tempest_toggle_WNeX9",ad="tempest_error_QdIFf",id="tempest_helper_mBUna",cd="tempest_errorText_73Uvv",ld="tempest_strength_i6RaQ",ud="tempest_strengthBar_PAPHR",dd="tempest_strengthLabel_u9QHS",pd="tempest_level0_n6tWv",md="tempest_level1_FOI93",fd="tempest_level2_q5Wii",hd="tempest_level3_BpB53",_d="tempest_level4_vyQ3x",H={wrapper:Vu,label:Zu,field:ed,input:td,sm:nd,md:sd,lg:rd,toggle:od,error:ad,helper:id,errorText:cd,strength:ld,strengthBar:ud,strengthLabel:dd,level0:pd,level1:md,level2:fd,level3:hd,level4:_d},gd=["Muito fraca","Fraca","Razoável","Forte","Excelente"];function zn(e){if(!e)return 0;let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^A-Za-z0-9]/.test(e)&&(t+=1),Math.min(4,t)}const bd=l.forwardRef(function({label:t,helperText:n,error:s,size:r="md",showStrength:a=!1,strength:i,strengthLabels:c=gd,toggleLabels:u={show:"Mostrar senha",hide:"Esconder senha"},className:d,value:p,defaultValue:m,...f},h){const[_,v]=l.useState(!1),y=String(p??m??""),g=i??zn(y);return o.jsxs("div",{className:w.cn(H.wrapper,H[r],s&&H.error,d),children:[t&&o.jsx("label",{className:H.label,children:t}),o.jsxs("div",{className:H.field,children:[o.jsx("input",{ref:h,...f,value:p,defaultValue:m,type:_?"text":"password","aria-invalid":!!s,className:H.input}),o.jsx("button",{type:"button",className:H.toggle,"aria-label":_?u.hide:u.show,"aria-pressed":_,onClick:()=>v(x=>!x),children:_?"🙈":"👁"})]}),a&&o.jsxs("div",{className:w.cn(H.strength,H[`level${g}`]),"aria-label":c[g],children:[o.jsx("div",{className:H.strengthBar,children:o.jsx("span",{style:{width:`${g/4*100}%`}})}),o.jsx("span",{className:H.strengthLabel,children:c[g]})]}),s?o.jsx("span",{className:H.errorText,children:s}):n?o.jsx("span",{className:H.helper,children:n}):null]})}),yd="tempest_wrapper_3WAh7",vd="tempest_label_Hk01i",xd="tempest_cells_URO3v",wd="tempest_cell_fxLzs",jd="tempest_sm_SQM-s",$d="tempest_md_aHCGl",kd="tempest_lg_JpI4A",Nd="tempest_error_Kou0o",Sd="tempest_helper_W04iL",Cd="tempest_errorText_h4svq",Se={wrapper:yd,label:vd,cells:xd,cell:wd,sm:jd,md:$d,lg:kd,error:Nd,helper:Sd,errorText:Cd},Ed=/[0-9]/,Td=/[A-Za-z0-9]/,Md=l.forwardRef(function({length:t=6,type:n="numeric",size:s="md",value:r,defaultValue:a,onChange:i,onComplete:c,masked:u=!1,label:d,helperText:p,error:m,disabled:f=!1,autoFocus:h=!1,id:_,className:v},y){const g=l.useId(),x=_??g,b=r!==void 0,[j,k]=l.useState(a??""),M=b?r??"":j,E=Array.from({length:t},(L,R)=>M[R]??""),N=l.useRef([]),S=n==="numeric"?Ed:Td;l.useEffect(()=>{h&&N.current[0]?.focus()},[h]);const T=L=>{const R=L.slice(0,t);b||k(R),i?.(R),R.length===t&&c?.(R)},D=L=>{const R=Math.max(0,Math.min(t-1,L));N.current[R]?.focus(),N.current[R]?.select()},$=L=>R=>{const W=R.target.value.slice(-1);if(W&&!S.test(W))return;const We=E.slice();We[L]=W,T(We.join("")),W&&D(L+1)},C=L=>R=>{if(R.key==="Backspace"){if(!E[L]&&L>0){R.preventDefault();const W=E.slice();W[L-1]="",T(W.join("")),D(L-1)}}else R.key==="ArrowLeft"?(R.preventDefault(),D(L-1)):R.key==="ArrowRight"&&(R.preventDefault(),D(L+1))},I=L=>{const R=L.clipboardData.getData("text").split("").filter(W=>S.test(W)).join("");R&&(L.preventDefault(),T(R),D(Math.min(t-1,R.length)))};return o.jsxs("div",{ref:y,className:w.cn(Se.wrapper,m&&Se.error,v),id:x,children:[d&&o.jsx("label",{className:Se.label,children:d}),o.jsx("div",{className:w.cn(Se.cells,Se[s]),role:"group","aria-label":d,children:E.map((L,R)=>o.jsx("input",{ref:W=>{N.current[R]=W},type:u?"password":"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:R===0?"one-time-code":"off",maxLength:1,value:L,disabled:f,className:Se.cell,"aria-label":`Dígito ${R+1}`,"aria-invalid":!!m,onChange:$(R),onKeyDown:C(R),onPaste:I},R))}),m?o.jsx("span",{className:Se.errorText,children:m}):p?o.jsx("span",{className:Se.helper,children:p}):null]})}),Rd="tempest_root_vEMon",Ld="tempest_popover_E9K9X",Dd="tempest_tempest-popover-in_W8miP",Pd="tempest_top_TYlrh",Ad="tempest_bottom_wGs70",Id="tempest_left_h7fCr",Fd="tempest_right_--bJW",Ct={root:Rd,popover:Ld,tempestPopoverIn:Dd,top:Pd,bottom:Ad,left:Id,right:Fd};function Od({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:a=!1,closeOnEsc:i=!0,closeOnOutsideClick:c=!0,className:u}){const d=s!==void 0,[p,m]=l.useState(a),f=d?s:p,h=l.useId(),_=l.useRef(null),v=l.useCallback(x=>{d||m(x),r?.(x)},[d,r]);l.useEffect(()=>{if(!f)return;const x=j=>{i&&j.key==="Escape"&&v(!1)},b=j=>{c&&_.current&&!_.current.contains(j.target)&&v(!1)};return window.addEventListener("keydown",x),window.addEventListener("mousedown",b),()=>{window.removeEventListener("keydown",x),window.removeEventListener("mousedown",b)}},[f,i,c,v]);const y=x=>{e.props.onClick?.(x),v(!f)},g={...e,props:{...e.props,onClick:y,"aria-expanded":f,"aria-controls":h}};return o.jsxs("span",{ref:_,className:Ct.root,children:[g,f&&o.jsx("div",{id:h,role:"dialog",className:w.cn(Ct.popover,Ct[n],u),children:t})]})}const Bd="tempest_wrapper_BQek1",zd="tempest_bar_uC-0x",Wd="tempest_fill_vmg7x",qd="tempest_success_gWJ8U",Kd="tempest_warning_DGkPO",Ud="tempest_danger_gfwHh",Hd="tempest_indeterminate_HojUj",Gd="tempest_tempest-progress-loop_0nEdF",Qd="tempest_label_qqHJM",Ue={wrapper:Bd,bar:zd,fill:Wd,success:qd,warning:Kd,danger:Ud,indeterminate:Hd,tempestProgressLoop:Gd,label:Qd};function Jd({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:a,className:i}){const c=s?0:Math.max(0,Math.min(100,e/t*100));return o.jsxs("div",{className:w.cn(Ue.wrapper,i),children:[(r||a)&&o.jsxs("div",{className:Ue.label,children:[a&&o.jsx("span",{children:a}),r&&!s&&o.jsxs("span",{children:[Math.round(c),"%"]})]}),o.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:w.cn(Ue.bar,s&&Ue.indeterminate),children:o.jsx("div",{className:w.cn(Ue.fill,n!=="primary"&&Ue[n]),style:{width:s?void 0:`${c}%`}})})]})}const Yd="tempest_wrapper_P-gFm",Xd="tempest_disabled_0-cna",Vd="tempest_input_7R8ZN",Zd="tempest_dot_P7ejP",ep="tempest_labelWrap_iQ1HR",tp="tempest_label_vAFIP",np="tempest_description_bEB8u",sp="tempest_group_oi329",rp="tempest_horizontal_1Ovgu",ke={wrapper:Yd,disabled:Xd,input:Vd,dot:Zd,labelWrap:ep,label:tp,description:np,group:sp,horizontal:rp},Wn=l.createContext(null),op=l.forwardRef(function({label:t,description:n,value:s,disabled:r,name:a,checked:i,onChange:c,wrapperClassName:u,className:d,...p},m){const f=l.useContext(Wn),h=f?.name??a,_=f?.disabled??r,v=f?f.value===s:i;function y(g){f&&f.onChange?.(s),c?.(g)}return o.jsxs("label",{className:w.cn(ke.wrapper,_&&ke.disabled,u),children:[o.jsx("input",{ref:m,type:"radio",name:h,value:s,checked:v,disabled:_,onChange:y,className:w.cn(ke.input,d),...p}),o.jsx("span",{className:ke.dot,"aria-hidden":!0}),(t||n)&&o.jsxs("span",{className:ke.labelWrap,children:[t&&o.jsx("span",{className:ke.label,children:t}),n&&o.jsx("span",{className:ke.description,children:n})]})]})});function ap({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:a=!1,className:i,children:c}){const u=l.useId(),d=s??u,[p,m]=l.useState(t),f=e!==void 0,h=f?e:p;function _(v){f||m(v),n?.(v)}return o.jsx(Wn.Provider,{value:{name:d,value:h,onChange:_,disabled:r},children:o.jsx("div",{role:"radiogroup",className:w.cn(ke.group,a&&ke.horizontal,i),children:c})})}const ip="tempest_wrapper_o1aOo",cp="tempest_label_jaBOA",lp="tempest_value_GKfOu",up="tempest_field_YxCzt",dp="tempest_track_j-2iy",pp="tempest_fill_1pbqj",mp="tempest_input_1MASw",fp="tempest_helper_uqxKu",ve={wrapper:ip,label:cp,value:lp,field:up,track:dp,fill:pp,input:mp,helper:fp};function hp({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:i,disabled:c=!1,formatValue:u,className:d}){const[p,m]=e,f=s-n,h=l.useMemo(()=>(p-n)/f*100,[p,n,f]),_=l.useMemo(()=>(m-n)/f*100,[m,n,f]),v=u?.(e)??`${p} – ${m}`,y=l.useCallback(x=>{const b=Math.min(Number(x.target.value),m);t([b,m])},[m,t]),g=l.useCallback(x=>{const b=Math.max(Number(x.target.value),p);t([p,b])},[p,t]);return o.jsxs("div",{className:w.cn(ve.wrapper,d),children:[a&&o.jsxs("div",{className:ve.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:ve.value,children:v})]}),o.jsxs("div",{className:ve.field,children:[o.jsx("div",{className:ve.track}),o.jsx("div",{className:ve.fill,style:{left:`${h}%`,right:`${100-_}%`}}),o.jsx("input",{type:"range",className:ve.input,min:n,max:s,step:r,value:p,onChange:y,disabled:c,"aria-label":a?`${a} (mínimo)`:"Mínimo"}),o.jsx("input",{type:"range",className:ve.input,min:n,max:s,step:r,value:m,onChange:g,disabled:c,"aria-label":a?`${a} (máximo)`:"Máximo"})]}),i&&o.jsx("span",{className:ve.helper,children:i})]})}const _p="tempest_wrapper_K9Mqa",gp="tempest_star_goIGS",bp="tempest_filled_mMs-d",yp="tempest_disabled_tyUlQ",vp="tempest_readonly_bnKLN",xp="tempest_sm_K7-y9",wp="tempest_md_ex2Tb",jp="tempest_lg_TstLJ",He={wrapper:_p,star:gp,filled:bp,disabled:yp,readonly:vp,sm:xp,md:wp,lg:jp};function $p({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:a=!1,label:i="Avaliação",className:c}){const[u,d]=l.useState(0),p=u>0?u:e,m=f=>{r||a||n?.(f)};return o.jsx("span",{role:"radiogroup","aria-label":i,className:w.cn(He.wrapper,He[s],a&&He.disabled,r&&He.readonly,c),onMouseLeave:()=>d(0),children:Array.from({length:t},(f,h)=>{const _=h+1,v=_<=p;return o.jsx("button",{type:"button",role:"radio","aria-checked":e===_,"aria-label":`${_} ${_===1?"estrela":"estrelas"}`,className:w.cn(He.star,v&&He.filled),disabled:a,onMouseEnter:()=>!r&&!a&&d(_),onClick:()=>m(_),children:o.jsx(kp,{filled:v})},_)})})}function kp({filled:e}){return o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function qn(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function Np({above:e,below:t,only:n,children:s}){const r=ze();return qn(r.current,e,t,n,r)?s:null}function Sp({above:e,below:t,only:n,children:s}){const r=ze();return qn(r.current,e,t,n,r)?null:s}const Cp="tempest_safe_iqDFY",Ep="tempest_inline_V9eMG",Tp="tempest_top_Xse9E",Mp="tempest_right_GZm9b",Rp="tempest_bottom_kkyD7",Lp="tempest_left_Z4Q72",Ge={safe:Cp,inline:Ep,top:Tp,right:Mp,bottom:Rp,left:Lp},Dp=["top","right","bottom","left"];function Pp({edges:e=Dp,inline:t=!1,className:n,children:s,...r}){return o.jsx("div",{className:w.cn(Ge.safe,t&&Ge.inline,e.includes("top")&&Ge.top,e.includes("right")&&Ge.right,e.includes("bottom")&&Ge.bottom,e.includes("left")&&Ge.left,n),"data-edges":e.join(" "),...r,children:s})}const Ap="tempest_wrapper_dKXJJ",Ip="tempest_input_m0lPc",Fp="tempest_iconLeft_030-U",Op="tempest_clear_nb6lG",pt={wrapper:Ap,input:Ip,iconLeft:Fp,clear:Op},Kn=l.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:a="Buscar...",className:i,...c},u){function d(){n(""),s?.()}return o.jsxs("div",{className:w.cn(pt.wrapper,r),children:[o.jsx("span",{className:pt.iconLeft,"aria-hidden":!0,children:o.jsx(Bp,{})}),o.jsx("input",{ref:u,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:a,className:w.cn(pt.input,i),...c}),t&&o.jsx("button",{type:"button",className:pt.clear,"aria-label":"Limpar busca",onClick:d,children:o.jsx(zp,{})})]})});function Bp(){return o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function zp(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Wp="tempest_group_mYyFC",qp="tempest_fullWidth_unSMm",Kp="tempest_segment_cu-EL",Up="tempest_sm_CfD41",Hp="tempest_md_2ixuM",Gp="tempest_lg_2Kt7-",Qp="tempest_active_GmyKg",Jp="tempest_icon_9h6GK",Yp="tempest_label_mS17q",Ie={group:Wp,fullWidth:qp,segment:Kp,sm:Up,md:Hp,lg:Gp,active:Qp,icon:Jp,label:Yp};function Xp({options:e,value:t,onChange:n,size:s="md",fullWidth:r=!1,className:a,"aria-label":i,...c}){return o.jsx("div",{role:"radiogroup","aria-label":i,className:w.cn(Ie.group,Ie[s],r&&Ie.fullWidth,a),...c,children:e.map(u=>{const d=u.value===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":d,disabled:u.disabled,className:w.cn(Ie.segment,d&&Ie.active),onClick:()=>n(u.value),children:[u.icon&&o.jsx("span",{className:Ie.icon,children:u.icon}),o.jsx("span",{className:Ie.label,children:u.label})]},u.value)})})}const Vp="tempest_sidebar_UB1qz",Zp="tempest_header_zupoS",em="tempest_nav_aLYuL",tm="tempest_item_IAjHb",nm="tempest_collapsed_ZbZYA",sm="tempest_active_BgcFy",rm="tempest_icon_UQswn",om="tempest_label_TPvJ9",am="tempest_badge_xwEZv",im="tempest_footer_TyRyi",pe={sidebar:Vp,header:Zp,nav:em,item:tm,collapsed:nm,active:sm,icon:rm,label:om,badge:am,footer:im};function cm({header:e,items:t,value:n,onChange:s,footer:r,collapsed:a=!1,width:i=240,collapsedWidth:c=64,className:u,style:d,...p}){const m=typeof(a?c:i)=="number"?`${a?c:i}px`:a?c:i;return o.jsxs("aside",{className:w.cn(pe.sidebar,a&&pe.collapsed,u),style:{width:m,...d},...p,children:[e&&o.jsx("div",{className:pe.header,children:e}),o.jsx("nav",{className:pe.nav,"aria-label":"Navegação lateral",children:t.map(f=>{const h=f.key===n;return o.jsxs("button",{type:"button",className:w.cn(pe.item,h&&pe.active),"aria-current":h?"page":void 0,disabled:f.disabled,onClick:()=>s?.(f.key),title:a&&typeof f.label=="string"?f.label:void 0,children:[f.icon&&o.jsx("span",{className:pe.icon,children:f.icon}),!a&&o.jsx("span",{className:pe.label,children:f.label}),!a&&f.badge!==void 0&&o.jsx("span",{className:pe.badge,children:f.badge})]},f.key)})}),r&&o.jsx("div",{className:pe.footer,children:r})]})}const lm="tempest_skeleton_CB4uF",um="tempest_text_-A8IF",dm="tempest_circle_DYcl8",Et={skeleton:lm,text:um,circle:dm};function pm({variant:e="rect",width:t,height:n,className:s,style:r}){return o.jsx("span",{"aria-hidden":!0,className:w.cn(Et.skeleton,e==="text"&&Et.text,e==="circle"&&Et.circle,s),style:{width:t,height:n,...r}})}const mm="tempest_spacer_okdOd",fm="tempest_both_85qSF",hm="tempest_x_QiU2B",_m="tempest_y_hTtCp",cn={spacer:mm,both:fm,x:hm,y:_m};function gm({axis:e="both",className:t,...n}){return o.jsx("div",{className:w.cn(cn.spacer,cn[e],t),...n})}const bm="tempest_spinner_GpFZS",ym="tempest_tempest-spinner_wKVCY",vm="tempest_xs_p8BFI",xm="tempest_sm_3sIoD",wm="tempest_md_M2sPj",jm="tempest_lg_IxTw2",$m="tempest_xl_cgwqq",km="tempest_wrap_Xkv-I",Nm="tempest_overlay_sVSe9",Sm="tempest_caption_B0ED9",Fe={spinner:bm,tempestSpinner:ym,xs:vm,sm:xm,md:wm,lg:jm,xl:$m,wrap:km,overlay:Nm,caption:Sm};function Un({size:e="md",className:t,label:n="Carregando",caption:s,overlay:r=!1}){const a=o.jsx("span",{"aria-hidden":!0,className:w.cn(Fe.spinner,Fe[e])});return!r&&s===void 0?o.jsx("span",{role:"status","aria-label":n,className:w.cn(Fe.spinner,Fe[e],t)}):o.jsxs("div",{role:"status","aria-label":n,"aria-live":"polite",className:w.cn(Fe.wrap,r&&Fe.overlay,t),children:[a,s!==void 0&&o.jsx("span",{className:Fe.caption,children:s})]})}const Cm="tempest_stat_zoo9y",Em="tempest_header_3UQqq",Tm="tempest_icon_zUG3e",Mm="tempest_label_lIH47",Rm="tempest_row_Ifyts",Lm="tempest_value_JBWnr",Dm="tempest_delta_mRVrE",Pm="tempest_up_7qgUO",Am="tempest_down_3Rq2Z",Im="tempest_flat_R5pZT",Fm="tempest_hint_YkTF8",oe={stat:Cm,header:Em,icon:Tm,label:Mm,row:Rm,value:Lm,delta:Dm,up:Pm,down:Am,flat:Im,hint:Fm};function Om(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function Bm({label:e,value:t,delta:n,trend:s,hint:r,icon:a,className:i,...c}){const u=s??Om(n);return o.jsxs("div",{className:w.cn(oe.stat,i),...c,children:[o.jsxs("div",{className:oe.header,children:[a&&o.jsx("span",{className:oe.icon,children:a}),o.jsx("span",{className:oe.label,children:e})]}),o.jsxs("div",{className:oe.row,children:[o.jsx("span",{className:oe.value,children:t}),n!==void 0&&o.jsx("span",{className:w.cn(oe.delta,u==="up"&&oe.up,u==="down"&&oe.down,u==="flat"&&oe.flat),children:n})]}),r&&o.jsx("p",{className:oe.hint,children:r})]})}const zm="tempest_stepper_w3qjQ",Wm="tempest_vertical_d4mOs",qm="tempest_step_s2nqL",Km="tempest_dot_d1bSL",Um="tempest_completed_gcFHM",Hm="tempest_active_kL-CH",Gm="tempest_label_8irAI",Qm="tempest_connector_lyeWp",xe={stepper:zm,vertical:Wm,step:qm,dot:Km,completed:Um,active:Hm,label:Gm,connector:Qm};function Jm({steps:e,current:t,orientation:n="horizontal",className:s}){return o.jsx("ol",{className:w.cn(xe.stepper,n==="vertical"&&xe.vertical,s),children:e.map((r,a)=>{const i=a<t,c=a===t;return o.jsxs(l.Fragment,{children:[o.jsxs("li",{className:w.cn(xe.step,i&&xe.completed,c&&xe.active),"aria-current":c?"step":void 0,children:[o.jsx("span",{className:xe.dot,children:i?"✓":a+1}),o.jsx("span",{className:xe.label,children:r.label})]}),a<e.length-1&&o.jsx("span",{className:w.cn(xe.connector,i&&xe.completed),"aria-hidden":!0})]},a)})})}function Bt(e,t,n){if(Number.isNaN(e))return e;if(t>n){const s=t;t=n,n=s}return e<t?t:e>n?n:e}function Ym(e,t=1){if(e===0)return"0 B";const n=["B","KB","MB","GB","TB"],s=1024,r=Math.min(Math.floor(Math.log(Math.abs(e))/Math.log(s)),n.length-1),a=e/s**r,i=r===0?0:Math.max(0,t);return`${parseFloat(a.toFixed(i)).toString()} ${n[r]}`}function Xm(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",maximumFractionDigits:1}).format(e)}const Vm="tempest_wrapper_JNjXK",Zm="tempest_label_9XKNm",ef="tempest_row_cOARX",tf="tempest_sm_RzVSU",nf="tempest_md_pezRm",sf="tempest_lg_kYbIN",rf="tempest_disabled_vqmo2",of="tempest_btn_xuHhj",af="tempest_value_NEatO",Ce={wrapper:Vm,label:Zm,row:ef,sm:tf,md:nf,lg:sf,disabled:rf,btn:of,value:af},cf=l.forwardRef(function({value:t,onChange:n,min:s=0,max:r=Number.POSITIVE_INFINITY,step:a=1,size:i="md",disabled:c=!1,label:u,format:d,labels:p={decrement:"Diminuir",increment:"Aumentar"},className:m},f){const h=()=>{c||n(Bt(t-a,s,r))},_=()=>{c||n(Bt(t+a,s,r))},v=d?d(t):String(t),y=!c&&t>s,g=!c&&t<r;return o.jsxs("div",{ref:f,className:w.cn(Ce.wrapper,m),children:[u&&o.jsx("label",{className:Ce.label,children:u}),o.jsxs("div",{className:w.cn(Ce.row,Ce[i],c&&Ce.disabled),children:[o.jsx("button",{type:"button",className:Ce.btn,"aria-label":p.decrement,onClick:h,disabled:!y,children:"−"}),o.jsx("span",{className:Ce.value,role:"status","aria-live":"polite",children:v}),o.jsx("button",{type:"button",className:Ce.btn,"aria-label":p.increment,onClick:_,disabled:!g,children:"+"})]})]})}),lf="tempest_wrapper_kudO9",uf="tempest_disabled_2aZ0V",df="tempest_input_5BPNu",pf="tempest_track_7ObdZ",mf="tempest_thumb_-FTeK",ff="tempest_label_LrH7V",Qe={wrapper:lf,disabled:uf,input:df,track:pf,thumb:mf,label:ff},hf=l.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...a},i){return o.jsxs("label",{className:w.cn(Qe.wrapper,n&&Qe.disabled,s),children:[o.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:w.cn(Qe.input,r),...a}),o.jsx("span",{className:Qe.track,"aria-hidden":!0,children:o.jsx("span",{className:Qe.thumb})}),t&&o.jsx("span",{className:Qe.label,children:t})]})}),_f="tempest_tag_16VPH",gf="tempest_sm_pzyd5",bf="tempest_md_GL6tQ",yf="tempest_lg_8tgXU",vf="tempest_neutral_jAd-x",xf="tempest_primary_AXKlN",wf="tempest_success_56lz4",jf="tempest_warning_UK7SC",$f="tempest_danger_kJ-yx",kf="tempest_info_hmHE-",Nf="tempest_label_ZBPfO",Sf="tempest_remove_UEwgr",rt={tag:_f,sm:gf,md:bf,lg:yf,neutral:vf,primary:xf,success:wf,warning:jf,danger:$f,info:kf,label:Nf,remove:Sf};function Cf({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:a,...i}){return o.jsxs("span",{className:w.cn(rt.tag,rt[e],rt[t],r),...i,children:[o.jsx("span",{className:rt.label,children:a}),n&&o.jsx("button",{type:"button",className:rt.remove,"aria-label":s,onClick:n,children:"×"})]})}const Ef="tempest_scroll_unrJp",Tf="tempest_table_Dkosn",Mf="tempest_th_PNuEx",Rf="tempest_td_jv9tA",Lf="tempest_tr_7UG8J",Df="tempest_clickable_B6Si-",Pf="tempest_alignRight_9hY0G",Af="tempest_alignCenter_YiUQy",If="tempest_emptyRow_kdMiv",Ff="tempest_priorityTablet_3alUt",Of="tempest_priorityDesktop_3f8Fq",Bf="tempest_stackable_heix7",zf="tempest_stackableHead_mKGcA",Wf="tempest_stackableRow_qPNqc",z={scroll:Ef,table:Tf,th:Mf,td:Rf,tr:Lf,clickable:Df,alignRight:Pf,alignCenter:Af,emptyRow:If,priorityTablet:Ff,priorityDesktop:Of,stackable:Bf,stackableHead:zf,stackableRow:Wf};function ln(e){if(e==="tablet")return z.priorityTablet;if(e==="desktop")return z.priorityDesktop}function Hn({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:a,stackOnMobile:i=!1}){return o.jsx("div",{className:w.cn(z.scroll,i&&z.stackable,a),children:o.jsxs("table",{className:z.table,children:[o.jsx("thead",{className:w.cn(i&&z.stackableHead),children:o.jsx("tr",{children:e.map(c=>o.jsx("th",{className:w.cn(z.th,c.align==="right"&&z.alignRight,c.align==="center"&&z.alignCenter,ln(c.priority)),style:{width:c.width},children:c.header},c.key))})}),o.jsx("tbody",{children:t.length===0?o.jsx("tr",{children:o.jsx("td",{className:z.emptyRow,colSpan:e.length,children:r})}):t.map((c,u)=>o.jsx("tr",{className:w.cn(z.tr,s&&z.clickable,i&&z.stackableRow),onClick:s?()=>s(c):void 0,children:e.map(d=>{const p=d.render?d.render(c,u):c[d.key];return o.jsx("td",{className:w.cn(z.td,d.align==="right"&&z.alignRight,d.align==="center"&&z.alignCenter,ln(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(c,u)))})]})})}const qf="tempest_tablist_WR6ag",Kf="tempest_tab_IdDYc",Uf="tempest_active_PTNtG",Hf="tempest_panel_08i9c",Gf="tempest_pill_lGuqn",ot={tablist:qf,tab:Kf,active:Uf,panel:Hf,pill:Gf};function Qf({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:a}){const i=e.find(h=>!h.disabled),[c,u]=l.useState(t??i?.id),d=n!==void 0,p=d?n:c,m=e.find(h=>h.id===p)??i;function f(h){d||u(h),s?.(h)}return o.jsxs("div",{className:a,children:[o.jsx("div",{role:"tablist",className:w.cn(ot.tablist,r==="pill"&&ot.pill),children:e.map(h=>{const _=h.id===m?.id;return o.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:w.cn(ot.tab,_&&ot.active),onClick:()=>f(h.id),children:h.label},h.id)})}),m&&o.jsx("div",{role:"tabpanel",id:`panel-${m.id}`,"aria-labelledby":`tab-${m.id}`,className:ot.panel,children:m.content})]})}const Jf="tempest_wrapper_C0gfg",Yf="tempest_label_cWLXP",Xf="tempest_required_rDZXE",Vf="tempest_textarea_Z-y6g",Zf="tempest_error_NWC9f",eh="tempest_helper_gedut",th="tempest_errorText_ey07q",Oe={wrapper:Jf,label:Yf,required:Xf,textarea:Vf,error:Zf,helper:eh,errorText:th},nh=l.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:a,id:i,required:c,...u},d){const p=l.useId(),m=i??p;return o.jsxs("div",{className:w.cn(Oe.wrapper,s&&Oe.error,r),children:[t&&o.jsxs("label",{htmlFor:m,className:Oe.label,children:[t,c&&o.jsx("span",{className:Oe.required,children:"*"})]}),o.jsx("textarea",{ref:d,id:m,"aria-invalid":!!s,required:c,className:w.cn(Oe.textarea,a),...u}),s?o.jsx("span",{className:Oe.errorText,children:s}):n?o.jsx("span",{className:Oe.helper,children:n}):null]})}),sh="tempest_timeline_utrkA",rh="tempest_item_T5xdQ",oh="tempest_markerColumn_BMe4d",ah="tempest_marker_kmPV-",ih="tempest_marker-primary_s9BNB",ch="tempest_marker-success_areMM",lh="tempest_marker-warning_rRrS8",uh="tempest_marker-danger_3GEBk",dh="tempest_marker-neutral_M2mnw",ph="tempest_line_CwY-N",mh="tempest_body_KpMJ6",fh="tempest_row_AX2ti",hh="tempest_title_DxfAX",_h="tempest_meta_GU0ih",gh="tempest_description_f9sxV",Y={timeline:sh,item:rh,markerColumn:oh,marker:ah,markerPrimary:ih,markerSuccess:ch,markerWarning:lh,markerDanger:uh,markerNeutral:dh,line:ph,body:mh,row:fh,title:hh,meta:_h,description:gh};function bh({items:e,connector:t=!0,className:n,...s}){return o.jsx("ol",{className:w.cn(Y.timeline,t&&Y.connector,n),...s,children:e.map((r,a)=>{const i=a===e.length-1;return o.jsxs("li",{className:Y.item,children:[o.jsxs("div",{className:Y.markerColumn,children:[o.jsx("span",{className:w.cn(Y.marker,Y[`marker-${r.marker??"primary"}`]),"aria-hidden":"true",children:r.icon}),t&&!i&&o.jsx("span",{className:Y.line,"aria-hidden":"true"})]}),o.jsxs("div",{className:Y.body,children:[o.jsxs("div",{className:Y.row,children:[o.jsx("span",{className:Y.title,children:r.title}),r.meta&&o.jsx("span",{className:Y.meta,children:r.meta})]}),r.description&&o.jsx("p",{className:Y.description,children:r.description})]})]},r.id)})})}const yh="tempest_trigger_Dmc5E",vh="tempest_bubble_TPGHB",xh="tempest_tempest-tooltip-in_csYeZ",wh="tempest_top_m2tnn",jh="tempest_bottom_9Twz4",$h="tempest_left_UPdrG",kh="tempest_right_CV--T",Tt={trigger:yh,bubble:vh,tempestTooltipIn:xh,top:wh,bottom:jh,left:$h,right:kh};function Nh({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[a,i]=l.useState(!1),c=l.useId();let u=null;function d(){s||(u&&clearTimeout(u),u=setTimeout(()=>i(!0),r))}function p(){u&&(clearTimeout(u),u=null),i(!1)}const m=l.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":a?c:void 0});return o.jsxs("span",{className:Tt.trigger,children:[m,a&&o.jsx("span",{id:c,role:"tooltip",className:w.cn(Tt.bubble,Tt[t]),children:e})]})}const Sh="tempest_container_x4-Qm",Ch="tempest_positionTopRight_gbUCQ",Eh="tempest_positionTopLeft_Z-tMJ",Th="tempest_positionTopCenter_A4Ze4",Mh="tempest_positionBottomRight_MGo19",Rh="tempest_positionBottomLeft_DpiNe",Lh="tempest_positionBottomCenter_XUdok",Dh="tempest_toast_FLdHz",Ph="tempest_tempest-toast-in_E2d-A",Ah="tempest_success_Oy694",Ih="tempest_warning_84GC8",Fh="tempest_error_hrQAA",Oh="tempest_info_eq5bQ",Bh="tempest_title_-H6R2",zh="tempest_description_-QwfC",Wh="tempest_close_i10-s",ee={container:Sh,positionTopRight:Ch,positionTopLeft:Eh,positionTopCenter:Th,positionBottomRight:Mh,positionBottomLeft:Rh,positionBottomCenter:Lh,toast:Dh,tempestToastIn:Ph,success:Ah,warning:Ih,error:Fh,info:Oh,title:Bh,description:zh,close:Wh},Gn=l.createContext(null);function qh(){const e=l.useContext(Gn);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function Kh({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=l.useState([]),a=l.useRef(0),i=l.useCallback(d=>{r(p=>p.filter(m=>m.id!==d))},[]),c=l.useCallback(d=>{const p=d.id??`toast-${++a.current}`,m={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(f=>[...f,m]),p},[t]),u=l.useMemo(()=>({show:c,dismiss:i,success:(d,p)=>c({...p,description:d,variant:"success"}),error:(d,p)=>c({...p,description:d,variant:"error"}),warning:(d,p)=>c({...p,description:d,variant:"warning"}),info:(d,p)=>c({...p,description:d,variant:"info"})}),[c,i]);return o.jsxs(Gn.Provider,{value:u,children:[e,o.jsx(Hh,{toasts:s,onDismiss:i,position:n})]})}function Uh(e){switch(e){case"top-left":return ee.positionTopLeft;case"top-center":return ee.positionTopCenter;case"bottom-right":return ee.positionBottomRight;case"bottom-left":return ee.positionBottomLeft;case"bottom-center":return ee.positionBottomCenter;default:return ee.positionTopRight}}function Hh({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:Ve.createPortal(o.jsx("div",{className:w.cn(ee.container,Uh(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>o.jsx(Gh,{toast:s,onDismiss:t},s.id))}),document.body)}function Gh({toast:e,onDismiss:t}){return l.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),o.jsxs("div",{className:w.cn(ee.toast,ee[e.variant]),role:"status",children:[o.jsxs("div",{children:[e.title&&o.jsx("p",{className:ee.title,children:e.title}),e.description&&o.jsx("p",{className:ee.description,children:e.description})]}),o.jsx("button",{type:"button",className:ee.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:o.jsx(Qh,{})})]})}function Qh(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Jh="tempest_scroll_8Giwl",Yh="tempest_spacer_P3Pvl",Xh="tempest_row_Ff0VU",Mt={scroll:Jh,spacer:Yh,row:Xh};function Vh({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:a,className:i,style:c}){const u=l.useRef(null),[d,p]=l.useState(0),[m,f]=l.useState(0);l.useEffect(()=>{const g=u.current;if(!g||(f(g.clientHeight),typeof ResizeObserver>"u"))return;const x=new ResizeObserver(()=>f(g.clientHeight));return x.observe(g),()=>x.disconnect()},[]);const h=e.length*t,_=Math.max(0,Math.floor(d/t)-r),v=Math.ceil(m/t)+r*2,y=Math.min(e.length,_+v);return o.jsx("div",{ref:u,className:w.cn(Mt.scroll,i),style:{height:s,...c},onScroll:g=>p(g.target.scrollTop),role:"list",children:o.jsx("div",{className:Mt.spacer,style:{height:h},children:e.slice(_,y).map((g,x)=>{const b=_+x,j=a?a(g,b):b;return o.jsx("div",{role:"listitem",className:Mt.row,style:{top:b*t,height:t},children:n(g,b)},j)})})})}const Zh="tempest_button_58f9i",e_="tempest_copied_WkLgR",un={button:Zh,copied:e_};function t_({value:e,timeout:t=2e3,children:n,onCopied:s,className:r,onClick:a,...i}){const[c,u]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current)},[]);const p=l.useCallback(async m=>{a?.(m);try{await navigator.clipboard.writeText(e),u(!0),s?.(),d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>u(!1),t)}catch{}},[e,t,s,a]);return o.jsx("button",{type:"button",className:w.cn(un.button,c&&un.copied,r),"data-copied":c||void 0,onClick:p,...i,children:n??(c?"Copied":"Copy")})}const n_={justNow:"agora há pouco",secondsAgo:e=>`${e} s atrás`,minutesAgo:e=>`${e} min atrás`,hoursAgo:e=>e===1?"1 hora atrás":`${e} horas atrás`,daysAgo:e=>e===1?"ontem":`${e} dias atrás`,weeksAgo:e=>e===1?"semana passada":`${e} semanas atrás`,monthsAgo:e=>e===1?"mês passado":`${e} meses atrás`,yearsAgo:e=>e===1?"ano passado":`${e} anos atrás`,inSeconds:e=>`em ${e} s`,inMinutes:e=>`em ${e} min`,inHours:e=>`em ${e} h`,inDays:e=>`em ${e} ${e===1?"dia":"dias"}`,inWeeks:e=>`em ${e} ${e===1?"semana":"semanas"}`,inMonths:e=>`em ${e} ${e===1?"mês":"meses"}`,inYears:e=>`em ${e} ${e===1?"ano":"anos"}`},s_={justNow:"just now",secondsAgo:e=>`${e}s ago`,minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>e===1?"yesterday":`${e} days ago`,weeksAgo:e=>`${e}w ago`,monthsAgo:e=>`${e}mo ago`,yearsAgo:e=>`${e}y ago`,inSeconds:e=>`in ${e}s`,inMinutes:e=>`in ${e}m`,inHours:e=>`in ${e}h`,inDays:e=>`in ${e}d`,inWeeks:e=>`in ${e}w`,inMonths:e=>`in ${e}mo`,inYears:e=>`in ${e}y`},r_={"pt-BR":n_,en:s_},zt=1e3,Wt=60*zt,qt=60*Wt,ut=24*qt,dn=7*ut,pn=30*ut,mn=365*ut;function Qn(e,t={}){const{locale:n="pt-BR",now:s=Date.now()}=t,r=r_[n],a=e instanceof Date?e.getTime():new Date(e).getTime(),c=(typeof s=="number"?s:s.getTime())-a,u=c>=0,d=Math.abs(c);if(d<30*zt)return r.justNow;if(d<Wt){const m=Math.round(d/zt);return u?r.secondsAgo(m):r.inSeconds(m)}if(d<qt){const m=Math.round(d/Wt);return u?r.minutesAgo(m):r.inMinutes(m)}if(d<ut){const m=Math.round(d/qt);return u?r.hoursAgo(m):r.inHours(m)}if(d<dn){const m=Math.round(d/ut);return u?r.daysAgo(m):r.inDays(m)}if(d<pn){const m=Math.round(d/dn);return u?r.weeksAgo(m):r.inWeeks(m)}if(d<mn){const m=Math.round(d/pn);return u?r.monthsAgo(m):r.inMonths(m)}const p=Math.round(d/mn);return u?r.yearsAgo(p):r.inYears(p)}function o_({date:e,locale:t="pt",...n}){const s=e instanceof Date?e:new Date(e),r=Number.isNaN(s.getTime())?void 0:s.toISOString(),a=Qn(e,{locale:t==="pt"?"pt-BR":"en"});return o.jsx("time",{dateTime:r,...n,children:a})}function a_({cents:e,currency:t="BRL",locale:n="pt-BR",...s}){const r=new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/100);return o.jsx("span",{...s,children:r})}const i_="tempest_clamp_r43C-",c_={clamp:i_};function l_({lines:e=1,className:t,style:n,children:s,...r}){const a={...n,"--tempest-clamp-lines":e};return o.jsx("div",{className:w.cn(c_.clamp,t),style:a,...r,children:s})}const u_="tempest_hidden_k7p-e",d_={hidden:u_};function p_({as:e="span",className:t,children:n,...s}){return l.createElement(e,{className:w.cn(d_.hidden,t),...s},n)}function Jn({children:e,container:t}){const[n,s]=l.useState(!1);return l.useEffect(()=>(s(!0),()=>s(!1)),[]),!n||typeof document>"u"?null:Ve.createPortal(e,t??document.body)}function m_({onOutside:e,children:t,...n}){const s=l.useRef(null),r=l.useRef(e);return r.current=e,l.useEffect(()=>{if(typeof document>"u")return;function a(i){const c=s.current,u=i.target;c&&u&&!c.contains(u)&&r.current(i)}return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[]),o.jsx("div",{ref:s,...n,children:t})}function f_({condition:e,wrapper:t,children:n}){return e?t(n):o.jsx(o.Fragment,{children:n})}function h_({each:e,children:t,fallback:n=null}){return e.length===0?o.jsx(o.Fragment,{children:n}):o.jsx(o.Fragment,{children:e.map((s,r)=>o.jsx(l.Fragment,{children:t(s,r)},r))})}const __="tempest_errorText_LU3jn",g_={errorText:__};function b_({children:e,className:t,...n}){return e==null||e===!1||e===""?null:o.jsx("p",{role:"alert",className:w.cn(g_.errorText,t),...n,children:e})}const y_="tempest_image_Zq9Zs",v_={image:y_};function x_({src:e,fallback:t,alt:n,lazy:s=!0,className:r,onError:a,...i}){const[c,u]=l.useState(e),[d,p]=l.useState(!1);return o.jsx("img",{src:c,alt:n,loading:s?"lazy":"eager",className:w.cn(v_.image,r),onError:m=>{t&&!d&&c!==t&&(p(!0),u(t)),a?.(m)},...i})}const w_="tempest_list_bAP4Q",j_="tempest_item_oRy5T",fn={list:w_,item:j_};function $_({items:e,renderItem:t,keyExtractor:n,empty:s,className:r,...a}){return e.length===0?o.jsx(o.Fragment,{children:s??null}):o.jsx("ul",{className:w.cn(fn.list,r),...a,children:e.map((i,c)=>o.jsx("li",{className:fn.item,children:t(i,c)},n?n(i,c):c))})}const k_="tempest_list_fwIXq",N_="tempest_term_QkQNZ",S_="tempest_description_e1bNN",Rt={list:k_,term:N_,description:S_};function C_({items:e,className:t,...n}){return o.jsx("dl",{className:w.cn(Rt.list,t),...n,children:e.map((s,r)=>o.jsxs(l.Fragment,{children:[o.jsx("dt",{className:Rt.term,children:s.term}),o.jsx("dd",{className:Rt.description,children:s.description})]},r))})}const E_="tempest_toggle_kmzmH",T_="tempest_outline_aFbzy",M_="tempest_pressed_hX319",R_="tempest_sm_JTqaB",L_="tempest_md_QfS4K",D_="tempest_lg_ajzsM",mt={toggle:E_,outline:T_,pressed:M_,sm:R_,md:L_,lg:D_},P_=l.forwardRef(function({pressed:t,defaultPressed:n=!1,onPressedChange:s,size:r="md",variant:a="default",className:i,disabled:c,onClick:u,children:d,...p},m){const f=t!==void 0,[h,_]=l.useState(n),v=f?t:h,y=l.useCallback(g=>{if(u?.(g),g.defaultPrevented)return;const x=!v;f||_(x),s?.(x)},[v,f,u,s]);return o.jsx("button",{ref:m,type:"button","aria-pressed":v,disabled:c,"data-state":v?"on":"off",className:w.cn(mt.toggle,mt[r],mt[a],v&&mt.pressed,i),onClick:y,...p,children:d})}),A_="tempest_group_XZCDJ",I_="tempest_item_B-27E",F_="tempest_selected_OHPVQ",Kt={group:A_,item:I_,selected:F_},Yn=l.createContext(null);function O_(){const e=l.useContext(Yn);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e}function hn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function B_({type:e="single",value:t,defaultValue:n,onValueChange:s,className:r,children:a,...i}){const c=t!==void 0,[u,d]=l.useState(()=>hn(n)),p=c?hn(t):u,m=l.useCallback(_=>{c||d(_),s?.(e==="single"?_[0]??"":_)},[c,s,e]),f=l.useCallback(_=>{const v=p.includes(_);m(e==="single"?v?[]:[_]:v?p.filter(y=>y!==_):[...p,_])},[p,e,m]),h=l.useMemo(()=>({type:e,isSelected:_=>p.includes(_),toggle:f}),[e,p,f]);return o.jsx(Yn.Provider,{value:h,children:o.jsx("div",{role:"group",className:w.cn(Kt.group,r),...i,children:a})})}function z_({value:e,disabled:t,className:n,children:s,...r}){const{isSelected:a,toggle:i}=O_(),c=a(e);return o.jsx("button",{type:"button",role:"button","aria-pressed":c,disabled:t,"data-state":c?"on":"off",className:w.cn(Kt.item,c&&Kt.selected,n),onClick:()=>i(e),...r,children:s})}const W_="tempest_label_RaRvM",q_="tempest_asterisk_1CgE8",_n={label:W_,asterisk:q_},K_=l.forwardRef(function({required:t=!1,className:n,children:s,...r},a){return o.jsxs("label",{ref:a,className:w.cn(_n.label,n),...r,children:[s,t&&o.jsx("span",{className:_n.asterisk,"aria-hidden":!0,children:"*"})]})}),U_="tempest_collapsible_8jmKP",H_="tempest_trigger_ers75",G_="tempest_content_XmUZL",ft={collapsible:U_,trigger:H_,content:G_};function Q_({open:e,defaultOpen:t=!1,onOpenChange:n,trigger:s,className:r,children:a,...i}){const c=l.useId(),u=`${c}-content`,d=`${c}-trigger`,p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=l.useCallback(()=>{const v=!h;p||f(v),n?.(v)},[h,p,n]);return o.jsxs("div",{className:w.cn(ft.collapsible,h&&ft.open,r),...i,children:[o.jsx("button",{type:"button",id:d,className:ft.trigger,"aria-expanded":h,"aria-controls":u,onClick:_,children:s}),o.jsx("div",{id:u,role:"region","aria-labelledby":d,hidden:!h,className:ft.content,children:a})]})}const J_="tempest_root_OxRHj",Y_="tempest_menu_MDn4t",X_="tempest_item_PoiMY",V_="tempest_active_ATcDu",Z_="tempest_danger_COgly",eg="tempest_separator_omuCz",Je={root:J_,menu:Y_,item:X_,active:V_,danger:Z_,separator:eg};function gn(e){return"separator"in e&&e.separator===!0}function tg({items:e,children:t,className:n}){const[s,r]=l.useState(!1),[a,i]=l.useState({x:0,y:0}),[c,u]=l.useState(-1),d=l.useId(),p=l.useRef(null),m=l.useRef([]),f=e.map((y,g)=>!gn(y)&&!y.disabled?g:-1).filter(y=>y!==-1),h=l.useCallback(()=>{r(!1),u(-1)},[]),_=y=>{y.preventDefault(),i({x:y.clientX,y:y.clientY}),u(-1),r(!0)};l.useEffect(()=>{if(!s)return;const y=x=>{if(x.key==="Escape"){h();return}if(x.key==="ArrowDown"){x.preventDefault();const b=f.indexOf(c),j=f[(b+1)%f.length]??-1;u(j),m.current[j]?.focus()}if(x.key==="ArrowUp"){x.preventDefault();const b=f.indexOf(c),j=f[(b-1+f.length)%f.length]??-1;u(j),m.current[j]?.focus()}},g=x=>{p.current&&!p.current.contains(x.target)&&h()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[s,c,f,h]);const v=y=>{y.onSelect?.(),h()};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Je.root,onContextMenu:_,children:t}),s&&o.jsx(Jn,{children:o.jsx("ul",{ref:p,id:d,role:"menu",className:w.cn(Je.menu,n),style:{top:a.y,left:a.x},children:e.map((y,g)=>gn(y)?o.jsx("li",{role:"separator",className:Je.separator,"aria-hidden":!0},`separator-${g}`):o.jsx("li",{role:"none",children:o.jsx("button",{ref:x=>{m.current[g]=x},type:"button",role:"menuitem",className:w.cn(Je.item,y.danger&&Je.danger,c===g&&Je.active),disabled:y.disabled,onClick:()=>v(y),onMouseEnter:()=>u(g),children:y.label})},`item-${g}`))})})]})}const ng="tempest_root_2KoZA",sg="tempest_trigger_OXsnr",rg="tempest_card_CoGx4",og="tempest_tempest-hover-card-in_jD85J",ag="tempest_top_AVcQ0",ig="tempest_bottom_2rLAA",cg="tempest_left_tqGPt",lg="tempest_right_9Fe6S",ht={root:ng,trigger:sg,card:rg,tempestHoverCardIn:og,top:ag,bottom:ig,left:cg,right:lg};function ug({trigger:e,children:t,openDelay:n=300,closeDelay:s=150,placement:r="bottom",className:a,...i}){const[c,u]=l.useState(!1),d=l.useId(),p=l.useRef(null),m=l.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]),f=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!0),n)},[m,n]),h=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!1),s)},[m,s]);return l.useEffect(()=>m,[m]),o.jsxs("span",{className:ht.root,onMouseEnter:f,onMouseLeave:h,onFocus:f,onBlur:h,children:[o.jsx("span",{"aria-describedby":c?d:void 0,className:ht.trigger,children:e}),c&&o.jsx("div",{id:d,role:"dialog",className:w.cn(ht.card,ht[r],a),...i,children:t})]})}const dg=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Xn(e,t){l.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(dg)??[]).filter(c=>{if(c.hasAttribute("aria-hidden"))return!1;const u=typeof window<"u"?window.getComputedStyle(c):null;return!(u&&(u.display==="none"||u.visibility==="hidden"))})}function a(c){if(c.key!=="Tab")return;const u=r();if(u.length===0){c.preventDefault();return}const d=u[0],p=u[u.length-1],m=document.activeElement;c.shiftKey?(m===d||!m||!n?.contains(m))&&(c.preventDefault(),p.focus()):m===p&&(c.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),s?.focus?.()}},[e,t])}const pg="tempest_overlay_drnPW",mg="tempest_dialog_lPl6k",fg="tempest_inputRow_KxWoQ",hg="tempest_searchIcon_8PULr",_g="tempest_input_D3HQr",gg="tempest_list_5UzZU",bg="tempest_group_vLaWy",yg="tempest_groupHeading_d01fo",vg="tempest_groupList_QFMjK",xg="tempest_option_doqib",wg="tempest_active_LdCIJ",jg="tempest_icon_CyCCx",$g="tempest_label_QePT-",kg="tempest_empty_al68D",q={overlay:pg,dialog:mg,inputRow:fg,searchIcon:hg,input:_g,list:gg,group:bg,groupHeading:yg,groupList:vg,option:xg,active:wg,icon:jg,label:$g,empty:kg};function Ng(e,t){return t===""||e.label.toLowerCase().includes(t)?!0:(e.keywords??[]).some(n=>n.toLowerCase().includes(t))}function bn(e){const t=[],n=new Map;for(const s of e){const r=n.get(s.group);r===void 0?(n.set(s.group,t.length),t.push({name:s.group,items:[s]})):t[r].items.push(s)}return t}function Sg({open:e,onOpenChange:t,items:n,placeholder:s="Type a command…",emptyMessage:r="No results",className:a}){const i=l.useRef(null),[c,u]=l.useState(""),[d,p]=l.useState(0),m="tempest-command-list";Xn(i,e);const f=l.useMemo(()=>{const g=c.trim().toLowerCase(),x=n.filter(b=>Ng(b,g));return bn(x).flatMap(b=>b.items)},[n,c]),h=l.useMemo(()=>bn(f),[f]);if(l.useEffect(()=>{e&&(u(""),p(0))},[e]),l.useEffect(()=>{p(g=>f.length===0?0:Math.min(g,f.length-1))},[f.length]),!e||typeof document>"u")return null;function _(g){g.onSelect(),t(!1)}function v(g){if(g.key==="Escape"){g.preventDefault(),t(!1);return}if(g.key==="ArrowDown"){if(g.preventDefault(),f.length===0)return;p(x=>(x+1)%f.length);return}if(g.key==="ArrowUp"){if(g.preventDefault(),f.length===0)return;p(x=>(x-1+f.length)%f.length);return}if(g.key==="Enter"){g.preventDefault();const x=f[d];x&&_(x)}}let y=-1;return Ve.createPortal(o.jsx("div",{className:q.overlay,role:"presentation",onClick:()=>t(!1),children:o.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":"Command palette",className:w.cn(q.dialog,a),onClick:g=>g.stopPropagation(),children:[o.jsxs("div",{className:q.inputRow,children:[o.jsx(Cg,{}),o.jsx("input",{type:"text",role:"combobox","aria-expanded":"true","aria-controls":m,"aria-autocomplete":"list",autoFocus:!0,className:q.input,placeholder:s,value:c,onChange:g=>u(g.target.value),onKeyDown:v})]}),o.jsx("ul",{id:m,role:"listbox",className:q.list,children:f.length===0?o.jsx("li",{className:q.empty,children:r}):h.map(g=>o.jsxs("li",{className:q.group,children:[g.name&&o.jsx("div",{className:q.groupHeading,children:g.name}),o.jsx("ul",{role:"presentation",className:q.groupList,children:g.items.map(x=>{y+=1;const b=y===d,j=y;return o.jsxs("li",{role:"option","aria-selected":b,className:w.cn(q.option,b&&q.active),onMouseMove:()=>p(j),onClick:()=>_(x),children:[x.icon&&o.jsx("span",{className:q.icon,children:x.icon}),o.jsx("span",{className:q.label,children:x.label})]},x.id)})})]},g.name??"__ungrouped__"))})]})}),document.body)}function Cg(){return o.jsxs("svg",{className:q.searchIcon,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}const Eg="tempest_root_cWKqF",Tg={root:Eg},Mg=l.forwardRef(function({maxHeight:t,orientation:n="vertical",className:s,style:r,children:a,...i},c){const u={overflowX:n==="vertical"?"hidden":"auto",overflowY:n==="horizontal"?"hidden":"auto",...t!==void 0?{maxHeight:t}:{},...r};return o.jsx("div",{ref:c,className:w.cn(Tg.root,s),style:u,...i,children:a})}),Rg="tempest_root_-Xerf",Lg="tempest_horizontal_3QOMV",Dg="tempest_vertical_6A7lb",Pg="tempest_pane_x6yUG",Ag="tempest_divider_fhaTB",Ig="tempest_handle_eCe1B",Be={root:Rg,horizontal:Lg,vertical:Dg,pane:Pg,divider:Ag,handle:Ig},_t=2;function Lt(e,t,n){return Math.min(n,Math.max(t,e))}function Fg({direction:e="horizontal",defaultSize:t=50,min:n=10,max:s=90,children:r,className:a,...i}){const[c,u]=l.useState(()=>Lt(t,n,s)),d=l.useRef(null),[p,m]=r,f=e==="horizontal",h=l.useCallback((y,g)=>{const x=d.current;if(!x)return;const b=x.getBoundingClientRect(),j=f?b.width:b.height;if(j<=0)return;const M=(f?y-b.left:g-b.top)/j*100;u(Lt(M,n,s))},[f,n,s]),_=l.useCallback(y=>{y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const x=j=>{h(j.clientX,j.clientY)},b=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",b)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",b)},[h]),v=l.useCallback(y=>{let g=0;if(f?y.key==="ArrowRight"?g=_t:y.key==="ArrowLeft"&&(g=-_t):y.key==="ArrowDown"?g=_t:y.key==="ArrowUp"&&(g=-_t),y.key==="Home"){y.preventDefault(),u(n);return}if(y.key==="End"){y.preventDefault(),u(s);return}g!==0&&(y.preventDefault(),u(x=>Lt(x+g,n,s)))},[f,n,s]);return o.jsxs("div",{ref:d,className:w.cn(Be.root,f?Be.horizontal:Be.vertical,a),...i,children:[o.jsx("div",{className:Be.pane,style:{flexBasis:`${c}%`},children:p}),o.jsx("div",{role:"separator","aria-orientation":f?"vertical":"horizontal","aria-valuenow":Math.round(c),"aria-valuemin":n,"aria-valuemax":s,tabIndex:0,className:Be.divider,onPointerDown:_,onKeyDown:v,children:o.jsx("span",{className:Be.handle,"aria-hidden":"true"})}),o.jsx("div",{className:Be.pane,style:{flexBasis:`${100-c}%`},children:m})]})}const Og="tempest_root_ObO-Z",Bg="tempest_header_5nSJG",zg="tempest_title_Jd3Xb",Wg="tempest_nav_4h58I",qg="tempest_weekdays_YzRfx",Kg="tempest_grid_nbaFm",Ug="tempest_weekday_k-7Vr",Hg="tempest_day_ao-IC",Gg="tempest_outside_HkC-6",Qg="tempest_today_p18-m",Jg="tempest_selected_C9bTY",X={root:Og,header:Bg,title:zg,nav:Wg,weekdays:qg,grid:Kg,weekday:Ug,day:Hg,outside:Gg,today:Qg,selected:Jg},Yg=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xg=["January","February","March","April","May","June","July","August","September","October","November","December"],Vn=42;function Ye(e,t,n){return new Date(e,t,n)}function vt(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function yn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function vn(e,t,n){const s=vt(e).getTime();return!!(t&&s<vt(t).getTime()||n&&s>vt(n).getTime())}function Vg(e,t){const n=e.getFullYear(),s=e.getMonth(),i=(Ye(n,s,1).getDay()-t+7)%7,c=Ye(n,s,1-i),u=[];for(let d=0;d<Vn;d+=1)u.push(Ye(c.getFullYear(),c.getMonth(),c.getDate()+d));return u}function Zg({value:e,defaultValue:t,onChange:n,month:s,onMonthChange:r,minDate:a,maxDate:i,weekStartsOn:c=0,className:u,...d}){const p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=s!==void 0,[v,y]=l.useState(()=>{const $=s??e??t??new Date;return Ye($.getFullYear(),$.getMonth(),1)}),g=_?Ye(s.getFullYear(),s.getMonth(),1):v,[x,b]=l.useState(null),j=l.useRef(null),k=l.useMemo(()=>vt(new Date),[]),M=l.useMemo(()=>Vg(g,c),[g,c]),E=l.useMemo(()=>Array.from({length:7},($,C)=>Yg[(C+c)%7]),[c]),N=l.useCallback($=>{const C=Ye(g.getFullYear(),g.getMonth()+$,1);r&&r(C),_||y(C)},[g,r,_]),S=l.useCallback($=>{vn($,a,i)||(n&&n($),p||f($))},[a,i,n,p]),T=l.useCallback($=>{const C=Math.max(0,Math.min(Vn-1,$));b(C);const I=j.current;if(!I)return;I.querySelectorAll("button[data-day]")[C]?.focus()},[]),D=l.useCallback(($,C)=>{switch($.key){case"ArrowLeft":$.preventDefault(),T(C-1);break;case"ArrowRight":$.preventDefault(),T(C+1);break;case"ArrowUp":$.preventDefault(),T(C-7);break;case"ArrowDown":$.preventDefault(),T(C+7);break;case"Enter":case" ":$.preventDefault(),S(M[C]);break}},[T,S,M]);return o.jsxs("div",{className:w.cn(X.root,u),...d,children:[o.jsxs("div",{className:X.header,children:[o.jsx("button",{type:"button",className:X.nav,"aria-label":"Previous month",onClick:()=>N(-1),children:"‹"}),o.jsxs("span",{className:X.title,"aria-live":"polite",children:[Xg[g.getMonth()]," ",g.getFullYear()]}),o.jsx("button",{type:"button",className:X.nav,"aria-label":"Next month",onClick:()=>N(1),children:"›"})]}),o.jsx("div",{className:X.weekdays,role:"row",children:E.map($=>o.jsx("span",{className:X.weekday,role:"columnheader",children:$},$))}),o.jsx("div",{className:X.grid,role:"grid",ref:j,children:M.map(($,C)=>{const I=$.getMonth()===g.getMonth(),L=h?yn($,h):!1,R=yn($,k),W=vn($,a,i),We=x===null?I&&$.getDate()===1:x===C;return o.jsx("button",{type:"button","data-day":!0,role:"gridcell",className:w.cn(X.day,!I&&X.outside,L&&X.selected,R&&X.today),"aria-pressed":L,"aria-selected":L,"aria-current":R?"date":void 0,disabled:W,tabIndex:We?0:-1,onClick:()=>S($),onKeyDown:ge=>D(ge,C),children:$.getDate()},C)})})]})}const eb="tempest_wrapper_KCCs1",tb="tempest_label_N4ak-",nb="tempest_value_-33zj",sb="tempest_field_wFJsg",rb="tempest_track_kaJkL",ob="tempest_fill_tio-b",ab="tempest_input_J48Um",ib="tempest_helper_yn8VW",Ee={wrapper:eb,label:tb,value:nb,field:sb,track:rb,fill:ob,input:ab,helper:ib};function cb({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:i,disabled:c=!1,formatValue:u,className:d}){const p=l.useMemo(()=>{const h=s-n;return h<=0?0:Math.min(100,Math.max(0,(e-n)/h*100))},[e,n,s]),m=u?.(e)??String(e),f=l.useCallback(h=>{t(Number(h.target.value))},[t]);return o.jsxs("div",{className:w.cn(Ee.wrapper,d),children:[a&&o.jsxs("div",{className:Ee.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:Ee.value,children:m})]}),o.jsxs("div",{className:Ee.field,children:[o.jsx("div",{className:Ee.track}),o.jsx("div",{className:Ee.fill,style:{width:`${p}%`}}),o.jsx("input",{type:"range",className:Ee.input,min:n,max:s,step:r,value:e,onChange:f,disabled:c,"aria-label":a??"Slider","aria-valuetext":m})]}),i&&o.jsx("span",{className:Ee.helper,children:i})]})}const lb="tempest_wrapper_6xZZr",ub="tempest_label_Jwj7I",db="tempest_field_GpA0V",pb="tempest_disabled_BIKaG",mb="tempest_chip_Zk0ch",fb="tempest_chipRemove_R-mNv",hb="tempest_input_SjOXU",_b="tempest_menu_3xnmo",gb="tempest_option_lqEl1",bb="tempest_check_aUM1w",yb="tempest_active_S9sQ-",vb="tempest_selected_Rw8yr",xb="tempest_empty_-5B16",wb="tempest_helper_c7aH3",jb="tempest_errorText_qZR9s",$b="tempest_error_DIOTW",B={wrapper:lb,label:ub,field:db,disabled:pb,chip:mb,chipRemove:fb,input:hb,menu:_b,option:gb,check:bb,active:yb,selected:vb,empty:xb,helper:wb,errorText:jb,error:$b};function kb(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function Nb({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:i,disabled:c,maxItems:u,filter:d=kb,emptyMessage:p="Nenhuma opção encontrada",className:m}){const f=l.useId(),h=l.useRef(null),_=l.useRef(null),[v,y]=l.useState(!1),[g,x]=l.useState(""),[b,j]=l.useState(0),k=l.useMemo(()=>new Set(t),[t]),M=l.useMemo(()=>t.map($=>e.find(C=>C.value===$)).filter($=>!!$),[t,e]),E=l.useMemo(()=>e.filter($=>d($,g)),[e,d,g]),N=u!==void 0&&t.length>=u,S=l.useCallback($=>{if(!$.disabled){if(k.has($.value))n(t.filter(C=>C!==$.value));else{if(N)return;n([...t,$.value])}x(""),_.current?.focus()}},[k,n,t,N]),T=l.useCallback($=>{n(t.filter(C=>C!==$))},[n,t]);l.useEffect(()=>{if(!v)return;const $=C=>{h.current&&!h.current.contains(C.target)&&(y(!1),x(""))};return window.addEventListener("mousedown",$),()=>window.removeEventListener("mousedown",$)},[v]);const D=$=>{if($.key==="ArrowDown")$.preventDefault(),y(!0),j(C=>Math.min(E.length-1,C+1));else if($.key==="ArrowUp")$.preventDefault(),j(C=>Math.max(0,C-1));else if($.key==="Enter"){$.preventDefault();const C=E[b];C&&S(C)}else $.key==="Escape"?(y(!1),x("")):$.key==="Backspace"&&g===""&&t.length>0&&T(t[t.length-1])};return o.jsxs("div",{ref:h,className:w.cn(B.wrapper,i&&B.error,m),children:[s&&o.jsx("label",{htmlFor:f,className:B.label,children:s}),o.jsxs("div",{className:w.cn(B.field,c&&B.disabled),onMouseDown:$=>{c||$.target===$.currentTarget&&($.preventDefault(),_.current?.focus(),y(!0))},children:[M.map($=>o.jsxs("span",{className:B.chip,children:[$.label,o.jsx("button",{type:"button",className:B.chipRemove,"aria-label":`Remover ${$.label}`,disabled:c,onMouseDown:C=>{C.preventDefault(),T($.value)},children:"×"})]},$.value)),o.jsx("input",{id:f,ref:_,type:"text",role:"combobox","aria-expanded":v,"aria-controls":`${f}-listbox`,"aria-autocomplete":"list",className:B.input,placeholder:t.length===0?r:"",disabled:c,value:g,onFocus:()=>y(!0),onChange:$=>{x($.target.value),y(!0),j(0)},onKeyDown:D})]}),v&&o.jsx("ul",{id:`${f}-listbox`,role:"listbox","aria-multiselectable":!0,className:B.menu,children:E.length===0?o.jsx("li",{className:B.empty,children:p}):E.map(($,C)=>{const I=k.has($.value);return o.jsxs("li",{role:"option","aria-selected":I,"aria-disabled":$.disabled||!I&&N,className:w.cn(B.option,C===b&&B.active,I&&B.selected),onMouseEnter:()=>j(C),onMouseDown:L=>{L.preventDefault(),S($)},children:[o.jsx("span",{className:B.check,"aria-hidden":!0,children:I?"✓":""}),$.label]},$.value)})}),i?o.jsx("span",{className:B.errorText,children:i}):a?o.jsx("span",{className:B.helper,children:a}):null]})}const Sb="tempest_root_fVC66",Cb="tempest_header_sTdRM",Eb="tempest_headerSpacer_nqeNO",Tb="tempest_nav_7nFJE",Mb="tempest_months_fbwtK",Rb="tempest_month_0WfUc",Lb="tempest_title_OGQrm",Db="tempest_weekdays_nYTrg",Pb="tempest_grid_O0eUF",Ab="tempest_weekday_cy-Mz",Ib="tempest_day_-V6FX",Fb="tempest_outside_3otid",Ob="tempest_today_gwmhs",Bb="tempest_inRange_iQJYA",zb="tempest_selected_DRsBO",Wb="tempest_rangeStart_-Oe1u",qb="tempest_rangeEnd_mUaKW",F={root:Sb,header:Cb,headerSpacer:Eb,nav:Tb,months:Mb,month:Rb,title:Lb,weekdays:Db,grid:Pb,weekday:Ab,day:Ib,outside:Fb,today:Ob,inRange:Bb,selected:zb,rangeStart:Wb,rangeEnd:qb},Kb=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xn=["January","February","March","April","May","June","July","August","September","October","November","December"],Ub=42;function ct(e,t,n){return new Date(e,t,n)}function le(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t){return ct(e.getFullYear(),e.getMonth()+t,1)}function Dt(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function jn(e,t,n){const s=le(e).getTime();return!!(t&&s<le(t).getTime()||n&&s>le(n).getTime())}function Hb(e,t,n){const s=le(e).getTime(),r=Math.min(le(t).getTime(),le(n).getTime()),a=Math.max(le(t).getTime(),le(n).getTime());return s>r&&s<a}function Gb(e,t){const n=e.getFullYear(),s=e.getMonth(),a=(ct(n,s,1).getDay()-t+7)%7,i=ct(n,s,1-a);return Array.from({length:Ub},(c,u)=>ct(i.getFullYear(),i.getMonth(),i.getDate()+u))}function Qb({value:e,onChange:t,numberOfMonths:n=2,defaultMonth:s,minDate:r,maxDate:a,weekStartsOn:i=0,className:c,...u}){const[d,p]=l.useState(()=>{const b=s??e.start??new Date;return ct(b.getFullYear(),b.getMonth(),1)}),[m,f]=l.useState(null),h=l.useMemo(()=>le(new Date),[]),_=l.useMemo(()=>Array.from({length:7},(b,j)=>Kb[(j+i)%7]),[i]),v=l.useCallback(b=>{if(jn(b,r,a))return;const{start:j,end:k}=e;!j||k?t({start:b,end:null}):le(b).getTime()<le(j).getTime()?t({start:b,end:j}):t({start:j,end:b})},[e,t,r,a]),y=l.useCallback(b=>{p(j=>wn(j,b))},[]),g=e.start&&!e.end?m:e.end;function x(b){const{start:j}=e,k=g,M=j?Dt(b,j):!1,E=k?Dt(b,k):!1,N=j&&k?Hb(b,j,k):!1;return{selected:M||E,inRange:N,isStart:M,isEnd:E}}return o.jsxs("div",{className:w.cn(F.root,c),...u,children:[o.jsxs("div",{className:F.header,children:[o.jsx("button",{type:"button",className:F.nav,"aria-label":"Previous month",onClick:()=>y(-1),children:"‹"}),o.jsx("span",{className:F.headerSpacer,"aria-hidden":!0}),o.jsx("button",{type:"button",className:F.nav,"aria-label":"Next month",onClick:()=>y(1),children:"›"})]}),o.jsx("div",{className:F.months,onMouseLeave:()=>f(null),children:Array.from({length:Math.max(1,n)},(b,j)=>{const k=wn(d,j),M=Gb(k,i);return o.jsxs("div",{className:F.month,children:[o.jsxs("div",{className:F.title,"aria-live":"polite",children:[xn[k.getMonth()]," ",k.getFullYear()]}),o.jsx("div",{className:F.weekdays,role:"row",children:_.map(E=>o.jsx("span",{className:F.weekday,role:"columnheader",children:E},E))}),o.jsx("div",{className:F.grid,role:"grid",children:M.map((E,N)=>{const S=E.getMonth()===k.getMonth(),T=jn(E,r,a),{selected:D,inRange:$,isStart:C,isEnd:I}=x(E),L=Dt(E,h);return o.jsx("button",{type:"button",role:"gridcell",className:w.cn(F.day,!S&&F.outside,$&&F.inRange,D&&F.selected,C&&F.rangeStart,I&&F.rangeEnd,L&&F.today),"aria-label":`${xn[E.getMonth()]} ${E.getDate()}, ${E.getFullYear()}`,"aria-selected":D,"aria-current":L?"date":void 0,disabled:T,onClick:()=>v(E),onMouseEnter:()=>f(E),children:E.getDate()},N)})})]},j)})})]})}const Jb="tempest_root_Nosqs",Yb="tempest_list_v9FNC",Xb="tempest_item_9RzZ7",Vb="tempest_link_67ULr",Zb="tempest_trigger_2gBDu",ey="tempest_panel_N2ujp",ty="tempest_subItem_LjtO7",we={root:Jb,list:Yb,item:Xb,link:Vb,trigger:Zb,panel:ey,subItem:ty};function ny({items:e,className:t,...n}){const[s,r]=l.useState(-1),[a,i]=l.useState(-1),c=l.useId(),u=l.useRef(null),d=l.useCallback(()=>{r(-1),i(-1)},[]),p=s!==-1?s:a;l.useEffect(()=>{if(p===-1)return;const f=_=>{_.key==="Escape"&&d()},h=_=>{u.current&&!u.current.contains(_.target)&&d()};return window.addEventListener("keydown",f),window.addEventListener("mousedown",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",h)}},[p,d]);const m=(f,h)=>{const _=()=>{f.onSelect?.(),d()};return f.href?o.jsx("a",{href:f.href,role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label}):o.jsx("button",{type:"button",role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label})};return o.jsx("nav",{ref:u,className:w.cn(we.root,t),...n,children:o.jsx("ul",{className:we.list,children:e.map((f,h)=>{if(!(!!f.children&&f.children.length>0))return o.jsx("li",{className:we.item,children:m(f,"none")},h);const v=p===h,y=`${c}-panel-${h}`;return o.jsxs("li",{className:we.item,onMouseEnter:()=>i(h),onMouseLeave:()=>i(g=>g===h?-1:g),children:[o.jsx("button",{type:"button",className:we.trigger,"aria-haspopup":"menu","aria-expanded":v,"aria-controls":y,onClick:()=>r(g=>g===h?-1:h),onFocus:()=>i(h),children:f.label}),v&&o.jsx("ul",{id:y,role:"menu",className:we.panel,children:f.children.map((g,x)=>o.jsx("li",{role:"none",className:we.subItem,children:m(g,"menuitem")},x))})]},h)})})})}const sy="tempest_root_PGUO2",ry="tempest_menu_hEVLT",oy="tempest_trigger_ZlZBx",ay="tempest_triggerOpen_Hpfbu",iy="tempest_panel_6ta6u",cy="tempest_item_wM-61",ly="tempest_itemLabel_wXfB2",uy="tempest_shortcut_qNlmN",dy="tempest_separator_LfK3t",je={root:sy,menu:ry,trigger:oy,triggerOpen:ay,panel:iy,item:cy,itemLabel:ly,shortcut:uy,separator:dy};function py(e){return"separator"in e}function my({menus:e,className:t,...n}){const[s,r]=l.useState(-1),a=l.useId(),i=l.useRef(null),c=l.useRef([]),u=l.useCallback(()=>{r(-1)},[]);return l.useEffect(()=>{if(s===-1)return;const d=m=>{if(m.key==="Escape"){u(),c.current[s]?.focus();return}if(m.key==="ArrowRight"){m.preventDefault();const f=(s+1)%e.length;r(f),c.current[f]?.focus()}if(m.key==="ArrowLeft"){m.preventDefault();const f=(s-1+e.length)%e.length;r(f),c.current[f]?.focus()}},p=m=>{i.current&&!i.current.contains(m.target)&&u()};return window.addEventListener("keydown",d),window.addEventListener("mousedown",p),()=>{window.removeEventListener("keydown",d),window.removeEventListener("mousedown",p)}},[s,e.length,u]),o.jsx("div",{ref:i,role:"menubar",className:w.cn(je.root,t),...n,children:e.map((d,p)=>{const m=s===p,f=`${a}-panel-${p}`;return o.jsxs("div",{className:je.menu,children:[o.jsx("button",{ref:h=>{c.current[p]=h},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?f:void 0,className:w.cn(je.trigger,m&&je.triggerOpen),onClick:()=>r(h=>h===p?-1:p),children:d.label}),m&&o.jsx("ul",{id:f,role:"menu",className:je.panel,children:d.items.map((h,_)=>py(h)?o.jsx("li",{role:"separator",className:je.separator,"aria-hidden":!0},_):o.jsx("li",{role:"none",children:o.jsxs("button",{type:"button",role:"menuitem",className:je.item,disabled:h.disabled,onClick:()=>{h.onSelect?.(),u()},children:[o.jsx("span",{className:je.itemLabel,children:h.label}),h.shortcut&&o.jsx("span",{className:je.shortcut,children:h.shortcut})]})},_))})]},p)})})}const fy="tempest_root_-w3-j",hy="tempest_viewport_n0hzM",_y="tempest_track_5PA8h",gy="tempest_slide_fhfjg",by="tempest_arrow_S92Lt",yy="tempest_prev_X8whU",vy="tempest_next_jBRSz",xy="tempest_dots_fL3Hr",wy="tempest_dot_vEB56",jy="tempest_dotActive_OSSUg",ae={root:fy,viewport:hy,track:_y,slide:gy,arrow:by,prev:yy,next:vy,dots:xy,dot:wy,dotActive:jy};function $y({children:e,loop:t=!1,showArrows:n=!0,showDots:s=!0,index:r,defaultIndex:a=0,onIndexChange:i,className:c,...u}){const d=e.length,p=r!==void 0,[m,f]=l.useState(a),h=p?r:m,_=l.useCallback(x=>{let b=x;b<0?b=t?d-1:0:b>=d&&(b=t?0:d-1),b!==h&&(p||f(b),i?.(b))},[d,t,h,p,i]),v=h<=0,y=h>=d-1,g=x=>{x.key==="ArrowRight"?(x.preventDefault(),_(h+1)):x.key==="ArrowLeft"&&(x.preventDefault(),_(h-1))};return o.jsxs("div",{role:"region","aria-roledescription":"carousel",tabIndex:0,className:w.cn(ae.root,c),onKeyDown:g,...u,children:[o.jsx("div",{className:ae.viewport,children:o.jsx("div",{className:ae.track,style:{transform:`translateX(-${h*100}%)`},children:e.map((x,b)=>o.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":`${b+1} of ${d}`,"aria-hidden":b!==h,className:ae.slide,children:x},b))})}),n&&d>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:w.cn(ae.arrow,ae.prev),"aria-label":"Previous slide",disabled:!t&&v,onClick:()=>_(h-1),children:"‹"}),o.jsx("button",{type:"button",className:w.cn(ae.arrow,ae.next),"aria-label":"Next slide",disabled:!t&&y,onClick:()=>_(h+1),children:"›"})]}),s&&d>1&&o.jsx("div",{className:ae.dots,role:"tablist","aria-label":"Slides",children:e.map((x,b)=>o.jsx("button",{type:"button",role:"tab","aria-label":`Go to slide ${b+1}`,"aria-selected":b===h,className:w.cn(ae.dot,b===h&&ae.dotActive),onClick:()=>_(b)},b))})]})}function Zn(e=1,t=50){const[n,s]=l.useState(e),[r,a]=l.useState(t),i=l.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:a,reset:i}}function ky(e,t,n){return l.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(a=>{const i=r[a];return i!=null&&String(i).toLowerCase().includes(s)})):e},[e,t,n])}function Ny(e){const[t,n]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=a=>n(a.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function Sy(e,t,n,s){const r=l.useRef(t);r.current=t,l.useEffect(()=>{const a=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!a?.addEventListener)return;const i=c=>r.current(c);return a.addEventListener(e,i,s),()=>a.removeEventListener(e,i,s)},[e,n,s])}const Cy=JSON.stringify,Ey=e=>JSON.parse(e);function Ty(e,t,n={}){const s=n.serialize??Cy,r=n.deserialize??Ey,a=l.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[i,c]=l.useState(a);l.useEffect(()=>{c(a())},[a]);const u=l.useCallback(p=>{c(m=>{const f=typeof p=="function"?p(m):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(f))}catch{}return f})},[e,s]),d=l.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}c(t)},[e,t]);return l.useEffect(()=>{if(typeof window>"u")return;const p=m=>{if(m.key===e){if(m.newValue===null){c(t);return}try{c(r(m.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[i,u,d]}function My(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(c=>!c),[]),r=l.useCallback(()=>n(!0),[]),a=l.useCallback(()=>n(!1),[]),i=l.useCallback(c=>n(c),[]);return[t,{toggle:s,setTrue:r,setFalse:a,set:i}]}function Ry(e,t=[],n={}){const{immediate:s=!1}=n,[r,a]=l.useState({status:"idle",data:void 0,error:void 0}),i=l.useRef(e);i.current=e;const c=l.useRef(0),u=l.useRef(!0);l.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const d=l.useCallback(async()=>{const m=++c.current;a(f=>({...f,status:"pending",error:void 0}));try{const f=await i.current();return u.current&&c.current===m&&a({status:"success",data:f,error:void 0}),f}catch(f){throw u.current&&c.current===m&&a({status:"error",data:void 0,error:f}),f}},[]),p=l.useCallback(()=>{c.current++,a({status:"idle",data:void 0,error:void 0})},[]);return l.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function Ly(){const[e,t]=l.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function Dy(){const[e,t]=l.useState(()=>typeof document>"u"?"visible":document.visibilityState);return l.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function Py(e,t={}){const[n,s]=l.useState(null),{once:r=!1,root:a,rootMargin:i,threshold:c}=t;return l.useEffect(()=>{const u=e.current;if(!u||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(u))},{root:a,rootMargin:i,threshold:c});return d.observe(u),()=>d.disconnect()},[e,r,a,i,c]),n}function Ay(e){const[t,n]=l.useState(null);return l.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(a=>{const i=a[0];if(!i)return;const c=i.contentRect;n({width:c.width,height:c.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function Iy(e={}){const{resetAfter:t=1500}=e,[n,s]=l.useState(!1),r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);l.useEffect(()=>()=>a(),[a]);const i=l.useCallback(async c=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(c);else if(typeof document<"u"){const u=document.createElement("textarea");u.value=c,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:a}}function Fy(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,a=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==a)}function Oy(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function By(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;l.useEffect(()=>{if(s||typeof window>"u")return;const a=i=>{r&&Oy(i.target)||Fy(i,e)&&t(i)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}const $n=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function zy(e=6e4){const[t,n]=l.useState(!1);return l.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const a of $n)window.addEventListener(a,r,{passive:!0});return()=>{clearTimeout(s);for(const a of $n)window.removeEventListener(a,r)}},[e]),t}function Wy(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,a]=l.useState({loading:!n,error:null,coords:null,timestamp:null});return l.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){a(u=>({...u,loading:!1}));return}const i=u=>{a({loading:!1,error:null,coords:u.coords,timestamp:u.timestamp})},c=u=>{a(d=>({...d,loading:!1,error:u}))};if(t){const u=navigator.geolocation.watchPosition(i,c,s);return()=>navigator.geolocation.clearWatch(u)}navigator.geolocation.getCurrentPosition(i,c,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function qy(e){l.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])}function Ky(e){const t=l.useRef(e);return t.current=e,l.useCallback((...n)=>t.current(...n),[])}function Ut(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((r,a)=>Ut(r,t[a]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Ut(e[r],t[r]))}function Uy(e){const t=l.useRef(e);return Ut(t.current,e)||(t.current=e),t.current}function Hy(e){const t=l.useRef(void 0);return l.useEffect(()=>{t.current=e},[e]),t.current}function Gy(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setInterval(()=>n.current(),t);return()=>clearInterval(s)},[t])}function Qy(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setTimeout(()=>n.current(),t);return()=>clearTimeout(s)},[t])}function Jy(e,t){const[n,s]=l.useState(e),r=l.useRef(0),a=l.useRef(null);return l.useEffect(()=>{const i=Date.now(),c=i-r.current;return c>=t?(r.current=i,s(e)):(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r.current=Date.now(),s(e)},t-c)),()=>{a.current&&clearTimeout(a.current)}},[e,t]),n}function Yy(){const[e,t]=l.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight});return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t({width:window.innerWidth,height:window.innerHeight});return n(),window.addEventListener("resize",n,{passive:!0}),()=>window.removeEventListener("resize",n)},[]),e}function Xy(e){const[t,n]=l.useState(!1);return l.useEffect(()=>{const s=e.current;if(!s)return;const r=()=>n(!0),a=()=>n(!1);return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",a)}},[e]),t}function Vy(e,t,n={}){const{delay:s=500,moveThreshold:r=10}=n,a=l.useRef(t);a.current=t,l.useEffect(()=>{const i=e.current;if(!i)return;let c=null,u=0,d=0;const p=()=>{c&&(clearTimeout(c),c=null)},m=h=>{u=h.clientX,d=h.clientY,p(),c=setTimeout(()=>{c=null,a.current()},s)},f=h=>{if(c===null)return;const _=h.clientX-u,v=h.clientY-d;Math.hypot(_,v)>r&&p()};return i.addEventListener("pointerdown",m),i.addEventListener("pointermove",f),i.addEventListener("pointerup",p),i.addEventListener("pointercancel",p),i.addEventListener("pointerleave",p),()=>{p(),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",f),i.removeEventListener("pointerup",p),i.removeEventListener("pointercancel",p),i.removeEventListener("pointerleave",p)}},[e,s,r])}function Zy(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(!0),[]),r=l.useCallback(()=>n(!1),[]),a=l.useCallback(()=>n(c=>!c),[]),i=l.useMemo(()=>({open:s,close:r,toggle:a}),[s,r,a]);return[t,i]}function ev(e=[]){const[t,n]=l.useState(e),s=l.useCallback((...h)=>{n(_=>[..._,...h])},[]),r=l.useCallback((...h)=>{n(_=>[...h,..._])},[]),a=l.useCallback((h,..._)=>{n(v=>[...v.slice(0,h),..._,...v.slice(h)])},[]),i=l.useCallback((...h)=>{const _=new Set(h);n(v=>v.filter((y,g)=>!_.has(g)))},[]),c=l.useCallback(({from:h,to:_})=>{n(v=>{const y=[...v],[g]=y.splice(h,1);return y.splice(_,0,g),y})},[]),u=l.useCallback((h,_)=>{n(v=>v.map((y,g)=>g===h?_:y))},[]),d=l.useCallback(h=>n(h),[]),p=l.useCallback(h=>{n(_=>_.map(h))},[]),m=l.useCallback(()=>n([]),[]),f=l.useMemo(()=>({append:s,prepend:r,insert:a,remove:i,reorder:c,setItem:u,setState:d,apply:p,clear:m}),[s,r,a,i,c,u,d,p,m]);return[t,f]}const at=(e,t,n)=>{let s=e;return typeof t=="number"&&(s=Math.max(t,s)),typeof n=="number"&&(s=Math.min(n,s)),s};function tv(e=0,t={}){const{min:n,max:s}=t,[r,a]=l.useState(()=>at(e,n,s)),i=l.useCallback(()=>{a(m=>at(m+1,n,s))},[n,s]),c=l.useCallback(()=>{a(m=>at(m-1,n,s))},[n,s]),u=l.useCallback(m=>{a(at(m,n,s))},[n,s]),d=l.useCallback(()=>{a(at(e,n,s))},[e,n,s]),p=l.useMemo(()=>({increment:i,decrement:c,set:u,reset:d}),[i,c,u,d]);return[r,p]}function nv(e){l.useEffect(()=>{if(typeof document>"u")return;const t=document.title;return document.title=e,()=>{document.title=t}},[e])}function sv(e){l.useEffect(()=>{if(typeof document>"u")return;let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},[e])}function rv(e){const[t,n]=l.useState(()=>new Map(e)),s=l.useCallback((u,d)=>{n(p=>{const m=new Map(p);return m.set(u,d),m})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Map(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Map)},[]),i=l.useCallback(u=>t.get(u),[t]),c=l.useCallback(u=>t.has(u),[t]);return l.useMemo(()=>({map:t,set:s,delete:r,clear:a,get:i,has:c,size:t.size}),[t,s,r,a,i,c])}function ov(e){const[t,n]=l.useState(()=>new Set(e)),s=l.useCallback(u=>{n(d=>{if(d.has(u))return d;const p=new Set(d);return p.add(u),p})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Set(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Set)},[]),i=l.useCallback(u=>t.has(u),[t]),c=l.useCallback(u=>{n(d=>{const p=new Set(d);return p.has(u)?p.delete(u):p.add(u),p})},[]);return l.useMemo(()=>({set:t,add:s,delete:r,clear:a,has:i,toggle:c,size:t.size}),[t,s,r,a,i,c])}function av(e={}){const{initialValues:t=[],limit:n=1/0}=e,[s,r]=l.useState(()=>({queue:t.slice(0,n),overflow:t.slice(n)})),a=l.useCallback((...u)=>{r(d=>{const p=[...d.queue,...d.overflow,...u];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),i=l.useCallback(u=>{r(d=>{const p=[...u(d.queue),...d.overflow];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),c=l.useCallback(()=>{r(u=>({queue:u.overflow.slice(0,n),overflow:u.overflow.slice(n)}))},[n]);return l.useMemo(()=>({queue:s.queue,add:a,update:i,cleanQueue:c,size:s.queue.length}),[s.queue,a,i,c])}function iv(e){const t=l.useRef(null),n=l.useRef(e);return n.current=e,l.useEffect(()=>{if(typeof document>"u")return;const s=r=>{const a=r.target;!t.current||a&&t.current.contains(a)||n.current()};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),t}function cv(){const e=l.useRef(!0);return e.current?(e.current=!1,!0):!1}const lv="tempest_wrapper_iB6ka",uv="tempest_search_2y-yM",dv="tempest_sortButton_9p6w4",pv="tempest_sortIndicator_bZMlH",gt={wrapper:lv,search:uv,sortButton:dv,sortIndicator:pv};function mv(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():typeof e=="boolean"&&typeof t=="boolean"?Number(e)-Number(t):String(e).localeCompare(String(t),void 0,{numeric:!0})}function fv({data:e,columns:t,pageSize:n=10,searchable:s=!1,searchKeys:r,initialSort:a,rowKey:i=(p,m)=>m,emptyMessage:c,className:u,...d}){const[p,m]=l.useState(""),[f,h]=l.useState(a??null),{page:_,setPage:v}=Zn(1,n),y=l.useMemo(()=>r&&r.length>0?r:t.filter(N=>{const S=e.find(D=>D[N.key]!=null),T=S?S[N.key]:void 0;return typeof T=="string"||typeof T=="number"}).map(N=>N.key),[r,t,e]),g=l.useMemo(()=>{const N=p.trim().toLowerCase();return!N||!s?e:e.filter(S=>y.some(T=>{const D=S[T];return D!=null&&String(D).toLowerCase().includes(N)}))},[e,p,s,y]),x=l.useMemo(()=>{if(!f)return g;const N=f.direction==="asc"?1:-1;return[...g].sort((S,T)=>mv(S[f.key],T[f.key])*N)},[g,f]),b=Math.max(1,Math.ceil(x.length/n));l.useEffect(()=>{_>b&&v(b)},[_,b,v]);const j=Math.min(_,b),k=l.useMemo(()=>{const N=(j-1)*n;return x.slice(N,N+n)},[x,j,n]);function M(N){h(S=>!S||S.key!==N?{key:N,direction:"asc"}:S.direction==="asc"?{key:N,direction:"desc"}:null)}const E=l.useMemo(()=>t.map(N=>{const T=f?.key===N.key?f?.direction==="asc"?" ▲":" ▼":"",D=N.sortable?o.jsxs("button",{type:"button",className:gt.sortButton,onClick:()=>M(N.key),"aria-label":`Ordenar por ${typeof N.header=="string"?N.header:String(N.key)}`,children:[N.header,o.jsx("span",{className:gt.sortIndicator,"aria-hidden":!0,children:T})]}):N.header;return{key:String(N.key),header:D,align:N.align,priority:N.priority,width:N.width,render:N.render?$=>N.render($):$=>$[N.key]??null}}),[t,f]);return o.jsxs("div",{className:w.cn(gt.wrapper,u),...d,children:[s&&o.jsx(Kn,{value:p,onChange:N=>{m(N),v(1)},wrapperClassName:gt.search}),o.jsx(Hn,{columns:E,data:k,rowKey:(N,S)=>i(N,(j-1)*n+S),emptyMessage:c}),b>1&&o.jsx(Bn,{page:j,totalPages:b,onPageChange:v,totalItems:x.length})]})}const hv="tempest_tile_ZpED6",_v="tempest_interactive_3ICXQ",gv="tempest_selected_dMY11",bv="tempest_disabled_HnXxf",yv="tempest_leading_gSuBb",vv="tempest_trailing_cVd1n",xv="tempest_body_gyEl2",wv="tempest_title_jWFBN",jv="tempest_subtitle_GUtn7",$e={tile:hv,interactive:_v,selected:gv,disabled:bv,leading:yv,trailing:vv,body:xv,title:wv,subtitle:jv};function $v({leading:e,title:t,subtitle:n,trailing:s,onClick:r,disabled:a=!1,selected:i=!1,className:c}){const u=o.jsxs(o.Fragment,{children:[e!==void 0&&o.jsx("span",{className:$e.leading,children:e}),o.jsxs("span",{className:$e.body,children:[o.jsx("span",{className:$e.title,children:t}),n!==void 0&&o.jsx("span",{className:$e.subtitle,children:n})]}),s!==void 0&&o.jsx("span",{className:$e.trailing,children:s})]}),d=w.cn($e.tile,i&&$e.selected,a&&$e.disabled,c);return r?o.jsx("button",{type:"button",className:w.cn(d,$e.interactive),"aria-pressed":i?!0:void 0,disabled:a,onClick:r,children:u}):o.jsx("div",{className:d,children:u})}const kv="tempest_fab_U3NIL",Nv="tempest_primary_8lnHI",Sv="tempest_surface_ZTMQ4",Cv="tempest_round_ljguw",Ev="tempest_sm_3-rLi",Tv="tempest_md_vOdzW",Mv="tempest_lg_Xc6vE",Rv="tempest_extended_GhPio",Lv="tempest_icon_cZ8Nq",Dv="tempest_label_tfoCq",Pv="tempest_fixed_Xr8Xa",Av="tempest_bottomRight_bJ8Oo",Iv="tempest_bottomLeft_USN6N",me={fab:kv,primary:Nv,surface:Sv,round:Cv,sm:Ev,md:Tv,lg:Mv,extended:Rv,icon:Lv,label:Dv,fixed:Pv,bottomRight:Av,bottomLeft:Iv};function Fv({icon:e,label:t,position:n="bottom-right",size:s="md",variant:r="primary",className:a,...i}){const c=t!==void 0;return o.jsxs("button",{type:"button",className:w.cn(me.fab,me[s],me[r],c?me.extended:me.round,n!=="none"&&me.fixed,n==="bottom-right"&&me.bottomRight,n==="bottom-left"&&me.bottomLeft,a),...i,children:[o.jsx("span",{className:me.icon,children:e}),c&&o.jsx("span",{className:me.label,children:t})]})}const Ov="tempest_rail_bvns5",Bv="tempest_header_Mikit",zv="tempest_list_rS6XJ",Wv="tempest_footer_ojpGC",qv="tempest_item_XEXI9",Kv="tempest_active_U3hSU",Uv="tempest_iconWrap_iVwlb",Hv="tempest_icon_-hpb6",Gv="tempest_badge_1YxwU",Qv="tempest_label_zCKyA",fe={rail:Ov,header:Bv,list:zv,footer:Wv,item:qv,active:Kv,iconWrap:Uv,icon:Hv,badge:Gv,label:Qv};function Jv({items:e,value:t,onChange:n,header:s,footer:r,labelVisibility:a="all",className:i,...c}){return o.jsxs("nav",{className:w.cn(fe.rail,i),"aria-label":"Navegação lateral",...c,children:[s!==void 0&&o.jsx("div",{className:fe.header,children:s}),o.jsx("ul",{className:fe.list,children:e.map(u=>{const d=u.key===t,p=a==="all"||a==="selected"&&d;return o.jsx("li",{children:o.jsxs("button",{type:"button",className:w.cn(fe.item,d&&fe.active),"aria-current":d?"page":void 0,disabled:u.disabled,onClick:()=>n(u.key),children:[o.jsxs("span",{className:fe.iconWrap,children:[u.icon&&o.jsx("span",{className:fe.icon,children:u.icon}),u.badge!==void 0&&o.jsx("span",{className:fe.badge,children:u.badge})]}),p&&o.jsx("span",{className:fe.label,children:u.label})]})},u.key)})}),r!==void 0&&o.jsx("div",{className:fe.footer,children:r})]})}const Yv="tempest_wrapper_tFKNC",Xv="tempest_label_FUecv",Vv="tempest_columns_XMru6",Zv="tempest_column_bwotJ",ex="tempest_cellWrapper_xRos3",tx="tempest_cell_eSc7G",nx="tempest_active_6amgd",sx="tempest_helper_ihHGE",rx="tempest_disabled_NDezB",O={wrapper:Yv,label:Xv,columns:Vv,column:Zv,cellWrapper:ex,cell:tx,active:nx,helper:sx,disabled:rx};function bt(e){return e.toString().padStart(2,"0")}function ox(e){const t=/^(\d{1,2}):(\d{1,2})$/.exec(e.trim());if(!t)return{hour24:null,minute:null};const n=Number(t[1]),s=Number(t[2]);return n<0||n>23||s<0||s>59?{hour24:null,minute:null}:{hour24:n,minute:s}}function ax(e){const t=e%12;return t===0?12:t}function Pt(e,t){const n=e%12;return t==="PM"?n+12:n}function ix({value:e,onChange:t,minuteStep:n=5,use12Hours:s=!1,label:r,helperText:a,disabled:i,className:c}){const u=l.useId(),{hour24:d,minute:p}=l.useMemo(()=>ox(e),[e]),m=d!==null&&d>=12?"PM":"AM",f=l.useMemo(()=>s?Array.from({length:12},(b,j)=>j+1):Array.from({length:24},(b,j)=>j),[s]),h=l.useMemo(()=>{const b=n>0?n:1,j=[];for(let k=0;k<60;k+=b)j.push(k);return j},[n]),_=d===null?null:s?ax(d):d,v=(b,j)=>{t(`${bt(b)}:${bt(j)}`)},y=b=>{if(i)return;const j=p??0,k=s?Pt(b,m):b;v(k,j)},g=b=>{if(i)return;const j=d??(s?Pt(12,"AM"):0);v(j,b)},x=b=>{if(i)return;const j=_??12,k=p??0;v(Pt(j,b),k)};return o.jsxs("div",{className:w.cn(O.wrapper,i&&O.disabled,c),children:[r&&o.jsx("span",{id:`${u}-label`,className:O.label,children:r}),o.jsxs("div",{className:O.columns,children:[o.jsx("ul",{role:"listbox","aria-label":"Horas",className:O.column,children:f.map(b=>{const j=b===_;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>y(b),children:s?b:bt(b)})},b)})}),o.jsx("ul",{role:"listbox","aria-label":"Minutos",className:O.column,children:h.map(b=>{const j=b===p;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>g(b),children:bt(b)})},b)})}),s&&o.jsx("ul",{role:"listbox","aria-label":"Período",className:O.column,children:["AM","PM"].map(b=>{const j=_!==null&&b===m;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>x(b),children:b})},b)})})]}),a&&o.jsx("span",{className:O.helper,children:a})]})}const cx="tempest_wrapper_vGp-3",lx="tempest_indicator_S7mV0",ux="tempest_content_bZdpc",dx="tempest_dragging_BvUty",yt={wrapper:cx,indicator:lx,content:ux,dragging:dx};function px(e,t){const n=t*1.5;return Math.min(e/2,n)}function mx({onRefresh:e,children:t,threshold:n=80,disabled:s,className:r}){const a=l.useRef(null),i=l.useRef(null),[c,u]=l.useState(0),[d,p]=l.useState(!1),m=i.current!==null,f=x=>{if(s||d)return;const b=a.current;if(!b||b.scrollTop>0)return;const j=x.touches[0];j&&(i.current=j.clientY)},h=x=>{if(s||d)return;const b=i.current;if(b===null)return;const j=x.touches[0];if(!j)return;const k=j.clientY-b;if(k<=0){u(0);return}u(px(k,n))},_=()=>{i.current=null,u(0)},v=async()=>{if(s||d){_();return}if(!(i.current!==null&&c>=n)){_();return}i.current=null,p(!0),u(n);try{await e()}finally{p(!1),u(0)}},y=d||c>0,g=Math.min(1,c/n);return o.jsxs("div",{ref:a,className:w.cn(yt.wrapper,r),"data-refreshing":d,onTouchStart:f,onTouchMove:h,onTouchEnd:v,children:[o.jsx("div",{className:yt.indicator,"aria-hidden":!y,style:{opacity:d?1:g,transform:`translateX(-50%) translateY(${y?c:0}px) rotate(${g*360}deg)`},children:o.jsx(Un,{size:"sm",label:"Atualizando"})}),o.jsx("div",{className:w.cn(yt.content,(m||d)&&yt.dragging),style:{transform:`translateY(${y?c:0}px)`},children:t})]})}function fx(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function hx(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function _x(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 es(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 ts(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 gx(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}const bx={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{}}};function yx(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function vx(e,t,n="…"){if(e.length<=t)return e;const s=Math.max(0,t-n.length);return e.slice(0,s).trimEnd()+n}function xx(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function wx(e){const t=e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.map((n,s)=>{const r=n.toLowerCase();return s===0?r:r.charAt(0).toUpperCase()+r.slice(1)}).join("")}function jx(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function $x(e,t,n){return e===1?t:n??`${t}s`}function kx(e,t){const n={};for(const s of e){const r=t(s);(n[r]??=[]).push(s)}return n}function Nx(e,t){const n=new Set,s=[];for(const r of e){const a=t(r);n.has(a)||(n.add(a),s.push(r))}return s}function Sx(e,t){if(t<1)throw new RangeError(`chunk size must be >= 1, received ${t}`);const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n}function Cx(e,t,n=1){const s=[];if(n===0)return s;if(n>0)for(let r=e;r<t;r+=n)s.push(r);else for(let r=e;r>t;r+=n)s.push(r);return s}function it(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ex(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}function Tx(e,t){const n=new Set(t),s={};for(const r of Object.keys(e))n.has(r)||(s[r]=e[r]);return s}function ns(e,t){if(!it(e)||!it(t))return t===void 0?e:t;const n={...e};for(const s of Object.keys(t)){const r=t[s],a=n[s];it(a)&&it(r)?n[s]=ns(a,r):n[s]=r}return n}function Mx(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:it(e)?Object.keys(e).length===0:!1}function Rx(e){return e!=null}function Lx(e){return typeof e=="string"}function Dx(e){return typeof e=="number"&&!Number.isNaN(e)}function Px(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ax(e,t){throw new Error(t??`Unexpected value: ${String(e)}`)}function Ix(e,t){let n;const s=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return s.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},s}function Fx(e,t){let n,s,r=0;const a=c=>{r=Date.now(),e(...c)},i=(...c)=>{const u=Date.now(),d=t-(u-r);d<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(c)):(s=c,n===void 0&&(n=setTimeout(()=>{if(n=void 0,s!==void 0){const p=s;s=void 0,a(p)}},d)))};return i.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),s=void 0,r=0},i}function Ox(e){let t=!1,n;return(...s)=>(t||(t=!0,n=e(...s)),n)}function Bx(e){let t=!1,n,s;const r=a=>{if(!t||a.length!==n.length)return!1;for(let i=0;i<a.length;i++)if(!Object.is(a[i],n[i]))return!1;return!0};return(...a)=>(r(a)||(n=a,s=e(...a),t=!0),s)}function zx(e){return new Promise(t=>setTimeout(t,e))}function Wx(e,t,n){return new Promise((s,r)=>{const a=setTimeout(()=>{const i=new Error(n??`Operation timed out after ${t}ms`);i.name="TimeoutError",r(i)},t);e.then(i=>{clearTimeout(a),s(i)},i=>{clearTimeout(a),r(i)})})}function Jt(e){let t;if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")t=crypto.randomUUID();else{const n=Date.now().toString(36),s=Math.random().toString(36).slice(2,10);t=`${n}-${s}`}return e?`${e}-${t}`:t}class kt extends Error{status;detail;code;requestId;body;constructor(t){super(t.detail),this.name="TempestApiError",this.status=t.status,this.detail=t.detail,this.code=t.code,this.requestId=t.requestId,this.body=t.body}}function qx(e){return typeof e=="object"&&e!==null&&typeof e.status=="number"&&typeof e.detail=="string"}function Yt(e,t,n,s){const r=typeof t=="object"&&t!==null?t:null,a=r?.detail??r?.message??`Erro ${e}`,i=typeof r?.code=="string"?r.code:void 0,c=typeof r?.details=="object"&&r.details!==null?r.details:null,u=(typeof c?.request_id=="string"?c.request_id:void 0)??n?.get("X-Request-ID")??s??void 0;return{status:e,detail:String(a),code:i,requestId:u??void 0,retryAfter:Kx(n?.get("Retry-After")),body:t}}function Kx(e){if(!e)return;const t=e.trim();if(/^\d+$/.test(t))return Number(t);const n=Date.parse(t);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function Ux(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,a]of Object.entries(n))a!=null&&s.searchParams.set(r,String(a));return s.toString()}function Hx(e){return typeof FormData<"u"&&e instanceof FormData}async function kn(e,t){let n=null;try{n=await e.clone().json()}catch{try{n=await e.text()}catch{n=null}}return new kt(Yt(e.status,n,e.headers,t))}function xt(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function s(i,c,u){const{body:d,params:p,headers:m,...f}=c,h=Hx(d),_={...h?{}:{"Content-Type":"application/json"},...u?{"X-Request-ID":u}:{},...e.headers,...n(),...m},v={...f,headers:_,credentials:e.withCredentials?"include":f.credentials,body:d==null?void 0:h?d:JSON.stringify(d)};return t(Ux(e.baseURL,i,p),v)}async function r(i,c={}){const u=e.requestId?e.requestId():Jt();let d=await s(i,c,u);if(d.status===401)if(e.refresh)try{await e.refresh(),d=await s(i,c,u)}catch{throw await e.onUnauthorized?.(d),await kn(d,u)}else await e.onUnauthorized?.(d);if(!d.ok)throw await kn(d,u);return d.status===204?void 0:(d.headers.get("content-type")??"").includes("application/json")?await d.json():await d.text()}async function a(i,c,u="POST"){return r(i,{method:u,body:c})}return{request:r,get:(i,c)=>r(i,{...c,method:"GET"}),post:(i,c)=>r(i,{...c,method:"POST"}),put:(i,c)=>r(i,{...c,method:"PUT"}),patch:(i,c)=>r(i,{...c,method:"PATCH"}),delete:(i,c)=>r(i,{...c,method:"DELETE"}),upload:a}}function Gx(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const a=s.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("./sw.cjs"),o=require("react/jsx-runtime"),l=require("react"),w=require("./cn-CNScIEB4.cjs"),Ln=require("lucide-react"),Q=require("@tanstack/react-query"),A=require("react-router-dom"),Ve=require("react-dom"),P=require("./projection-CILVBdpd.cjs"),he=require("react-hook-form"),Ot=require("zustand"),wt=require("zustand/middleware"),Ws=require("dexie"),qs="tempest_accordion_LVhhv",Us="tempest_item_7ryVk",Ks="tempest_header_WaTdJ",Hs="tempest_trigger_9BYFY",Gs="tempest_chevron_i-HVZ",Qs="tempest_open_98jLY",Js="tempest_panel_Wx50w",Te={accordion:qs,item:Us,header:Ks,trigger:Hs,chevron:Gs,open:Qs,panel:Js};function Ys({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:a}){const i=l.useId(),c=n!==void 0,[u,d]=l.useState(s),p=c?n:u,m=l.useCallback(f=>{const h=p.includes(f),_=t?h?p.filter(v=>v!==f):[...p,f]:h?[]:[f];c||d(_),r?.(_)},[p,t,c,r]);return o.jsx("div",{className:w.cn(Te.accordion,a),children:e.map(f=>{const h=p.includes(f.id),_=`${i}-${f.id}-panel`,v=`${i}-${f.id}-trigger`;return o.jsxs("div",{className:w.cn(Te.item,h&&Te.open),children:[o.jsx("h3",{className:Te.header,children:o.jsxs("button",{type:"button",id:v,className:Te.trigger,"aria-expanded":h,"aria-controls":_,disabled:f.disabled,onClick:()=>m(f.id),children:[o.jsx("span",{children:f.title}),o.jsx(Xs,{className:Te.chevron})]})}),h&&o.jsx("div",{id:_,role:"region","aria-labelledby":v,className:Te.panel,children:f.children})]},f.id)})})}function Xs({className:e}){return o.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Vs="tempest_alert_7cYyI",Zs="tempest_content_UXnmZ",er="tempest_title_abGgF",tr="tempest_description_pXPvw",nr="tempest_icon_Zg6SB",sr="tempest_close_narep",rr="tempest_neutral_J7MH1",or="tempest_solid_s-oW5",ar="tempest_outline_v7w9b",ir="tempest_info_9r3r1",cr="tempest_success_1bzoB",lr="tempest_warning_q-j1Q",ur="tempest_danger_CiZkW",be={alert:Vs,content:Zs,title:er,description:tr,icon:nr,close:sr,neutral:rr,solid:or,outline:ar,info:ir,success:cr,warning:lr,danger:ur};function dr({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:a,closeLabel:i="Dismiss",className:c,children:u,...d}){return o.jsxs("div",{role:"alert",className:w.cn(be.alert,be[e],t==="solid"&&be.solid,t==="outline"&&be.outline,c),...d,children:[r&&o.jsx("span",{className:be.icon,children:r}),o.jsxs("div",{className:be.content,children:[n&&o.jsx("p",{className:be.title,children:n}),s&&o.jsx("p",{className:be.description,children:s}),u]}),a&&o.jsx("button",{type:"button",className:be.close,onClick:a,"aria-label":i,children:o.jsx(pr,{})})]})}function pr(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const mr="tempest_bar_SHqWS",fr="tempest_centered_S0CCw",hr="tempest_surface_fusKb",_r="tempest_primary_QcCyN",gr="tempest_transparent_uGrsu",br="tempest_bordered_5M9FZ",yr="tempest_sticky_DStUO",vr="tempest_safeArea_Vo3Bi",xr="tempest_leading_mXv-d",wr="tempest_actions_x7tMx",jr="tempest_title_qaMMQ",$r="tempest_brand_xKt54",kr="tempest_iconBtn_S-BTg",te={bar:mr,centered:fr,surface:hr,primary:_r,transparent:gr,bordered:br,sticky:yr,safeArea:vr,leading:xr,actions:wr,title:jr,brand:$r,iconBtn:kr};function Nr({title:e,leading:t,showBack:n=!1,onBack:s,backLabel:r="Go back",backIcon:a,brand:i,actions:c,centered:u=!1,sticky:d=!0,tone:p="surface",bordered:m=!0,safeArea:f=!0,className:h,..._}){const v=s??(()=>window.history.back()),y=t??o.jsxs(o.Fragment,{children:[n&&o.jsx("button",{type:"button",className:te.iconBtn,onClick:v,"aria-label":r,children:a??o.jsx(Ln.ArrowLeft,{size:22,"aria-hidden":"true"})}),i&&o.jsx("span",{className:te.brand,children:i})]});return o.jsxs("header",{className:w.cn(te.bar,te[p],u&&te.centered,d&&te.sticky,m&&te.bordered,f&&te.safeArea,h),..._,children:[o.jsx("div",{className:te.leading,children:y}),e!=null&&e!==""&&o.jsx("h1",{className:te.title,"aria-live":"polite",children:e}),o.jsx("div",{className:te.actions,children:c})]})}const jt={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Sr=["xs","sm","md","lg","xl","2xl"];function Cr(e){let t="xs";for(const n of Sr)e>=jt[n]&&(t=n);return t}function ze(){const[e,t]=l.useState(()=>typeof window>"u"?0:window.innerWidth);l.useEffect(()=>{if(typeof window>"u")return;const a=()=>t(window.innerWidth);return a(),window.addEventListener("resize",a,{passive:!0}),()=>window.removeEventListener("resize",a)},[]);const n=Cr(e),s=a=>e>=jt[a],r=a=>e<jt[a];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const Er="tempest_shell_-xp0O",Tr="tempest_navbar_liTKV",Mr="tempest_row_PE41P",Rr="tempest_sidebar_wyx-V",Lr="tempest_main_O3GFv",Dr="tempest_footer_IFW4q",Pr="tempest_bottomNav_pKJ1v",Me={shell:Er,navbar:Tr,row:Mr,sidebar:Rr,main:Lr,footer:Dr,bottomNav:Pr};function Ar({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:a,children:i,...c}){const d=ze().above(r);return o.jsxs("div",{className:w.cn(Me.shell,a),...c,children:[e&&o.jsx("div",{className:Me.navbar,children:e}),o.jsxs("div",{className:Me.row,children:[t&&d&&o.jsx("div",{className:Me.sidebar,children:t}),o.jsx("main",{className:Me.main,children:i})]}),s&&o.jsx("div",{className:Me.footer,children:s}),n&&!d&&o.jsx("div",{className:Me.bottomNav,children:n})]})}const Ir="tempest_aspect_GnAJt",Fr={aspect:Ir};function Or({ratio:e=16/9,className:t,style:n,children:s,...r}){const a={aspectRatio:String(e),...n};return o.jsx("div",{className:w.cn(Fr.aspect,t),style:a,...r,children:s})}const Br="tempest_avatar_3xMuZ",zr="tempest_image_ieqGp",Wr="tempest_xs_oSaLL",qr="tempest_sm_sZ2bk",Ur="tempest_md_Fdkbz",Kr="tempest_lg_pTTUA",Hr="tempest_xl_mW58F",Gr="tempest_status_ISBnL",Qr="tempest_dot_Wgfo-",Jr="tempest_online_-aWoW",Yr="tempest_offline_-StX3",Xr="tempest_busy_TbwuF",qe={avatar:Br,image:zr,xs:Wr,sm:qr,md:Ur,lg:Kr,xl:Hr,status:Gr,dot:Qr,online:Jr,offline:Yr,busy:Xr};function Vr(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 Zr({src:e,alt:t,name:n="",size:s="md",status:r,className:a,onClick:i}){const[c,u]=l.useState(!1),d=l.useMemo(()=>Vr(n),[n]),p=e&&!c,m=i?"button":void 0,f=i?0:void 0;return o.jsxs("span",{className:w.cn(qe.avatar,qe[s],r&&qe.status,a),role:m,tabIndex:f,onClick:i,onKeyDown:i?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i())}:void 0,children:[p?o.jsx("img",{src:e,alt:t??n,className:qe.image,onError:()=>u(!0)}):o.jsx("span",{"aria-label":t??n,children:d}),r&&o.jsx("span",{className:w.cn(qe.dot,qe[r]),"aria-hidden":!0})]})}const eo="tempest_badge_RsuMz",to="tempest_sm_LYsCn",no="tempest_md_4Or8q",so="tempest_lg_Bseje",ro="tempest_square_l63D-",oo="tempest_neutral_lulSm",ao="tempest_solid_0Leug",io="tempest_outline_x06HL",co="tempest_success_u9JiS",lo="tempest_warning_nsGp-",uo="tempest_danger_PD2hz",po="tempest_info_na6DQ",mo="tempest_primary_S0WCS",fo="tempest_dot_i0c-G",Re={badge:eo,sm:to,md:no,lg:so,square:ro,neutral:oo,solid:ao,outline:io,success:co,warning:lo,danger:uo,info:po,primary:mo,dot:fo};function ho({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:a,children:i,...c}){return o.jsxs("span",{className:w.cn(Re.badge,Re[e],t==="solid"&&Re.solid,t==="outline"&&Re.outline,Re[n],s==="square"&&Re.square,a),...c,children:[r&&o.jsx("span",{className:Re.dot,"aria-hidden":!0}),i]})}const _o="tempest_banner_oyoWE",go="tempest_info_s2q0P",bo="tempest_success_uLYQ3",yo="tempest_warning_9rua8",vo="tempest_danger_Uzb-6",xo="tempest_icon_vzKmx",wo="tempest_body_-Qm4K",jo="tempest_title_AeTHT",$o="tempest_description_nbyf-",ko="tempest_action_47P8e",No="tempest_close_Iy2oN",Ne={banner:_o,info:go,success:bo,warning:yo,danger:vo,icon:xo,body:wo,title:jo,description:$o,action:ko,close:No};function So({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:a,className:i,children:c,...u}){const[d,p]=l.useState(!0);return d?o.jsxs("div",{className:w.cn(Ne.banner,Ne[e],i),role:"status",...u,children:[t&&o.jsx("span",{className:Ne.icon,children:t}),o.jsxs("div",{className:Ne.body,children:[n&&o.jsx("p",{className:Ne.title,children:n}),c&&o.jsx("p",{className:Ne.description,children:c})]}),s&&o.jsx("div",{className:Ne.action,children:s}),r&&o.jsx("button",{type:"button",className:Ne.close,"aria-label":"Fechar",onClick:()=>{p(!1),a?.()},children:"×"})]}):null}const Co="tempest_bar_kp35Q",Eo="tempest_item_XfDIW",To="tempest_active_sK54f",Mo="tempest_iconWrap_yJ20b",Ro="tempest_icon_TAjtI",Lo="tempest_badge_-c3Do",Do="tempest_label_qJj3L",Le={bar:Co,item:Eo,active:To,iconWrap:Mo,icon:Ro,badge:Lo,label:Do};function Po({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...a}){return o.jsx("nav",{className:w.cn(Le.bar,r),"aria-label":"Navegação principal",...a,children:e.map(i=>{const c=i.key===t;return o.jsxs("button",{type:"button",className:w.cn(Le.item,c&&Le.active),"aria-current":c?"page":void 0,disabled:i.disabled,onClick:()=>n(i.key),children:[o.jsxs("span",{className:Le.iconWrap,children:[i.icon&&o.jsx("span",{className:Le.icon,children:i.icon}),i.badge!==void 0&&o.jsx("span",{className:Le.badge,children:i.badge})]}),s&&o.jsx("span",{className:Le.label,children:i.label})]},i.key)})})}const Ao="tempest_root_qXce2",Io="tempest_backdrop_WLqh0",Fo="tempest_sheet_Okz1P",Oo="tempest_handle_GWCoK",Bo="tempest_handleBar_XPPiI",zo="tempest_title_i5Vuc",Wo="tempest_body_bgDhJ",De={root:Ao,backdrop:Io,sheet:Fo,handle:Oo,handleBar:Bo,title:zo,body:Wo};function qo({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:a=!0,className:i,children:c,...u}){return l.useEffect(()=>{if(!e||!a)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,a,t]),l.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:Ve.createPortal(o.jsxs("div",{className:De.root,role:"dialog","aria-modal":"true",children:[o.jsx("div",{className:De.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),o.jsxs("div",{className:w.cn(De.sheet,i),...u,children:[s&&o.jsx("button",{type:"button",className:De.handle,"aria-label":"Arrastar para fechar",onClick:t,children:o.jsx("span",{className:De.handleBar})}),n&&o.jsx("div",{className:De.title,children:n}),o.jsx("div",{className:De.body,children:c})]})]}),document.body)}const Uo="tempest_nav_H4g6P",Ko="tempest_item_O4g3P",Ho="tempest_link_7WM67",Go="tempest_current_JdlcS",Qo="tempest_separator_zGWyJ",et={nav:Uo,item:Ko,link:Ho,current:Go,separator:Qo};function Jo({items:e,separator:t="/",className:n}){return o.jsx("nav",{"aria-label":"breadcrumb",className:w.cn(et.nav,n),children:e.map((s,r)=>{const a=r===e.length-1,i=!a&&(s.href||s.onClick);return o.jsxs(l.Fragment,{children:[o.jsx("span",{className:et.item,children:i?o.jsx("a",{href:s.href,onClick:c=>{s.onClick&&(c.preventDefault(),s.onClick())},className:et.link,children:s.label}):o.jsx("span",{"aria-current":a?"page":void 0,className:a?et.current:void 0,children:s.label})}),!a&&o.jsx("span",{className:et.separator,"aria-hidden":!0,children:t})]},r)})})}const Yo="tempest_button_2ZuB7",Xo="tempest_primary_s1sM6",Vo="tempest_secondary_R0waJ",Zo="tempest_danger_V4fX8",ea="tempest_success_w6qB6",ta="tempest_ghost_1KINV",na="tempest_soft_c3kzm",sa="tempest_outline_F5jq-",ra="tempest_link_Zt5hw",oa="tempest_xs_cF6m0",aa="tempest_sm_NhG0g",ia="tempest_md_hH4h3",ca="tempest_lg_2plQf",la="tempest_xl_nx4V0",ua="tempest_iconOnly_WCpTS",da="tempest_pill_lx8lt",pa="tempest_fullWidth_36oJT",ma="tempest_content_EKXmF",fa="tempest_loading_EQAt2",ha="tempest_hiddenText_hIiJ2",_a="tempest_spinner_ZExvW",ga="tempest_tempest-spin_UOSVC",ue={button:Yo,primary:Xo,secondary:Vo,danger:Zo,success:ea,ghost:ta,soft:na,outline:sa,link:ra,xs:oa,sm:aa,md:ia,lg:ca,xl:la,iconOnly:ua,pill:da,fullWidth:pa,content:ma,loading:fa,hiddenText:ha,spinner:_a,tempestSpin:ga};function Xe({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:a=!1,leftIcon:i,rightIcon:c,disabled:u,className:d,children:p,...m}){return o.jsxs("button",{className:w.cn(ue.button,ue[e],ue[t],r&&ue.iconOnly,a&&ue.pill,n&&ue.loading,s&&ue.fullWidth,d),disabled:u||n,...m,children:[n&&o.jsx("span",{className:ue.spinner,"aria-hidden":!0,children:o.jsx(ba,{})}),o.jsxs("span",{className:w.cn(ue.content,n&&ue.hiddenText),children:[i,p,c]})]})}function ba(){return o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const ya="tempest_card_Cb1o4",va="tempest_flat_LRpce",xa="tempest_raised_WmIqk",wa="tempest_elevated_5VEDw",ja="tempest_interactive_B8Tah",$a="tempest_padded_oOxwN",ka="tempest_flush_aiDZi",Na="tempest_header_PTXf2",Sa="tempest_title_mSgoo",Ca="tempest_body_W441Z",Ea="tempest_footer_Mu-JC",ne={card:ya,flat:va,raised:xa,elevated:wa,interactive:ja,padded:$a,flush:ka,header:Na,title:Sa,body:Ca,footer:Ea};function Ta({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:a="default",className:i,children:c,...u}){const d=!!(e||t);return o.jsxs("div",{className:w.cn(ne.card,a==="flat"&&ne.flat,a==="raised"&&ne.raised,a==="elevated"&&ne.elevated,r&&ne.interactive,!d&&!s&&ne.padded,s&&ne.flush,i),tabIndex:r?u.tabIndex??0:u.tabIndex,...u,children:[d&&o.jsxs("header",{className:ne.header,children:[typeof e=="string"?o.jsx("h3",{className:ne.title,children:e}):e,t]}),d?o.jsx("div",{className:ne.body,children:c}):c,n&&o.jsx("footer",{className:ne.footer,children:n})]})}const Ma="tempest_center_Pu1Pf",Ra="tempest_both_53GWn",La="tempest_horizontal_94-Bt",Da="tempest_vertical_Q7Kyg",nn={center:Ma,both:Ra,horizontal:La,vertical:Da};function Pa({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:a,...i}){const c={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return o.jsx("div",{className:w.cn(nn.center,nn[e],s),style:c,...i,children:a})}const Aa="tempest_wrapper_rpthW",Ia="tempest_disabled_x7-eg",Fa="tempest_input_2kt-h",Oa="tempest_box_OCPee",Ba="tempest_labelWrap_Ktbp0",za="tempest_label_cwRtI",Wa="tempest_description_rMhG1",Pe={wrapper:Aa,disabled:Ia,input:Fa,box:Oa,labelWrap:Ba,label:za,description:Wa},qa=l.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:a,className:i,...c},u){const d=l.useRef(null);l.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(m){d.current=m,typeof u=="function"?u(m):u&&(u.current=m)}return o.jsxs("label",{className:w.cn(Pe.wrapper,r&&Pe.disabled,a),children:[o.jsx("input",{ref:p,type:"checkbox",disabled:r,className:w.cn(Pe.input,i),...c}),o.jsx("span",{className:Pe.box,"aria-hidden":!0,children:s?o.jsx(Ka,{}):o.jsx(Ua,{})}),(t||n)&&o.jsxs("span",{className:Pe.labelWrap,children:[t&&o.jsx("span",{className:Pe.label,children:t}),n&&o.jsx("span",{className:Pe.description,children:n})]})]})});function Ua(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ka(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const Ha="tempest_wrapper_KR4-F",Ga="tempest_label_Mz-wX",Qa="tempest_field_iIBJw",Ja="tempest_error_O9n-9",Ya="tempest_chip_GEwrc",Xa="tempest_remove_JYDIq",Va="tempest_input_frJmk",Za="tempest_helper_Yts53",ei="tempest_errorText_llJGq",ye={wrapper:Ha,label:Ga,field:Qa,error:Ja,chip:Ya,remove:Xa,input:Va,helper:Za,errorText:ei};function ti({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:a,commitKeys:i=["Enter",",","Tab"],normalize:c=!0,className:u}){const[d,p]=l.useState(""),m=l.useRef(null);function f(){const v=c?d.trim().toLowerCase():d.trim();if(v){if(e.includes(v)){p("");return}t([...e,v]),p("")}}function h(v){if(i.includes(v.key)){v.preventDefault(),f();return}v.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function _(v){const y=e.slice();y.splice(v,1),t(y)}return o.jsxs("div",{className:w.cn(ye.wrapper,a&&ye.error,u),children:[n&&o.jsx("label",{className:ye.label,children:n}),o.jsxs("div",{className:ye.field,onClick:()=>m.current?.focus(),children:[e.map((v,y)=>o.jsxs("span",{className:ye.chip,children:[v,o.jsx("button",{type:"button",className:ye.remove,"aria-label":`Remover ${v}`,onClick:()=>_(y),children:"×"})]},`${v}-${y}`)),o.jsx("input",{ref:m,className:ye.input,value:d,placeholder:e.length===0?s:"",onChange:v=>p(v.target.value),onKeyDown:h,onBlur:f})]}),a?o.jsx("span",{className:ye.errorText,children:a}):r?o.jsx("span",{className:ye.helper,children:r}):null]})}const ni="tempest_wrapper_TNvle",si="tempest_label_KVkZO",ri="tempest_field_BenH0",oi="tempest_input_-HTv1",ai="tempest_caret_jRplQ",ii="tempest_menu_zPQG3",ci="tempest_option_vhhn5",li="tempest_active_XCgtX",ui="tempest_selected_T6nm2",di="tempest_empty_Ahw5K",pi="tempest_helper_OzB7V",mi="tempest_errorText_X18sQ",fi="tempest_error_bnVuM",U={wrapper:ni,label:si,field:ri,input:oi,caret:ai,menu:ii,option:ci,active:li,selected:ui,empty:di,helper:pi,errorText:mi,error:fi};function hi(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function _i({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:i,disabled:c,filter:u=hi,emptyMessage:d="Nenhuma opção encontrada",className:p}){const m=l.useId(),f=l.useRef(null),h=l.useRef(null),[_,v]=l.useState(!1),[y,g]=l.useState(""),[x,b]=l.useState(0),j=l.useMemo(()=>e.find(S=>S.value===t)?.label??"",[e,t]),k=l.useMemo(()=>e.filter(S=>u(S,y)),[e,u,y]),M=l.useCallback(()=>{v(!1),g(""),b(0)},[]),E=l.useCallback(S=>{S.disabled||(n(S.value),M())},[n,M]);l.useEffect(()=>{if(!_)return;const S=T=>{f.current&&!f.current.contains(T.target)&&M()};return window.addEventListener("mousedown",S),()=>window.removeEventListener("mousedown",S)},[_,M]);const N=S=>{if(S.key==="ArrowDown")S.preventDefault(),v(!0),b(T=>Math.min(k.length-1,T+1));else if(S.key==="ArrowUp")S.preventDefault(),b(T=>Math.max(0,T-1));else if(S.key==="Enter"){S.preventDefault();const T=k[x];T&&E(T)}else S.key==="Escape"&&M()};return o.jsxs("div",{ref:f,className:w.cn(U.wrapper,i&&U.error,p),children:[s&&o.jsx("label",{htmlFor:m,className:U.label,children:s}),o.jsxs("div",{className:U.field,children:[o.jsx("input",{id:m,ref:h,type:"text",role:"combobox","aria-expanded":_,"aria-controls":`${m}-listbox`,"aria-autocomplete":"list",className:U.input,placeholder:r,disabled:c,value:_?y:j,onFocus:()=>v(!0),onChange:S=>{g(S.target.value),v(!0),b(0)},onKeyDown:N}),o.jsx("span",{className:U.caret,"aria-hidden":!0,children:"▾"})]}),_&&o.jsx("ul",{id:`${m}-listbox`,role:"listbox",className:U.menu,children:k.length===0?o.jsx("li",{className:U.empty,children:d}):k.map((S,T)=>o.jsx("li",{role:"option","aria-selected":S.value===t,className:w.cn(U.option,T===x&&U.active,S.value===t&&U.selected),onMouseEnter:()=>b(T),onMouseDown:D=>{D.preventDefault(),E(S)},children:S.label},S.value))}),i?o.jsx("span",{className:U.errorText,children:i}):a?o.jsx("span",{className:U.helper,children:a}):null]})}const gi="tempest_overlay_dd9h1",bi="tempest_tempest-fade-in_DvgSp",yi="tempest_dialog_ptM-K",vi="tempest_tempest-modal-in_UoxQC",xi="tempest_sm_K5k3W",wi="tempest_md_gvyR7",ji="tempest_lg_BgB1a",$i="tempest_xl_MR-68",ki="tempest_size2xl_-PH9e",Ni="tempest_size3xl_iqDwN",Si="tempest_fullscreen_o84Xi",Ci="tempest_fullscreenOnMobile_0bDwe",Ei="tempest_body_lVhql",Ti="tempest_header_ILG9i",Mi="tempest_footer_rro2w",Ri="tempest_title_A5OeE",Li="tempest_close_-ER1C",V={overlay:gi,tempestFadeIn:bi,dialog:yi,tempestModalIn:vi,sm:xi,md:wi,lg:ji,xl:$i,size2Xl:ki,size3Xl:Ni,fullscreen:Si,fullscreenOnMobile:Ci,body:Ei,header:Ti,footer:Mi,title:Ri,close:Li};function Gt({open:e,onClose:t,title:n,children:s,footer:r,size:a="md",closeOnBackdrop:i=!0,closeOnEsc:c=!0,className:u,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:m=!1}){return l.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const h=_=>{c&&_.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",h)}},[e,c,t]),!e||typeof document>"u"?null:Ve.createPortal(o.jsx("div",{className:V.overlay,role:"presentation",onClick:()=>{i&&t()},children:o.jsxs("div",{role:"dialog","aria-modal":"true",className:w.cn(V.dialog,Di(a),p&&V.fullscreen,m&&V.fullscreenOnMobile,u),onClick:f=>f.stopPropagation(),children:[(n||!d)&&o.jsxs("header",{className:V.header,children:[o.jsx("h3",{className:V.title,children:n}),!d&&o.jsx("button",{type:"button",className:V.close,"aria-label":"Fechar",onClick:t,children:o.jsx(Pi,{})})]}),o.jsx("div",{className:V.body,children:s}),r&&o.jsx("footer",{className:V.footer,children:r})]})}),document.body)}function Di(e){return e==="2xl"?V.size2xl:e==="3xl"?V.size3xl:V[e]}function Pi(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Dn({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:a="primary",loading:i=!1,onConfirm:c,onCancel:u}){return o.jsx(Gt,{open:e,onClose:u,title:t,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(Xe,{variant:"secondary",onClick:u,disabled:i,children:r}),o.jsx(Xe,{variant:a,loading:i,onClick:()=>{c()},children:s})]}),children:n})}const Ai=l.forwardRef(function({value:t,onChange:n,mode:s="date",...r},a){return o.jsx(P.Input,{...r,ref:a,type:s,value:t,onChange:i=>n(i.target.value)})}),Ii="tempest_divider_KSGsi",Fi="tempest_horizontal_pZ05Y",Oi="tempest_bare_elDbS",Bi="tempest_vertical_p-jD4",zi="tempest_dashed_JWxCU",Wi="tempest_alignStart_QAIi1",qi="tempest_alignEnd_eZDwa",J={divider:Ii,horizontal:Fi,bare:Oi,vertical:Bi,dashed:zi,alignStart:Wi,alignEnd:qi};function Ui({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...a}){return e==="vertical"?o.jsx("span",{role:"separator","aria-orientation":"vertical",className:w.cn(J.divider,J.vertical,t==="dashed"&&J.dashed,r),...a}):n?o.jsx("div",{role:"separator","aria-orientation":"horizontal",className:w.cn(J.divider,J.horizontal,t==="dashed"&&J.dashed,s==="start"&&J.alignStart,s==="end"&&J.alignEnd,r),...a,children:n}):o.jsx("hr",{className:w.cn(J.divider,J.horizontal,J.bare,t==="dashed"&&J.dashed,r)})}const Ki="tempest_overlay_hcG1G",Hi="tempest_tempest-drawer-overlay_XFbxY",Gi="tempest_panel_wUX0N",Qi="tempest_right_-oX-6",Ji="tempest_tempest-drawer-in-right_pWYHv",Yi="tempest_left_xi3nD",Xi="tempest_tempest-drawer-in-left_o7JSb",Vi="tempest_top_7rGCn",Zi="tempest_tempest-drawer-in-top_kn6AF",ec="tempest_bottom_zd-25",tc="tempest_tempest-drawer-in-bottom_0x3u7",nc="tempest_handle_5B-TB",sc="tempest_handleTop_7aMf-",rc="tempest_header_sYoP1",oc="tempest_title_LqUOu",ac="tempest_close_tYPhU",ic="tempest_body_aV9FG",cc="tempest_footer_AuvUP",de={overlay:Ki,tempestDrawerOverlay:Hi,panel:Gi,right:Qi,tempestDrawerInRight:Ji,left:Yi,tempestDrawerInLeft:Xi,top:Vi,tempestDrawerInTop:Zi,bottom:ec,tempestDrawerInBottom:tc,handle:nc,handleTop:sc,header:rc,title:oc,close:ac,body:ic,footer:cc};function lc({open:e,onClose:t,placement:n="right",title:s,children:r,footer:a,closeOnBackdrop:i=!0,closeOnEsc:c=!0,hideCloseButton:u=!1,className:d,mobilePlacement:p,showHandle:m=!1}){const{isMobile:f}=ze(),h=f&&p?p:n;return l.useEffect(()=>{if(!e)return;const _=document.body.style.overflow;document.body.style.overflow="hidden";const v=y=>{c&&y.key==="Escape"&&t()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",v)}},[e,c,t]),!e||typeof document>"u"?null:Ve.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:de.overlay,onClick:()=>{i&&t()}}),o.jsxs("aside",{role:"dialog","aria-modal":"true",className:w.cn(de.panel,de[h],d),children:[m&&(h==="bottom"||h==="top")&&o.jsx("div",{className:w.cn(de.handle,h==="top"&&de.handleTop),"aria-hidden":!0}),(s||!u)&&o.jsxs("header",{className:de.header,children:[o.jsx("h3",{className:de.title,children:s}),!u&&o.jsx("button",{type:"button","aria-label":"Fechar",className:de.close,onClick:t,children:o.jsx(uc,{})})]}),o.jsx("div",{className:de.body,children:r}),a&&o.jsx("footer",{className:de.footer,children:a})]})]}),document.body)}function uc(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const dc="tempest_root_5ZetV",pc="tempest_menu_-RiRW",mc="tempest_bottomStart_z60h9",fc="tempest_bottomEnd_b1tmU",hc="tempest_topStart_A0em2",_c="tempest_topEnd_cFA5-",gc="tempest_item_T-QPZ",bc="tempest_active_WNqoX",yc="tempest_danger_C0jN3",vc="tempest_separator_RimQa",xc="tempest_label_6yP76",ie={root:dc,menu:pc,bottomStart:mc,bottomEnd:fc,topStart:hc,topEnd:_c,item:gc,active:bc,danger:yc,separator:vc,label:xc};function wc(e){switch(e){case"bottom-end":return ie.bottomEnd;case"top-start":return ie.topStart;case"top-end":return ie.topEnd;default:return ie.bottomStart}}function jc({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,a]=l.useState(!1),[i,c]=l.useState(-1),u=l.useId(),d=l.useRef(null),p=l.useRef([]),m=t.map((y,g)=>y.type==="item"&&!y.disabled?g:-1).filter(y=>y!==-1),f=l.useCallback(()=>{a(!1),c(-1)},[]);l.useEffect(()=>{if(!r)return;const y=x=>{if(x.key==="Escape"){f();return}if(x.key==="ArrowDown"){x.preventDefault();const b=m.indexOf(i),j=m[(b+1)%m.length]??-1;c(j),p.current[j]?.focus()}if(x.key==="ArrowUp"){x.preventDefault();const b=m.indexOf(i),j=m[(b-1+m.length)%m.length]??-1;c(j),p.current[j]?.focus()}},g=x=>{d.current&&!d.current.contains(x.target)&&f()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[r,i,m,f]);const h=y=>{e.props.onClick?.(y),a(g=>!g)},_={...e,props:{...e.props,onClick:h,"aria-expanded":r,"aria-controls":u,"aria-haspopup":"menu"}},v=y=>{y.onSelect(),f()};return o.jsxs("span",{ref:d,className:ie.root,children:[_,r&&o.jsx("ul",{id:u,role:"menu",className:w.cn(ie.menu,wc(n),s),children:t.map((y,g)=>y.type==="separator"?o.jsx("li",{role:"separator",className:ie.separator,"aria-hidden":!0},y.id):y.type==="label"?o.jsx("li",{role:"presentation",className:ie.label,children:y.label},y.id):o.jsx("li",{role:"none",children:o.jsxs("button",{ref:x=>{p.current[g]=x},type:"button",role:"menuitem",className:w.cn(ie.item,y.danger&&ie.danger,i===g&&ie.active),disabled:y.disabled,onClick:()=>v(y),onMouseEnter:()=>c(g),children:[y.icon&&o.jsx("span",{"aria-hidden":!0,children:y.icon}),y.label]})},y.id))})]})}const $c="tempest_zone_u04pu",kc="tempest_dragging_uGtl4",Nc="tempest_disabled_GTKfV",Sc="tempest_input_qhJ1u",Cc="tempest_prompt_mlpWz",tt={zone:$c,dragging:kc,disabled:Nc,input:Sc,prompt:Cc};function Ec({onDrop:e,accept:t,multiple:n=!0,disabled:s=!1,maxSize:r,onReject:a,children:i,className:c}){const u=l.useRef(null),[d,p]=l.useState(!1),m=x=>{if(!x||x.length===0)return;const b=Array.from(x),j=n?b:b.slice(0,1);if(r===void 0){e(j);return}const k=[],M=[];for(const E of j)E.size>r?M.push(E):k.push(E);M.length>0&&a?.(M),k.length>0&&e(k)},f=()=>{s||u.current?.click()},h=x=>{x.preventDefault(),!s&&p(!0)},_=x=>{x.preventDefault()},v=x=>{x.preventDefault(),p(!1)},y=x=>{x.preventDefault(),p(!1),!s&&m(x.dataTransfer.files)},g=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),f())};return o.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,className:w.cn(tt.zone,d&&tt.dragging,s&&tt.disabled,c),onClick:f,onKeyDown:g,onDragEnter:h,onDragOver:_,onDragLeave:v,onDrop:y,children:[o.jsx("input",{ref:u,type:"file",className:tt.input,accept:t,multiple:n,disabled:s,onChange:x=>{m(x.target.files),x.target.value=""}}),i??o.jsx("span",{className:tt.prompt,children:"Arraste arquivos aqui ou clique para selecionar"})]})}const Tc="tempest_wrapper_gzyTd",Mc="tempest_icon_qVCyh",Rc="tempest_title_xPfUf",Lc="tempest_description_oWwH1",Dc="tempest_action_dqxw1",nt={wrapper:Tc,icon:Mc,title:Rc,description:Lc,action:Dc};function Pc({icon:e,title:t,description:n,action:s,className:r}){return o.jsxs("div",{className:w.cn(nt.wrapper,r),children:[e&&o.jsx("div",{className:nt.icon,children:e}),o.jsx("h4",{className:nt.title,children:t}),n&&o.jsx("p",{className:nt.description,children:n}),s&&o.jsx("div",{className:nt.action,children:s})]})}const Ac="tempest_wrapper_luRyF",Ic="tempest_icon_dEdBl",Fc="tempest_title_StutD",Oc="tempest_description_A2XCb",Bc="tempest_action_vm1LC",st={wrapper:Ac,icon:Ic,title:Fc,description:Oc,action:Bc};function zc({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:a}){return o.jsxs("div",{className:w.cn(st.wrapper,a),children:[o.jsx("div",{className:st.icon,children:r??o.jsx(Wc,{})}),o.jsx("h4",{className:st.title,children:e}),t&&o.jsx("p",{className:st.description,children:t}),n&&o.jsx("div",{className:st.action,children:o.jsx(Xe,{variant:"secondary",onClick:n,children:s})})]})}function Wc(){return o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:o.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 qc="tempest_wrapper_E0qHs",Uc="tempest_label_lbMkx",Kc="tempest_dropzone_jqua0",Hc="tempest_active_CG9Uk",Gc="tempest_disabled_WNUUl",Qc="tempest_icon_i9fGH",Jc="tempest_title_bTVFl",Yc="tempest_subtitle_S54OV",Xc="tempest_files_WljYm",Vc="tempest_file_Lp-dR",Zc="tempest_fileMeta_LTnN2",el="tempest_remove_jskra",tl="tempest_hidden_ReEq6",K={wrapper:qc,label:Uc,dropzone:Kc,active:Hc,disabled:Gc,icon:Qc,title:Jc,subtitle:Yc,files:Xc,file:Vc,fileMeta:Zc,remove:el,hidden:tl};function nl(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function sl(e,t){if(!t)return!0;const n=t.split(",").map(a=>a.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(a=>a.startsWith(".")?s.endsWith(a):a.endsWith("/*")?r.startsWith(a.replace("/*","/")):r===a)}function rl({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:a,onReject:i,disabled:c,title:u="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[m,f]=l.useState(!1),h=l.useRef(null);function _(g){const x=[],b=[];for(const k of Array.from(g)){if(!sl(k,s)){b.push({file:k,reason:"type"});continue}if(a&&k.size>a){b.push({file:k,reason:"size"});continue}x.push(k)}if(b.length>0&&i?.(b),x.length===0)return;const j=r?[...e,...x]:x.slice(0,1);t(j)}function v(g){g.preventDefault(),f(!1),!c&&g.dataTransfer?.files&&_(g.dataTransfer.files)}function y(g){const x=e.slice();x.splice(g,1),t(x)}return o.jsxs("div",{className:w.cn(K.wrapper,p),children:[n&&o.jsx("label",{className:K.label,children:n}),o.jsxs("div",{className:w.cn(K.dropzone,m&&K.active,c&&K.disabled),role:"button",tabIndex:c?-1:0,onClick:()=>!c&&h.current?.click(),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h.current?.click())},onDragEnter:g=>{g.preventDefault(),c||f(!0)},onDragOver:g=>g.preventDefault(),onDragLeave:()=>f(!1),onDrop:v,children:[o.jsx("div",{className:K.icon,"aria-hidden":!0,children:o.jsx(ol,{})}),o.jsx("p",{className:K.title,children:u}),d&&o.jsx("p",{className:K.subtitle,children:d}),o.jsx("input",{ref:h,type:"file",accept:s,multiple:r,disabled:c,className:K.hidden,onChange:g=>{g.target.files&&_(g.target.files),g.target.value=""}})]}),e.length>0&&o.jsx("ul",{className:K.files,children:e.map((g,x)=>o.jsxs("li",{className:K.file,children:[o.jsxs("div",{children:[o.jsx("div",{children:g.name}),o.jsx("div",{className:K.fileMeta,children:nl(g.size)})]}),o.jsx("button",{type:"button","aria-label":`Remover ${g.name}`,className:K.remove,onClick:()=>y(x),children:"×"})]},`${g.name}-${x}`))})]})}function ol(){return o.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const al="tempest_form_jNBDR",il="tempest_stack_O1Hl-",cl="tempest_inline_LBQAv",ll="tempest_grid_-B86T",ul="tempest_section_HGqw3",dl="tempest_sectionHeader_ji9hQ",pl="tempest_sectionTitle_GTPwe",ml="tempest_sectionDescription_KjW7k",fl="tempest_sectionBody_Vp2wz",hl="tempest_row_1EkVR",_l="tempest_actions_hK95I",gl="tempest_start_gXnm3",bl="tempest_center_mKkz4",yl="tempest_end_O3yDQ",vl="tempest_between_tte2z",ce={form:al,stack:il,inline:cl,grid:ll,section:ul,sectionHeader:dl,sectionTitle:pl,sectionDescription:ml,sectionBody:fl,row:hl,actions:_l,start:gl,center:bl,end:yl,between:vl};function Nt(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function Pn(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const xl=l.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:a,children:i,...c},u){const d={gap:Nt(s,4),...t==="grid"?{gridTemplateColumns:Pn(n)}:null,...a};return o.jsx("form",{ref:u,className:w.cn(ce.form,ce[t],r),style:d,...c,children:i})});function wl({title:e,description:t,layout:n="stack",columns:s,gap:r,className:a,style:i,children:c,...u}){const d={gap:Nt(r,4),...n==="grid"?{gridTemplateColumns:Pn(s)}:null};return o.jsxs("section",{className:w.cn(ce.section,a),style:i,...u,children:[(e||t)&&o.jsxs("header",{className:ce.sectionHeader,children:[e&&o.jsx("h3",{className:ce.sectionTitle,children:e}),t&&o.jsx("p",{className:ce.sectionDescription,children:t})]}),o.jsx("div",{className:w.cn(ce.sectionBody,ce[n]),style:d,children:c})]})}function jl({gap:e,className:t,style:n,children:s,...r}){const a={gap:Nt(e,3),...n};return o.jsx("div",{className:w.cn(ce.row,t),style:a,...r,children:s})}function $l({align:e="end",gap:t,className:n,style:s,children:r,...a}){const i={gap:Nt(t,2),...s};return o.jsx("div",{className:w.cn(ce.actions,ce[e],n),style:i,...a,children:r})}const kl="tempest_container_fJfOt",Nl="tempest_sm_k8D4-",Sl="tempest_md_EnpYy",Cl="tempest_lg_UU-Ig",El="tempest_xl_2TEWj",Tl="tempest_full_l8bvG",Ml="tempest_stack_sxR8u",Rl="tempest_vertical_2TMf5",Ll="tempest_horizontal_r7-c-",Dl="tempest_center_EDSAh",Pl="tempest_start_ucQ-K",Al="tempest_end_pnKlF",Il="tempest_stretch_pX6l7",Fl="tempest_justifyStart_lHYsS",Ol="tempest_justifyCenter_JH2m6",Bl="tempest_justifyEnd_EBisT",zl="tempest_justifyBetween_mAJwT",Wl="tempest_wrap_-xxOh",ql="tempest_grid_o-JIX",Z={container:kl,sm:Nl,md:Sl,lg:Cl,xl:El,full:Tl,stack:Ml,vertical:Rl,horizontal:Ll,center:Dl,start:Pl,end:Al,stretch:Il,justifyStart:Fl,justifyCenter:Ol,justifyEnd:Bl,justifyBetween:zl,wrap:Wl,grid:ql};function Ul({size:e="lg",className:t,children:n,...s}){return o.jsx("div",{className:w.cn(Z.container,Z[e],t),...s,children:n})}function Kl(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function $t(e,t){if(e!==void 0)return Kl(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function An(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function In(e,t){return e?"mobile":t?"tablet":"desktop"}function Hl({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:a,style:i,children:c,...u}){const{isMobile:d,isTablet:p}=ze(),m=In(d,p),f=$t(e,m)??"vertical",_={gap:An($t(t,m)),...i},v=s==="between"?Z.justifyBetween:s==="center"?Z.justifyCenter:s==="end"?Z.justifyEnd:s==="start"?Z.justifyStart:void 0;return o.jsx("div",{className:w.cn(Z.stack,f==="vertical"?Z.vertical:Z.horizontal,n&&Z[n],v,r&&Z.wrap,a),style:_,...u,children:c})}function Gl(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function Ql({columns:e=2,gap:t=4,className:n,style:s,children:r,...a}){const{isMobile:i,isTablet:c}=ze(),u=In(i,c),d=Gl($t(e,u)),p=An($t(t,u));return o.jsx("div",{className:w.cn(Z.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...a,children:r})}function sn(){if(typeof window>"u")return!1;const t=["standalone","fullscreen","minimal-ui"].some(s=>window.matchMedia?.(`(display-mode: ${s})`)?.matches),n=window.navigator.standalone===!0;return t||n}function Qt(){const[e,t]=l.useState(null),[n,s]=l.useState(!1),[r,a]=l.useState(sn);l.useEffect(()=>{if(typeof window>"u")return;const c=m=>{m.preventDefault(),t(m)},u=()=>{t(null),s(!0),a(!0)},d=window.matchMedia?.("(display-mode: standalone)"),p=()=>a(sn());return window.addEventListener("beforeinstallprompt",c),window.addEventListener("appinstalled",u),d?.addEventListener("change",p),()=>{window.removeEventListener("beforeinstallprompt",c),window.removeEventListener("appinstalled",u),d?.removeEventListener("change",p)}},[]);const i=l.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const c=await e.userChoice;return t(null),c.outcome==="accepted"&&s(!0),c.outcome},[e]);return{installable:!!e,installed:n,isStandalone:r,prompt:i}}const Jl="tempest_banner_0oCIc",Yl="tempest_icon_izjRL",Xl="tempest_body_9JAQv",Vl="tempest_title_1E50X",Zl="tempest_description_QY25-",eu="tempest_close_RN6FO",Ue={banner:Jl,icon:Yl,body:Xl,title:Vl,description:Zl,close:eu};function tu(e){if(!e||typeof window>"u")return!1;try{return window.localStorage.getItem(e)==="1"}catch{return!1}}function nu({title:e="Instale o app",description:t,installLabel:n="Instalar",dismissLabel:s="Dispensar",icon:r,storageKey:a,onResult:i,className:c}){const{installable:u,installed:d,isStandalone:p,prompt:m}=Qt(),[f,h]=l.useState(()=>tu(a));if(!u||d||p||f)return null;const _=()=>{if(h(!0),a&&typeof window<"u")try{window.localStorage.setItem(a,"1")}catch{}};return o.jsxs("div",{className:w.cn(Ue.banner,c),role:"region","aria-label":String(e),children:[r&&o.jsx("span",{className:Ue.icon,children:r}),o.jsxs("div",{className:Ue.body,children:[o.jsx("p",{className:Ue.title,children:e}),t&&o.jsx("p",{className:Ue.description,children:t})]}),o.jsx(Xe,{size:"sm",onClick:async()=>{i?.(await m())},children:n}),o.jsx("button",{type:"button",className:Ue.close,"aria-label":s,onClick:_,children:o.jsx(Ln.X,{size:18,"aria-hidden":!0})})]})}function su({label:e="Instalar app",onResult:t,...n}){const{installable:s,installed:r,isStandalone:a,prompt:i}=Qt();return!s||r||a?null:o.jsx(Xe,{onClick:async()=>{t?.(await i())},...n,children:e})}const ru="tempest_kbd_jgbYx",ou="tempest_sm_9WPWA",au="tempest_md_BePC0",iu="tempest_lg_cBKum",rn={kbd:ru,sm:ou,md:au,lg:iu};function cu({size:e="md",className:t,children:n,...s}){return o.jsx("kbd",{className:w.cn(rn.kbd,rn[e],t),...s,children:n})}const lu="tempest_stack_zYzdv",uu={stack:lu},Fn=l.createContext(null);function du({children:e}){const[t,n]=l.useState([]),s=l.useRef(0),r=l.useCallback(()=>(s.current+=1,`modal-${s.current}`),[]),a=l.useCallback(p=>{n(m=>m.filter(f=>f.id!==p))},[]),i=l.useCallback(()=>{n([])},[]),c=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"content",id:m,options:p}]),m},[r]),u=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"confirm",id:m,options:p}]),m},[r]),d=l.useMemo(()=>({open:c,confirm:u,close:a,closeAll:i}),[c,u,a,i]);return o.jsxs(Fn.Provider,{value:d,children:[e,o.jsx("div",{className:uu.stack,children:t.map(p=>p.kind==="content"?o.jsx(pu,{entry:p,close:a},p.id):o.jsx(mu,{entry:p,close:a},p.id))})]})}function pu({entry:e,close:t}){const{options:n,id:s}=e,r=()=>{n.onClose?.(),t(s)};return o.jsx(Gt,{open:!0,onClose:r,title:n.title,size:n.size,closeOnBackdrop:n.closeOnBackdrop,closeOnEsc:n.closeOnEsc,hideCloseButton:n.hideCloseButton,children:n.children})}function mu({entry:e,close:t}){const{options:n,id:s}=e,[r,a]=l.useState(!1),i=async()=>{try{a(!0),await n.onConfirm?.()}finally{a(!1),t(s)}},c=()=>{n.onCancel?.(),t(s)};return o.jsx(Dn,{open:!0,title:n.title??"",description:n.message,confirmLabel:n.confirmLabel,cancelLabel:n.cancelLabel,variant:n.danger?"danger":"primary",loading:r,onConfirm:i,onCancel:c})}function fu(){const e=l.useContext(Fn);if(e===null)throw new Error("useModals must be used within a <ModalsProvider>");return e}const hu="tempest_navbar_Ey25T",_u="tempest_surface_xyKhM",gu="tempest_primary_w3ft-",bu="tempest_transparent_N1vMR",yu="tempest_bordered_HD49R",vu="tempest_sticky_0XsOs",xu="tempest_logo_O9j3q",wu="tempest_nav_0oisE",ju="tempest_actions_8BNWJ",Ae={navbar:hu,surface:_u,primary:gu,transparent:bu,bordered:yu,sticky:vu,logo:xu,nav:wu,actions:ju};function $u({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:a=!0,className:i,...c}){return o.jsxs("header",{className:w.cn(Ae.navbar,Ae[r],s&&Ae.sticky,a&&Ae.bordered,i),...c,children:[e&&o.jsx("div",{className:Ae.logo,children:e}),t&&o.jsx("nav",{className:Ae.nav,children:t}),n&&o.jsx("div",{className:Ae.actions,children:n})]})}const ku="tempest_bar_zxTqx",Nu={bar:ku},Su=300,on=.9,Cu=300;function an(e){return e<0?0:e>1?1:e}function Eu(){let e={value:0,active:!1};const t=new Set;let n=null,s=null;const r=()=>{for(const h of t)h(e)},a=h=>{e={...e,...h},r()},i=()=>{n!==null&&(clearInterval(n),n=null)},c=()=>{s!==null&&(clearTimeout(s),s=null)},u=h=>{const _=e.value;if(_>=on)return;const v=h??(1-_)*.1+.01;a({value:Math.min(an(_+v),on)})};return{start:()=>{c(),!e.active&&(a({active:!0,value:e.value>0?e.value:.08}),i(),n=setInterval(()=>u(),Su))},done:()=>{i(),c(),a({value:1,active:!0}),s=setTimeout(()=>{a({active:!1,value:0}),s=null},Cu)},set:h=>{c();const _=an(h);a({value:_,active:_<1?!0:e.active})},inc:u,subscribe:h=>(t.add(h),h(e),()=>{t.delete(h)})}}const On=Eu();function Tu({color:e,height:t=3,className:n}){const[s,r]=l.useState({value:0,active:!1});if(l.useEffect(()=>On.subscribe(r),[]),!s.active)return null;const a={width:`${Math.round(s.value*100)}%`,height:`${t}px`,background:e??"var(--tempest-primary)"};return o.jsx("div",{className:w.cn(Nu.bar,n),style:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s.value*100)})}const Mu="tempest_page_THNNc",Ru="tempest_padded_bzjoF",Lu="tempest_header_PZEzk",Du="tempest_headerText_qYXFI",Pu="tempest_eyebrow_651RV",Au="tempest_title_2oGnT",Iu="tempest_description_YzmWl",Fu="tempest_actions_-rB3U",Ou="tempest_toolbar_sA7sD",Bu="tempest_content_RCB4b",zu="tempest_footer_540pQ",se={page:Mu,padded:Ru,header:Lu,headerText:Du,eyebrow:Pu,title:Au,description:Iu,actions:Fu,toolbar:Ou,content:Bu,footer:zu};function Wu({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:a,padded:i=!0,className:c,children:u,...d}){const p=e||t||n||s;return o.jsxs("main",{className:w.cn(se.page,i&&se.padded,c),...d,children:[p&&o.jsxs("header",{className:se.header,children:[o.jsxs("div",{className:se.headerText,children:[t&&o.jsx("div",{className:se.eyebrow,children:t}),e&&o.jsx("h1",{className:se.title,children:e}),n&&o.jsx("p",{className:se.description,children:n})]}),s&&o.jsx("div",{className:se.actions,children:s})]}),r&&o.jsx("div",{className:se.toolbar,children:r}),o.jsx("div",{className:se.content,children:u}),a&&o.jsx("footer",{className:se.footer,children:a})]})}const qu="tempest_wrapper_cRGQm",Uu="tempest_controls_fdL-y",Ku="tempest_page_WjG0l",Hu="tempest_active_1kqsJ",Gu="tempest_ellipsis_V294k",Qu="tempest_sizeSelect_ZayTo",Ju="tempest_numeric_ztI0I",Yu="tempest_summary_ZTggV",re={wrapper:qu,controls:Uu,page:Ku,active:Hu,ellipsis:Gu,sizeSelect:Qu,numeric:Ju,summary:Yu};function Xu(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(c,u)=>u+1);const r=Math.max(2,e-Math.floor(n/2)),a=Math.min(t-1,r+n-1),i=[1];r>2&&i.push("...");for(let c=r;c<=a;c++)i.push(c);return a<t-1&&i.push("..."),i.push(t),i}function Bn({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:a=[10,25,50,100],totalItems:i,siblingCount:c=3,className:u}){const d=l.useMemo(()=>Xu(e,t,c),[e,t,c]);return t<=1&&!r?null:o.jsxs("div",{className:w.cn(re.wrapper,u),children:[o.jsx("div",{className:re.summary,children:typeof i=="number"?`${i} resultado${i===1?"":"s"}`:`Página ${e} de ${t}`}),o.jsxs("div",{className:re.controls,children:[o.jsx("button",{type:"button",className:re.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,m)=>p==="..."?o.jsx("span",{className:w.cn(re.ellipsis,re.numeric),children:"…"},`ellipsis-${m}`):o.jsx("button",{type:"button",className:w.cn(re.page,re.numeric,p===e&&re.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),o.jsx("button",{type:"button",className:re.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&o.jsx("select",{className:re.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:a.map(p=>o.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const Vu="tempest_wrapper_zEU-L",Zu="tempest_label_ps3gD",ed="tempest_field_7taZG",td="tempest_input_FWEvb",nd="tempest_sm_3-CZz",sd="tempest_md_ReV0O",rd="tempest_lg_DiTiB",od="tempest_toggle_WNeX9",ad="tempest_error_QdIFf",id="tempest_helper_mBUna",cd="tempest_errorText_73Uvv",ld="tempest_strength_i6RaQ",ud="tempest_strengthBar_PAPHR",dd="tempest_strengthLabel_u9QHS",pd="tempest_level0_n6tWv",md="tempest_level1_FOI93",fd="tempest_level2_q5Wii",hd="tempest_level3_BpB53",_d="tempest_level4_vyQ3x",H={wrapper:Vu,label:Zu,field:ed,input:td,sm:nd,md:sd,lg:rd,toggle:od,error:ad,helper:id,errorText:cd,strength:ld,strengthBar:ud,strengthLabel:dd,level0:pd,level1:md,level2:fd,level3:hd,level4:_d},gd=["Muito fraca","Fraca","Razoável","Forte","Excelente"];function zn(e){if(!e)return 0;let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^A-Za-z0-9]/.test(e)&&(t+=1),Math.min(4,t)}const bd=l.forwardRef(function({label:t,helperText:n,error:s,size:r="md",showStrength:a=!1,strength:i,strengthLabels:c=gd,toggleLabels:u={show:"Mostrar senha",hide:"Esconder senha"},className:d,value:p,defaultValue:m,...f},h){const[_,v]=l.useState(!1),y=String(p??m??""),g=i??zn(y);return o.jsxs("div",{className:w.cn(H.wrapper,H[r],s&&H.error,d),children:[t&&o.jsx("label",{className:H.label,children:t}),o.jsxs("div",{className:H.field,children:[o.jsx("input",{ref:h,...f,value:p,defaultValue:m,type:_?"text":"password","aria-invalid":!!s,className:H.input}),o.jsx("button",{type:"button",className:H.toggle,"aria-label":_?u.hide:u.show,"aria-pressed":_,onClick:()=>v(x=>!x),children:_?"🙈":"👁"})]}),a&&o.jsxs("div",{className:w.cn(H.strength,H[`level${g}`]),"aria-label":c[g],children:[o.jsx("div",{className:H.strengthBar,children:o.jsx("span",{style:{width:`${g/4*100}%`}})}),o.jsx("span",{className:H.strengthLabel,children:c[g]})]}),s?o.jsx("span",{className:H.errorText,children:s}):n?o.jsx("span",{className:H.helper,children:n}):null]})}),yd="tempest_wrapper_3WAh7",vd="tempest_label_Hk01i",xd="tempest_cells_URO3v",wd="tempest_cell_fxLzs",jd="tempest_sm_SQM-s",$d="tempest_md_aHCGl",kd="tempest_lg_JpI4A",Nd="tempest_error_Kou0o",Sd="tempest_helper_W04iL",Cd="tempest_errorText_h4svq",Se={wrapper:yd,label:vd,cells:xd,cell:wd,sm:jd,md:$d,lg:kd,error:Nd,helper:Sd,errorText:Cd},Ed=/[0-9]/,Td=/[A-Za-z0-9]/,Md=l.forwardRef(function({length:t=6,type:n="numeric",size:s="md",value:r,defaultValue:a,onChange:i,onComplete:c,masked:u=!1,label:d,helperText:p,error:m,disabled:f=!1,autoFocus:h=!1,id:_,className:v},y){const g=l.useId(),x=_??g,b=r!==void 0,[j,k]=l.useState(a??""),M=b?r??"":j,E=Array.from({length:t},(L,R)=>M[R]??""),N=l.useRef([]),S=n==="numeric"?Ed:Td;l.useEffect(()=>{h&&N.current[0]?.focus()},[h]);const T=L=>{const R=L.slice(0,t);b||k(R),i?.(R),R.length===t&&c?.(R)},D=L=>{const R=Math.max(0,Math.min(t-1,L));N.current[R]?.focus(),N.current[R]?.select()},$=L=>R=>{const W=R.target.value.slice(-1);if(W&&!S.test(W))return;const We=E.slice();We[L]=W,T(We.join("")),W&&D(L+1)},C=L=>R=>{if(R.key==="Backspace"){if(!E[L]&&L>0){R.preventDefault();const W=E.slice();W[L-1]="",T(W.join("")),D(L-1)}}else R.key==="ArrowLeft"?(R.preventDefault(),D(L-1)):R.key==="ArrowRight"&&(R.preventDefault(),D(L+1))},I=L=>{const R=L.clipboardData.getData("text").split("").filter(W=>S.test(W)).join("");R&&(L.preventDefault(),T(R),D(Math.min(t-1,R.length)))};return o.jsxs("div",{ref:y,className:w.cn(Se.wrapper,m&&Se.error,v),id:x,children:[d&&o.jsx("label",{className:Se.label,children:d}),o.jsx("div",{className:w.cn(Se.cells,Se[s]),role:"group","aria-label":d,children:E.map((L,R)=>o.jsx("input",{ref:W=>{N.current[R]=W},type:u?"password":"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:R===0?"one-time-code":"off",maxLength:1,value:L,disabled:f,className:Se.cell,"aria-label":`Dígito ${R+1}`,"aria-invalid":!!m,onChange:$(R),onKeyDown:C(R),onPaste:I},R))}),m?o.jsx("span",{className:Se.errorText,children:m}):p?o.jsx("span",{className:Se.helper,children:p}):null]})}),Rd="tempest_root_vEMon",Ld="tempest_popover_E9K9X",Dd="tempest_tempest-popover-in_W8miP",Pd="tempest_top_TYlrh",Ad="tempest_bottom_wGs70",Id="tempest_left_h7fCr",Fd="tempest_right_--bJW",Ct={root:Rd,popover:Ld,tempestPopoverIn:Dd,top:Pd,bottom:Ad,left:Id,right:Fd};function Od({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:a=!1,closeOnEsc:i=!0,closeOnOutsideClick:c=!0,className:u}){const d=s!==void 0,[p,m]=l.useState(a),f=d?s:p,h=l.useId(),_=l.useRef(null),v=l.useCallback(x=>{d||m(x),r?.(x)},[d,r]);l.useEffect(()=>{if(!f)return;const x=j=>{i&&j.key==="Escape"&&v(!1)},b=j=>{c&&_.current&&!_.current.contains(j.target)&&v(!1)};return window.addEventListener("keydown",x),window.addEventListener("mousedown",b),()=>{window.removeEventListener("keydown",x),window.removeEventListener("mousedown",b)}},[f,i,c,v]);const y=x=>{e.props.onClick?.(x),v(!f)},g={...e,props:{...e.props,onClick:y,"aria-expanded":f,"aria-controls":h}};return o.jsxs("span",{ref:_,className:Ct.root,children:[g,f&&o.jsx("div",{id:h,role:"dialog",className:w.cn(Ct.popover,Ct[n],u),children:t})]})}const Bd="tempest_wrapper_BQek1",zd="tempest_bar_uC-0x",Wd="tempest_fill_vmg7x",qd="tempest_success_gWJ8U",Ud="tempest_warning_DGkPO",Kd="tempest_danger_gfwHh",Hd="tempest_indeterminate_HojUj",Gd="tempest_tempest-progress-loop_0nEdF",Qd="tempest_label_qqHJM",Ke={wrapper:Bd,bar:zd,fill:Wd,success:qd,warning:Ud,danger:Kd,indeterminate:Hd,tempestProgressLoop:Gd,label:Qd};function Jd({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:a,className:i}){const c=s?0:Math.max(0,Math.min(100,e/t*100));return o.jsxs("div",{className:w.cn(Ke.wrapper,i),children:[(r||a)&&o.jsxs("div",{className:Ke.label,children:[a&&o.jsx("span",{children:a}),r&&!s&&o.jsxs("span",{children:[Math.round(c),"%"]})]}),o.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:w.cn(Ke.bar,s&&Ke.indeterminate),children:o.jsx("div",{className:w.cn(Ke.fill,n!=="primary"&&Ke[n]),style:{width:s?void 0:`${c}%`}})})]})}const Yd="tempest_wrapper_P-gFm",Xd="tempest_disabled_0-cna",Vd="tempest_input_7R8ZN",Zd="tempest_dot_P7ejP",ep="tempest_labelWrap_iQ1HR",tp="tempest_label_vAFIP",np="tempest_description_bEB8u",sp="tempest_group_oi329",rp="tempest_horizontal_1Ovgu",ke={wrapper:Yd,disabled:Xd,input:Vd,dot:Zd,labelWrap:ep,label:tp,description:np,group:sp,horizontal:rp},Wn=l.createContext(null),op=l.forwardRef(function({label:t,description:n,value:s,disabled:r,name:a,checked:i,onChange:c,wrapperClassName:u,className:d,...p},m){const f=l.useContext(Wn),h=f?.name??a,_=f?.disabled??r,v=f?f.value===s:i;function y(g){f&&f.onChange?.(s),c?.(g)}return o.jsxs("label",{className:w.cn(ke.wrapper,_&&ke.disabled,u),children:[o.jsx("input",{ref:m,type:"radio",name:h,value:s,checked:v,disabled:_,onChange:y,className:w.cn(ke.input,d),...p}),o.jsx("span",{className:ke.dot,"aria-hidden":!0}),(t||n)&&o.jsxs("span",{className:ke.labelWrap,children:[t&&o.jsx("span",{className:ke.label,children:t}),n&&o.jsx("span",{className:ke.description,children:n})]})]})});function ap({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:a=!1,className:i,children:c}){const u=l.useId(),d=s??u,[p,m]=l.useState(t),f=e!==void 0,h=f?e:p;function _(v){f||m(v),n?.(v)}return o.jsx(Wn.Provider,{value:{name:d,value:h,onChange:_,disabled:r},children:o.jsx("div",{role:"radiogroup",className:w.cn(ke.group,a&&ke.horizontal,i),children:c})})}const ip="tempest_wrapper_o1aOo",cp="tempest_label_jaBOA",lp="tempest_value_GKfOu",up="tempest_field_YxCzt",dp="tempest_track_j-2iy",pp="tempest_fill_1pbqj",mp="tempest_input_1MASw",fp="tempest_helper_uqxKu",ve={wrapper:ip,label:cp,value:lp,field:up,track:dp,fill:pp,input:mp,helper:fp};function hp({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:i,disabled:c=!1,formatValue:u,className:d}){const[p,m]=e,f=s-n,h=l.useMemo(()=>(p-n)/f*100,[p,n,f]),_=l.useMemo(()=>(m-n)/f*100,[m,n,f]),v=u?.(e)??`${p} – ${m}`,y=l.useCallback(x=>{const b=Math.min(Number(x.target.value),m);t([b,m])},[m,t]),g=l.useCallback(x=>{const b=Math.max(Number(x.target.value),p);t([p,b])},[p,t]);return o.jsxs("div",{className:w.cn(ve.wrapper,d),children:[a&&o.jsxs("div",{className:ve.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:ve.value,children:v})]}),o.jsxs("div",{className:ve.field,children:[o.jsx("div",{className:ve.track}),o.jsx("div",{className:ve.fill,style:{left:`${h}%`,right:`${100-_}%`}}),o.jsx("input",{type:"range",className:ve.input,min:n,max:s,step:r,value:p,onChange:y,disabled:c,"aria-label":a?`${a} (mínimo)`:"Mínimo"}),o.jsx("input",{type:"range",className:ve.input,min:n,max:s,step:r,value:m,onChange:g,disabled:c,"aria-label":a?`${a} (máximo)`:"Máximo"})]}),i&&o.jsx("span",{className:ve.helper,children:i})]})}const _p="tempest_wrapper_K9Mqa",gp="tempest_star_goIGS",bp="tempest_filled_mMs-d",yp="tempest_disabled_tyUlQ",vp="tempest_readonly_bnKLN",xp="tempest_sm_K7-y9",wp="tempest_md_ex2Tb",jp="tempest_lg_TstLJ",He={wrapper:_p,star:gp,filled:bp,disabled:yp,readonly:vp,sm:xp,md:wp,lg:jp};function $p({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:a=!1,label:i="Avaliação",className:c}){const[u,d]=l.useState(0),p=u>0?u:e,m=f=>{r||a||n?.(f)};return o.jsx("span",{role:"radiogroup","aria-label":i,className:w.cn(He.wrapper,He[s],a&&He.disabled,r&&He.readonly,c),onMouseLeave:()=>d(0),children:Array.from({length:t},(f,h)=>{const _=h+1,v=_<=p;return o.jsx("button",{type:"button",role:"radio","aria-checked":e===_,"aria-label":`${_} ${_===1?"estrela":"estrelas"}`,className:w.cn(He.star,v&&He.filled),disabled:a,onMouseEnter:()=>!r&&!a&&d(_),onClick:()=>m(_),children:o.jsx(kp,{filled:v})},_)})})}function kp({filled:e}){return o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function qn(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function Np({above:e,below:t,only:n,children:s}){const r=ze();return qn(r.current,e,t,n,r)?s:null}function Sp({above:e,below:t,only:n,children:s}){const r=ze();return qn(r.current,e,t,n,r)?null:s}const Cp="tempest_safe_iqDFY",Ep="tempest_inline_V9eMG",Tp="tempest_top_Xse9E",Mp="tempest_right_GZm9b",Rp="tempest_bottom_kkyD7",Lp="tempest_left_Z4Q72",Ge={safe:Cp,inline:Ep,top:Tp,right:Mp,bottom:Rp,left:Lp},Dp=["top","right","bottom","left"];function Pp({edges:e=Dp,inline:t=!1,className:n,children:s,...r}){return o.jsx("div",{className:w.cn(Ge.safe,t&&Ge.inline,e.includes("top")&&Ge.top,e.includes("right")&&Ge.right,e.includes("bottom")&&Ge.bottom,e.includes("left")&&Ge.left,n),"data-edges":e.join(" "),...r,children:s})}const Ap="tempest_wrapper_dKXJJ",Ip="tempest_input_m0lPc",Fp="tempest_iconLeft_030-U",Op="tempest_clear_nb6lG",pt={wrapper:Ap,input:Ip,iconLeft:Fp,clear:Op},Un=l.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:a="Buscar...",className:i,...c},u){function d(){n(""),s?.()}return o.jsxs("div",{className:w.cn(pt.wrapper,r),children:[o.jsx("span",{className:pt.iconLeft,"aria-hidden":!0,children:o.jsx(Bp,{})}),o.jsx("input",{ref:u,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:a,className:w.cn(pt.input,i),...c}),t&&o.jsx("button",{type:"button",className:pt.clear,"aria-label":"Limpar busca",onClick:d,children:o.jsx(zp,{})})]})});function Bp(){return o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function zp(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Wp="tempest_group_mYyFC",qp="tempest_fullWidth_unSMm",Up="tempest_segment_cu-EL",Kp="tempest_sm_CfD41",Hp="tempest_md_2ixuM",Gp="tempest_lg_2Kt7-",Qp="tempest_active_GmyKg",Jp="tempest_icon_9h6GK",Yp="tempest_label_mS17q",Ie={group:Wp,fullWidth:qp,segment:Up,sm:Kp,md:Hp,lg:Gp,active:Qp,icon:Jp,label:Yp};function Xp({options:e,value:t,onChange:n,size:s="md",fullWidth:r=!1,className:a,"aria-label":i,...c}){return o.jsx("div",{role:"radiogroup","aria-label":i,className:w.cn(Ie.group,Ie[s],r&&Ie.fullWidth,a),...c,children:e.map(u=>{const d=u.value===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":d,disabled:u.disabled,className:w.cn(Ie.segment,d&&Ie.active),onClick:()=>n(u.value),children:[u.icon&&o.jsx("span",{className:Ie.icon,children:u.icon}),o.jsx("span",{className:Ie.label,children:u.label})]},u.value)})})}const Vp="tempest_sidebar_UB1qz",Zp="tempest_header_zupoS",em="tempest_nav_aLYuL",tm="tempest_item_IAjHb",nm="tempest_collapsed_ZbZYA",sm="tempest_active_BgcFy",rm="tempest_icon_UQswn",om="tempest_label_TPvJ9",am="tempest_badge_xwEZv",im="tempest_footer_TyRyi",pe={sidebar:Vp,header:Zp,nav:em,item:tm,collapsed:nm,active:sm,icon:rm,label:om,badge:am,footer:im};function cm({header:e,items:t,value:n,onChange:s,footer:r,collapsed:a=!1,width:i=240,collapsedWidth:c=64,className:u,style:d,...p}){const m=typeof(a?c:i)=="number"?`${a?c:i}px`:a?c:i;return o.jsxs("aside",{className:w.cn(pe.sidebar,a&&pe.collapsed,u),style:{width:m,...d},...p,children:[e&&o.jsx("div",{className:pe.header,children:e}),o.jsx("nav",{className:pe.nav,"aria-label":"Navegação lateral",children:t.map(f=>{const h=f.key===n;return o.jsxs("button",{type:"button",className:w.cn(pe.item,h&&pe.active),"aria-current":h?"page":void 0,disabled:f.disabled,onClick:()=>s?.(f.key),title:a&&typeof f.label=="string"?f.label:void 0,children:[f.icon&&o.jsx("span",{className:pe.icon,children:f.icon}),!a&&o.jsx("span",{className:pe.label,children:f.label}),!a&&f.badge!==void 0&&o.jsx("span",{className:pe.badge,children:f.badge})]},f.key)})}),r&&o.jsx("div",{className:pe.footer,children:r})]})}const lm="tempest_skeleton_CB4uF",um="tempest_text_-A8IF",dm="tempest_circle_DYcl8",Et={skeleton:lm,text:um,circle:dm};function pm({variant:e="rect",width:t,height:n,className:s,style:r}){return o.jsx("span",{"aria-hidden":!0,className:w.cn(Et.skeleton,e==="text"&&Et.text,e==="circle"&&Et.circle,s),style:{width:t,height:n,...r}})}const mm="tempest_spacer_okdOd",fm="tempest_both_85qSF",hm="tempest_x_QiU2B",_m="tempest_y_hTtCp",cn={spacer:mm,both:fm,x:hm,y:_m};function gm({axis:e="both",className:t,...n}){return o.jsx("div",{className:w.cn(cn.spacer,cn[e],t),...n})}const bm="tempest_spinner_GpFZS",ym="tempest_tempest-spinner_wKVCY",vm="tempest_xs_p8BFI",xm="tempest_sm_3sIoD",wm="tempest_md_M2sPj",jm="tempest_lg_IxTw2",$m="tempest_xl_cgwqq",km="tempest_wrap_Xkv-I",Nm="tempest_overlay_sVSe9",Sm="tempest_caption_B0ED9",Fe={spinner:bm,tempestSpinner:ym,xs:vm,sm:xm,md:wm,lg:jm,xl:$m,wrap:km,overlay:Nm,caption:Sm};function Kn({size:e="md",className:t,label:n="Carregando",caption:s,overlay:r=!1}){const a=o.jsx("span",{"aria-hidden":!0,className:w.cn(Fe.spinner,Fe[e])});return!r&&s===void 0?o.jsx("span",{role:"status","aria-label":n,className:w.cn(Fe.spinner,Fe[e],t)}):o.jsxs("div",{role:"status","aria-label":n,"aria-live":"polite",className:w.cn(Fe.wrap,r&&Fe.overlay,t),children:[a,s!==void 0&&o.jsx("span",{className:Fe.caption,children:s})]})}const Cm="tempest_stat_zoo9y",Em="tempest_header_3UQqq",Tm="tempest_icon_zUG3e",Mm="tempest_label_lIH47",Rm="tempest_row_Ifyts",Lm="tempest_value_JBWnr",Dm="tempest_delta_mRVrE",Pm="tempest_up_7qgUO",Am="tempest_down_3Rq2Z",Im="tempest_flat_R5pZT",Fm="tempest_hint_YkTF8",oe={stat:Cm,header:Em,icon:Tm,label:Mm,row:Rm,value:Lm,delta:Dm,up:Pm,down:Am,flat:Im,hint:Fm};function Om(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function Bm({label:e,value:t,delta:n,trend:s,hint:r,icon:a,className:i,...c}){const u=s??Om(n);return o.jsxs("div",{className:w.cn(oe.stat,i),...c,children:[o.jsxs("div",{className:oe.header,children:[a&&o.jsx("span",{className:oe.icon,children:a}),o.jsx("span",{className:oe.label,children:e})]}),o.jsxs("div",{className:oe.row,children:[o.jsx("span",{className:oe.value,children:t}),n!==void 0&&o.jsx("span",{className:w.cn(oe.delta,u==="up"&&oe.up,u==="down"&&oe.down,u==="flat"&&oe.flat),children:n})]}),r&&o.jsx("p",{className:oe.hint,children:r})]})}const zm="tempest_stepper_w3qjQ",Wm="tempest_vertical_d4mOs",qm="tempest_step_s2nqL",Um="tempest_dot_d1bSL",Km="tempest_completed_gcFHM",Hm="tempest_active_kL-CH",Gm="tempest_label_8irAI",Qm="tempest_connector_lyeWp",xe={stepper:zm,vertical:Wm,step:qm,dot:Um,completed:Km,active:Hm,label:Gm,connector:Qm};function Jm({steps:e,current:t,orientation:n="horizontal",className:s}){return o.jsx("ol",{className:w.cn(xe.stepper,n==="vertical"&&xe.vertical,s),children:e.map((r,a)=>{const i=a<t,c=a===t;return o.jsxs(l.Fragment,{children:[o.jsxs("li",{className:w.cn(xe.step,i&&xe.completed,c&&xe.active),"aria-current":c?"step":void 0,children:[o.jsx("span",{className:xe.dot,children:i?"✓":a+1}),o.jsx("span",{className:xe.label,children:r.label})]}),a<e.length-1&&o.jsx("span",{className:w.cn(xe.connector,i&&xe.completed),"aria-hidden":!0})]},a)})})}function Bt(e,t,n){if(Number.isNaN(e))return e;if(t>n){const s=t;t=n,n=s}return e<t?t:e>n?n:e}function Ym(e,t=1){if(e===0)return"0 B";const n=["B","KB","MB","GB","TB"],s=1024,r=Math.min(Math.floor(Math.log(Math.abs(e))/Math.log(s)),n.length-1),a=e/s**r,i=r===0?0:Math.max(0,t);return`${parseFloat(a.toFixed(i)).toString()} ${n[r]}`}function Xm(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",maximumFractionDigits:1}).format(e)}const Vm="tempest_wrapper_JNjXK",Zm="tempest_label_9XKNm",ef="tempest_row_cOARX",tf="tempest_sm_RzVSU",nf="tempest_md_pezRm",sf="tempest_lg_kYbIN",rf="tempest_disabled_vqmo2",of="tempest_btn_xuHhj",af="tempest_value_NEatO",Ce={wrapper:Vm,label:Zm,row:ef,sm:tf,md:nf,lg:sf,disabled:rf,btn:of,value:af},cf=l.forwardRef(function({value:t,onChange:n,min:s=0,max:r=Number.POSITIVE_INFINITY,step:a=1,size:i="md",disabled:c=!1,label:u,format:d,labels:p={decrement:"Diminuir",increment:"Aumentar"},className:m},f){const h=()=>{c||n(Bt(t-a,s,r))},_=()=>{c||n(Bt(t+a,s,r))},v=d?d(t):String(t),y=!c&&t>s,g=!c&&t<r;return o.jsxs("div",{ref:f,className:w.cn(Ce.wrapper,m),children:[u&&o.jsx("label",{className:Ce.label,children:u}),o.jsxs("div",{className:w.cn(Ce.row,Ce[i],c&&Ce.disabled),children:[o.jsx("button",{type:"button",className:Ce.btn,"aria-label":p.decrement,onClick:h,disabled:!y,children:"−"}),o.jsx("span",{className:Ce.value,role:"status","aria-live":"polite",children:v}),o.jsx("button",{type:"button",className:Ce.btn,"aria-label":p.increment,onClick:_,disabled:!g,children:"+"})]})]})}),lf="tempest_wrapper_kudO9",uf="tempest_disabled_2aZ0V",df="tempest_input_5BPNu",pf="tempest_track_7ObdZ",mf="tempest_thumb_-FTeK",ff="tempest_label_LrH7V",Qe={wrapper:lf,disabled:uf,input:df,track:pf,thumb:mf,label:ff},hf=l.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...a},i){return o.jsxs("label",{className:w.cn(Qe.wrapper,n&&Qe.disabled,s),children:[o.jsx("input",{ref:i,type:"checkbox",role:"switch",disabled:n,className:w.cn(Qe.input,r),...a}),o.jsx("span",{className:Qe.track,"aria-hidden":!0,children:o.jsx("span",{className:Qe.thumb})}),t&&o.jsx("span",{className:Qe.label,children:t})]})}),_f="tempest_tag_16VPH",gf="tempest_sm_pzyd5",bf="tempest_md_GL6tQ",yf="tempest_lg_8tgXU",vf="tempest_neutral_jAd-x",xf="tempest_primary_AXKlN",wf="tempest_success_56lz4",jf="tempest_warning_UK7SC",$f="tempest_danger_kJ-yx",kf="tempest_info_hmHE-",Nf="tempest_label_ZBPfO",Sf="tempest_remove_UEwgr",rt={tag:_f,sm:gf,md:bf,lg:yf,neutral:vf,primary:xf,success:wf,warning:jf,danger:$f,info:kf,label:Nf,remove:Sf};function Cf({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:a,...i}){return o.jsxs("span",{className:w.cn(rt.tag,rt[e],rt[t],r),...i,children:[o.jsx("span",{className:rt.label,children:a}),n&&o.jsx("button",{type:"button",className:rt.remove,"aria-label":s,onClick:n,children:"×"})]})}const Ef="tempest_scroll_unrJp",Tf="tempest_table_Dkosn",Mf="tempest_th_PNuEx",Rf="tempest_td_jv9tA",Lf="tempest_tr_7UG8J",Df="tempest_clickable_B6Si-",Pf="tempest_alignRight_9hY0G",Af="tempest_alignCenter_YiUQy",If="tempest_emptyRow_kdMiv",Ff="tempest_priorityTablet_3alUt",Of="tempest_priorityDesktop_3f8Fq",Bf="tempest_stackable_heix7",zf="tempest_stackableHead_mKGcA",Wf="tempest_stackableRow_qPNqc",z={scroll:Ef,table:Tf,th:Mf,td:Rf,tr:Lf,clickable:Df,alignRight:Pf,alignCenter:Af,emptyRow:If,priorityTablet:Ff,priorityDesktop:Of,stackable:Bf,stackableHead:zf,stackableRow:Wf};function ln(e){if(e==="tablet")return z.priorityTablet;if(e==="desktop")return z.priorityDesktop}function Hn({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:a,stackOnMobile:i=!1}){return o.jsx("div",{className:w.cn(z.scroll,i&&z.stackable,a),children:o.jsxs("table",{className:z.table,children:[o.jsx("thead",{className:w.cn(i&&z.stackableHead),children:o.jsx("tr",{children:e.map(c=>o.jsx("th",{className:w.cn(z.th,c.align==="right"&&z.alignRight,c.align==="center"&&z.alignCenter,ln(c.priority)),style:{width:c.width},children:c.header},c.key))})}),o.jsx("tbody",{children:t.length===0?o.jsx("tr",{children:o.jsx("td",{className:z.emptyRow,colSpan:e.length,children:r})}):t.map((c,u)=>o.jsx("tr",{className:w.cn(z.tr,s&&z.clickable,i&&z.stackableRow),onClick:s?()=>s(c):void 0,children:e.map(d=>{const p=d.render?d.render(c,u):c[d.key];return o.jsx("td",{className:w.cn(z.td,d.align==="right"&&z.alignRight,d.align==="center"&&z.alignCenter,ln(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(c,u)))})]})})}const qf="tempest_tablist_WR6ag",Uf="tempest_tab_IdDYc",Kf="tempest_active_PTNtG",Hf="tempest_panel_08i9c",Gf="tempest_pill_lGuqn",ot={tablist:qf,tab:Uf,active:Kf,panel:Hf,pill:Gf};function Qf({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:a}){const i=e.find(h=>!h.disabled),[c,u]=l.useState(t??i?.id),d=n!==void 0,p=d?n:c,m=e.find(h=>h.id===p)??i;function f(h){d||u(h),s?.(h)}return o.jsxs("div",{className:a,children:[o.jsx("div",{role:"tablist",className:w.cn(ot.tablist,r==="pill"&&ot.pill),children:e.map(h=>{const _=h.id===m?.id;return o.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:w.cn(ot.tab,_&&ot.active),onClick:()=>f(h.id),children:h.label},h.id)})}),m&&o.jsx("div",{role:"tabpanel",id:`panel-${m.id}`,"aria-labelledby":`tab-${m.id}`,className:ot.panel,children:m.content})]})}const Jf="tempest_wrapper_C0gfg",Yf="tempest_label_cWLXP",Xf="tempest_required_rDZXE",Vf="tempest_textarea_Z-y6g",Zf="tempest_error_NWC9f",eh="tempest_helper_gedut",th="tempest_errorText_ey07q",Oe={wrapper:Jf,label:Yf,required:Xf,textarea:Vf,error:Zf,helper:eh,errorText:th},nh=l.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:a,id:i,required:c,...u},d){const p=l.useId(),m=i??p;return o.jsxs("div",{className:w.cn(Oe.wrapper,s&&Oe.error,r),children:[t&&o.jsxs("label",{htmlFor:m,className:Oe.label,children:[t,c&&o.jsx("span",{className:Oe.required,children:"*"})]}),o.jsx("textarea",{ref:d,id:m,"aria-invalid":!!s,required:c,className:w.cn(Oe.textarea,a),...u}),s?o.jsx("span",{className:Oe.errorText,children:s}):n?o.jsx("span",{className:Oe.helper,children:n}):null]})}),sh="tempest_timeline_utrkA",rh="tempest_item_T5xdQ",oh="tempest_markerColumn_BMe4d",ah="tempest_marker_kmPV-",ih="tempest_marker-primary_s9BNB",ch="tempest_marker-success_areMM",lh="tempest_marker-warning_rRrS8",uh="tempest_marker-danger_3GEBk",dh="tempest_marker-neutral_M2mnw",ph="tempest_line_CwY-N",mh="tempest_body_KpMJ6",fh="tempest_row_AX2ti",hh="tempest_title_DxfAX",_h="tempest_meta_GU0ih",gh="tempest_description_f9sxV",Y={timeline:sh,item:rh,markerColumn:oh,marker:ah,markerPrimary:ih,markerSuccess:ch,markerWarning:lh,markerDanger:uh,markerNeutral:dh,line:ph,body:mh,row:fh,title:hh,meta:_h,description:gh};function bh({items:e,connector:t=!0,className:n,...s}){return o.jsx("ol",{className:w.cn(Y.timeline,t&&Y.connector,n),...s,children:e.map((r,a)=>{const i=a===e.length-1;return o.jsxs("li",{className:Y.item,children:[o.jsxs("div",{className:Y.markerColumn,children:[o.jsx("span",{className:w.cn(Y.marker,Y[`marker-${r.marker??"primary"}`]),"aria-hidden":"true",children:r.icon}),t&&!i&&o.jsx("span",{className:Y.line,"aria-hidden":"true"})]}),o.jsxs("div",{className:Y.body,children:[o.jsxs("div",{className:Y.row,children:[o.jsx("span",{className:Y.title,children:r.title}),r.meta&&o.jsx("span",{className:Y.meta,children:r.meta})]}),r.description&&o.jsx("p",{className:Y.description,children:r.description})]})]},r.id)})})}const yh="tempest_trigger_Dmc5E",vh="tempest_bubble_TPGHB",xh="tempest_tempest-tooltip-in_csYeZ",wh="tempest_top_m2tnn",jh="tempest_bottom_9Twz4",$h="tempest_left_UPdrG",kh="tempest_right_CV--T",Tt={trigger:yh,bubble:vh,tempestTooltipIn:xh,top:wh,bottom:jh,left:$h,right:kh};function Nh({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[a,i]=l.useState(!1),c=l.useId();let u=null;function d(){s||(u&&clearTimeout(u),u=setTimeout(()=>i(!0),r))}function p(){u&&(clearTimeout(u),u=null),i(!1)}const m=l.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":a?c:void 0});return o.jsxs("span",{className:Tt.trigger,children:[m,a&&o.jsx("span",{id:c,role:"tooltip",className:w.cn(Tt.bubble,Tt[t]),children:e})]})}const Sh="tempest_container_x4-Qm",Ch="tempest_positionTopRight_gbUCQ",Eh="tempest_positionTopLeft_Z-tMJ",Th="tempest_positionTopCenter_A4Ze4",Mh="tempest_positionBottomRight_MGo19",Rh="tempest_positionBottomLeft_DpiNe",Lh="tempest_positionBottomCenter_XUdok",Dh="tempest_toast_FLdHz",Ph="tempest_tempest-toast-in_E2d-A",Ah="tempest_success_Oy694",Ih="tempest_warning_84GC8",Fh="tempest_error_hrQAA",Oh="tempest_info_eq5bQ",Bh="tempest_title_-H6R2",zh="tempest_description_-QwfC",Wh="tempest_close_i10-s",ee={container:Sh,positionTopRight:Ch,positionTopLeft:Eh,positionTopCenter:Th,positionBottomRight:Mh,positionBottomLeft:Rh,positionBottomCenter:Lh,toast:Dh,tempestToastIn:Ph,success:Ah,warning:Ih,error:Fh,info:Oh,title:Bh,description:zh,close:Wh},Gn=l.createContext(null);function qh(){const e=l.useContext(Gn);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function Uh({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=l.useState([]),a=l.useRef(0),i=l.useCallback(d=>{r(p=>p.filter(m=>m.id!==d))},[]),c=l.useCallback(d=>{const p=d.id??`toast-${++a.current}`,m={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(f=>[...f,m]),p},[t]),u=l.useMemo(()=>({show:c,dismiss:i,success:(d,p)=>c({...p,description:d,variant:"success"}),error:(d,p)=>c({...p,description:d,variant:"error"}),warning:(d,p)=>c({...p,description:d,variant:"warning"}),info:(d,p)=>c({...p,description:d,variant:"info"})}),[c,i]);return o.jsxs(Gn.Provider,{value:u,children:[e,o.jsx(Hh,{toasts:s,onDismiss:i,position:n})]})}function Kh(e){switch(e){case"top-left":return ee.positionTopLeft;case"top-center":return ee.positionTopCenter;case"bottom-right":return ee.positionBottomRight;case"bottom-left":return ee.positionBottomLeft;case"bottom-center":return ee.positionBottomCenter;default:return ee.positionTopRight}}function Hh({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:Ve.createPortal(o.jsx("div",{className:w.cn(ee.container,Kh(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>o.jsx(Gh,{toast:s,onDismiss:t},s.id))}),document.body)}function Gh({toast:e,onDismiss:t}){return l.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),o.jsxs("div",{className:w.cn(ee.toast,ee[e.variant]),role:"status",children:[o.jsxs("div",{children:[e.title&&o.jsx("p",{className:ee.title,children:e.title}),e.description&&o.jsx("p",{className:ee.description,children:e.description})]}),o.jsx("button",{type:"button",className:ee.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:o.jsx(Qh,{})})]})}function Qh(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Jh="tempest_scroll_8Giwl",Yh="tempest_spacer_P3Pvl",Xh="tempest_row_Ff0VU",Mt={scroll:Jh,spacer:Yh,row:Xh};function Vh({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:a,className:i,style:c}){const u=l.useRef(null),[d,p]=l.useState(0),[m,f]=l.useState(0);l.useEffect(()=>{const g=u.current;if(!g||(f(g.clientHeight),typeof ResizeObserver>"u"))return;const x=new ResizeObserver(()=>f(g.clientHeight));return x.observe(g),()=>x.disconnect()},[]);const h=e.length*t,_=Math.max(0,Math.floor(d/t)-r),v=Math.ceil(m/t)+r*2,y=Math.min(e.length,_+v);return o.jsx("div",{ref:u,className:w.cn(Mt.scroll,i),style:{height:s,...c},onScroll:g=>p(g.target.scrollTop),role:"list",children:o.jsx("div",{className:Mt.spacer,style:{height:h},children:e.slice(_,y).map((g,x)=>{const b=_+x,j=a?a(g,b):b;return o.jsx("div",{role:"listitem",className:Mt.row,style:{top:b*t,height:t},children:n(g,b)},j)})})})}const Zh="tempest_button_58f9i",e_="tempest_copied_WkLgR",un={button:Zh,copied:e_};function t_({value:e,timeout:t=2e3,children:n,onCopied:s,className:r,onClick:a,...i}){const[c,u]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current)},[]);const p=l.useCallback(async m=>{a?.(m);try{await navigator.clipboard.writeText(e),u(!0),s?.(),d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>u(!1),t)}catch{}},[e,t,s,a]);return o.jsx("button",{type:"button",className:w.cn(un.button,c&&un.copied,r),"data-copied":c||void 0,onClick:p,...i,children:n??(c?"Copied":"Copy")})}const n_={justNow:"agora há pouco",secondsAgo:e=>`${e} s atrás`,minutesAgo:e=>`${e} min atrás`,hoursAgo:e=>e===1?"1 hora atrás":`${e} horas atrás`,daysAgo:e=>e===1?"ontem":`${e} dias atrás`,weeksAgo:e=>e===1?"semana passada":`${e} semanas atrás`,monthsAgo:e=>e===1?"mês passado":`${e} meses atrás`,yearsAgo:e=>e===1?"ano passado":`${e} anos atrás`,inSeconds:e=>`em ${e} s`,inMinutes:e=>`em ${e} min`,inHours:e=>`em ${e} h`,inDays:e=>`em ${e} ${e===1?"dia":"dias"}`,inWeeks:e=>`em ${e} ${e===1?"semana":"semanas"}`,inMonths:e=>`em ${e} ${e===1?"mês":"meses"}`,inYears:e=>`em ${e} ${e===1?"ano":"anos"}`},s_={justNow:"just now",secondsAgo:e=>`${e}s ago`,minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>e===1?"yesterday":`${e} days ago`,weeksAgo:e=>`${e}w ago`,monthsAgo:e=>`${e}mo ago`,yearsAgo:e=>`${e}y ago`,inSeconds:e=>`in ${e}s`,inMinutes:e=>`in ${e}m`,inHours:e=>`in ${e}h`,inDays:e=>`in ${e}d`,inWeeks:e=>`in ${e}w`,inMonths:e=>`in ${e}mo`,inYears:e=>`in ${e}y`},r_={"pt-BR":n_,en:s_},zt=1e3,Wt=60*zt,qt=60*Wt,ut=24*qt,dn=7*ut,pn=30*ut,mn=365*ut;function Qn(e,t={}){const{locale:n="pt-BR",now:s=Date.now()}=t,r=r_[n],a=e instanceof Date?e.getTime():new Date(e).getTime(),c=(typeof s=="number"?s:s.getTime())-a,u=c>=0,d=Math.abs(c);if(d<30*zt)return r.justNow;if(d<Wt){const m=Math.round(d/zt);return u?r.secondsAgo(m):r.inSeconds(m)}if(d<qt){const m=Math.round(d/Wt);return u?r.minutesAgo(m):r.inMinutes(m)}if(d<ut){const m=Math.round(d/qt);return u?r.hoursAgo(m):r.inHours(m)}if(d<dn){const m=Math.round(d/ut);return u?r.daysAgo(m):r.inDays(m)}if(d<pn){const m=Math.round(d/dn);return u?r.weeksAgo(m):r.inWeeks(m)}if(d<mn){const m=Math.round(d/pn);return u?r.monthsAgo(m):r.inMonths(m)}const p=Math.round(d/mn);return u?r.yearsAgo(p):r.inYears(p)}function o_({date:e,locale:t="pt",...n}){const s=e instanceof Date?e:new Date(e),r=Number.isNaN(s.getTime())?void 0:s.toISOString(),a=Qn(e,{locale:t==="pt"?"pt-BR":"en"});return o.jsx("time",{dateTime:r,...n,children:a})}function a_({cents:e,currency:t="BRL",locale:n="pt-BR",...s}){const r=new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/100);return o.jsx("span",{...s,children:r})}const i_="tempest_clamp_r43C-",c_={clamp:i_};function l_({lines:e=1,className:t,style:n,children:s,...r}){const a={...n,"--tempest-clamp-lines":e};return o.jsx("div",{className:w.cn(c_.clamp,t),style:a,...r,children:s})}const u_="tempest_hidden_k7p-e",d_={hidden:u_};function p_({as:e="span",className:t,children:n,...s}){return l.createElement(e,{className:w.cn(d_.hidden,t),...s},n)}function Jn({children:e,container:t}){const[n,s]=l.useState(!1);return l.useEffect(()=>(s(!0),()=>s(!1)),[]),!n||typeof document>"u"?null:Ve.createPortal(e,t??document.body)}function m_({onOutside:e,children:t,...n}){const s=l.useRef(null),r=l.useRef(e);return r.current=e,l.useEffect(()=>{if(typeof document>"u")return;function a(i){const c=s.current,u=i.target;c&&u&&!c.contains(u)&&r.current(i)}return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[]),o.jsx("div",{ref:s,...n,children:t})}function f_({condition:e,wrapper:t,children:n}){return e?t(n):o.jsx(o.Fragment,{children:n})}function h_({each:e,children:t,fallback:n=null}){return e.length===0?o.jsx(o.Fragment,{children:n}):o.jsx(o.Fragment,{children:e.map((s,r)=>o.jsx(l.Fragment,{children:t(s,r)},r))})}const __="tempest_errorText_LU3jn",g_={errorText:__};function b_({children:e,className:t,...n}){return e==null||e===!1||e===""?null:o.jsx("p",{role:"alert",className:w.cn(g_.errorText,t),...n,children:e})}const y_="tempest_image_Zq9Zs",v_={image:y_};function x_({src:e,fallback:t,alt:n,lazy:s=!0,className:r,onError:a,...i}){const[c,u]=l.useState(e),[d,p]=l.useState(!1);return o.jsx("img",{src:c,alt:n,loading:s?"lazy":"eager",className:w.cn(v_.image,r),onError:m=>{t&&!d&&c!==t&&(p(!0),u(t)),a?.(m)},...i})}const w_="tempest_list_bAP4Q",j_="tempest_item_oRy5T",fn={list:w_,item:j_};function $_({items:e,renderItem:t,keyExtractor:n,empty:s,className:r,...a}){return e.length===0?o.jsx(o.Fragment,{children:s??null}):o.jsx("ul",{className:w.cn(fn.list,r),...a,children:e.map((i,c)=>o.jsx("li",{className:fn.item,children:t(i,c)},n?n(i,c):c))})}const k_="tempest_list_fwIXq",N_="tempest_term_QkQNZ",S_="tempest_description_e1bNN",Rt={list:k_,term:N_,description:S_};function C_({items:e,className:t,...n}){return o.jsx("dl",{className:w.cn(Rt.list,t),...n,children:e.map((s,r)=>o.jsxs(l.Fragment,{children:[o.jsx("dt",{className:Rt.term,children:s.term}),o.jsx("dd",{className:Rt.description,children:s.description})]},r))})}const E_="tempest_toggle_kmzmH",T_="tempest_outline_aFbzy",M_="tempest_pressed_hX319",R_="tempest_sm_JTqaB",L_="tempest_md_QfS4K",D_="tempest_lg_ajzsM",mt={toggle:E_,outline:T_,pressed:M_,sm:R_,md:L_,lg:D_},P_=l.forwardRef(function({pressed:t,defaultPressed:n=!1,onPressedChange:s,size:r="md",variant:a="default",className:i,disabled:c,onClick:u,children:d,...p},m){const f=t!==void 0,[h,_]=l.useState(n),v=f?t:h,y=l.useCallback(g=>{if(u?.(g),g.defaultPrevented)return;const x=!v;f||_(x),s?.(x)},[v,f,u,s]);return o.jsx("button",{ref:m,type:"button","aria-pressed":v,disabled:c,"data-state":v?"on":"off",className:w.cn(mt.toggle,mt[r],mt[a],v&&mt.pressed,i),onClick:y,...p,children:d})}),A_="tempest_group_XZCDJ",I_="tempest_item_B-27E",F_="tempest_selected_OHPVQ",Ut={group:A_,item:I_,selected:F_},Yn=l.createContext(null);function O_(){const e=l.useContext(Yn);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e}function hn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function B_({type:e="single",value:t,defaultValue:n,onValueChange:s,className:r,children:a,...i}){const c=t!==void 0,[u,d]=l.useState(()=>hn(n)),p=c?hn(t):u,m=l.useCallback(_=>{c||d(_),s?.(e==="single"?_[0]??"":_)},[c,s,e]),f=l.useCallback(_=>{const v=p.includes(_);m(e==="single"?v?[]:[_]:v?p.filter(y=>y!==_):[...p,_])},[p,e,m]),h=l.useMemo(()=>({type:e,isSelected:_=>p.includes(_),toggle:f}),[e,p,f]);return o.jsx(Yn.Provider,{value:h,children:o.jsx("div",{role:"group",className:w.cn(Ut.group,r),...i,children:a})})}function z_({value:e,disabled:t,className:n,children:s,...r}){const{isSelected:a,toggle:i}=O_(),c=a(e);return o.jsx("button",{type:"button",role:"button","aria-pressed":c,disabled:t,"data-state":c?"on":"off",className:w.cn(Ut.item,c&&Ut.selected,n),onClick:()=>i(e),...r,children:s})}const W_="tempest_label_RaRvM",q_="tempest_asterisk_1CgE8",_n={label:W_,asterisk:q_},U_=l.forwardRef(function({required:t=!1,className:n,children:s,...r},a){return o.jsxs("label",{ref:a,className:w.cn(_n.label,n),...r,children:[s,t&&o.jsx("span",{className:_n.asterisk,"aria-hidden":!0,children:"*"})]})}),K_="tempest_collapsible_8jmKP",H_="tempest_trigger_ers75",G_="tempest_content_XmUZL",ft={collapsible:K_,trigger:H_,content:G_};function Q_({open:e,defaultOpen:t=!1,onOpenChange:n,trigger:s,className:r,children:a,...i}){const c=l.useId(),u=`${c}-content`,d=`${c}-trigger`,p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=l.useCallback(()=>{const v=!h;p||f(v),n?.(v)},[h,p,n]);return o.jsxs("div",{className:w.cn(ft.collapsible,h&&ft.open,r),...i,children:[o.jsx("button",{type:"button",id:d,className:ft.trigger,"aria-expanded":h,"aria-controls":u,onClick:_,children:s}),o.jsx("div",{id:u,role:"region","aria-labelledby":d,hidden:!h,className:ft.content,children:a})]})}const J_="tempest_root_OxRHj",Y_="tempest_menu_MDn4t",X_="tempest_item_PoiMY",V_="tempest_active_ATcDu",Z_="tempest_danger_COgly",eg="tempest_separator_omuCz",Je={root:J_,menu:Y_,item:X_,active:V_,danger:Z_,separator:eg};function gn(e){return"separator"in e&&e.separator===!0}function tg({items:e,children:t,className:n}){const[s,r]=l.useState(!1),[a,i]=l.useState({x:0,y:0}),[c,u]=l.useState(-1),d=l.useId(),p=l.useRef(null),m=l.useRef([]),f=e.map((y,g)=>!gn(y)&&!y.disabled?g:-1).filter(y=>y!==-1),h=l.useCallback(()=>{r(!1),u(-1)},[]),_=y=>{y.preventDefault(),i({x:y.clientX,y:y.clientY}),u(-1),r(!0)};l.useEffect(()=>{if(!s)return;const y=x=>{if(x.key==="Escape"){h();return}if(x.key==="ArrowDown"){x.preventDefault();const b=f.indexOf(c),j=f[(b+1)%f.length]??-1;u(j),m.current[j]?.focus()}if(x.key==="ArrowUp"){x.preventDefault();const b=f.indexOf(c),j=f[(b-1+f.length)%f.length]??-1;u(j),m.current[j]?.focus()}},g=x=>{p.current&&!p.current.contains(x.target)&&h()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[s,c,f,h]);const v=y=>{y.onSelect?.(),h()};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Je.root,onContextMenu:_,children:t}),s&&o.jsx(Jn,{children:o.jsx("ul",{ref:p,id:d,role:"menu",className:w.cn(Je.menu,n),style:{top:a.y,left:a.x},children:e.map((y,g)=>gn(y)?o.jsx("li",{role:"separator",className:Je.separator,"aria-hidden":!0},`separator-${g}`):o.jsx("li",{role:"none",children:o.jsx("button",{ref:x=>{m.current[g]=x},type:"button",role:"menuitem",className:w.cn(Je.item,y.danger&&Je.danger,c===g&&Je.active),disabled:y.disabled,onClick:()=>v(y),onMouseEnter:()=>u(g),children:y.label})},`item-${g}`))})})]})}const ng="tempest_root_2KoZA",sg="tempest_trigger_OXsnr",rg="tempest_card_CoGx4",og="tempest_tempest-hover-card-in_jD85J",ag="tempest_top_AVcQ0",ig="tempest_bottom_2rLAA",cg="tempest_left_tqGPt",lg="tempest_right_9Fe6S",ht={root:ng,trigger:sg,card:rg,tempestHoverCardIn:og,top:ag,bottom:ig,left:cg,right:lg};function ug({trigger:e,children:t,openDelay:n=300,closeDelay:s=150,placement:r="bottom",className:a,...i}){const[c,u]=l.useState(!1),d=l.useId(),p=l.useRef(null),m=l.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]),f=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!0),n)},[m,n]),h=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!1),s)},[m,s]);return l.useEffect(()=>m,[m]),o.jsxs("span",{className:ht.root,onMouseEnter:f,onMouseLeave:h,onFocus:f,onBlur:h,children:[o.jsx("span",{"aria-describedby":c?d:void 0,className:ht.trigger,children:e}),c&&o.jsx("div",{id:d,role:"dialog",className:w.cn(ht.card,ht[r],a),...i,children:t})]})}const dg=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Xn(e,t){l.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(dg)??[]).filter(c=>{if(c.hasAttribute("aria-hidden"))return!1;const u=typeof window<"u"?window.getComputedStyle(c):null;return!(u&&(u.display==="none"||u.visibility==="hidden"))})}function a(c){if(c.key!=="Tab")return;const u=r();if(u.length===0){c.preventDefault();return}const d=u[0],p=u[u.length-1],m=document.activeElement;c.shiftKey?(m===d||!m||!n?.contains(m))&&(c.preventDefault(),p.focus()):m===p&&(c.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),s?.focus?.()}},[e,t])}const pg="tempest_overlay_drnPW",mg="tempest_dialog_lPl6k",fg="tempest_inputRow_KxWoQ",hg="tempest_searchIcon_8PULr",_g="tempest_input_D3HQr",gg="tempest_list_5UzZU",bg="tempest_group_vLaWy",yg="tempest_groupHeading_d01fo",vg="tempest_groupList_QFMjK",xg="tempest_option_doqib",wg="tempest_active_LdCIJ",jg="tempest_icon_CyCCx",$g="tempest_label_QePT-",kg="tempest_empty_al68D",q={overlay:pg,dialog:mg,inputRow:fg,searchIcon:hg,input:_g,list:gg,group:bg,groupHeading:yg,groupList:vg,option:xg,active:wg,icon:jg,label:$g,empty:kg};function Ng(e,t){return t===""||e.label.toLowerCase().includes(t)?!0:(e.keywords??[]).some(n=>n.toLowerCase().includes(t))}function bn(e){const t=[],n=new Map;for(const s of e){const r=n.get(s.group);r===void 0?(n.set(s.group,t.length),t.push({name:s.group,items:[s]})):t[r].items.push(s)}return t}function Sg({open:e,onOpenChange:t,items:n,placeholder:s="Type a command…",emptyMessage:r="No results",className:a}){const i=l.useRef(null),[c,u]=l.useState(""),[d,p]=l.useState(0),m="tempest-command-list";Xn(i,e);const f=l.useMemo(()=>{const g=c.trim().toLowerCase(),x=n.filter(b=>Ng(b,g));return bn(x).flatMap(b=>b.items)},[n,c]),h=l.useMemo(()=>bn(f),[f]);if(l.useEffect(()=>{e&&(u(""),p(0))},[e]),l.useEffect(()=>{p(g=>f.length===0?0:Math.min(g,f.length-1))},[f.length]),!e||typeof document>"u")return null;function _(g){g.onSelect(),t(!1)}function v(g){if(g.key==="Escape"){g.preventDefault(),t(!1);return}if(g.key==="ArrowDown"){if(g.preventDefault(),f.length===0)return;p(x=>(x+1)%f.length);return}if(g.key==="ArrowUp"){if(g.preventDefault(),f.length===0)return;p(x=>(x-1+f.length)%f.length);return}if(g.key==="Enter"){g.preventDefault();const x=f[d];x&&_(x)}}let y=-1;return Ve.createPortal(o.jsx("div",{className:q.overlay,role:"presentation",onClick:()=>t(!1),children:o.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":"Command palette",className:w.cn(q.dialog,a),onClick:g=>g.stopPropagation(),children:[o.jsxs("div",{className:q.inputRow,children:[o.jsx(Cg,{}),o.jsx("input",{type:"text",role:"combobox","aria-expanded":"true","aria-controls":m,"aria-autocomplete":"list",autoFocus:!0,className:q.input,placeholder:s,value:c,onChange:g=>u(g.target.value),onKeyDown:v})]}),o.jsx("ul",{id:m,role:"listbox",className:q.list,children:f.length===0?o.jsx("li",{className:q.empty,children:r}):h.map(g=>o.jsxs("li",{className:q.group,children:[g.name&&o.jsx("div",{className:q.groupHeading,children:g.name}),o.jsx("ul",{role:"presentation",className:q.groupList,children:g.items.map(x=>{y+=1;const b=y===d,j=y;return o.jsxs("li",{role:"option","aria-selected":b,className:w.cn(q.option,b&&q.active),onMouseMove:()=>p(j),onClick:()=>_(x),children:[x.icon&&o.jsx("span",{className:q.icon,children:x.icon}),o.jsx("span",{className:q.label,children:x.label})]},x.id)})})]},g.name??"__ungrouped__"))})]})}),document.body)}function Cg(){return o.jsxs("svg",{className:q.searchIcon,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}const Eg="tempest_root_cWKqF",Tg={root:Eg},Mg=l.forwardRef(function({maxHeight:t,orientation:n="vertical",className:s,style:r,children:a,...i},c){const u={overflowX:n==="vertical"?"hidden":"auto",overflowY:n==="horizontal"?"hidden":"auto",...t!==void 0?{maxHeight:t}:{},...r};return o.jsx("div",{ref:c,className:w.cn(Tg.root,s),style:u,...i,children:a})}),Rg="tempest_root_-Xerf",Lg="tempest_horizontal_3QOMV",Dg="tempest_vertical_6A7lb",Pg="tempest_pane_x6yUG",Ag="tempest_divider_fhaTB",Ig="tempest_handle_eCe1B",Be={root:Rg,horizontal:Lg,vertical:Dg,pane:Pg,divider:Ag,handle:Ig},_t=2;function Lt(e,t,n){return Math.min(n,Math.max(t,e))}function Fg({direction:e="horizontal",defaultSize:t=50,min:n=10,max:s=90,children:r,className:a,...i}){const[c,u]=l.useState(()=>Lt(t,n,s)),d=l.useRef(null),[p,m]=r,f=e==="horizontal",h=l.useCallback((y,g)=>{const x=d.current;if(!x)return;const b=x.getBoundingClientRect(),j=f?b.width:b.height;if(j<=0)return;const M=(f?y-b.left:g-b.top)/j*100;u(Lt(M,n,s))},[f,n,s]),_=l.useCallback(y=>{y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const x=j=>{h(j.clientX,j.clientY)},b=()=>{window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",b)};window.addEventListener("pointermove",x),window.addEventListener("pointerup",b)},[h]),v=l.useCallback(y=>{let g=0;if(f?y.key==="ArrowRight"?g=_t:y.key==="ArrowLeft"&&(g=-_t):y.key==="ArrowDown"?g=_t:y.key==="ArrowUp"&&(g=-_t),y.key==="Home"){y.preventDefault(),u(n);return}if(y.key==="End"){y.preventDefault(),u(s);return}g!==0&&(y.preventDefault(),u(x=>Lt(x+g,n,s)))},[f,n,s]);return o.jsxs("div",{ref:d,className:w.cn(Be.root,f?Be.horizontal:Be.vertical,a),...i,children:[o.jsx("div",{className:Be.pane,style:{flexBasis:`${c}%`},children:p}),o.jsx("div",{role:"separator","aria-orientation":f?"vertical":"horizontal","aria-valuenow":Math.round(c),"aria-valuemin":n,"aria-valuemax":s,tabIndex:0,className:Be.divider,onPointerDown:_,onKeyDown:v,children:o.jsx("span",{className:Be.handle,"aria-hidden":"true"})}),o.jsx("div",{className:Be.pane,style:{flexBasis:`${100-c}%`},children:m})]})}const Og="tempest_root_ObO-Z",Bg="tempest_header_5nSJG",zg="tempest_title_Jd3Xb",Wg="tempest_nav_4h58I",qg="tempest_weekdays_YzRfx",Ug="tempest_grid_nbaFm",Kg="tempest_weekday_k-7Vr",Hg="tempest_day_ao-IC",Gg="tempest_outside_HkC-6",Qg="tempest_today_p18-m",Jg="tempest_selected_C9bTY",X={root:Og,header:Bg,title:zg,nav:Wg,weekdays:qg,grid:Ug,weekday:Kg,day:Hg,outside:Gg,today:Qg,selected:Jg},Yg=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xg=["January","February","March","April","May","June","July","August","September","October","November","December"],Vn=42;function Ye(e,t,n){return new Date(e,t,n)}function vt(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function yn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function vn(e,t,n){const s=vt(e).getTime();return!!(t&&s<vt(t).getTime()||n&&s>vt(n).getTime())}function Vg(e,t){const n=e.getFullYear(),s=e.getMonth(),i=(Ye(n,s,1).getDay()-t+7)%7,c=Ye(n,s,1-i),u=[];for(let d=0;d<Vn;d+=1)u.push(Ye(c.getFullYear(),c.getMonth(),c.getDate()+d));return u}function Zg({value:e,defaultValue:t,onChange:n,month:s,onMonthChange:r,minDate:a,maxDate:i,weekStartsOn:c=0,className:u,...d}){const p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=s!==void 0,[v,y]=l.useState(()=>{const $=s??e??t??new Date;return Ye($.getFullYear(),$.getMonth(),1)}),g=_?Ye(s.getFullYear(),s.getMonth(),1):v,[x,b]=l.useState(null),j=l.useRef(null),k=l.useMemo(()=>vt(new Date),[]),M=l.useMemo(()=>Vg(g,c),[g,c]),E=l.useMemo(()=>Array.from({length:7},($,C)=>Yg[(C+c)%7]),[c]),N=l.useCallback($=>{const C=Ye(g.getFullYear(),g.getMonth()+$,1);r&&r(C),_||y(C)},[g,r,_]),S=l.useCallback($=>{vn($,a,i)||(n&&n($),p||f($))},[a,i,n,p]),T=l.useCallback($=>{const C=Math.max(0,Math.min(Vn-1,$));b(C);const I=j.current;if(!I)return;I.querySelectorAll("button[data-day]")[C]?.focus()},[]),D=l.useCallback(($,C)=>{switch($.key){case"ArrowLeft":$.preventDefault(),T(C-1);break;case"ArrowRight":$.preventDefault(),T(C+1);break;case"ArrowUp":$.preventDefault(),T(C-7);break;case"ArrowDown":$.preventDefault(),T(C+7);break;case"Enter":case" ":$.preventDefault(),S(M[C]);break}},[T,S,M]);return o.jsxs("div",{className:w.cn(X.root,u),...d,children:[o.jsxs("div",{className:X.header,children:[o.jsx("button",{type:"button",className:X.nav,"aria-label":"Previous month",onClick:()=>N(-1),children:"‹"}),o.jsxs("span",{className:X.title,"aria-live":"polite",children:[Xg[g.getMonth()]," ",g.getFullYear()]}),o.jsx("button",{type:"button",className:X.nav,"aria-label":"Next month",onClick:()=>N(1),children:"›"})]}),o.jsx("div",{className:X.weekdays,role:"row",children:E.map($=>o.jsx("span",{className:X.weekday,role:"columnheader",children:$},$))}),o.jsx("div",{className:X.grid,role:"grid",ref:j,children:M.map(($,C)=>{const I=$.getMonth()===g.getMonth(),L=h?yn($,h):!1,R=yn($,k),W=vn($,a,i),We=x===null?I&&$.getDate()===1:x===C;return o.jsx("button",{type:"button","data-day":!0,role:"gridcell",className:w.cn(X.day,!I&&X.outside,L&&X.selected,R&&X.today),"aria-pressed":L,"aria-selected":L,"aria-current":R?"date":void 0,disabled:W,tabIndex:We?0:-1,onClick:()=>S($),onKeyDown:ge=>D(ge,C),children:$.getDate()},C)})})]})}const eb="tempest_wrapper_KCCs1",tb="tempest_label_N4ak-",nb="tempest_value_-33zj",sb="tempest_field_wFJsg",rb="tempest_track_kaJkL",ob="tempest_fill_tio-b",ab="tempest_input_J48Um",ib="tempest_helper_yn8VW",Ee={wrapper:eb,label:tb,value:nb,field:sb,track:rb,fill:ob,input:ab,helper:ib};function cb({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:i,disabled:c=!1,formatValue:u,className:d}){const p=l.useMemo(()=>{const h=s-n;return h<=0?0:Math.min(100,Math.max(0,(e-n)/h*100))},[e,n,s]),m=u?.(e)??String(e),f=l.useCallback(h=>{t(Number(h.target.value))},[t]);return o.jsxs("div",{className:w.cn(Ee.wrapper,d),children:[a&&o.jsxs("div",{className:Ee.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:Ee.value,children:m})]}),o.jsxs("div",{className:Ee.field,children:[o.jsx("div",{className:Ee.track}),o.jsx("div",{className:Ee.fill,style:{width:`${p}%`}}),o.jsx("input",{type:"range",className:Ee.input,min:n,max:s,step:r,value:e,onChange:f,disabled:c,"aria-label":a??"Slider","aria-valuetext":m})]}),i&&o.jsx("span",{className:Ee.helper,children:i})]})}const lb="tempest_wrapper_6xZZr",ub="tempest_label_Jwj7I",db="tempest_field_GpA0V",pb="tempest_disabled_BIKaG",mb="tempest_chip_Zk0ch",fb="tempest_chipRemove_R-mNv",hb="tempest_input_SjOXU",_b="tempest_menu_3xnmo",gb="tempest_option_lqEl1",bb="tempest_check_aUM1w",yb="tempest_active_S9sQ-",vb="tempest_selected_Rw8yr",xb="tempest_empty_-5B16",wb="tempest_helper_c7aH3",jb="tempest_errorText_qZR9s",$b="tempest_error_DIOTW",B={wrapper:lb,label:ub,field:db,disabled:pb,chip:mb,chipRemove:fb,input:hb,menu:_b,option:gb,check:bb,active:yb,selected:vb,empty:xb,helper:wb,errorText:jb,error:$b};function kb(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function Nb({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:i,disabled:c,maxItems:u,filter:d=kb,emptyMessage:p="Nenhuma opção encontrada",className:m}){const f=l.useId(),h=l.useRef(null),_=l.useRef(null),[v,y]=l.useState(!1),[g,x]=l.useState(""),[b,j]=l.useState(0),k=l.useMemo(()=>new Set(t),[t]),M=l.useMemo(()=>t.map($=>e.find(C=>C.value===$)).filter($=>!!$),[t,e]),E=l.useMemo(()=>e.filter($=>d($,g)),[e,d,g]),N=u!==void 0&&t.length>=u,S=l.useCallback($=>{if(!$.disabled){if(k.has($.value))n(t.filter(C=>C!==$.value));else{if(N)return;n([...t,$.value])}x(""),_.current?.focus()}},[k,n,t,N]),T=l.useCallback($=>{n(t.filter(C=>C!==$))},[n,t]);l.useEffect(()=>{if(!v)return;const $=C=>{h.current&&!h.current.contains(C.target)&&(y(!1),x(""))};return window.addEventListener("mousedown",$),()=>window.removeEventListener("mousedown",$)},[v]);const D=$=>{if($.key==="ArrowDown")$.preventDefault(),y(!0),j(C=>Math.min(E.length-1,C+1));else if($.key==="ArrowUp")$.preventDefault(),j(C=>Math.max(0,C-1));else if($.key==="Enter"){$.preventDefault();const C=E[b];C&&S(C)}else $.key==="Escape"?(y(!1),x("")):$.key==="Backspace"&&g===""&&t.length>0&&T(t[t.length-1])};return o.jsxs("div",{ref:h,className:w.cn(B.wrapper,i&&B.error,m),children:[s&&o.jsx("label",{htmlFor:f,className:B.label,children:s}),o.jsxs("div",{className:w.cn(B.field,c&&B.disabled),onMouseDown:$=>{c||$.target===$.currentTarget&&($.preventDefault(),_.current?.focus(),y(!0))},children:[M.map($=>o.jsxs("span",{className:B.chip,children:[$.label,o.jsx("button",{type:"button",className:B.chipRemove,"aria-label":`Remover ${$.label}`,disabled:c,onMouseDown:C=>{C.preventDefault(),T($.value)},children:"×"})]},$.value)),o.jsx("input",{id:f,ref:_,type:"text",role:"combobox","aria-expanded":v,"aria-controls":`${f}-listbox`,"aria-autocomplete":"list",className:B.input,placeholder:t.length===0?r:"",disabled:c,value:g,onFocus:()=>y(!0),onChange:$=>{x($.target.value),y(!0),j(0)},onKeyDown:D})]}),v&&o.jsx("ul",{id:`${f}-listbox`,role:"listbox","aria-multiselectable":!0,className:B.menu,children:E.length===0?o.jsx("li",{className:B.empty,children:p}):E.map(($,C)=>{const I=k.has($.value);return o.jsxs("li",{role:"option","aria-selected":I,"aria-disabled":$.disabled||!I&&N,className:w.cn(B.option,C===b&&B.active,I&&B.selected),onMouseEnter:()=>j(C),onMouseDown:L=>{L.preventDefault(),S($)},children:[o.jsx("span",{className:B.check,"aria-hidden":!0,children:I?"✓":""}),$.label]},$.value)})}),i?o.jsx("span",{className:B.errorText,children:i}):a?o.jsx("span",{className:B.helper,children:a}):null]})}const Sb="tempest_root_fVC66",Cb="tempest_header_sTdRM",Eb="tempest_headerSpacer_nqeNO",Tb="tempest_nav_7nFJE",Mb="tempest_months_fbwtK",Rb="tempest_month_0WfUc",Lb="tempest_title_OGQrm",Db="tempest_weekdays_nYTrg",Pb="tempest_grid_O0eUF",Ab="tempest_weekday_cy-Mz",Ib="tempest_day_-V6FX",Fb="tempest_outside_3otid",Ob="tempest_today_gwmhs",Bb="tempest_inRange_iQJYA",zb="tempest_selected_DRsBO",Wb="tempest_rangeStart_-Oe1u",qb="tempest_rangeEnd_mUaKW",F={root:Sb,header:Cb,headerSpacer:Eb,nav:Tb,months:Mb,month:Rb,title:Lb,weekdays:Db,grid:Pb,weekday:Ab,day:Ib,outside:Fb,today:Ob,inRange:Bb,selected:zb,rangeStart:Wb,rangeEnd:qb},Ub=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xn=["January","February","March","April","May","June","July","August","September","October","November","December"],Kb=42;function ct(e,t,n){return new Date(e,t,n)}function le(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t){return ct(e.getFullYear(),e.getMonth()+t,1)}function Dt(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function jn(e,t,n){const s=le(e).getTime();return!!(t&&s<le(t).getTime()||n&&s>le(n).getTime())}function Hb(e,t,n){const s=le(e).getTime(),r=Math.min(le(t).getTime(),le(n).getTime()),a=Math.max(le(t).getTime(),le(n).getTime());return s>r&&s<a}function Gb(e,t){const n=e.getFullYear(),s=e.getMonth(),a=(ct(n,s,1).getDay()-t+7)%7,i=ct(n,s,1-a);return Array.from({length:Kb},(c,u)=>ct(i.getFullYear(),i.getMonth(),i.getDate()+u))}function Qb({value:e,onChange:t,numberOfMonths:n=2,defaultMonth:s,minDate:r,maxDate:a,weekStartsOn:i=0,className:c,...u}){const[d,p]=l.useState(()=>{const b=s??e.start??new Date;return ct(b.getFullYear(),b.getMonth(),1)}),[m,f]=l.useState(null),h=l.useMemo(()=>le(new Date),[]),_=l.useMemo(()=>Array.from({length:7},(b,j)=>Ub[(j+i)%7]),[i]),v=l.useCallback(b=>{if(jn(b,r,a))return;const{start:j,end:k}=e;!j||k?t({start:b,end:null}):le(b).getTime()<le(j).getTime()?t({start:b,end:j}):t({start:j,end:b})},[e,t,r,a]),y=l.useCallback(b=>{p(j=>wn(j,b))},[]),g=e.start&&!e.end?m:e.end;function x(b){const{start:j}=e,k=g,M=j?Dt(b,j):!1,E=k?Dt(b,k):!1,N=j&&k?Hb(b,j,k):!1;return{selected:M||E,inRange:N,isStart:M,isEnd:E}}return o.jsxs("div",{className:w.cn(F.root,c),...u,children:[o.jsxs("div",{className:F.header,children:[o.jsx("button",{type:"button",className:F.nav,"aria-label":"Previous month",onClick:()=>y(-1),children:"‹"}),o.jsx("span",{className:F.headerSpacer,"aria-hidden":!0}),o.jsx("button",{type:"button",className:F.nav,"aria-label":"Next month",onClick:()=>y(1),children:"›"})]}),o.jsx("div",{className:F.months,onMouseLeave:()=>f(null),children:Array.from({length:Math.max(1,n)},(b,j)=>{const k=wn(d,j),M=Gb(k,i);return o.jsxs("div",{className:F.month,children:[o.jsxs("div",{className:F.title,"aria-live":"polite",children:[xn[k.getMonth()]," ",k.getFullYear()]}),o.jsx("div",{className:F.weekdays,role:"row",children:_.map(E=>o.jsx("span",{className:F.weekday,role:"columnheader",children:E},E))}),o.jsx("div",{className:F.grid,role:"grid",children:M.map((E,N)=>{const S=E.getMonth()===k.getMonth(),T=jn(E,r,a),{selected:D,inRange:$,isStart:C,isEnd:I}=x(E),L=Dt(E,h);return o.jsx("button",{type:"button",role:"gridcell",className:w.cn(F.day,!S&&F.outside,$&&F.inRange,D&&F.selected,C&&F.rangeStart,I&&F.rangeEnd,L&&F.today),"aria-label":`${xn[E.getMonth()]} ${E.getDate()}, ${E.getFullYear()}`,"aria-selected":D,"aria-current":L?"date":void 0,disabled:T,onClick:()=>v(E),onMouseEnter:()=>f(E),children:E.getDate()},N)})})]},j)})})]})}const Jb="tempest_root_Nosqs",Yb="tempest_list_v9FNC",Xb="tempest_item_9RzZ7",Vb="tempest_link_67ULr",Zb="tempest_trigger_2gBDu",ey="tempest_panel_N2ujp",ty="tempest_subItem_LjtO7",we={root:Jb,list:Yb,item:Xb,link:Vb,trigger:Zb,panel:ey,subItem:ty};function ny({items:e,className:t,...n}){const[s,r]=l.useState(-1),[a,i]=l.useState(-1),c=l.useId(),u=l.useRef(null),d=l.useCallback(()=>{r(-1),i(-1)},[]),p=s!==-1?s:a;l.useEffect(()=>{if(p===-1)return;const f=_=>{_.key==="Escape"&&d()},h=_=>{u.current&&!u.current.contains(_.target)&&d()};return window.addEventListener("keydown",f),window.addEventListener("mousedown",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",h)}},[p,d]);const m=(f,h)=>{const _=()=>{f.onSelect?.(),d()};return f.href?o.jsx("a",{href:f.href,role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label}):o.jsx("button",{type:"button",role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label})};return o.jsx("nav",{ref:u,className:w.cn(we.root,t),...n,children:o.jsx("ul",{className:we.list,children:e.map((f,h)=>{if(!(!!f.children&&f.children.length>0))return o.jsx("li",{className:we.item,children:m(f,"none")},h);const v=p===h,y=`${c}-panel-${h}`;return o.jsxs("li",{className:we.item,onMouseEnter:()=>i(h),onMouseLeave:()=>i(g=>g===h?-1:g),children:[o.jsx("button",{type:"button",className:we.trigger,"aria-haspopup":"menu","aria-expanded":v,"aria-controls":y,onClick:()=>r(g=>g===h?-1:h),onFocus:()=>i(h),children:f.label}),v&&o.jsx("ul",{id:y,role:"menu",className:we.panel,children:f.children.map((g,x)=>o.jsx("li",{role:"none",className:we.subItem,children:m(g,"menuitem")},x))})]},h)})})})}const sy="tempest_root_PGUO2",ry="tempest_menu_hEVLT",oy="tempest_trigger_ZlZBx",ay="tempest_triggerOpen_Hpfbu",iy="tempest_panel_6ta6u",cy="tempest_item_wM-61",ly="tempest_itemLabel_wXfB2",uy="tempest_shortcut_qNlmN",dy="tempest_separator_LfK3t",je={root:sy,menu:ry,trigger:oy,triggerOpen:ay,panel:iy,item:cy,itemLabel:ly,shortcut:uy,separator:dy};function py(e){return"separator"in e}function my({menus:e,className:t,...n}){const[s,r]=l.useState(-1),a=l.useId(),i=l.useRef(null),c=l.useRef([]),u=l.useCallback(()=>{r(-1)},[]);return l.useEffect(()=>{if(s===-1)return;const d=m=>{if(m.key==="Escape"){u(),c.current[s]?.focus();return}if(m.key==="ArrowRight"){m.preventDefault();const f=(s+1)%e.length;r(f),c.current[f]?.focus()}if(m.key==="ArrowLeft"){m.preventDefault();const f=(s-1+e.length)%e.length;r(f),c.current[f]?.focus()}},p=m=>{i.current&&!i.current.contains(m.target)&&u()};return window.addEventListener("keydown",d),window.addEventListener("mousedown",p),()=>{window.removeEventListener("keydown",d),window.removeEventListener("mousedown",p)}},[s,e.length,u]),o.jsx("div",{ref:i,role:"menubar",className:w.cn(je.root,t),...n,children:e.map((d,p)=>{const m=s===p,f=`${a}-panel-${p}`;return o.jsxs("div",{className:je.menu,children:[o.jsx("button",{ref:h=>{c.current[p]=h},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?f:void 0,className:w.cn(je.trigger,m&&je.triggerOpen),onClick:()=>r(h=>h===p?-1:p),children:d.label}),m&&o.jsx("ul",{id:f,role:"menu",className:je.panel,children:d.items.map((h,_)=>py(h)?o.jsx("li",{role:"separator",className:je.separator,"aria-hidden":!0},_):o.jsx("li",{role:"none",children:o.jsxs("button",{type:"button",role:"menuitem",className:je.item,disabled:h.disabled,onClick:()=>{h.onSelect?.(),u()},children:[o.jsx("span",{className:je.itemLabel,children:h.label}),h.shortcut&&o.jsx("span",{className:je.shortcut,children:h.shortcut})]})},_))})]},p)})})}const fy="tempest_root_-w3-j",hy="tempest_viewport_n0hzM",_y="tempest_track_5PA8h",gy="tempest_slide_fhfjg",by="tempest_arrow_S92Lt",yy="tempest_prev_X8whU",vy="tempest_next_jBRSz",xy="tempest_dots_fL3Hr",wy="tempest_dot_vEB56",jy="tempest_dotActive_OSSUg",ae={root:fy,viewport:hy,track:_y,slide:gy,arrow:by,prev:yy,next:vy,dots:xy,dot:wy,dotActive:jy};function $y({children:e,loop:t=!1,showArrows:n=!0,showDots:s=!0,index:r,defaultIndex:a=0,onIndexChange:i,className:c,...u}){const d=e.length,p=r!==void 0,[m,f]=l.useState(a),h=p?r:m,_=l.useCallback(x=>{let b=x;b<0?b=t?d-1:0:b>=d&&(b=t?0:d-1),b!==h&&(p||f(b),i?.(b))},[d,t,h,p,i]),v=h<=0,y=h>=d-1,g=x=>{x.key==="ArrowRight"?(x.preventDefault(),_(h+1)):x.key==="ArrowLeft"&&(x.preventDefault(),_(h-1))};return o.jsxs("div",{role:"region","aria-roledescription":"carousel",tabIndex:0,className:w.cn(ae.root,c),onKeyDown:g,...u,children:[o.jsx("div",{className:ae.viewport,children:o.jsx("div",{className:ae.track,style:{transform:`translateX(-${h*100}%)`},children:e.map((x,b)=>o.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":`${b+1} of ${d}`,"aria-hidden":b!==h,className:ae.slide,children:x},b))})}),n&&d>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:w.cn(ae.arrow,ae.prev),"aria-label":"Previous slide",disabled:!t&&v,onClick:()=>_(h-1),children:"‹"}),o.jsx("button",{type:"button",className:w.cn(ae.arrow,ae.next),"aria-label":"Next slide",disabled:!t&&y,onClick:()=>_(h+1),children:"›"})]}),s&&d>1&&o.jsx("div",{className:ae.dots,role:"tablist","aria-label":"Slides",children:e.map((x,b)=>o.jsx("button",{type:"button",role:"tab","aria-label":`Go to slide ${b+1}`,"aria-selected":b===h,className:w.cn(ae.dot,b===h&&ae.dotActive),onClick:()=>_(b)},b))})]})}function Zn(e=1,t=50){const[n,s]=l.useState(e),[r,a]=l.useState(t),i=l.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:a,reset:i}}function ky(e,t,n){return l.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(a=>{const i=r[a];return i!=null&&String(i).toLowerCase().includes(s)})):e},[e,t,n])}function Ny(e){const[t,n]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=a=>n(a.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function Sy(e,t,n,s){const r=l.useRef(t);r.current=t,l.useEffect(()=>{const a=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!a?.addEventListener)return;const i=c=>r.current(c);return a.addEventListener(e,i,s),()=>a.removeEventListener(e,i,s)},[e,n,s])}const Cy=JSON.stringify,Ey=e=>JSON.parse(e);function Ty(e,t,n={}){const s=n.serialize??Cy,r=n.deserialize??Ey,a=l.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[i,c]=l.useState(a);l.useEffect(()=>{c(a())},[a]);const u=l.useCallback(p=>{c(m=>{const f=typeof p=="function"?p(m):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(f))}catch{}return f})},[e,s]),d=l.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}c(t)},[e,t]);return l.useEffect(()=>{if(typeof window>"u")return;const p=m=>{if(m.key===e){if(m.newValue===null){c(t);return}try{c(r(m.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[i,u,d]}function My(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(c=>!c),[]),r=l.useCallback(()=>n(!0),[]),a=l.useCallback(()=>n(!1),[]),i=l.useCallback(c=>n(c),[]);return[t,{toggle:s,setTrue:r,setFalse:a,set:i}]}function Ry(e,t=[],n={}){const{immediate:s=!1}=n,[r,a]=l.useState({status:"idle",data:void 0,error:void 0}),i=l.useRef(e);i.current=e;const c=l.useRef(0),u=l.useRef(!0);l.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const d=l.useCallback(async()=>{const m=++c.current;a(f=>({...f,status:"pending",error:void 0}));try{const f=await i.current();return u.current&&c.current===m&&a({status:"success",data:f,error:void 0}),f}catch(f){throw u.current&&c.current===m&&a({status:"error",data:void 0,error:f}),f}},[]),p=l.useCallback(()=>{c.current++,a({status:"idle",data:void 0,error:void 0})},[]);return l.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function Ly(){const[e,t]=l.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function Dy(){const[e,t]=l.useState(()=>typeof document>"u"?"visible":document.visibilityState);return l.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function Py(e,t={}){const[n,s]=l.useState(null),{once:r=!1,root:a,rootMargin:i,threshold:c}=t;return l.useEffect(()=>{const u=e.current;if(!u||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(u))},{root:a,rootMargin:i,threshold:c});return d.observe(u),()=>d.disconnect()},[e,r,a,i,c]),n}function Ay(e){const[t,n]=l.useState(null);return l.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(a=>{const i=a[0];if(!i)return;const c=i.contentRect;n({width:c.width,height:c.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function Iy(e={}){const{resetAfter:t=1500}=e,[n,s]=l.useState(!1),r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);l.useEffect(()=>()=>a(),[a]);const i=l.useCallback(async c=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(c);else if(typeof document<"u"){const u=document.createElement("textarea");u.value=c,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:i,reset:a}}function Fy(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,a=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==a)}function Oy(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function By(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;l.useEffect(()=>{if(s||typeof window>"u")return;const a=i=>{r&&Oy(i.target)||Fy(i,e)&&t(i)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}const $n=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function zy(e=6e4){const[t,n]=l.useState(!1);return l.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const a of $n)window.addEventListener(a,r,{passive:!0});return()=>{clearTimeout(s);for(const a of $n)window.removeEventListener(a,r)}},[e]),t}function Wy(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,a]=l.useState({loading:!n,error:null,coords:null,timestamp:null});return l.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){a(u=>({...u,loading:!1}));return}const i=u=>{a({loading:!1,error:null,coords:u.coords,timestamp:u.timestamp})},c=u=>{a(d=>({...d,loading:!1,error:u}))};if(t){const u=navigator.geolocation.watchPosition(i,c,s);return()=>navigator.geolocation.clearWatch(u)}navigator.geolocation.getCurrentPosition(i,c,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function qy(e){l.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])}function Uy(e){const t=l.useRef(e);return t.current=e,l.useCallback((...n)=>t.current(...n),[])}function Kt(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((r,a)=>Kt(r,t[a]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Kt(e[r],t[r]))}function Ky(e){const t=l.useRef(e);return Kt(t.current,e)||(t.current=e),t.current}function Hy(e){const t=l.useRef(void 0);return l.useEffect(()=>{t.current=e},[e]),t.current}function Gy(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setInterval(()=>n.current(),t);return()=>clearInterval(s)},[t])}function Qy(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setTimeout(()=>n.current(),t);return()=>clearTimeout(s)},[t])}function Jy(e,t){const[n,s]=l.useState(e),r=l.useRef(0),a=l.useRef(null);return l.useEffect(()=>{const i=Date.now(),c=i-r.current;return c>=t?(r.current=i,s(e)):(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r.current=Date.now(),s(e)},t-c)),()=>{a.current&&clearTimeout(a.current)}},[e,t]),n}function Yy(){const[e,t]=l.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight});return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t({width:window.innerWidth,height:window.innerHeight});return n(),window.addEventListener("resize",n,{passive:!0}),()=>window.removeEventListener("resize",n)},[]),e}function Xy(e){const[t,n]=l.useState(!1);return l.useEffect(()=>{const s=e.current;if(!s)return;const r=()=>n(!0),a=()=>n(!1);return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",a)}},[e]),t}function Vy(e,t,n={}){const{delay:s=500,moveThreshold:r=10}=n,a=l.useRef(t);a.current=t,l.useEffect(()=>{const i=e.current;if(!i)return;let c=null,u=0,d=0;const p=()=>{c&&(clearTimeout(c),c=null)},m=h=>{u=h.clientX,d=h.clientY,p(),c=setTimeout(()=>{c=null,a.current()},s)},f=h=>{if(c===null)return;const _=h.clientX-u,v=h.clientY-d;Math.hypot(_,v)>r&&p()};return i.addEventListener("pointerdown",m),i.addEventListener("pointermove",f),i.addEventListener("pointerup",p),i.addEventListener("pointercancel",p),i.addEventListener("pointerleave",p),()=>{p(),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",f),i.removeEventListener("pointerup",p),i.removeEventListener("pointercancel",p),i.removeEventListener("pointerleave",p)}},[e,s,r])}function Zy(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(!0),[]),r=l.useCallback(()=>n(!1),[]),a=l.useCallback(()=>n(c=>!c),[]),i=l.useMemo(()=>({open:s,close:r,toggle:a}),[s,r,a]);return[t,i]}function ev(e=[]){const[t,n]=l.useState(e),s=l.useCallback((...h)=>{n(_=>[..._,...h])},[]),r=l.useCallback((...h)=>{n(_=>[...h,..._])},[]),a=l.useCallback((h,..._)=>{n(v=>[...v.slice(0,h),..._,...v.slice(h)])},[]),i=l.useCallback((...h)=>{const _=new Set(h);n(v=>v.filter((y,g)=>!_.has(g)))},[]),c=l.useCallback(({from:h,to:_})=>{n(v=>{const y=[...v],[g]=y.splice(h,1);return y.splice(_,0,g),y})},[]),u=l.useCallback((h,_)=>{n(v=>v.map((y,g)=>g===h?_:y))},[]),d=l.useCallback(h=>n(h),[]),p=l.useCallback(h=>{n(_=>_.map(h))},[]),m=l.useCallback(()=>n([]),[]),f=l.useMemo(()=>({append:s,prepend:r,insert:a,remove:i,reorder:c,setItem:u,setState:d,apply:p,clear:m}),[s,r,a,i,c,u,d,p,m]);return[t,f]}const at=(e,t,n)=>{let s=e;return typeof t=="number"&&(s=Math.max(t,s)),typeof n=="number"&&(s=Math.min(n,s)),s};function tv(e=0,t={}){const{min:n,max:s}=t,[r,a]=l.useState(()=>at(e,n,s)),i=l.useCallback(()=>{a(m=>at(m+1,n,s))},[n,s]),c=l.useCallback(()=>{a(m=>at(m-1,n,s))},[n,s]),u=l.useCallback(m=>{a(at(m,n,s))},[n,s]),d=l.useCallback(()=>{a(at(e,n,s))},[e,n,s]),p=l.useMemo(()=>({increment:i,decrement:c,set:u,reset:d}),[i,c,u,d]);return[r,p]}function nv(e){l.useEffect(()=>{if(typeof document>"u")return;const t=document.title;return document.title=e,()=>{document.title=t}},[e])}function sv(e){l.useEffect(()=>{if(typeof document>"u")return;let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},[e])}function rv(e){const[t,n]=l.useState(()=>new Map(e)),s=l.useCallback((u,d)=>{n(p=>{const m=new Map(p);return m.set(u,d),m})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Map(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Map)},[]),i=l.useCallback(u=>t.get(u),[t]),c=l.useCallback(u=>t.has(u),[t]);return l.useMemo(()=>({map:t,set:s,delete:r,clear:a,get:i,has:c,size:t.size}),[t,s,r,a,i,c])}function ov(e){const[t,n]=l.useState(()=>new Set(e)),s=l.useCallback(u=>{n(d=>{if(d.has(u))return d;const p=new Set(d);return p.add(u),p})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Set(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Set)},[]),i=l.useCallback(u=>t.has(u),[t]),c=l.useCallback(u=>{n(d=>{const p=new Set(d);return p.has(u)?p.delete(u):p.add(u),p})},[]);return l.useMemo(()=>({set:t,add:s,delete:r,clear:a,has:i,toggle:c,size:t.size}),[t,s,r,a,i,c])}function av(e={}){const{initialValues:t=[],limit:n=1/0}=e,[s,r]=l.useState(()=>({queue:t.slice(0,n),overflow:t.slice(n)})),a=l.useCallback((...u)=>{r(d=>{const p=[...d.queue,...d.overflow,...u];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),i=l.useCallback(u=>{r(d=>{const p=[...u(d.queue),...d.overflow];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),c=l.useCallback(()=>{r(u=>({queue:u.overflow.slice(0,n),overflow:u.overflow.slice(n)}))},[n]);return l.useMemo(()=>({queue:s.queue,add:a,update:i,cleanQueue:c,size:s.queue.length}),[s.queue,a,i,c])}function iv(e){const t=l.useRef(null),n=l.useRef(e);return n.current=e,l.useEffect(()=>{if(typeof document>"u")return;const s=r=>{const a=r.target;!t.current||a&&t.current.contains(a)||n.current()};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),t}function cv(){const e=l.useRef(!0);return e.current?(e.current=!1,!0):!1}function lv(e){const[t,n]=l.useState(null);return l.useEffect(()=>{if(!e){n(null);return}const s=URL.createObjectURL(e);return n(s),()=>URL.revokeObjectURL(s)},[e]),t}const uv="tempest_wrapper_iB6ka",dv="tempest_search_2y-yM",pv="tempest_sortButton_9p6w4",mv="tempest_sortIndicator_bZMlH",gt={wrapper:uv,search:dv,sortButton:pv,sortIndicator:mv};function fv(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():typeof e=="boolean"&&typeof t=="boolean"?Number(e)-Number(t):String(e).localeCompare(String(t),void 0,{numeric:!0})}function hv({data:e,columns:t,pageSize:n=10,searchable:s=!1,searchKeys:r,initialSort:a,rowKey:i=(p,m)=>m,emptyMessage:c,className:u,...d}){const[p,m]=l.useState(""),[f,h]=l.useState(a??null),{page:_,setPage:v}=Zn(1,n),y=l.useMemo(()=>r&&r.length>0?r:t.filter(N=>{const S=e.find(D=>D[N.key]!=null),T=S?S[N.key]:void 0;return typeof T=="string"||typeof T=="number"}).map(N=>N.key),[r,t,e]),g=l.useMemo(()=>{const N=p.trim().toLowerCase();return!N||!s?e:e.filter(S=>y.some(T=>{const D=S[T];return D!=null&&String(D).toLowerCase().includes(N)}))},[e,p,s,y]),x=l.useMemo(()=>{if(!f)return g;const N=f.direction==="asc"?1:-1;return[...g].sort((S,T)=>fv(S[f.key],T[f.key])*N)},[g,f]),b=Math.max(1,Math.ceil(x.length/n));l.useEffect(()=>{_>b&&v(b)},[_,b,v]);const j=Math.min(_,b),k=l.useMemo(()=>{const N=(j-1)*n;return x.slice(N,N+n)},[x,j,n]);function M(N){h(S=>!S||S.key!==N?{key:N,direction:"asc"}:S.direction==="asc"?{key:N,direction:"desc"}:null)}const E=l.useMemo(()=>t.map(N=>{const T=f?.key===N.key?f?.direction==="asc"?" ▲":" ▼":"",D=N.sortable?o.jsxs("button",{type:"button",className:gt.sortButton,onClick:()=>M(N.key),"aria-label":`Ordenar por ${typeof N.header=="string"?N.header:String(N.key)}`,children:[N.header,o.jsx("span",{className:gt.sortIndicator,"aria-hidden":!0,children:T})]}):N.header;return{key:String(N.key),header:D,align:N.align,priority:N.priority,width:N.width,render:N.render?$=>N.render($):$=>$[N.key]??null}}),[t,f]);return o.jsxs("div",{className:w.cn(gt.wrapper,u),...d,children:[s&&o.jsx(Un,{value:p,onChange:N=>{m(N),v(1)},wrapperClassName:gt.search}),o.jsx(Hn,{columns:E,data:k,rowKey:(N,S)=>i(N,(j-1)*n+S),emptyMessage:c}),b>1&&o.jsx(Bn,{page:j,totalPages:b,onPageChange:v,totalItems:x.length})]})}const _v="tempest_tile_ZpED6",gv="tempest_interactive_3ICXQ",bv="tempest_selected_dMY11",yv="tempest_disabled_HnXxf",vv="tempest_leading_gSuBb",xv="tempest_trailing_cVd1n",wv="tempest_body_gyEl2",jv="tempest_title_jWFBN",$v="tempest_subtitle_GUtn7",$e={tile:_v,interactive:gv,selected:bv,disabled:yv,leading:vv,trailing:xv,body:wv,title:jv,subtitle:$v};function kv({leading:e,title:t,subtitle:n,trailing:s,onClick:r,disabled:a=!1,selected:i=!1,className:c}){const u=o.jsxs(o.Fragment,{children:[e!==void 0&&o.jsx("span",{className:$e.leading,children:e}),o.jsxs("span",{className:$e.body,children:[o.jsx("span",{className:$e.title,children:t}),n!==void 0&&o.jsx("span",{className:$e.subtitle,children:n})]}),s!==void 0&&o.jsx("span",{className:$e.trailing,children:s})]}),d=w.cn($e.tile,i&&$e.selected,a&&$e.disabled,c);return r?o.jsx("button",{type:"button",className:w.cn(d,$e.interactive),"aria-pressed":i?!0:void 0,disabled:a,onClick:r,children:u}):o.jsx("div",{className:d,children:u})}const Nv="tempest_fab_U3NIL",Sv="tempest_primary_8lnHI",Cv="tempest_surface_ZTMQ4",Ev="tempest_round_ljguw",Tv="tempest_sm_3-rLi",Mv="tempest_md_vOdzW",Rv="tempest_lg_Xc6vE",Lv="tempest_extended_GhPio",Dv="tempest_icon_cZ8Nq",Pv="tempest_label_tfoCq",Av="tempest_fixed_Xr8Xa",Iv="tempest_bottomRight_bJ8Oo",Fv="tempest_bottomLeft_USN6N",me={fab:Nv,primary:Sv,surface:Cv,round:Ev,sm:Tv,md:Mv,lg:Rv,extended:Lv,icon:Dv,label:Pv,fixed:Av,bottomRight:Iv,bottomLeft:Fv};function Ov({icon:e,label:t,position:n="bottom-right",size:s="md",variant:r="primary",className:a,...i}){const c=t!==void 0;return o.jsxs("button",{type:"button",className:w.cn(me.fab,me[s],me[r],c?me.extended:me.round,n!=="none"&&me.fixed,n==="bottom-right"&&me.bottomRight,n==="bottom-left"&&me.bottomLeft,a),...i,children:[o.jsx("span",{className:me.icon,children:e}),c&&o.jsx("span",{className:me.label,children:t})]})}const Bv="tempest_rail_bvns5",zv="tempest_header_Mikit",Wv="tempest_list_rS6XJ",qv="tempest_footer_ojpGC",Uv="tempest_item_XEXI9",Kv="tempest_active_U3hSU",Hv="tempest_iconWrap_iVwlb",Gv="tempest_icon_-hpb6",Qv="tempest_badge_1YxwU",Jv="tempest_label_zCKyA",fe={rail:Bv,header:zv,list:Wv,footer:qv,item:Uv,active:Kv,iconWrap:Hv,icon:Gv,badge:Qv,label:Jv};function Yv({items:e,value:t,onChange:n,header:s,footer:r,labelVisibility:a="all",className:i,...c}){return o.jsxs("nav",{className:w.cn(fe.rail,i),"aria-label":"Navegação lateral",...c,children:[s!==void 0&&o.jsx("div",{className:fe.header,children:s}),o.jsx("ul",{className:fe.list,children:e.map(u=>{const d=u.key===t,p=a==="all"||a==="selected"&&d;return o.jsx("li",{children:o.jsxs("button",{type:"button",className:w.cn(fe.item,d&&fe.active),"aria-current":d?"page":void 0,disabled:u.disabled,onClick:()=>n(u.key),children:[o.jsxs("span",{className:fe.iconWrap,children:[u.icon&&o.jsx("span",{className:fe.icon,children:u.icon}),u.badge!==void 0&&o.jsx("span",{className:fe.badge,children:u.badge})]}),p&&o.jsx("span",{className:fe.label,children:u.label})]})},u.key)})}),r!==void 0&&o.jsx("div",{className:fe.footer,children:r})]})}const Xv="tempest_wrapper_tFKNC",Vv="tempest_label_FUecv",Zv="tempest_columns_XMru6",ex="tempest_column_bwotJ",tx="tempest_cellWrapper_xRos3",nx="tempest_cell_eSc7G",sx="tempest_active_6amgd",rx="tempest_helper_ihHGE",ox="tempest_disabled_NDezB",O={wrapper:Xv,label:Vv,columns:Zv,column:ex,cellWrapper:tx,cell:nx,active:sx,helper:rx,disabled:ox};function bt(e){return e.toString().padStart(2,"0")}function ax(e){const t=/^(\d{1,2}):(\d{1,2})$/.exec(e.trim());if(!t)return{hour24:null,minute:null};const n=Number(t[1]),s=Number(t[2]);return n<0||n>23||s<0||s>59?{hour24:null,minute:null}:{hour24:n,minute:s}}function ix(e){const t=e%12;return t===0?12:t}function Pt(e,t){const n=e%12;return t==="PM"?n+12:n}function cx({value:e,onChange:t,minuteStep:n=5,use12Hours:s=!1,label:r,helperText:a,disabled:i,className:c}){const u=l.useId(),{hour24:d,minute:p}=l.useMemo(()=>ax(e),[e]),m=d!==null&&d>=12?"PM":"AM",f=l.useMemo(()=>s?Array.from({length:12},(b,j)=>j+1):Array.from({length:24},(b,j)=>j),[s]),h=l.useMemo(()=>{const b=n>0?n:1,j=[];for(let k=0;k<60;k+=b)j.push(k);return j},[n]),_=d===null?null:s?ix(d):d,v=(b,j)=>{t(`${bt(b)}:${bt(j)}`)},y=b=>{if(i)return;const j=p??0,k=s?Pt(b,m):b;v(k,j)},g=b=>{if(i)return;const j=d??(s?Pt(12,"AM"):0);v(j,b)},x=b=>{if(i)return;const j=_??12,k=p??0;v(Pt(j,b),k)};return o.jsxs("div",{className:w.cn(O.wrapper,i&&O.disabled,c),children:[r&&o.jsx("span",{id:`${u}-label`,className:O.label,children:r}),o.jsxs("div",{className:O.columns,children:[o.jsx("ul",{role:"listbox","aria-label":"Horas",className:O.column,children:f.map(b=>{const j=b===_;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>y(b),children:s?b:bt(b)})},b)})}),o.jsx("ul",{role:"listbox","aria-label":"Minutos",className:O.column,children:h.map(b=>{const j=b===p;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>g(b),children:bt(b)})},b)})}),s&&o.jsx("ul",{role:"listbox","aria-label":"Período",className:O.column,children:["AM","PM"].map(b=>{const j=_!==null&&b===m;return o.jsx("li",{className:O.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:i,className:w.cn(O.cell,j&&O.active),onClick:()=>x(b),children:b})},b)})})]}),a&&o.jsx("span",{className:O.helper,children:a})]})}const lx="tempest_wrapper_vGp-3",ux="tempest_indicator_S7mV0",dx="tempest_content_bZdpc",px="tempest_dragging_BvUty",yt={wrapper:lx,indicator:ux,content:dx,dragging:px};function mx(e,t){const n=t*1.5;return Math.min(e/2,n)}function fx({onRefresh:e,children:t,threshold:n=80,disabled:s,className:r}){const a=l.useRef(null),i=l.useRef(null),[c,u]=l.useState(0),[d,p]=l.useState(!1),m=i.current!==null,f=x=>{if(s||d)return;const b=a.current;if(!b||b.scrollTop>0)return;const j=x.touches[0];j&&(i.current=j.clientY)},h=x=>{if(s||d)return;const b=i.current;if(b===null)return;const j=x.touches[0];if(!j)return;const k=j.clientY-b;if(k<=0){u(0);return}u(mx(k,n))},_=()=>{i.current=null,u(0)},v=async()=>{if(s||d){_();return}if(!(i.current!==null&&c>=n)){_();return}i.current=null,p(!0),u(n);try{await e()}finally{p(!1),u(0)}},y=d||c>0,g=Math.min(1,c/n);return o.jsxs("div",{ref:a,className:w.cn(yt.wrapper,r),"data-refreshing":d,onTouchStart:f,onTouchMove:h,onTouchEnd:v,children:[o.jsx("div",{className:yt.indicator,"aria-hidden":!y,style:{opacity:d?1:g,transform:`translateX(-50%) translateY(${y?c:0}px) rotate(${g*360}deg)`},children:o.jsx(Kn,{size:"sm",label:"Atualizando"})}),o.jsx("div",{className:w.cn(yt.content,(m||d)&&yt.dragging),style:{transform:`translateY(${y?c:0}px)`},children:t})]})}function hx(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function _x(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function gx(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 es(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 ts(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 bx(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}const yx={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{}}};function vx(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function xx(e,t,n="…"){if(e.length<=t)return e;const s=Math.max(0,t-n.length);return e.slice(0,s).trimEnd()+n}function wx(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function jx(e){const t=e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.map((n,s)=>{const r=n.toLowerCase();return s===0?r:r.charAt(0).toUpperCase()+r.slice(1)}).join("")}function $x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function kx(e,t,n){return e===1?t:n??`${t}s`}function Nx(e,t){const n={};for(const s of e){const r=t(s);(n[r]??=[]).push(s)}return n}function Sx(e,t){const n=new Set,s=[];for(const r of e){const a=t(r);n.has(a)||(n.add(a),s.push(r))}return s}function Cx(e,t){if(t<1)throw new RangeError(`chunk size must be >= 1, received ${t}`);const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n}function Ex(e,t,n=1){const s=[];if(n===0)return s;if(n>0)for(let r=e;r<t;r+=n)s.push(r);else for(let r=e;r>t;r+=n)s.push(r);return s}function it(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Tx(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}function Mx(e,t){const n=new Set(t),s={};for(const r of Object.keys(e))n.has(r)||(s[r]=e[r]);return s}function ns(e,t){if(!it(e)||!it(t))return t===void 0?e:t;const n={...e};for(const s of Object.keys(t)){const r=t[s],a=n[s];it(a)&&it(r)?n[s]=ns(a,r):n[s]=r}return n}function Rx(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:it(e)?Object.keys(e).length===0:!1}function Lx(e){return e!=null}function Dx(e){return typeof e=="string"}function Px(e){return typeof e=="number"&&!Number.isNaN(e)}function Ax(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ix(e,t){throw new Error(t??`Unexpected value: ${String(e)}`)}function Fx(e,t){let n;const s=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return s.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},s}function Ox(e,t){let n,s,r=0;const a=c=>{r=Date.now(),e(...c)},i=(...c)=>{const u=Date.now(),d=t-(u-r);d<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(c)):(s=c,n===void 0&&(n=setTimeout(()=>{if(n=void 0,s!==void 0){const p=s;s=void 0,a(p)}},d)))};return i.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),s=void 0,r=0},i}function Bx(e){let t=!1,n;return(...s)=>(t||(t=!0,n=e(...s)),n)}function zx(e){let t=!1,n,s;const r=a=>{if(!t||a.length!==n.length)return!1;for(let i=0;i<a.length;i++)if(!Object.is(a[i],n[i]))return!1;return!0};return(...a)=>(r(a)||(n=a,s=e(...a),t=!0),s)}function Wx(e){return new Promise(t=>setTimeout(t,e))}function qx(e,t,n){return new Promise((s,r)=>{const a=setTimeout(()=>{const i=new Error(n??`Operation timed out after ${t}ms`);i.name="TimeoutError",r(i)},t);e.then(i=>{clearTimeout(a),s(i)},i=>{clearTimeout(a),r(i)})})}function Jt(e){let t;if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")t=crypto.randomUUID();else{const n=Date.now().toString(36),s=Math.random().toString(36).slice(2,10);t=`${n}-${s}`}return e?`${e}-${t}`:t}class kt extends Error{status;detail;code;requestId;body;constructor(t){super(t.detail),this.name="TempestApiError",this.status=t.status,this.detail=t.detail,this.code=t.code,this.requestId=t.requestId,this.body=t.body}}function Ux(e){return typeof e=="object"&&e!==null&&typeof e.status=="number"&&typeof e.detail=="string"}function Yt(e,t,n,s){const r=typeof t=="object"&&t!==null?t:null,a=r?.detail??r?.message??`Erro ${e}`,i=typeof r?.code=="string"?r.code:void 0,c=typeof r?.details=="object"&&r.details!==null?r.details:null,u=(typeof c?.request_id=="string"?c.request_id:void 0)??n?.get("X-Request-ID")??s??void 0;return{status:e,detail:String(a),code:i,requestId:u??void 0,retryAfter:Kx(n?.get("Retry-After")),body:t}}function Kx(e){if(!e)return;const t=e.trim();if(/^\d+$/.test(t))return Number(t);const n=Date.parse(t);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function Hx(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,a]of Object.entries(n))a!=null&&s.searchParams.set(r,String(a));return s.toString()}function Gx(e){return typeof FormData<"u"&&e instanceof FormData}async function kn(e,t){let n=null;try{n=await e.clone().json()}catch{try{n=await e.text()}catch{n=null}}return new kt(Yt(e.status,n,e.headers,t))}function xt(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const i=e.getToken?.();return i?{Authorization:`Bearer ${i}`}:{}}async function s(i,c,u){const{body:d,params:p,headers:m,...f}=c,h=Gx(d),_={...h?{}:{"Content-Type":"application/json"},...u?{"X-Request-ID":u}:{},...e.headers,...n(),...m},v={...f,headers:_,credentials:e.withCredentials?"include":f.credentials,body:d==null?void 0:h?d:JSON.stringify(d)};return t(Hx(e.baseURL,i,p),v)}async function r(i,c={}){const u=e.requestId?e.requestId():Jt();let d=await s(i,c,u);if(d.status===401)if(e.refresh)try{await e.refresh(),d=await s(i,c,u)}catch{throw await e.onUnauthorized?.(d),await kn(d,u)}else await e.onUnauthorized?.(d);if(!d.ok)throw await kn(d,u);return d.status===204?void 0:(d.headers.get("content-type")??"").includes("application/json")?await d.json():await d.text()}async function a(i,c,u="POST"){return r(i,{method:u,body:c})}return{request:r,get:(i,c)=>r(i,{...c,method:"GET"}),post:(i,c)=>r(i,{...c,method:"POST"}),put:(i,c)=>r(i,{...c,method:"PUT"}),patch:(i,c)=>r(i,{...c,method:"PATCH"}),delete:(i,c)=>r(i,{...c,method:"DELETE"}),upload:a}}function Qx(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const a=s.error.issues.map(i=>` - ${i.path.join(".")||"<root>"}: ${i.message}`).join(`
2
2
  `);throw new Error(`[parseResponse] Contract drift on ${n}:
3
3
  ${a}
4
4
 
5
- Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function Qx(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function Jx(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:a,withCredentials:i=!1,onProgress:c,signal:u,parser:d=JSON.parse,requestId:p}=e;return new Promise((m,f)=>{if(u?.aborted){f(new DOMException("Aborted","AbortError"));return}const h=new XMLHttpRequest;h.open(s,t),h.withCredentials=i;const _=a?.(),v=p?p():Jt(),y={...r};_&&!("Authorization"in y)&&(y.Authorization=`Bearer ${_}`),v&&!("X-Request-ID"in y)&&(y["X-Request-ID"]=v);for(const[x,b]of Object.entries(y))h.setRequestHeader(x,b);c&&(h.upload.onprogress=x=>{c({loaded:x.loaded,total:x.total,fraction:x.lengthComputable?x.loaded/x.total:null,lengthComputable:x.lengthComputable})});function g(){h.abort()}u?.addEventListener("abort",g),h.onload=()=>{u?.removeEventListener("abort",g);const x=h.status>=200&&h.status<300,b=h.getResponseHeader("content-type")??"";if(!x){const j=Qx(h.responseText);f(new kt(Yt(h.status,j,{get:k=>h.getResponseHeader(k)},v)));return}if(h.status===204||!h.responseText){m(void 0);return}if(b.includes("application/json"))try{m(d(h.responseText))}catch(j){f(j)}else m(h.responseText)},h.onerror=()=>{u?.removeEventListener("abort",g),f(new kt({status:0,detail:"Falha de rede no upload.",requestId:v||void 0}))},h.onabort=()=>{u?.removeEventListener("abort",g),f(new DOMException("Aborted","AbortError"))},h.send(n)})}function Yx(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Xx(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,respectRetryAfter:a=!0,shouldRetry:i=()=>!0,onRetry:c,signal:u}=t;let d=0,p;for(;d<n;){if(u?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(m){if(p=m,d+=1,d>=n||!i(m,d))throw m;const f=a&&typeof m?.retryAfter=="number"?m.retryAfter*1e3:null,h=Math.min(f!==null?f:s*2**(d-1),r);c?.({attempt:d,delay:h,error:m}),await Yx(h,u)}}throw p}function Vx(){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 Zx(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:a}=t,[i,c]=l.useState(null),[u,d]=l.useState(null),[p,m]=l.useState(!s),f=l.useRef(s),h=l.useRef(!1),_=l.useRef(null);async function v(){if(!(f.current||h.current)){h.current=!0;try{const y=await e();if(f.current)return;c(y),d(null),r?.(y)&&(f.current=!0)}catch(y){f.current||(d(y),a?.(y))}finally{h.current=!1,m(!1),f.current||(_.current=setTimeout(v,n))}}}return l.useEffect(()=>{if(f.current=s,s){_.current&&clearTimeout(_.current);return}return m(!0),v(),()=>{f.current=!0,_.current&&clearTimeout(_.current)}},[n,s]),{data:i,error:u,loading:p,stop:()=>{f.current=!0,_.current&&clearTimeout(_.current)},start:()=>{f.current&&(f.current=!1,v())}}}function ss(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:a})=>s({user:r,token:a,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:wt.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function ew({isAuthenticated:e,children:t,fallback:n}){return o.jsx(o.Fragment,{children:e?t:n})}function Nn(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 Xt(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(Nn(n)),payload:JSON.parse(Nn(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function tw(e,t=0){try{const{payload:n}=Xt(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function rs(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function a(i=1){try{return await e()}catch(c){if(i>=n)throw r&&typeof window<"u"&&window.location.reload(),c;return await new Promise(u=>setTimeout(u,s*2**(i-1))),a(i+1)}}return l.lazy(a)}function os(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function nw(e){const t=e??{};return{token:t.access_token,refreshToken:t.refresh_token}}function sw(e){const{baseURL:t,loginPath:n="/api/auth/login",refreshPath:s="/api/auth/refresh",mePath:r,storeName:a="tempest-auth",storage:i="local",withCredentials:c=!1,fetcher:u,parseTokens:d=nw,parseUser:p,refreshBody:m=S=>S?{refresh_token:S}:void 0}=e,f=ss({name:a,storage:i}),h=`${a}-refresh`;function _(){return typeof window>"u"?null:i==="session"?window.sessionStorage:window.localStorage}function v(){return _()?.getItem(h)??null}function y(S){const T=_();T&&(S?T.setItem(h,S):T.removeItem(h))}const g=()=>f.getState(),x=()=>g().token,b=xt({baseURL:t,withCredentials:c,fetcher:u});async function j(){if(!r)return g().user;const S=x(),T=await xt({baseURL:t,withCredentials:c,fetcher:u,getToken:()=>S}).get(r);return g().setUser(T),T}async function k(S){const T=await b.post(n,{body:S}),{token:D,refreshToken:$}=d(T);g().setToken(D),y($??null);const C=p?.(T);return C!=null?(g().setUser(C),C):j()}function M(){g().logout(),y(null)}const E=os(async()=>{const S=await b.post(s,{body:m(v())}),{token:T,refreshToken:D}=d(S);g().setToken(T),D&&y(D)}),N=xt({baseURL:t,withCredentials:c,fetcher:u,getToken:x,refresh:E,onUnauthorized:()=>M()});return{useAuthStore:f,api:N,login:k,logout:M,refresh:E,getToken:x}}const as=l.createContext(null);function rw({control:e,children:t}){return o.jsx(as.Provider,{value:e,children:t})}function is(){return l.useContext(as)}function ow(e){return typeof e=="boolean"?{can:e}:e}function cs(e){const t=is(),n=JSON.stringify(e),[s,r]=l.useState(()=>t?{allowed:!1,isLoading:!0}:{allowed:!0,isLoading:!1});return l.useEffect(()=>{if(!t){r({allowed:!0,isLoading:!1});return}let a=!1;return r(i=>({...i,isLoading:!0})),Promise.resolve(t.can(e)).then(i=>{if(a)return;const c=ow(i);r({allowed:c.can,isLoading:!1,reason:c.reason})}).catch(i=>{a||r({allowed:!1,isLoading:!1,reason:i instanceof Error?i.message:"access check failed"})}),()=>{a=!0}},[t,n]),s}function aw({action:e,resource:t,params:n,children:s,fallback:r}){const{allowed:a,isLoading:i}=cs({action:e,resource:t,params:n});return i?o.jsx(o.Fragment,{children:r??null}):o.jsx(o.Fragment,{children:a?s:r??null})}function iw(e){const t=new Set(e.permissions??[]),n=e.role?Array.isArray(e.role)?e.role:[e.role]:[];for(const s of n)for(const r of e.roles?.[s]??[])t.add(r);return t}function cw(e){const t=iw(e);return{can({action:n,resource:s}){return t.has("*")||s!==void 0&&(t.has(`${s}:*`)||t.has(`${s}:${n}`))||s===void 0&&t.has(n)?{can:!0}:{can:!1,reason:"missing permission"}}}}function At(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"?e.split(/\s+/).filter(Boolean):[]}function lw(e,t){try{const{payload:n}=Xt(e),s=t?.claim??"permissions",r=At(n[s]);if(r.length>0)return r;if(t?.claim===void 0){const a=At(n.scopes);return a.length>0?a:At(n.scope)}return r}catch{return[]}}function uw({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:a,shape:i,size:c,disableOneTap:u,width:d,className:p,style:m}){return o.jsx("div",{className:p,style:m,children:e({onSuccess:f=>{if(!f.credential){n?.({provider:"google",message:"Google returned no credential",raw:f});return}return t({idToken:f.credential,provider:"google",raw:f})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:a,shape:i,size:c,useOneTap:!u,width:d})})}function dw(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,a]=l.useState(null),[i,c]=l.useState(null),[u,d]=l.useState("pending"),p=l.useRef(!1);return l.useEffect(()=>{if(p.current)return;p.current=!0;let m=!1;return t().then(f=>{if(!m)return a(f),d("success"),n?.(f)}).catch(f=>{m||(c(f),d("error"),s?.(f))}),()=>{m=!0}},[t,n,s]),{loading:u==="pending",data:r,error:i,status:u}}const ls={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},us={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},pw={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function mw(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...a)=>[e,...r(...a)]:n[s]=[e,...r];return n}function ds({children:e,client:t,defaultOptions:n}){const[s]=l.useState(()=>t??new Q.QueryClient({defaultOptions:{queries:{staleTime:ls.DEFAULT,gcTime:us.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return o.jsx(Q.QueryClientProvider,{client:s,children:e})}function fw(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.total=="number"&&typeof t.pages=="number"}function hw(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.has_more=="boolean"&&"next_cursor"in t}function _w(e=20){return{items:[],total:0,page:1,size:e,pages:0}}function gw(e){const{queryKey:t,queryFn:n,initialPage:s=1,pageSize:r=20,sizeParam:a="size",orderBy:i,ascending:c=!1,...u}=e,[d,p]=l.useState(s),m=Q.useQuery({...u,queryKey:[...t,{page:d,pageSize:r,sizeParam:a,orderBy:i,ascending:c}],queryFn:()=>{const b={page:d,[a]:r};return i&&(b.order_by=i,b.ascending=c),n(b)},placeholderData:Q.keepPreviousData}),f=m.data,h=f?.pages??0,_=d<h,v=d>1,y=l.useCallback(b=>p(Math.max(1,b)),[]),g=l.useCallback(()=>p(b=>b<h?b+1:b),[h]),x=l.useCallback(()=>p(b=>b>1?b-1:b),[]);return{page:f,items:f?.items??[],pageNumber:d,pageCount:h,total:f?.total??0,hasNext:_,hasPrev:v,isLoading:m.isLoading,isFetching:m.isFetching,error:m.error,setPage:y,next:g,prev:x,refetch:()=>{m.refetch()}}}function bw(e){const{queryKey:t,queryFn:n,limit:s=20,orderBy:r,ascending:a=!1,...i}=e,c=Q.useInfiniteQuery({...i,queryKey:[...t,{limit:s,orderBy:r,ascending:a}],initialPageParam:null,queryFn:({pageParam:d})=>n({cursor:d,limit:s,order_by:r,ascending:a}),getNextPageParam:d=>d.has_more?d.next_cursor:void 0}),u=c.data?.pages??[];return{items:u.flatMap(d=>d.items),pages:u,hasNextPage:c.hasNextPage,isLoading:c.isLoading,isFetchingNextPage:c.isFetchingNextPage,error:c.error,fetchNextPage:()=>{c.fetchNextPage()},refetch:()=>{c.refetch()}}}const yw=(e,t)=>t==null?`/${e}`:`/${e}/${t}`;function vw(e,t={}){const{pageParam:n="page",sizeParam:s="size",sortFieldParam:r="order_by",sortOrderParam:a="ascending",sortOrderAsBoolean:i=!0,updateMethod:c="patch",buildPath:u=yw}=t,d={getList(p,m={}){const{pagination:f,sort:h,filters:_}=m,v={};if(f?.page!=null&&(v[n]=f.page),f?.pageSize!=null&&(v[s]=f.pageSize),h?.field){const g=h.order??"asc";v[r]=h.field,v[a]=i?g==="asc":g}if(_)for(const[g,x]of Object.entries(_))v[g]=x;const y={params:v};return e.get(u(p),y)},getOne(p,m){return e.get(u(p,m))},getMany(p,m){return Promise.all(m.map(f=>d.getOne(p,f)))},create(p,m){return e.post(u(p),{body:m})},update(p,m,f){const h=u(p,m);return c==="put"?e.put(h,{body:f}):e.patch(h,{body:f})},deleteOne(p,m){return e.delete(u(p,m))}};return d}const ps=l.createContext(null);function xw({provider:e,children:t}){return o.jsx(ps.Provider,{value:e,children:t})}function Ze(){const e=l.useContext(ps);if(!e)throw new Error("useDataProvider must be used within a <TempestDataProvider>");return e}function ms(e,t){return["data",e,"list",t]}function Vt(e,t){return["data",e,"one",t]}function ww(e,t,n){const s=Ze();return Q.useQuery({queryKey:ms(e,t),queryFn:()=>s.getList(e,t),...n})}function jw(e,t,n){const s=Ze(),{enabled:r,...a}=n??{};return Q.useQuery({queryKey:Vt(e,t),queryFn:()=>s.getOne(e,t),enabled:t!=null&&(r??!0),...a})}function $w(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:r=>n.create(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function kw(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:({id:r,data:a})=>n.update(e,r,a),onSuccess:(...r)=>{const[,a]=r;s.invalidateQueries({queryKey:["data",e,"list"]}),s.invalidateQueries({queryKey:Vt(e,a.id)}),t?.onSuccess?.(...r)},...t})}function Nw(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:r=>n.deleteOne(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function fs({when:e,redirectTo:t="/",replace:n=!0,children:s}){return o.jsx(o.Fragment,{children:e?s:o.jsx(A.Navigate,{to:t,replace:n})})}function Sw(e){return e}const Sn=new WeakMap;function Cw(e){let t=Sn.get(e);return t||(t=rs(e.lazy),Sn.set(e,t)),t}function Ew({guard:e,redirectTo:t,children:n}){const s=typeof e=="function"?e():e;return o.jsx(fs,{when:s,redirectTo:t,children:n})}function hs(e){return e.map((t,n)=>{let s=t.element;if(t.lazy){const r=Cw(t);s=o.jsx(r,{})}return t.guard!==void 0&&(s=o.jsx(Ew,{guard:t.guard,redirectTo:t.redirectTo,children:s})),t.index?o.jsx(A.Route,{index:!0,element:s},`index-${n}`):o.jsx(A.Route,{path:t.path,element:s,caseSensitive:t.caseSensitive,children:t.children?hs(t.children):null},t.path??`route-${n}`)})}const Tw={browser:A.BrowserRouter,hash:A.HashRouter,memory:A.MemoryRouter};function Mw({routes:e,router:t="browser",basename:n,initialEntries:s,fallback:r=null}){const a=l.useMemo(()=>hs(e),[e]),i=Tw[t],c=t==="memory"?{basename:n,initialEntries:s}:{basename:n};return o.jsx(i,{...c,children:o.jsx(l.Suspense,{fallback:r,children:o.jsx(A.Routes,{children:a})})})}function Rw(e,t={}){if(!t.persist)return Ot.create()(e);const{name:n,storage:s="local",partialize:r,version:a,migrate:i}=t.persist,c=s==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(e,{name:n,storage:wt.createJSONStorage(c),...r?{partialize:r}:{},...a!==void 0?{version:a}:{},...i?{migrate:i}:{}}))}function Lw(e){const t=e;t.use={};for(const n of Object.keys(e.getState()))t.use[n]=()=>e(s=>s[n]);return t}const _s=l.createContext(null);function Cn(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function En(e,t,n,s){const r=Array.isArray(n)?n:[n];for(const a of r)e.setAttribute(a,t);if(s&&typeof document<"u"){const a=document.querySelector('meta[name="theme-color"]');a&&(a.content=s[t])}}function Dw(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 gs({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme",themeColor:a}){const[i,c]=l.useState(()=>Dw(n)??t),[u,d]=l.useState(()=>Cn(i)),p=l.useRef(s);p.current=s;const m=Array.isArray(r)?r.join(","):r,f=l.useRef(a);f.current=a,l.useEffect(()=>{const y=p.current?.()??document.documentElement;if(!y)return;const g=Cn(i);En(y,g,r,f.current),d(g)},[i,m]),l.useEffect(()=>{if(i!=="system"||typeof window>"u")return;const y=window.matchMedia("(prefers-color-scheme: dark)"),g=()=>{const x=p.current?.()??document.documentElement;if(!x)return;const b=y.matches?"dark":"light";En(x,b,r,f.current),d(b)};return y.addEventListener("change",g),()=>y.removeEventListener("change",g)},[i,m]);const h=l.useCallback(y=>{if(c(y),n&&typeof window<"u")try{window.localStorage.setItem(n,y)}catch{}},[n]),_=l.useCallback(()=>{h(u==="dark"?"light":"dark")},[u,h]),v=l.useMemo(()=>({theme:i,resolvedTheme:u,setTheme:h,toggle:_}),[i,u,h,_]);return o.jsx(_s.Provider,{value:v,children:e})}function Pw(){const e=l.useContext(_s);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function Tn(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function It(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const a=e[n]?.[s];if(a!==void 0)return a}return null}function Zt(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(u,d){const p=It(s,t,n,u);return p===null?u:Tn(p,d)}function a(u,d,p){const f=It(s,t,n,`${u}${d===1?"_one":"_other"}`)??It(s,t,n,u);return f===null?u:Tn(f,{count:d,...p??{}})}function i(u,d){return new Intl.NumberFormat(t,d).format(u)}function c(u,d){const p=typeof u=="string"?new Date(u):u;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:a,formatNumber:i,formatDate:c,withLocale:u=>Zt({locale:u,fallbackLocale:n??void 0,messages:s})}}const bs=l.createContext(null);function Aw(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 ys({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const a=l.useMemo(()=>Object.keys(s),[s]),[i,c]=l.useState(()=>Aw(r,a)??t);l.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",i)},[i]);const u=l.useCallback(p=>{if(c(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=l.useMemo(()=>({...Zt({locale:i,fallbackLocale:n,messages:s}),setLocale:u,availableLocales:a}),[i,n,s,u,a]);return o.jsx(bs.Provider,{value:d,children:e})}function vs(){const e=l.useContext(bs);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function Iw(){return vs().t}function Fw(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 xs extends l.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&Fw(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 Ow({children:e,query:t,theme:n,i18n:s,errorBoundary:r}){let a=e;return s&&(a=o.jsx(ys,{...s,children:a})),n!==!1&&(a=o.jsx(gs,{...n||{},children:a})),t!==!1&&(a=o.jsx(ds,{...t||{},children:a})),r&&(a=o.jsx(xs,{...r,children:a})),o.jsx(o.Fragment,{children:a})}function Bw(e){try{return JSON.parse(e)}catch{return e}}function ws(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:a=10,initialBackoff:i=1e3,maxBackoff:c=3e4,parser:u=Bw,onOpen:d,onMessage:p,onError:m,onStatusChange:f}=t;let h=null,_=null,v=0,y="idle",g=!1;function x(N){y!==N&&(y=N,f?.(N))}function b(N,S){r.includes(N)||p?.({event:N,data:u(S.data),id:S.lastEventId||void 0,raw:S})}function j(){if(g)return;if(v>=a){x("error");return}const N=Math.min(i*2**v,c);v+=1,_=setTimeout(k,N)}function k(){if(g)return;h&&h.close(),x("connecting");const N=new EventSource(e,{withCredentials:n});h=N,N.onopen=()=>{v=0,x("open"),d?.()},N.onmessage=S=>b("message",S);for(const S of s)N.addEventListener(S,T=>b(S,T));for(const S of r)N.addEventListener(S,()=>{});N.onerror=S=>{m?.(S),N.close(),h=null,x("closed"),j()}}function M(){g=!0,_&&(clearTimeout(_),_=null),v=0,h&&(h.close(),h=null),x("closed")}function E(){_&&(clearTimeout(_),_=null),v=0,g=!1,k()}return k(),{close:M,reconnect:E,get status(){return y}}}function zw(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,i]=l.useState("idle"),[c,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);return p.current=s,l.useEffect(()=>{if(!n||!e){i("idle");return}const m=ws(e,{...r,onStatusChange:i,onMessage:f=>{u(f),p.current?.(f)}});return d.current=m.reconnect,()=>{m.close(),d.current=null}},[e,n]),{status:a,lastMessage:c,reconnect:()=>d.current?.()}}function js(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),a=new Uint8Array(r);for(let i=0;i<s.length;i++)a[i]=s.charCodeAt(i);return a}function lt(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class Ht extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class $s extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class ks{config;constructor(t){this.config=t}static isSupported(){return lt()}async registration(){if(!lt())throw new Ht;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 Ht;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return lt()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new $s;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:js(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function Ww(e){const t=l.useRef(e);t.current=e;const n=l.useMemo(()=>new ks({vapidPublicKey:e.vapidPublicKey,onSubscribe:v=>t.current.onSubscribe(v),onUnsubscribe:v=>t.current.onUnsubscribe?.(v),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=l.useState(()=>lt()),[r,a]=l.useState(()=>n.permission()),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[p,m]=l.useState(null),f=l.useCallback(async()=>{if(s){a(n.permission());try{const v=await n.isSubscribed();c(v)}catch(v){m(v instanceof Error?v:new Error(String(v)))}}},[n,s]);l.useEffect(()=>{f()},[f]);const h=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.subscribe(),c(!0),a(n.permission())}catch(v){throw m(v instanceof Error?v:new Error(String(v))),v}finally{d(!1)}}},[n,s]),_=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.unsubscribe(),c(!1)}catch(v){throw m(v instanceof Error?v:new Error(String(v))),v}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:i,loading:u,error:p,subscribe:h,unsubscribe:_,refresh:f}}function en(){let e=null;async function t(s,{volume:r=1,loop:a=!1,autoplay:i=!0,stopPrevious:c=!1,onEnded:u,onError:d}={}){try{c&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=a,p.preload="auto",u&&(p.onended=u),d&&(p.onerror=m=>d(m)),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 Ft=null;function Ns(){return Ft||(Ft=en()),Ft}async function qw(e,t){return Ns().play(e,t)}function Kw(){Ns().stop()}function Uw(){const e=l.useRef(null),[t,n]=l.useState(!1);e.current||(e.current=en()),l.useEffect(()=>()=>{e.current?.stop()},[]);const s=l.useCallback(async(a,i)=>{await e.current.play(a,i)&&n(!0)},[]),r=l.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class Hw extends Ws{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function Gw(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:a="id",ownerField:i}=e,c=new Hw(t,n,s,r),u=c.store;function d(m,f){return!i||!f?m:{...m,[i]:f}}async function p(m,f={}){const{orderBy:h=a,reverse:_=!1,limit:v,offset:y,filter:g}=f;let x=i&&m?u.where(i).equals(m):u.toCollection();g&&(x=x.filter(g));let b=h===a?await x.toArray():await x.sortBy(h);return _&&(b=b.reverse()),y&&(b=b.slice(y)),typeof v=="number"&&(b=b.slice(0,v)),b}return{put:(m,f)=>u.put(d(m,f)),bulkPut:(m,f)=>u.bulkPut(m.map(h=>d(h,f))),get:m=>u.get(m),list:p,update:(m,f)=>u.update(m,f),updateMany:async(m,f)=>{const h=f;return i&&m?u.where(i).equals(m).modify(h):u.toCollection().modify(h)},delete:m=>u.delete(m),clear:async m=>{if(i&&m){await u.where(i).equals(m).delete();return}await u.clear()},count:m=>i&&m?u.where(i).equals(m).count():u.count(),raw:u,db:c}}function Qw(){const[,e]=l.useState(null);return l.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function Jw({name:e,label:t,helperText:n,required:s,control:r,children:a}){const i=he.useFormContext(),c=r??i?.control;if(!c)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return o.jsx(he.Controller,{name:e,control:c,render:({field:u,fieldState:d})=>{if(!l.isValidElement(a))return a;const p=d.error?.message;return l.cloneElement(a,{name:u.name,value:u.value,onChange:u.onChange,onBlur:u.onBlur,ref:u.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function Yw(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const a=r.path.length===0?"_root":r.path.join(".");a in s||(s[a]=r.message)}return{success:!1,errors:s}}function Ss(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const a={},i=s.criteriaMode??"firstError";for(const c of r.error.issues){const u=c.path.length===0?"_root":c.path.join(".");i==="firstError"&&a[u]||(a[u]={type:c.code,message:c.message})}return{values:{},errors:a}}}function Xw(e,t={}){return he.useForm({...t,resolver:Ss(e)})}function dt(e){return e.replace(/\D/g,"")}function Vw(e){const t=dt(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let a=0;a<9;a++)s+=n[a]*(10-a);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let a=0;a<10;a++)s+=n[a]*(11-a);return r=s*10%11,r===10&&(r=0),r===n[10]}function Zw(e){const t=dt(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let a=0;for(let c=0;c<12;c++)a+=n[c]*s[c];let i=a%11;if(i=i<2?0:11-i,i!==n[12])return!1;a=0;for(let c=0;c<13;c++)a+=n[c]*r[c];return i=a%11,i=i<2?0:11-i,i===n[13]}function Cs(e){return dt(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function Es(e){return dt(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 ej(e){return dt(e)}function St(e,t="numeric"){return l.forwardRef(function({value:s,onChange:r,...a},i){return o.jsx(P.Input,{...a,ref:i,value:e(s??""),inputMode:t,onChange:c=>r(e(c.target.value))})})}const tj=St(ts),nj=St(Es),sj=St(es,"tel"),rj=St(Cs);function oj(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function aj(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const ij=l.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...a},i){return o.jsx(P.Input,{...a,ref:i,type:"text",inputMode:"numeric",value:oj(t||0,r,s),onChange:c=>n(aj(c.target.value))})});function cj(){const[e,t]=l.useState(!1),[n,s]=l.useState(null),[r,a]=l.useState(null),i=l.useCallback(async u=>{const d=u.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const m=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in m&&m.erro?(s("CEP não encontrado."),a(null),null):(a(m),m)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),c=l.useCallback(()=>{t(!1),s(null),a(null)},[]);return{loading:e,error:n,data:r,lookup:i,reset:c}}function lj(e){try{return JSON.parse(e)}catch{return e}}function Ts(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:a=3e4,pingInterval:i=0,pingPayload:c=JSON.stringify({type:"ping"}),parser:u=lj,onOpen:d,onMessage:p,onClose:m,onError:f,onStatusChange:h}=t;let _=null,v=null,y=null,g=0,x="idle",b=!1;function j($){x!==$&&(x=$,h?.($))}function k(){y&&(clearInterval(y),y=null)}function M(){!i||i<=0||(k(),y=setInterval(()=>{_?.readyState===WebSocket.OPEN&&_.send(c)},i))}function E(){if(b)return;if(g>=s){j("error");return}const $=Math.min(r*2**g,a);g+=1,v=setTimeout(N,$)}function N(){if(b)return;_&&(_.onopen=null,_.onmessage=null,_.onclose=null,_.onerror=null,_.close()),j("connecting");const $=new WebSocket(e,n);_=$,$.onopen=C=>{g=0,j("open"),M(),d?.(C)},$.onmessage=C=>{const I=typeof C.data=="string"?C.data:"";p?.({data:u(I),raw:C})},$.onerror=C=>{f?.(C)},$.onclose=C=>{k(),m?.(C),_=null,j("closed"),!b&&!C.wasClean&&E()}}function S($){return _?.readyState!==WebSocket.OPEN?!1:(_.send($),!0)}function T($,C){b=!0,v&&(clearTimeout(v),v=null),k(),g=0,_&&(j("closing"),_.close($,C),_=null),j("closed")}function D(){v&&(clearTimeout(v),v=null),g=0,b=!1,N()}return N(),{send:S,close:T,reconnect:D,get status(){return x}}}function uj(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,i]=l.useState("idle"),[c,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);p.current=s,l.useEffect(()=>{if(!n||!e){i("idle");return}const h=Ts(e,{...r,onStatusChange:i,onMessage:_=>{u(_),p.current?.(_)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const m=l.useCallback(h=>d.current?.send(h)??!1,[]),f=l.useCallback(()=>{d.current?.reconnect()},[]);return{status:a,lastMessage:c,send:m,reconnect:f}}const Ms=1.3,Rs=50,Ls={car:1,motorcycle:.95,bus:1.6};function tn(e,t){return t?.[e]??Ls[e]??1}function dj(e,t,n="car",s={}){const{circuityFactor:r=Ms,carSpeedKmh:a=Rs,modeDurationFactors:i}=s;if(a<=0)throw new RangeError("carSpeedKmh must be greater than 0");if(r<=0)throw new RangeError("circuityFactor must be greater than 0");const c=P.haversineKm(e,t)*r,d=c/a*60*tn(n,i);return{mode:n,distance_km:c,duration_minutes:d,source:"heuristic"}}function Ds(e){if(e.length===0)return null;let t=e[0].latitude,n=e[0].latitude,s=e[0].longitude,r=e[0].longitude;for(const a of e)a.latitude<t&&(t=a.latitude),a.latitude>n&&(n=a.latitude),a.longitude<s&&(s=a.longitude),a.longitude>r&&(r=a.longitude);return{minLatitude:t,maxLatitude:n,minLongitude:s,maxLongitude:r}}function pj(e){return{latitude:(e.minLatitude+e.maxLatitude)/2,longitude:(e.minLongitude+e.maxLongitude)/2}}function Ps(e,t=.1){const n=e.maxLatitude-e.minLatitude,s=e.maxLongitude-e.minLongitude,r=n*t||.001,a=s*t||.001;return{minLatitude:e.minLatitude-r,maxLatitude:e.maxLatitude+r,minLongitude:e.minLongitude-a,maxLongitude:e.maxLongitude+a}}function mj(e){const{baseUrl:t,fetch:n=globalThis.fetch,modeDurationFactors:s}=e,r=t.replace(/\/+$/,"");return{async route(a,i,c={}){const u=c.mode??"car",d=`${a.longitude},${a.latitude};${i.longitude},${i.latitude}`,p=`${r}/route/v1/driving/${d}?overview=false`;let m;try{m=await(await n(p)).json()}catch(y){throw new Error(`OSRM request failed: ${String(y)}`,{cause:y})}const f=m.routes?.[0];if(m.code!=="Ok"||!f)throw new Error(`OSRM returned no route (code: ${m.code??"unknown"})`);const h=f.distance/1e3,v=f.duration/60*tn(u,s);return{mode:u,distance_km:h,duration_minutes:v,source:"osrm"}}}}function As(e={}){const{minDistanceKm:t=.005,maxPoints:n=1/0,positionOptions:s,onUpdate:r,onError:a,onStatusChange:i}=e;let c=[],u=0,d=null,p=null,m="idle";function f(x){m!==x&&(m=x,i?.(x))}function h(x){const b={latitude:x.coords.latitude,longitude:x.coords.longitude,timestamp:x.timestamp,accuracy:x.coords.accuracy};if(d){const j=P.haversineKm(d,b);if(j<t)return;u+=j}d=b,c.push(b),c.length>n&&(c=c.slice(c.length-n)),r?.(c)}function _(x){f("error"),a?.(x)}function v(){if(p===null){if(typeof navigator>"u"||!navigator.geolocation){f("error");return}f("tracking"),p=navigator.geolocation.watchPosition(h,_,s)}}function y(){p!==null&&typeof navigator<"u"&&navigator.geolocation&&navigator.geolocation.clearWatch(p),p=null,f("idle")}function g(){y(),c=[],u=0,d=null,r?.(c)}return{start:v,stop:y,clear:g,get points(){return c},get distanceKm(){return u},get status(){return m}}}function fj(e={}){const{autoStart:t=!1,onError:n,...s}=e,[r,a]=l.useState([]),[i,c]=l.useState(0),[u,d]=l.useState("idle"),p=l.useRef(null),m=l.useRef(n);m.current=n,l.useEffect(()=>{const v=As({...s,onUpdate:y=>{a([...y]),c(v.distanceKm)},onStatusChange:d,onError:y=>m.current?.(y)});return p.current=v,t&&v.start(),()=>{v.stop(),p.current=null}},[]);const f=l.useCallback(()=>p.current?.start(),[]),h=l.useCallback(()=>p.current?.stop(),[]),_=l.useCallback(()=>{p.current?.clear(),c(0)},[]);return{points:r,lastPoint:r.length>0?r[r.length-1]:null,distanceKm:i,status:u,isTracking:u==="tracking",start:f,stop:h,clear:_}}const hj="tempest_map_3qgBX",_j="tempest_svg_Da-XM",gj="tempest_empty_QQGkP",bj="tempest_loading_R6YCf",yj="tempest_grid_xFsTS",vj="tempest_path_-A7Sl",xj="tempest_start_OPmUL",wj="tempest_end_7SX7p",jj="tempest_current_WFLJk",$j="tempest_pulse_DUzgL",kj="tempest_marker_HB3Rb",Nj="tempest_scale_YuwqB",G={map:hj,svg:_j,empty:gj,loading:bj,grid:yj,path:vj,start:xj,end:wj,current:jj,pulse:$j,marker:kj,scale:Nj},Sj=l.lazy(()=>Promise.resolve().then(()=>require("./leaflet-map-BzYV9czG.cjs")).then(e=>({default:e.LeafletTrajectory}))),Mn=[.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Cj(e,t){const n=e*t;let s=Mn[0];for(const r of Mn)r<=n&&(s=r);return{km:s,pixels:s/e}}function Ej(e){return e<1?`${Math.round(e*1e3)} m`:`${e%1===0?e:e.toFixed(1)} km`}function Tj({points:e,current:t,height:n=320,padding:s=24,showGrid:r=!0,showScale:a=!0,strokeColor:i,tileUrl:c,tileAttribution:u,label:d="Trajetória",markers:p,onMarkerClick:m,className:f,style:h,..._}){const v=l.useRef(null),[y,g]=l.useState(600);l.useEffect(()=>{const k=v.current;if(!k||typeof ResizeObserver>"u")return;const M=new ResizeObserver(E=>{const N=E[0]?.contentRect.width;N&&N>0&&g(N)});return M.observe(k),()=>M.disconnect()},[]);const x=l.useMemo(()=>[...e,...t?[t]:[],...p??[]],[e,t,p]),b=l.useMemo(()=>{const k=Ds(x);if(!k)return null;const M=P.fitProjection(Ps(k,.12),y,n,{padding:s}),E=e.map(ge=>M.project(ge)),N=E.map(ge=>`${ge.x.toFixed(1)},${ge.y.toFixed(1)}`).join(" "),S=E[0]??null,T=E.length>0?E[E.length-1]:null,D=t?M.project(t):null,$={latitude:(k.minLatitude+k.maxLatitude)/2,longitude:(k.minLongitude+k.maxLongitude)/2},C=M.project($),I=M.project({...$,longitude:k.maxLongitude}),L=P.haversineKm($,{...$,longitude:k.maxLongitude}),R=Math.abs(I.x-C.x)||1,W=L/R||0,We=(p??[]).map(ge=>({marker:ge,p:M.project(ge)}));return{polyline:N,startPixel:S,endPixel:T,currentPixel:D,kmPerPixel:W,markerPixels:We}},[x,e,t,p,y,n,s]);if(c)return o.jsx("div",{ref:v,className:w.cn(G.map,f),style:{height:n,...h},role:"img","aria-label":d,..._,children:o.jsx(l.Suspense,{fallback:o.jsx("div",{className:G.loading,children:"Carregando mapa…"}),children:o.jsx(Sj,{points:e,current:t,tileUrl:c,tileAttribution:u,strokeColor:i})})});const j=a&&b&&b.kmPerPixel>0?Cj(b.kmPerPixel,Math.min(120,y*.35)):null;return o.jsx("div",{ref:v,className:w.cn(G.map,f),style:{height:n,...h},role:"img","aria-label":d,..._,children:b?o.jsxs("svg",{className:G.svg,width:"100%",height:n,viewBox:`0 0 ${y} ${n}`,preserveAspectRatio:"xMidYMid meet",children:[r&&o.jsxs("g",{className:G.grid,children:[[.25,.5,.75].map(k=>o.jsx("line",{x1:0,y1:n*k,x2:y,y2:n*k},`h${k}`)),[.25,.5,.75].map(k=>o.jsx("line",{x1:y*k,y1:0,x2:y*k,y2:n},`v${k}`))]}),b.polyline&&o.jsx("polyline",{className:G.path,points:b.polyline,fill:"none",stroke:i,"data-testid":"trajectory-path"}),b.startPixel&&o.jsx("circle",{className:G.start,cx:b.startPixel.x,cy:b.startPixel.y,r:5}),b.endPixel&&!t&&o.jsx("circle",{className:G.end,cx:b.endPixel.x,cy:b.endPixel.y,r:5}),b.currentPixel&&o.jsxs(o.Fragment,{children:[o.jsx("circle",{className:G.pulse,cx:b.currentPixel.x,cy:b.currentPixel.y,r:10}),o.jsx("circle",{className:G.current,cx:b.currentPixel.x,cy:b.currentPixel.y,r:5})]}),b.markerPixels.map(({marker:k,p:M},E)=>{const N=!!m;return o.jsx("circle",{className:G.marker,cx:M.x,cy:M.y,r:k.radius??6,style:k.color?{fill:k.color}:void 0,"data-marker-id":k.id??E,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-label":k.label,onClick:N?()=>m?.(k,E):void 0,onKeyDown:N?S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m?.(k,E))}:void 0,children:k.label?o.jsx("title",{children:k.label}):null},k.id??E)}),j&&o.jsxs("g",{className:G.scale,transform:`translate(${s}, ${n-s})`,children:[o.jsx("line",{x1:0,y1:0,x2:j.pixels,y2:0}),o.jsx("line",{x1:0,y1:-4,x2:0,y2:4}),o.jsx("line",{x1:j.pixels,y1:-4,x2:j.pixels,y2:4}),o.jsx("text",{x:j.pixels/2,y:-8,textAnchor:"middle",children:Ej(j.km)})]})]}):o.jsx("div",{className:G.empty,children:"Sem pontos de trajetória ainda."})})}function Mj(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Rj(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 Jx(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function Yx(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:a,withCredentials:i=!1,onProgress:c,signal:u,parser:d=JSON.parse,requestId:p}=e;return new Promise((m,f)=>{if(u?.aborted){f(new DOMException("Aborted","AbortError"));return}const h=new XMLHttpRequest;h.open(s,t),h.withCredentials=i;const _=a?.(),v=p?p():Jt(),y={...r};_&&!("Authorization"in y)&&(y.Authorization=`Bearer ${_}`),v&&!("X-Request-ID"in y)&&(y["X-Request-ID"]=v);for(const[x,b]of Object.entries(y))h.setRequestHeader(x,b);c&&(h.upload.onprogress=x=>{c({loaded:x.loaded,total:x.total,fraction:x.lengthComputable?x.loaded/x.total:null,lengthComputable:x.lengthComputable})});function g(){h.abort()}u?.addEventListener("abort",g),h.onload=()=>{u?.removeEventListener("abort",g);const x=h.status>=200&&h.status<300,b=h.getResponseHeader("content-type")??"";if(!x){const j=Jx(h.responseText);f(new kt(Yt(h.status,j,{get:k=>h.getResponseHeader(k)},v)));return}if(h.status===204||!h.responseText){m(void 0);return}if(b.includes("application/json"))try{m(d(h.responseText))}catch(j){f(j)}else m(h.responseText)},h.onerror=()=>{u?.removeEventListener("abort",g),f(new kt({status:0,detail:"Falha de rede no upload.",requestId:v||void 0}))},h.onabort=()=>{u?.removeEventListener("abort",g),f(new DOMException("Aborted","AbortError"))},h.send(n)})}function Xx(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Vx(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,respectRetryAfter:a=!0,shouldRetry:i=()=>!0,onRetry:c,signal:u}=t;let d=0,p;for(;d<n;){if(u?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(m){if(p=m,d+=1,d>=n||!i(m,d))throw m;const f=a&&typeof m?.retryAfter=="number"?m.retryAfter*1e3:null,h=Math.min(f!==null?f:s*2**(d-1),r);c?.({attempt:d,delay:h,error:m}),await Xx(h,u)}}throw p}function Zx(){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 ew(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:a}=t,[i,c]=l.useState(null),[u,d]=l.useState(null),[p,m]=l.useState(!s),f=l.useRef(s),h=l.useRef(!1),_=l.useRef(null);async function v(){if(!(f.current||h.current)){h.current=!0;try{const y=await e();if(f.current)return;c(y),d(null),r?.(y)&&(f.current=!0)}catch(y){f.current||(d(y),a?.(y))}finally{h.current=!1,m(!1),f.current||(_.current=setTimeout(v,n))}}}return l.useEffect(()=>{if(f.current=s,s){_.current&&clearTimeout(_.current);return}return m(!0),v(),()=>{f.current=!0,_.current&&clearTimeout(_.current)}},[n,s]),{data:i,error:u,loading:p,stop:()=>{f.current=!0,_.current&&clearTimeout(_.current)},start:()=>{f.current&&(f.current=!1,v())}}}function ss(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:a})=>s({user:r,token:a,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:wt.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function tw({isAuthenticated:e,children:t,fallback:n}){return o.jsx(o.Fragment,{children:e?t:n})}function Nn(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 Xt(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(Nn(n)),payload:JSON.parse(Nn(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function nw(e,t=0){try{const{payload:n}=Xt(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function rs(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function a(i=1){try{return await e()}catch(c){if(i>=n)throw r&&typeof window<"u"&&window.location.reload(),c;return await new Promise(u=>setTimeout(u,s*2**(i-1))),a(i+1)}}return l.lazy(a)}function os(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function sw(e){const t=e??{};return{token:t.access_token,refreshToken:t.refresh_token}}function rw(e){const{baseURL:t,loginPath:n="/api/auth/login",refreshPath:s="/api/auth/refresh",mePath:r,storeName:a="tempest-auth",storage:i="local",withCredentials:c=!1,fetcher:u,parseTokens:d=sw,parseUser:p,refreshBody:m=S=>S?{refresh_token:S}:void 0}=e,f=ss({name:a,storage:i}),h=`${a}-refresh`;function _(){return typeof window>"u"?null:i==="session"?window.sessionStorage:window.localStorage}function v(){return _()?.getItem(h)??null}function y(S){const T=_();T&&(S?T.setItem(h,S):T.removeItem(h))}const g=()=>f.getState(),x=()=>g().token,b=xt({baseURL:t,withCredentials:c,fetcher:u});async function j(){if(!r)return g().user;const S=x(),T=await xt({baseURL:t,withCredentials:c,fetcher:u,getToken:()=>S}).get(r);return g().setUser(T),T}async function k(S){const T=await b.post(n,{body:S}),{token:D,refreshToken:$}=d(T);g().setToken(D),y($??null);const C=p?.(T);return C!=null?(g().setUser(C),C):j()}function M(){g().logout(),y(null)}const E=os(async()=>{const S=await b.post(s,{body:m(v())}),{token:T,refreshToken:D}=d(S);g().setToken(T),D&&y(D)}),N=xt({baseURL:t,withCredentials:c,fetcher:u,getToken:x,refresh:E,onUnauthorized:()=>M()});return{useAuthStore:f,api:N,login:k,logout:M,refresh:E,getToken:x}}const as=l.createContext(null);function ow({control:e,children:t}){return o.jsx(as.Provider,{value:e,children:t})}function is(){return l.useContext(as)}function aw(e){return typeof e=="boolean"?{can:e}:e}function cs(e){const t=is(),n=JSON.stringify(e),[s,r]=l.useState(()=>t?{allowed:!1,isLoading:!0}:{allowed:!0,isLoading:!1});return l.useEffect(()=>{if(!t){r({allowed:!0,isLoading:!1});return}let a=!1;return r(i=>({...i,isLoading:!0})),Promise.resolve(t.can(e)).then(i=>{if(a)return;const c=aw(i);r({allowed:c.can,isLoading:!1,reason:c.reason})}).catch(i=>{a||r({allowed:!1,isLoading:!1,reason:i instanceof Error?i.message:"access check failed"})}),()=>{a=!0}},[t,n]),s}function iw({action:e,resource:t,params:n,children:s,fallback:r}){const{allowed:a,isLoading:i}=cs({action:e,resource:t,params:n});return i?o.jsx(o.Fragment,{children:r??null}):o.jsx(o.Fragment,{children:a?s:r??null})}function cw(e){const t=new Set(e.permissions??[]),n=e.role?Array.isArray(e.role)?e.role:[e.role]:[];for(const s of n)for(const r of e.roles?.[s]??[])t.add(r);return t}function lw(e){const t=cw(e);return{can({action:n,resource:s}){return t.has("*")||s!==void 0&&(t.has(`${s}:*`)||t.has(`${s}:${n}`))||s===void 0&&t.has(n)?{can:!0}:{can:!1,reason:"missing permission"}}}}function At(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"?e.split(/\s+/).filter(Boolean):[]}function uw(e,t){try{const{payload:n}=Xt(e),s=t?.claim??"permissions",r=At(n[s]);if(r.length>0)return r;if(t?.claim===void 0){const a=At(n.scopes);return a.length>0?a:At(n.scope)}return r}catch{return[]}}function dw({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:a,shape:i,size:c,disableOneTap:u,width:d,className:p,style:m}){return o.jsx("div",{className:p,style:m,children:e({onSuccess:f=>{if(!f.credential){n?.({provider:"google",message:"Google returned no credential",raw:f});return}return t({idToken:f.credential,provider:"google",raw:f})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:a,shape:i,size:c,useOneTap:!u,width:d})})}function pw(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,a]=l.useState(null),[i,c]=l.useState(null),[u,d]=l.useState("pending"),p=l.useRef(!1);return l.useEffect(()=>{if(p.current)return;p.current=!0;let m=!1;return t().then(f=>{if(!m)return a(f),d("success"),n?.(f)}).catch(f=>{m||(c(f),d("error"),s?.(f))}),()=>{m=!0}},[t,n,s]),{loading:u==="pending",data:r,error:i,status:u}}const ls={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},us={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},mw={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function fw(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...a)=>[e,...r(...a)]:n[s]=[e,...r];return n}function ds({children:e,client:t,defaultOptions:n}){const[s]=l.useState(()=>t??new Q.QueryClient({defaultOptions:{queries:{staleTime:ls.DEFAULT,gcTime:us.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return o.jsx(Q.QueryClientProvider,{client:s,children:e})}function hw(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.total=="number"&&typeof t.pages=="number"}function _w(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.has_more=="boolean"&&"next_cursor"in t}function gw(e=20){return{items:[],total:0,page:1,size:e,pages:0}}function bw(e){const{queryKey:t,queryFn:n,initialPage:s=1,pageSize:r=20,sizeParam:a="size",orderBy:i,ascending:c=!1,...u}=e,[d,p]=l.useState(s),m=Q.useQuery({...u,queryKey:[...t,{page:d,pageSize:r,sizeParam:a,orderBy:i,ascending:c}],queryFn:()=>{const b={page:d,[a]:r};return i&&(b.order_by=i,b.ascending=c),n(b)},placeholderData:Q.keepPreviousData}),f=m.data,h=f?.pages??0,_=d<h,v=d>1,y=l.useCallback(b=>p(Math.max(1,b)),[]),g=l.useCallback(()=>p(b=>b<h?b+1:b),[h]),x=l.useCallback(()=>p(b=>b>1?b-1:b),[]);return{page:f,items:f?.items??[],pageNumber:d,pageCount:h,total:f?.total??0,hasNext:_,hasPrev:v,isLoading:m.isLoading,isFetching:m.isFetching,error:m.error,setPage:y,next:g,prev:x,refetch:()=>{m.refetch()}}}function yw(e){const{queryKey:t,queryFn:n,limit:s=20,orderBy:r,ascending:a=!1,...i}=e,c=Q.useInfiniteQuery({...i,queryKey:[...t,{limit:s,orderBy:r,ascending:a}],initialPageParam:null,queryFn:({pageParam:d})=>n({cursor:d,limit:s,order_by:r,ascending:a}),getNextPageParam:d=>d.has_more?d.next_cursor:void 0}),u=c.data?.pages??[];return{items:u.flatMap(d=>d.items),pages:u,hasNextPage:c.hasNextPage,isLoading:c.isLoading,isFetchingNextPage:c.isFetchingNextPage,error:c.error,fetchNextPage:()=>{c.fetchNextPage()},refetch:()=>{c.refetch()}}}const vw=(e,t)=>t==null?`/${e}`:`/${e}/${t}`;function xw(e,t={}){const{pageParam:n="page",sizeParam:s="size",sortFieldParam:r="order_by",sortOrderParam:a="ascending",sortOrderAsBoolean:i=!0,updateMethod:c="patch",buildPath:u=vw}=t,d={getList(p,m={}){const{pagination:f,sort:h,filters:_}=m,v={};if(f?.page!=null&&(v[n]=f.page),f?.pageSize!=null&&(v[s]=f.pageSize),h?.field){const g=h.order??"asc";v[r]=h.field,v[a]=i?g==="asc":g}if(_)for(const[g,x]of Object.entries(_))v[g]=x;const y={params:v};return e.get(u(p),y)},getOne(p,m){return e.get(u(p,m))},getMany(p,m){return Promise.all(m.map(f=>d.getOne(p,f)))},create(p,m){return e.post(u(p),{body:m})},update(p,m,f){const h=u(p,m);return c==="put"?e.put(h,{body:f}):e.patch(h,{body:f})},deleteOne(p,m){return e.delete(u(p,m))}};return d}const ps=l.createContext(null);function ww({provider:e,children:t}){return o.jsx(ps.Provider,{value:e,children:t})}function Ze(){const e=l.useContext(ps);if(!e)throw new Error("useDataProvider must be used within a <TempestDataProvider>");return e}function ms(e,t){return["data",e,"list",t]}function Vt(e,t){return["data",e,"one",t]}function jw(e,t,n){const s=Ze();return Q.useQuery({queryKey:ms(e,t),queryFn:()=>s.getList(e,t),...n})}function $w(e,t,n){const s=Ze(),{enabled:r,...a}=n??{};return Q.useQuery({queryKey:Vt(e,t),queryFn:()=>s.getOne(e,t),enabled:t!=null&&(r??!0),...a})}function kw(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:r=>n.create(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function Nw(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:({id:r,data:a})=>n.update(e,r,a),onSuccess:(...r)=>{const[,a]=r;s.invalidateQueries({queryKey:["data",e,"list"]}),s.invalidateQueries({queryKey:Vt(e,a.id)}),t?.onSuccess?.(...r)},...t})}function Sw(e,t){const n=Ze(),s=Q.useQueryClient();return Q.useMutation({mutationFn:r=>n.deleteOne(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function fs({when:e,redirectTo:t="/",replace:n=!0,children:s}){return o.jsx(o.Fragment,{children:e?s:o.jsx(A.Navigate,{to:t,replace:n})})}function Cw(e){return e}const Sn=new WeakMap;function Ew(e){let t=Sn.get(e);return t||(t=rs(e.lazy),Sn.set(e,t)),t}function Tw({guard:e,redirectTo:t,children:n}){const s=typeof e=="function"?e():e;return o.jsx(fs,{when:s,redirectTo:t,children:n})}function hs(e){return e.map((t,n)=>{let s=t.element;if(t.lazy){const r=Ew(t);s=o.jsx(r,{})}return t.guard!==void 0&&(s=o.jsx(Tw,{guard:t.guard,redirectTo:t.redirectTo,children:s})),t.index?o.jsx(A.Route,{index:!0,element:s},`index-${n}`):o.jsx(A.Route,{path:t.path,element:s,caseSensitive:t.caseSensitive,children:t.children?hs(t.children):null},t.path??`route-${n}`)})}const Mw={browser:A.BrowserRouter,hash:A.HashRouter,memory:A.MemoryRouter};function Rw({routes:e,router:t="browser",basename:n,initialEntries:s,fallback:r=null}){const a=l.useMemo(()=>hs(e),[e]),i=Mw[t],c=t==="memory"?{basename:n,initialEntries:s}:{basename:n};return o.jsx(i,{...c,children:o.jsx(l.Suspense,{fallback:r,children:o.jsx(A.Routes,{children:a})})})}function Lw(e,t={}){if(!t.persist)return Ot.create()(e);const{name:n,storage:s="local",partialize:r,version:a,migrate:i}=t.persist,c=s==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(e,{name:n,storage:wt.createJSONStorage(c),...r?{partialize:r}:{},...a!==void 0?{version:a}:{},...i?{migrate:i}:{}}))}function Dw(e){const t=e;t.use={};for(const n of Object.keys(e.getState()))t.use[n]=()=>e(s=>s[n]);return t}const _s=l.createContext(null);function Cn(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function En(e,t,n,s){const r=Array.isArray(n)?n:[n];for(const a of r)e.setAttribute(a,t);if(s&&typeof document<"u"){const a=document.querySelector('meta[name="theme-color"]');a&&(a.content=s[t])}}function Pw(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 gs({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme",themeColor:a}){const[i,c]=l.useState(()=>Pw(n)??t),[u,d]=l.useState(()=>Cn(i)),p=l.useRef(s);p.current=s;const m=Array.isArray(r)?r.join(","):r,f=l.useRef(a);f.current=a,l.useEffect(()=>{const y=p.current?.()??document.documentElement;if(!y)return;const g=Cn(i);En(y,g,r,f.current),d(g)},[i,m]),l.useEffect(()=>{if(i!=="system"||typeof window>"u")return;const y=window.matchMedia("(prefers-color-scheme: dark)"),g=()=>{const x=p.current?.()??document.documentElement;if(!x)return;const b=y.matches?"dark":"light";En(x,b,r,f.current),d(b)};return y.addEventListener("change",g),()=>y.removeEventListener("change",g)},[i,m]);const h=l.useCallback(y=>{if(c(y),n&&typeof window<"u")try{window.localStorage.setItem(n,y)}catch{}},[n]),_=l.useCallback(()=>{h(u==="dark"?"light":"dark")},[u,h]),v=l.useMemo(()=>({theme:i,resolvedTheme:u,setTheme:h,toggle:_}),[i,u,h,_]);return o.jsx(_s.Provider,{value:v,children:e})}function Aw(){const e=l.useContext(_s);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function Tn(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function It(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const a=e[n]?.[s];if(a!==void 0)return a}return null}function Zt(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(u,d){const p=It(s,t,n,u);return p===null?u:Tn(p,d)}function a(u,d,p){const f=It(s,t,n,`${u}${d===1?"_one":"_other"}`)??It(s,t,n,u);return f===null?u:Tn(f,{count:d,...p??{}})}function i(u,d){return new Intl.NumberFormat(t,d).format(u)}function c(u,d){const p=typeof u=="string"?new Date(u):u;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:a,formatNumber:i,formatDate:c,withLocale:u=>Zt({locale:u,fallbackLocale:n??void 0,messages:s})}}const bs=l.createContext(null);function Iw(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 ys({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const a=l.useMemo(()=>Object.keys(s),[s]),[i,c]=l.useState(()=>Iw(r,a)??t);l.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",i)},[i]);const u=l.useCallback(p=>{if(c(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=l.useMemo(()=>({...Zt({locale:i,fallbackLocale:n,messages:s}),setLocale:u,availableLocales:a}),[i,n,s,u,a]);return o.jsx(bs.Provider,{value:d,children:e})}function vs(){const e=l.useContext(bs);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function Fw(){return vs().t}function Ow(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 xs extends l.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&Ow(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 Bw({children:e,query:t,theme:n,i18n:s,errorBoundary:r}){let a=e;return s&&(a=o.jsx(ys,{...s,children:a})),n!==!1&&(a=o.jsx(gs,{...n||{},children:a})),t!==!1&&(a=o.jsx(ds,{...t||{},children:a})),r&&(a=o.jsx(xs,{...r,children:a})),o.jsx(o.Fragment,{children:a})}function zw(e){try{return JSON.parse(e)}catch{return e}}function ws(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:a=10,initialBackoff:i=1e3,maxBackoff:c=3e4,parser:u=zw,onOpen:d,onMessage:p,onError:m,onStatusChange:f}=t;let h=null,_=null,v=0,y="idle",g=!1;function x(N){y!==N&&(y=N,f?.(N))}function b(N,S){r.includes(N)||p?.({event:N,data:u(S.data),id:S.lastEventId||void 0,raw:S})}function j(){if(g)return;if(v>=a){x("error");return}const N=Math.min(i*2**v,c);v+=1,_=setTimeout(k,N)}function k(){if(g)return;h&&h.close(),x("connecting");const N=new EventSource(e,{withCredentials:n});h=N,N.onopen=()=>{v=0,x("open"),d?.()},N.onmessage=S=>b("message",S);for(const S of s)N.addEventListener(S,T=>b(S,T));for(const S of r)N.addEventListener(S,()=>{});N.onerror=S=>{m?.(S),N.close(),h=null,x("closed"),j()}}function M(){g=!0,_&&(clearTimeout(_),_=null),v=0,h&&(h.close(),h=null),x("closed")}function E(){_&&(clearTimeout(_),_=null),v=0,g=!1,k()}return k(),{close:M,reconnect:E,get status(){return y}}}function Ww(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,i]=l.useState("idle"),[c,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);return p.current=s,l.useEffect(()=>{if(!n||!e){i("idle");return}const m=ws(e,{...r,onStatusChange:i,onMessage:f=>{u(f),p.current?.(f)}});return d.current=m.reconnect,()=>{m.close(),d.current=null}},[e,n]),{status:a,lastMessage:c,reconnect:()=>d.current?.()}}function js(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),a=new Uint8Array(r);for(let i=0;i<s.length;i++)a[i]=s.charCodeAt(i);return a}function lt(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class Ht extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class $s extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class ks{config;constructor(t){this.config=t}static isSupported(){return lt()}async registration(){if(!lt())throw new Ht;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 Ht;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return lt()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new $s;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:js(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function qw(e){const t=l.useRef(e);t.current=e;const n=l.useMemo(()=>new ks({vapidPublicKey:e.vapidPublicKey,onSubscribe:v=>t.current.onSubscribe(v),onUnsubscribe:v=>t.current.onUnsubscribe?.(v),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=l.useState(()=>lt()),[r,a]=l.useState(()=>n.permission()),[i,c]=l.useState(!1),[u,d]=l.useState(!1),[p,m]=l.useState(null),f=l.useCallback(async()=>{if(s){a(n.permission());try{const v=await n.isSubscribed();c(v)}catch(v){m(v instanceof Error?v:new Error(String(v)))}}},[n,s]);l.useEffect(()=>{f()},[f]);const h=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.subscribe(),c(!0),a(n.permission())}catch(v){throw m(v instanceof Error?v:new Error(String(v))),v}finally{d(!1)}}},[n,s]),_=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.unsubscribe(),c(!1)}catch(v){throw m(v instanceof Error?v:new Error(String(v))),v}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:i,loading:u,error:p,subscribe:h,unsubscribe:_,refresh:f}}function en(){let e=null;async function t(s,{volume:r=1,loop:a=!1,autoplay:i=!0,stopPrevious:c=!1,onEnded:u,onError:d}={}){try{c&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=a,p.preload="auto",u&&(p.onended=u),d&&(p.onerror=m=>d(m)),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 Ft=null;function Ns(){return Ft||(Ft=en()),Ft}async function Uw(e,t){return Ns().play(e,t)}function Kw(){Ns().stop()}function Hw(){const e=l.useRef(null),[t,n]=l.useState(!1);e.current||(e.current=en()),l.useEffect(()=>()=>{e.current?.stop()},[]);const s=l.useCallback(async(a,i)=>{await e.current.play(a,i)&&n(!0)},[]),r=l.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class Gw extends Ws{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function Qw(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:a="id",ownerField:i}=e,c=new Gw(t,n,s,r),u=c.store;function d(m,f){return!i||!f?m:{...m,[i]:f}}async function p(m,f={}){const{orderBy:h=a,reverse:_=!1,limit:v,offset:y,filter:g}=f;let x=i&&m?u.where(i).equals(m):u.toCollection();g&&(x=x.filter(g));let b=h===a?await x.toArray():await x.sortBy(h);return _&&(b=b.reverse()),y&&(b=b.slice(y)),typeof v=="number"&&(b=b.slice(0,v)),b}return{put:(m,f)=>u.put(d(m,f)),bulkPut:(m,f)=>u.bulkPut(m.map(h=>d(h,f))),get:m=>u.get(m),list:p,update:(m,f)=>u.update(m,f),updateMany:async(m,f)=>{const h=f;return i&&m?u.where(i).equals(m).modify(h):u.toCollection().modify(h)},delete:m=>u.delete(m),clear:async m=>{if(i&&m){await u.where(i).equals(m).delete();return}await u.clear()},count:m=>i&&m?u.where(i).equals(m).count():u.count(),raw:u,db:c}}function Jw(){const[,e]=l.useState(null);return l.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function Yw({name:e,label:t,helperText:n,required:s,control:r,children:a}){const i=he.useFormContext(),c=r??i?.control;if(!c)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return o.jsx(he.Controller,{name:e,control:c,render:({field:u,fieldState:d})=>{if(!l.isValidElement(a))return a;const p=d.error?.message;return l.cloneElement(a,{name:u.name,value:u.value,onChange:u.onChange,onBlur:u.onBlur,ref:u.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function Xw(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const a=r.path.length===0?"_root":r.path.join(".");a in s||(s[a]=r.message)}return{success:!1,errors:s}}function Ss(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const a={},i=s.criteriaMode??"firstError";for(const c of r.error.issues){const u=c.path.length===0?"_root":c.path.join(".");i==="firstError"&&a[u]||(a[u]={type:c.code,message:c.message})}return{values:{},errors:a}}}function Vw(e,t={}){return he.useForm({...t,resolver:Ss(e)})}function dt(e){return e.replace(/\D/g,"")}function Zw(e){const t=dt(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let a=0;a<9;a++)s+=n[a]*(10-a);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let a=0;a<10;a++)s+=n[a]*(11-a);return r=s*10%11,r===10&&(r=0),r===n[10]}function ej(e){const t=dt(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let a=0;for(let c=0;c<12;c++)a+=n[c]*s[c];let i=a%11;if(i=i<2?0:11-i,i!==n[12])return!1;a=0;for(let c=0;c<13;c++)a+=n[c]*r[c];return i=a%11,i=i<2?0:11-i,i===n[13]}function Cs(e){return dt(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function Es(e){return dt(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 tj(e){return dt(e)}function St(e,t="numeric"){return l.forwardRef(function({value:s,onChange:r,...a},i){return o.jsx(P.Input,{...a,ref:i,value:e(s??""),inputMode:t,onChange:c=>r(e(c.target.value))})})}const nj=St(ts),sj=St(Es),rj=St(es,"tel"),oj=St(Cs);function aj(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function ij(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const cj=l.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...a},i){return o.jsx(P.Input,{...a,ref:i,type:"text",inputMode:"numeric",value:aj(t||0,r,s),onChange:c=>n(ij(c.target.value))})});function lj(){const[e,t]=l.useState(!1),[n,s]=l.useState(null),[r,a]=l.useState(null),i=l.useCallback(async u=>{const d=u.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const m=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in m&&m.erro?(s("CEP não encontrado."),a(null),null):(a(m),m)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),c=l.useCallback(()=>{t(!1),s(null),a(null)},[]);return{loading:e,error:n,data:r,lookup:i,reset:c}}function uj(e){try{return JSON.parse(e)}catch{return e}}function Ts(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:a=3e4,pingInterval:i=0,pingPayload:c=JSON.stringify({type:"ping"}),parser:u=uj,onOpen:d,onMessage:p,onClose:m,onError:f,onStatusChange:h}=t;let _=null,v=null,y=null,g=0,x="idle",b=!1;function j($){x!==$&&(x=$,h?.($))}function k(){y&&(clearInterval(y),y=null)}function M(){!i||i<=0||(k(),y=setInterval(()=>{_?.readyState===WebSocket.OPEN&&_.send(c)},i))}function E(){if(b)return;if(g>=s){j("error");return}const $=Math.min(r*2**g,a);g+=1,v=setTimeout(N,$)}function N(){if(b)return;_&&(_.onopen=null,_.onmessage=null,_.onclose=null,_.onerror=null,_.close()),j("connecting");const $=new WebSocket(e,n);_=$,$.onopen=C=>{g=0,j("open"),M(),d?.(C)},$.onmessage=C=>{const I=typeof C.data=="string"?C.data:"";p?.({data:u(I),raw:C})},$.onerror=C=>{f?.(C)},$.onclose=C=>{k(),m?.(C),_=null,j("closed"),!b&&!C.wasClean&&E()}}function S($){return _?.readyState!==WebSocket.OPEN?!1:(_.send($),!0)}function T($,C){b=!0,v&&(clearTimeout(v),v=null),k(),g=0,_&&(j("closing"),_.close($,C),_=null),j("closed")}function D(){v&&(clearTimeout(v),v=null),g=0,b=!1,N()}return N(),{send:S,close:T,reconnect:D,get status(){return x}}}function dj(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,i]=l.useState("idle"),[c,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);p.current=s,l.useEffect(()=>{if(!n||!e){i("idle");return}const h=Ts(e,{...r,onStatusChange:i,onMessage:_=>{u(_),p.current?.(_)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const m=l.useCallback(h=>d.current?.send(h)??!1,[]),f=l.useCallback(()=>{d.current?.reconnect()},[]);return{status:a,lastMessage:c,send:m,reconnect:f}}const Ms=1.3,Rs=50,Ls={car:1,motorcycle:.95,bus:1.6};function tn(e,t){return t?.[e]??Ls[e]??1}function pj(e,t,n="car",s={}){const{circuityFactor:r=Ms,carSpeedKmh:a=Rs,modeDurationFactors:i}=s;if(a<=0)throw new RangeError("carSpeedKmh must be greater than 0");if(r<=0)throw new RangeError("circuityFactor must be greater than 0");const c=P.haversineKm(e,t)*r,d=c/a*60*tn(n,i);return{mode:n,distance_km:c,duration_minutes:d,source:"heuristic"}}function Ds(e){if(e.length===0)return null;let t=e[0].latitude,n=e[0].latitude,s=e[0].longitude,r=e[0].longitude;for(const a of e)a.latitude<t&&(t=a.latitude),a.latitude>n&&(n=a.latitude),a.longitude<s&&(s=a.longitude),a.longitude>r&&(r=a.longitude);return{minLatitude:t,maxLatitude:n,minLongitude:s,maxLongitude:r}}function mj(e){return{latitude:(e.minLatitude+e.maxLatitude)/2,longitude:(e.minLongitude+e.maxLongitude)/2}}function Ps(e,t=.1){const n=e.maxLatitude-e.minLatitude,s=e.maxLongitude-e.minLongitude,r=n*t||.001,a=s*t||.001;return{minLatitude:e.minLatitude-r,maxLatitude:e.maxLatitude+r,minLongitude:e.minLongitude-a,maxLongitude:e.maxLongitude+a}}function fj(e){const{baseUrl:t,fetch:n=globalThis.fetch,modeDurationFactors:s}=e,r=t.replace(/\/+$/,"");return{async route(a,i,c={}){const u=c.mode??"car",d=`${a.longitude},${a.latitude};${i.longitude},${i.latitude}`,p=`${r}/route/v1/driving/${d}?overview=false`;let m;try{m=await(await n(p)).json()}catch(y){throw new Error(`OSRM request failed: ${String(y)}`,{cause:y})}const f=m.routes?.[0];if(m.code!=="Ok"||!f)throw new Error(`OSRM returned no route (code: ${m.code??"unknown"})`);const h=f.distance/1e3,v=f.duration/60*tn(u,s);return{mode:u,distance_km:h,duration_minutes:v,source:"osrm"}}}}function As(e={}){const{minDistanceKm:t=.005,maxPoints:n=1/0,positionOptions:s,onUpdate:r,onError:a,onStatusChange:i}=e;let c=[],u=0,d=null,p=null,m="idle";function f(x){m!==x&&(m=x,i?.(x))}function h(x){const b={latitude:x.coords.latitude,longitude:x.coords.longitude,timestamp:x.timestamp,accuracy:x.coords.accuracy};if(d){const j=P.haversineKm(d,b);if(j<t)return;u+=j}d=b,c.push(b),c.length>n&&(c=c.slice(c.length-n)),r?.(c)}function _(x){f("error"),a?.(x)}function v(){if(p===null){if(typeof navigator>"u"||!navigator.geolocation){f("error");return}f("tracking"),p=navigator.geolocation.watchPosition(h,_,s)}}function y(){p!==null&&typeof navigator<"u"&&navigator.geolocation&&navigator.geolocation.clearWatch(p),p=null,f("idle")}function g(){y(),c=[],u=0,d=null,r?.(c)}return{start:v,stop:y,clear:g,get points(){return c},get distanceKm(){return u},get status(){return m}}}function hj(e={}){const{autoStart:t=!1,onError:n,...s}=e,[r,a]=l.useState([]),[i,c]=l.useState(0),[u,d]=l.useState("idle"),p=l.useRef(null),m=l.useRef(n);m.current=n,l.useEffect(()=>{const v=As({...s,onUpdate:y=>{a([...y]),c(v.distanceKm)},onStatusChange:d,onError:y=>m.current?.(y)});return p.current=v,t&&v.start(),()=>{v.stop(),p.current=null}},[]);const f=l.useCallback(()=>p.current?.start(),[]),h=l.useCallback(()=>p.current?.stop(),[]),_=l.useCallback(()=>{p.current?.clear(),c(0)},[]);return{points:r,lastPoint:r.length>0?r[r.length-1]:null,distanceKm:i,status:u,isTracking:u==="tracking",start:f,stop:h,clear:_}}const _j="tempest_map_3qgBX",gj="tempest_svg_Da-XM",bj="tempest_empty_QQGkP",yj="tempest_loading_R6YCf",vj="tempest_grid_xFsTS",xj="tempest_path_-A7Sl",wj="tempest_start_OPmUL",jj="tempest_end_7SX7p",$j="tempest_current_WFLJk",kj="tempest_pulse_DUzgL",Nj="tempest_marker_HB3Rb",Sj="tempest_scale_YuwqB",G={map:_j,svg:gj,empty:bj,loading:yj,grid:vj,path:xj,start:wj,end:jj,current:$j,pulse:kj,marker:Nj,scale:Sj},Cj=l.lazy(()=>Promise.resolve().then(()=>require("./leaflet-map-BzYV9czG.cjs")).then(e=>({default:e.LeafletTrajectory}))),Mn=[.05,.1,.25,.5,1,2,5,10,25,50,100,250,500,1e3];function Ej(e,t){const n=e*t;let s=Mn[0];for(const r of Mn)r<=n&&(s=r);return{km:s,pixels:s/e}}function Tj(e){return e<1?`${Math.round(e*1e3)} m`:`${e%1===0?e:e.toFixed(1)} km`}function Mj({points:e,current:t,height:n=320,padding:s=24,showGrid:r=!0,showScale:a=!0,strokeColor:i,tileUrl:c,tileAttribution:u,label:d="Trajetória",markers:p,onMarkerClick:m,className:f,style:h,..._}){const v=l.useRef(null),[y,g]=l.useState(600);l.useEffect(()=>{const k=v.current;if(!k||typeof ResizeObserver>"u")return;const M=new ResizeObserver(E=>{const N=E[0]?.contentRect.width;N&&N>0&&g(N)});return M.observe(k),()=>M.disconnect()},[]);const x=l.useMemo(()=>[...e,...t?[t]:[],...p??[]],[e,t,p]),b=l.useMemo(()=>{const k=Ds(x);if(!k)return null;const M=P.fitProjection(Ps(k,.12),y,n,{padding:s}),E=e.map(ge=>M.project(ge)),N=E.map(ge=>`${ge.x.toFixed(1)},${ge.y.toFixed(1)}`).join(" "),S=E[0]??null,T=E.length>0?E[E.length-1]:null,D=t?M.project(t):null,$={latitude:(k.minLatitude+k.maxLatitude)/2,longitude:(k.minLongitude+k.maxLongitude)/2},C=M.project($),I=M.project({...$,longitude:k.maxLongitude}),L=P.haversineKm($,{...$,longitude:k.maxLongitude}),R=Math.abs(I.x-C.x)||1,W=L/R||0,We=(p??[]).map(ge=>({marker:ge,p:M.project(ge)}));return{polyline:N,startPixel:S,endPixel:T,currentPixel:D,kmPerPixel:W,markerPixels:We}},[x,e,t,p,y,n,s]);if(c)return o.jsx("div",{ref:v,className:w.cn(G.map,f),style:{height:n,...h},role:"img","aria-label":d,..._,children:o.jsx(l.Suspense,{fallback:o.jsx("div",{className:G.loading,children:"Carregando mapa…"}),children:o.jsx(Cj,{points:e,current:t,tileUrl:c,tileAttribution:u,strokeColor:i})})});const j=a&&b&&b.kmPerPixel>0?Ej(b.kmPerPixel,Math.min(120,y*.35)):null;return o.jsx("div",{ref:v,className:w.cn(G.map,f),style:{height:n,...h},role:"img","aria-label":d,..._,children:b?o.jsxs("svg",{className:G.svg,width:"100%",height:n,viewBox:`0 0 ${y} ${n}`,preserveAspectRatio:"xMidYMid meet",children:[r&&o.jsxs("g",{className:G.grid,children:[[.25,.5,.75].map(k=>o.jsx("line",{x1:0,y1:n*k,x2:y,y2:n*k},`h${k}`)),[.25,.5,.75].map(k=>o.jsx("line",{x1:y*k,y1:0,x2:y*k,y2:n},`v${k}`))]}),b.polyline&&o.jsx("polyline",{className:G.path,points:b.polyline,fill:"none",stroke:i,"data-testid":"trajectory-path"}),b.startPixel&&o.jsx("circle",{className:G.start,cx:b.startPixel.x,cy:b.startPixel.y,r:5}),b.endPixel&&!t&&o.jsx("circle",{className:G.end,cx:b.endPixel.x,cy:b.endPixel.y,r:5}),b.currentPixel&&o.jsxs(o.Fragment,{children:[o.jsx("circle",{className:G.pulse,cx:b.currentPixel.x,cy:b.currentPixel.y,r:10}),o.jsx("circle",{className:G.current,cx:b.currentPixel.x,cy:b.currentPixel.y,r:5})]}),b.markerPixels.map(({marker:k,p:M},E)=>{const N=!!m;return o.jsx("circle",{className:G.marker,cx:M.x,cy:M.y,r:k.radius??6,style:k.color?{fill:k.color}:void 0,"data-marker-id":k.id??E,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-label":k.label,onClick:N?()=>m?.(k,E):void 0,onKeyDown:N?S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m?.(k,E))}:void 0,children:k.label?o.jsx("title",{children:k.label}):null},k.id??E)}),j&&o.jsxs("g",{className:G.scale,transform:`translate(${s}, ${n-s})`,children:[o.jsx("line",{x1:0,y1:0,x2:j.pixels,y2:0}),o.jsx("line",{x1:0,y1:-4,x2:0,y2:4}),o.jsx("line",{x1:j.pixels,y1:-4,x2:j.pixels,y2:4}),o.jsx("text",{x:j.pixels/2,y:-8,textAnchor:"middle",children:Tj(j.km)})]})]}):o.jsx("div",{className:G.empty,children:"Sem pontos de trajetória ainda."})})}function Rj(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Lj(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()}const Rn=["debug","info","warn","error"];function Lj(e,t){return Rn.indexOf(t)>=Rn.indexOf(e)}const Is=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function Fs(e={}){const t=e.level??"info",n=e.sinks??[Is],s=e.namespace??"";function r(a,i,c){if(!Lj(t,a))return;const u={level:a,message:s?`[${s}] ${i}`:i,context:c,timestamp:Date.now()};for(const d of n)try{d(u)}catch{}}return{debug:(a,i)=>r("debug",a,i),info:(a,i)=>r("info",a,i),warn:(a,i)=>r("warn",a,i),error:(a,i)=>r("error",a,i),child:a=>Fs({level:t,sinks:n,namespace:s?`${s}:${a}`:a})}}const Os=l.createContext(null);function Dj({adapter:e,children:t}){l.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=l.useMemo(()=>e,[e]);return o.jsx(Os.Provider,{value:n,children:t})}function Pj(){return l.useContext(Os)}const Aj={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)}};function Ij(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function Fj(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(a){t.setUser(Ij(a))},track(a){t.addBreadcrumb({category:r,message:a.name,level:"info",...a.properties?{data:a.properties}:null})},captureException(a,i){t.captureException(a,i?{extra:i}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function Oj(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function Bj(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,Oj(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const a=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:a.message,$exception_type:a.name,$exception_stack_trace_raw:a.stack,...r})}}}const Bs=l.createContext(null);function zj({adapter:e,children:t}){const n=l.useMemo(()=>e,[e]);return l.useEffect(()=>{},[n]),o.jsx(Bs.Provider,{value:n,children:t})}function zs(){const e=l.useContext(Bs);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function Wj(e,t=!1){const n=zs(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.isEnabled(e,t);return l.useSyncExternalStore(s,r,r)}function qj(e,t){const n=zs(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.get(e,t);return l.useSyncExternalStore(s,r,r)}function Kj(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,a=!1){return r in t?!!t[r]:a},get(r,a){return r in t?t[r]:a},onChange(r){return n.add(r),()=>n.delete(r)},set(r,a){t[r]=a,s()}}}function Uj(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const a of n)a()}))}return{isEnabled(a,i=!1){const c=t.isOn(a);return typeof c=="boolean"?c:i},get(a,i){return t.getFeatureValue(a,i)},onChange(a){return r(),n.add(a),()=>{n.delete(a)}}}}function Hj(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function Gj(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 Qj(){return typeof navigator<"u"&&"share"in navigator}exports.createPartialResponse=_e.createPartialResponse;exports.installBackgroundSync=_e.installBackgroundSync;exports.installNotificationClickHandler=_e.installNotificationClickHandler;exports.installPrecache=_e.installPrecache;exports.installPushHandler=_e.installPushHandler;exports.installRuntimeCache=_e.installRuntimeCache;exports.installSkipWaitingListener=_e.installSkipWaitingListener;exports.registerServiceWorker=_e.registerServiceWorker;exports.skipWaiting=_e.skipWaiting;exports.unregisterAllServiceWorkers=_e.unregisterAllServiceWorkers;exports.cn=w.cn;Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>A.BrowserRouter});Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:()=>A.HashRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>A.Link});Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:()=>A.MemoryRouter});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>A.NavLink});Object.defineProperty(exports,"Navigate",{enumerable:!0,get:()=>A.Navigate});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>A.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>A.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>A.Routes});Object.defineProperty(exports,"redirect",{enumerable:!0,get:()=>A.redirect});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>A.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>A.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>A.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>A.useParams});Object.defineProperty(exports,"useRouteError",{enumerable:!0,get:()=>A.useRouteError});Object.defineProperty(exports,"useSearchParams",{enumerable:!0,get:()=>A.useSearchParams});exports.EARTH_RADIUS_KM=P.EARTH_RADIUS_KM;exports.Input=P.Input;exports.MERCATOR_MAX_LATITUDE=P.MERCATOR_MAX_LATITUDE;exports.Select=P.Select;exports.bearingDeg=P.bearingDeg;exports.clampLatitude=P.clampLatitude;exports.fitProjection=P.fitProjection;exports.haversineKm=P.haversineKm;exports.isCoordinate=P.isCoordinate;exports.isValidLatitude=P.isValidLatitude;exports.isValidLongitude=P.isValidLongitude;exports.normalizeLongitude=P.normalizeLongitude;exports.pathLengthKm=P.pathLengthKm;exports.projectMercator=P.projectMercator;exports.toRadians=P.toRadians;exports.unprojectMercator=P.unprojectMercator;exports.useDebounce=P.useDebounce;Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>he.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>he.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>he.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>he.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>he.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>he.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>he.useWatch});exports.AccessControlProvider=rw;exports.Accordion=Ys;exports.Alert=dr;exports.AppBar=Nr;exports.AppProviders=Ow;exports.AppRouter=Mw;exports.AppShell=Ar;exports.AspectRatio=Or;exports.AuthGuard=ew;exports.Avatar=Zr;exports.BREAKPOINTS=jt;exports.Badge=ho;exports.Banner=So;exports.BottomNavigation=Po;exports.BottomSheet=qo;exports.Breadcrumbs=Jo;exports.Button=Xe;exports.CACHE_TIME=us;exports.CEPInput=rj;exports.CNPJInput=nj;exports.CPFInput=tj;exports.Calendar=Zg;exports.Can=aw;exports.Card=Ta;exports.Carousel=$y;exports.Center=Pa;exports.Checkbox=qa;exports.ChipInput=ti;exports.ClickOutside=m_;exports.Collapsible=Q_;exports.Combobox=_i;exports.Command=Sg;exports.ConditionalWrapper=f_;exports.ConfirmDialog=Dn;exports.Container=Kl;exports.ContextMenu=tg;exports.CopyButton=t_;exports.DEFAULT_CAR_SPEED_KMH=Rs;exports.DEFAULT_CIRCUITY_FACTOR=Ms;exports.DEFAULT_MODE_DURATION_FACTORS=Ls;exports.DataList=$_;exports.DataTable=fv;exports.DatePicker=Ai;exports.DateRangePicker=Qb;exports.DescriptionList=C_;exports.Divider=Ki;exports.Drawer=lc;exports.DropdownMenu=jc;exports.Dropzone=Ec;exports.EmptyState=Pc;exports.ErrorBoundary=xs;exports.ErrorState=zc;exports.ErrorText=b_;exports.FeatureFlagsProvider=zj;exports.FileUpload=rl;exports.FloatingActionButton=Fv;exports.For=h_;exports.Form=xl;exports.FormActions=$l;exports.FormField=Jw;exports.FormRow=jl;exports.FormSection=wl;exports.GoogleSignIn=uw;exports.Grid=Ql;exports.Hide=Sp;exports.HoverCard=ug;exports.I18nProvider=ys;exports.Image=x_;exports.InstallBanner=nu;exports.InstallButton=su;exports.Kbd=cu;exports.Label=K_;exports.ListTile=$v;exports.Menubar=my;exports.Modal=Gt;exports.ModalsProvider=du;exports.Money=a_;exports.MoneyInput=ij;exports.MultiSelect=Nb;exports.NProgressBar=Tu;exports.Navbar=$u;exports.NavigationMenu=ny;exports.NavigationRail=Jv;exports.Page=Wu;exports.Pagination=Bn;exports.PasswordInput=bd;exports.PhoneInput=sj;exports.PinInput=Md;exports.Popover=Od;exports.Portal=Jn;exports.Progress=Jd;exports.QueryProvider=ds;exports.REFETCH_TIME=pw;exports.Radio=op;exports.RadioGroup=ap;exports.RangeSlider=hp;exports.RatingStars=$p;exports.RefreshIndicator=mx;exports.RelativeTime=o_;exports.Resizable=Fg;exports.RouteGuard=fs;exports.STALE_TIME=ls;exports.SafeArea=Pp;exports.ScrollArea=Mg;exports.SearchBar=Kn;exports.SegmentedControl=Xp;exports.Show=Np;exports.Sidebar=cm;exports.Skeleton=pm;exports.Slider=cb;exports.Spacer=gm;exports.Spinner=Un;exports.Stack=Hl;exports.Stat=Bm;exports.Stepper=Jm;exports.StepperInput=cf;exports.Switch=hf;exports.Table=Hn;exports.Tabs=Qf;exports.Tag=Cf;exports.TelemetryProvider=Dj;exports.TempestApiError=kt;exports.TempestDataProvider=xw;exports.Textarea=nh;exports.ThemeProvider=gs;exports.TimePicker=ix;exports.Timeline=bh;exports.ToastProvider=Kh;exports.Toggle=P_;exports.ToggleGroup=B_;exports.ToggleGroupItem=z_;exports.Tooltip=Nh;exports.TrajectoryMap=Tj;exports.TruncateText=l_;exports.VirtualList=Vh;exports.VisuallyHidden=p_;exports.WebPushClient=ks;exports.WebPushPermissionDeniedError=$s;exports.WebPushUnsupportedError=Ht;exports.assertNever=Ax;exports.boundingBox=Ds;exports.boundsCenter=pj;exports.buildApiError=Yt;exports.camelCase=wx;exports.capitalize=xx;exports.chunk=Sx;exports.clamp=Bt;exports.consoleSink=Is;exports.consoleTelemetryAdapter=Aj;exports.createApiClient=xt;exports.createAudioPlayer=en;exports.createAuthStore=ss;exports.createDataProvider=vw;exports.createEventStream=ws;exports.createGrowthBookFeatureFlagsAdapter=Uj;exports.createI18n=Zt;exports.createInMemoryFlags=Kj;exports.createLaunchDarklyFeatureFlagsAdapter=Hj;exports.createLogger=Fs;exports.createOSRMBackend=mj;exports.createOfflineStore=Gw;exports.createPositionTracker=As;exports.createPostHogTelemetryAdapter=Bj;exports.createQueryKeys=mw;exports.createRefreshQueue=os;exports.createRoleAccessControl=cw;exports.createSelectors=Lw;exports.createSentryTelemetryAdapter=Fj;exports.createStore=Rw;exports.createTempestAuth=sw;exports.createWebSocket=Ts;exports.debounce=Ix;exports.decodeJWT=Xt;exports.deepMerge=ns;exports.defineRoutes=Sw;exports.durationFactor=tn;exports.emptyOffsetPage=_w;exports.estimatePasswordStrength=zn;exports.estimateTravel=dj;exports.expandBounds=Ps;exports.formatBytes=Ym;exports.formatCEP=Cs;exports.formatCNPJ=Es;exports.formatCPF=ts;exports.formatCompactNumber=Xm;exports.formatCurrency=fx;exports.formatDate=hx;exports.formatDateTime=_x;exports.formatPercent=gx;exports.formatPhone=es;exports.generateIdempotencyKey=Vx;exports.getInitialTheme=Mj;exports.groupBy=kx;exports.isApiError=qx;exports.isCursorPage=hw;exports.isDefined=Rx;exports.isEmpty=Mx;exports.isJWTExpired=tw;exports.isNumber=Dx;exports.isOffsetPage=fw;exports.isPlainObject=Px;exports.isPushSupported=lt;exports.isShareSupported=Qj;exports.isString=Lx;exports.kebabCase=jx;exports.lazyWithRetry=rs;exports.listQueryKey=ms;exports.memoizeOne=Bx;exports.nprogress=On;exports.omit=Tx;exports.once=Ox;exports.oneQueryKey=Vt;exports.parseResponse=Gx;exports.permissionsFromToken=lw;exports.pick=Ex;exports.playAudio=qw;exports.pluralize=$x;exports.randomId=Jt;exports.range=Cx;exports.relativeTime=Qn;exports.retry=Xx;exports.share=Gj;exports.sleep=zx;exports.slugify=yx;exports.stopAudio=Kw;exports.storage=bx;exports.themeInitScript=Rj;exports.throttle=Fx;exports.truncate=vx;exports.uniqueBy=Nx;exports.unmask=ej;exports.uploadWithProgress=Jx;exports.urlBase64ToUint8Array=js;exports.useAccessControl=is;exports.useAsync=Ry;exports.useAudio=Uw;exports.useBeforeInstallPrompt=Qt;exports.useBreakpoint=ze;exports.useCan=cs;exports.useClickOutside=iv;exports.useClientFilter=ky;exports.useClipboard=Iy;exports.useCounter=tv;exports.useCreate=$w;exports.useCursorQuery=bw;exports.useDataProvider=Ze;exports.useDeepMemo=Uy;exports.useDelete=Nw;exports.useDisclosure=Zy;exports.useDocumentTitle=nv;exports.useDocumentVisibility=Dy;exports.useErrorHandler=Qw;exports.useEventListener=Sy;exports.useEventStream=zw;exports.useFavicon=sv;exports.useFeatureFlag=Wj;exports.useFlagValue=qj;exports.useFocusTrap=Xn;exports.useGeolocation=Wy;exports.useHover=Xy;exports.useI18n=vs;exports.useIdle=zy;exports.useIntersectionObserver=Py;exports.useInterval=Gy;exports.useIsFirstRender=cv;exports.useKeyboardShortcut=By;exports.useList=ww;exports.useListState=ev;exports.useLocalStorage=Ty;exports.useLongPress=Vy;exports.useMap=rv;exports.useMediaQuery=Ny;exports.useModals=fu;exports.useOAuthCallback=dw;exports.useOne=jw;exports.useOnline=Ly;exports.usePaginatedQuery=gw;exports.usePagination=Zn;exports.usePoll=Zx;exports.usePositionTracker=fj;exports.usePrevious=Hy;exports.usePushSubscription=Ww;exports.useQueue=av;exports.useResizeObserver=Ay;exports.useScrollLock=qy;exports.useSet=ov;exports.useStableCallback=Ky;exports.useTelemetry=Pj;exports.useTheme=Pw;exports.useThrottle=Jy;exports.useTimeout=Qy;exports.useToast=qh;exports.useToggle=My;exports.useTranslate=Iw;exports.useUpdate=kw;exports.useViaCEP=cj;exports.useWebSocket=uj;exports.useWindowSize=Yy;exports.useZodForm=Xw;exports.validateCNPJ=Zw;exports.validateCPF=Vw;exports.validateForm=Yw;exports.withTimeout=Wx;exports.zodResolver=Ss;
14
+ `.trim()}const Rn=["debug","info","warn","error"];function Dj(e,t){return Rn.indexOf(t)>=Rn.indexOf(e)}const Is=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function Fs(e={}){const t=e.level??"info",n=e.sinks??[Is],s=e.namespace??"";function r(a,i,c){if(!Dj(t,a))return;const u={level:a,message:s?`[${s}] ${i}`:i,context:c,timestamp:Date.now()};for(const d of n)try{d(u)}catch{}}return{debug:(a,i)=>r("debug",a,i),info:(a,i)=>r("info",a,i),warn:(a,i)=>r("warn",a,i),error:(a,i)=>r("error",a,i),child:a=>Fs({level:t,sinks:n,namespace:s?`${s}:${a}`:a})}}const Os=l.createContext(null);function Pj({adapter:e,children:t}){l.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=l.useMemo(()=>e,[e]);return o.jsx(Os.Provider,{value:n,children:t})}function Aj(){return l.useContext(Os)}const Ij={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)}};function Fj(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function Oj(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(a){t.setUser(Fj(a))},track(a){t.addBreadcrumb({category:r,message:a.name,level:"info",...a.properties?{data:a.properties}:null})},captureException(a,i){t.captureException(a,i?{extra:i}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function Bj(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function zj(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,Bj(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const a=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:a.message,$exception_type:a.name,$exception_stack_trace_raw:a.stack,...r})}}}const Bs=l.createContext(null);function Wj({adapter:e,children:t}){const n=l.useMemo(()=>e,[e]);return l.useEffect(()=>{},[n]),o.jsx(Bs.Provider,{value:n,children:t})}function zs(){const e=l.useContext(Bs);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function qj(e,t=!1){const n=zs(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.isEnabled(e,t);return l.useSyncExternalStore(s,r,r)}function Uj(e,t){const n=zs(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.get(e,t);return l.useSyncExternalStore(s,r,r)}function Kj(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,a=!1){return r in t?!!t[r]:a},get(r,a){return r in t?t[r]:a},onChange(r){return n.add(r),()=>n.delete(r)},set(r,a){t[r]=a,s()}}}function Hj(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const a of n)a()}))}return{isEnabled(a,i=!1){const c=t.isOn(a);return typeof c=="boolean"?c:i},get(a,i){return t.getFeatureValue(a,i)},onChange(a){return r(),n.add(a),()=>{n.delete(a)}}}}function Gj(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function Qj(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 Jj(){return typeof navigator<"u"&&"share"in navigator}exports.createPartialResponse=_e.createPartialResponse;exports.installBackgroundSync=_e.installBackgroundSync;exports.installNotificationClickHandler=_e.installNotificationClickHandler;exports.installPrecache=_e.installPrecache;exports.installPushHandler=_e.installPushHandler;exports.installRuntimeCache=_e.installRuntimeCache;exports.installSkipWaitingListener=_e.installSkipWaitingListener;exports.registerServiceWorker=_e.registerServiceWorker;exports.skipWaiting=_e.skipWaiting;exports.unregisterAllServiceWorkers=_e.unregisterAllServiceWorkers;exports.cn=w.cn;Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>A.BrowserRouter});Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:()=>A.HashRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>A.Link});Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:()=>A.MemoryRouter});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>A.NavLink});Object.defineProperty(exports,"Navigate",{enumerable:!0,get:()=>A.Navigate});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>A.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>A.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>A.Routes});Object.defineProperty(exports,"redirect",{enumerable:!0,get:()=>A.redirect});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>A.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>A.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>A.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>A.useParams});Object.defineProperty(exports,"useRouteError",{enumerable:!0,get:()=>A.useRouteError});Object.defineProperty(exports,"useSearchParams",{enumerable:!0,get:()=>A.useSearchParams});exports.EARTH_RADIUS_KM=P.EARTH_RADIUS_KM;exports.Input=P.Input;exports.MERCATOR_MAX_LATITUDE=P.MERCATOR_MAX_LATITUDE;exports.Select=P.Select;exports.bearingDeg=P.bearingDeg;exports.clampLatitude=P.clampLatitude;exports.fitProjection=P.fitProjection;exports.haversineKm=P.haversineKm;exports.isCoordinate=P.isCoordinate;exports.isValidLatitude=P.isValidLatitude;exports.isValidLongitude=P.isValidLongitude;exports.normalizeLongitude=P.normalizeLongitude;exports.pathLengthKm=P.pathLengthKm;exports.projectMercator=P.projectMercator;exports.toRadians=P.toRadians;exports.unprojectMercator=P.unprojectMercator;exports.useDebounce=P.useDebounce;Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>he.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>he.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>he.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>he.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>he.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>he.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>he.useWatch});exports.AccessControlProvider=ow;exports.Accordion=Ys;exports.Alert=dr;exports.AppBar=Nr;exports.AppProviders=Bw;exports.AppRouter=Rw;exports.AppShell=Ar;exports.AspectRatio=Or;exports.AuthGuard=tw;exports.Avatar=Zr;exports.BREAKPOINTS=jt;exports.Badge=ho;exports.Banner=So;exports.BottomNavigation=Po;exports.BottomSheet=qo;exports.Breadcrumbs=Jo;exports.Button=Xe;exports.CACHE_TIME=us;exports.CEPInput=oj;exports.CNPJInput=sj;exports.CPFInput=nj;exports.Calendar=Zg;exports.Can=iw;exports.Card=Ta;exports.Carousel=$y;exports.Center=Pa;exports.Checkbox=qa;exports.ChipInput=ti;exports.ClickOutside=m_;exports.Collapsible=Q_;exports.Combobox=_i;exports.Command=Sg;exports.ConditionalWrapper=f_;exports.ConfirmDialog=Dn;exports.Container=Ul;exports.ContextMenu=tg;exports.CopyButton=t_;exports.DEFAULT_CAR_SPEED_KMH=Rs;exports.DEFAULT_CIRCUITY_FACTOR=Ms;exports.DEFAULT_MODE_DURATION_FACTORS=Ls;exports.DataList=$_;exports.DataTable=hv;exports.DatePicker=Ai;exports.DateRangePicker=Qb;exports.DescriptionList=C_;exports.Divider=Ui;exports.Drawer=lc;exports.DropdownMenu=jc;exports.Dropzone=Ec;exports.EmptyState=Pc;exports.ErrorBoundary=xs;exports.ErrorState=zc;exports.ErrorText=b_;exports.FeatureFlagsProvider=Wj;exports.FileUpload=rl;exports.FloatingActionButton=Ov;exports.For=h_;exports.Form=xl;exports.FormActions=$l;exports.FormField=Yw;exports.FormRow=jl;exports.FormSection=wl;exports.GoogleSignIn=dw;exports.Grid=Ql;exports.Hide=Sp;exports.HoverCard=ug;exports.I18nProvider=ys;exports.Image=x_;exports.InstallBanner=nu;exports.InstallButton=su;exports.Kbd=cu;exports.Label=U_;exports.ListTile=kv;exports.Menubar=my;exports.Modal=Gt;exports.ModalsProvider=du;exports.Money=a_;exports.MoneyInput=cj;exports.MultiSelect=Nb;exports.NProgressBar=Tu;exports.Navbar=$u;exports.NavigationMenu=ny;exports.NavigationRail=Yv;exports.Page=Wu;exports.Pagination=Bn;exports.PasswordInput=bd;exports.PhoneInput=rj;exports.PinInput=Md;exports.Popover=Od;exports.Portal=Jn;exports.Progress=Jd;exports.QueryProvider=ds;exports.REFETCH_TIME=mw;exports.Radio=op;exports.RadioGroup=ap;exports.RangeSlider=hp;exports.RatingStars=$p;exports.RefreshIndicator=fx;exports.RelativeTime=o_;exports.Resizable=Fg;exports.RouteGuard=fs;exports.STALE_TIME=ls;exports.SafeArea=Pp;exports.ScrollArea=Mg;exports.SearchBar=Un;exports.SegmentedControl=Xp;exports.Show=Np;exports.Sidebar=cm;exports.Skeleton=pm;exports.Slider=cb;exports.Spacer=gm;exports.Spinner=Kn;exports.Stack=Hl;exports.Stat=Bm;exports.Stepper=Jm;exports.StepperInput=cf;exports.Switch=hf;exports.Table=Hn;exports.Tabs=Qf;exports.Tag=Cf;exports.TelemetryProvider=Pj;exports.TempestApiError=kt;exports.TempestDataProvider=ww;exports.Textarea=nh;exports.ThemeProvider=gs;exports.TimePicker=cx;exports.Timeline=bh;exports.ToastProvider=Uh;exports.Toggle=P_;exports.ToggleGroup=B_;exports.ToggleGroupItem=z_;exports.Tooltip=Nh;exports.TrajectoryMap=Mj;exports.TruncateText=l_;exports.VirtualList=Vh;exports.VisuallyHidden=p_;exports.WebPushClient=ks;exports.WebPushPermissionDeniedError=$s;exports.WebPushUnsupportedError=Ht;exports.assertNever=Ix;exports.boundingBox=Ds;exports.boundsCenter=mj;exports.buildApiError=Yt;exports.camelCase=jx;exports.capitalize=wx;exports.chunk=Cx;exports.clamp=Bt;exports.consoleSink=Is;exports.consoleTelemetryAdapter=Ij;exports.createApiClient=xt;exports.createAudioPlayer=en;exports.createAuthStore=ss;exports.createDataProvider=xw;exports.createEventStream=ws;exports.createGrowthBookFeatureFlagsAdapter=Hj;exports.createI18n=Zt;exports.createInMemoryFlags=Kj;exports.createLaunchDarklyFeatureFlagsAdapter=Gj;exports.createLogger=Fs;exports.createOSRMBackend=fj;exports.createOfflineStore=Qw;exports.createPositionTracker=As;exports.createPostHogTelemetryAdapter=zj;exports.createQueryKeys=fw;exports.createRefreshQueue=os;exports.createRoleAccessControl=lw;exports.createSelectors=Dw;exports.createSentryTelemetryAdapter=Oj;exports.createStore=Lw;exports.createTempestAuth=rw;exports.createWebSocket=Ts;exports.debounce=Fx;exports.decodeJWT=Xt;exports.deepMerge=ns;exports.defineRoutes=Cw;exports.durationFactor=tn;exports.emptyOffsetPage=gw;exports.estimatePasswordStrength=zn;exports.estimateTravel=pj;exports.expandBounds=Ps;exports.formatBytes=Ym;exports.formatCEP=Cs;exports.formatCNPJ=Es;exports.formatCPF=ts;exports.formatCompactNumber=Xm;exports.formatCurrency=hx;exports.formatDate=_x;exports.formatDateTime=gx;exports.formatPercent=bx;exports.formatPhone=es;exports.generateIdempotencyKey=Zx;exports.getInitialTheme=Rj;exports.groupBy=Nx;exports.isApiError=Ux;exports.isCursorPage=_w;exports.isDefined=Lx;exports.isEmpty=Rx;exports.isJWTExpired=nw;exports.isNumber=Px;exports.isOffsetPage=hw;exports.isPlainObject=Ax;exports.isPushSupported=lt;exports.isShareSupported=Jj;exports.isString=Dx;exports.kebabCase=$x;exports.lazyWithRetry=rs;exports.listQueryKey=ms;exports.memoizeOne=zx;exports.nprogress=On;exports.omit=Mx;exports.once=Bx;exports.oneQueryKey=Vt;exports.parseResponse=Qx;exports.permissionsFromToken=uw;exports.pick=Tx;exports.playAudio=Uw;exports.pluralize=kx;exports.randomId=Jt;exports.range=Ex;exports.relativeTime=Qn;exports.retry=Vx;exports.share=Qj;exports.sleep=Wx;exports.slugify=vx;exports.stopAudio=Kw;exports.storage=yx;exports.themeInitScript=Lj;exports.throttle=Ox;exports.truncate=xx;exports.uniqueBy=Sx;exports.unmask=tj;exports.uploadWithProgress=Yx;exports.urlBase64ToUint8Array=js;exports.useAccessControl=is;exports.useAsync=Ry;exports.useAudio=Hw;exports.useBeforeInstallPrompt=Qt;exports.useBreakpoint=ze;exports.useCan=cs;exports.useClickOutside=iv;exports.useClientFilter=ky;exports.useClipboard=Iy;exports.useCounter=tv;exports.useCreate=kw;exports.useCursorQuery=yw;exports.useDataProvider=Ze;exports.useDeepMemo=Ky;exports.useDelete=Sw;exports.useDisclosure=Zy;exports.useDocumentTitle=nv;exports.useDocumentVisibility=Dy;exports.useErrorHandler=Jw;exports.useEventListener=Sy;exports.useEventStream=Ww;exports.useFavicon=sv;exports.useFeatureFlag=qj;exports.useFlagValue=Uj;exports.useFocusTrap=Xn;exports.useGeolocation=Wy;exports.useHover=Xy;exports.useI18n=vs;exports.useIdle=zy;exports.useIntersectionObserver=Py;exports.useInterval=Gy;exports.useIsFirstRender=cv;exports.useKeyboardShortcut=By;exports.useList=jw;exports.useListState=ev;exports.useLocalStorage=Ty;exports.useLongPress=Vy;exports.useMap=rv;exports.useMediaQuery=Ny;exports.useModals=fu;exports.useOAuthCallback=pw;exports.useObjectUrl=lv;exports.useOne=$w;exports.useOnline=Ly;exports.usePaginatedQuery=bw;exports.usePagination=Zn;exports.usePoll=ew;exports.usePositionTracker=hj;exports.usePrevious=Hy;exports.usePushSubscription=qw;exports.useQueue=av;exports.useResizeObserver=Ay;exports.useScrollLock=qy;exports.useSet=ov;exports.useStableCallback=Uy;exports.useTelemetry=Aj;exports.useTheme=Aw;exports.useThrottle=Jy;exports.useTimeout=Qy;exports.useToast=qh;exports.useToggle=My;exports.useTranslate=Fw;exports.useUpdate=Nw;exports.useViaCEP=lj;exports.useWebSocket=dj;exports.useWindowSize=Yy;exports.useZodForm=Vw;exports.validateCNPJ=ej;exports.validateCPF=Zw;exports.validateForm=Xw;exports.withTimeout=qx;exports.zodResolver=Ss;
15
15
  //# sourceMappingURL=tempest-react-sdk.cjs.map