@opengovsg/confetti 0.1.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ModalContainer-D7lgJ6Vl.d.ts +34 -0
- package/build/ModalContainer-TykfTV77.js +11 -0
- package/build/RecordingReplayer-CKYzAfYD.js +73 -0
- package/build/client-internals.d.ts +2 -0
- package/build/client-internals.js +1 -0
- package/build/confetti.css +3 -1
- package/build/html2canvas-pro.esm-C4mKZXvx.js +10 -0
- package/build/index.d.ts +33 -44
- package/build/index.js +1 -11
- package/build/internals-pYkbsaWU.js +1 -0
- package/build/internals.d.ts +11 -2
- package/build/internals.js +1 -1
- package/build/record-CeeyzJpB.js +53 -0
- package/build/{types-DvzzMSv8.d.ts → types-BUY-8MBx.d.ts} +62 -1
- package/package.json +17 -3
- package/build/routing-ZHrE7mgA.js +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/container/ModalContainer.d.ts
|
|
4
|
+
interface ModalContainerProps {
|
|
5
|
+
closeOnFinishMs?: number | null;
|
|
6
|
+
isDismissable?: boolean;
|
|
7
|
+
classNames?: {
|
|
8
|
+
overlay?: string;
|
|
9
|
+
modal?: string;
|
|
10
|
+
dialog?: string;
|
|
11
|
+
closeButton?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
};
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
children: React.ReactNode | ((props: {
|
|
16
|
+
setIsFinished: () => void;
|
|
17
|
+
}) => React.ReactNode);
|
|
18
|
+
}
|
|
19
|
+
declare const ModalContent: ({
|
|
20
|
+
children,
|
|
21
|
+
classNames,
|
|
22
|
+
isDismissable,
|
|
23
|
+
onDismiss,
|
|
24
|
+
closeOnFinishMs
|
|
25
|
+
}: ModalContainerProps & Required<Pick<ModalContainerProps, "closeOnFinishMs" | "isDismissable">>) => react_jsx_runtime0.JSX.Element;
|
|
26
|
+
declare const ModalContainer: ({
|
|
27
|
+
children,
|
|
28
|
+
classNames,
|
|
29
|
+
onDismiss,
|
|
30
|
+
isDismissable,
|
|
31
|
+
closeOnFinishMs
|
|
32
|
+
}: ModalContainerProps) => react_jsx_runtime0.JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { ModalContainerProps as n, ModalContent as r, ModalContainer as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e,t}from"./internals-pYkbsaWU.js";import n,{createContext as r,forwardRef as i,useCallback as a,useContext as o,useEffect as s,useMemo as c,useReducer as l,useRef as u,useState as d}from"react";import{useLocalStorage as f,useTimeout as p}from"usehooks-ts";import{z as m}from"zod/v4/mini";import h from"ky";import{jsx as g,jsxs as _}from"react/jsx-runtime";import v from"clsx";import y,{flushSync as b}from"react-dom";const x=m.object({type:m.literal(`next`)}),S=m.object({type:m.literal(`end`)}),C=m.object({type:m.literal(`jump`),target:m.number({error:`Target question is required`})}),w=m.discriminatedUnion(`type`,[x,C,S]),T=m.object({type:m.literal(`value`),value:m.union([m.string().check(m.trim(),m.minLength(1,{error:`Value is required`})),m.number({error:`Value is required`})])}),E=m.object({type:m.literal(`binary-operator`),operator:m.union([m.literal(`equal`),m.literal(`not-equal`),m.literal(`greater`),m.literal(`greater-or-equal`),m.literal(`less`),m.literal(`less-or-equal`),m.literal(`contains`),m.literal(`not-contains`)]),value:T,target:w}),D=m.object({type:m.literal(`switch`),cases:m.array(E),default:w}),ee=m.object({type:m.literal(`always`),target:w}),O=m.discriminatedUnion(`type`,[ee,D]),te=m.string().check(m.trim(),m.url({protocol:/^(https|mailto)/,error:`Link must start with https:// or mailto:`})),k=m.optional(m.string().check(m.trim(),m.maxLength(50))),ne=m.object({value:m.string().check(m.trim(),m.minLength(1,{error:`Value is required`})),description:m.optional(m.string().check(m.trim()))}),re=m.nullable(m.object({label:m.string().check(m.trim(),m.minLength(1,{error:`Value is required`})),max:m.number(),description:m.optional(m.string().check(m.trim()))})),ie=m.optional(m.boolean()),ae=m.object({type:m.literal(`rating`),buttonLabel:k,shouldAutoProgress:ie,scale:m.number().check(m.minimum(2),m.maximum(10)),labels:m.optional(m.object({lower:m.optional(m.pipe(m.string().check(m.trim()),m.transform(e=>e===``?void 0:e))),upper:m.optional(m.pipe(m.string().check(m.trim()),m.transform(e=>e===``?void 0:e)))})),display:m.optional(m.literal([`star`,`emoji`,`number`]))}),oe=m.object({type:m.literal(`open-ended`),placeholder:m.optional(m.string()),buttonLabel:k,max:m.number()}),se=m.object({type:m.literal(`single-select`),shouldAutoProgress:ie,options:m.array(ne),buttonLabel:k,editable:re}),ce=m.object({type:m.literal(`multi-select`),buttonLabel:k,options:m.array(ne),editable:re,max:m.optional(m.number()),display:m.optional(m.literal([`checkbox`,`tag`]))}),le=m.object({type:m.literal(`statement`),buttonLabel:k,buttonUrl:m.optional(te)}),ue=m.object({type:m.literal(`bug-report`),placeholder:m.optional(m.string()),buttonLabel:k,enableScreenshot:m.boolean(),enableRecording:m.boolean(),detailsLabel:m.string().check(m.trim(),m.minLength(1,{error:`Label is required`}),m.maxLength(128)),detailsPlaceholder:m.optional(m.string()),redactClasses:m.array(m.string())}),de=m.discriminatedUnion(`type`,[ae,se,oe,ce,le,ue]),fe=`__CONFETTI_CHECKBOX_Others`,pe=`__CONFETTI_RADIO_Others`,me=m.optional(m.catchall(m.partial(m.looseObject({userAgent:m.string().check(m.trim(),m.maxLength(1e3)),screenResolution:m.string().check(m.trim(),m.maxLength(100)),viewportSize:m.string().check(m.trim(),m.maxLength(100)),pageUrl:m.string(),pageTitle:m.string().check(m.trim(),m.maxLength(1e3)),referrer:m.string(),datadogTraceId:m.optional(m.string()),datadogSessionId:m.optional(m.string()),datadogSessionReplayLink:m.optional(m.string())})),m.optional(m.string())));m.cuid2();const he=m.looseObject({type:m.literal([0,1,2,3,4,5,6]),data:m.unknown(),timestamp:m.number(),delay:m.optional(m.number())});m.array(he);const ge=m.array(he),_e=m.string().check(m.refine(e=>{try{return ge.safeParse(JSON.parse(e)).success}catch{return!1}},{error:`Invalid recording events`})),ve=m.string().check(m.regex(/^data:image\/(png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/]+=*$/,{error:`Invalid image data URL`})),ye=e=>m.object({title:m.string().check(m.trim(),...e?[m.minLength(1,{error:`Title is required`})]:[],m.maxLength(256)),description:m.optional(m.string().check(m.trim(),m.maxLength(4096))),screenshotDataUrl:m.optional(ve),recordingEventsJson:m.optional(_e),metadata:me}),be=ye(!0),xe=(e,{required:t})=>ye(t),Se=e=>m.number().check(m.int(),m.minimum(1),m.maximum(e)),Ce=({scale:e},{required:t})=>{let n=Se(e);return t?n:m.optional(n)},we=({maxLength:e},{required:t})=>m.string().check(m.trim(),...t?[m.minLength(1,{error:`This field is required`})]:[],m.maxLength(e??2048,{error:({maximum:e})=>`Please enter less than ${e} characters`})),Te=(e,t)=>m.string().check(m.trim(),...t?[m.minLength(1,{error:`This field is required`})]:[],m.maxLength(e??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),m.refine(e=>e!==pe,{error:`Please fill out the free text field`})),Ee=({maxLength:e},{required:t})=>{let n=Te(e,t);return t?n:m.optional(n)},De=({maxSelected:e,maxLength:t},{required:n})=>m.array(m.string().check(m.trim(),...n?[m.minLength(1,{error:`This field is required`})]:[],m.maxLength(t??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),m.refine(e=>e!==fe,{error:`Please fill out the free text field`}))).check(...n?[m.minLength(1,{error:`Please select at least one option`})]:[],m.maxLength(e??1024,{error:({maximum:e})=>`Please select less than ${e} options`})),Oe=()=>m.optional(m.string()),ke=m.object({title:m.string().check(m.trim()),description:m.string().check(m.trim()),buttonText:m.string().check(m.trim())}),Ae=m.object({title:m.string(),description:m.nullable(m.string()),questions:m.array(m.object({id:m.string(),title:m.string(),description:m.nullable(m.string()),position:m.number(),required:m.boolean(),properties:de,routingLogic:O})),confirmation:ke});m.object({surveyId:m.cuid2(),responseId:m.union([m.cuid2(),m.uuid()])}),m.object({respondent:m.string().check(m.trim(),m.minLength(1),m.maxLength(2048)),data:m.record(m.string(),m.union([m.string().check(m.trim(),m.maxLength(2048)),m.number(),m.array(m.string().check(m.trim(),m.maxLength(2048))).check(m.maxLength(1024)),be])),metadata:m.record(m.string().check(m.trim(),m.maxLength(1e3)),m.string().check(m.trim(),m.maxLength(1e3)))}),m.object({surveyId:m.cuid2(),respondent:m.string().check(m.trim(),m.minLength(1),m.maxLength(2048))}),m.object({surveyId:m.cuid2(),respondent:m.string().check(m.trim(),m.minLength(1),m.maxLength(2048))}),m.object({surveyId:m.cuid2()});const je=m.object({lastRespondedAt:m.nullable(m.union([m.iso.datetime(),m.date()])),lastViewedAt:m.nullable(m.union([m.iso.datetime(),m.date()])),lastDismissedAt:m.nullable(m.union([m.iso.datetime(),m.date()]))});m.object({type:m.enum([`view`,`dismiss`])});const Me=h.create({prefixUrl:`https://confetti.gov.sg/api`,retry:{limit:3,methods:[`get`]},timeout:6e4}),Ne=r(null),Pe=({children:e,surveyId:t,publishableKey:n,respondent:r,metadata:i={},isSurveyVisible:o,apiBaseUrl:l})=>{let p=u(!1),[m,h]=d(),[_,v]=d(!1),[y,b]=d(null),[x,S]=d(null),[C,w]=f(`cfti:${t}:respondent`,``);s(()=>{C||w(crypto.randomUUID())},[C,w]);let T=c(()=>r||C,[r,C]),E=c(()=>{let e={headers:{"x-cfti-pk":n}};return l&&(e.prefixUrl=l),Me.extend(e)},[l,n]),D=a(async()=>{if(!T)return;let e=await E.get(`v1/cfti/${t}/respondent/${T}`).json(),n=je.safeParse(e);n.success&&(b(n.data.lastRespondedAt?new Date(n.data.lastRespondedAt):null),S(n.data.lastDismissedAt?new Date(n.data.lastDismissedAt):null))},[E,T,t]);s(()=>{if(typeof window>`u`||typeof document>`u`)return;let e=()=>{document.visibilityState===`visible`&&D()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[D]),s(()=>{(async()=>{p.current=!1,v(!1),h(void 0),b(null),S(null);try{let e=await E.get(`v1/cfti/${t}`).json(),n=Ae.safeParse(e);if(!n.success)return;h(n.data),await D()}catch{}finally{v(!0)}})()},[E,D,t]);let ee=a(async({answers:e})=>{let n=crypto.randomUUID();await E.put(`v1/cfti/${t}/response/${n}`,{json:{respondent:T,data:e,metadata:i}})},[E,i,T,t]),O=a(()=>{h(void 0),E.post(`v1/cfti/${t}/respondent/${T}/event`,{json:{type:`dismiss`}}).catch(()=>{})},[E,T,t]),te=c(()=>_?o===void 0?!0:typeof o==`boolean`?o:o({lastRespondedAt:y,lastDismissedAt:x}):!1,[_,o,y,x]);return s(()=>{p.current||te&&m&&T&&(p.current=!0,E.post(`v1/cfti/${t}/respondent/${T}/event`,{json:{type:`view`}}).catch(()=>{}))},[E,te,T,m,t]),!te||!m?null:g(Ne.Provider,{value:{submit:ee,dismiss:O,surveyId:t,survey:m,metadata:i},children:e})},Fe=()=>{let e=o(Ne);if(!e)throw Error(`useConfetti must be used within a ConfettiProvider`);return e},Ie=r(null);r(null),r(null),r(null),r(null);const Le=r({});r(null);const Re=r(null);function ze(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function Be(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function A(e){let t=null;return()=>(t??=e(),t)}const Ve=A(function(){return Be(/^Mac/i)}),He=A(function(){return Be(/^iPhone/i)}),Ue=A(function(){return Be(/^iPad/i)||Ve()&&navigator.maxTouchPoints>1}),We=A(function(){return He()||Ue()}),Ge=A(function(){return ze(/AppleWebKit/i)&&!Ke()}),Ke=A(function(){return ze(/Chrome/i)}),qe=A(function(){return ze(/Android/i)}),Je=A(function(){return ze(/Firefox/i)});function Ye(e){if(Ze())e.focus({preventScroll:!0});else{let t=Qe(e);e.focus(),$e(t)}}let Xe=null;function Ze(){if(Xe==null){Xe=!1;try{document.createElement(`div`).focus({get preventScroll(){return Xe=!0,!0}})}catch{}}return Xe}function Qe(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function $e(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function j(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;Je()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(Ve()?r=!0:i=!0);let s=Ge()&&Ve()&&!Ue()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}):new MouseEvent(`click`,{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,detail:1,bubbles:!0,cancelable:!0});j.isOpening=n,Ye(e),e.dispatchEvent(s),j.isOpening=!1}j.isOpening=!1;const M=typeof document<`u`?n.useLayoutEffect:()=>{},et={prefix:String(Math.round(Math.random()*1e10)),current:0},tt=n.createContext(et),nt=n.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let rt=new WeakMap;function it(e=!1){let t=o(tt),r=u(null);if(r.current===null&&!e){let e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=rt.get(e);n==null?rt.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,rt.delete(e))}r.current=++t.current}return r.current}function at(e){let t=o(tt),n=it(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function ot(e){let t=n.useId(),[r]=d(dt()),i=r?`react-aria`:`react-aria${et.prefix}`;return e||`${i}-${t}`}const st=typeof n.useId==`function`?ot:at;function ct(){return!1}function lt(){return!0}function ut(e){return()=>{}}function dt(){return typeof n.useSyncExternalStore==`function`?n.useSyncExternalStore(ut,ct,lt):o(nt)}function ft(e){let[t,n]=d(e),r=u(t),i=u(null),o=u(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}r.current===e.value?o.current():n(e.value)});return M(()=>{r.current=t,i.current&&o.current()}),[t,a(e=>{i.current=e(r.current),o.current()},[o])]}let pt=!!(typeof window<`u`&&window.document&&window.document.createElement),mt=new Map,ht;typeof FinalizationRegistry<`u`&&(ht=new FinalizationRegistry(e=>{mt.delete(e)}));function gt(e){let[t,n]=d(e),r=u(null),i=st(t),a=u(null);if(ht&&ht.register(a,i),pt){let e=mt.get(i);e&&!e.includes(r)?e.push(r):mt.set(i,[r])}return M(()=>{let e=i;return()=>{ht&&ht.unregister(a),mt.delete(e)}},[i]),s(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function _t(e,t){if(e===t)return e;let n=mt.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=mt.get(t);return r?(r.forEach(t=>t.current=e),e):t}function vt(e=[]){let t=gt(),[n,r]=ft(t),i=a(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return M(i,[t,i,...e]),n}function yt(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}const N=e=>e?.ownerDocument??document,P=e=>e&&`window`in e&&e.window===e?e:N(e).defaultView||window;function bt(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function xt(e){return bt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}function F(){return!1}function I(e,t){if(!F())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:xt(n)?n.host:n.parentNode}return!1}const L=(e=document)=>{if(!F())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function R(e){if(F()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function St(e){if(!e)return!1;let t=e.getRootNode(),n=P(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}var Ct=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}else if(typeof this.filter==`function`)return this.filter(e);else if(this.filter?.acceptNode)return this.filter.acceptNode(e);else if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!I(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return I(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function wt(e,t,n,r){return F()?new Ct(e,t,n,r):e.createTreeWalker(t,n,r)}function Tt(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=Et(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():Et(e[n],null)})}}}function Et(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function z(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=yt(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=v(n,i):e===`id`&&n&&i?t.id=_t(n,i):e===`ref`&&n&&i?t.ref=Tt(n,i):t[e]=i===void 0?n:i}}return t}const Dt=new Set([`id`]),Ot=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),kt=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),At=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),jt=new Set(`onClick.onAuxClick.onContextMenu.onDoubleClick.onMouseDown.onMouseEnter.onMouseLeave.onMouseMove.onMouseOut.onMouseOver.onMouseUp.onTouchCancel.onTouchEnd.onTouchMove.onTouchStart.onPointerDown.onPointerMove.onPointerUp.onPointerCancel.onPointerEnter.onPointerLeave.onPointerOver.onPointerOut.onGotPointerCapture.onLostPointerCapture.onScroll.onWheel.onAnimationStart.onAnimationEnd.onAnimationIteration.onTransitionCancel.onTransitionEnd.onTransitionRun.onTransitionStart`.split(`.`)),Mt=/^(data-.*)$/;function B(e,t={}){let{labelable:n,isLink:r,global:i,events:a=i,propNames:o}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(Dt.has(t)||n&&Ot.has(t)||r&&kt.has(t)||i&&At.has(t)||a&&(jt.has(t)||t.endsWith(`Capture`)&&jt.has(t.slice(0,-7)))||o?.has(t)||Mt.test(t))&&(s[t]=e[t]);return s}let V=new Map,Nt=new Set;function Pt(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=R(t);if(!e(t)||!r)return;let i=V.get(r);i||(i=new Set,V.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=R(t);if(!e(t)||!r)return;let i=V.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),V.delete(r)),V.size===0)){for(let e of Nt)e();Nt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Pt):Pt());function Ft(){for(let[e]of V)`isConnected`in e&&!e.isConnected&&V.delete(e)}function It(e){requestAnimationFrame(()=>{Ft(),V.size===0?e():Nt.add(e)})}function Lt(){let e=u(new Map),t=a((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=a((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=a(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return s(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Rt(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=gt(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(` `):i&&=i.trim().split(/\s+/).join(` `),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function zt(e){let t=u(null),n=u(void 0),r=a(t=>{if(typeof e==`function`){let n=e,r=n(t);return()=>{typeof r==`function`?r():n(null)}}else if(e)return e.current=t,()=>{e.current=null}},[e]);return c(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=r(e))}}),[r])}const Bt=n.useInsertionEffect??M;function Vt(e){let t=u(null);return Bt(()=>{t.current=e},[e]),a((...e)=>{let n=t.current;return n?.(...e)},[])}function Ht(e,t){M(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ut(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function Wt(e,t){let n=e;for(Ut(n,t)&&(n=n.parentElement);n&&!Ut(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}const Gt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Kt(e){return e instanceof HTMLInputElement&&!Gt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let H=typeof document<`u`&&window.visualViewport;function qt(){let e=dt(),[t,n]=d(()=>e?{width:0,height:0}:Jt());return s(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{H&&H.scale>1||e(Jt())},r,i=t=>{H&&H.scale>1||Kt(R(t))&&(r=requestAnimationFrame(()=>{let t=L();(!t||!Kt(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(Jt()),We()&&window.addEventListener(`blur`,i,!0),H?H.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),We()&&window.removeEventListener(`blur`,i,!0),H?H.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function Jt(){return{width:H?Math.min(H.width*H.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:H?H.height*H.scale:document.documentElement.clientHeight}}function Yt(e){return e.pointerType===``&&e.isTrusted?!0:qe()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Xt(e){return!qe()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}function Zt(e,t=!0){let[n,r]=d(!0),i=n&&t;return M(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),$t(e,i,a(()=>r(!1),[])),i}function Qt(e,t){let[n,r]=d(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`);break}let i=n===`exiting`;return $t(e,i,a(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function $t(e,t,n){M(()=>{if(t&&e.current){if(!(`getAnimations`in e.current)){n();return}let t=e.current.getAnimations();if(t.length===0){n();return}let r=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{r||b(()=>{n()})}),()=>{r=!0}}},[e,t,n])}const en=typeof Element<`u`&&`checkVisibility`in Element.prototype;function tn(e){let t=P(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function nn(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function rn(e,t){return en?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&tn(e)&&nn(e,t)&&(!e.parentElement||rn(e.parentElement,e))}const an=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],on=an.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;an.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const sn=an.join(`:not([hidden]):not([tabindex="-1"]),`);function cn(e,t){return e.matches(on)&&!un(e)&&(t?.skipVisibilityCheck||rn(e))}function ln(e){return e.matches(sn)&&rn(e)&&!un(e)}function un(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function dn(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let fn=new WeakMap;function pn(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return dn(t);if(fn.has(t))return fn.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof P(n).HTMLMetaElement&&(n.nonce||n.content)||dn(t)||void 0;return r!==void 0&&fn.set(t,r),r}const mn=Symbol(`default`);function hn({values:e,children:t}){for(let[r,i]of e)t=n.createElement(r.Provider,{value:i},t);return t}function gn(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:l}=e;return c(()=>{let e,c,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,c=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:c||o?{...o,...c}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,s):void 0}},[t,n,r,i,a,o,s,l])}function _n(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function vn(e,t){let n=o(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||mn;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function yn(e,t,n){let{ref:r,...i}=vn(n,e.slot)||{},a=zt(c(()=>Tt(t,r),[t,r])),o=z(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(typeof i.style==`function`||typeof e.style==`function`?o.style=t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:o.style={...i.style,...e.style}),[o,a]}function bn(e=!0){let[t,n]=d(e),r=u(!1),i=a(e=>{r.current=!0,n(!!e)},[]);return M(()=>{r.current||n(!1)},[]),[i,t]}function xn(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function Sn(e,t,r){let{render:i,...a}=t,o=u(null),s=c(()=>Tt(r,o),[r,o]);M(()=>{},[e,i]);let l={...a,ref:s};return i?i(l,void 0):n.createElement(e,l)}const Cn={},wn=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=Cn[t];return n||(n=i(Sn.bind(null,t)),Cn[t]=n),n}}),Tn=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function En(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}let Dn=new WeakMap,U=[];function On(e,t){let n=P(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&Tn,o=new Set(e),s=new Set,c=e=>a&&e instanceof n.HTMLElement?e.inert:e.getAttribute(`aria-hidden`)===`true`,l=(e,t)=>{a&&e instanceof n.HTMLElement?e.inert=t:t?e.setAttribute(`aria-hidden`,`true`):(e.removeAttribute(`aria-hidden`),e instanceof n.HTMLElement&&(e.inert=!1))},u=new Set;if(F())for(let t of e){let e=t;for(;e&&e!==i;){let t=e.getRootNode();`shadowRoot`in t&&u.add(t.shadowRoot),e=t.parentNode}}let d=e=>{for(let t of e.querySelectorAll(`[data-live-announcer], [data-react-aria-top-layer]`))o.add(t);let t=e=>{if(s.has(e)||o.has(e)||e.parentElement&&s.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of o)if(I(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=wt(N(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;e!=null;)f(e),e=n.nextNode()}},f=e=>{let t=Dn.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),Dn.set(e,t+1))};U.length&&U[U.length-1].disconnect(),d(i);let p=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>I(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&En(e)?o.add(e):e instanceof Element&&d(e);if(F()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(F())for(let e of u){let t=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>I(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&En(e)?o.add(e):e instanceof Element&&d(e);if(F()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});t.observe(e,{childList:!0,subtree:!0}),m.add(t)}let h={visibleNodes:o,hiddenNodes:s,observe(){p.observe(i,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return U.push(h),()=>{if(p.disconnect(),F())for(let e of m)e.disconnect();for(let e of s){let t=Dn.get(e);t!=null&&(t===1?(l(e,!1),Dn.delete(e)):Dn.set(e,t-1))}h===U[U.length-1]?(U.pop(),U.length&&U[U.length-1].observe()):U.splice(U.indexOf(h),1)}}const kn=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),An=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function jn(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n=typeof t.getTextInfo==`function`?t.getTextInfo():t.textInfo;if(n)return n.direction===`rtl`;if(t.script)return kn.has(t.script)}let t=e.split(`-`)[0];return An.has(t)}const Mn=Symbol.for(`react-aria.i18n.locale`);function Nn(){let e=typeof window<`u`&&window[Mn]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:jn(e)?`rtl`:`ltr`}}let Pn=Nn(),Fn=new Set;function In(){Pn=Nn();for(let e of Fn)e(Pn)}function Ln(){let e=dt(),[t,n]=d(Pn);return s(()=>(Fn.size===0&&window.addEventListener(`languagechange`,In),Fn.add(n),()=>{Fn.delete(n),Fn.size===0&&window.removeEventListener(`languagechange`,In)}),[]),e?{locale:typeof window<`u`&&window[Mn]||`en-US`,direction:`ltr`}:t}const Rn=n.createContext(null);function zn(){let e=Ln();return o(Rn)||e}const Bn=Symbol.for(`react-aria.i18n.locale`),Vn=Symbol.for(`react-aria.i18n.strings`);let Hn;var Un=class e{constructor(e,t=`en-US`){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=Wn(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[Bn];if(Hn===void 0){let t=window[Vn];if(!t)return null;for(let r in Hn={},t)Hn[r]=new e({[n]:t[r]},n)}let r=Hn?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}};function Wn(e,t,n=`en-US`){if(t[e])return t[e];let r=Gn(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function Gn(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const Kn=new Map,qn=new Map;var Jn=class{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=Kn.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),Kn.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=qn.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),qn.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}};const Yn=new WeakMap;function Xn(e){let t=Yn.get(e);return t||(t=new Un(e),Yn.set(e,t)),t}function Zn(e,t){return t&&Un.getGlobalDictionaryForPackage(t)||Xn(e)}function Qn(e,t){let{locale:n}=zn(),r=Zn(e,t);return c(()=>new Jn(n,r),[n,r])}function $n(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function er(e,t){Object.defineProperty(e,`target`,{value:t}),Object.defineProperty(e,`currentTarget`,{value:t})}function tr(e){let t=u({isFocused:!1,observer:null});return M(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),a(n=>{let r=R(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=$n(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===L()?null:L();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:e})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}let nr=!1;function rr(e){for(;e&&!cn(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=P(e),n=t.document.activeElement;if(!n||n===e)return;nr=!0;let r=!1,i=e=>{(R(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(R(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,Ye(n),c()))},o=t=>{(R(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(R(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,Ye(n),c()))};t.addEventListener(`blur`,i,!0),t.addEventListener(`focusout`,a,!0),t.addEventListener(`focusin`,s,!0),t.addEventListener(`focus`,o,!0);let c=()=>{cancelAnimationFrame(l),t.removeEventListener(`blur`,i,!0),t.removeEventListener(`focusout`,a,!0),t.removeEventListener(`focusin`,s,!0),t.removeEventListener(`focus`,o,!0),nr=!1,r=!1},l=requestAnimationFrame(c);return c}let ir=`default`,ar=``,or=new WeakMap;function sr(e){if(We()){if(ir===`default`){let t=N(e);ar=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}ir=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;or.set(e,e.style[t]),e.style[t]=`none`}}function cr(e){if(We()){if(ir!==`disabled`)return;ir=`restoring`,setTimeout(()=>{It(()=>{if(ir===`restoring`){let t=N(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=ar||``),ar=``,ir=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&or.has(e)){let t=or.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),or.delete(e)}}const lr=n.createContext({register:()=>{}});lr.displayName=`PressResponderContext`;function ur(e){let t=o(lr);if(t){let{register:n,ref:r,...i}=t;e=z(i,e),n()}return Ht(t,e.ref),e}var dr=class{#e;constructor(e,t,n,r){this.#e=!0;let i=(r?.target??n.currentTarget)?.getBoundingClientRect(),a,o=0,s,c=null;n.clientX!=null&&n.clientY!=null&&(s=n.clientX,c=n.clientY),i&&(s!=null&&c!=null?(a=s-i.left,o=c-i.top):(a=i.width/2,o=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=o,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}};const fr=Symbol(`linkClicked`),pr=`react-aria-pressable-style`,mr=`data-react-aria-pressable`;function hr(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,onClick:l,isDisabled:f,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=ur(e),[y,b]=d(!1),x=u({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=Lt(),w=a((e,t)=>{let i=x.current;if(f||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new dr(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,b(!0),a},[f,r,n]),T=a((e,r,a=!0)=>{let o=x.current;if(!o.didFirePressStart)return!1;o.didFirePressStart=!1,o.isTriggeringEvent=!0;let s=!0;if(i){let t=new dr(`pressend`,r,e);i(t),s=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&a&&!f){let n=new dr(`press`,r,e);t(n),s&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,s},[f,i,n,t]),E=Vt(T),D=Vt(a((e,t)=>{let n=x.current;if(f)return!1;if(o){n.isTriggeringEvent=!0;let r=new dr(`pressup`,t,e);return o(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[f,o])),ee=a(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&T(W(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||cr(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,T]),O=Vt(ee),te=a(e=>{h&&ee(e)},[h,ee]),k=a(e=>{f||l?.(e)},[f,l]),ne=a((e,t)=>{if(!f&&l){let n=new MouseEvent(`click`,e);er(n,t),l($n(n))}},[f,l]),re=c(()=>{let e=x.current,t={onKeyDown(t){if(_r(t.nativeEvent,t.currentTarget)&&I(t.currentTarget,R(t))){yr(R(t),t.key)&&t.preventDefault();let r=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,e.pointerType=`keyboard`,r=w(t,`keyboard`));let i=t.currentTarget;S(N(t.currentTarget),`keyup`,yt(t=>{_r(t,i)&&!t.repeat&&I(i,R(t))&&e.target&&D(W(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&Ve()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!I(t.currentTarget,R(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!j.isOpening){let n=!0;if(f&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||Yt(t.nativeEvent))){let e=w(t,`virtual`),r=D(t,`virtual`),i=E(t,`virtual`);k(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=D(W(t.currentTarget,t),r),a=E(W(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,k(t),O(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&_r(t,e.target)){yr(R(t),t.key)&&t.preventDefault();let n=R(t),r=I(e.target,n);E(W(e.target,t),`keyboard`,r),r&&ne(t,e.target),C(),t.key!==`Enter`&&gr(e.target)&&I(e.target,n)&&!t[fr]&&(t[fr]=!0,j(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if(t.key===`Meta`&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let n of t.values())e.target?.dispatchEvent(new KeyboardEvent(`keyup`,n))}};if(typeof PointerEvent<`u`){t.onPointerDown=t=>{if(t.button!==0||!I(t.currentTarget,R(t)))return;if(Xt(t.nativeEvent)){e.pointerType=`virtual`;return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,g||sr(e.target),i=w(t,e.pointerType);let a=R(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),S(N(t.currentTarget),`pointerup`,n,!1),S(N(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(I(t.currentTarget,R(t))&&t.button===0){if(m){let n=rr(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!I(t.currentTarget,R(t))||e.pointerType===`virtual`||t.button===0&&!e.isPressed&&D(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,w(W(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,E(W(e.target,t),e.pointerType,!1),te(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(I(e.target,R(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?O(t):(Ye(e.target),e.target.click()))},80);S(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else O(t);e.isOverTarget=!1}},r=e=>{O(e)};t.onDragStart=e=>{I(e.currentTarget,R(e))&&O(e)}}return t},[S,f,m,C,g,te,w,k,ne]);return s(()=>{if(!_)return;let e=N(_.current);if(!e||!e.head||e.getElementById(pr))return;let t=e.createElement(`style`);t.id=pr;let n=pn(e);n&&(t.nonce=n),t.textContent=`
|
|
2
|
+
@layer {
|
|
3
|
+
[${mr}] {
|
|
4
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`.trim(),e.head.prepend(t)},[_]),s(()=>{let e=x.current;return()=>{g||cr(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:z(v,re,{[mr]:!0})}}function gr(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function _r(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof P(i).HTMLInputElement&&!xr(i,n)||i instanceof P(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&gr(i))&&n!==`Enter`)}function W(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function vr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!gr(e)}function yr(e,t){return e instanceof HTMLInputElement?!xr(e,t):vr(e)}const br=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function xr(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:br.has(e.type)}let G=null;const Sr=new Set;let Cr=new Map,K=!1,wr=!1;const Tr={Tab:!0,Escape:!0};function Er(e,t){for(let n of Sr)n(e,t)}function Dr(e){return!(e.metaKey||!Ve()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Or(e){K=!0,!j.isOpening&&Dr(e)&&(G=`keyboard`,Er(`keyboard`,e))}function kr(e){G=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(K=!0,Er(`pointer`,e))}function Ar(e){!j.isOpening&&Yt(e)&&(K=!0,G=`virtual`)}function jr(e){let t=P(R(e)),n=N(R(e));R(e)===t||R(e)===n||nr||!e.isTrusted||(!K&&!wr&&(G=`virtual`,Er(`virtual`,e)),K=!1,wr=!1)}function Mr(){nr||(K=!1,wr=!0)}function Nr(e){if(typeof window>`u`||typeof document>`u`)return;let t=P(e),n=N(e);if(Cr.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){K=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Or,!0),n.addEventListener(`keyup`,Or,!0),n.addEventListener(`click`,Ar,!0),t.addEventListener(`focus`,jr,!0),t.addEventListener(`blur`,Mr,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,kr,!0),n.addEventListener(`pointermove`,kr,!0),n.addEventListener(`pointerup`,kr,!0)),t.addEventListener(`beforeunload`,()=>{Pr(e)},{once:!0}),Cr.set(t,{focus:r})}const Pr=(e,t)=>{let n=P(e),r=N(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Cr.has(n)&&(n.HTMLElement.prototype.focus=Cr.get(n).focus,r.removeEventListener(`keydown`,Or,!0),r.removeEventListener(`keyup`,Or,!0),r.removeEventListener(`click`,Ar,!0),n.removeEventListener(`focus`,jr,!0),n.removeEventListener(`blur`,Mr,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,kr,!0),r.removeEventListener(`pointermove`,kr,!0),r.removeEventListener(`pointerup`,kr,!0)),Cr.delete(n))};function Fr(e){let t=N(e),n;return t.readyState===`loading`?(n=()=>{Nr(e)},t.addEventListener(`DOMContentLoaded`,n)):Nr(e),()=>Pr(e,n)}typeof document<`u`&&Fr();function Ir(){return G!==`pointer`}function Lr(){return G}function Rr(e){G=e,Er(e,null)}const zr=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Br(e,t,n){let r=n?R(n):void 0,i=N(r),a=P(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,c=a===void 0?HTMLElement:a.HTMLElement,l=a===void 0?KeyboardEvent:a.KeyboardEvent,u=L(i);return e=e||u instanceof o&&!zr.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!Tr[n.key])}function Vr(e,t,n){Nr(),s(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Br(!!n?.isTextInput,t,r)&&e(Ir())};return Sr.add(t),()=>{Sr.delete(t)}},t)}function Hr(e){if(!e.isConnected)return;let t=N(e);if(Lr()===`virtual`){let n=L(t);It(()=>{let r=L(t);(r===n||r===t.body)&&e.isConnected&&Ye(e)})}else Ye(e)}const Ur=n.createContext(null),Wr=`react-aria-focus-scope-restore`;let q=null;function Gr(e){let{children:t,contain:r,restoreFocus:i,autoFocus:a}=e,l=u(null),d=u(null),f=u([]),{parentNode:p}=o(Ur)||{},m=c(()=>new li({scopeRef:f}),[f]);M(()=>{let e=p||Q.root;if(Q.getTreeNode(e.scopeRef)&&q&&!ei(q,e.scopeRef)){let t=Q.getTreeNode(q);t&&(e=t)}e.addChild(m),Q.addNode(m)},[m,p]),M(()=>{let e=Q.getTreeNode(f);e&&(e.contain=!!r)},[r]),M(()=>{let e=l.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==d.current;)t.push(e),e.addEventListener(Wr,n),e=e.nextSibling;return f.current=t,()=>{for(let e of t)e.removeEventListener(Wr,n)}},[t]),ii(f,i,r),Zr(f,r),oi(f,i,r),ri(f,a),s(()=>{let e=L(N(f.current?f.current[0]:void 0)),t=null;if(J(e,f.current)){for(let n of Q.traverse())n.scopeRef&&J(e,n.scopeRef.current)&&(t=n);t===Q.getTreeNode(f)&&(q=t.scopeRef)}},[f]),M(()=>()=>{let e=Q.getTreeNode(f)?.parent?.scopeRef??null;(f===q||ei(f,q))&&(!e||Q.getTreeNode(e))&&(q=e),Q.removeTreeNode(f)},[f]);let h=c(()=>Kr(f),[]),g=c(()=>({focusManager:h,parentNode:m}),[m,h]);return n.createElement(Ur.Provider,{value:g},n.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:l}),t,n.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:d}))}function Kr(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||L(N(n[0]??void 0)),c=n[0].previousElementSibling,l=Z(qr(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&X(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||L(N(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Z(qr(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&X(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Z(qr(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&X(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Z(qr(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&X(o,!0),o}}}function qr(e){return e[0].parentElement}function Jr(e){let t=Q.getTreeNode(q);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Yr(e){if(!e.form)return Array.from(N(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=P(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function Xr(e){if(e.checked)return!0;let t=Yr(e);return t.length>0&&!t.some(e=>e.checked)}function Zr(e,t){let n=u(void 0),r=u(void 0);M(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=N(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Jr(e)||t.isComposing)return;let n=L(a),r=e.current;if(!r||!J(n,r))return;let i=Z(qr(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(X(o,!0),o instanceof P(o).HTMLInputElement&&o.select())},s=t=>{(!q||ei(q,e))&&J(R(t),e.current)?(q=e,n.current=R(t)):Jr(e)&&!Y(R(t),e)?n.current?n.current.focus():q&&q.current&&ni(q.current):Jr(e)&&(n.current=R(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=Lr(),i=(r===`virtual`||r===null)&&qe()&&Ke(),o=L(a);if(!i&&o&&Jr(e)&&!Y(o,e)){q=e;let r=R(t);r&&r.isConnected?(n.current=r,n.current?.focus()):q.current&&ni(q.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),M(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function Qr(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>I(t,e))}function Y(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of Q.traverse(Q.getTreeNode(t)))if(n&&J(e,n.current))return!0;return!1}function $r(e){return Y(e,q)}function ei(e,t){let n=Q.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function X(e,t=!1){if(e!=null&&!t)try{Hr(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function ti(e,t=!0){let n=e[0].previousElementSibling,r=qr(e),i=Z(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=qr(e),i=Z(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function ni(e,t=!0){X(ti(e,t))}function ri(e,t){let r=n.useRef(t);s(()=>{r.current&&(q=e,!J(L(N(e.current?e.current[0]:void 0)),q.current)&&e.current&&ni(e.current)),r.current=!1},[e])}function ii(e,t,n){M(()=>{if(t||n)return;let r=e.current,i=N(r?r[0]:void 0),a=t=>{let n=R(t);J(n,e.current)?q=e:Qr(n)||(q=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function ai(e){let t=Q.getTreeNode(q);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function oi(e,t,n){let r=u(typeof document<`u`?L(N(e.current?e.current[0]:void 0)):null);M(()=>{let r=e.current,i=N(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!q||ei(q,e))&&J(L(i),e.current)&&(q=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),M(()=>{let r=N(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Jr(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!ai(e))return;let i=Q.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Z(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Y(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Y(s,e));t.preventDefault(),t.stopPropagation(),s?X(s,!0):Qr(a)?X(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),M(()=>{let n=N(e.current?e.current[0]:void 0);if(!t)return;let i=Q.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=Q.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=L(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&ai(e))){let t=Q.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){si(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Q.getTreeNode(n.scopeRef)){si(ti(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function si(e){e.dispatchEvent(new CustomEvent(Wr,{bubbles:!0,cancelable:!0}))&&X(e)}function Z(e,t,n){let r=t?.tabbable?ln:cn,i=N(e?.nodeType===Node.ELEMENT_NODE?e:null),a=wt(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return I(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!Xr(e)||a.currentNode.tagName===`INPUT`&&a.currentNode.type===`radio`&&a.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}var ci=class e{constructor(){this.fastMap=new Map,this.root=new li({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new li({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},li=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}};let Q=new ci;function ui(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,o=a(e=>{if(R(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),s=tr(o),c=a(e=>{let t=R(e),r=N(t),a=r?L(r):L();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),s(e))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?o:void 0}}}function di(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function fi(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:di(e.onKeyDown),onKeyUp:di(e.onKeyUp)}}}let pi=n.createContext(null);function mi(e){let t=o(pi)||{};Ht(t,e);let{ref:n,...r}=t;return r}function hi(e,t){let{focusProps:n}=ui(e),{keyboardProps:r}=fi(e),i=z(n,r),a=mi(t),o=e.isDisabled?{}:a,c=u(e.autoFocus);s(()=>{c.current&&t.current&&Hr(t.current),c.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:z({...i,tabIndex:l},o)}}const gi=typeof document<`u`?n.useInsertionEffect??n.useLayoutEffect:()=>{};function _i(e,t,n){let[r,i]=d(e||t),o=u(r),c=u(e!==void 0),f=e!==void 0;s(()=>{c.current,c.current=f},[f]);let p=f?e:r;gi(()=>{o.current=p});let[,m]=l(()=>({}),{});return[p,a((e,...t)=>{let r=typeof e==`function`?e(o.current):e;Object.is(o.current,r)||(o.current=r,i(r),m(),n?.(r,...t))},[n])]}function vi(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,o=u({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:c}=Lt(),l=a(e=>{I(e.currentTarget,R(e))&&o.current.isFocusWithin&&!I(e.currentTarget,e.relatedTarget)&&(o.current.isFocusWithin=!1,c(),n&&n(e),i&&i(!1))},[n,i,o,c]),d=tr(l),f=a(e=>{if(!I(e.currentTarget,R(e)))return;let t=R(e),n=N(t),a=L(n);if(!o.current.isFocusWithin&&a===t){r&&r(e),i&&i(!0),o.current.isFocusWithin=!0,d(e);let t=e.currentTarget;s(n,`focus`,e=>{let r=R(e);if(o.current.isFocusWithin&&!I(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});er(e,t),l($n(e))}},{capture:!0})}},[r,i,d,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:l}}}function yi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=u({isFocused:!1,isFocusVisible:t||Ir()}),[o,s]=d(!1),[c,l]=d(()=>i.current.isFocused&&i.current.isFocusVisible),f=a(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),p=a(e=>{i.current.isFocused=e,i.current.isFocusVisible=Ir(),s(e),f()},[f]);Vr(e=>{i.current.isFocusVisible=e,f()},[n,o],{enabled:o,isTextInput:n});let{focusProps:m}=ui({isDisabled:r,onFocusChange:p}),{focusWithinProps:h}=vi({isDisabled:!r,onFocusWithinChange:p});return{isFocused:o,isFocusVisible:c,focusProps:r?h:m}}function bi({children:e}){let t=c(()=>({register:()=>{}}),[]);return n.createElement(lr.Provider,{value:t},e)}let xi=!1,Si=0;function Ci(){xi=!0,setTimeout(()=>{xi=!1},500)}function wi(e){e.pointerType===`touch`&&Ci()}function Ti(){let e=N(null);if(e!==void 0)return Si===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,wi),Si++,()=>{Si--,!(Si>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,wi)}}function Ei(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=d(!1),l=u({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;s(Ti,[]);let{addGlobalListener:f,removeAllGlobalListeners:p}=Lt(),{hoverProps:m,triggerHoverEnd:h}=c(()=>{let e=(e,r)=>{if(l.pointerType=r,i||r===`touch`||l.isHovered||!I(e.currentTarget,R(e)))return;l.isHovered=!0;let s=e.currentTarget;l.target=s,f(N(R(e)),`pointerover`,e=>{l.isHovered&&l.target&&!I(l.target,R(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:s,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=l.target;l.pointerType=``,l.target=null,!(t===`touch`||!l.isHovered||!i)&&(l.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},s={};return typeof PointerEvent<`u`&&(s.onPointerEnter=t=>{xi&&t.pointerType===`mouse`||e(t,t.pointerType)},s.onPointerLeave=e=>{!i&&I(e.currentTarget,R(e))&&a(e,e.pointerType)}),{hoverProps:s,triggerHoverEnd:a}},[t,n,r,i,l,f,p]);return s(()=>{i&&h({currentTarget:l.target},l.pointerType)},[i]),{hoverProps:m,isHovered:a}}function Di(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=u({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=Vt(e=>{n&&Oi(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),c=Vt(e=>{n&&n(e)});s(()=>{let e=a.current;if(r)return;let n=t.current,i=N(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&Oi(n,t)&&c(n),e.isPointerDown=!1};return i.addEventListener(`pointerdown`,o,!0),i.addEventListener(`click`,n,!0),()=>{i.removeEventListener(`pointerdown`,o,!0),i.removeEventListener(`click`,n,!0)}}},[t,r])}function Oi(e,t){if(e.button>0)return!1;let n=R(e);if(n){let e=n.ownerDocument;if(!e||!I(e.documentElement,n)||n.closest(`[data-react-aria-top-layer]`))return!1}return t.current?!e.composedPath().includes(t.current):!1}typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,`firstChild`,{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,`appendChild`,{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,`removeChild`,{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,`insertBefore`,{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));const ki=r(!1);function Ai(e){let t=(t,n)=>o(ki)?null:e(t,n);return t.displayName=e.displayName||e.name,i(t)}function ji(e,t){let{elementType:n=`button`,isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:u,onClick:d,href:f,target:p,rel:m,type:h=`button`}=e,g;g=n===`button`?{type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:`button`,href:n===`a`&&!r?f:void 0,target:n===`a`?p:void 0,type:n===`input`?h:void 0,disabled:n===`input`?r:void 0,"aria-disabled":!r||n===`input`?void 0:r,rel:n===`a`?m:void 0};let{pressProps:_,isPressed:v}=hr({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=hi(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=z(y,_,B(e,{labelable:!0}));return{isPressed:v,buttonProps:z(g,b,{"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],"aria-controls":e[`aria-controls`],"aria-pressed":e[`aria-pressed`],"aria-current":e[`aria-current`],"aria-disabled":e[`aria-disabled`]})}}const Mi={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function Ni(e={}){let{style:t,isFocusable:n}=e,[r,i]=d(!1),{focusWithinProps:a}=vi({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=c(()=>r?t:t?{...Mi,...t}:Mi,[r]);return{visuallyHiddenProps:{...a,style:o}}}function Pi(e){let{children:t,elementType:r=`div`,isFocusable:i,style:a,...o}=e,{visuallyHiddenProps:s}=Ni(e);return n.createElement(r,z(o,s),t)}const Fi=r({});function Ii(){return o(Fi)??{}}const Li=n.createContext(null);function Ri(e){let t=dt(),{portalContainer:r=t?null:document.body,isExiting:i}=e,[a,o]=d(!1),s=c(()=>({contain:a,setContain:o}),[a,o]),{getContainer:l}=Ii();if(!e.portalContainer&&l&&(r=l()),!r)return null;let u=e.children;return e.disableFocusManagement||(u=n.createElement(Gr,{restoreFocus:!0,contain:(e.shouldContainFocus||a)&&!i},u)),u=n.createElement(Li.Provider,{value:s},n.createElement(bi,null,u)),y.createPortal(u,r)}function zi(){let e=o(Li)?.setContain;M(()=>{e?.(!0)},[e])}function Bi(e,t){let{role:n=`dialog`}=e,r=vt();r=e[`aria-label`]?void 0:r;let i=u(!1);return s(()=>{if(t.current&&!St(t.current)){Hr(t.current);let e=setTimeout(()=>{(L()===t.current||L()===document.body)&&(i.current=!0,t.current&&(t.current.blur(),Hr(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),zi(),u(!1),s(()=>{}),{dialogProps:{...B(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]||r,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:r}}}var Vi={};Vi={dismiss:`تجاهل`};var Hi={};Hi={dismiss:`Отхвърляне`};var Ui={};Ui={dismiss:`Odstranit`};var Wi={};Wi={dismiss:`Luk`};var Gi={};Gi={dismiss:`Schließen`};var Ki={};Ki={dismiss:`Απόρριψη`};var qi={};qi={dismiss:`Dismiss`};var Ji={};Ji={dismiss:`Descartar`};var Yi={};Yi={dismiss:`Lõpeta`};var Xi={};Xi={dismiss:`Hylkää`};var Zi={};Zi={dismiss:`Rejeter`};var Qi={};Qi={dismiss:`התעלם`};var $i={};$i={dismiss:`Odbaci`};var ea={};ea={dismiss:`Elutasítás`};var ta={};ta={dismiss:`Ignora`};var na={};na={dismiss:`閉じる`};var ra={};ra={dismiss:`무시`};var ia={};ia={dismiss:`Atmesti`};var aa={};aa={dismiss:`Nerādīt`};var oa={};oa={dismiss:`Lukk`};var sa={};sa={dismiss:`Negeren`};var ca={};ca={dismiss:`Zignoruj`};var la={};la={dismiss:`Descartar`};var ua={};ua={dismiss:`Dispensar`};var da={};da={dismiss:`Revocare`};var fa={};fa={dismiss:`Пропустить`};var pa={};pa={dismiss:`Zrušiť`};var ma={};ma={dismiss:`Opusti`};var ha={};ha={dismiss:`Odbaci`};var ga={};ga={dismiss:`Avvisa`};var _a={};_a={dismiss:`Kapat`};var va={};va={dismiss:`Скасувати`};var ya={};ya={dismiss:`取消`};var ba={};ba={dismiss:`關閉`};var xa={};xa={"ar-AE":Vi,"bg-BG":Hi,"cs-CZ":Ui,"da-DK":Wi,"de-DE":Gi,"el-GR":Ki,"en-US":qi,"es-ES":Ji,"et-EE":Yi,"fi-FI":Xi,"fr-FR":Zi,"he-IL":Qi,"hr-HR":$i,"hu-HU":ea,"it-IT":ta,"ja-JP":na,"ko-KR":ra,"lt-LT":ia,"lv-LV":aa,"nb-NO":oa,"nl-NL":sa,"pl-PL":ca,"pt-BR":la,"pt-PT":ua,"ro-RO":da,"ru-RU":fa,"sk-SK":pa,"sl-SI":ma,"sr-SP":ha,"sv-SE":ga,"tr-TR":_a,"uk-UA":va,"zh-CN":ya,"zh-TW":ba};function Sa(e){return e&&e.__esModule?e.default:e}function Ca(e){let{onDismiss:t,...r}=e,i=Rt(r,Qn(Sa(xa),`@react-aria/overlays`).format(`dismiss`)),a=()=>{t&&t()};return n.createElement(Pi,null,n.createElement(`button`,{...i,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}const $=[];function wa(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:c}=e,l=u(void 0);s(()=>{if(i&&!$.includes(t))return $.push(t),()=>{let e=$.indexOf(t);e>=0&&$.splice(e,1)}},[i,t]);let d=()=>{$[$.length-1]===t&&n&&n()},f=e=>{let n=$[$.length-1];l.current=n,(!c||c(R(e)))&&n===t&&e.stopPropagation()},p=e=>{(!c||c(R(e)))&&($[$.length-1]===t&&e.stopPropagation(),l.current===t&&d()),l.current=void 0},m=e=>{e.key===`Escape`&&!o&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),d())};Di({ref:t,onInteractOutside:a&&i?p:void 0,onInteractOutsideStart:f});let{focusWithinProps:h}=vi({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||$r(e.relatedTarget)||(!c||c(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:m,...h},underlayProps:{}}}const Ta=typeof document<`u`&&window.visualViewport;let Ea=0,Da;function Oa(e={}){let{isDisabled:t}=e;M(()=>{if(!t)return Ea++,Ea===1&&(Da=We()?Aa():ka()),()=>{Ea--,Ea===0&&Da()}},[t])}function ka(){let e=window.innerWidth-document.documentElement.clientWidth;return yt(e>0&&(`scrollbarGutter`in document.documentElement.style?ja(document.documentElement,`scrollbarGutter`,`stable`):ja(document.documentElement,`paddingRight`,`${e}px`)),ja(document.documentElement,`overflow`,`hidden`))}function Aa(){let e=ja(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=R(e);t=Ut(r)?r:Wt(r,!0),n=!1;let i=r.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(r,!0)&&(n=!0),e.composedPath().some(e=>e instanceof HTMLInputElement&&e.type===`range`)&&(n=!0),`selectionStart`in r&&`selectionEnd`in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},i=document.createElement(`style`),a=pn();a&&(i.nonce=a),i.textContent=`@layer {
|
|
8
|
+
* {
|
|
9
|
+
overscroll-behavior: contain;
|
|
10
|
+
}
|
|
11
|
+
}`,document.head.prepend(i);let o=e=>{if(!(e.touches.length===2||n)){if(!t||t===document.documentElement||t===document.body){e.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&e.preventDefault()}},s=e=>{let t=R(e),n=e.relatedTarget;n&&Kt(n)?(n.focus({preventScroll:!0}),Na(n,Kt(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=L(),n=t!=null&&Kt(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&Na(this,n)};let l=yt(Ma(document,`touchstart`,r,{passive:!1,capture:!0}),Ma(document,`touchmove`,o,{passive:!1,capture:!0}),Ma(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function ja(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ma(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Na(e,t){t||!Ta?Pa(e):Ta.addEventListener(`resize`,()=>Pa(e),{once:!0})}function Pa(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=Wt(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;Ta&&(n=Math.min(n,Ta.offsetTop+Ta.height));let i=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:`smooth`})}}n=e.parentElement}}function Fa(e,t,n){let{overlayProps:r,underlayProps:i}=wa({...e,isOpen:t.isOpen,onClose:t.close},n);return Oa({isDisabled:!t.isOpen}),zi(),s(()=>{if(t.isOpen&&n.current)return On([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:z(r),underlayProps:i}}const Ia=r({}),La=Ai(function(e,t){[e,t]=yn(e,t,Ia);let{elementType:r=`label`,...i}=e,a=wn[r];return n.createElement(a,{className:`react-aria-Label`,...i,ref:t})}),Ra=r(null),za=7e3;let Ba=null;function Va(e,t=`assertive`,n=za){Ba?Ba.announce(e,t,n):(Ba=new Ha,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?Ba.announce(e,t,n):setTimeout(()=>{Ba?.isAttached()&&Ba?.announce(e,t,n)},100))}var Ha=class{isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement(`div`);return t.setAttribute(`role`,`log`),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-relevant`,`additions`),t}destroy(){this.node&&=(document.body.removeChild(this.node),null)}announce(e,t=`assertive`,n=za){var r,i;if(!this.node)return;let a=document.createElement(`div`);typeof e==`object`?(a.setAttribute(`role`,`img`),a.setAttribute(`aria-labelledby`,e[`aria-labelledby`])):a.textContent=e,t===`assertive`?(r=this.assertiveLog)==null||r.appendChild(a):(i=this.politeLog)==null||i.appendChild(a),e!==``&&setTimeout(()=>{a.remove()},n)}clear(e){this.node&&((!e||e===`assertive`)&&this.assertiveLog&&(this.assertiveLog.innerHTML=``),(!e||e===`polite`)&&this.politeLog&&(this.politeLog.innerHTML=``))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<`u`&&(this.node=document.createElement(`div`),this.node.dataset.liveAnnouncer=`true`,Object.assign(this.node.style,{border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`}),this.assertiveLog=this.createLog(`assertive`),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog(`polite`),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}};const Ua=r({}),Wa=Ai(function(e,t){[e,t]=yn(e,t,Ua);let r=e,{isPending:i}=r,{buttonProps:a,isPressed:o}=ji(e,t);a=Ka(a,i);let{focusProps:c,isFocused:l,isFocusVisible:d}=yi(e),{hoverProps:f,isHovered:p}=Ei({...e,isDisabled:e.isDisabled||i}),m={isHovered:p,isPressed:(r.isPressed||o)&&!i,isFocused:l,isFocusVisible:d,isDisabled:e.isDisabled||!1,isPending:i??!1},h=gn({...e,values:m,defaultClassName:`react-aria-Button`}),g=gt(a.id),_=gt(),v=a[`aria-labelledby`];i&&(v?v=`${v} ${_}`:a[`aria-label`]&&(v=`${g} ${_}`));let y=u(i);s(()=>{let e={"aria-labelledby":v||g};(!y.current&&l&&i||y.current&&l&&!i)&&Va(e,`assertive`),y.current=i},[i,l,v,g]);let b=B(e,{global:!0});return delete b.onClick,n.createElement(wn.button,{...z(b,h,a,c,f),type:a.type===`submit`&&i?`button`:a.type,id:g,ref:t,"aria-labelledby":v,slot:e.slot||void 0,"aria-disabled":i?`true`:a[`aria-disabled`],"data-disabled":e.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":p||void 0,"data-focused":l||void 0,"data-pending":i||void 0,"data-focus-visible":d||void 0},n.createElement(Ra.Provider,{value:{id:_}},h.children))}),Ga=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function Ka(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!Ga.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}function qa(e){let[t,n]=_i(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:a(()=>{n(!0)},[n]),close:a(()=>{n(!1)},[n]),toggle:a(()=>{n(!t)},[n,t])}}const Ja=r(null),Ya=r(null),Xa=i(function(e,t){let r=e[`aria-labelledby`];[e,t]=yn(e,t,Ja);let{dialogProps:i,titleProps:a}=Bi({...e,"aria-labelledby":r},t),s=o(Ya);!i[`aria-label`]&&!i[`aria-labelledby`]&&e[`aria-labelledby`]&&(i[`aria-labelledby`]=e[`aria-labelledby`]);let c=gn({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:s?.close||(()=>{})}}),l=B(e,{global:!0});return n.createElement(wn.section,{...z(l,c,i),render:e.render,ref:t,slot:e.slot||void 0},n.createElement(hn,{values:[[Le,{slots:{[mn]:{},title:{...a,level:2}}}],[Ua,{slots:{[mn]:{},close:{onPress:()=>s?.close()}}}]]},c.children))}),Za=r(null),Qa=r(null),$a=i(function(e,t){if(o(Qa))return n.createElement(ro,{...e,modalRef:t},e.children);let{isDismissable:r,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:s,onOpenChange:c,children:l,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p,...m}=e;return n.createElement(to,{isDismissable:r,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:s,onOpenChange:c,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p},n.createElement(ro,{...m,modalRef:t},l))});function eo(e,t){[e,t]=yn(e,t,Za);let r=o(Ya),i=qa(e),a=e.isOpen!=null||e.defaultOpen!=null||!r?i:r,s=zt(t),c=u(null),l=Qt(s,a.isOpen),d=Qt(c,a.isOpen),f=l||d||e.isExiting||!1,p=dt();return!a.isOpen&&!f||p?null:n.createElement(no,{...e,state:a,isExiting:f,overlayRef:s,modalRef:c})}const to=i(eo);function no({UNSTABLE_portalContainer:e,...t}){let r=t.modalRef,{state:i}=t,{modalProps:a,underlayProps:o}=Fa(t,i,r),s=Zt(t.overlayRef)||t.isEntering||!1,c=gn({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:s,isExiting:t.isExiting,state:i}}),l=qt(),u;if(typeof document<`u`){let e=Ut(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().height%1;u=e.scrollHeight-t}let d={...c.style,"--visual-viewport-height":l.height+`px`,"--page-height":u===void 0?void 0:u+`px`};return n.createElement(Ri,{isExiting:t.isExiting,portalContainer:e},n.createElement(wn.div,{...z(B(t,{global:!0}),o),...c,style:d,ref:t.overlayRef,"data-entering":s||void 0,"data-exiting":t.isExiting||void 0},n.createElement(hn,{values:[[Qa,{modalProps:a,modalRef:r,isExiting:t.isExiting,isDismissable:t.isDismissable}],[Ya,i]]},c.children)))}function ro(e){let{modalProps:t,modalRef:r,isExiting:i,isDismissable:a}=o(Qa),s=o(Ya),l=zt(c(()=>Tt(e.modalRef,r),[e.modalRef,r])),u=Zt(l),d=gn({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:u,isExiting:i,state:s}});return n.createElement(wn.div,{...z(B(e,{global:!0}),t),...d,ref:l,"data-entering":u||void 0,"data-exiting":i||void 0},a&&n.createElement(Ca,{onDismiss:s.close}),d.children)}const io=()=>{let[n,r]=d(!1);return s(()=>{let n=t=>{let n=e.safeParse(t);n.error||r(n.data.detail.isRecording)};return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[]),n},ao=({className:e,iconClassName:t,onClose:n})=>io()?null:g(`button`,{type:`button`,className:e,"aria-label":`Dismiss`,onClick:n,children:g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`none`,className:t,children:g(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M3.53 3.529c.26-.26.682-.26.942 0l3.529 3.528 3.528-3.528a.667.667 0 0 1 .943.942L8.943 8l3.53 3.528a.667.667 0 0 1-.944.943L8.001 8.943 4.472 12.47a.667.667 0 1 1-.943-.943L7.058 8 3.529 4.47a.667.667 0 0 1 0-.942Z`,clipRule:`evenodd`})})}),oo=({children:e,classNames:t,isDismissable:n,onDismiss:r,closeOnFinishMs:i})=>{let{survey:a,surveyId:o,dismiss:s}=Fe(),[c,l]=d(!1);return p(()=>{a&&s()},c?i:null),_(Xa,{"aria-label":`Survey`,id:`${o}-popover`,className:v(`confetti-modal-dialog`,t?.dialog),children:[n&&g(ao,{className:v(`confetti-modal-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await s(),r?.()}}),typeof e==`function`?e({setIsFinished:()=>l(!0)}):e]})},so=({children:e,classNames:t,onDismiss:n,isDismissable:r=!0,closeOnFinishMs:i=3e3})=>{let{dismiss:a}=Fe();return g(to,{isOpen:!0,isDismissable:r,isKeyboardDismissDisabled:!r,onOpenChange:async e=>{e||(await a(),n?.())},className:v(`confetti-modal-overlay`,t?.overlay),children:g($a,{className:v(`confetti-modal`,t?.modal),children:g(oo,{classNames:t,isDismissable:r,onDismiss:n,closeOnFinishMs:i,children:e})})})};export{B as A,Ne as B,_n as C,Vt as D,vn as E,vt as F,we as G,Fe as H,gt as I,Oe as J,Ce as K,M as L,Tt as M,R as N,zt as O,P,Re as R,bn as S,xn as T,xe as U,Pe as V,De as W,pe as X,fe as Y,te as Z,hr as _,Wa as a,yn as b,Pi as c,yi as d,vi as f,Rr as g,Z as h,io as i,z as j,Rt as k,Ai as l,hi as m,oo as n,Ia as o,_i as p,Ee as q,ao as r,La as s,so as t,Ei as u,zn as v,wn as w,gn as x,hn as y,Ie as z};
|