@opengovsg/confetti 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ModalContainer-b9Zgg8fN.js +11 -0
- package/build/client-internals.js +1 -1
- package/build/index.d.ts +22 -22
- package/build/index.js +1 -1
- package/package.json +3 -3
- package/build/ModalContainer-CDEl2ap2.js +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./internals-Dzl6abGJ.js";import r,{createContext as i,forwardRef as a,useCallback as o,useContext as s,useEffect as c,useMemo as l,useReducer as u,useRef as d,useState as f}from"react";import{useLocalStorage as p,useTimeout as m}from"usehooks-ts";import{z as h}from"zod/v4/mini";import g from"ky";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import b from"clsx";import x,{flushSync as S}from"react-dom";const C=h.object({type:h.literal(`next`)}),w=h.object({type:h.literal(`end`)}),T=h.object({type:h.literal(`jump`),target:h.number({error:`Target question is required`})}),E=h.discriminatedUnion(`type`,[C,T,w]),D=h.object({type:h.literal(`value`),value:h.union([h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),h.number({error:`Value is required`})])}),O=h.object({type:h.literal(`binary-operator`),operator:h.union([h.literal(`equal`),h.literal(`not-equal`),h.literal(`greater`),h.literal(`greater-or-equal`),h.literal(`less`),h.literal(`less-or-equal`),h.literal(`contains`),h.literal(`not-contains`)]),value:D,target:E}),k=h.object({type:h.literal(`switch`),cases:h.array(O),default:E}),ee=h.object({type:h.literal(`always`),target:E}),te=h.discriminatedUnion(`type`,[ee,k]),ne=h.string().check(h.trim(),h.url({protocol:/^(https|mailto)/,error:`Link must start with https:// or mailto:`})),A=h.optional(h.string().check(h.trim(),h.maxLength(50))),re=h.object({value:h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),description:h.optional(h.string().check(h.trim()))}),ie=h.nullable(h.object({label:h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),max:h.number(),description:h.optional(h.string().check(h.trim()))})),ae=h.optional(h.boolean()),oe=h.object({type:h.literal(`rating`),buttonLabel:A,shouldAutoProgress:ae,scale:h.number().check(h.minimum(2),h.maximum(10)),labels:h.optional(h.object({lower:h.optional(h.pipe(h.string().check(h.trim()),h.transform(e=>e===``?void 0:e))),upper:h.optional(h.pipe(h.string().check(h.trim()),h.transform(e=>e===``?void 0:e)))})),display:h.optional(h.literal([`star`,`emoji`,`number`]))}),se=h.object({type:h.literal(`open-ended`),placeholder:h.optional(h.string()),buttonLabel:A,max:h.number()}),ce=h.object({type:h.literal(`single-select`),shouldAutoProgress:ae,options:h.array(re),buttonLabel:A,editable:ie}),le=h.object({type:h.literal(`multi-select`),buttonLabel:A,options:h.array(re),editable:ie,max:h.optional(h.number()),display:h.optional(h.literal([`checkbox`,`tag`]))}),ue=h.object({type:h.literal(`statement`),buttonLabel:A,buttonUrl:h.optional(ne)}),de=h.object({type:h.literal(`bug-report`),placeholder:h.optional(h.string()),buttonLabel:A,enableScreenshot:h.boolean(),enableRecording:h.boolean(),detailsLabel:h.string().check(h.trim(),h.minLength(1,{error:`Label is required`}),h.maxLength(128)),detailsPlaceholder:h.optional(h.string()),redactClasses:h.optional(h.array(h.string()))}),fe=h.discriminatedUnion(`type`,[oe,ce,se,le,ue,de]),pe=`__CONFETTI_CHECKBOX_Others`,me=`__CONFETTI_RADIO_Others`,he=h.optional(h.catchall(h.partial(h.looseObject({userAgent:h.string().check(h.trim(),h.maxLength(1e3)),screenResolution:h.string().check(h.trim(),h.maxLength(100)),viewportSize:h.string().check(h.trim(),h.maxLength(100)),pageUrl:h.string(),pageTitle:h.string().check(h.trim(),h.maxLength(1e3)),referrer:h.string(),datadogTraceId:h.optional(h.string()),datadogSessionId:h.optional(h.string()),datadogSessionReplayLink:h.optional(h.string())})),h.optional(h.string())));h.cuid2();const ge=h.looseObject({type:h.literal([0,1,2,3,4,5,6]),data:h.unknown(),timestamp:h.number(),delay:h.optional(h.number())});h.array(ge);const _e=h.array(ge),ve=h.string().check(h.refine(e=>{try{return _e.safeParse(JSON.parse(e)).success}catch{return!1}},{error:`Invalid recording events`})),ye=h.string().check(h.regex(/^data:image\/(png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/]+=*$/,{error:`Invalid image data URL`})),be=e=>h.object({title:h.string().check(h.trim(),...e?[h.minLength(1,{error:`Title is required`})]:[],h.maxLength(256)),description:h.optional(h.string().check(h.trim(),h.maxLength(4096))),screenshotDataUrl:h.optional(ye),recordingEventsJson:h.optional(ve),metadata:he}),xe=be(!0),Se=(e,{required:t})=>be(t),Ce=e=>h.number().check(h.int(),h.minimum(1),h.maximum(e)),we=({scale:e},{required:t})=>{let n=Ce(e);return t?n:h.optional(n)},Te=({maxLength:e},{required:t})=>h.string().check(h.trim(),...t?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(e??2048,{error:({maximum:e})=>`Please enter less than ${e} characters`})),Ee=(e,t)=>h.string().check(h.trim(),...t?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(e??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),h.refine(e=>e!==me,{error:`Please fill out the free text field`})),De=({maxLength:e},{required:t})=>{let n=Ee(e,t);return t?n:h.optional(n)},Oe=({maxSelected:e,maxLength:t},{required:n})=>h.array(h.string().check(h.trim(),...n?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(t??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),h.refine(e=>e!==pe,{error:`Please fill out the free text field`}))).check(...n?[h.minLength(1,{error:`Please select at least one option`})]:[],h.maxLength(e??1024,{error:({maximum:e})=>`Please select less than ${e} options`})),ke=()=>h.optional(h.string()),Ae=h.cuid2(),je=h.object({title:h.string().check(h.trim()),description:h.string().check(h.trim()),buttonText:h.string().check(h.trim())}),Me=h.object({title:h.string(),description:h.nullable(h.string()),questions:h.array(h.object({id:h.string(),title:h.string(),description:h.nullable(h.string()),position:h.number(),required:h.boolean(),properties:fe,routingLogic:te})),confirmation:je});h.object({surveyId:Ae,responseId:h.union([h.cuid2(),h.uuid()])});const Ne=h.catch(h.partial(h.object({type:h.enum([`embedded`,`popover`,`modal`]),version:h.string().check(h.trim(),h.minLength(1),h.maxLength(50))})),{});h.object({respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048)),data:h.record(h.string(),h.union([h.string().check(h.trim(),h.maxLength(2048)),h.number(),h.array(h.string().check(h.trim(),h.maxLength(2048))).check(h.maxLength(1024)),xe])),metadata:h.record(h.string().check(h.trim(),h.maxLength(1e3)),h.string().check(h.trim(),h.maxLength(1e3))),telemetry:h.optional(Ne)}),h.object({surveyId:Ae,respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048))}),h.object({surveyId:Ae,respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048))}),h.object({surveyId:Ae});const Pe=h.object({lastRespondedAt:h.nullable(h.union([h.iso.datetime(),h.date()])),lastViewedAt:h.nullable(h.union([h.iso.datetime(),h.date()])),lastDismissedAt:h.nullable(h.union([h.iso.datetime(),h.date()]))});h.object({type:h.enum([`view`,`dismiss`])});const Fe=g.create({prefixUrl:`https://confetti.gov.sg/api`,retry:{limit:3,methods:[`get`]},timeout:6e4}),Ie=i(null),Le=({type:e,children:t})=>{let n=l(()=>({type:e}),[e]);return v(Ie.Provider,{value:n,children:t})},Re=()=>s(Ie),ze=i(null),Be=({children:e,surveyId:t,publishableKey:n,respondent:r,metadata:i={},isSurveyVisible:a,apiBaseUrl:s,alwaysRenderChildren:u})=>{let m=Re(),h=d(!1),[g,_]=f(),[y,b]=f(!1),[x,S]=f(null),[C,w]=f(null),[T,E]=p(`cfti:${t}:respondent`,``);c(()=>{T||E(crypto.randomUUID())},[T,E]);let D=l(()=>r||T,[r,T]),O=l(()=>{let e={headers:{"x-cfti-pk":n}};return s&&(e.prefixUrl=s),Fe.extend(e)},[s,n]),k=o(async()=>{if(!D)return;let e=await O.get(`v1/cfti/${t}/respondent/${D}`).json(),n=Pe.safeParse(e);n.success&&(S(n.data.lastRespondedAt?new Date(n.data.lastRespondedAt):null),w(n.data.lastDismissedAt?new Date(n.data.lastDismissedAt):null))},[O,D,t]);c(()=>{if(typeof window>`u`||typeof document>`u`)return;let e=()=>{document.visibilityState===`visible`&&k()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[k]),c(()=>{(async()=>{h.current=!1,b(!1),_(void 0),S(null),w(null);try{let e=await O.get(`v1/cfti/${t}`).json(),n=Me.safeParse(e);if(!n.success)return;_(n.data),await k()}catch{}finally{b(!0)}})()},[O,k,t]);let ee=o(async({answers:e})=>{let n=crypto.randomUUID();await O.put(`v1/cfti/${t}/response/${n}`,{json:{respondent:D,data:e,metadata:i,telemetry:{...m!==null&&{type:m.type},version:`0.3.2`}}})},[O,i,D,t,m]),te=o(()=>{u||_(void 0),O.post(`v1/cfti/${t}/respondent/${D}/event`,{json:{type:`dismiss`}}).catch(()=>{})},[u,O,D,t]),ne=l(()=>y?a===void 0?!0:typeof a==`boolean`?a:a({lastRespondedAt:x,lastDismissedAt:C}):!1,[y,a,x,C]);c(()=>{h.current||ne&&g&&D&&(h.current=!0,O.post(`v1/cfti/${t}/respondent/${D}/event`,{json:{type:`view`}}).catch(()=>{}))},[O,ne,D,g,t]);let A=ne&&!!g;return!u&&!A?null:v(ze.Provider,{value:{submit:ee,dismiss:te,surveyId:t,survey:g,metadata:i,isVisible:A},children:e})},Ve=e=>s(ze)?v(_,{children:e.children}):v(Be,{...e,surveyId:e.surveyId,publishableKey:e.publishableKey}),He=()=>{let e=s(ze);if(!e)throw Error(`useConfetti must be used within a ConfettiProvider`);return e},Ue=i(null);i(null),i(null),i(null),i(null);const We=i({});i(null);const Ge=i(null);function Ke(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 qe(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function j(e){let t=null;return()=>(t??=e(),t)}const Je=j(function(){return qe(/^Mac/i)}),Ye=j(function(){return qe(/^iPhone/i)}),Xe=j(function(){return qe(/^iPad/i)||Je()&&navigator.maxTouchPoints>1}),Ze=j(function(){return Ye()||Xe()}),Qe=j(function(){return Ke(/AppleWebKit/i)&&!$e()}),$e=j(function(){return Ke(/Chrome/i)}),et=j(function(){return Ke(/Android/i)}),tt=j(function(){return Ke(/Firefox/i)});function nt(e){if(it())e.focus({preventScroll:!0});else{let t=at(e);e.focus(),ot(t)}}let rt=null;function it(){if(rt==null){rt=!1;try{document.createElement(`div`).focus({get preventScroll(){return rt=!0,!0}})}catch{}}return rt}function at(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 ot(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function M(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;tt()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(Je()?r=!0:i=!0);let s=Qe()&&Je()&&!Xe()?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});M.isOpening=n,nt(e),e.dispatchEvent(s),M.isOpening=!1}M.isOpening=!1;const N=typeof document<`u`?r.useLayoutEffect:()=>{},st={prefix:String(Math.round(Math.random()*1e10)),current:0},ct=r.createContext(st),lt=r.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let ut=new WeakMap;function dt(e=!1){let t=s(ct),n=d(null);if(n.current===null&&!e){let e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=ut.get(e);n==null?ut.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,ut.delete(e))}n.current=++t.current}return n.current}function ft(e){let t=s(ct),n=dt(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function pt(e){let t=r.useId(),[n]=f(vt()),i=n?`react-aria`:`react-aria${st.prefix}`;return e||`${i}-${t}`}const mt=typeof r.useId==`function`?pt:ft;function ht(){return!1}function gt(){return!0}function _t(e){return()=>{}}function vt(){return typeof r.useSyncExternalStore==`function`?r.useSyncExternalStore(_t,ht,gt):s(lt)}function yt(e){let[t,n]=f(e),r=d(t),i=d(null),a=d(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}r.current===e.value?a.current():n(e.value)});return N(()=>{r.current=t,i.current&&a.current()}),[t,o(e=>{i.current=e(r.current),a.current()},[a])]}let bt=!!(typeof window<`u`&&window.document&&window.document.createElement),xt=new Map,St;typeof FinalizationRegistry<`u`&&(St=new FinalizationRegistry(e=>{xt.delete(e)}));function Ct(e){let[t,n]=f(e),r=d(null),i=mt(t),a=d(null);if(St&&St.register(a,i),bt){let e=xt.get(i);e&&!e.includes(r)?e.push(r):xt.set(i,[r])}return N(()=>{let e=i;return()=>{St&&St.unregister(a),xt.delete(e)}},[i]),c(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function wt(e,t){if(e===t)return e;let n=xt.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=xt.get(t);return r?(r.forEach(t=>t.current=e),e):t}function Tt(e=[]){let t=Ct(),[n,r]=yt(t),i=o(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return N(i,[t,i,...e]),n}function Et(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}const P=e=>e?.ownerDocument??document,F=e=>e&&`window`in e&&e.window===e?e:P(e).defaultView||window;function Dt(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Ot(e){return Dt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}function I(){return!1}function L(e,t){if(!I())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:Ot(n)?n.host:n.parentNode}return!1}const R=(e=document)=>{if(!I())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function z(e){if(I()&&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 kt(e){if(!e)return!1;let t=e.getRootNode(),n=F(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}var At=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(!L(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 L(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 jt(e,t,n,r){return I()?new At(e,t,n,r):e.createTreeWalker(t,n,r)}function Mt(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=Nt(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():Nt(e[n],null)})}}}function Nt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function B(...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]=Et(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=b(n,i):e===`id`&&n&&i?t.id=wt(n,i):e===`ref`&&n&&i?t.ref=Mt(n,i):t[e]=i===void 0?n:i}}return t}const Pt=new Set([`id`]),Ft=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),It=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),Lt=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Rt=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(`.`)),zt=/^(data-.*)$/;function V(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)&&(Pt.has(t)||n&&Ft.has(t)||r&&It.has(t)||i&&Lt.has(t)||a&&(Rt.has(t)||t.endsWith(`Capture`)&&Rt.has(t.slice(0,-7)))||o?.has(t)||zt.test(t))&&(s[t]=e[t]);return s}let H=new Map,Bt=new Set;function Vt(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=z(t);if(!e(t)||!r)return;let i=H.get(r);i||(i=new Set,H.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=z(t);if(!e(t)||!r)return;let i=H.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),H.delete(r)),H.size===0)){for(let e of Bt)e();Bt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Vt):Vt());function Ht(){for(let[e]of H)`isConnected`in e&&!e.isConnected&&H.delete(e)}function Ut(e){requestAnimationFrame(()=>{Ht(),H.size===0?e():Bt.add(e)})}function Wt(){let e=d(new Map),t=o((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=o((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=o(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return c(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Gt(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=Ct(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 Kt(e){let t=d(null),n=d(void 0),r=o(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 l(()=>({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 qt=r.useInsertionEffect??N;function Jt(e){let t=d(null);return qt(()=>{t.current=e},[e]),o((...e)=>{let n=t.current;return n?.(...e)},[])}function Yt(e,t){N(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Xt(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 Zt(e,t){let n=e;for(Xt(n,t)&&(n=n.parentElement);n&&!Xt(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}const Qt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function $t(e){return e instanceof HTMLInputElement&&!Qt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let U=typeof document<`u`&&window.visualViewport;function en(){let e=vt(),[t,n]=f(()=>e?{width:0,height:0}:tn());return c(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{U&&U.scale>1||e(tn())},r,i=t=>{U&&U.scale>1||$t(z(t))&&(r=requestAnimationFrame(()=>{let t=R();(!t||!$t(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(tn()),Ze()&&window.addEventListener(`blur`,i,!0),U?U.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),Ze()&&window.removeEventListener(`blur`,i,!0),U?U.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function tn(){return{width:U?Math.min(U.width*U.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:U?U.height*U.scale:document.documentElement.clientHeight}}function nn(e){return e.pointerType===``&&e.isTrusted?!0:et()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function rn(e){return!et()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}function an(e,t=!0){let[n,r]=f(!0),i=n&&t;return N(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),sn(e,i,o(()=>r(!1),[])),i}function on(e,t){let[n,r]=f(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`);break}let i=n===`exiting`;return sn(e,i,o(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function sn(e,t,n){N(()=>{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||S(()=>{n()})}),()=>{r=!0}}},[e,t,n])}const cn=typeof Element<`u`&&`checkVisibility`in Element.prototype;function ln(e){let t=F(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 un(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 dn(e,t){return cn?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&ln(e)&&un(e,t)&&(!e.parentElement||dn(e.parentElement,e))}const fn=[`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`],pn=fn.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;fn.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const mn=fn.join(`:not([hidden]):not([tabindex="-1"]),`);function hn(e,t){return e.matches(pn)&&!_n(e)&&(t?.skipVisibilityCheck||dn(e))}function gn(e){return e.matches(mn)&&dn(e)&&!_n(e)}function _n(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function vn(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let yn=new WeakMap;function bn(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return vn(t);if(yn.has(t))return yn.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof F(n).HTMLMetaElement&&(n.nonce||n.content)||vn(t)||void 0;return r!==void 0&&yn.set(t,r),r}const xn=Symbol(`default`);function Sn({values:e,children:t}){for(let[n,i]of e)t=r.createElement(n.Provider,{value:i},t);return t}function Cn(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:c}=e;return l(()=>{let e,l,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,l=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:l||o?{...o,...l}:void 0,children:u??a,"data-rac":``,render:c?e=>c(e,s):void 0}},[t,n,r,i,a,o,s,c])}function wn(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function Tn(e,t){let n=s(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||xn;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 En(e,t,n){let{ref:r,...i}=Tn(n,e.slot)||{},a=Kt(l(()=>Mt(t,r),[t,r])),o=B(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 Dn(e=!0){let[t,n]=f(e),r=d(!1),i=o(e=>{r.current=!0,n(!!e)},[]);return N(()=>{r.current||n(!1)},[]),[i,t]}function On(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function kn(e,t,n){let{render:i,...a}=t,o=d(null),s=l(()=>Mt(n,o),[n,o]);N(()=>{},[e,i]);let c={...a,ref:s};return i?i(c,void 0):r.createElement(e,c)}const An={},jn=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=An[t];return n||(n=a(kn.bind(null,t)),An[t]=n),n}}),Mn=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function Nn(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}let Pn=new WeakMap,W=[];function Fn(e,t){let n=F(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&Mn,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(I())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(L(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=jt(P(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=Pn.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),Pn.set(e,t+1))};W.length&&W[W.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=>L(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&Nn(e)?o.add(e):e instanceof Element&&d(e);if(I()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(I())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=>L(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&Nn(e)?o.add(e):e instanceof Element&&d(e);if(I()){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 W.push(h),()=>{if(p.disconnect(),I())for(let e of m)e.disconnect();for(let e of s){let t=Pn.get(e);t!=null&&(t===1?(l(e,!1),Pn.delete(e)):Pn.set(e,t-1))}h===W[W.length-1]?(W.pop(),W.length&&W[W.length-1].observe()):W.splice(W.indexOf(h),1)}}const In=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Ln=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Rn(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 In.has(t.script)}let t=e.split(`-`)[0];return Ln.has(t)}const zn=Symbol.for(`react-aria.i18n.locale`);function Bn(){let e=typeof window<`u`&&window[zn]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:Rn(e)?`rtl`:`ltr`}}let Vn=Bn(),Hn=new Set;function Un(){Vn=Bn();for(let e of Hn)e(Vn)}function Wn(){let e=vt(),[t,n]=f(Vn);return c(()=>(Hn.size===0&&window.addEventListener(`languagechange`,Un),Hn.add(n),()=>{Hn.delete(n),Hn.size===0&&window.removeEventListener(`languagechange`,Un)}),[]),e?{locale:typeof window<`u`&&window[zn]||`en-US`,direction:`ltr`}:t}const Gn=r.createContext(null);function Kn(){let e=Wn();return s(Gn)||e}const qn=Symbol.for(`react-aria.i18n.locale`),Jn=Symbol.for(`react-aria.i18n.strings`);let Yn;var Xn=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=Zn(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[qn];if(Yn===void 0){let t=window[Jn];if(!t)return null;for(let r in Yn={},t)Yn[r]=new e({[n]:t[r]},n)}let r=Yn?.[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 Zn(e,t,n=`en-US`){if(t[e])return t[e];let r=Qn(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function Qn(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const $n=new Map,er=new Map;var tr=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=$n.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),$n.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=er.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),er.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}};const nr=new WeakMap;function rr(e){let t=nr.get(e);return t||(t=new Xn(e),nr.set(e,t)),t}function ir(e,t){return t&&Xn.getGlobalDictionaryForPackage(t)||rr(e)}function ar(e,t){let{locale:n}=Kn(),r=ir(e,t);return l(()=>new tr(n,r),[n,r])}function or(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function sr(e,t){Object.defineProperty(e,`target`,{value:t}),Object.defineProperty(e,`currentTarget`,{value:t})}function cr(e){let t=d({isFocused:!1,observer:null});return N(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),o(n=>{let r=z(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=or(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===R()?null:R();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 lr=!1;function ur(e){for(;e&&!hn(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=F(e),n=t.document.activeElement;if(!n||n===e)return;lr=!0;let r=!1,i=e=>{(z(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(z(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,nt(n),c()))},o=t=>{(z(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(z(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,nt(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),lr=!1,r=!1},l=requestAnimationFrame(c);return c}let dr=`default`,fr=``,pr=new WeakMap;function mr(e){if(Ze()){if(dr===`default`){let t=P(e);fr=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}dr=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;pr.set(e,e.style[t]),e.style[t]=`none`}}function hr(e){if(Ze()){if(dr!==`disabled`)return;dr=`restoring`,setTimeout(()=>{Ut(()=>{if(dr===`restoring`){let t=P(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=fr||``),fr=``,dr=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&pr.has(e)){let t=pr.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),pr.delete(e)}}const gr=r.createContext({register:()=>{}});gr.displayName=`PressResponderContext`;function _r(e){let t=s(gr);if(t){let{register:n,ref:r,...i}=t;e=B(i,e),n()}return Yt(t,e.ref),e}var vr=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 yr=Symbol(`linkClicked`),br=`react-aria-pressable-style`,xr=`data-react-aria-pressable`;function Sr(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,onClick:s,isDisabled:u,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=_r(e),[y,b]=f(!1),x=d({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=Wt(),w=o((e,t)=>{let i=x.current;if(u||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new vr(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,b(!0),a},[u,r,n]),T=o((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 vr(`pressend`,r,e);i(t),s=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&a&&!u){let n=new vr(`press`,r,e);t(n),s&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,s},[u,i,n,t]),E=Jt(T),D=Jt(o((e,t)=>{let n=x.current;if(u)return!1;if(a){n.isTriggeringEvent=!0;let r=new vr(`pressup`,t,e);return a(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[u,a])),O=o(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&T(G(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||hr(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,T]),k=Jt(O),ee=o(e=>{h&&O(e)},[h,O]),te=o(e=>{u||s?.(e)},[u,s]),ne=o((e,t)=>{if(!u&&s){let n=new MouseEvent(`click`,e);sr(n,t),s(or(n))}},[u,s]),A=l(()=>{let e=x.current,t={onKeyDown(t){if(wr(t.nativeEvent,t.currentTarget)&&L(t.currentTarget,z(t))){Er(z(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(P(t.currentTarget),`keyup`,Et(t=>{wr(t,i)&&!t.repeat&&L(i,z(t))&&e.target&&D(G(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&Je()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!L(t.currentTarget,z(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!M.isOpening){let n=!0;if(u&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||nn(t.nativeEvent))){let e=w(t,`virtual`),r=D(t,`virtual`),i=E(t,`virtual`);te(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=D(G(t.currentTarget,t),r),a=E(G(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,te(t),k(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&wr(t,e.target)){Er(z(t),t.key)&&t.preventDefault();let n=z(t),r=L(e.target,n);E(G(e.target,t),`keyboard`,r),r&&ne(t,e.target),C(),t.key!==`Enter`&&Cr(e.target)&&L(e.target,n)&&!t[yr]&&(t[yr]=!0,M(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||!L(t.currentTarget,z(t)))return;if(rn(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||mr(e.target),i=w(t,e.pointerType);let a=z(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),S(P(t.currentTarget),`pointerup`,n,!1),S(P(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(L(t.currentTarget,z(t))&&t.button===0){if(m){let n=ur(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!L(t.currentTarget,z(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(G(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,E(G(e.target,t),e.pointerType,!1),ee(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(L(e.target,z(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?k(t):(nt(e.target),e.target.click()))},80);S(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else k(t);e.isOverTarget=!1}},r=e=>{k(e)};t.onDragStart=e=>{L(e.currentTarget,z(e))&&k(e)}}return t},[S,u,m,C,g,ee,w,te,ne]);return c(()=>{if(!_)return;let e=P(_.current);if(!e||!e.head||e.getElementById(br))return;let t=e.createElement(`style`);t.id=br;let n=bn(e);n&&(t.nonce=n),t.textContent=`
|
|
2
|
+
@layer {
|
|
3
|
+
[${xr}] {
|
|
4
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`.trim(),e.head.prepend(t)},[_]),c(()=>{let e=x.current;return()=>{g||hr(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:B(v,A,{[xr]:!0})}}function Cr(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function wr(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof F(i).HTMLInputElement&&!Or(i,n)||i instanceof F(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&Cr(i))&&n!==`Enter`)}function G(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 Tr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!Cr(e)}function Er(e,t){return e instanceof HTMLInputElement?!Or(e,t):Tr(e)}const Dr=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Or(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:Dr.has(e.type)}let K=null;const kr=new Set;let Ar=new Map,jr=!1,Mr=!1;const Nr={Tab:!0,Escape:!0};function Pr(e,t){for(let n of kr)n(e,t)}function Fr(e){return!(e.metaKey||!Je()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Ir(e){jr=!0,!M.isOpening&&Fr(e)&&(K=`keyboard`,Pr(`keyboard`,e))}function Lr(e){K=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(jr=!0,Pr(`pointer`,e))}function Rr(e){!M.isOpening&&nn(e)&&(jr=!0,K=`virtual`)}function zr(e){let t=F(z(e)),n=P(z(e));z(e)===t||z(e)===n||lr||!e.isTrusted||(!jr&&!Mr&&(K=`virtual`,Pr(`virtual`,e)),jr=!1,Mr=!1)}function Br(){lr||(jr=!1,Mr=!0)}function Vr(e){if(typeof window>`u`||typeof document>`u`)return;let t=F(e),n=P(e);if(Ar.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){jr=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Ir,!0),n.addEventListener(`keyup`,Ir,!0),n.addEventListener(`click`,Rr,!0),t.addEventListener(`focus`,zr,!0),t.addEventListener(`blur`,Br,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Lr,!0),n.addEventListener(`pointermove`,Lr,!0),n.addEventListener(`pointerup`,Lr,!0)),t.addEventListener(`beforeunload`,()=>{Hr(e)},{once:!0}),Ar.set(t,{focus:r})}const Hr=(e,t)=>{let n=F(e),r=P(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Ar.has(n)&&(n.HTMLElement.prototype.focus=Ar.get(n).focus,r.removeEventListener(`keydown`,Ir,!0),r.removeEventListener(`keyup`,Ir,!0),r.removeEventListener(`click`,Rr,!0),n.removeEventListener(`focus`,zr,!0),n.removeEventListener(`blur`,Br,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Lr,!0),r.removeEventListener(`pointermove`,Lr,!0),r.removeEventListener(`pointerup`,Lr,!0)),Ar.delete(n))};function Ur(e){let t=P(e),n;return t.readyState===`loading`?(n=()=>{Vr(e)},t.addEventListener(`DOMContentLoaded`,n)):Vr(e),()=>Hr(e,n)}typeof document<`u`&&Ur();function Wr(){return K!==`pointer`}function Gr(){return K}function Kr(e){K=e,Pr(e,null)}const qr=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Jr(e,t,n){let r=n?z(n):void 0,i=P(r),a=F(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=R(i);return e=e||u instanceof o&&!qr.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!Nr[n.key])}function Yr(e,t,n){Vr(),c(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Jr(!!n?.isTextInput,t,r)&&e(Wr())};return kr.add(t),()=>{kr.delete(t)}},t)}function Xr(e){if(!e.isConnected)return;let t=P(e);if(Gr()===`virtual`){let n=R(t);Ut(()=>{let r=R(t);(r===n||r===t.body)&&e.isConnected&&nt(e)})}else nt(e)}const Zr=r.createContext(null),Qr=`react-aria-focus-scope-restore`;let q=null;function $r(e){let{children:t,contain:n,restoreFocus:i,autoFocus:a}=e,o=d(null),u=d(null),f=d([]),{parentNode:p}=s(Zr)||{},m=l(()=>new _i({scopeRef:f}),[f]);N(()=>{let e=p||Q.root;if(Q.getTreeNode(e.scopeRef)&&q&&!ci(q,e.scopeRef)){let t=Q.getTreeNode(q);t&&(e=t)}e.addChild(m),Q.addNode(m)},[m,p]),N(()=>{let e=Q.getTreeNode(f);e&&(e.contain=!!n)},[n]),N(()=>{let e=o.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==u.current;)t.push(e),e.addEventListener(Qr,n),e=e.nextSibling;return f.current=t,()=>{for(let e of t)e.removeEventListener(Qr,n)}},[t]),fi(f,i,n),ai(f,n),mi(f,i,n),di(f,a),c(()=>{let e=R(P(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]),N(()=>()=>{let e=Q.getTreeNode(f)?.parent?.scopeRef??null;(f===q||ci(f,q))&&(!e||Q.getTreeNode(e))&&(q=e),Q.removeTreeNode(f)},[f]);let h=l(()=>ei(f),[]),g=l(()=>({focusManager:h,parentNode:m}),[m,h]);return r.createElement(Zr.Provider,{value:g},r.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,r.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:u}))}function ei(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||R(P(n[0]??void 0)),c=n[0].previousElementSibling,l=Z(ti(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||R(P(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Z(ti(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(ti(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(ti(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&X(o,!0),o}}}function ti(e){return e[0].parentElement}function ni(e){let t=Q.getTreeNode(q);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function ri(e){if(!e.form)return Array.from(P(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=F(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function ii(e){if(e.checked)return!0;let t=ri(e);return t.length>0&&!t.some(e=>e.checked)}function ai(e,t){let n=d(void 0),r=d(void 0);N(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=P(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!ni(e)||t.isComposing)return;let n=R(a),r=e.current;if(!r||!J(n,r))return;let i=Z(ti(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 F(o).HTMLInputElement&&o.select())},s=t=>{(!q||ci(q,e))&&J(z(t),e.current)?(q=e,n.current=z(t)):ni(e)&&!Y(z(t),e)?n.current?n.current.focus():q&&q.current&&ui(q.current):ni(e)&&(n.current=z(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=Gr(),i=(r===`virtual`||r===null)&&et()&&$e(),o=R(a);if(!i&&o&&ni(e)&&!Y(o,e)){q=e;let r=z(t);r&&r.isConnected?(n.current=r,n.current?.focus()):q.current&&ui(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]),N(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function oi(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>L(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 si(e){return Y(e,q)}function ci(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{Xr(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function li(e,t=!0){let n=e[0].previousElementSibling,r=ti(e),i=Z(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=ti(e),i=Z(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function ui(e,t=!0){X(li(e,t))}function di(e,t){let n=r.useRef(t);c(()=>{n.current&&(q=e,!J(R(P(e.current?e.current[0]:void 0)),q.current)&&e.current&&ui(e.current)),n.current=!1},[e])}function fi(e,t,n){N(()=>{if(t||n)return;let r=e.current,i=P(r?r[0]:void 0),a=t=>{let n=z(t);J(n,e.current)?q=e:oi(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 pi(e){let t=Q.getTreeNode(q);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function mi(e,t,n){let r=d(typeof document<`u`?R(P(e.current?e.current[0]:void 0)):null);N(()=>{let r=e.current,i=P(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!q||ci(q,e))&&J(R(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]),N(()=>{let r=P(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!ni(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!pi(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):oi(a)?X(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),N(()=>{let n=P(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=R(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&pi(e))){let t=Q.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){hi(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Q.getTreeNode(n.scopeRef)){hi(li(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function hi(e){e.dispatchEvent(new CustomEvent(Qr,{bubbles:!0,cancelable:!0}))&&X(e)}function Z(e,t,n){let r=t?.tabbable?gn:hn,i=P(e?.nodeType===Node.ELEMENT_NODE?e:null),a=jt(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return L(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!ii(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 gi=class e{constructor(){this.fastMap=new Map,this.root=new _i({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 _i({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}},_i=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 gi;function vi(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=o(e=>{if(z(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),s=cr(a),c=o(e=>{let t=z(e),r=P(t),a=r?R(r):R();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)?a:void 0}}}function yi(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 bi(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:yi(e.onKeyDown),onKeyUp:yi(e.onKeyUp)}}}let xi=r.createContext(null);function Si(e){let t=s(xi)||{};Yt(t,e);let{ref:n,...r}=t;return r}function Ci(e,t){let{focusProps:n}=vi(e),{keyboardProps:r}=bi(e),i=B(n,r),a=Si(t),o=e.isDisabled?{}:a,s=d(e.autoFocus);c(()=>{s.current&&t.current&&Xr(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:B({...i,tabIndex:l},o)}}const wi=typeof document<`u`?r.useInsertionEffect??r.useLayoutEffect:()=>{};function Ti(e,t,n){let[r,i]=f(e||t),a=d(r),s=d(e!==void 0),l=e!==void 0;c(()=>{s.current,s.current=l},[l]);let p=l?e:r;wi(()=>{a.current=p});let[,m]=u(()=>({}),{});return[p,o((e,...t)=>{let r=typeof e==`function`?e(a.current):e;Object.is(a.current,r)||(a.current=r,i(r),m(),n?.(r,...t))},[n])]}function Ei(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=d({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:c}=Wt(),l=o(e=>{L(e.currentTarget,z(e))&&a.current.isFocusWithin&&!L(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,c(),n&&n(e),i&&i(!1))},[n,i,a,c]),u=cr(l),f=o(e=>{if(!L(e.currentTarget,z(e)))return;let t=z(e),n=P(t),o=R(n);if(!a.current.isFocusWithin&&o===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,u(e);let t=e.currentTarget;s(n,`focus`,e=>{let r=z(e);if(a.current.isFocusWithin&&!L(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});sr(e,t),l(or(e))}},{capture:!0})}},[r,i,u,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:l}}}function Di(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=d({isFocused:!1,isFocusVisible:t||Wr()}),[a,s]=f(!1),[c,l]=f(()=>i.current.isFocused&&i.current.isFocusVisible),u=o(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),p=o(e=>{i.current.isFocused=e,i.current.isFocusVisible=Wr(),s(e),u()},[u]);Yr(e=>{i.current.isFocusVisible=e,u()},[n,a],{enabled:a,isTextInput:n});let{focusProps:m}=vi({isDisabled:r,onFocusChange:p}),{focusWithinProps:h}=Ei({isDisabled:!r,onFocusWithinChange:p});return{isFocused:a,isFocusVisible:c,focusProps:r?h:m}}function Oi({children:e}){let t=l(()=>({register:()=>{}}),[]);return r.createElement(gr.Provider,{value:t},e)}let ki=!1,Ai=0;function ji(){ki=!0,setTimeout(()=>{ki=!1},500)}function Mi(e){e.pointerType===`touch`&&ji()}function Ni(){let e=P(null);if(e!==void 0)return Ai===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Mi),Ai++,()=>{Ai--,!(Ai>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Mi)}}function Pi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=f(!1),s=d({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;c(Ni,[]);let{addGlobalListener:u,removeAllGlobalListeners:p}=Wt(),{hoverProps:m,triggerHoverEnd:h}=l(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!L(e.currentTarget,z(e)))return;s.isHovered=!0;let c=e.currentTarget;s.target=c,u(P(z(e)),`pointerover`,e=>{s.isHovered&&s.target&&!L(s.target,z(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:c,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},c={};return typeof PointerEvent<`u`&&(c.onPointerEnter=t=>{ki&&t.pointerType===`mouse`||e(t,t.pointerType)},c.onPointerLeave=e=>{!i&&L(e.currentTarget,z(e))&&a(e,e.pointerType)}),{hoverProps:c,triggerHoverEnd:a}},[t,n,r,i,s,u,p]);return c(()=>{i&&h({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:m,isHovered:a}}function Fi(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=d({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=Jt(e=>{n&&Ii(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=Jt(e=>{n&&n(e)});c(()=>{let e=a.current;if(r)return;let n=t.current,i=P(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&Ii(n,t)&&s(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 Ii(e,t){if(e.button>0)return!1;let n=z(e);if(n){let e=n.ownerDocument;if(!e||!L(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 Li=i(!1);function Ri(e){let t=(t,n)=>s(Li)?null:e(t,n);return t.displayName=e.displayName||e.name,a(t)}function zi(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}=Sr({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Ci(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=B(y,_,V(e,{labelable:!0}));return{isPressed:v,buttonProps:B(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 Bi={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 Vi(e={}){let{style:t,isFocusable:n}=e,[r,i]=f(!1),{focusWithinProps:a}=Ei({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=l(()=>r?t:t?{...Bi,...t}:Bi,[r]);return{visuallyHiddenProps:{...a,style:o}}}function Hi(e){let{children:t,elementType:n=`div`,isFocusable:i,style:a,...o}=e,{visuallyHiddenProps:s}=Vi(e);return r.createElement(n,B(o,s),t)}const Ui=i({});function Wi(){return s(Ui)??{}}const Gi=r.createContext(null);function Ki(e){let t=vt(),{portalContainer:n=t?null:document.body,isExiting:i}=e,[a,o]=f(!1),s=l(()=>({contain:a,setContain:o}),[a,o]),{getContainer:c}=Wi();if(!e.portalContainer&&c&&(n=c()),!n)return null;let u=e.children;return e.disableFocusManagement||(u=r.createElement($r,{restoreFocus:!0,contain:(e.shouldContainFocus||a)&&!i},u)),u=r.createElement(Gi.Provider,{value:s},r.createElement(Oi,null,u)),x.createPortal(u,n)}function qi(){let e=s(Gi)?.setContain;N(()=>{e?.(!0)},[e])}function Ji(e,t){let{role:n=`dialog`}=e,r=Tt();r=e[`aria-label`]?void 0:r;let i=d(!1);return c(()=>{if(t.current&&!kt(t.current)){Xr(t.current);let e=setTimeout(()=>{(R()===t.current||R()===document.body)&&(i.current=!0,t.current&&(t.current.blur(),Xr(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),qi(),d(!1),c(()=>{}),{dialogProps:{...V(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]||r,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:r}}}var Yi={};Yi={dismiss:`تجاهل`};var Xi={};Xi={dismiss:`Отхвърляне`};var Zi={};Zi={dismiss:`Odstranit`};var Qi={};Qi={dismiss:`Luk`};var $i={};$i={dismiss:`Schließen`};var ea={};ea={dismiss:`Απόρριψη`};var ta={};ta={dismiss:`Dismiss`};var na={};na={dismiss:`Descartar`};var ra={};ra={dismiss:`Lõpeta`};var ia={};ia={dismiss:`Hylkää`};var aa={};aa={dismiss:`Rejeter`};var oa={};oa={dismiss:`התעלם`};var sa={};sa={dismiss:`Odbaci`};var ca={};ca={dismiss:`Elutasítás`};var la={};la={dismiss:`Ignora`};var ua={};ua={dismiss:`閉じる`};var da={};da={dismiss:`무시`};var fa={};fa={dismiss:`Atmesti`};var pa={};pa={dismiss:`Nerādīt`};var ma={};ma={dismiss:`Lukk`};var ha={};ha={dismiss:`Negeren`};var ga={};ga={dismiss:`Zignoruj`};var _a={};_a={dismiss:`Descartar`};var va={};va={dismiss:`Dispensar`};var ya={};ya={dismiss:`Revocare`};var ba={};ba={dismiss:`Пропустить`};var xa={};xa={dismiss:`Zrušiť`};var Sa={};Sa={dismiss:`Opusti`};var Ca={};Ca={dismiss:`Odbaci`};var wa={};wa={dismiss:`Avvisa`};var Ta={};Ta={dismiss:`Kapat`};var Ea={};Ea={dismiss:`Скасувати`};var Da={};Da={dismiss:`取消`};var Oa={};Oa={dismiss:`關閉`};var ka={};ka={"ar-AE":Yi,"bg-BG":Xi,"cs-CZ":Zi,"da-DK":Qi,"de-DE":$i,"el-GR":ea,"en-US":ta,"es-ES":na,"et-EE":ra,"fi-FI":ia,"fr-FR":aa,"he-IL":oa,"hr-HR":sa,"hu-HU":ca,"it-IT":la,"ja-JP":ua,"ko-KR":da,"lt-LT":fa,"lv-LV":pa,"nb-NO":ma,"nl-NL":ha,"pl-PL":ga,"pt-BR":_a,"pt-PT":va,"ro-RO":ya,"ru-RU":ba,"sk-SK":xa,"sl-SI":Sa,"sr-SP":Ca,"sv-SE":wa,"tr-TR":Ta,"uk-UA":Ea,"zh-CN":Da,"zh-TW":Oa};function Aa(e){return e&&e.__esModule?e.default:e}function ja(e){let{onDismiss:t,...n}=e,i=Gt(n,ar(Aa(ka),`@react-aria/overlays`).format(`dismiss`)),a=()=>{t&&t()};return r.createElement(Hi,null,r.createElement(`button`,{...i,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}const $=[];function Ma(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,l=d(void 0);c(()=>{if(i&&!$.includes(t))return $.push(t),()=>{let e=$.indexOf(t);e>=0&&$.splice(e,1)}},[i,t]);let u=()=>{$[$.length-1]===t&&n&&n()},f=e=>{let n=$[$.length-1];l.current=n,(!s||s(z(e)))&&n===t&&e.stopPropagation()},p=e=>{(!s||s(z(e)))&&($[$.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0},m=e=>{e.key===`Escape`&&!o&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),u())};Fi({ref:t,onInteractOutside:a&&i?p:void 0,onInteractOutsideStart:f});let{focusWithinProps:h}=Ei({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||si(e.relatedTarget)||(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:m,...h},underlayProps:{}}}const Na=typeof document<`u`&&window.visualViewport;let Pa=0,Fa;function Ia(e={}){let{isDisabled:t}=e;N(()=>{if(!t)return Pa++,Pa===1&&(Fa=Ze()?Ra():La()),()=>{Pa--,Pa===0&&Fa()}},[t])}function La(){let e=window.innerWidth-document.documentElement.clientWidth;return Et(e>0&&(`scrollbarGutter`in document.documentElement.style?za(document.documentElement,`scrollbarGutter`,`stable`):za(document.documentElement,`paddingRight`,`${e}px`)),za(document.documentElement,`overflow`,`hidden`))}function Ra(){let e=za(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=z(e);t=Xt(r)?r:Zt(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=bn();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=z(e),n=e.relatedTarget;n&&$t(n)?(n.focus({preventScroll:!0}),Va(n,$t(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=R(),n=t!=null&&$t(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&Va(this,n)};let l=Et(Ba(document,`touchstart`,r,{passive:!1,capture:!0}),Ba(document,`touchmove`,o,{passive:!1,capture:!0}),Ba(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function za(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ba(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Va(e,t){t||!Na?Ha(e):Na.addEventListener(`resize`,()=>Ha(e),{once:!0})}function Ha(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=Zt(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;Na&&(n=Math.min(n,Na.offsetTop+Na.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 Ua(e,t,n){let{overlayProps:r,underlayProps:i}=Ma({...e,isOpen:t.isOpen,onClose:t.close},n);return Ia({isDisabled:!t.isOpen}),qi(),c(()=>{if(t.isOpen&&n.current)return Fn([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:B(r),underlayProps:i}}const Wa=i({}),Ga=Ri(function(e,t){[e,t]=En(e,t,Wa);let{elementType:n=`label`,...i}=e,a=jn[n];return r.createElement(a,{className:`react-aria-Label`,...i,ref:t})}),Ka=i(null),qa=7e3;let Ja=null;function Ya(e,t=`assertive`,n=qa){Ja?Ja.announce(e,t,n):(Ja=new Xa,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?Ja.announce(e,t,n):setTimeout(()=>{Ja?.isAttached()&&Ja?.announce(e,t,n)},100))}var Xa=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=qa){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 Za=i({}),Qa=Ri(function(e,t){[e,t]=En(e,t,Za);let n=e,{isPending:i}=n,{buttonProps:a,isPressed:o}=zi(e,t);a=eo(a,i);let{focusProps:s,isFocused:l,isFocusVisible:u}=Di(e),{hoverProps:f,isHovered:p}=Pi({...e,isDisabled:e.isDisabled||i}),m={isHovered:p,isPressed:(n.isPressed||o)&&!i,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:i??!1},h=Cn({...e,values:m,defaultClassName:`react-aria-Button`}),g=Ct(a.id),_=Ct(),v=a[`aria-labelledby`];i&&(v?v=`${v} ${_}`:a[`aria-label`]&&(v=`${g} ${_}`));let y=d(i);c(()=>{let e={"aria-labelledby":v||g};(!y.current&&l&&i||y.current&&l&&!i)&&Ya(e,`assertive`),y.current=i},[i,l,v,g]);let b=V(e,{global:!0});return delete b.onClick,r.createElement(jn.button,{...B(b,h,a,s,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":u||void 0},r.createElement(Ka.Provider,{value:{id:_}},h.children))}),$a=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function eo(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!$a.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}function to(e){let[t,n]=Ti(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:o(()=>{n(!0)},[n]),close:o(()=>{n(!1)},[n]),toggle:o(()=>{n(!t)},[n,t])}}const no=i(null),ro=i(null),io=a(function(e,t){let n=e[`aria-labelledby`];[e,t]=En(e,t,no);let{dialogProps:i,titleProps:a}=Ji({...e,"aria-labelledby":n},t),o=s(ro);!i[`aria-label`]&&!i[`aria-labelledby`]&&e[`aria-labelledby`]&&(i[`aria-labelledby`]=e[`aria-labelledby`]);let c=Cn({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),l=V(e,{global:!0});return r.createElement(jn.section,{...B(l,c,i),render:e.render,ref:t,slot:e.slot||void 0},r.createElement(Sn,{values:[[We,{slots:{[xn]:{},title:{...a,level:2}}}],[Za,{slots:{[xn]:{},close:{onPress:()=>o?.close()}}}]]},c.children))}),ao=i(null),oo=i(null),so=a(function(e,t){if(s(oo))return r.createElement(fo,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,children:l,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p,...m}=e;return r.createElement(lo,{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p},r.createElement(fo,{...m,modalRef:t},l))});function co(e,t){[e,t]=En(e,t,ao);let n=s(ro),i=to(e),a=e.isOpen!=null||e.defaultOpen!=null||!n?i:n,o=Kt(t),c=d(null),l=on(o,a.isOpen),u=on(c,a.isOpen),f=l||u||e.isExiting||!1,p=vt();return!a.isOpen&&!f||p?null:r.createElement(uo,{...e,state:a,isExiting:f,overlayRef:o,modalRef:c})}const lo=a(co);function uo({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:i}=t,{modalProps:a,underlayProps:o}=Ua(t,i,n),s=an(t.overlayRef)||t.isEntering||!1,c=Cn({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:s,isExiting:t.isExiting,state:i}}),l=en(),u;if(typeof document<`u`){let e=Xt(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 r.createElement(Ki,{isExiting:t.isExiting,portalContainer:e},r.createElement(jn.div,{...B(V(t,{global:!0}),o),...c,style:d,ref:t.overlayRef,"data-entering":s||void 0,"data-exiting":t.isExiting||void 0},r.createElement(Sn,{values:[[oo,{modalProps:a,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[ro,i]]},c.children)))}function fo(e){let{modalProps:t,modalRef:n,isExiting:i,isDismissable:a}=s(oo),o=s(ro),c=Kt(l(()=>Mt(e.modalRef,n),[e.modalRef,n])),u=an(c),d=Cn({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:u,isExiting:i,state:o}});return r.createElement(jn.div,{...B(V(e,{global:!0}),t),...d,ref:c,"data-entering":u||void 0,"data-exiting":i||void 0},a&&r.createElement(ja,{onDismiss:o.close}),d.children)}const po=()=>{let[n,r]=f(!1);return c(()=>{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},mo=({className:e,iconClassName:t,onClose:n})=>po()?null:v(`button`,{type:`button`,className:e,"aria-label":`Dismiss`,onClick:n,children:v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`none`,className:t,children:v(`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`})})}),ho=({children:e,classNames:t,isDismissable:r,onDismiss:i,closeOnFinishMs:a})=>{let{survey:o,surveyId:s,dismiss:c}=He(),[l,u]=f(!1);return m(()=>{o&&c()},l?a:null),y(io,{"aria-label":`Survey`,id:`${s}-popover`,className:b(`confetti-modal-dialog ${n}`,t?.dialog),children:[r&&v(mo,{className:b(`confetti-modal-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await c(),i?.()}}),typeof e==`function`?e({setIsFinished:()=>u(!0)}):e]})},go=({children:e,classNames:t,onDismiss:r,isDismissable:i=!0,closeOnFinishMs:a=3e3})=>{let{dismiss:o}=He();return v(lo,{isOpen:!0,isDismissable:i,isKeyboardDismissDisabled:!i,onOpenChange:async e=>{e||(await o(),r?.())},className:b(`confetti-modal-overlay ${n}`,t?.overlay),children:v(so,{className:b(`confetti-modal ${n}`,t?.modal),children:v(ho,{classNames:t,isDismissable:i,onDismiss:r,closeOnFinishMs:a,children:e})})})};export{V as A,ze as B,wn as C,Jt as D,Tn as E,Tt as F,Oe as G,He as H,Ct as I,De as J,Te as K,N as L,Mt as M,z as N,Kt as O,F as P,ne as Q,Ge as R,Dn as S,On as T,Le as U,Ve as V,Se as W,pe as X,ke as Y,me as Z,Sr as _,Qa as a,En as b,Hi as c,Di as d,Ei as f,Kr as g,Z as h,po as i,B as j,Gt as k,Ri as l,Ci as m,ho as n,Wa as o,Ti as p,we as q,mo as r,Ga as s,go as t,Pi as u,Kn as v,jn as w,Cn as x,Sn as y,Ue as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./ModalContainer-
|
|
1
|
+
import{n as e}from"./ModalContainer-b9Zgg8fN.js";export{e as UnstableModalContent};
|
package/build/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { n as ModalContainerProps, t as ModalContainer } from "./ModalContainer-
|
|
|
2
2
|
import { a as MultiSelectQuestionProperties, c as StatementQuestionProperties, i as PublicGetSurveyOutput, l as TextQuestionProperties, n as ConfettiState, o as RatingQuestionProperties, r as Question, s as SingleSelectQuestionProperties, t as Answer } from "./types-JeyKtT3p.js";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { HTMLAttributes, PropsWithChildren, SVGProps } from "react";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/core/ConfettiController.d.ts
|
|
8
8
|
interface ConfettiControllerProps {
|
|
@@ -20,7 +20,7 @@ declare const ConfettiController: ({
|
|
|
20
20
|
shouldAutoSubmit,
|
|
21
21
|
onFinished,
|
|
22
22
|
children
|
|
23
|
-
}: ConfettiControllerProps) =>
|
|
23
|
+
}: ConfettiControllerProps) => react_jsx_runtime8.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/core/ConfettiProvider.d.ts
|
|
26
26
|
interface ConfettiContextValue {
|
|
@@ -49,7 +49,7 @@ interface ConfettiProviderProps {
|
|
|
49
49
|
}) => boolean);
|
|
50
50
|
alwaysRenderChildren?: boolean;
|
|
51
51
|
}
|
|
52
|
-
declare const ConfettiProvider: (props: ConfettiProviderProps) =>
|
|
52
|
+
declare const ConfettiProvider: (props: ConfettiProviderProps) => react_jsx_runtime8.JSX.Element;
|
|
53
53
|
declare const useConfetti: () => ConfettiContextValue;
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/components/questions/types.d.ts
|
|
@@ -79,7 +79,7 @@ declare const Confetti: ({
|
|
|
79
79
|
onFinished,
|
|
80
80
|
shouldAutoSubmit,
|
|
81
81
|
...props
|
|
82
|
-
}: ConfettiProps & Pick<ConfettiControllerProps, "children" | "shouldAutoSubmit">) =>
|
|
82
|
+
}: ConfettiProps & Pick<ConfettiControllerProps, "children" | "shouldAutoSubmit">) => react_jsx_runtime8.JSX.Element;
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/components/ThankYouMessage.d.ts
|
|
85
85
|
interface ThankYouMessageProps {
|
|
@@ -96,7 +96,7 @@ declare const ThankYouMessage: ({
|
|
|
96
96
|
title,
|
|
97
97
|
description,
|
|
98
98
|
classNames
|
|
99
|
-
}: ThankYouMessageProps) =>
|
|
99
|
+
}: ThankYouMessageProps) => react_jsx_runtime8.JSX.Element | null;
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/components/container/PopoverContainer.d.ts
|
|
102
102
|
interface PopoverContainerProps {
|
|
@@ -118,7 +118,7 @@ declare const PopoverContainer: ({
|
|
|
118
118
|
containerProps,
|
|
119
119
|
onDismiss,
|
|
120
120
|
closeOnFinishMs
|
|
121
|
-
}: PopoverContainerProps) =>
|
|
121
|
+
}: PopoverContainerProps) => react_jsx_runtime8.JSX.Element;
|
|
122
122
|
//#endregion
|
|
123
123
|
//#region src/components/questions/factory.d.ts
|
|
124
124
|
interface SurveyQuestionFactoryProps extends BugReportOptions {
|
|
@@ -131,7 +131,7 @@ declare const SurveyQuestionFactory: ({
|
|
|
131
131
|
onChange,
|
|
132
132
|
error,
|
|
133
133
|
maskAllInputs
|
|
134
|
-
}: SurveyQuestionFactoryProps) =>
|
|
134
|
+
}: SurveyQuestionFactoryProps) => react_jsx_runtime8.JSX.Element;
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/components/questions/Rating.d.ts
|
|
137
137
|
interface RatingProps extends BaseFieldProps {
|
|
@@ -165,7 +165,7 @@ declare const Rating: ({
|
|
|
165
165
|
id,
|
|
166
166
|
error,
|
|
167
167
|
required
|
|
168
|
-
}: RatingProps) =>
|
|
168
|
+
}: RatingProps) => react_jsx_runtime8.JSX.Element;
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region src/components/questions/FreeText.d.ts
|
|
171
171
|
interface FreeTextProps extends BaseFieldProps {
|
|
@@ -189,7 +189,7 @@ declare const FreeText: ({
|
|
|
189
189
|
classNames,
|
|
190
190
|
required,
|
|
191
191
|
error
|
|
192
|
-
}: FreeTextProps) =>
|
|
192
|
+
}: FreeTextProps) => react_jsx_runtime8.JSX.Element;
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/components/questions/SingleChoice.d.ts
|
|
195
195
|
interface SingleChoiceProps extends BaseFieldProps {
|
|
@@ -219,7 +219,7 @@ declare const SingleChoice: ({
|
|
|
219
219
|
id,
|
|
220
220
|
required,
|
|
221
221
|
error
|
|
222
|
-
}: SingleChoiceProps) =>
|
|
222
|
+
}: SingleChoiceProps) => react_jsx_runtime8.JSX.Element;
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/components/questions/MultiChoice.d.ts
|
|
225
225
|
interface MultiChoiceProps extends BaseFieldProps {
|
|
@@ -252,7 +252,7 @@ declare const MultiChoice: ({
|
|
|
252
252
|
id,
|
|
253
253
|
required,
|
|
254
254
|
error
|
|
255
|
-
}: MultiChoiceProps) =>
|
|
255
|
+
}: MultiChoiceProps) => react_jsx_runtime8.JSX.Element;
|
|
256
256
|
//#endregion
|
|
257
257
|
//#region src/components/questions/Statement.d.ts
|
|
258
258
|
interface StatementProps extends BaseFieldProps {
|
|
@@ -270,7 +270,7 @@ declare const Statement: ({
|
|
|
270
270
|
title,
|
|
271
271
|
description,
|
|
272
272
|
classNames
|
|
273
|
-
}: StatementProps) =>
|
|
273
|
+
}: StatementProps) => react_jsx_runtime8.JSX.Element;
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region src/components/presentation/Flow.d.ts
|
|
276
276
|
type ChildField = (_: {
|
|
@@ -289,7 +289,7 @@ declare const Flow: ({
|
|
|
289
289
|
children,
|
|
290
290
|
question,
|
|
291
291
|
isLastQuestion
|
|
292
|
-
}: FlowProps) =>
|
|
292
|
+
}: FlowProps) => react_jsx_runtime8.JSX.Element;
|
|
293
293
|
//#endregion
|
|
294
294
|
//#region src/components/presentation/Embed.d.ts
|
|
295
295
|
declare const Embed: ({
|
|
@@ -299,7 +299,7 @@ declare const Embed: ({
|
|
|
299
299
|
}: PropsWithChildren<{
|
|
300
300
|
isCompleted: boolean;
|
|
301
301
|
onSubmit: () => void;
|
|
302
|
-
}>) =>
|
|
302
|
+
}>) => react_jsx_runtime8.JSX.Element;
|
|
303
303
|
//#endregion
|
|
304
304
|
//#region src/components/CloseButton.d.ts
|
|
305
305
|
interface CloseButtonProps {
|
|
@@ -311,10 +311,10 @@ declare const CloseButton: ({
|
|
|
311
311
|
className,
|
|
312
312
|
iconClassName,
|
|
313
313
|
onClose
|
|
314
|
-
}: CloseButtonProps) =>
|
|
314
|
+
}: CloseButtonProps) => react_jsx_runtime8.JSX.Element | null;
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/components/trigger/ConfettiTriggerIcon.d.ts
|
|
317
|
-
declare const ConfettiTriggerIcon: (props: SVGProps<SVGSVGElement>) =>
|
|
317
|
+
declare const ConfettiTriggerIcon: (props: SVGProps<SVGSVGElement>) => react_jsx_runtime8.JSX.Element;
|
|
318
318
|
//#endregion
|
|
319
319
|
//#region src/components/trigger/DefaultConfettiTrigger.d.ts
|
|
320
320
|
interface DefaultConfettiTriggerProps {
|
|
@@ -333,7 +333,7 @@ declare const DefaultConfettiTrigger: ({
|
|
|
333
333
|
isWidgetOpen,
|
|
334
334
|
classNames,
|
|
335
335
|
label
|
|
336
|
-
}: DefaultConfettiTriggerProps) =>
|
|
336
|
+
}: DefaultConfettiTriggerProps) => react_jsx_runtime8.JSX.Element | null;
|
|
337
337
|
//#endregion
|
|
338
338
|
//#region src/templates/ConfettiTrigger.d.ts
|
|
339
339
|
interface TriggerRenderProps {
|
|
@@ -354,10 +354,10 @@ declare const ConfettiTrigger: ({
|
|
|
354
354
|
trigger,
|
|
355
355
|
children,
|
|
356
356
|
...providerProps
|
|
357
|
-
}: ConfettiTriggerProps) =>
|
|
357
|
+
}: ConfettiTriggerProps) => react_jsx_runtime8.JSX.Element;
|
|
358
358
|
//#endregion
|
|
359
359
|
//#region src/templates/EmbeddedConfetti.d.ts
|
|
360
|
-
declare const EmbeddedConfetti: (props: ConfettiProps) =>
|
|
360
|
+
declare const EmbeddedConfetti: (props: ConfettiProps) => react_jsx_runtime8.JSX.Element;
|
|
361
361
|
//#endregion
|
|
362
362
|
//#region src/templates/ModalConfetti.d.ts
|
|
363
363
|
interface ModalConfettiProps extends ConfettiProps {
|
|
@@ -370,7 +370,7 @@ declare const ModalConfetti: ({
|
|
|
370
370
|
closeOnFinishMs,
|
|
371
371
|
isDismissable,
|
|
372
372
|
...props
|
|
373
|
-
}: ModalConfettiProps) =>
|
|
373
|
+
}: ModalConfettiProps) => react_jsx_runtime8.JSX.Element;
|
|
374
374
|
//#endregion
|
|
375
375
|
//#region src/templates/PopoverConfetti.d.ts
|
|
376
376
|
interface PopoverConfettiProps extends ConfettiProps {
|
|
@@ -390,10 +390,10 @@ declare const PopoverConfetti: ({
|
|
|
390
390
|
onDismiss,
|
|
391
391
|
closeOnFinishMs,
|
|
392
392
|
...props
|
|
393
|
-
}: PopoverConfettiProps) =>
|
|
393
|
+
}: PopoverConfettiProps) => react_jsx_runtime8.JSX.Element;
|
|
394
394
|
//#endregion
|
|
395
395
|
//#region src/templates/StepperConfetti.d.ts
|
|
396
|
-
declare const StepperConfetti: (props: ConfettiProps) =>
|
|
396
|
+
declare const StepperConfetti: (props: ConfettiProps) => react_jsx_runtime8.JSX.Element;
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/hooks/useVisibleAfterDelay.d.ts
|
|
399
399
|
interface UseVisibleAfterDelayOptions {
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r,t as i}from"./internals-Dzl6abGJ.js";import{A as a,B as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,O as y,P as b,R as x,S,T as C,U as w,V as T,W as E,X as D,Y as O,Z as ee,_ as k,a as A,b as j,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as M,k as se,l as ce,m as le,o as ue,p as de,q as fe,r as pe,s as N,t as me,u as he,v as ge,w as P,x as F,y as _e,z as ve}from"./ModalContainer-CDEl2ap2.js";import{ErrorBoundary as ye}from"react-error-boundary";import I,{Suspense as be,createContext as L,forwardRef as R,lazy as xe,useCallback as z,useContext as Se,useEffect as B,useMemo as V,useRef as H,useState as U}from"react";import{useLocalStorage as Ce,useSessionStorage as we,useTimeout as Te}from"usehooks-ts";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import q from"clsx";import{flushSync as Ee}from"react-dom";function De(e){return e.issues[0]?.message??`Invalid input`}const J={rating:({scale:e},t)=>h({scale:e},t),"open-ended":({max:e},t)=>d({maxLength:e},t),"single-select":({editable:e},t)=>fe({maxLength:e?.max},t),"multi-select":({editable:e,max:t},n)=>E({maxLength:e?.max,maxSelected:t},n),statement:(e,t)=>m(),"bug-report":(e,t)=>w({},t)},Oe=(e,t)=>{let n=e.type;switch(n){case`rating`:{let r=J[n];return r(e,t)}case`open-ended`:{let r=J[n];return r(e,t)}case`single-select`:{let r=J[n];return r(e,t)}case`multi-select`:{let r=J[n];return r(e,t)}case`statement`:{let r=J[n];return r(e,t)}case`bug-report`:{let r=J[n];return r(e,t)}default:throw Error(`Unsupported question type`)}},ke=({originalQuestions:e,answers:t,errors:r,pointer:i=-1})=>{if(!e)return{questions:[],currentIndex:-1};let a=e.sort((e,t)=>e.position-t.position).map(e=>{let t={...e},n=r[e.id];return n&&(t.error=n),{...t,visible:!1}});for(let e=0;e<a.length;e++){let r=a[e];if(!r)continue;let o=n({index:e,questions:a,answers:t});r.visible=i===e||o}let o=a.findIndex((e,n)=>n>i&&e.visible&&t[e.id]===void 0);return o===-1&&(o=a.findLastIndex(e=>!!e.visible)),{questions:a,currentIndex:o}},Ae=({questions:e,answers:t})=>{let n=je({questions:e,answers:t});return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==null))},je=({questions:e,answers:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Me=({questions:e,errors:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Ne=({current:e,shouldAutoSubmit:t,onFinished:n,children:r})=>{let{survey:a,submit:o}=f(),[s,c]=U({}),[l,u]=U({}),d=V(()=>ke({originalQuestions:a?.questions,answers:s,errors:l,pointer:e}),[a?.questions,s,l,e]),p=V(()=>!!d.questions.filter(({required:e,visible:t})=>!!e&&!!t).every(({id:e})=>s[e]!==void 0),[s,d.questions]),[m,h]=U(!1),g=z(({answers:e})=>{o({answers:e}).finally(()=>{n?.()})},[n,o]),_=z(()=>{g({answers:Ae({questions:d.questions,answers:s})}),h(!0)},[s,d.questions,g]),v=z(({question:n,answer:r})=>{let i=d.questions.at(n);if(!i)return{error:`Question index is invalid`};let o=Oe(i.properties,{required:i.required}).safeParse(r);if(!o.success){let e=De(o.error);return u(t=>{if(t[i.id]===e)return t;let n={...t};return n[i.id]=e,n}),c(e=>{if(!(i.id in e))return e;let t={...e};return delete t[i.id],t}),{error:e}}u(e=>{if(!e[i.id])return e;let t={...e};return delete t[i.id],t});let f=!i.required&&!r?null:r,p={...s};if(p[i.id]===f)return{next:ke({originalQuestions:a?.questions,answers:p,errors:l,pointer:e}).currentIndex};p[i.id]=f;let m=ke({originalQuestions:a?.questions,answers:p,errors:l,pointer:e});return p=je({questions:m.questions,answers:p}),c(p),u(Me({questions:m.questions,errors:l})),m.questions.filter(({visible:e})=>!!e).every(({id:e})=>p[e]!==void 0)&&t&&(g({answers:Ae({questions:m.questions,answers:p})}),h(!0)),{next:m.currentIndex}},[d.questions,s,a?.questions,l,t,e,g]);return d.questions.length===0?G(W,{}):G(`div`,{className:`confetti ${i}`,children:r({questions:d.questions,current:e??d.currentIndex,update:v,isCompleted:p,submit:_,isSubmitted:m,errors:l})})},Pe=({children:e,onFinished:t,shouldAutoSubmit:n,...r})=>G(ye,{fallback:G(W,{}),children:G(T,{...r,children:G(Ne,{shouldAutoSubmit:n,onFinished:t,children:e})})});function Fe(e,t,n){let r=c(e=>{n&&!e.defaultPrevented&&n(t)});B(()=>{let t=e?.current?.form;return t?.addEventListener(`reset`,r),()=>{t?.removeEventListener(`reset`,r)}},[e])}function Ie(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a=`label`}=e;t=p(t);let o=p(),s={};n&&(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a===`label`?t:void 0});let c=se({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:c}}function Le(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=Ie(e),s=u([!!t,!!n,r,i]),c=u([!!t,!!n,r,i]);return o=M(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}function Re(e,t,n){let{validationBehavior:r,focus:i}=e;g(()=>{if(r===`native`&&n?.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(Be(n.current))}});let a=H(!1),o=c(()=>{a.current||t.resetValidation()}),s=c(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&Ve(r)===n.current&&(i?i():n.current?.focus(),ie(`keyboard`)),e.preventDefault()}),l=c(()=>{t.commitValidation()});B(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&v(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,l),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,l),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function ze(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function Be(e){return{isInvalid:!e.validity.valid,validationDetails:ze(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function Ve(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}const He={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Ue={...He,customError:!0,valid:!1},Y={isInvalid:!1,validationDetails:He,validationErrors:[]},We=L({}),Ge=`__reactAriaFormValidationState`;function X(e){if(e[Ge]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Ge];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return Ke(e)}function Ke(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:Ue},l=V(()=>!o||i==null?null:Ye(Je(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=Se(We),d=V(()=>r?Array.isArray(r)?r.flatMap(e=>qe(u[e])):qe(u[r]):[],[u,r]),[f,p]=U(u),[m,h]=U(!1);u!==f&&(p(u),h(!1));let g=V(()=>Ye(m?[]:d),[m,d]),_=H(Y),[v,y]=U(Y),b=H(Y),x=()=>{if(!S)return;C(!1);let e=l||a||_.current;Xe(e,b.current)||(b.current=e,y(e))},[S,C]=U(!1);return B(x),{realtimeValidation:c||g||l||a||Y,displayValidation:s===`native`?c||g||v:c||g||l||a||v,updateValidation(e){s===`aria`&&!Xe(v,e)?y(e):_.current=e},resetValidation(){let e=Y;Xe(e,b.current)||(b.current=e,y(e)),s===`native`&&C(!1),h(!0)},commitValidation(){s===`native`&&C(!0),h(!0)}}}function qe(e){return e?Array.isArray(e)?e:[e]:[]}function Je(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return qe(n)}return[]}function Ye(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Ue}:null}function Xe(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function Ze(...e){let t=new Set,n=!1,r={...He};for(let i of e){for(let e of i.validationErrors)t.add(e);for(let e in n||=i.isInvalid,r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function Qe(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:o=!1,type:s=`text`,validationBehavior:c=`aria`}=e,[l,u]=de(e.value,e.defaultValue||``,e.onChange),{focusableProps:d}=le(e,t),f=X({...e,value:l}),{isInvalid:p,validationErrors:m,validationDetails:h}=f.displayValidation,{labelProps:g,fieldProps:_,descriptionProps:y,errorMessageProps:b}=Le({...e,isInvalid:p,errorMessage:e.errorMessage||m}),x=a(e,{labelable:!0}),S={type:s,pattern:e.pattern},[C]=U(l);return Fe(t,e.defaultValue??C,u),Re(e,f,t),{labelProps:g,inputProps:M(x,n===`input`?S:void 0,{disabled:r,readOnly:o,required:i&&c===`native`,"aria-required":i&&c===`aria`||void 0,"aria-invalid":p||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:l,onChange:e=>u(v(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(I.version,10)>=17?`enterKeyHint`:`enterkeyhint`]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,..._}),descriptionProps:y,errorMessageProps:b,isInvalid:p,validationErrors:m,validationDetails:h}}function $e(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:o,name:s,form:c,children:l,"aria-label":u,"aria-labelledby":d,validationState:f=`valid`,isInvalid:p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b}=e,x=e=>{e.stopPropagation(),t.setSelected(v(e).checked)},{pressProps:S,isPressed:C}=k({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b,isDisabled:r}),{pressProps:w,isPressed:T}=k({onPressStart:m,onPressEnd:h,onPressChange:g,onPressUp:y,onClick:b,onPress(e){_?.(e),t.toggle(),n.current?.focus()},isDisabled:r||i}),{focusableProps:E}=le(e,n),D=M(S,E),O=a(e,{labelable:!0});return Fe(n,t.defaultSelected,t.setSelected),{labelProps:M(w,{onClick:e=>e.preventDefault()}),inputProps:M(O,{"aria-invalid":p||f===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,onChange:x,disabled:r,...o==null?{}:{value:o},name:s,form:c,type:`checkbox`,...D}),isSelected:t.isSelected,isPressed:C||T,isDisabled:r,isReadOnly:i,isInvalid:p||f===`invalid`}}function et(e,t,n){let r=X({...e,value:t.isSelected}),{isInvalid:i,validationErrors:a,validationDetails:o}=r.displayValidation,{labelProps:s,inputProps:c,isSelected:l,isPressed:u,isDisabled:d,isReadOnly:f}=$e({...e,isInvalid:i},t,n);Re(e,r,n);let{isIndeterminate:p,isRequired:m,validationBehavior:h=`aria`}=e;B(()=>{n.current&&(n.current.indeterminate=!!p)});let{pressProps:g}=k({isDisabled:d||f,onPress(){let{[Ge]:t}=e,{commitValidation:n}=t||r;n()}});return{labelProps:M(s,g,V(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:{...c,checked:l,"aria-required":m&&h===`aria`||void 0,required:m&&h===`native`},isSelected:l,isPressed:u,isDisabled:d,isReadOnly:f,isInvalid:i,validationErrors:a,validationDetails:o}}const tt=new WeakMap;function nt(e,t){let{isDisabled:n,name:r,form:i,validationBehavior:o=`aria`}=e,{isInvalid:s,validationErrors:c,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:d,descriptionProps:f,errorMessageProps:p}=Le({...e,labelElementType:`span`,isInvalid:s,errorMessage:e.errorMessage||c});tt.set(t,{name:r,form:i,descriptionId:f.id,errorMessageId:p.id,validationBehavior:o});let m=a(e,{labelable:!0}),{focusWithinProps:h}=re({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:M(m,{role:`group`,"aria-disabled":n||void 0,...d,...h}),labelProps:u,descriptionProps:f,errorMessageProps:p,isInvalid:s,validationErrors:c,validationDetails:l}}function rt(e={}){let{isReadOnly:t}=e,[n,r]=de(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=U(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}function it(e,t,n){let r=rt({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=tt.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=X({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=H(Y),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};B(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=et({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[Ge]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[e[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}const at=new WeakMap;function ot(e,t,n){let{value:r,children:i,"aria-label":o,"aria-labelledby":s,onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p}=e,m=e.isDisabled||t.isDisabled,h=t.selectedValue===r,g=e=>{e.stopPropagation(),t.setSelectedValue(r)},{pressProps:_,isPressed:v}=k({onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p,isDisabled:m}),{pressProps:y,isPressed:b}=k({onPressStart:c,onPressEnd:l,onPressChange:u,onPressUp:f,onClick:p,isDisabled:m,onPress(e){d?.(e),t.setSelectedValue(r),n.current?.focus()}}),{focusableProps:x}=le(M(e,{onFocus:()=>t.setLastFocusedValue(r)}),n),S=M(_,x),C=a(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===r||t.lastFocusedValue==null)&&(w=0):t.selectedValue===r&&(w=0),m&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:ee}=at.get(t);return Fe(n,t.defaultSelectedValue,t.setSelectedValue),Re({validationBehavior:ee},t,n),{labelProps:M(y,V(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:M(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:m,required:t.isRequired&&ee===`native`,checked:h,value:r,onChange:g,"aria-describedby":[e[`aria-describedby`],t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),isDisabled:m,isSelected:h,isPressed:v||b}}function st(e,t){let{name:n,form:r,isReadOnly:i,isRequired:o,isDisabled:s,orientation:c=`vertical`,validationBehavior:l=`aria`}=e,{direction:u}=ge(),{isInvalid:d,validationErrors:f,validationDetails:m}=t.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:y}=Le({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||f}),x=a(e,{labelable:!0}),{focusWithinProps:S}=re({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),C=e=>{let n;switch(e.key){case`ArrowRight`:n=u===`rtl`&&c!==`vertical`?`prev`:`next`;break;case`ArrowLeft`:n=u===`rtl`&&c!==`vertical`?`next`:`prev`;break;case`ArrowDown`:n=`next`;break;case`ArrowUp`:n=`prev`;break;default:return}e.preventDefault();let r=ae(e.currentTarget,{from:v(e),accept:e=>e instanceof b(e).HTMLInputElement&&e.type===`radio`}),i;n===`next`?(i=r.nextNode(),i||=(r.currentNode=e.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=e.currentTarget,r.lastChild())),i&&(i.focus(),t.setSelectedValue(i.value))},w=p(n);return at.set(t,{name:w,form:r,descriptionId:_.id,errorMessageId:y.id,validationBehavior:l}),{radioGroupProps:M(x,{role:`radiogroup`,onKeyDown:C,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":i||void 0,"aria-required":o||void 0,"aria-disabled":s||void 0,"aria-orientation":c,...g,...S}),labelProps:h,descriptionProps:_,errorMessageProps:y,isInvalid:d,validationErrors:f,validationDetails:m}}const ct=L({}),Z=R(function(e,t){[e,t]=j(e,t,ct);let{elementType:n=`span`,...r}=e,i=P[n];return I.createElement(i,{className:`react-aria-Text`,...r,ref:t})});function lt(e={}){let[t,n]=de(e.value,e.defaultValue||[],e.onChange),[r]=U(t),i=!!e.isRequired&&t.length===0,a=H(new Map),o=X({...e,value:t}),s=o.displayValidation.isInvalid;return{...o,value:t,defaultValue:e.defaultValue??r,setValue(t){e.isReadOnly||e.isDisabled||n(t)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(e){return t.includes(e)},addValue(t){e.isReadOnly||e.isDisabled||n(e=>e.includes(t)?e:e.concat(t))},removeValue(r){e.isReadOnly||e.isDisabled||t.includes(r)&&n(t.filter(e=>e!==r))},toggleValue(r){e.isReadOnly||e.isDisabled||(t.includes(r)?n(t.filter(e=>e!==r)):n(t.concat(r)))},setInvalid(e,t){let n=new Map(a.current);t.isInvalid?n.set(e,t):n.delete(e),a.current=n,o.updateValidation(Ze(...n.values()))},validationState:e.validationState??(s?`invalid`:null),isInvalid:s,isRequired:i}}let ut=Math.round(Math.random()*1e10),dt=0;function ft(e){let t=V(()=>e.name||`radio-group-${ut}-${++dt}`,[e.name]),[n,r]=de(e.value,e.defaultValue??null,e.onChange),[i]=U(n),[a,o]=U(null),s=X({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}const Q=L(null),$=R(function(e,t){return Se(Q)?.isInvalid?I.createElement(pt,{...e,ref:t}):null}),pt=R((e,t)=>{let n=Se(Q),r=a(e,{global:!0}),i=F({...e,defaultClassName:`react-aria-FieldError`,defaultChildren:n.validationErrors.length===0?void 0:n.validationErrors.join(` `),values:n});return i.children==null?null:I.createElement(Z,{slot:`errorMessage`,...r,...i,ref:t})}),mt=L(null),ht=L(null),gt=L(null),_t=R(function(e,t){[e,t]=j(e,t,ht);let{validationBehavior:n}=l(mt)||{},r=e.validationBehavior??n??`native`,i=lt({...e,validationBehavior:r}),[o,s]=S(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:c,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=nt({...e,label:s,validationBehavior:r},i),m=F({...e,values:{isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:e.isRequired||!1,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-CheckboxGroup`}),h=a(e,{global:!0});return I.createElement(P.div,{...M(h,m,c),ref:t,slot:e.slot||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":i.isInvalid||void 0,"data-disabled":e.isDisabled||void 0},I.createElement(_e,{values:[[gt,i],[ue,{...u,ref:o,elementType:`span`}],[ct,{slots:{description:d,errorMessage:f}}],[Q,p]]},m.children))}),vt=R(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=j(r,t,ve);let{validationBehavior:i}=l(mt)||{},o=e.validationBehavior??i??`native`,s=Se(gt),c=y(V(()=>_(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:u,inputProps:d,isSelected:f,isDisabled:p,isReadOnly:m,isPressed:h,isInvalid:g}=s?it({...C(e),value:e.value,children:typeof e.children==`function`?!0:e.children},s,c):et({...C(e),children:typeof e.children==`function`?!0:e.children,validationBehavior:o},rt(e),c),{isFocused:v,isFocusVisible:b,focusProps:x}=ne(),S=p||m,{hoverProps:w,isHovered:T}=he({...e,isDisabled:S}),E=F({...e,defaultClassName:`react-aria-Checkbox`,values:{isSelected:f,isIndeterminate:e.isIndeterminate||!1,isPressed:h,isHovered:T,isFocused:v,isFocusVisible:b,isDisabled:p,isReadOnly:m,isInvalid:g,isRequired:e.isRequired||!1}}),D=a(e,{global:!0});return delete D.id,delete D.onClick,I.createElement(P.label,{...M(D,u,w,E),ref:t,slot:e.slot||void 0,"data-selected":f||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":h||void 0,"data-hovered":T||void 0,"data-focused":v||void 0,"data-focus-visible":b||void 0,"data-disabled":p||void 0,"data-readonly":m||void 0,"data-invalid":g||void 0,"data-required":e.isRequired||void 0},I.createElement(te,{elementType:`span`},I.createElement(`input`,{...M(d,x),ref:c})),E.children)}),yt=L({}),bt=L({});let xt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const St=ce(function(e,t){[e,t]=j(e,t,bt);let{hoverProps:n,isHovered:r}=he({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=ne({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=F({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return I.createElement(P.input,{...M(xt(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),Ct=L(null);function wt(e){let t=H({});return I.createElement(Ct.Provider,{value:t},e.children)}const Tt=L({isSelected:!1}),Et=L(null),Dt=L(null),Ot=L(null),kt=R(function(e,t){[e,t]=j(e,t,Et);let{validationBehavior:n}=l(mt)||{},r=e.validationBehavior??n??`native`,i=ft({...e,validationBehavior:r}),[o,s]=S(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:c,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=st({...e,label:s,validationBehavior:r},i),m=F({...e,values:{orientation:e.orientation||`vertical`,isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-RadioGroup`}),h=a(e,{global:!0});return I.createElement(P.div,{...M(h,m,c),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},I.createElement(_e,{values:[[Ot,i],[ue,{...u,ref:o,elementType:`span`}],[ct,{slots:{description:d,errorMessage:f}}],[Q,p]]},I.createElement(wt,null,m.children)))}),At=R(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=j(r,t,Dt);let i=I.useContext(Ot),o=y(V(()=>_(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:s,inputProps:c,isSelected:l,isDisabled:u,isPressed:d}=ot({...C(e),children:typeof e.children==`function`?!0:e.children},i,o),{isFocused:f,isFocusVisible:p,focusProps:m}=ne(),h=u||i.isReadOnly,{hoverProps:g,isHovered:v}=he({...e,isDisabled:h}),b=F({...e,defaultClassName:`react-aria-Radio`,values:{isSelected:l,isPressed:d,isHovered:v,isFocused:f,isFocusVisible:p,isDisabled:u,isReadOnly:i.isReadOnly,isInvalid:i.isInvalid,isRequired:i.isRequired}}),x=a(e,{global:!0});return delete x.id,delete x.onClick,I.createElement(P.label,{...M(x,s,g,b),ref:t,"data-selected":l||void 0,"data-pressed":d||void 0,"data-hovered":v||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":u||void 0,"data-readonly":i.isReadOnly||void 0,"data-invalid":i.isInvalid||void 0,"data-required":i.isRequired||void 0},I.createElement(te,{elementType:`span`},I.createElement(`input`,{...M(c,m),ref:o})),I.createElement(Tt.Provider,{value:{isSelected:l}},b.children))}),jt=L({});let Mt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const Nt=R(function(e,t){[e,t]=j(e,t,jt);let{hoverProps:n,isHovered:r}=he(e),{isFocused:i,isFocusVisible:a,focusProps:o}=ne({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=F({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-TextArea`});return I.createElement(P.textarea,{...M(Mt(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),Pt=L(null),Ft=ce(function(e,t){[e,t]=j(e,t,Pt);let{validationBehavior:n}=l(mt)||{},r=e.validationBehavior??n??`native`,i=H(null);[e,i]=j(e,i,x);let[o,s]=S(!e[`aria-label`]&&!e[`aria-labelledby`]),[c,u]=U(`input`),{labelProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=Qe({...C(e),inputElementType:c,label:s,validationBehavior:r},i),g=z(e=>{i.current=e,e&&u(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),_=F({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:h.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),v=a(e,{global:!0});return delete v.id,I.createElement(P.div,{...v,..._,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":h.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},I.createElement(_e,{values:[[ue,{...d,ref:o}],[bt,{...f,ref:g}],[jt,{...f,ref:g}],[yt,{role:`presentation`,isInvalid:h.isInvalid,isDisabled:e.isDisabled||!1}],[ct,{slots:{description:p,errorMessage:m}}],[Q,h]]},_.children))}),It=({title:e,description:t,classNames:n})=>{let{survey:r,dismiss:i}=f();if(!r)return null;let a=t||r.confirmation.description;return K(W,{children:[G(`div`,{className:q(`cf-question`,n?.question),children:K(`div`,{className:q(`cf-header`,n?.header),children:[G(N,{className:q(`cf-title`,n?.title),children:e||r.confirmation.title||`Feedback submitted!`}),a&&G(Z,{slot:`description`,className:q(`cf-description`,n?.description),children:a})]})}),G(A,{className:`cf-submit-button`,onPress:i,children:r.confirmation.buttonText||`Close`})]})},Lt=({children:e,classNames:t,containerProps:n,onDismiss:r,closeOnFinishMs:a=3e3})=>{let{surveyId:o,survey:s,dismiss:c}=f(),[l,u]=U(!1),[d,p]=U(!1),[m,h]=U(!1);return Te(()=>{s&&c()},l&&!(d||m)?a:null),K(`div`,{className:q(`confetti-dialog ${i}`,t?.dialog),id:`${o}-popover`,...n,onMouseEnter:e=>{n?.onMouseEnter?.(e),p(!0)},onMouseLeave:e=>{n?.onMouseLeave?.(e),p(!1)},onFocusCapture:e=>{n?.onFocusCapture?.(e),h(!0)},onBlurCapture:e=>{n?.onBlurCapture?.(e),e.currentTarget.contains(e.relatedTarget)||h(!1)},children:[G(pe,{className:q(`confetti-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await c(),r?.()}}),typeof e==`function`?e({setIsFinished:()=>u(!0)}):e]})},Rt=3e4;Rt/1e3;const zt=({maskAllInputs:e}={})=>{let[n,a]=U(null),[o,s]=U(!1),[c,l]=U(null),[u,d]=U(30),f=H(null),p=H(null),m=H(null),h=H([]);B(()=>{let e=new CustomEvent(r,{detail:{isRecording:o}});document.dispatchEvent(e)},[o]);let g=z(()=>{p.current&&=(clearInterval(p.current),null),m.current&&=(clearTimeout(m.current),null),f.current=null,d(Rt/1e3)},[]),_=z(()=>{f.current?.(),g(),s(!1),a(JSON.stringify(h.current))},[g]);return{recordingEventsJson:n,isRecording:o,recordingError:c,remainingSeconds:u,startRecording:z(async()=>{s(!0),l(null),a(null),h.current=[];try{let{record:n}=await import(`./record-CeeyzJpB.js`);f.current=n({slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0},sampling:{mousemove:50,scroll:100,input:`last`},emit:e=>{h.current.push(e)},blockClass:i,maskTextClass:t,maskAllInputs:e})??null;let r=Rt/1e3;d(r),p.current=setInterval(()=>{--r,d(r)},1e3),m.current=setTimeout(()=>{_()},Rt)}catch{l(`Failed to start recording. Please try again.`),s(!1),g()}},[e,_,g]),stopRecording:_,clear:z(()=>{g(),s(!1),a(null),l(null),h.current=[]},[g])}},Bt=e=>e.replace(/\S/g,`*`),Vt=e=>`*`.repeat(e.length),Ht=(e,t)=>{for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t(n):Ht(n,t)},Ut=e=>{if(e instanceof HTMLInputElement)e.setAttribute(`value`,Vt(e.getAttribute(`value`)??``));else if(e instanceof HTMLTextAreaElement)e.textContent=Vt(e.textContent);else if(e instanceof HTMLSelectElement)for(let t of e.querySelectorAll(`option`))t.textContent=Vt(t.textContent)},Wt=({maskInputs:e})=>({name:`cfti-redact`,afterClone:n=>{let{clone:r}=n;if(r instanceof HTMLElement){for(let e of r.querySelectorAll(`.${t}`)){Ht(e,e=>{e.data=Bt(e.data)}),Ut(e);for(let t of e.querySelectorAll(`input, textarea, select`))Ut(t)}if(e)for(let e of r.querySelectorAll(`input, textarea, select`))Ut(e)}}}),Gt=({maskAllInputs:e}={})=>{let[t,n]=U(null),[r,a]=U(!1),[o,s]=U(null);return{screenshotDataUrl:t,isCapturing:r,captureError:o,capture:z(async()=>{a(!0),s(null);try{let{snapdom:t}=await import(`./snapdom-VnBlM9vL.js`),r=await(await t(document.documentElement,{embedFonts:!0,exclude:[`.${i}`],excludeMode:`hide`,plugins:[Wt({maskInputs:!!e})],fast:!1})).toCanvas(),a=window.devicePixelRatio||1,o=Math.min(Math.round(window.innerWidth*a),r.width),s=Math.min(Math.round(window.innerHeight*a),r.height),c=document.createElement(`canvas`);c.width=o,c.height=s;let l=c.getContext(`2d`);if(!l)throw Error(`Failed to get 2D context for cropping`);l.drawImage(r,0,0,o,s,0,0,o,s),n(c.toDataURL(`image/png`))}catch{s(`Failed to capture screenshot. Please try again.`)}finally{a(!1)}},[e]),clear:z(()=>{n(null),s(null)},[])}},Kt=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[G(`circle`,{cx:`12`,cy:`12`,r:`10`}),G(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`})]}),qt=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[G(`path`,{d:`M10 11v6`}),G(`path`,{d:`M14 11v6`}),G(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),G(`path`,{d:`M3 6h18`}),G(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]});function Jt(){if(window.DD_RUM&&typeof window.DD_RUM?.getInternalContext==`function`&&typeof window.DD_RUM?.getSessionReplayLink==`function`)try{let e=window.DD_RUM?.getInternalContext?.(),t=window.DD_RUM?.getSessionReplayLink?.();return{sessionId:e?.session_id,sessionReplayLink:t}}catch{return null}return null}function Yt(){if(typeof window>`u`||typeof navigator>`u`)return;let e=navigator,t=window.screen,n=Jt();return{userAgent:e.userAgent,screenResolution:`${t.width}x${t.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,language:e.language,timestamp:new Date().toISOString(),datadogTraceId:n?.traceId,datadogSessionId:n?.sessionId,datadogSessionReplayLink:n?.sessionReplayLink}}const Xt=xe(()=>import(`./RecordingReplayer-CKYzAfYD.js`)),Zt=({id:e,title:t,description:n,properties:r,onChange:i,required:a,error:o,classNames:s,maskAllInputs:c})=>{let l=V(()=>Yt(),[]),[u,d]=U(``),[f,p]=U(``),{screenshotDataUrl:m,isCapturing:h,captureError:g,capture:_,clear:v}=Gt({maskAllInputs:c}),{recordingEventsJson:y,isRecording:b,recordingError:x,remainingSeconds:S,startRecording:C,stopRecording:w,clear:T}=zt({maskAllInputs:c}),E=V(()=>({title:u,...f?{description:f}:{},...m?{screenshotDataUrl:m}:{},...y?{recordingEventsJson:y}:{},metadata:l}),[f,l,y,m,u]);B(()=>{i(E)},[E,i]),B(()=>()=>{w()},[w]);let D=V(()=>y?JSON.parse(y):[],[y]);return G(W,{children:b?K(A,{className:q(`cf-bug-report-button`,`cf-bug-report-record-button`,s?.button,s?.recordButton),onPress:w,children:[G(Kt,{}),K(`span`,{children:[30-S,`s /`,` `,30,`s`]})]}):K(`div`,{className:q(`cf-bug-report`,s?.base),children:[K(Ft,{isRequired:a,isInvalid:!!o,name:`${e}-title`,value:u,onChange:d,className:q(`cf-question`,s?.question),children:[K(`div`,{className:q(`cf-header`,s?.header),children:[K(N,{className:q(`cf-title`,s?.title),children:[t,!a&&K(`span`,{className:q(`cf-label-optional`,s?.optionalLabel),children:[` `,`(optional)`]})]}),n&&G(Z,{slot:`description`,className:q(`cf-description`,s?.description),children:n})]}),G(St,{placeholder:r.placeholder||`Brief description of the issue`,className:q(`cf-input`,s?.input)})]}),K(Ft,{name:`${e}-description`,value:f,onChange:p,className:q(`cf-question`,s?.question),children:[G(N,{className:q(`cf-title`,s?.title),children:r.detailsLabel}),G(Nt,{placeholder:r.detailsPlaceholder||`Steps to reproduce, expected vs actual behavior, etc.`,className:q(`cf-textarea`,s?.textArea),rows:4})]}),r.enableScreenshot||r.enableRecording?K(`section`,{className:q(`cf-question`,s?.question),children:[G(N,{className:q(`cf-title`,s?.title),children:`Attachments`}),K(`div`,{className:q(`cf-bug-report-actions`,s?.actions),children:[r.enableScreenshot&&K(`div`,{className:q(`cf-bug-report-screenshot-section`,s?.screenshotSection),children:[m?K(`div`,{className:q(`cf-bug-report-media-preview`,s?.mediaPreview),children:[G(`img`,{src:m,alt:`Screenshot preview`,className:q(`cf-bug-report-screenshot-img`,s?.screenshotImg)}),G(`div`,{className:q(`cf-bug-report-media-actions`,s?.mediaActions),children:G(A,{className:q(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:v,"aria-label":`Remove screenshot`,children:G(qt,{})})})]}):G(A,{className:q(`cf-bug-report-button`,s?.button),onPress:_,isDisabled:h,children:h?`Capturing...`:`Screenshot`}),g&&G(`div`,{className:q(`cf-error`,s?.error),children:g})]}),r.enableRecording&&K(`div`,{className:q(`cf-bug-report-recording-section`,s?.recordingSection),children:[D.length>0?K(`div`,{className:q(`cf-bug-report-media-preview`,s?.mediaPreview),children:[G(be,{fallback:G(`span`,{className:q(`cf-bug-report-player-loading`,s?.playerLoading),"aria-label":`Loading recording preview...`}),children:G(Xt,{events:D})}),G(`div`,{className:q(`cf-bug-report-media-actions`,s?.mediaActions),children:G(A,{className:q(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:T,"aria-label":`Remove recording`,children:G(qt,{})})})]}):G(A,{className:q(`cf-bug-report-button`,s?.button),onPress:C,children:`Record`}),x&&G(`div`,{className:q(`cf-error`,s?.error),children:x})]})]})]}):null,G($,{className:q(`cf-error`,s?.error),children:o})]})})},Qt=({id:e,title:t,description:n,properties:r,onChange:i,classNames:a,required:o,error:s})=>{let[c,l]=U(``);return B(()=>{i(c)},[i,c]),K(Ft,{isRequired:o,isInvalid:!!s,name:e,className:q(`cf-question`,a?.question),value:c,onChange:e=>{l(e),i(e)},children:[K(`div`,{className:q(`cf-header`,a?.header),children:[K(N,{className:q(`cf-title`,a?.title),children:[t,!o&&K(`span`,{className:q(`cf-label-optional`,a?.optionalLabel),children:[` `,`(optional)`]})]}),n&&G(Z,{slot:`description`,className:q(`cf-description`,a?.description),children:n})]}),G(Nt,{className:q(`cf-textarea`,a?.textarea),maxLength:r.max,rows:4,placeholder:r.placeholder||`Start typing...`}),G($,{className:q(`cf-error`,a?.error),children:s})]})},$t=({children:e,classNames:t,description:n,...r})=>G(vt,{...r,children:({isIndeterminate:r})=>K(W,{children:[K(`div`,{className:q(`cf-choice-label`,t?.label),children:[G(`div`,{className:q(`cf-checkbox-indicator`,t?.indicator),children:G(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:q(`cf-checkbox-indicator-svg`,t?.svg),children:r?G(`rect`,{x:1,y:7.5,width:16,height:3}):G(`polyline`,{points:`2 9 7 14 16 4`})},r?`indeterminate`:`check`)}),e]}),n&&G(`span`,{className:q(`cf-choice-description`,t?.choiceDescription),children:n})]})}),en=({children:e,classNames:t,...n})=>G(vt,{...n,children:G(`div`,{className:q(`cf-tag-label`,t?.tagLabel),children:e})}),tn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let c=!!n.editable,l=n.display??`checkbox`,[u,d]=U([]),[f,p]=U(``),m=H(null),h=H(null),g=V(()=>{let e=u.indexOf(O);if(e===-1)return u;let t=[...u];return t[e]=f||O,t},[f,u]),_=l===`tag`;return B(()=>{i(g)},[i,g]),G(_t,{isRequired:o,isInvalid:!!s,name:a,value:u,onChange:d,className:q(`cf-question`,r?.question),children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(N,{className:q(`cf-title`,r?.title),children:[e,!o&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&G(Z,{slot:`description`,className:q(`cf-description`,r?.description),children:t})]}),K(`div`,{className:q(`cf-response-choices`,l===`tag`&&`cf-response-choices-tag`,r?.group),children:[n.options.map((e,t)=>G(_?en:$t,{className:q(`cf-choice`,_&&[`cf-tag`,r?.tag],!_&&[`cf-checkbox`,r?.checkbox]),description:e.description,value:e.value,classNames:{tag:r?.tag,tagLabel:r?.tagLabel,choiceDescription:r?.choiceDescription,label:r?.label,indicator:r?.indicator,svg:r?.svg},children:e.value},t)),c&&(_?K(W,{children:[G(en,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:q(`cf-choice cf-tag`,r?.tag),value:O,children:n.editable?.label}),G(St,{"data-visible":i.value.includes(O)||void 0,value:f,onChange:e=>{p(e.target.value)},ref:h,className:q(`cf-input cf-tag-input`,r?.othersInput)})]}):K(`div`,{className:q(`cf-choice cf-others-choice`,r?.othersChoice),children:[G($t,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:q(`cf-checkbox`,r?.checkbox),value:O,classNames:{indicator:r?.indicator,svg:r?.svg},description:n.editable?.description,children:n.editable?.label}),G(St,{value:f,onChange:e=>{p(e.target.value)},tabIndex:i.value.includes(O)?0:-1,ref:h,onFocus:()=>{m.current?.checked===!1&&m.current.click()},className:q(`cf-input`,r?.othersInput)})]}))]}),G($,{className:q(`cf-error`,r?.error),children:s})]})})},nn=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[G(`circle`,{cx:12,cy:12,r:10}),G(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M7.5 8 10 9M14 9l2.5-1M9 10h.01M15 10h.01`})]}),rn=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[G(`circle`,{cx:12,cy:12,r:10}),G(`path`,{d:`M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12ZM9 9h.01M15 9h.01`})]}),an=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[G(`circle`,{cx:12,cy:12,r:10}),G(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M9 9h.01M15 9h.01`})]}),on=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[G(`circle`,{cx:12,cy:12,r:10}),G(`path`,{d:`M8 15h8M9 9h.01M15 9h.01`})]}),sn=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[G(`circle`,{cx:12,cy:12,r:10}),G(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01`})]}),cn=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:40,height:40,fill:`none`,...e,children:G(`path`,{fill:`currentColor`,d:`m6.516 14.323-1.49 6.452a.998.998 0 0 0 1.529 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082a1 1 0 0 0-.59-1.74l-5.701-.454-2.467-5.461a.998.998 0 0 0-1.822 0L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.214 4.107zm2.853-4.326a.998.998 0 0 0 .832-.586L12 5.43l1.799 3.981a.998.998 0 0 0 .832.586l3.972.315-3.271 2.944c-.284.256-.397.65-.293 1.018l1.253 4.385-3.736-2.491a.995.995 0 0 0-1.109 0l-3.904 2.603 1.05-4.546a1 1 0 0 0-.276-.94l-3.038-2.962 4.09-.326z`})}),ln=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,...e,children:G(`path`,{fill:`currentColor`,d:`M21.947 9.179a1.001 1.001 0 0 0-.868-.676l-5.701-.453-2.467-5.461a.998.998 0 0 0-1.822-.001L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.213 4.107-1.49 6.452a1 1 0 0 0 1.53 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082c.297-.268.406-.686.278-1.065z`})}),un=({state:e,properties:t,classNames:n})=>{let r=e.selectedValue?Number(e.selectedValue):null;return G(`div`,{className:q(`cf-rating-display-star`,n?.ratingDisplayStar),children:Array.from({length:t.scale},(e,t)=>{let i=t+1,a=String(i),o=r&&i<=r;return G(At,{className:q(`cf-rating-star`,n?.ratingStar),value:a,"data-filled":o?`true`:void 0,children:G(o?ln:cn,{})},t)})})},dn=({properties:e,classNames:t})=>G(`div`,{className:q(`cf-rating-display-number`,t?.ratingDisplayNumber),children:Array.from({length:e.scale},(e,n)=>{let r=n+1,i=String(r);return G(At,{className:q(`cf-rating-number`,t?.ratingNumber),value:i,children:r},n)})}),fn=({properties:e,classNames:t,state:n})=>{let r=V(()=>[nn,an,on,sn,rn],[]),i=V(()=>[an,on,sn],[]);return V(()=>e.scale===3||e.scale===5,[e.scale])?G(`div`,{className:q(`cf-rating-display-emoji`,t?.ratingDisplayEmoji),children:Array.from({length:e.scale},(n,a)=>{let o=a+1,s=String(o),c=e.scale===5?r[a]:i[a];return G(At,{className:q(`cf-rating-emoji`,t?.ratingEmoji),value:s,children:c&&G(c,{})},a)})}):G(dn,{properties:e,classNames:t,state:n})},pn=e=>{switch(e.properties.display??`star`){case`emoji`:return G(fn,{...e});case`number`:return G(dn,{...e});case`star`:return G(un,{...e})}},mn=({properties:e,title:t,description:n,classNames:r,onChange:i,id:a,error:o,required:s})=>{let[c,l]=U(null),u=V(()=>c?Number(c):void 0,[c]);return B(()=>{i(u)},[i,u]),G(kt,{isRequired:s,isInvalid:!!o,name:a,className:q(`cf-question`,r?.question),value:c,onChange:l,children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(N,{className:q(`cf-title`,r?.title),children:[t,!s&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),n&&G(Z,{slot:`description`,className:q(`cf-description`,r?.description),children:n})]}),K(`div`,{className:q(`cf-rating-section`,r?.ratingSection),children:[G(pn,{state:i,properties:e,classNames:r}),K(`div`,{className:q(`cf-rating-text`,r?.ratingText),children:[G(`span`,{className:q(`cf-rating-text-lower`,r?.ratingTextLower),children:e.labels?.lower}),G(`span`,{className:q(`cf-rating-text-upper`,r?.ratingTextUpper),children:e.labels?.upper})]})]}),G($,{className:q(`cf-error`,r?.error),children:o})]})})},hn=({classNames:e,className:t,description:n,...r})=>G(At,{...r,className:q(t,e?.radio),children:s(r.children,t=>K(W,{children:[K(`div`,{className:q(`cf-choice-label`,e?.label),children:[G(`div`,{className:q(`cf-radio-indicator`,e?.indicator)}),t]}),n&&G(`span`,{className:q(`cf-choice-description`,e?.choiceDescription),children:n})]}))}),gn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let[c,l]=U(null),[u,d]=U(``),f=!!n.editable,p=H(null),m=H(null),h=V(()=>c===D?u||D:c??void 0,[u,c]);return B(()=>{i(h)},[i,h]),G(kt,{isRequired:o,isInvalid:!!s,name:a,onChange:e=>{l(e),e===D&&requestAnimationFrame(()=>{m.current&&m.current.focus()})},value:c,className:q(`cf-question`,r?.question),children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(N,{className:q(`cf-title`,r?.title),children:[e,!o&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&G(Z,{slot:`description`,className:q(`cf-description`,r?.description),children:t})]}),K(`div`,{className:q(`cf-response-choices`,r?.group),children:[n.options.map((e,t)=>G(hn,{classNames:{indicator:r?.indicator,radio:q(`cf-choice cf-radio`,r?.radio)},value:e.value,description:e.description,children:e.value},t)),f&&K(`div`,{className:q(`cf-choice cf-others-choice`,r?.othersChoice),children:[G(hn,{inputRef:p,value:D,classNames:{indicator:r?.indicator,radio:q(`cf-radio`,r?.radio)},description:n.editable?.description,children:n.editable?.label}),G(St,{tabIndex:i.selectedValue===D?0:-1,ref:m,value:u,onChange:e=>d(e.target.value),onFocus:()=>{p.current?.checked===!1&&p.current.click()},className:q(`cf-input`,r?.othersInput)})]})]}),G($,{className:q(`cf-error`,r?.error),children:s})]})})},_n=({properties:e,title:t,description:n,classNames:r})=>G(`div`,{className:q(`cf-question`,r?.question),children:K(`div`,{className:q(`cf-header`,r?.header),children:[t&&G(`div`,{className:q(`cf-title`,r?.title),children:t}),n&&G(`div`,{className:q(`cf-description`,r?.description),children:n})]})}),vn=({question:e,onChange:t,error:n,maskAllInputs:r})=>{switch(e.properties.type){case`rating`:return G(mn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`open-ended`:return G(Qt,{...e,properties:e.properties,onChange:t,error:n},e.id);case`single-select`:return G(gn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`multi-select`:return G(tn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`statement`:return G(_n,{...e,properties:e.properties,onChange:t,error:n},e.id);case`bug-report`:return G(Zt,{...e,properties:e.properties,onChange:t,error:n,maskAllInputs:r},e.id)}return G(`div`,{children:`Unsupported question type`},e.id)},yn=({onPress:e,isDisabled:t,children:n=`Submit`})=>oe()?null:G(A,{isDisabled:t,className:`cf-submit-button`,onPress:e,children:n}),bn=e=>{switch(e){case`multi-select`:return[];case`bug-report`:return{title:``};case`statement`:return;default:return``}},xn=e=>e!==void 0&&e!==``&&!(Array.isArray(e)&&e.length===0),Sn=({onSubmit:t,children:n,question:r,isLastQuestion:i})=>{let[a,o]=U(bn(r.properties.type)),s=V(()=>Oe(r.properties,{required:r.required}),[r.properties,r.required]),c=V(()=>{let e=s.safeParse(a);if(!e.success)return De(e.error)},[a,s]),l=V(()=>{let t=r.routingLogic;if(t.type!==`always`&&!xn(a)&&r.required)return!0;let n=t.type===`always`?t.target:t.cases.find(t=>e({answer:a,condition:t}))?.target??t.default;return n.type===`end`?!1:n.type===`next`?!i:!0},[a,i,r.required,r.routingLogic]),u=V(()=>r.properties.buttonLabel?r.properties.buttonLabel:l?!r.required&&!xn(a)?`Skip`:`Next`:`Submit`,[a,l,r.properties.buttonLabel,r.required]),d=z(()=>{switch(r.properties.type){case`statement`:if(r.properties.buttonUrl&&typeof window<`u`){let e=ee.safeParse(r.properties.buttonUrl).data;e&&window.open(e,`_blank`)}return t(void 0);default:return t(a)}},[a,t,r.properties]),f=V(()=>{switch(r.properties.type){case`rating`:case`single-select`:return!!r.properties.shouldAutoProgress;default:return!1}},[r.properties]);return K(W,{children:[n({onChange:z(e=>{o(e),f&&xn(e)&&s.safeParse(e).success&&t(e)},[f,s,t]),question:r,error:c}),(!f||!r.required)&&G(yn,{isDisabled:!!c,onPress:d,children:u})]})},Cn=({isCompleted:e,onSubmit:t,children:n})=>K(W,{children:[n,e&&G(yn,{onPress:t})]}),wn=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 44 38`,...e,children:K(`g`,{transform:`translate(-2 -2) scale(1.1)`,children:[G(`path`,{d:`M16.8395 3.2139C8.2208 3.9522 1.8331 11.5311 2.5721 20.1416C3.3111 28.7523 10.897 35.134 19.5157 34.3956L27.1631 33.7406C28.9787 33.585 30.6949 33.1248 32.2669 32.4163L38.7663 35.4396C39.3254 35.6994 39.9048 35.1205 39.6447 34.562L37.0707 29.0396C40.1147 25.8995 41.8336 21.5102 41.4304 16.8128C40.6913 8.2022 33.1054 1.8205 24.4867 2.5588L16.8395 3.2139Z`,fill:`#BAE6FD`}),G(`path`,{d:`M19.6764 24.0307C19.6764 24.0307 20.9773 25.4496 23.5438 25.1228C26.1103 24.7959 27.3642 23.0095 27.3642 23.0095`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`}),G(`path`,{d:`M18.0861 16.4082C18.0861 16.4082 17.1255 18.619 14.8183 18.9139C12.5111 19.2088 11.1697 17.237 11.1697 17.237`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`}),G(`path`,{d:`M32.6296 15.0398C32.6296 15.0398 31.6691 17.2506 29.3619 17.5455C27.0548 17.8404 25.7132 15.8686 25.7132 15.8686`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`})]})}),Tn=({onClick:e,isWidgetOpen:t,classNames:n,label:r=`Help us improve`})=>t?null:K(A,{onPress:e,className:q(`confetti-trigger`,n?.trigger),children:[G(`span`,{className:q(`confetti-trigger-icon-wrapper`,n?.iconWrapper),"aria-hidden":!0,children:G(wn,{className:q(`confetti-trigger-icon`,n?.icon),width:24})}),G(`span`,{className:q(`confetti-trigger-label`,n?.label),children:r})]}),En=({trigger:e,children:t,publishableKey:n,surveyId:r})=>{let i=f(),[a,s]=U(!1),[c,l]=U(!1);if(!i.isVisible)return null;let u=()=>{s(!1)};return K(W,{children:[e({onClick:()=>s(!0),isWidgetOpen:a,hasSubmitted:c}),a&&G(o.Provider,{value:{...i,dismiss:()=>{i.dismiss(),u()},submit:async e=>{let t=await i.submit(e);return l(!0),t}},children:t({onDismiss:u,surveyId:r,publishableKey:n})})]})},Dn=({trigger:e=e=>G(Tn,{...e}),children:t,...n})=>G(ye,{fallback:G(W,{}),children:G(T,{...n,alwaysRenderChildren:!0,children:G(En,{trigger:e,surveyId:n.surveyId,publishableKey:n.publishableKey,children:t})})}),On=e=>G(Pe,{...e,shouldAutoSubmit:!1,children:({questions:t,update:n,isCompleted:r,submit:i,isSubmitted:a,errors:o})=>a?G(It,{}):G(Cn,{onSubmit:i,isCompleted:r,children:t.filter(({visible:e})=>!!e).map(t=>G(vn,{question:t,error:o[t.id]||``,maskAllInputs:e.options?.bugReport?.maskAllInputs,onChange:e=>n({question:t.position,answer:e})},t.position))})}),kn=({onDismiss:e,closeOnFinishMs:t,isDismissable:n,...r})=>G(ye,{fallback:G(W,{}),children:G(T,{...r,children:G(me,{onDismiss:e,closeOnFinishMs:t,isDismissable:n,children:({setIsFinished:e})=>G(Ne,{...r,shouldAutoSubmit:!1,onFinished:()=>{e(),r.onFinished?.()},children:({questions:e,update:t,isCompleted:n,errors:i,submit:a,isSubmitted:o})=>o?G(It,{}):G(Cn,{onSubmit:a,isCompleted:n,children:e.filter(({visible:e})=>!!e).map(e=>G(vn,{question:e,error:i[e.id]||``,maskAllInputs:r.options?.bugReport?.maskAllInputs,onChange:n=>t({question:e.position,answer:n})},e.position))})})})})}),An=({onDismiss:e,closeOnFinishMs:t,...n})=>G(ye,{fallback:G(W,{}),children:G(T,{...n,children:G(Lt,{onDismiss:e,closeOnFinishMs:t,children:({setIsFinished:e})=>G(Ne,{shouldAutoSubmit:!0,...n,onFinished:()=>{e(),n.onFinished?.()},children:({current:e,questions:t,update:r,isSubmitted:i})=>{let a=e===t.length-1;if(i)return G(It,{});let o=t[e];return o?G(Sn,{isLastQuestion:a,question:o,onSubmit:t=>r({question:e,answer:t}),children:e=>G(vn,{maskAllInputs:n.options?.bugReport?.maskAllInputs,...e})}):G(W,{})}})})})}),jn=e=>G(Pe,{...e,shouldAutoSubmit:!0,children:({current:t,questions:n,update:r,isSubmitted:i})=>{let a=t===n.length-1;if(i)return G(It,{});let o=n[t];return o?G(Sn,{isLastQuestion:a,question:o,onSubmit:e=>r({question:t,answer:e}),children:t=>G(vn,{maskAllInputs:e.options?.bugReport?.maskAllInputs,...t})}):G(W,{})}}),Mn=({delay:e})=>{let[t,n]=U(!1),r=V(()=>e,[]);return B(()=>{let e=setTimeout(()=>{n(!0)},r);return()=>clearTimeout(e)},[]),{isVisible:t}},Nn=({visits:e,respondent:t})=>{let[n,r]=Ce(`cfti:${V(()=>window.location.pathname,[])}:visits:${t??``}`,0);return B(()=>{r(e=>e+1)},[r]),{isVisible:n>=e,reset:z(()=>r(0),[r])}},Pn=({visits:e,respondent:t})=>{let[n,r]=we(`cfti:${V(()=>window.location.pathname,[])}:visits:${t??``}`,0);return B(()=>{r(e=>e+1)},[r]),{isVisible:n>=e,reset:z(()=>r(0),[r])}},Fn=({threshold:e})=>{let[t,n]=U(()=>typeof window>`u`?!1:window.scrollY>=e);return B(()=>{let t=()=>{window.scrollY>=e&&n(!0)};return window.addEventListener(`scroll`,t,{passive:!0}),()=>window.removeEventListener(`scroll`,t)},[e]),{isVisible:t}};export{pe as CloseButton,Pe as Confetti,o as ConfettiContext,Ne as ConfettiController,T as ConfettiProvider,Dn as ConfettiTrigger,wn as ConfettiTriggerIcon,Tn as DefaultConfettiTrigger,Cn as Embed,On as EmbeddedConfetti,Sn as Flow,Qt as FreeText,kn as ModalConfetti,me as ModalContainer,tn as MultiChoice,An as PopoverConfetti,Lt as PopoverContainer,mn as Rating,gn as SingleChoice,_n as Statement,jn as StepperConfetti,vn as SurveyQuestionFactory,It as ThankYouMessage,f as useConfetti,Mn as useVisibleAfterDelay,Nn as useVisibleAfterPageVisits,Fn as useVisibleAfterScroll,Pn as useVisibleAfterSessionPageVisits};
|
|
1
|
+
import{a as e,n as t,o as n,r,t as i}from"./internals-Dzl6abGJ.js";import{A as a,B as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,O as y,P as b,Q as x,R as S,S as C,T as w,U as T,V as E,W as D,X as O,Y as ee,Z as k,_ as A,a as j,b as M,c as te,d as ne,f as re,g as ie,h as ae,i as oe,j as N,k as se,l as ce,m as le,o as ue,p as de,q as fe,r as pe,s as P,t as me,u as he,v as ge,w as F,x as I,y as _e,z as ve}from"./ModalContainer-b9Zgg8fN.js";import{ErrorBoundary as ye}from"react-error-boundary";import L,{Suspense as be,createContext as R,forwardRef as z,lazy as xe,useCallback as B,useContext as Se,useEffect as V,useMemo as H,useRef as U,useState as W}from"react";import{useLocalStorage as Ce,useSessionStorage as we,useTimeout as Te}from"usehooks-ts";import{Fragment as G,jsx as K,jsxs as q}from"react/jsx-runtime";import J from"clsx";import{flushSync as Ee}from"react-dom";function De(e){return e.issues[0]?.message??`Invalid input`}const Y={rating:({scale:e},t)=>fe({scale:e},t),"open-ended":({max:e},t)=>h({maxLength:e},t),"single-select":({editable:e},t)=>m({maxLength:e?.max},t),"multi-select":({editable:e,max:t},n)=>d({maxLength:e?.max,maxSelected:t},n),statement:(e,t)=>ee(),"bug-report":(e,t)=>D({},t)},Oe=(e,t)=>{let n=e.type;switch(n){case`rating`:{let r=Y[n];return r(e,t)}case`open-ended`:{let r=Y[n];return r(e,t)}case`single-select`:{let r=Y[n];return r(e,t)}case`multi-select`:{let r=Y[n];return r(e,t)}case`statement`:{let r=Y[n];return r(e,t)}case`bug-report`:{let r=Y[n];return r(e,t)}default:throw Error(`Unsupported question type`)}},ke=({originalQuestions:e,answers:t,errors:r,pointer:i=-1})=>{if(!e)return{questions:[],currentIndex:-1};let a=e.sort((e,t)=>e.position-t.position).map(e=>{let t={...e},n=r[e.id];return n&&(t.error=n),{...t,visible:!1}});for(let e=0;e<a.length;e++){let r=a[e];if(!r)continue;let o=n({index:e,questions:a,answers:t});r.visible=i===e||o}let o=a.findIndex((e,n)=>n>i&&e.visible&&t[e.id]===void 0);return o===-1&&(o=a.findLastIndex(e=>!!e.visible)),{questions:a,currentIndex:o}},Ae=({questions:e,answers:t})=>{let n=je({questions:e,answers:t});return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==null))},je=({questions:e,answers:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Me=({questions:e,errors:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Ne=({current:e,shouldAutoSubmit:t,onFinished:n,children:r})=>{let{survey:a,submit:o}=f(),[s,c]=W({}),[l,u]=W({}),d=H(()=>ke({originalQuestions:a?.questions,answers:s,errors:l,pointer:e}),[a?.questions,s,l,e]),p=H(()=>!!d.questions.filter(({required:e,visible:t})=>!!e&&!!t).every(({id:e})=>s[e]!==void 0),[s,d.questions]),[m,h]=W(!1),g=B(({answers:e})=>{o({answers:e}).finally(()=>{n?.()})},[n,o]),_=B(()=>{g({answers:Ae({questions:d.questions,answers:s})}),h(!0)},[s,d.questions,g]),v=B(({question:n,answer:r})=>{let i=d.questions.at(n);if(!i)return{error:`Question index is invalid`};let o=Oe(i.properties,{required:i.required}).safeParse(r);if(!o.success){let e=De(o.error);return u(t=>{if(t[i.id]===e)return t;let n={...t};return n[i.id]=e,n}),c(e=>{if(!(i.id in e))return e;let t={...e};return delete t[i.id],t}),{error:e}}u(e=>{if(!e[i.id])return e;let t={...e};return delete t[i.id],t});let f=!i.required&&!r?null:r,p={...s};if(p[i.id]===f)return{next:ke({originalQuestions:a?.questions,answers:p,errors:l,pointer:e}).currentIndex};p[i.id]=f;let m=ke({originalQuestions:a?.questions,answers:p,errors:l,pointer:e});return p=je({questions:m.questions,answers:p}),c(p),u(Me({questions:m.questions,errors:l})),m.questions.filter(({visible:e})=>!!e).every(({id:e})=>p[e]!==void 0)&&t&&(g({answers:Ae({questions:m.questions,answers:p})}),h(!0)),{next:m.currentIndex}},[d.questions,s,a?.questions,l,t,e,g]);return d.questions.length===0?K(G,{}):K(`div`,{className:`confetti ${i}`,children:r({questions:d.questions,current:e??d.currentIndex,update:v,isCompleted:p,submit:_,isSubmitted:m,errors:l})})},Pe=({children:e,onFinished:t,shouldAutoSubmit:n,...r})=>K(ye,{fallback:K(G,{}),children:K(E,{...r,children:K(Ne,{shouldAutoSubmit:n,onFinished:t,children:e})})});function Fe(e,t,n){let r=c(e=>{n&&!e.defaultPrevented&&n(t)});V(()=>{let t=e?.current?.form;return t?.addEventListener(`reset`,r),()=>{t?.removeEventListener(`reset`,r)}},[e])}function Ie(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a=`label`}=e;t=p(t);let o=p(),s={};n&&(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a===`label`?t:void 0});let c=se({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:c}}function Le(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=Ie(e),s=u([!!t,!!n,r,i]),c=u([!!t,!!n,r,i]);return o=N(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}function Re(e,t,n){let{validationBehavior:r,focus:i}=e;g(()=>{if(r===`native`&&n?.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(Be(n.current))}});let a=U(!1),o=c(()=>{a.current||t.resetValidation()}),s=c(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&Ve(r)===n.current&&(i?i():n.current?.focus(),ie(`keyboard`)),e.preventDefault()}),l=c(()=>{t.commitValidation()});V(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&v(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,l),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,l),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function ze(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function Be(e){return{isInvalid:!e.validity.valid,validationDetails:ze(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function Ve(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}const He={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Ue={...He,customError:!0,valid:!1},X={isInvalid:!1,validationDetails:He,validationErrors:[]},We=R({}),Ge=`__reactAriaFormValidationState`;function Z(e){if(e[Ge]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Ge];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return Ke(e)}function Ke(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:Ue},l=H(()=>!o||i==null?null:Ye(Je(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=Se(We),d=H(()=>r?Array.isArray(r)?r.flatMap(e=>qe(u[e])):qe(u[r]):[],[u,r]),[f,p]=W(u),[m,h]=W(!1);u!==f&&(p(u),h(!1));let g=H(()=>Ye(m?[]:d),[m,d]),_=U(X),[v,y]=W(X),b=U(X),x=()=>{if(!S)return;C(!1);let e=l||a||_.current;Xe(e,b.current)||(b.current=e,y(e))},[S,C]=W(!1);return V(x),{realtimeValidation:c||g||l||a||X,displayValidation:s===`native`?c||g||v:c||g||l||a||v,updateValidation(e){s===`aria`&&!Xe(v,e)?y(e):_.current=e},resetValidation(){let e=X;Xe(e,b.current)||(b.current=e,y(e)),s===`native`&&C(!1),h(!0)},commitValidation(){s===`native`&&C(!0),h(!0)}}}function qe(e){return e?Array.isArray(e)?e:[e]:[]}function Je(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return qe(n)}return[]}function Ye(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Ue}:null}function Xe(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function Ze(...e){let t=new Set,n=!1,r={...He};for(let i of e){for(let e of i.validationErrors)t.add(e);for(let e in n||=i.isInvalid,r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function Qe(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:o=!1,type:s=`text`,validationBehavior:c=`aria`}=e,[l,u]=de(e.value,e.defaultValue||``,e.onChange),{focusableProps:d}=le(e,t),f=Z({...e,value:l}),{isInvalid:p,validationErrors:m,validationDetails:h}=f.displayValidation,{labelProps:g,fieldProps:_,descriptionProps:y,errorMessageProps:b}=Le({...e,isInvalid:p,errorMessage:e.errorMessage||m}),x=a(e,{labelable:!0}),S={type:s,pattern:e.pattern},[C]=W(l);return Fe(t,e.defaultValue??C,u),Re(e,f,t),{labelProps:g,inputProps:N(x,n===`input`?S:void 0,{disabled:r,readOnly:o,required:i&&c===`native`,"aria-required":i&&c===`aria`||void 0,"aria-invalid":p||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:l,onChange:e=>u(v(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(L.version,10)>=17?`enterKeyHint`:`enterkeyhint`]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...d,..._}),descriptionProps:y,errorMessageProps:b,isInvalid:p,validationErrors:m,validationDetails:h}}function $e(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:o,name:s,form:c,children:l,"aria-label":u,"aria-labelledby":d,validationState:f=`valid`,isInvalid:p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b}=e,x=e=>{e.stopPropagation(),t.setSelected(v(e).checked)},{pressProps:S,isPressed:C}=A({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:y,onClick:b,isDisabled:r}),{pressProps:w,isPressed:T}=A({onPressStart:m,onPressEnd:h,onPressChange:g,onPressUp:y,onClick:b,onPress(e){_?.(e),t.toggle(),n.current?.focus()},isDisabled:r||i}),{focusableProps:E}=le(e,n),D=N(S,E),O=a(e,{labelable:!0});return Fe(n,t.defaultSelected,t.setSelected),{labelProps:N(w,{onClick:e=>e.preventDefault()}),inputProps:N(O,{"aria-invalid":p||f===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,onChange:x,disabled:r,...o==null?{}:{value:o},name:s,form:c,type:`checkbox`,...D}),isSelected:t.isSelected,isPressed:C||T,isDisabled:r,isReadOnly:i,isInvalid:p||f===`invalid`}}function et(e,t,n){let r=Z({...e,value:t.isSelected}),{isInvalid:i,validationErrors:a,validationDetails:o}=r.displayValidation,{labelProps:s,inputProps:c,isSelected:l,isPressed:u,isDisabled:d,isReadOnly:f}=$e({...e,isInvalid:i},t,n);Re(e,r,n);let{isIndeterminate:p,isRequired:m,validationBehavior:h=`aria`}=e;V(()=>{n.current&&(n.current.indeterminate=!!p)});let{pressProps:g}=A({isDisabled:d||f,onPress(){let{[Ge]:t}=e,{commitValidation:n}=t||r;n()}});return{labelProps:N(s,g,H(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:{...c,checked:l,"aria-required":m&&h===`aria`||void 0,required:m&&h===`native`},isSelected:l,isPressed:u,isDisabled:d,isReadOnly:f,isInvalid:i,validationErrors:a,validationDetails:o}}const tt=new WeakMap;function nt(e,t){let{isDisabled:n,name:r,form:i,validationBehavior:o=`aria`}=e,{isInvalid:s,validationErrors:c,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:d,descriptionProps:f,errorMessageProps:p}=Le({...e,labelElementType:`span`,isInvalid:s,errorMessage:e.errorMessage||c});tt.set(t,{name:r,form:i,descriptionId:f.id,errorMessageId:p.id,validationBehavior:o});let m=a(e,{labelable:!0}),{focusWithinProps:h}=re({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:N(m,{role:`group`,"aria-disabled":n||void 0,...d,...h}),labelProps:u,descriptionProps:f,errorMessageProps:p,isInvalid:s,validationErrors:c,validationDetails:l}}function rt(e={}){let{isReadOnly:t}=e,[n,r]=de(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=W(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}function it(e,t,n){let r=rt({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=tt.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=Z({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=U(X),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};V(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=et({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[Ge]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[e[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}const at=new WeakMap;function ot(e,t,n){let{value:r,children:i,"aria-label":o,"aria-labelledby":s,onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p}=e,m=e.isDisabled||t.isDisabled,h=t.selectedValue===r,g=e=>{e.stopPropagation(),t.setSelectedValue(r)},{pressProps:_,isPressed:v}=A({onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p,isDisabled:m}),{pressProps:y,isPressed:b}=A({onPressStart:c,onPressEnd:l,onPressChange:u,onPressUp:f,onClick:p,isDisabled:m,onPress(e){d?.(e),t.setSelectedValue(r),n.current?.focus()}}),{focusableProps:x}=le(N(e,{onFocus:()=>t.setLastFocusedValue(r)}),n),S=N(_,x),C=a(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===r||t.lastFocusedValue==null)&&(w=0):t.selectedValue===r&&(w=0),m&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:ee}=at.get(t);return Fe(n,t.defaultSelectedValue,t.setSelectedValue),Re({validationBehavior:ee},t,n),{labelProps:N(y,H(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:N(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:m,required:t.isRequired&&ee===`native`,checked:h,value:r,onChange:g,"aria-describedby":[e[`aria-describedby`],t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),isDisabled:m,isSelected:h,isPressed:v||b}}function st(e,t){let{name:n,form:r,isReadOnly:i,isRequired:o,isDisabled:s,orientation:c=`vertical`,validationBehavior:l=`aria`}=e,{direction:u}=ge(),{isInvalid:d,validationErrors:f,validationDetails:m}=t.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:y}=Le({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||f}),x=a(e,{labelable:!0}),{focusWithinProps:S}=re({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),C=e=>{let n;switch(e.key){case`ArrowRight`:n=u===`rtl`&&c!==`vertical`?`prev`:`next`;break;case`ArrowLeft`:n=u===`rtl`&&c!==`vertical`?`next`:`prev`;break;case`ArrowDown`:n=`next`;break;case`ArrowUp`:n=`prev`;break;default:return}e.preventDefault();let r=ae(e.currentTarget,{from:v(e),accept:e=>e instanceof b(e).HTMLInputElement&&e.type===`radio`}),i;n===`next`?(i=r.nextNode(),i||=(r.currentNode=e.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=e.currentTarget,r.lastChild())),i&&(i.focus(),t.setSelectedValue(i.value))},w=p(n);return at.set(t,{name:w,form:r,descriptionId:_.id,errorMessageId:y.id,validationBehavior:l}),{radioGroupProps:N(x,{role:`radiogroup`,onKeyDown:C,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":i||void 0,"aria-required":o||void 0,"aria-disabled":s||void 0,"aria-orientation":c,...g,...S}),labelProps:h,descriptionProps:_,errorMessageProps:y,isInvalid:d,validationErrors:f,validationDetails:m}}const ct=R({}),Q=z(function(e,t){[e,t]=M(e,t,ct);let{elementType:n=`span`,...r}=e,i=F[n];return L.createElement(i,{className:`react-aria-Text`,...r,ref:t})});function lt(e={}){let[t,n]=de(e.value,e.defaultValue||[],e.onChange),[r]=W(t),i=!!e.isRequired&&t.length===0,a=U(new Map),o=Z({...e,value:t}),s=o.displayValidation.isInvalid;return{...o,value:t,defaultValue:e.defaultValue??r,setValue(t){e.isReadOnly||e.isDisabled||n(t)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(e){return t.includes(e)},addValue(t){e.isReadOnly||e.isDisabled||n(e=>e.includes(t)?e:e.concat(t))},removeValue(r){e.isReadOnly||e.isDisabled||t.includes(r)&&n(t.filter(e=>e!==r))},toggleValue(r){e.isReadOnly||e.isDisabled||(t.includes(r)?n(t.filter(e=>e!==r)):n(t.concat(r)))},setInvalid(e,t){let n=new Map(a.current);t.isInvalid?n.set(e,t):n.delete(e),a.current=n,o.updateValidation(Ze(...n.values()))},validationState:e.validationState??(s?`invalid`:null),isInvalid:s,isRequired:i}}let ut=Math.round(Math.random()*1e10),dt=0;function ft(e){let t=H(()=>e.name||`radio-group-${ut}-${++dt}`,[e.name]),[n,r]=de(e.value,e.defaultValue??null,e.onChange),[i]=W(n),[a,o]=W(null),s=Z({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}const pt=R(null),mt=z(function(e,t){return Se(pt)?.isInvalid?L.createElement(ht,{...e,ref:t}):null}),ht=z((e,t)=>{let n=Se(pt),r=a(e,{global:!0}),i=I({...e,defaultClassName:`react-aria-FieldError`,defaultChildren:n.validationErrors.length===0?void 0:n.validationErrors.join(` `),values:n});return i.children==null?null:L.createElement(Q,{slot:`errorMessage`,...r,...i,ref:t})}),gt=R(null),_t=R(null),vt=R(null),yt=z(function(e,t){[e,t]=M(e,t,_t);let{validationBehavior:n}=l(gt)||{},r=e.validationBehavior??n??`native`,i=lt({...e,validationBehavior:r}),[o,s]=C(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:c,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=nt({...e,label:s,validationBehavior:r},i),m=I({...e,values:{isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:e.isRequired||!1,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-CheckboxGroup`}),h=a(e,{global:!0});return L.createElement(F.div,{...N(h,m,c),ref:t,slot:e.slot||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":i.isInvalid||void 0,"data-disabled":e.isDisabled||void 0},L.createElement(_e,{values:[[vt,i],[ue,{...u,ref:o,elementType:`span`}],[ct,{slots:{description:d,errorMessage:f}}],[pt,p]]},m.children))}),bt=z(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=M(r,t,ve);let{validationBehavior:i}=l(gt)||{},o=e.validationBehavior??i??`native`,s=Se(vt),c=y(H(()=>_(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:u,inputProps:d,isSelected:f,isDisabled:p,isReadOnly:m,isPressed:h,isInvalid:g}=s?it({...w(e),value:e.value,children:typeof e.children==`function`?!0:e.children},s,c):et({...w(e),children:typeof e.children==`function`?!0:e.children,validationBehavior:o},rt(e),c),{isFocused:v,isFocusVisible:b,focusProps:x}=ne(),S=p||m,{hoverProps:C,isHovered:T}=he({...e,isDisabled:S}),E=I({...e,defaultClassName:`react-aria-Checkbox`,values:{isSelected:f,isIndeterminate:e.isIndeterminate||!1,isPressed:h,isHovered:T,isFocused:v,isFocusVisible:b,isDisabled:p,isReadOnly:m,isInvalid:g,isRequired:e.isRequired||!1}}),D=a(e,{global:!0});return delete D.id,delete D.onClick,L.createElement(F.label,{...N(D,u,C,E),ref:t,slot:e.slot||void 0,"data-selected":f||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":h||void 0,"data-hovered":T||void 0,"data-focused":v||void 0,"data-focus-visible":b||void 0,"data-disabled":p||void 0,"data-readonly":m||void 0,"data-invalid":g||void 0,"data-required":e.isRequired||void 0},L.createElement(te,{elementType:`span`},L.createElement(`input`,{...N(d,x),ref:c})),E.children)}),xt=R({}),St=R({});let Ct=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const wt=ce(function(e,t){[e,t]=M(e,t,St);let{hoverProps:n,isHovered:r}=he({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=ne({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=I({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return L.createElement(F.input,{...N(Ct(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),Tt=R(null);function Et(e){let t=U({});return L.createElement(Tt.Provider,{value:t},e.children)}const Dt=R({isSelected:!1}),Ot=R(null),kt=R(null),At=R(null),jt=z(function(e,t){[e,t]=M(e,t,Ot);let{validationBehavior:n}=l(gt)||{},r=e.validationBehavior??n??`native`,i=ft({...e,validationBehavior:r}),[o,s]=C(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:c,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=st({...e,label:s,validationBehavior:r},i),m=I({...e,values:{orientation:e.orientation||`vertical`,isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-RadioGroup`}),h=a(e,{global:!0});return L.createElement(F.div,{...N(h,m,c),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},L.createElement(_e,{values:[[At,i],[ue,{...u,ref:o,elementType:`span`}],[ct,{slots:{description:d,errorMessage:f}}],[pt,p]]},L.createElement(Et,null,m.children)))}),Mt=z(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=M(r,t,kt);let i=L.useContext(At),o=y(H(()=>_(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:s,inputProps:c,isSelected:l,isDisabled:u,isPressed:d}=ot({...w(e),children:typeof e.children==`function`?!0:e.children},i,o),{isFocused:f,isFocusVisible:p,focusProps:m}=ne(),h=u||i.isReadOnly,{hoverProps:g,isHovered:v}=he({...e,isDisabled:h}),b=I({...e,defaultClassName:`react-aria-Radio`,values:{isSelected:l,isPressed:d,isHovered:v,isFocused:f,isFocusVisible:p,isDisabled:u,isReadOnly:i.isReadOnly,isInvalid:i.isInvalid,isRequired:i.isRequired}}),x=a(e,{global:!0});return delete x.id,delete x.onClick,L.createElement(F.label,{...N(x,s,g,b),ref:t,"data-selected":l||void 0,"data-pressed":d||void 0,"data-hovered":v||void 0,"data-focused":f||void 0,"data-focus-visible":p||void 0,"data-disabled":u||void 0,"data-readonly":i.isReadOnly||void 0,"data-invalid":i.isInvalid||void 0,"data-required":i.isRequired||void 0},L.createElement(te,{elementType:`span`},L.createElement(`input`,{...N(c,m),ref:o})),L.createElement(Dt.Provider,{value:{isSelected:l}},b.children))}),Nt=R({});let Pt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const Ft=z(function(e,t){[e,t]=M(e,t,Nt);let{hoverProps:n,isHovered:r}=he(e),{isFocused:i,isFocusVisible:a,focusProps:o}=ne({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=I({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-TextArea`});return L.createElement(F.textarea,{...N(Pt(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),It=R(null),Lt=ce(function(e,t){[e,t]=M(e,t,It);let{validationBehavior:n}=l(gt)||{},r=e.validationBehavior??n??`native`,i=U(null);[e,i]=M(e,i,S);let[o,s]=C(!e[`aria-label`]&&!e[`aria-labelledby`]),[c,u]=W(`input`),{labelProps:d,inputProps:f,descriptionProps:p,errorMessageProps:m,...h}=Qe({...w(e),inputElementType:c,label:s,validationBehavior:r},i),g=B(e=>{i.current=e,e&&u(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),_=I({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:h.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),v=a(e,{global:!0});return delete v.id,L.createElement(F.div,{...v,..._,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":h.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},L.createElement(_e,{values:[[ue,{...d,ref:o}],[St,{...f,ref:g}],[Nt,{...f,ref:g}],[xt,{role:`presentation`,isInvalid:h.isInvalid,isDisabled:e.isDisabled||!1}],[ct,{slots:{description:p,errorMessage:m}}],[pt,h]]},_.children))}),Rt=({title:e,description:t,classNames:n})=>{let{survey:r,dismiss:i}=f();if(!r)return null;let a=t||r.confirmation.description;return q(G,{children:[K(`div`,{className:J(`cf-question`,n?.question),children:q(`div`,{className:J(`cf-header`,n?.header),children:[K(P,{className:J(`cf-title`,n?.title),children:e||r.confirmation.title||`Feedback submitted!`}),a&&K(Q,{slot:`description`,className:J(`cf-description`,n?.description),children:a})]})}),K(j,{className:`cf-submit-button`,onPress:i,children:r.confirmation.buttonText||`Close`})]})},zt=({children:e,classNames:t,containerProps:n,onDismiss:r,closeOnFinishMs:a=3e3})=>{let{surveyId:o,survey:s,dismiss:c}=f(),[l,u]=W(!1),[d,p]=W(!1),[m,h]=W(!1);return Te(()=>{s&&c()},l&&!(d||m)?a:null),q(`div`,{className:J(`confetti-dialog ${i}`,t?.dialog),id:`${o}-popover`,...n,onMouseEnter:e=>{n?.onMouseEnter?.(e),p(!0)},onMouseLeave:e=>{n?.onMouseLeave?.(e),p(!1)},onFocusCapture:e=>{n?.onFocusCapture?.(e),h(!0)},onBlurCapture:e=>{n?.onBlurCapture?.(e),e.currentTarget.contains(e.relatedTarget)||h(!1)},children:[K(pe,{className:J(`confetti-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await c(),r?.()}}),typeof e==`function`?e({setIsFinished:()=>u(!0)}):e]})},Bt=3e4;Bt/1e3;const Vt=({maskAllInputs:e}={})=>{let[n,a]=W(null),[o,s]=W(!1),[c,l]=W(null),[u,d]=W(30),f=U(null),p=U(null),m=U(null),h=U([]);V(()=>{let e=new CustomEvent(r,{detail:{isRecording:o}});document.dispatchEvent(e)},[o]);let g=B(()=>{p.current&&=(clearInterval(p.current),null),m.current&&=(clearTimeout(m.current),null),f.current=null,d(Bt/1e3)},[]),_=B(()=>{f.current?.(),g(),s(!1),a(JSON.stringify(h.current))},[g]);return{recordingEventsJson:n,isRecording:o,recordingError:c,remainingSeconds:u,startRecording:B(async()=>{s(!0),l(null),a(null),h.current=[];try{let{record:n}=await import(`./record-CeeyzJpB.js`);f.current=n({slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0},sampling:{mousemove:50,scroll:100,input:`last`},emit:e=>{h.current.push(e)},blockClass:i,maskTextClass:t,maskAllInputs:e})??null;let r=Bt/1e3;d(r),p.current=setInterval(()=>{--r,d(r)},1e3),m.current=setTimeout(()=>{_()},Bt)}catch{l(`Failed to start recording. Please try again.`),s(!1),g()}},[e,_,g]),stopRecording:_,clear:B(()=>{g(),s(!1),a(null),l(null),h.current=[]},[g])}},Ht=e=>e.replace(/\S/g,`*`),Ut=e=>`*`.repeat(e.length),Wt=(e,t)=>{for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t(n):Wt(n,t)},Gt=e=>{if(e instanceof HTMLInputElement)e.setAttribute(`value`,Ut(e.getAttribute(`value`)??``));else if(e instanceof HTMLTextAreaElement)e.textContent=Ut(e.textContent);else if(e instanceof HTMLSelectElement)for(let t of e.querySelectorAll(`option`))t.textContent=Ut(t.textContent)},Kt=({maskInputs:e})=>({name:`cfti-redact`,afterClone:n=>{let{clone:r}=n;if(r instanceof HTMLElement){for(let e of r.querySelectorAll(`.${t}`)){Wt(e,e=>{e.data=Ht(e.data)}),Gt(e);for(let t of e.querySelectorAll(`input, textarea, select`))Gt(t)}if(e)for(let e of r.querySelectorAll(`input, textarea, select`))Gt(e)}}}),qt=({maskAllInputs:e}={})=>{let[t,n]=W(null),[r,a]=W(!1),[o,s]=W(null);return{screenshotDataUrl:t,isCapturing:r,captureError:o,capture:B(async()=>{a(!0),s(null);try{let{snapdom:t}=await import(`./snapdom-VnBlM9vL.js`),r=await(await t(document.documentElement,{embedFonts:!0,exclude:[`.${i}`],excludeMode:`hide`,plugins:[Kt({maskInputs:!!e})],fast:!1})).toCanvas(),a=window.devicePixelRatio||1,o=Math.min(Math.round(window.innerWidth*a),r.width),s=Math.min(Math.round(window.innerHeight*a),r.height),c=document.createElement(`canvas`);c.width=o,c.height=s;let l=c.getContext(`2d`);if(!l)throw Error(`Failed to get 2D context for cropping`);l.drawImage(r,0,0,o,s,0,0,o,s),n(c.toDataURL(`image/png`))}catch{s(`Failed to capture screenshot. Please try again.`)}finally{a(!1)}},[e]),clear:B(()=>{n(null),s(null)},[])}},Jt=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[K(`circle`,{cx:`12`,cy:`12`,r:`10`}),K(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`})]}),Yt=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[K(`path`,{d:`M10 11v6`}),K(`path`,{d:`M14 11v6`}),K(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),K(`path`,{d:`M3 6h18`}),K(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]});function Xt(){if(window.DD_RUM&&typeof window.DD_RUM?.getInternalContext==`function`&&typeof window.DD_RUM?.getSessionReplayLink==`function`)try{let e=window.DD_RUM?.getInternalContext?.(),t=window.DD_RUM?.getSessionReplayLink?.();return{sessionId:e?.session_id,sessionReplayLink:t}}catch{return null}return null}function Zt(){if(typeof window>`u`||typeof navigator>`u`)return;let e=navigator,t=window.screen,n=Xt();return{userAgent:e.userAgent,screenResolution:`${t.width}x${t.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,language:e.language,timestamp:new Date().toISOString(),datadogTraceId:n?.traceId,datadogSessionId:n?.sessionId,datadogSessionReplayLink:n?.sessionReplayLink}}const Qt=xe(()=>import(`./RecordingReplayer-CKYzAfYD.js`)),$t=({id:e,title:t,description:n,properties:r,onChange:i,required:a,error:o,classNames:s,maskAllInputs:c})=>{let l=H(()=>Zt(),[]),[u,d]=W(``),[f,p]=W(``),{screenshotDataUrl:m,isCapturing:h,captureError:g,capture:_,clear:v}=qt({maskAllInputs:c}),{recordingEventsJson:y,isRecording:b,recordingError:x,remainingSeconds:S,startRecording:C,stopRecording:w,clear:T}=Vt({maskAllInputs:c}),E=H(()=>({title:u,...f?{description:f}:{},...m?{screenshotDataUrl:m}:{},...y?{recordingEventsJson:y}:{},metadata:l}),[f,l,y,m,u]);V(()=>{i(E)},[E,i]),V(()=>()=>{w()},[w]);let D=H(()=>y?JSON.parse(y):[],[y]);return K(G,{children:b?q(j,{className:J(`cf-bug-report-button`,`cf-bug-report-record-button`,s?.button,s?.recordButton),onPress:w,children:[K(Jt,{}),q(`span`,{children:[30-S,`s /`,` `,30,`s`]})]}):q(`div`,{className:J(`cf-bug-report`,s?.base),children:[q(Lt,{isRequired:a,isInvalid:!!o,name:`${e}-title`,value:u,onChange:d,className:J(`cf-question`,s?.question),children:[q(`div`,{className:J(`cf-header`,s?.header),children:[q(P,{className:J(`cf-title`,s?.title),children:[t,!a&&q(`span`,{className:J(`cf-label-optional`,s?.optionalLabel),children:[` `,`(optional)`]})]}),n&&K(Q,{slot:`description`,className:J(`cf-description`,s?.description),children:n})]}),K(wt,{placeholder:r.placeholder||`Brief description of the issue`,className:J(`cf-input`,s?.input)})]}),q(Lt,{name:`${e}-description`,value:f,onChange:p,className:J(`cf-question`,s?.question),children:[K(P,{className:J(`cf-title`,s?.title),children:r.detailsLabel}),K(Ft,{placeholder:r.detailsPlaceholder||`Steps to reproduce, expected vs actual behavior, etc.`,className:J(`cf-textarea`,s?.textArea),rows:4})]}),r.enableScreenshot||r.enableRecording?q(`section`,{className:J(`cf-question`,s?.question),children:[K(P,{className:J(`cf-title`,s?.title),children:`Attachments`}),q(`div`,{className:J(`cf-bug-report-actions`,s?.actions),children:[r.enableScreenshot&&q(`div`,{className:J(`cf-bug-report-screenshot-section`,s?.screenshotSection),children:[m?q(`div`,{className:J(`cf-bug-report-media-preview`,s?.mediaPreview),children:[K(`img`,{src:m,alt:`Screenshot preview`,className:J(`cf-bug-report-screenshot-img`,s?.screenshotImg)}),K(`div`,{className:J(`cf-bug-report-media-actions`,s?.mediaActions),children:K(j,{className:J(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:v,"aria-label":`Remove screenshot`,children:K(Yt,{})})})]}):K(j,{className:J(`cf-bug-report-button`,s?.button),onPress:_,isDisabled:h,children:h?`Capturing...`:`Screenshot`}),g&&K(`div`,{className:J(`cf-error`,s?.error),children:g})]}),r.enableRecording&&q(`div`,{className:J(`cf-bug-report-recording-section`,s?.recordingSection),children:[D.length>0?q(`div`,{className:J(`cf-bug-report-media-preview`,s?.mediaPreview),children:[K(be,{fallback:K(`span`,{className:J(`cf-bug-report-player-loading`,s?.playerLoading),"aria-label":`Loading recording preview...`}),children:K(Qt,{events:D})}),K(`div`,{className:J(`cf-bug-report-media-actions`,s?.mediaActions),children:K(j,{className:J(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:T,"aria-label":`Remove recording`,children:K(Yt,{})})})]}):K(j,{className:J(`cf-bug-report-button`,s?.button),onPress:C,children:`Record`}),x&&K(`div`,{className:J(`cf-error`,s?.error),children:x})]})]})]}):null,K(mt,{className:J(`cf-error`,s?.error),children:o})]})})},en=({id:e,title:t,description:n,properties:r,onChange:i,classNames:a,required:o,error:s})=>{let[c,l]=W(``);return V(()=>{i(c)},[i,c]),q(Lt,{isRequired:o,isInvalid:!!s,name:e,className:J(`cf-question`,a?.question),value:c,onChange:e=>{l(e),i(e)},children:[q(`div`,{className:J(`cf-header`,a?.header),children:[q(P,{className:J(`cf-title`,a?.title),children:[t,!o&&q(`span`,{className:J(`cf-label-optional`,a?.optionalLabel),children:[` `,`(optional)`]})]}),n&&K(Q,{slot:`description`,className:J(`cf-description`,a?.description),children:n})]}),K(Ft,{className:J(`cf-textarea`,a?.textarea),maxLength:r.max,rows:4,placeholder:r.placeholder||`Start typing...`}),K(mt,{className:J(`cf-error`,a?.error),children:s})]})},tn=({children:e,classNames:t,description:n,...r})=>K(bt,{...r,children:({isIndeterminate:r})=>q(G,{children:[q(`div`,{className:J(`cf-choice-label`,t?.label),children:[K(`div`,{className:J(`cf-checkbox-indicator`,t?.indicator),children:K(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:J(`cf-checkbox-indicator-svg`,t?.svg),children:r?K(`rect`,{x:1,y:7.5,width:16,height:3}):K(`polyline`,{points:`2 9 7 14 16 4`})},r?`indeterminate`:`check`)}),e]}),n&&K(`span`,{className:J(`cf-choice-description`,t?.choiceDescription),children:n})]})}),nn=({children:e,classNames:t,...n})=>K(bt,{...n,children:K(`div`,{className:J(`cf-tag-label`,t?.tagLabel),children:e})}),rn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let c=!!n.editable,l=n.display??`checkbox`,[u,d]=W([]),[f,p]=W(``),m=U(null),h=U(null),g=H(()=>{let e=u.indexOf(O);if(e===-1)return u;let t=[...u];return t[e]=f||O,t},[f,u]),_=l===`tag`;return V(()=>{i(g)},[i,g]),K(yt,{isRequired:o,isInvalid:!!s,name:a,value:u,onChange:d,className:J(`cf-question`,r?.question),children:({state:i})=>q(G,{children:[q(`div`,{className:J(`cf-header`,r?.header),children:[q(P,{className:J(`cf-title`,r?.title),children:[e,!o&&q(`span`,{className:J(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&K(Q,{slot:`description`,className:J(`cf-description`,r?.description),children:t})]}),q(`div`,{className:J(`cf-response-choices`,l===`tag`&&`cf-response-choices-tag`,r?.group),children:[n.options.map((e,t)=>K(_?nn:tn,{className:J(`cf-choice`,_&&[`cf-tag`,r?.tag],!_&&[`cf-checkbox`,r?.checkbox]),description:e.description,value:e.value,classNames:{tag:r?.tag,tagLabel:r?.tagLabel,choiceDescription:r?.choiceDescription,label:r?.label,indicator:r?.indicator,svg:r?.svg},children:e.value},t)),c&&(_?q(G,{children:[K(nn,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:J(`cf-choice cf-tag`,r?.tag),value:O,children:n.editable?.label}),K(wt,{"data-visible":i.value.includes(O)||void 0,value:f,onChange:e=>{p(e.target.value)},ref:h,className:J(`cf-input cf-tag-input`,r?.othersInput)})]}):q(`div`,{className:J(`cf-choice cf-others-choice`,r?.othersChoice),children:[K(tn,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:J(`cf-checkbox`,r?.checkbox),value:O,classNames:{indicator:r?.indicator,svg:r?.svg},description:n.editable?.description,children:n.editable?.label}),K(wt,{value:f,onChange:e=>{p(e.target.value)},tabIndex:i.value.includes(O)?0:-1,ref:h,onFocus:()=>{m.current?.checked===!1&&m.current.click()},className:J(`cf-input`,r?.othersInput)})]}))]}),K(mt,{className:J(`cf-error`,r?.error),children:s})]})})},an=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[K(`circle`,{cx:12,cy:12,r:10}),K(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M7.5 8 10 9M14 9l2.5-1M9 10h.01M15 10h.01`})]}),on=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[K(`circle`,{cx:12,cy:12,r:10}),K(`path`,{d:`M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12ZM9 9h.01M15 9h.01`})]}),sn=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[K(`circle`,{cx:12,cy:12,r:10}),K(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M9 9h.01M15 9h.01`})]}),cn=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[K(`circle`,{cx:12,cy:12,r:10}),K(`path`,{d:`M8 15h8M9 9h.01M15 9h.01`})]}),ln=e=>q(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[K(`circle`,{cx:12,cy:12,r:10}),K(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01`})]}),un=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:40,height:40,fill:`none`,...e,children:K(`path`,{fill:`currentColor`,d:`m6.516 14.323-1.49 6.452a.998.998 0 0 0 1.529 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082a1 1 0 0 0-.59-1.74l-5.701-.454-2.467-5.461a.998.998 0 0 0-1.822 0L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.214 4.107zm2.853-4.326a.998.998 0 0 0 .832-.586L12 5.43l1.799 3.981a.998.998 0 0 0 .832.586l3.972.315-3.271 2.944c-.284.256-.397.65-.293 1.018l1.253 4.385-3.736-2.491a.995.995 0 0 0-1.109 0l-3.904 2.603 1.05-4.546a1 1 0 0 0-.276-.94l-3.038-2.962 4.09-.326z`})}),dn=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,...e,children:K(`path`,{fill:`currentColor`,d:`M21.947 9.179a1.001 1.001 0 0 0-.868-.676l-5.701-.453-2.467-5.461a.998.998 0 0 0-1.822-.001L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.213 4.107-1.49 6.452a1 1 0 0 0 1.53 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082c.297-.268.406-.686.278-1.065z`})}),fn=({state:e,properties:t,classNames:n})=>{let r=e.selectedValue?Number(e.selectedValue):null;return K(`div`,{className:J(`cf-rating-display-star`,n?.ratingDisplayStar),children:Array.from({length:t.scale},(e,t)=>{let i=t+1,a=String(i),o=r&&i<=r;return K(Mt,{className:J(`cf-rating-star`,n?.ratingStar),value:a,"data-filled":o?`true`:void 0,children:K(o?dn:un,{})},t)})})},pn=({properties:e,classNames:t})=>K(`div`,{className:J(`cf-rating-display-number`,t?.ratingDisplayNumber),children:Array.from({length:e.scale},(e,n)=>{let r=n+1,i=String(r);return K(Mt,{className:J(`cf-rating-number`,t?.ratingNumber),value:i,children:r},n)})}),mn=({properties:e,classNames:t,state:n})=>{let r=H(()=>[an,sn,cn,ln,on],[]),i=H(()=>[sn,cn,ln],[]);return H(()=>e.scale===3||e.scale===5,[e.scale])?K(`div`,{className:J(`cf-rating-display-emoji`,t?.ratingDisplayEmoji),children:Array.from({length:e.scale},(n,a)=>{let o=a+1,s=String(o),c=e.scale===5?r[a]:i[a];return K(Mt,{className:J(`cf-rating-emoji`,t?.ratingEmoji),value:s,children:c&&K(c,{})},a)})}):K(pn,{properties:e,classNames:t,state:n})},hn=e=>{switch(e.properties.display??`star`){case`emoji`:return K(mn,{...e});case`number`:return K(pn,{...e});case`star`:return K(fn,{...e})}},gn=({properties:e,title:t,description:n,classNames:r,onChange:i,id:a,error:o,required:s})=>{let[c,l]=W(null),u=H(()=>c?Number(c):void 0,[c]);return V(()=>{i(u)},[i,u]),K(jt,{isRequired:s,isInvalid:!!o,name:a,className:J(`cf-question`,r?.question),value:c,onChange:l,children:({state:i})=>q(G,{children:[q(`div`,{className:J(`cf-header`,r?.header),children:[q(P,{className:J(`cf-title`,r?.title),children:[t,!s&&q(`span`,{className:J(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),n&&K(Q,{slot:`description`,className:J(`cf-description`,r?.description),children:n})]}),q(`div`,{className:J(`cf-rating-section`,r?.ratingSection),children:[K(hn,{state:i,properties:e,classNames:r}),q(`div`,{className:J(`cf-rating-text`,r?.ratingText),children:[K(`span`,{className:J(`cf-rating-text-lower`,r?.ratingTextLower),children:e.labels?.lower}),K(`span`,{className:J(`cf-rating-text-upper`,r?.ratingTextUpper),children:e.labels?.upper})]})]}),K(mt,{className:J(`cf-error`,r?.error),children:o})]})})},_n=({classNames:e,className:t,description:n,...r})=>K(Mt,{...r,className:J(t,e?.radio),children:s(r.children,t=>q(G,{children:[q(`div`,{className:J(`cf-choice-label`,e?.label),children:[K(`div`,{className:J(`cf-radio-indicator`,e?.indicator)}),t]}),n&&K(`span`,{className:J(`cf-choice-description`,e?.choiceDescription),children:n})]}))}),vn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let[c,l]=W(null),[u,d]=W(``),f=!!n.editable,p=U(null),m=U(null),h=H(()=>c===k?u||k:c??void 0,[u,c]);return V(()=>{i(h)},[i,h]),K(jt,{isRequired:o,isInvalid:!!s,name:a,onChange:e=>{l(e),e===k&&requestAnimationFrame(()=>{m.current&&m.current.focus()})},value:c,className:J(`cf-question`,r?.question),children:({state:i})=>q(G,{children:[q(`div`,{className:J(`cf-header`,r?.header),children:[q(P,{className:J(`cf-title`,r?.title),children:[e,!o&&q(`span`,{className:J(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&K(Q,{slot:`description`,className:J(`cf-description`,r?.description),children:t})]}),q(`div`,{className:J(`cf-response-choices`,r?.group),children:[n.options.map((e,t)=>K(_n,{classNames:{indicator:r?.indicator,radio:J(`cf-choice cf-radio`,r?.radio)},value:e.value,description:e.description,children:e.value},t)),f&&q(`div`,{className:J(`cf-choice cf-others-choice`,r?.othersChoice),children:[K(_n,{inputRef:p,value:k,classNames:{indicator:r?.indicator,radio:J(`cf-radio`,r?.radio)},description:n.editable?.description,children:n.editable?.label}),K(wt,{tabIndex:i.selectedValue===k?0:-1,ref:m,value:u,onChange:e=>d(e.target.value),onFocus:()=>{p.current?.checked===!1&&p.current.click()},className:J(`cf-input`,r?.othersInput)})]})]}),K(mt,{className:J(`cf-error`,r?.error),children:s})]})})},yn=({properties:e,title:t,description:n,classNames:r})=>K(`div`,{className:J(`cf-question`,r?.question),children:q(`div`,{className:J(`cf-header`,r?.header),children:[t&&K(`div`,{className:J(`cf-title`,r?.title),children:t}),n&&K(`div`,{className:J(`cf-description`,r?.description),children:n})]})}),$=({question:e,onChange:t,error:n,maskAllInputs:r})=>{switch(e.properties.type){case`rating`:return K(gn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`open-ended`:return K(en,{...e,properties:e.properties,onChange:t,error:n},e.id);case`single-select`:return K(vn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`multi-select`:return K(rn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`statement`:return K(yn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`bug-report`:return K($t,{...e,properties:e.properties,onChange:t,error:n,maskAllInputs:r},e.id)}return K(`div`,{children:`Unsupported question type`},e.id)},bn=({onPress:e,isDisabled:t,children:n=`Submit`})=>oe()?null:K(j,{isDisabled:t,className:`cf-submit-button`,onPress:e,children:n}),xn=e=>{switch(e){case`multi-select`:return[];case`bug-report`:return{title:``};case`statement`:return;default:return``}},Sn=e=>e!==void 0&&e!==``&&!(Array.isArray(e)&&e.length===0),Cn=({onSubmit:t,children:n,question:r,isLastQuestion:i})=>{let[a,o]=W(xn(r.properties.type)),s=H(()=>Oe(r.properties,{required:r.required}),[r.properties,r.required]),c=H(()=>{let e=s.safeParse(a);if(!e.success)return De(e.error)},[a,s]),l=H(()=>{let t=r.routingLogic;if(t.type!==`always`&&!Sn(a)&&r.required)return!0;let n=t.type===`always`?t.target:t.cases.find(t=>e({answer:a,condition:t}))?.target??t.default;return n.type===`end`?!1:n.type===`next`?!i:!0},[a,i,r.required,r.routingLogic]),u=H(()=>r.properties.buttonLabel?r.properties.buttonLabel:l?!r.required&&!Sn(a)?`Skip`:`Next`:`Submit`,[a,l,r.properties.buttonLabel,r.required]),d=B(()=>{switch(r.properties.type){case`statement`:if(r.properties.buttonUrl&&typeof window<`u`){let e=x.safeParse(r.properties.buttonUrl).data;e&&window.open(e,`_blank`)}return t(void 0);default:return t(a)}},[a,t,r.properties]),f=H(()=>{switch(r.properties.type){case`rating`:case`single-select`:return!!r.properties.shouldAutoProgress;default:return!1}},[r.properties]);return q(G,{children:[n({onChange:B(e=>{o(e),f&&Sn(e)&&s.safeParse(e).success&&t(e)},[f,s,t]),question:r,error:c}),(!f||!r.required)&&K(bn,{isDisabled:!!c,onPress:d,children:u})]})},wn=({isCompleted:e,onSubmit:t,children:n})=>q(G,{children:[n,e&&K(bn,{onPress:t})]}),Tn=e=>K(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 44 38`,...e,children:q(`g`,{transform:`translate(-2 -2) scale(1.1)`,children:[K(`path`,{d:`M16.8395 3.2139C8.2208 3.9522 1.8331 11.5311 2.5721 20.1416C3.3111 28.7523 10.897 35.134 19.5157 34.3956L27.1631 33.7406C28.9787 33.585 30.6949 33.1248 32.2669 32.4163L38.7663 35.4396C39.3254 35.6994 39.9048 35.1205 39.6447 34.562L37.0707 29.0396C40.1147 25.8995 41.8336 21.5102 41.4304 16.8128C40.6913 8.2022 33.1054 1.8205 24.4867 2.5588L16.8395 3.2139Z`,fill:`#BAE6FD`}),K(`path`,{d:`M19.6764 24.0307C19.6764 24.0307 20.9773 25.4496 23.5438 25.1228C26.1103 24.7959 27.3642 23.0095 27.3642 23.0095`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`}),K(`path`,{d:`M18.0861 16.4082C18.0861 16.4082 17.1255 18.619 14.8183 18.9139C12.5111 19.2088 11.1697 17.237 11.1697 17.237`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`}),K(`path`,{d:`M32.6296 15.0398C32.6296 15.0398 31.6691 17.2506 29.3619 17.5455C27.0548 17.8404 25.7132 15.8686 25.7132 15.8686`,stroke:`#382F40`,strokeWidth:2.4821,strokeLinecap:`round`})]})}),En=({onClick:e,isWidgetOpen:t,classNames:n,label:r=`Help us improve`})=>t?null:q(j,{onPress:e,className:J(`confetti-trigger`,n?.trigger),children:[K(`span`,{className:J(`confetti-trigger-icon-wrapper`,n?.iconWrapper),"aria-hidden":!0,children:K(Tn,{className:J(`confetti-trigger-icon`,n?.icon),width:24})}),K(`span`,{className:J(`confetti-trigger-label`,n?.label),children:r})]}),Dn=({trigger:e,children:t,publishableKey:n,surveyId:r})=>{let i=f(),[a,s]=W(!1),[c,l]=W(!1);if(!i.isVisible)return null;let u=()=>{s(!1)};return q(G,{children:[e({onClick:()=>s(!0),isWidgetOpen:a,hasSubmitted:c}),a&&K(o.Provider,{value:{...i,dismiss:()=>{i.dismiss(),u()},submit:async e=>{let t=await i.submit(e);return l(!0),t}},children:t({onDismiss:u,surveyId:r,publishableKey:n})})]})},On=({trigger:e=e=>K(En,{...e}),children:t,...n})=>K(ye,{fallback:K(G,{}),children:K(E,{...n,alwaysRenderChildren:!0,children:K(Dn,{trigger:e,surveyId:n.surveyId,publishableKey:n.publishableKey,children:t})})}),kn=e=>K(ye,{fallback:K(G,{}),children:K(T,{type:`embedded`,children:K(Pe,{...e,shouldAutoSubmit:!1,children:({questions:t,update:n,isCompleted:r,submit:i,isSubmitted:a,errors:o})=>a?K(Rt,{}):K(wn,{onSubmit:i,isCompleted:r,children:t.filter(({visible:e})=>!!e).map(t=>K($,{question:t,error:o[t.id]||``,maskAllInputs:e.options?.bugReport?.maskAllInputs,onChange:e=>n({question:t.position,answer:e})},t.position))})})})}),An=({onDismiss:e,closeOnFinishMs:t,isDismissable:n,...r})=>K(ye,{fallback:K(G,{}),children:K(T,{type:`modal`,children:K(E,{...r,children:K(me,{onDismiss:e,closeOnFinishMs:t,isDismissable:n,children:({setIsFinished:e})=>K(Ne,{...r,shouldAutoSubmit:!1,onFinished:()=>{e(),r.onFinished?.()},children:({questions:e,update:t,isCompleted:n,errors:i,submit:a,isSubmitted:o})=>o?K(Rt,{}):K(wn,{onSubmit:a,isCompleted:n,children:e.filter(({visible:e})=>!!e).map(e=>K($,{question:e,error:i[e.id]||``,maskAllInputs:r.options?.bugReport?.maskAllInputs,onChange:n=>t({question:e.position,answer:n})},e.position))})})})})})}),jn=({onDismiss:e,closeOnFinishMs:t,...n})=>K(ye,{fallback:K(G,{}),children:K(T,{type:`popover`,children:K(E,{...n,children:K(zt,{onDismiss:e,closeOnFinishMs:t,children:({setIsFinished:e})=>K(Ne,{shouldAutoSubmit:!0,...n,onFinished:()=>{e(),n.onFinished?.()},children:({current:e,questions:t,update:r,isSubmitted:i})=>{let a=e===t.length-1;if(i)return K(Rt,{});let o=t[e];return o?K(Cn,{isLastQuestion:a,question:o,onSubmit:t=>r({question:e,answer:t}),children:e=>K($,{maskAllInputs:n.options?.bugReport?.maskAllInputs,...e})}):K(G,{})}})})})})}),Mn=e=>K(Pe,{...e,shouldAutoSubmit:!0,children:({current:t,questions:n,update:r,isSubmitted:i})=>{let a=t===n.length-1;if(i)return K(Rt,{});let o=n[t];return o?K(Cn,{isLastQuestion:a,question:o,onSubmit:e=>r({question:t,answer:e}),children:t=>K($,{maskAllInputs:e.options?.bugReport?.maskAllInputs,...t})}):K(G,{})}}),Nn=({delay:e})=>{let[t,n]=W(!1),r=H(()=>e,[]);return V(()=>{let e=setTimeout(()=>{n(!0)},r);return()=>clearTimeout(e)},[]),{isVisible:t}},Pn=({visits:e,respondent:t})=>{let[n,r]=Ce(`cfti:${H(()=>window.location.pathname,[])}:visits:${t??``}`,0);return V(()=>{r(e=>e+1)},[r]),{isVisible:n>=e,reset:B(()=>r(0),[r])}},Fn=({visits:e,respondent:t})=>{let[n,r]=we(`cfti:${H(()=>window.location.pathname,[])}:visits:${t??``}`,0);return V(()=>{r(e=>e+1)},[r]),{isVisible:n>=e,reset:B(()=>r(0),[r])}},In=({threshold:e})=>{let[t,n]=W(()=>typeof window>`u`?!1:window.scrollY>=e);return V(()=>{let t=()=>{window.scrollY>=e&&n(!0)};return window.addEventListener(`scroll`,t,{passive:!0}),()=>window.removeEventListener(`scroll`,t)},[e]),{isVisible:t}};export{pe as CloseButton,Pe as Confetti,o as ConfettiContext,Ne as ConfettiController,E as ConfettiProvider,On as ConfettiTrigger,Tn as ConfettiTriggerIcon,En as DefaultConfettiTrigger,wn as Embed,kn as EmbeddedConfetti,Cn as Flow,en as FreeText,An as ModalConfetti,me as ModalContainer,rn as MultiChoice,jn as PopoverConfetti,zt as PopoverContainer,gn as Rating,vn as SingleChoice,yn as Statement,Mn as StepperConfetti,$ as SurveyQuestionFactory,Rt as ThankYouMessage,f as useConfetti,Nn as useVisibleAfterDelay,Pn as useVisibleAfterPageVisits,In as useVisibleAfterScroll,Fn as useVisibleAfterSessionPageVisits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/confetti",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Widgets for Confetti",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"react-aria-components": "1.16.0",
|
|
65
65
|
"tsdown": "0.19.0",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
|
+
"@confetti/prettier-config": "0.0.0",
|
|
67
68
|
"@confetti/eslint-config": "0.0.0",
|
|
68
69
|
"@confetti/tsconfig": "0.0.0",
|
|
69
|
-
"@confetti/validators": "0.0.0"
|
|
70
|
-
"@confetti/prettier-config": "0.0.0"
|
|
70
|
+
"@confetti/validators": "0.0.0"
|
|
71
71
|
},
|
|
72
72
|
"prettier": "@confetti/prettier-config",
|
|
73
73
|
"scripts": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./internals-Dzl6abGJ.js";import r,{createContext as i,forwardRef as a,useCallback as o,useContext as s,useEffect as c,useMemo as l,useReducer as u,useRef as d,useState as f}from"react";import{useLocalStorage as p,useTimeout as m}from"usehooks-ts";import{z as h}from"zod/v4/mini";import g from"ky";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import b from"clsx";import x,{flushSync as S}from"react-dom";const C=h.object({type:h.literal(`next`)}),w=h.object({type:h.literal(`end`)}),ee=h.object({type:h.literal(`jump`),target:h.number({error:`Target question is required`})}),T=h.discriminatedUnion(`type`,[C,ee,w]),E=h.object({type:h.literal(`value`),value:h.union([h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),h.number({error:`Value is required`})])}),D=h.object({type:h.literal(`binary-operator`),operator:h.union([h.literal(`equal`),h.literal(`not-equal`),h.literal(`greater`),h.literal(`greater-or-equal`),h.literal(`less`),h.literal(`less-or-equal`),h.literal(`contains`),h.literal(`not-contains`)]),value:E,target:T}),O=h.object({type:h.literal(`switch`),cases:h.array(D),default:T}),te=h.object({type:h.literal(`always`),target:T}),k=h.discriminatedUnion(`type`,[te,O]),ne=h.string().check(h.trim(),h.url({protocol:/^(https|mailto)/,error:`Link must start with https:// or mailto:`})),re=h.optional(h.string().check(h.trim(),h.maxLength(50))),ie=h.object({value:h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),description:h.optional(h.string().check(h.trim()))}),ae=h.nullable(h.object({label:h.string().check(h.trim(),h.minLength(1,{error:`Value is required`})),max:h.number(),description:h.optional(h.string().check(h.trim()))})),oe=h.optional(h.boolean()),se=h.object({type:h.literal(`rating`),buttonLabel:re,shouldAutoProgress:oe,scale:h.number().check(h.minimum(2),h.maximum(10)),labels:h.optional(h.object({lower:h.optional(h.pipe(h.string().check(h.trim()),h.transform(e=>e===``?void 0:e))),upper:h.optional(h.pipe(h.string().check(h.trim()),h.transform(e=>e===``?void 0:e)))})),display:h.optional(h.literal([`star`,`emoji`,`number`]))}),ce=h.object({type:h.literal(`open-ended`),placeholder:h.optional(h.string()),buttonLabel:re,max:h.number()}),le=h.object({type:h.literal(`single-select`),shouldAutoProgress:oe,options:h.array(ie),buttonLabel:re,editable:ae}),ue=h.object({type:h.literal(`multi-select`),buttonLabel:re,options:h.array(ie),editable:ae,max:h.optional(h.number()),display:h.optional(h.literal([`checkbox`,`tag`]))}),de=h.object({type:h.literal(`statement`),buttonLabel:re,buttonUrl:h.optional(ne)}),fe=h.object({type:h.literal(`bug-report`),placeholder:h.optional(h.string()),buttonLabel:re,enableScreenshot:h.boolean(),enableRecording:h.boolean(),detailsLabel:h.string().check(h.trim(),h.minLength(1,{error:`Label is required`}),h.maxLength(128)),detailsPlaceholder:h.optional(h.string()),redactClasses:h.optional(h.array(h.string()))}),pe=h.discriminatedUnion(`type`,[se,le,ce,ue,de,fe]),me=`__CONFETTI_CHECKBOX_Others`,he=`__CONFETTI_RADIO_Others`,ge=h.optional(h.catchall(h.partial(h.looseObject({userAgent:h.string().check(h.trim(),h.maxLength(1e3)),screenResolution:h.string().check(h.trim(),h.maxLength(100)),viewportSize:h.string().check(h.trim(),h.maxLength(100)),pageUrl:h.string(),pageTitle:h.string().check(h.trim(),h.maxLength(1e3)),referrer:h.string(),datadogTraceId:h.optional(h.string()),datadogSessionId:h.optional(h.string()),datadogSessionReplayLink:h.optional(h.string())})),h.optional(h.string())));h.cuid2();const _e=h.looseObject({type:h.literal([0,1,2,3,4,5,6]),data:h.unknown(),timestamp:h.number(),delay:h.optional(h.number())});h.array(_e);const ve=h.array(_e),ye=h.string().check(h.refine(e=>{try{return ve.safeParse(JSON.parse(e)).success}catch{return!1}},{error:`Invalid recording events`})),be=h.string().check(h.regex(/^data:image\/(png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/]+=*$/,{error:`Invalid image data URL`})),xe=e=>h.object({title:h.string().check(h.trim(),...e?[h.minLength(1,{error:`Title is required`})]:[],h.maxLength(256)),description:h.optional(h.string().check(h.trim(),h.maxLength(4096))),screenshotDataUrl:h.optional(be),recordingEventsJson:h.optional(ye),metadata:ge}),Se=xe(!0),Ce=(e,{required:t})=>xe(t),we=e=>h.number().check(h.int(),h.minimum(1),h.maximum(e)),Te=({scale:e},{required:t})=>{let n=we(e);return t?n:h.optional(n)},Ee=({maxLength:e},{required:t})=>h.string().check(h.trim(),...t?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(e??2048,{error:({maximum:e})=>`Please enter less than ${e} characters`})),De=(e,t)=>h.string().check(h.trim(),...t?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(e??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),h.refine(e=>e!==he,{error:`Please fill out the free text field`})),Oe=({maxLength:e},{required:t})=>{let n=De(e,t);return t?n:h.optional(n)},ke=({maxSelected:e,maxLength:t},{required:n})=>h.array(h.string().check(h.trim(),...n?[h.minLength(1,{error:`This field is required`})]:[],h.maxLength(t??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),h.refine(e=>e!==me,{error:`Please fill out the free text field`}))).check(...n?[h.minLength(1,{error:`Please select at least one option`})]:[],h.maxLength(e??1024,{error:({maximum:e})=>`Please select less than ${e} options`})),Ae=()=>h.optional(h.string()),je=h.object({title:h.string().check(h.trim()),description:h.string().check(h.trim()),buttonText:h.string().check(h.trim())}),Me=h.object({title:h.string(),description:h.nullable(h.string()),questions:h.array(h.object({id:h.string(),title:h.string(),description:h.nullable(h.string()),position:h.number(),required:h.boolean(),properties:pe,routingLogic:k})),confirmation:je});h.object({surveyId:h.cuid2(),responseId:h.union([h.cuid2(),h.uuid()])}),h.object({respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048)),data:h.record(h.string(),h.union([h.string().check(h.trim(),h.maxLength(2048)),h.number(),h.array(h.string().check(h.trim(),h.maxLength(2048))).check(h.maxLength(1024)),Se])),metadata:h.record(h.string().check(h.trim(),h.maxLength(1e3)),h.string().check(h.trim(),h.maxLength(1e3)))}),h.object({surveyId:h.cuid2(),respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048))}),h.object({surveyId:h.cuid2(),respondent:h.string().check(h.trim(),h.minLength(1),h.maxLength(2048))}),h.object({surveyId:h.cuid2()});const Ne=h.object({lastRespondedAt:h.nullable(h.union([h.iso.datetime(),h.date()])),lastViewedAt:h.nullable(h.union([h.iso.datetime(),h.date()])),lastDismissedAt:h.nullable(h.union([h.iso.datetime(),h.date()]))});h.object({type:h.enum([`view`,`dismiss`])});const Pe=g.create({prefixUrl:`https://confetti.gov.sg/api`,retry:{limit:3,methods:[`get`]},timeout:6e4}),Fe=i(null),Ie=({children:e,surveyId:t,publishableKey:n,respondent:r,metadata:i={},isSurveyVisible:a,apiBaseUrl:s,alwaysRenderChildren:u})=>{let m=d(!1),[h,g]=f(),[_,y]=f(!1),[b,x]=f(null),[S,C]=f(null),[w,ee]=p(`cfti:${t}:respondent`,``);c(()=>{w||ee(crypto.randomUUID())},[w,ee]);let T=l(()=>r||w,[r,w]),E=l(()=>{let e={headers:{"x-cfti-pk":n}};return s&&(e.prefixUrl=s),Pe.extend(e)},[s,n]),D=o(async()=>{if(!T)return;let e=await E.get(`v1/cfti/${t}/respondent/${T}`).json(),n=Ne.safeParse(e);n.success&&(x(n.data.lastRespondedAt?new Date(n.data.lastRespondedAt):null),C(n.data.lastDismissedAt?new Date(n.data.lastDismissedAt):null))},[E,T,t]);c(()=>{if(typeof window>`u`||typeof document>`u`)return;let e=()=>{document.visibilityState===`visible`&&D()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[D]),c(()=>{(async()=>{m.current=!1,y(!1),g(void 0),x(null),C(null);try{let e=await E.get(`v1/cfti/${t}`).json(),n=Me.safeParse(e);if(!n.success)return;g(n.data),await D()}catch{}finally{y(!0)}})()},[E,D,t]);let O=o(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]),te=o(()=>{u||g(void 0),E.post(`v1/cfti/${t}/respondent/${T}/event`,{json:{type:`dismiss`}}).catch(()=>{})},[u,E,T,t]),k=l(()=>_?a===void 0?!0:typeof a==`boolean`?a:a({lastRespondedAt:b,lastDismissedAt:S}):!1,[_,a,b,S]);c(()=>{m.current||k&&h&&T&&(m.current=!0,E.post(`v1/cfti/${t}/respondent/${T}/event`,{json:{type:`view`}}).catch(()=>{}))},[E,k,T,h,t]);let ne=k&&!!h;return!u&&!ne?null:v(Fe.Provider,{value:{submit:O,dismiss:te,surveyId:t,survey:h,metadata:i,isVisible:ne},children:e})},Le=e=>s(Fe)?v(_,{children:e.children}):v(Ie,{...e,surveyId:e.surveyId,publishableKey:e.publishableKey}),Re=()=>{let e=s(Fe);if(!e)throw Error(`useConfetti must be used within a ConfettiProvider`);return e},ze=i(null);i(null),i(null),i(null),i(null);const Be=i({});i(null);const Ve=i(null);function He(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 Ue(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 We=A(function(){return Ue(/^Mac/i)}),Ge=A(function(){return Ue(/^iPhone/i)}),Ke=A(function(){return Ue(/^iPad/i)||We()&&navigator.maxTouchPoints>1}),qe=A(function(){return Ge()||Ke()}),Je=A(function(){return He(/AppleWebKit/i)&&!Ye()}),Ye=A(function(){return He(/Chrome/i)}),Xe=A(function(){return He(/Android/i)}),Ze=A(function(){return He(/Firefox/i)});function Qe(e){if(et())e.focus({preventScroll:!0});else{let t=tt(e);e.focus(),nt(t)}}let $e=null;function et(){if($e==null){$e=!1;try{document.createElement(`div`).focus({get preventScroll(){return $e=!0,!0}})}catch{}}return $e}function tt(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 nt(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function rt(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;Ze()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(We()?r=!0:i=!0);let s=Je()&&We()&&!Ke()?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});rt.isOpening=n,Qe(e),e.dispatchEvent(s),rt.isOpening=!1}rt.isOpening=!1;const j=typeof document<`u`?r.useLayoutEffect:()=>{},it={prefix:String(Math.round(Math.random()*1e10)),current:0},at=r.createContext(it),ot=r.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let st=new WeakMap;function ct(e=!1){let t=s(at),n=d(null);if(n.current===null&&!e){let e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=st.get(e);n==null?st.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,st.delete(e))}n.current=++t.current}return n.current}function lt(e){let t=s(at),n=ct(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function ut(e){let t=r.useId(),[n]=f(ht()),i=n?`react-aria`:`react-aria${it.prefix}`;return e||`${i}-${t}`}const dt=typeof r.useId==`function`?ut:lt;function ft(){return!1}function pt(){return!0}function mt(e){return()=>{}}function ht(){return typeof r.useSyncExternalStore==`function`?r.useSyncExternalStore(mt,ft,pt):s(ot)}function gt(e){let[t,n]=f(e),r=d(t),i=d(null),a=d(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}r.current===e.value?a.current():n(e.value)});return j(()=>{r.current=t,i.current&&a.current()}),[t,o(e=>{i.current=e(r.current),a.current()},[a])]}let _t=!!(typeof window<`u`&&window.document&&window.document.createElement),vt=new Map,yt;typeof FinalizationRegistry<`u`&&(yt=new FinalizationRegistry(e=>{vt.delete(e)}));function bt(e){let[t,n]=f(e),r=d(null),i=dt(t),a=d(null);if(yt&&yt.register(a,i),_t){let e=vt.get(i);e&&!e.includes(r)?e.push(r):vt.set(i,[r])}return j(()=>{let e=i;return()=>{yt&&yt.unregister(a),vt.delete(e)}},[i]),c(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function xt(e,t){if(e===t)return e;let n=vt.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=vt.get(t);return r?(r.forEach(t=>t.current=e),e):t}function St(e=[]){let t=bt(),[n,r]=gt(t),i=o(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return j(i,[t,i,...e]),n}function Ct(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}const M=e=>e?.ownerDocument??document,N=e=>e&&`window`in e&&e.window===e?e:M(e).defaultView||window;function wt(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Tt(e){return wt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}function P(){return!1}function F(e,t){if(!P())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:Tt(n)?n.host:n.parentNode}return!1}const I=(e=document)=>{if(!P())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function L(e){if(P()&&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 Et(e){if(!e)return!1;let t=e.getRootNode(),n=N(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}var Dt=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(!F(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 F(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 Ot(e,t,n,r){return P()?new Dt(e,t,n,r):e.createTreeWalker(t,n,r)}function kt(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=At(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():At(e[n],null)})}}}function At(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function R(...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]=Ct(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=b(n,i):e===`id`&&n&&i?t.id=xt(n,i):e===`ref`&&n&&i?t.ref=kt(n,i):t[e]=i===void 0?n:i}}return t}const jt=new Set([`id`]),Mt=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),Nt=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),Pt=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Ft=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(`.`)),It=/^(data-.*)$/;function z(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)&&(jt.has(t)||n&&Mt.has(t)||r&&Nt.has(t)||i&&Pt.has(t)||a&&(Ft.has(t)||t.endsWith(`Capture`)&&Ft.has(t.slice(0,-7)))||o?.has(t)||It.test(t))&&(s[t]=e[t]);return s}let B=new Map,Lt=new Set;function Rt(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=L(t);if(!e(t)||!r)return;let i=B.get(r);i||(i=new Set,B.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=L(t);if(!e(t)||!r)return;let i=B.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),B.delete(r)),B.size===0)){for(let e of Lt)e();Lt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Rt):Rt());function zt(){for(let[e]of B)`isConnected`in e&&!e.isConnected&&B.delete(e)}function Bt(e){requestAnimationFrame(()=>{zt(),B.size===0?e():Lt.add(e)})}function Vt(){let e=d(new Map),t=o((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=o((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=o(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return c(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ht(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=bt(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 Ut(e){let t=d(null),n=d(void 0),r=o(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 l(()=>({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 Wt=r.useInsertionEffect??j;function Gt(e){let t=d(null);return Wt(()=>{t.current=e},[e]),o((...e)=>{let n=t.current;return n?.(...e)},[])}function Kt(e,t){j(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function qt(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 Jt(e,t){let n=e;for(qt(n,t)&&(n=n.parentElement);n&&!qt(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}const Yt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Xt(e){return e instanceof HTMLInputElement&&!Yt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let V=typeof document<`u`&&window.visualViewport;function Zt(){let e=ht(),[t,n]=f(()=>e?{width:0,height:0}:Qt());return c(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{V&&V.scale>1||e(Qt())},r,i=t=>{V&&V.scale>1||Xt(L(t))&&(r=requestAnimationFrame(()=>{let t=I();(!t||!Xt(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(Qt()),qe()&&window.addEventListener(`blur`,i,!0),V?V.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),qe()&&window.removeEventListener(`blur`,i,!0),V?V.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function Qt(){return{width:V?Math.min(V.width*V.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:V?V.height*V.scale:document.documentElement.clientHeight}}function $t(e){return e.pointerType===``&&e.isTrusted?!0:Xe()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function en(e){return!Xe()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}function tn(e,t=!0){let[n,r]=f(!0),i=n&&t;return j(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),rn(e,i,o(()=>r(!1),[])),i}function nn(e,t){let[n,r]=f(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`);break}let i=n===`exiting`;return rn(e,i,o(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function rn(e,t,n){j(()=>{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||S(()=>{n()})}),()=>{r=!0}}},[e,t,n])}const an=typeof Element<`u`&&`checkVisibility`in Element.prototype;function on(e){let t=N(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 sn(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 cn(e,t){return an?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&on(e)&&sn(e,t)&&(!e.parentElement||cn(e.parentElement,e))}const ln=[`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`],un=ln.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;ln.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const dn=ln.join(`:not([hidden]):not([tabindex="-1"]),`);function fn(e,t){return e.matches(un)&&!mn(e)&&(t?.skipVisibilityCheck||cn(e))}function pn(e){return e.matches(dn)&&cn(e)&&!mn(e)}function mn(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function hn(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let gn=new WeakMap;function _n(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return hn(t);if(gn.has(t))return gn.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof N(n).HTMLMetaElement&&(n.nonce||n.content)||hn(t)||void 0;return r!==void 0&&gn.set(t,r),r}const vn=Symbol(`default`);function yn({values:e,children:t}){for(let[n,i]of e)t=r.createElement(n.Provider,{value:i},t);return t}function bn(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:c}=e;return l(()=>{let e,l,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,l=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:l||o?{...o,...l}:void 0,children:u??a,"data-rac":``,render:c?e=>c(e,s):void 0}},[t,n,r,i,a,o,s,c])}function xn(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function Sn(e,t){let n=s(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||vn;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 Cn(e,t,n){let{ref:r,...i}=Sn(n,e.slot)||{},a=Ut(l(()=>kt(t,r),[t,r])),o=R(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 wn(e=!0){let[t,n]=f(e),r=d(!1),i=o(e=>{r.current=!0,n(!!e)},[]);return j(()=>{r.current||n(!1)},[]),[i,t]}function Tn(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function En(e,t,n){let{render:i,...a}=t,o=d(null),s=l(()=>kt(n,o),[n,o]);j(()=>{},[e,i]);let c={...a,ref:s};return i?i(c,void 0):r.createElement(e,c)}const Dn={},On=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=Dn[t];return n||(n=a(En.bind(null,t)),Dn[t]=n),n}}),kn=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function An(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}let jn=new WeakMap,H=[];function Mn(e,t){let n=N(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&kn,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(P())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(F(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=Ot(M(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=jn.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),jn.set(e,t+1))};H.length&&H[H.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=>F(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&An(e)?o.add(e):e instanceof Element&&d(e);if(P()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(P())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=>F(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&An(e)?o.add(e):e instanceof Element&&d(e);if(P()){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 H.push(h),()=>{if(p.disconnect(),P())for(let e of m)e.disconnect();for(let e of s){let t=jn.get(e);t!=null&&(t===1?(l(e,!1),jn.delete(e)):jn.set(e,t-1))}h===H[H.length-1]?(H.pop(),H.length&&H[H.length-1].observe()):H.splice(H.indexOf(h),1)}}const Nn=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Pn=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Fn(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 Nn.has(t.script)}let t=e.split(`-`)[0];return Pn.has(t)}const In=Symbol.for(`react-aria.i18n.locale`);function Ln(){let e=typeof window<`u`&&window[In]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:Fn(e)?`rtl`:`ltr`}}let Rn=Ln(),zn=new Set;function Bn(){Rn=Ln();for(let e of zn)e(Rn)}function Vn(){let e=ht(),[t,n]=f(Rn);return c(()=>(zn.size===0&&window.addEventListener(`languagechange`,Bn),zn.add(n),()=>{zn.delete(n),zn.size===0&&window.removeEventListener(`languagechange`,Bn)}),[]),e?{locale:typeof window<`u`&&window[In]||`en-US`,direction:`ltr`}:t}const Hn=r.createContext(null);function Un(){let e=Vn();return s(Hn)||e}const Wn=Symbol.for(`react-aria.i18n.locale`),Gn=Symbol.for(`react-aria.i18n.strings`);let Kn;var qn=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=Jn(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[Wn];if(Kn===void 0){let t=window[Gn];if(!t)return null;for(let r in Kn={},t)Kn[r]=new e({[n]:t[r]},n)}let r=Kn?.[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 Jn(e,t,n=`en-US`){if(t[e])return t[e];let r=Yn(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function Yn(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const Xn=new Map,Zn=new Map;var Qn=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=Xn.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),Xn.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=Zn.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),Zn.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}};const $n=new WeakMap;function er(e){let t=$n.get(e);return t||(t=new qn(e),$n.set(e,t)),t}function tr(e,t){return t&&qn.getGlobalDictionaryForPackage(t)||er(e)}function nr(e,t){let{locale:n}=Un(),r=tr(e,t);return l(()=>new Qn(n,r),[n,r])}function rr(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function ir(e,t){Object.defineProperty(e,`target`,{value:t}),Object.defineProperty(e,`currentTarget`,{value:t})}function ar(e){let t=d({isFocused:!1,observer:null});return j(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),o(n=>{let r=L(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=rr(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===I()?null:I();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 or=!1;function sr(e){for(;e&&!fn(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=N(e),n=t.document.activeElement;if(!n||n===e)return;or=!0;let r=!1,i=e=>{(L(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(L(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,Qe(n),c()))},o=t=>{(L(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(L(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,Qe(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),or=!1,r=!1},l=requestAnimationFrame(c);return c}let cr=`default`,lr=``,ur=new WeakMap;function dr(e){if(qe()){if(cr===`default`){let t=M(e);lr=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}cr=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;ur.set(e,e.style[t]),e.style[t]=`none`}}function fr(e){if(qe()){if(cr!==`disabled`)return;cr=`restoring`,setTimeout(()=>{Bt(()=>{if(cr===`restoring`){let t=M(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=lr||``),lr=``,cr=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&ur.has(e)){let t=ur.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),ur.delete(e)}}const pr=r.createContext({register:()=>{}});pr.displayName=`PressResponderContext`;function mr(e){let t=s(pr);if(t){let{register:n,ref:r,...i}=t;e=R(i,e),n()}return Kt(t,e.ref),e}var hr=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 gr=Symbol(`linkClicked`),_r=`react-aria-pressable-style`,vr=`data-react-aria-pressable`;function yr(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,onClick:s,isDisabled:u,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=mr(e),[y,b]=f(!1),x=d({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=Vt(),w=o((e,t)=>{let i=x.current;if(u||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new hr(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,b(!0),a},[u,r,n]),ee=o((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 hr(`pressend`,r,e);i(t),s=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&a&&!u){let n=new hr(`press`,r,e);t(n),s&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,s},[u,i,n,t]),T=Gt(ee),E=Gt(o((e,t)=>{let n=x.current;if(u)return!1;if(a){n.isTriggeringEvent=!0;let r=new hr(`pressup`,t,e);return a(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[u,a])),D=o(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&ee(U(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||fr(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,ee]),O=Gt(D),te=o(e=>{h&&D(e)},[h,D]),k=o(e=>{u||s?.(e)},[u,s]),ne=o((e,t)=>{if(!u&&s){let n=new MouseEvent(`click`,e);ir(n,t),s(rr(n))}},[u,s]),re=l(()=>{let e=x.current,t={onKeyDown(t){if(xr(t.nativeEvent,t.currentTarget)&&F(t.currentTarget,L(t))){Cr(L(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(M(t.currentTarget),`keyup`,Ct(t=>{xr(t,i)&&!t.repeat&&F(i,L(t))&&e.target&&E(U(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&We()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!F(t.currentTarget,L(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!rt.isOpening){let n=!0;if(u&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||$t(t.nativeEvent))){let e=w(t,`virtual`),r=E(t,`virtual`),i=T(t,`virtual`);k(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=E(U(t.currentTarget,t),r),a=T(U(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&&xr(t,e.target)){Cr(L(t),t.key)&&t.preventDefault();let n=L(t),r=F(e.target,n);T(U(e.target,t),`keyboard`,r),r&&ne(t,e.target),C(),t.key!==`Enter`&&br(e.target)&&F(e.target,n)&&!t[gr]&&(t[gr]=!0,rt(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||!F(t.currentTarget,L(t)))return;if(en(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||dr(e.target),i=w(t,e.pointerType);let a=L(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),S(M(t.currentTarget),`pointerup`,n,!1),S(M(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(F(t.currentTarget,L(t))&&t.button===0){if(m){let n=sr(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!F(t.currentTarget,L(t))||e.pointerType===`virtual`||t.button===0&&!e.isPressed&&E(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,w(U(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,T(U(e.target,t),e.pointerType,!1),te(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(F(e.target,L(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?O(t):(Qe(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=>{F(e.currentTarget,L(e))&&O(e)}}return t},[S,u,m,C,g,te,w,k,ne]);return c(()=>{if(!_)return;let e=M(_.current);if(!e||!e.head||e.getElementById(_r))return;let t=e.createElement(`style`);t.id=_r;let n=_n(e);n&&(t.nonce=n),t.textContent=`
|
|
2
|
-
@layer {
|
|
3
|
-
[${vr}] {
|
|
4
|
-
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`.trim(),e.head.prepend(t)},[_]),c(()=>{let e=x.current;return()=>{g||fr(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:R(v,re,{[vr]:!0})}}function br(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function xr(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof N(i).HTMLInputElement&&!Tr(i,n)||i instanceof N(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&br(i))&&n!==`Enter`)}function U(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 Sr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!br(e)}function Cr(e,t){return e instanceof HTMLInputElement?!Tr(e,t):Sr(e)}const wr=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Tr(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:wr.has(e.type)}let W=null;const Er=new Set;let Dr=new Map,G=!1,Or=!1;const kr={Tab:!0,Escape:!0};function Ar(e,t){for(let n of Er)n(e,t)}function jr(e){return!(e.metaKey||!We()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Mr(e){G=!0,!rt.isOpening&&jr(e)&&(W=`keyboard`,Ar(`keyboard`,e))}function Nr(e){W=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(G=!0,Ar(`pointer`,e))}function Pr(e){!rt.isOpening&&$t(e)&&(G=!0,W=`virtual`)}function Fr(e){let t=N(L(e)),n=M(L(e));L(e)===t||L(e)===n||or||!e.isTrusted||(!G&&!Or&&(W=`virtual`,Ar(`virtual`,e)),G=!1,Or=!1)}function Ir(){or||(G=!1,Or=!0)}function Lr(e){if(typeof window>`u`||typeof document>`u`)return;let t=N(e),n=M(e);if(Dr.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){G=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Mr,!0),n.addEventListener(`keyup`,Mr,!0),n.addEventListener(`click`,Pr,!0),t.addEventListener(`focus`,Fr,!0),t.addEventListener(`blur`,Ir,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Nr,!0),n.addEventListener(`pointermove`,Nr,!0),n.addEventListener(`pointerup`,Nr,!0)),t.addEventListener(`beforeunload`,()=>{Rr(e)},{once:!0}),Dr.set(t,{focus:r})}const Rr=(e,t)=>{let n=N(e),r=M(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Dr.has(n)&&(n.HTMLElement.prototype.focus=Dr.get(n).focus,r.removeEventListener(`keydown`,Mr,!0),r.removeEventListener(`keyup`,Mr,!0),r.removeEventListener(`click`,Pr,!0),n.removeEventListener(`focus`,Fr,!0),n.removeEventListener(`blur`,Ir,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Nr,!0),r.removeEventListener(`pointermove`,Nr,!0),r.removeEventListener(`pointerup`,Nr,!0)),Dr.delete(n))};function zr(e){let t=M(e),n;return t.readyState===`loading`?(n=()=>{Lr(e)},t.addEventListener(`DOMContentLoaded`,n)):Lr(e),()=>Rr(e,n)}typeof document<`u`&&zr();function Br(){return W!==`pointer`}function Vr(){return W}function Hr(e){W=e,Ar(e,null)}const Ur=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Wr(e,t,n){let r=n?L(n):void 0,i=M(r),a=N(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=I(i);return e=e||u instanceof o&&!Ur.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!kr[n.key])}function Gr(e,t,n){Lr(),c(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Wr(!!n?.isTextInput,t,r)&&e(Br())};return Er.add(t),()=>{Er.delete(t)}},t)}function Kr(e){if(!e.isConnected)return;let t=M(e);if(Vr()===`virtual`){let n=I(t);Bt(()=>{let r=I(t);(r===n||r===t.body)&&e.isConnected&&Qe(e)})}else Qe(e)}const qr=r.createContext(null),Jr=`react-aria-focus-scope-restore`;let K=null;function Yr(e){let{children:t,contain:n,restoreFocus:i,autoFocus:a}=e,o=d(null),u=d(null),f=d([]),{parentNode:p}=s(qr)||{},m=l(()=>new fi({scopeRef:f}),[f]);j(()=>{let e=p||Q.root;if(Q.getTreeNode(e.scopeRef)&&K&&!ri(K,e.scopeRef)){let t=Q.getTreeNode(K);t&&(e=t)}e.addChild(m),Q.addNode(m)},[m,p]),j(()=>{let e=Q.getTreeNode(f);e&&(e.contain=!!n)},[n]),j(()=>{let e=o.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==u.current;)t.push(e),e.addEventListener(Jr,n),e=e.nextSibling;return f.current=t,()=>{for(let e of t)e.removeEventListener(Jr,n)}},[t]),si(f,i,n),ei(f,n),li(f,i,n),oi(f,a),c(()=>{let e=I(M(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)&&(K=t.scopeRef)}},[f]),j(()=>()=>{let e=Q.getTreeNode(f)?.parent?.scopeRef??null;(f===K||ri(f,K))&&(!e||Q.getTreeNode(e))&&(K=e),Q.removeTreeNode(f)},[f]);let h=l(()=>Xr(f),[]),g=l(()=>({focusManager:h,parentNode:m}),[m,h]);return r.createElement(qr.Provider,{value:g},r.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,r.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:u}))}function Xr(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||I(M(n[0]??void 0)),c=n[0].previousElementSibling,l=Z(q(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||I(M(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Z(q(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(q(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(q(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&X(o,!0),o}}}function q(e){return e[0].parentElement}function Zr(e){let t=Q.getTreeNode(K);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Qr(e){if(!e.form)return Array.from(M(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=N(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function $r(e){if(e.checked)return!0;let t=Qr(e);return t.length>0&&!t.some(e=>e.checked)}function ei(e,t){let n=d(void 0),r=d(void 0);j(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=M(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Zr(e)||t.isComposing)return;let n=I(a),r=e.current;if(!r||!J(n,r))return;let i=Z(q(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 N(o).HTMLInputElement&&o.select())},s=t=>{(!K||ri(K,e))&&J(L(t),e.current)?(K=e,n.current=L(t)):Zr(e)&&!Y(L(t),e)?n.current?n.current.focus():K&&K.current&&ai(K.current):Zr(e)&&(n.current=L(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=Vr(),i=(r===`virtual`||r===null)&&Xe()&&Ye(),o=I(a);if(!i&&o&&Zr(e)&&!Y(o,e)){K=e;let r=L(t);r&&r.isConnected?(n.current=r,n.current?.focus()):K.current&&ai(K.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]),j(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function ti(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>F(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 ni(e){return Y(e,K)}function ri(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{Kr(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function ii(e,t=!0){let n=e[0].previousElementSibling,r=q(e),i=Z(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=q(e),i=Z(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function ai(e,t=!0){X(ii(e,t))}function oi(e,t){let n=r.useRef(t);c(()=>{n.current&&(K=e,!J(I(M(e.current?e.current[0]:void 0)),K.current)&&e.current&&ai(e.current)),n.current=!1},[e])}function si(e,t,n){j(()=>{if(t||n)return;let r=e.current,i=M(r?r[0]:void 0),a=t=>{let n=L(t);J(n,e.current)?K=e:ti(n)||(K=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 ci(e){let t=Q.getTreeNode(K);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function li(e,t,n){let r=d(typeof document<`u`?I(M(e.current?e.current[0]:void 0)):null);j(()=>{let r=e.current,i=M(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!K||ri(K,e))&&J(I(i),e.current)&&(K=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]),j(()=>{let r=M(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Zr(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!ci(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):ti(a)?X(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),j(()=>{let n=M(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=I(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&ci(e))){let t=Q.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){ui(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Q.getTreeNode(n.scopeRef)){ui(ii(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function ui(e){e.dispatchEvent(new CustomEvent(Jr,{bubbles:!0,cancelable:!0}))&&X(e)}function Z(e,t,n){let r=t?.tabbable?pn:fn,i=M(e?.nodeType===Node.ELEMENT_NODE?e:null),a=Ot(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return F(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!$r(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 di=class e{constructor(){this.fastMap=new Map,this.root=new fi({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 fi({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}},fi=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 di;function pi(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=o(e=>{if(L(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),s=ar(a),c=o(e=>{let t=L(e),r=M(t),a=r?I(r):I();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)?a:void 0}}}function mi(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 hi(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:mi(e.onKeyDown),onKeyUp:mi(e.onKeyUp)}}}let gi=r.createContext(null);function _i(e){let t=s(gi)||{};Kt(t,e);let{ref:n,...r}=t;return r}function vi(e,t){let{focusProps:n}=pi(e),{keyboardProps:r}=hi(e),i=R(n,r),a=_i(t),o=e.isDisabled?{}:a,s=d(e.autoFocus);c(()=>{s.current&&t.current&&Kr(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:R({...i,tabIndex:l},o)}}const yi=typeof document<`u`?r.useInsertionEffect??r.useLayoutEffect:()=>{};function bi(e,t,n){let[r,i]=f(e||t),a=d(r),s=d(e!==void 0),l=e!==void 0;c(()=>{s.current,s.current=l},[l]);let p=l?e:r;yi(()=>{a.current=p});let[,m]=u(()=>({}),{});return[p,o((e,...t)=>{let r=typeof e==`function`?e(a.current):e;Object.is(a.current,r)||(a.current=r,i(r),m(),n?.(r,...t))},[n])]}function xi(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=d({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:c}=Vt(),l=o(e=>{F(e.currentTarget,L(e))&&a.current.isFocusWithin&&!F(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,c(),n&&n(e),i&&i(!1))},[n,i,a,c]),u=ar(l),f=o(e=>{if(!F(e.currentTarget,L(e)))return;let t=L(e),n=M(t),o=I(n);if(!a.current.isFocusWithin&&o===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,u(e);let t=e.currentTarget;s(n,`focus`,e=>{let r=L(e);if(a.current.isFocusWithin&&!F(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});ir(e,t),l(rr(e))}},{capture:!0})}},[r,i,u,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:l}}}function Si(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=d({isFocused:!1,isFocusVisible:t||Br()}),[a,s]=f(!1),[c,l]=f(()=>i.current.isFocused&&i.current.isFocusVisible),u=o(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),p=o(e=>{i.current.isFocused=e,i.current.isFocusVisible=Br(),s(e),u()},[u]);Gr(e=>{i.current.isFocusVisible=e,u()},[n,a],{enabled:a,isTextInput:n});let{focusProps:m}=pi({isDisabled:r,onFocusChange:p}),{focusWithinProps:h}=xi({isDisabled:!r,onFocusWithinChange:p});return{isFocused:a,isFocusVisible:c,focusProps:r?h:m}}function Ci({children:e}){let t=l(()=>({register:()=>{}}),[]);return r.createElement(pr.Provider,{value:t},e)}let wi=!1,Ti=0;function Ei(){wi=!0,setTimeout(()=>{wi=!1},500)}function Di(e){e.pointerType===`touch`&&Ei()}function Oi(){let e=M(null);if(e!==void 0)return Ti===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Di),Ti++,()=>{Ti--,!(Ti>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Di)}}function ki(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=f(!1),s=d({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;c(Oi,[]);let{addGlobalListener:u,removeAllGlobalListeners:p}=Vt(),{hoverProps:m,triggerHoverEnd:h}=l(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!F(e.currentTarget,L(e)))return;s.isHovered=!0;let c=e.currentTarget;s.target=c,u(M(L(e)),`pointerover`,e=>{s.isHovered&&s.target&&!F(s.target,L(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:c,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},c={};return typeof PointerEvent<`u`&&(c.onPointerEnter=t=>{wi&&t.pointerType===`mouse`||e(t,t.pointerType)},c.onPointerLeave=e=>{!i&&F(e.currentTarget,L(e))&&a(e,e.pointerType)}),{hoverProps:c,triggerHoverEnd:a}},[t,n,r,i,s,u,p]);return c(()=>{i&&h({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:m,isHovered:a}}function Ai(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=d({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=Gt(e=>{n&&ji(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=Gt(e=>{n&&n(e)});c(()=>{let e=a.current;if(r)return;let n=t.current,i=M(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&ji(n,t)&&s(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 ji(e,t){if(e.button>0)return!1;let n=L(e);if(n){let e=n.ownerDocument;if(!e||!F(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 Mi=i(!1);function Ni(e){let t=(t,n)=>s(Mi)?null:e(t,n);return t.displayName=e.displayName||e.name,a(t)}function Pi(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}=yr({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=vi(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=R(y,_,z(e,{labelable:!0}));return{isPressed:v,buttonProps:R(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 Fi={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 Ii(e={}){let{style:t,isFocusable:n}=e,[r,i]=f(!1),{focusWithinProps:a}=xi({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=l(()=>r?t:t?{...Fi,...t}:Fi,[r]);return{visuallyHiddenProps:{...a,style:o}}}function Li(e){let{children:t,elementType:n=`div`,isFocusable:i,style:a,...o}=e,{visuallyHiddenProps:s}=Ii(e);return r.createElement(n,R(o,s),t)}const Ri=i({});function zi(){return s(Ri)??{}}const Bi=r.createContext(null);function Vi(e){let t=ht(),{portalContainer:n=t?null:document.body,isExiting:i}=e,[a,o]=f(!1),s=l(()=>({contain:a,setContain:o}),[a,o]),{getContainer:c}=zi();if(!e.portalContainer&&c&&(n=c()),!n)return null;let u=e.children;return e.disableFocusManagement||(u=r.createElement(Yr,{restoreFocus:!0,contain:(e.shouldContainFocus||a)&&!i},u)),u=r.createElement(Bi.Provider,{value:s},r.createElement(Ci,null,u)),x.createPortal(u,n)}function Hi(){let e=s(Bi)?.setContain;j(()=>{e?.(!0)},[e])}function Ui(e,t){let{role:n=`dialog`}=e,r=St();r=e[`aria-label`]?void 0:r;let i=d(!1);return c(()=>{if(t.current&&!Et(t.current)){Kr(t.current);let e=setTimeout(()=>{(I()===t.current||I()===document.body)&&(i.current=!0,t.current&&(t.current.blur(),Kr(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),Hi(),d(!1),c(()=>{}),{dialogProps:{...z(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]||r,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:r}}}var Wi={};Wi={dismiss:`تجاهل`};var Gi={};Gi={dismiss:`Отхвърляне`};var Ki={};Ki={dismiss:`Odstranit`};var qi={};qi={dismiss:`Luk`};var Ji={};Ji={dismiss:`Schließen`};var Yi={};Yi={dismiss:`Απόρριψη`};var Xi={};Xi={dismiss:`Dismiss`};var Zi={};Zi={dismiss:`Descartar`};var Qi={};Qi={dismiss:`Lõpeta`};var $i={};$i={dismiss:`Hylkää`};var ea={};ea={dismiss:`Rejeter`};var ta={};ta={dismiss:`התעלם`};var na={};na={dismiss:`Odbaci`};var ra={};ra={dismiss:`Elutasítás`};var ia={};ia={dismiss:`Ignora`};var aa={};aa={dismiss:`閉じる`};var oa={};oa={dismiss:`무시`};var sa={};sa={dismiss:`Atmesti`};var ca={};ca={dismiss:`Nerādīt`};var la={};la={dismiss:`Lukk`};var ua={};ua={dismiss:`Negeren`};var da={};da={dismiss:`Zignoruj`};var fa={};fa={dismiss:`Descartar`};var pa={};pa={dismiss:`Dispensar`};var ma={};ma={dismiss:`Revocare`};var ha={};ha={dismiss:`Пропустить`};var ga={};ga={dismiss:`Zrušiť`};var _a={};_a={dismiss:`Opusti`};var va={};va={dismiss:`Odbaci`};var ya={};ya={dismiss:`Avvisa`};var ba={};ba={dismiss:`Kapat`};var xa={};xa={dismiss:`Скасувати`};var Sa={};Sa={dismiss:`取消`};var Ca={};Ca={dismiss:`關閉`};var wa={};wa={"ar-AE":Wi,"bg-BG":Gi,"cs-CZ":Ki,"da-DK":qi,"de-DE":Ji,"el-GR":Yi,"en-US":Xi,"es-ES":Zi,"et-EE":Qi,"fi-FI":$i,"fr-FR":ea,"he-IL":ta,"hr-HR":na,"hu-HU":ra,"it-IT":ia,"ja-JP":aa,"ko-KR":oa,"lt-LT":sa,"lv-LV":ca,"nb-NO":la,"nl-NL":ua,"pl-PL":da,"pt-BR":fa,"pt-PT":pa,"ro-RO":ma,"ru-RU":ha,"sk-SK":ga,"sl-SI":_a,"sr-SP":va,"sv-SE":ya,"tr-TR":ba,"uk-UA":xa,"zh-CN":Sa,"zh-TW":Ca};function Ta(e){return e&&e.__esModule?e.default:e}function Ea(e){let{onDismiss:t,...n}=e,i=Ht(n,nr(Ta(wa),`@react-aria/overlays`).format(`dismiss`)),a=()=>{t&&t()};return r.createElement(Li,null,r.createElement(`button`,{...i,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}const $=[];function Da(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,l=d(void 0);c(()=>{if(i&&!$.includes(t))return $.push(t),()=>{let e=$.indexOf(t);e>=0&&$.splice(e,1)}},[i,t]);let u=()=>{$[$.length-1]===t&&n&&n()},f=e=>{let n=$[$.length-1];l.current=n,(!s||s(L(e)))&&n===t&&e.stopPropagation()},p=e=>{(!s||s(L(e)))&&($[$.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0},m=e=>{e.key===`Escape`&&!o&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),u())};Ai({ref:t,onInteractOutside:a&&i?p:void 0,onInteractOutsideStart:f});let{focusWithinProps:h}=xi({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||ni(e.relatedTarget)||(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:m,...h},underlayProps:{}}}const Oa=typeof document<`u`&&window.visualViewport;let ka=0,Aa;function ja(e={}){let{isDisabled:t}=e;j(()=>{if(!t)return ka++,ka===1&&(Aa=qe()?Na():Ma()),()=>{ka--,ka===0&&Aa()}},[t])}function Ma(){let e=window.innerWidth-document.documentElement.clientWidth;return Ct(e>0&&(`scrollbarGutter`in document.documentElement.style?Pa(document.documentElement,`scrollbarGutter`,`stable`):Pa(document.documentElement,`paddingRight`,`${e}px`)),Pa(document.documentElement,`overflow`,`hidden`))}function Na(){let e=Pa(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=L(e);t=qt(r)?r:Jt(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=_n();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=L(e),n=e.relatedTarget;n&&Xt(n)?(n.focus({preventScroll:!0}),Ia(n,Xt(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=I(),n=t!=null&&Xt(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&Ia(this,n)};let l=Ct(Fa(document,`touchstart`,r,{passive:!1,capture:!0}),Fa(document,`touchmove`,o,{passive:!1,capture:!0}),Fa(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function Pa(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Fa(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ia(e,t){t||!Oa?La(e):Oa.addEventListener(`resize`,()=>La(e),{once:!0})}function La(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=Jt(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;Oa&&(n=Math.min(n,Oa.offsetTop+Oa.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 Ra(e,t,n){let{overlayProps:r,underlayProps:i}=Da({...e,isOpen:t.isOpen,onClose:t.close},n);return ja({isDisabled:!t.isOpen}),Hi(),c(()=>{if(t.isOpen&&n.current)return Mn([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:R(r),underlayProps:i}}const za=i({}),Ba=Ni(function(e,t){[e,t]=Cn(e,t,za);let{elementType:n=`label`,...i}=e,a=On[n];return r.createElement(a,{className:`react-aria-Label`,...i,ref:t})}),Va=i(null),Ha=7e3;let Ua=null;function Wa(e,t=`assertive`,n=Ha){Ua?Ua.announce(e,t,n):(Ua=new Ga,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?Ua.announce(e,t,n):setTimeout(()=>{Ua?.isAttached()&&Ua?.announce(e,t,n)},100))}var Ga=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=Ha){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 Ka=i({}),qa=Ni(function(e,t){[e,t]=Cn(e,t,Ka);let n=e,{isPending:i}=n,{buttonProps:a,isPressed:o}=Pi(e,t);a=Ya(a,i);let{focusProps:s,isFocused:l,isFocusVisible:u}=Si(e),{hoverProps:f,isHovered:p}=ki({...e,isDisabled:e.isDisabled||i}),m={isHovered:p,isPressed:(n.isPressed||o)&&!i,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:i??!1},h=bn({...e,values:m,defaultClassName:`react-aria-Button`}),g=bt(a.id),_=bt(),v=a[`aria-labelledby`];i&&(v?v=`${v} ${_}`:a[`aria-label`]&&(v=`${g} ${_}`));let y=d(i);c(()=>{let e={"aria-labelledby":v||g};(!y.current&&l&&i||y.current&&l&&!i)&&Wa(e,`assertive`),y.current=i},[i,l,v,g]);let b=z(e,{global:!0});return delete b.onClick,r.createElement(On.button,{...R(b,h,a,s,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":u||void 0},r.createElement(Va.Provider,{value:{id:_}},h.children))}),Ja=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function Ya(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!Ja.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}function Xa(e){let[t,n]=bi(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:o(()=>{n(!0)},[n]),close:o(()=>{n(!1)},[n]),toggle:o(()=>{n(!t)},[n,t])}}const Za=i(null),Qa=i(null),$a=a(function(e,t){let n=e[`aria-labelledby`];[e,t]=Cn(e,t,Za);let{dialogProps:i,titleProps:a}=Ui({...e,"aria-labelledby":n},t),o=s(Qa);!i[`aria-label`]&&!i[`aria-labelledby`]&&e[`aria-labelledby`]&&(i[`aria-labelledby`]=e[`aria-labelledby`]);let c=bn({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),l=z(e,{global:!0});return r.createElement(On.section,{...R(l,c,i),render:e.render,ref:t,slot:e.slot||void 0},r.createElement(yn,{values:[[Be,{slots:{[vn]:{},title:{...a,level:2}}}],[Ka,{slots:{[vn]:{},close:{onPress:()=>o?.close()}}}]]},c.children))}),eo=i(null),to=i(null),no=a(function(e,t){if(s(to))return r.createElement(oo,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,children:l,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p,...m}=e;return r.createElement(io,{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p},r.createElement(oo,{...m,modalRef:t},l))});function ro(e,t){[e,t]=Cn(e,t,eo);let n=s(Qa),i=Xa(e),a=e.isOpen!=null||e.defaultOpen!=null||!n?i:n,o=Ut(t),c=d(null),l=nn(o,a.isOpen),u=nn(c,a.isOpen),f=l||u||e.isExiting||!1,p=ht();return!a.isOpen&&!f||p?null:r.createElement(ao,{...e,state:a,isExiting:f,overlayRef:o,modalRef:c})}const io=a(ro);function ao({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:i}=t,{modalProps:a,underlayProps:o}=Ra(t,i,n),s=tn(t.overlayRef)||t.isEntering||!1,c=bn({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:s,isExiting:t.isExiting,state:i}}),l=Zt(),u;if(typeof document<`u`){let e=qt(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 r.createElement(Vi,{isExiting:t.isExiting,portalContainer:e},r.createElement(On.div,{...R(z(t,{global:!0}),o),...c,style:d,ref:t.overlayRef,"data-entering":s||void 0,"data-exiting":t.isExiting||void 0},r.createElement(yn,{values:[[to,{modalProps:a,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[Qa,i]]},c.children)))}function oo(e){let{modalProps:t,modalRef:n,isExiting:i,isDismissable:a}=s(to),o=s(Qa),c=Ut(l(()=>kt(e.modalRef,n),[e.modalRef,n])),u=tn(c),d=bn({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:u,isExiting:i,state:o}});return r.createElement(On.div,{...R(z(e,{global:!0}),t),...d,ref:c,"data-entering":u||void 0,"data-exiting":i||void 0},a&&r.createElement(Ea,{onDismiss:o.close}),d.children)}const so=()=>{let[n,r]=f(!1);return c(()=>{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},co=({className:e,iconClassName:t,onClose:n})=>so()?null:v(`button`,{type:`button`,className:e,"aria-label":`Dismiss`,onClick:n,children:v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`none`,className:t,children:v(`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`})})}),lo=({children:e,classNames:t,isDismissable:r,onDismiss:i,closeOnFinishMs:a})=>{let{survey:o,surveyId:s,dismiss:c}=Re(),[l,u]=f(!1);return m(()=>{o&&c()},l?a:null),y($a,{"aria-label":`Survey`,id:`${s}-popover`,className:b(`confetti-modal-dialog ${n}`,t?.dialog),children:[r&&v(co,{className:b(`confetti-modal-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await c(),i?.()}}),typeof e==`function`?e({setIsFinished:()=>u(!0)}):e]})},uo=({children:e,classNames:t,onDismiss:r,isDismissable:i=!0,closeOnFinishMs:a=3e3})=>{let{dismiss:o}=Re();return v(io,{isOpen:!0,isDismissable:i,isKeyboardDismissDisabled:!i,onOpenChange:async e=>{e||(await o(),r?.())},className:b(`confetti-modal-overlay ${n}`,t?.overlay),children:v(no,{className:b(`confetti-modal ${n}`,t?.modal),children:v(lo,{classNames:t,isDismissable:i,onDismiss:r,closeOnFinishMs:a,children:e})})})};export{z as A,Fe as B,xn as C,Gt as D,Sn as E,St as F,Ee as G,Re as H,bt as I,Ae as J,Te as K,j as L,kt as M,L as N,Ut as O,N as P,Ve as R,wn as S,Tn as T,Ce as U,Le as V,ke as W,he as X,me as Y,ne as Z,yr as _,qa as a,Cn as b,Li as c,Si as d,xi as f,Hr as g,Z as h,so as i,R as j,Ht as k,Ni as l,vi as m,lo as n,za as o,bi as p,Oe as q,co as r,Ba as s,uo as t,ki as u,Un as v,On as w,bn as x,yn as y,ze as z};
|