PageSourceSearch

https://app-static.joinzipper.com/build/assets/useDebounceEffect-B7Skf_F3.js

js joinzipper.com collected 2026-09-25 20:28:24 UTC 30,008 bytes, 1 lines download raw bytes

1import{j as b}from"./jsx-runtime-BTCK_S7S.js";import{r as i,R as p}from"./index-CBqU2yxZ.js";import{r as Ie}from"./index-Bz5QO1uh.js";import{c as Ae}from"./index-oGBOdLgt.js";import"./useWindowSize-BkK8Zfjs.js";import{e as Le,u as T,d as B,o as $,b as V,C as D,y as j,f as Z,h as be,s as xe,$ as A,T as Xe,F as Qe,I as ee,S as Ee,c as Ze,k as et,r as tt,j as z}from"./description-CzI1hnjZ.js";function ae(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Y(){let e=[],t=[],n={enqueue(r){t.push(r)},addEventListener(r,l,a,o){return r.addEventListener(l,a,o),n.add(()=>r.removeEventListener(l,a,o))},requestAnimationFrame(...r){let l=requestAnimationFrame(...r);return n.add(()=>cancelAnimationFrame(l))},nextFrame(...r){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...r))},setTimeout(...r){let l=setTimeout(...r);return n.add(()=>clearTimeout(l))},microTask(...r){let l={current:!0};return ae(()=>{l.current&&r[0]()}),n.add(()=>{l.current=!1})},add(r){return e.push(r),()=>{let l=e.indexOf(r);if(l>=0){let[a]=e.splice(l,1);a()}}},dispose(){for(let r of e.splice(0))r()},async workQueue(){for(let r of t.splice(0))await r()}};return n}function ze(){let[e]=i.useState(Y);return i.useEffect(()=>()=>e.dispose(),[e]),e}function ie(e){return Le?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let ye=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var re=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(re||{}),Be=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Be||{}),nt=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(nt||{});function He(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(ye))}var qe=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(qe||{});function Ue(e,t=0){var n;return e===((n=ie(e))==null?void 0:n.body)?!1:T(t,{0(){return e.matches(ye)},1(){let r=e;for(;r!==null;){if(r.matches(ye))return!0;r=r.parentElement}return!1}})}function sn(e){let t=ie(e);Y().nextFrame(()=>{t&&!Ue(t.activeElement,0)&&q(e)})}function q(e){e==null||e.focus({preventScroll:!0})}let rt=["textarea","input"].join(",");function lt(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,rt))!=null?n:!1}function ot(e,t=n=>n){return e.slice().sort((n,r)=>{let l=t(n),a=t(r);if(l===null||a===null)return 0;let o=l.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function un(e,t){return le(He(),t,!0,e)}function le(e,t,n=!0,r=null){let l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?n?ot(e):e:He(e);r=r??l.activeElement;let o=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(r))-1;if(t&4)return Math.max(0,a.indexOf(r))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=t&32?{preventScroll:!0}:{},c=0,f=a.length,h;do{if(c>=f||c+f<=0)return 0;let x=s+c;if(t&16)x=(x+f)%f;else{if(x<0)return 3;if(x>=f)return 1}h=a[x],h==null||h.focus(d),c+=o}while(h!==l.activeElement);return t&6&&lt(h)&&h.select(),h.hasAttribute("tabindex")||h.setAttribute("tabindex","0"),2}function he(e,t,n){let r=B(t);i.useEffect(()=>{function l(a){r.current(a)}return document.addEventListener(e,l,n),()=>document.removeEventListener(e,l,n)},[e,n])}function at(e,t,n=!0){let r=i.useRef(!1);i.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function l(o,s){if(!r.current||o.defaultPrevented)return;let d=function f(h){return typeof h=="function"?f(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e),c=s(o);if(c!==null&&c.ownerDocument.documentElement.contains(c)){for(let f of d){if(f===null)continue;let h=f instanceof HTMLElement?f:f.current;if(h!=null&&h.contains(c))return}return!Ue(c,qe.Loose)&&c.tabIndex!==-1&&o.preventDefault(),t(o,c)}}let a=i.useRef(null);he("mousedown",o=>{var s,d;r.current&&(a.current=((d=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:d[0])||o.target)},!0),he("click",o=>
1{!a.current||(l(o,()=>a.current),a.current=null)},!0),he("blur",o=>l(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let Se=i.createContext(null);Se.displayName="OpenClosedContext";var U=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(U||{});function De(){return i.useContext(Se)}function it({value:e,children:t}){return p.createElement(Se.Provider,{value:e},t)}function We(e,t){let n=i.useRef([]),r=$(e);i.useEffect(()=>{let l=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let s=r(t,l);return n.current=t,s}},[r,...t])}function st(e,t,n){let r=B(t);i.useEffect(()=>{function l(a){r.current(a)}return window.addEventListener(e,l,n),()=>window.removeEventListener(e,l,n)},[e,n])}var Ce=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Ce||{});function ut(){let e=i.useRef(0);return st("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function se(){let e=i.useRef(!1);return V(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ue(...e){return i.useMemo(()=>ie(...e),[...e])}function Ne(e,t,n,r){let l=B(n);i.useEffect(()=>{e=e??window;function a(o){l.current(o)}return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a,r)},[e,t,r])}let ct="div";var _e=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(_e||{});let Q=Object.assign(D(function(e,t){let n=i.useRef(null),r=j(n,t),{initialFocus:l,containers:a,features:o=30,...s}=e;Z()||(o=1);let d=ue(n);dt({ownerDocument:d},!!(o&16));let c=ft({ownerDocument:d,container:n,initialFocus:l},!!(o&2));mt({ownerDocument:d,container:n,containers:a,previousActiveElement:c},!!(o&8));let f=ut(),h=$(()=>{let w=n.current;!w||T(f.current,{[Ce.Forwards]:()=>le(w,re.First),[Ce.Backwards]:()=>le(w,re.Last)})}),x={ref:r};return p.createElement(p.Fragment,null,!!(o&4)&&p.createElement(be,{as:"button",type:"button",onFocus:h,features:xe.Focusable}),A({ourProps:x,theirProps:s,defaultTag:ct,name:"FocusTrap"}),!!(o&4)&&p.createElement(be,{as:"button",type:"button",onFocus:h,features:xe.Focusable}))}),{features:_e});function dt({ownerDocument:e},t){let n=i.useRef(null);Ne(e==null?void 0:e.defaultView,"focusout",l=>{!t||n.current||(n.current=l.target)},!0),We(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&q(n.current),n.current=null)},[t]);let r=i.useRef(!1);i.useEffect(()=>(r.current=!1,()=>{r.current=!0,ae(()=>{!r.current||(q(n.current),n.current=null)})}),[])}function ft({ownerDocument:e,container:t,initialFocus:n},r){let l=i.useRef(null),a=se();return We(()=>{if(!r)return;let o=t.current;!o||ae(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===s){l.current=s;return}}else if(o.contains(s)){l.current=s;return}n!=null&&n.current?q(n.current):le(o,re.First)===Be.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),l.current=e==null?void 0:e.activeElement})},[r]),l}function mt({ownerDocument:e,container:t,containers:n,previousActiveElement:r},l){let a=se();Ne(e==null?void 0:e.defaultView,"focus",o=>{if(!l||!a.current)return;let s=new Set(n==null?void 0:n.current);s.add(t);let d=r.current;if(!d)return;let c=o.target;c&&c instanceof HTMLElement?ht(s,c)?(r.current=c,q(c)):(o.preventDefault(),o.stopPropagation(),q(d)):q(r.current)},!0)}function ht(e,t){var n;for(let r of e)if((n=r.current)!=null&&n.contains(t))return!0;return!1}let G=new Set,I=new Map;function ke(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Me(e){let t=I.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function vt(e,t=!0){V(()=>{if(!t||!e.current)return;let n=e.current,r=ie(n);if(r){G.add(n);for(let l of I.keys())l.contains(n)&&(Me(l),I.delete(l));return r.querySelectorAll("body > *").forEach(l=>{if(l instanceof HTMLElement){for(let a of G)if(l.contains(a))return;G.size===1&&(I.set(l,{"aria-hidden":l.getAttribute("aria-hidden"),inert:l.inert}),ke(l))}}),()=>{if(G.delete(n),G.size>0)r.querySelectorAll("body > *").forEach(l=>{if(l instanceof HTMLElement&&!I.has(l)){for(let a of G)if(l.contains(a))return;I.set(l,{"aria-hidden":l.getAttribute("aria-hidden"),inert:l.inert}),ke(l)}});else for(let l of I.keys())Me(l),I.delete(l)}}},[t])}let Ge=i.createContext(!1);function pt(){return i.useContext(Ge)}function Te(e){return p.createElement(Ge.Provider,{value:e.force},e.children)}function gt(e){let t=pt(),n=i.useContext(Ve),r=ue(e),[l,a]=i.useState(()=>{if(!t&&n!==null||Le)return null;let o=r==null?void 0:r.getElementById("headlessui-portal-root");
1if(o)return o;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return i.useEffect(()=>{l!==null&&(r!=null&&r.body.contains(l)||r==null||r.body.appendChild(l))},[l,r]),i.useEffect(()=>{t||n!==null&&a(n.current)},[n,a,t]),l}let wt=i.Fragment,bt=D(function(e,t){let n=e,r=i.useRef(null),l=j(Xe(f=>{r.current=f}),t),a=ue(r),o=gt(r),[s]=i.useState(()=>{var f;return Le?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),d=Z(),c=i.useRef(!1);return V(()=>{if(c.current=!1,!(!o||!s))return o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s)),()=>{c.current=!0,ae(()=>{var f;!c.current||!o||!s||(o.removeChild(s),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))})}},[o,s]),d?!o||!s?null:Ie.createPortal(A({ourProps:{ref:l},theirProps:n,defaultTag:wt,name:"Portal"}),s):null}),xt=i.Fragment,Ve=i.createContext(null),Et=D(function(e,t){let{target:n,...r}=e,l={ref:j(t)};return p.createElement(Ve.Provider,{value:n},A({ourProps:l,theirProps:r,defaultTag:xt,name:"Popover.Group"}))}),Fe=Object.assign(bt,{Group:Et}),je=i.createContext(()=>{});je.displayName="StackContext";var $e=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))($e||{});function yt(){return i.useContext(je)}function Ct({children:e,onUpdate:t,type:n,element:r,enabled:l}){let a=yt(),o=$((...s)=>{t==null||t(...s),a(...s)});return V(()=>{let s=l===void 0||l===!0;return s&&o(0,n,r),()=>{s&&o(1,n,r)}},[o,n,r,l]),p.createElement(je.Provider,{value:o},e)}function Tt(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Ft=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ft||{}),$t=(e=>(e[e.SetTitleId=0]="SetTitleId",e))($t||{});let Pt={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},oe=i.createContext(null);oe.displayName="DialogContext";function te(e){let t=i.useContext(oe);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,te),n}return t}function Rt(e,t){i.useEffect(()=>{var n;if(!t||!e)return;let r=Y();function l(s,d,c){let f=s.style.getPropertyValue(d);return Object.assign(s.style,{[d]:c}),r.add(()=>{Object.assign(s.style,{[d]:f})})}let a=e.documentElement,o=((n=e.defaultView)!=null?n:window).innerWidth-a.clientWidth;if(l(a,"overflow","hidden"),o>0){let s=a.clientWidth-a.offsetWidth,d=o-s;l(a,"paddingRight",`${d}px`)}if(Tt()){let s=window.pageYOffset;l(a,"position","fixed"),l(a,"marginTop",`-${s}px`),l(a,"width","100%"),r.add(()=>window.scrollTo(0,s))}return r.dispose},[e,t])}function Lt(e,t){return T(t.type,Pt,e,t)}let St="div",Dt=Ee.RenderStrategy|Ee.Static,Nt=D(function(e,t){let{open:n,onClose:r,initialFocus:l,__demoMode:a=!1,...o}=e,[s,d]=i.useState(0),c=De();n===void 0&&c!==null&&(n=T(c,{[U.Open]:!0,[U.Closed]:!1}));let f=i.useRef(new Set),h=i.useRef(null),x=j(h,t),w=i.useRef(null),m=ue(h),E=e.hasOwnProperty("open")||c!==null,g=e.hasOwnProperty("onClose");if(!E&&!g)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!E)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!g)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof n!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if(typeof r!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${r}`);let v=n?0:1,[u,P]=i.useReducer(Lt,{titleId:null,descriptionId:null,panelRef:i.createRef()}),y=$(()=>r(!1)),k=$(C=>P({type:0,id:C})),F=Z()?a?!1:v===0:!1,R=s>1,M=i.useContext(oe)!==null,N=R?"parent":"leaf";vt(h,R?F:!1),at(()=>{var C,S;return[...Array.from((C=m==null?void 0:m.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?C:[]).filter(L=>!(!(L instanceof HTMLElement)||L.contains(w.current)||u.panelRef.current&&L.contains(u.panelRef.current))),(S=u.panelRef.current)!=null?S:h.current]},y,F&&!R),Ne(m==null?void 0:m.defaultView,"keydown",C=>{C.defaultPrevented||C.key===Ze.Escape&&v===0&&(R||(C.preventDefault(),C.stopPropagation(),y()))}),Rt(m,v===0&&!M),i.useEffect(()=>{if(v!==0||!h.current)return;let C=new IntersectionObserver(S=>{for(let L of S)L.boundingClientRect.x===0&&L.boundingClientRect.y===0&&L.boundingClientRect.width===0&&L.boundingClientRect.height===0&&y()});return C.observe(h.current),()=>C.disconnect()},[v,h,y]);let[W,_]=et(),J=`headlessui-dialog-${ee()}`,K=i.useMemo(()=>[{dialogState:v,close:y,setTitleId:k},u],[v,u,y,k]),ne=i.useMemo(()=>({open:v===0}),[v]),me={ref:x,id:J,role:"dialog","aria-modal":v===0?!0:void 0,"aria-labelledby":u.titleId,"aria-describedby":W};return p.createElement(Ct,{type:"Dialog",enabled:v===0,element:h,onUpdate:$((C,S,L)=>{S==="Dialog"&&T(C,{[$e.Add](){f.current.add(L),d(X=>X+1)},[$e.Remove](){f.current.add(L),d(X=>X-1)}})})},p.createElement(Te,{force:!0},p.createElement(Fe,null,p.createElement(oe.Provider,{value:K},p.createElement(Fe.Group,{target:h},p.createElement(Te,{force:!1},p.createElement(_,{slot:ne,name:"Dialog.Description"},p.createElement(Q,{initialFocus:l,containers:f,features:F?T(N,{parent:Q.features.RestoreFocus,leaf:Q.features.All&~Q.features.FocusLock}):Q.features.None},A({ourProps:me,theirProps:o,slot:ne,defaultTag:St,features:Dt,visible:v===0,name:"Dialog"})))))))),p.createElement(be,{features:xe.Hidden,ref:w}))}),jt="div",At=D(function(e,t){let[{dialogState:n,close:r}]=te("Dialog.Overlay"),l=j(t),a=`headlessui-dialog-overlay-${ee()}`,o=$(d=>{if(d.target===d.currentTarget){if(tt(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),r()}}),s=i.useMemo(()=>({open:n===0}),[n]);return A({ourProps:{ref:l,id:a,"aria-hidden":!0,onClick:o},theirProps:e,slot:s,defaultTag:jt,name:"Dialog.Overlay"})}),kt="div",Mt=D(function(e,t){let[{dialogState:n},r]=te("Dialog.Backdrop"),l=j(t),a=`headlessui-dialog-backdrop-${ee()}`;i.useEffect(()=>{if(r.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[r.panelRef]);let o=i.useMemo(()=>({open:n===0}),[n]);return p.createElement(Te,{force:!0},p.createElement(Fe,null,A({ourProps:{ref:l,id:a,"aria-hidden":!0},theirProps:e,slot:o,defaultTag:kt,name:"Dialog.Backdrop"})))}),Ot="div",It=D(function(e,t){let[{dialogState:n},r]=te("Dialog.Panel"),l=j(t,r.panelRef),a=`headlessui-dialog-panel-${ee()}`,o=i.useMemo(()=>({open:n===0}),[n]),s=$(d=>{d.stopPropagation()});return A({ourProps:{ref:l,id:a,onClick:s},theirProps:e,slot:o,defaultTag:Ot,name:"Dialog.Panel"})}),zt="h2",Bt=D(function(e,t){let[{dialogState:n,setTitleId:r}]=te("Dialog.Title"),l=`headlessui-dialog-title-${ee()}`,a=j(t);i.useEffect(()=>(r(l),()=>r(null)),[l,r]);let o=i.useMemo(()=>({open:n===0}),[n]);return A({ourProps:{ref:a,id:l},theirProps:e,slot:o,defaultTag:zt,name:"Dialog.Title"})}),ve=Object.assign(Nt,{Backdrop:Mt,Panel:It,Overlay:At,Title:Bt,Description:Qe});function Ht(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function pe(e,...t){e&&t.length>0&&e.classList.add(...t)}function ge(e,...t){e&&t.length>0&&e.classList.remove(...t)}var Pe=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(Pe||{});function qt(e,t){let n=Y();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:l}=getComputedStyle(e),[a,o]=[r,l].map(s=>
1{let[d=0]=s.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,f)=>f-c);return d});if(a+o!==0){let s=[];s.push(n.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&(s.splice(0).forEach(c=>c()),s.push(n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t("ended"),s.splice(0).forEach(f=>f()))}),n.addEventListener(e,"transitioncancel",c=>{c.target===c.currentTarget&&(t("cancelled"),s.splice(0).forEach(f=>f()))})))}))}else t("ended");return n.add(()=>t("cancelled")),n.dispose}function Ut(e,t,n,r){let l=n?"enter":"leave",a=Y(),o=r!==void 0?Ht(r):()=>{};l==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=T(l,{enter:()=>t.enter,leave:()=>t.leave}),d=T(l,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=T(l,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return ge(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),pe(e,...s,...c),a.nextFrame(()=>{ge(e,...c),pe(e,...d),qt(e,f=>(f==="ended"&&(ge(e,...s),pe(e,...t.entered)),o(f)))}),a.dispose}function Wt({container:e,direction:t,classes:n,onStart:r,onStop:l}){let a=se(),o=ze(),s=B(t);V(()=>{let d=Y();o.add(d.dispose);let c=e.current;if(c&&s.current!=="idle"&&a.current)return d.dispose(),r.current(s.current),d.add(Ut(c,n.current,s.current==="enter",f=>{d.dispose(),T(f,{[Pe.Ended](){l.current(s.current)},[Pe.Cancelled]:()=>{}})})),d.dispose},[t])}function H(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let ce=i.createContext(null);ce.displayName="TransitionContext";var _t=(e=>(e.Visible="visible",e.Hidden="hidden",e))(_t||{});function Gt(){let e=i.useContext(ce);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Vt(){let e=i.useContext(de);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let de=i.createContext(null);de.displayName="NestingContext";function fe(e){return"children"in e?fe(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ye(e,t){let n=B(e),r=i.useRef([]),l=se(),a=ze(),o=$((w,m=z.Hidden)=>{let E=r.current.findIndex(({el:g})=>g===w);E!==-1&&(T(m,{[z.Unmount](){r.current.splice(E,1)},[z.Hidden](){r.current[E].state="hidden"}}),a.microTask(()=>{var g;!fe(r)&&l.current&&((g=n.current)==null||g.call(n))}))}),s=$(w=>{let m=r.current.find(({el:E})=>E===w);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:w,state:"visible"}),()=>o(w,z.Unmount)}),d=i.useRef([]),c=i.useRef(Promise.resolve()),f=i.useRef({enter:[],leave:[],idle:[]}),h=$((w,m,E)=>{d.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([g])=>g!==w)),t==null||t.chains.current[m].push([w,new Promise(g=>{d.current.push(g)})]),t==null||t.chains.current[m].push([w,new Promise(g=>{Promise.all(f.current[m].map(([v,u])=>u)).then(()=>g())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>E(m)):E(m)}),x=$((w,m,E)=>{Promise.all(f.current[m].splice(0).map(([g,v])=>v)).then(()=>{var g;(g=d.current.shift())==null||g()}).then(()=>E(m))});return i.useMemo(()=>({children:r,register:s,unregister:o,onStart:h,onStop:x,wait:c,chains:f}),[s,o,r,h,x,f,c])}function Yt(){}let Jt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Oe(e){var t;let n={};for(let r of Jt)n[r]=(t=e[r])!=null?t:Yt;return n}function Kt(e){let t=i.useRef(Oe(e));return i.useEffect(()=>{t.current=Oe(e)},[e]),t}let Xt="div",Je=Ee.RenderStrategy,Ke=D(function(e,t){let{beforeEnter:n,after
1Enter:r,beforeLeave:l,afterLeave:a,enter:o,enterFrom:s,enterTo:d,entered:c,leave:f,leaveFrom:h,leaveTo:x,...w}=e,m=i.useRef(null),E=j(m,t),g=w.unmount?z.Unmount:z.Hidden,{show:v,appear:u,initial:P}=Gt(),[y,k]=i.useState(v?"visible":"hidden"),F=Vt(),{register:R,unregister:M}=F,N=i.useRef(null);i.useEffect(()=>R(m),[R,m]),i.useEffect(()=>{if(g===z.Hidden&&m.current){if(v&&y!=="visible"){k("visible");return}return T(y,{hidden:()=>M(m),visible:()=>R(m)})}},[y,m,R,M,v,g]);let W=B({enter:H(o),enterFrom:H(s),enterTo:H(d),entered:H(c),leave:H(f),leaveFrom:H(h),leaveTo:H(x)}),_=Kt({beforeEnter:n,afterEnter:r,beforeLeave:l,afterLeave:a}),J=Z();i.useEffect(()=>{if(J&&y==="visible"&&m.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,y,J]);let K=P&&!u,ne=!J||K||N.current===v?"idle":v?"enter":"leave",me=$(O=>T(O,{enter:()=>_.current.beforeEnter(),leave:()=>_.current.beforeLeave(),idle:()=>{}})),C=$(O=>T(O,{enter:()=>_.current.afterEnter(),leave:()=>_.current.afterLeave(),idle:()=>{}})),S=Ye(()=>{k("hidden"),M(m)},F);Wt({container:m,classes:W,direction:ne,onStart:B(O=>{S.onStart(m,O,me)}),onStop:B(O=>{S.onStop(m,O,C),O==="leave"&&!fe(S)&&(k("hidden"),M(m))})}),i.useEffect(()=>{!K||(g===z.Hidden?N.current=null:N.current=v)},[v,K,y]);let L=w,X={ref:E};return p.createElement(de.Provider,{value:S},p.createElement(it,{value:T(y,{visible:U.Open,hidden:U.Closed})},A({ourProps:X,theirProps:L,defaultTag:Xt,features:Je,visible:y==="visible",name:"Transition.Child"})))}),Re=D(function(e,t){let{show:n,appear:r=!1,unmount:l,...a}=e,o=i.useRef(null),s=j(o,t);Z();let d=De();if(n===void 0&&d!==null&&(n=T(d,{[U.Open]:!0,[U.Closed]:!1})),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=i.useState(n?"visible":"hidden"),h=Ye(()=>{f("hidden")}),[x,w]=i.useState(!0),m=i.useRef([n]);V(()=>{x!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),w(!1))},[m,n]);let E=i.useMemo(()=>({show:n,appear:r,initial:x}),[n,r,x]);i.useEffect(()=>{if(n)f("visible");else if(!fe(h))f("hidden");else{let v=o.current;if(!v)return;let u=v.getBoundingClientRect();u.x===0&&u.y===0&&u.width===0&&u.height===0&&f("hidden")}},[n,h]);let g={unmount:l};return p.createElement(de.Provider,{value:h},p.createElement(ce.Provider,{value:E},A({ourProps:{...g,as:i.Fragment,children:p.createElement(Ke,{ref:s,...g,...a})},theirProps:{},defaultTag:i.Fragment,features:Je,visible:c==="visible",name:"Transition"})))}),Qt=D(function(e,t){let n=i.useContext(ce)!==null,r=De()!==null;return p.createElement(p.Fragment,null,!n&&r?p.createElement(Re,{ref:t,...e}):p.createElement(Ke,{ref:t,...e}))}),we=Object.assign(Re,{Child:Qt,Root:Re});const Zt=e=>{var n;const t=["text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center"];return(n=e.className)!=null&&n.length&&t.push(e.className),b.jsxs("button",{type:"button",style:e.style,className:t.join(" "),onClick:()=>{var r;return(r=e.onClick)==null?void 0:r.call(e)},children:[b.jsx("svg",{"aria-hidden":"true",className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:b.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})}),b.jsx("span",{className:"sr-only",children:"Close modal"})]})},cn=e=>{const[t,n]=i.useState(null),r=i.useRef(null),l=i.useRef(null);i.useEffect(()=>{n(document.body)},[]);const a=e.type||"front-and-center",o=e.mobileSlideUp??!1,s=(()=>{const u=["relative mx-auto w-full",e.modalClasses||""];return e.size==="full-screen"?u.push("min-h-full"):e.size==="full-screen-padded"?u.push("min-h-[100dvh] sm:min-h-[calc(100dvh-32px)]"):(o?(u.push("rounded-t-xl sm:rounded-xl shadow-2xl"),u.push("max-h-[95vh] sm:max-h-[85vh]")):u.push("rounded-lg shadow-xl"),u.push({xl:"lg:max-w-[calc(100vw-50px)] lg:max-w-[calc(100vw-200px)]",lg:"lg:max-w-[calc(100vw-75px)] lg:max-w-[calc(100vw-400px)]",md:"sm:max-w-3xl",sm:"sm:max-w-lg",xs:"sm:max-w-md"}[e.size||"md"])),a==="front-and-center"?u.push("bg-white"):u.push("shadow-lg sm:shadow bg-gray-50 sm:bg-white border-t-4 sm:border-t-0"),o&&u.push("flex flex-col"),u.join(" ")})(),d=(()=>{const u=["relative mx-auto w-full",e.modalContainerClasses||""];return e.size==="full-screen"?u.push("h-[100vh]"):e.size==="full-screen-padded"?u.push("h-[100dvh] sm:h-[calc(100dvh-32px)]"):(u.push("h-full md:h-auto sm:p-4"),a==="front-and-center"?o?u.push("p-0 sm:p-4"):u.push("p-2"):u.push("p-0")),u.join(" ")})(),c=(()=>{const u=["fixed inset-0"];return u.push("bg-gray-500 bg-opacity-75 transition-opacity"),u.join(" ")})(),f=(()=>{const u=["font-semibold text-gray-900"];return a==="bottom-right"?u.push("text-base sm:text-xl"):u.push("text-xl"),u.join(" ")})(),h=(()=>{const u=["flex justify-between items-start shrink-0"];return o?u.push("rounded-t-xl sm:rounded-t"):u.push("rounded-t"),a==="bottom-right"?u.push("p-2 sm:p-4"):u.push("p-4"),o&&u.push("flex-shrink-0"),u.join(" ")})(),x=(()=>
1{if(a==="bottom-right")return"p-2 sm:p-4 text-xs sm:text-base";{const u=[];return e.bodyPadding==="none"||u.push("p-6 space-y-6"),o&&u.push("flex-1 overflow-y-auto"),u.join(" ")}})(),w=(()=>{const u=["flex w-full space-x-2 rounded-b"];return e.footerJustify==="end"&&u.push("grid"),a==="bottom-right"?u.push("p-2 sm:p-6"):o?u.push("px-6 pt-6 pb-[calc(1.5rem+env(safe-area-inset-bottom,0px))]"):u.push("p-6"),o&&u.push("flex-shrink-0"),u.join(" ")})(),m=e.onRenderHeaderActions||(u=>u),E=e.embedded?b.jsx("h3",{className:f,children:e.header}):b.jsx(ve.Title,{as:"h3",className:f,children:e.header}),g=!e.hideCloseButton||e.header?b.jsxs("div",{className:h,children:[E,m(e.hideCloseButton?null:b.jsx(Zt,{onClick:()=>e.onClose()}))]}):b.jsx(b.Fragment,{});if(en(()=>{if(e.type==="bottom-right"){const u=document.querySelector("html");u==null||u.setAttribute("style","")}},50,[e.show]),i.useEffect(()=>{if(!e.show||!o||!e.mobileKeyboardAware||e.embedded)return;const u=window.visualViewport,P=r.current,y=l.current;if(!u||!P||!y)return;const k=()=>{P.style.height="",P.style.top="",P.style.bottom="",y.style.maxHeight=""},F=()=>{if(Math.max(0,window.innerHeight-u.height-u.offsetTop)<80){k();return}P.style.height=`${Math.round(u.height)}px`,P.style.top=`${Math.round(u.offsetTop)}px`,P.style.bottom="auto",y.style.maxHeight=`${Math.max(0,Math.floor(u.height-8))}px`},R=new Set,M=()=>{for(const N of[150,400]){const W=window.setTimeout(()=>{R.delete(W),F()},N);R.add(W)}};return F(),u.addEventListener("resize",F),u.addEventListener("scroll",F),window.addEventListener("resize",F),P.addEventListener("focusin",M),()=>{u.removeEventListener("resize",F),u.removeEventListener("scroll",F),window.removeEventListener("resize",F),P.removeEventListener("focusin",M),R.forEach(N=>window.clearTimeout(N)),k()}},[o,t,e.embedded,e.mobileKeyboardAware,e.show]),e.embedded)return e.show?b.jsxs("div",{id:e.id,"data-testid":"modal","data-modal-embedded":"true",className:"w-full overflow-hidden rounded-lg border border-stone-200 bg-white",children:[g,b.jsx("div",{className:x,children:e.children}),e.footer&&b.jsx("div",{className:w,children:e.footerJustify==="end"?b.jsx("div",{className:"flex flex-row-reverse justify-items-end",children:e.footer}):e.footer})]}):null;const v=b.jsx(we.Root,{show:e.show,as:i.Fragment,children:b.jsxs(ve,{as:"div",...Ae(a==="front-and-center"?"fixed inset-0":"relative",e.dialogClassName??"z-[10000]"),"aria-label":e.header?void 0:"Dialog",style:a==="front-and-center"?{position:"fixed",inset:0}:void 0,onClose:e.onClose,static:!1,children:[a==="front-and-center"&&b.jsx(we.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:b.jsx("div",{className:`${c} z-0`})}),b.jsx("div",{ref:r,id:e.id,"data-testid":"modal","data-modal-type":a,"data-modal-size":e.size,...Ae(a==="front-and-center"?"fixed inset-0 z-10":"",a==="bottom-right"?"fixed bottom-0 right-0":"",e.size==="full-screen"?"":"sm:p-4",o?"flex items-end sm:items-center justify-center":"overflow-y-auto"),children:b.jsx("div",{className:d,children:b.jsx(we.Child,{as:i.Fragment,enter:o?"ease-out duration-300 transform":"ease-out duration-300",enterFrom:o?"opacity-0 translate-y-full sm:translate-y-0 sm:scale-95":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:o?"ease-in duration-200 transform":"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:o?"opacity-0 translate-y-full sm:translate-y-0 sm:scale-95":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:b.jsxs(ve.Panel,{ref:l,className:s,"data-testid":"modal-panel",children:[g,b.jsx("div",{className:x,children:e.children}),e.footer&&b.jsx("div",{className:w,children:e.footerJustify==="end"?b.jsx("div",{className:"flex-row-reverse justify-items-end flex",children:e.footer}):e.footer})]})})})})]})});return t?Ie.createPortal(v,t):v};function en(e,t,n){i.useEffect(()=>{const r=setTimeout(()=>{e.apply(void 0,n)},t);return()=>{clearTimeout(r)}},n)}export{Fe as $,it as C,un as D,Ne as E,Ue as F,sn as I,at as L,cn as M,qe as N,le as O,ot as S,re as T,we as W,Zt as X,Be as a,ze as b,ut as c,He as d,ie as e,Ce as f,ve as g,Y as m,ue as n,U as p,De as s,ae as t,en as u};

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