import{j as a}from"./jsx-runtime-hUI6LOBV.js";import{r}from"./index-CFdT0RIo.js";import{k as p,g as b}from"./chunk-EVOBXE3Y-Bmgys8-c.js";import{d as h,c as y}from"./misc-BNcbB3dR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"66e9b849450b819e11683314a547a341cb57f7d0"};var n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="413b3053-72f4-4563-9e2f-47f6a4c31401",t._sentryDebugIdIdentifier="sentry-dbid-413b3053-72f4-4563-9e2f-47f6a4c31401")}catch{}})();const D=a.jsx("input",{type:"hidden",name:"show-progress-bar",value:"true"});function I(){const t=p(),n=b().filter(e=>e.formData?.get("show-progress-bar")==="true"),i=[t.state,...n.map(e=>e.state)],l=i.some(e=>e!=="idle"),s=h.useSpinDelay(l,{delay:600,minDuration:400}),o=r.useRef(null),[f,d]=r.useState(!0),u=i.every(e=>e==="idle"),c=i.some(e=>e==="submitting"),m=i.some(e=>e==="loading");return r.useEffect(()=>{if(!o.current)return;s&&d(!1);const e=o.current.getAnimations().map(({finished:g})=>g);Promise.allSettled(e).then(()=>{s||d(!0)})},[s]),a.jsx("div",{role:"progressbar","aria-hidden":s?void 0:!0,"aria-valuetext":s?"Loading":void 0,className:"fixed inset-x-0 top-0 left-0 z-50 h-[0.20rem] animate-pulse",children:a.jsx("div",{ref:o,className:y("bg-highlight h-full w-0 duration-500 ease-in-out",u&&(f?"transition-none":"w-full opacity-0 transition-all"),s&&c&&"w-5/12",s&&m&&"w-8/12")})})}export{I as E,D as s};
//# sourceMappingURL=progress-bar-8MSIg-hJ.js.map
