@opengovsg/confetti 0.8.2 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -150,12 +150,16 @@ Choose the component that best fits your use case:
150
150
 
151
151
  ## Locale
152
152
 
153
+ Requires `@opengovsg/confetti` `0.8.2` or later. Older versions keep the
154
+ English survey — they do not fail to load.
155
+
153
156
  Pass `locale` to show a translated survey. Author translations in the Confetti
154
157
  dashboard (English is always the source; Chinese, Malay, and Tamil are
155
158
  optional). Untranslated fields fall back to English.
156
159
 
157
- `useResolveLocale` maps a BCP-47 tag (or the browser's language preferences)
158
- to `'en' | 'zh' | 'ms' | 'ta'`:
160
+ The widget does not read the browser language on its own. Use
161
+ `useResolveLocale` to map a BCP-47 tag (or the browser's language
162
+ preferences) to `'en' | 'zh' | 'ms' | 'ta'`:
159
163
 
160
164
  ```tsx
161
165
  import { PopoverConfetti, useResolveLocale } from '@opengovsg/confetti'
@@ -174,8 +178,9 @@ function Feedback() {
174
178
  ```
175
179
 
176
180
  Pass `preferred` when the host app already knows the locale (for example
177
- next-intl), and `explicit` for an override that should win even when it does
178
- not match a Confetti locale:
181
+ next-intl). Pass `explicit` for an override that wins even when it does not
182
+ match a Confetti locale — including an empty string, which falls back to
183
+ English instead of `preferred`:
179
184
 
180
185
  ```tsx
181
186
  const locale = useResolveLocale({
@@ -184,6 +189,16 @@ const locale = useResolveLocale({
184
189
  })
185
190
  ```
186
191
 
192
+ To always show one language, pass `locale` directly and skip the hook:
193
+
194
+ ```tsx
195
+ <PopoverConfetti
196
+ surveyId="your-survey-id"
197
+ publishableKey="your-publishable-key"
198
+ locale="zh"
199
+ />
200
+ ```
201
+
187
202
  | Value | Language |
188
203
  | ----- | ----------------- |
189
204
  | `en` | English (default) |
@@ -196,7 +211,9 @@ placeholders, and validation errors — still localises for the given locale.
196
211
  Omit `locale`, or pass `'en'`, to keep the English survey.
197
212
 
198
213
  The same prop is accepted on the [static](#static-components) components and
199
- on the [building-block](#building-blocks) primitives.
214
+ on the [building-block](#building-blocks) primitives. Import
215
+ `useResolveLocale` from `@opengovsg/confetti` in those setups too. See the
216
+ [translations guide](https://docs.confetti.gov.sg/docs/surveys/translations).
200
217
 
201
218
  ## Static Components
202
219
 
@@ -0,0 +1,7 @@
1
+ import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import l from"ky";import u from"clsx";import"react-dom";const d=l.create({prefixUrl:`https://confetti.gov.sg`,retry:{limit:3,methods:[`get`,`head`]},timeout:6e4});function f({publishableKey:e,apiBaseUrl:t}){return o(()=>{let n={headers:{"x-cfti-pk":e}};return t&&(n.prefixUrl=t),d.extend(n)},[t,e])}const p=typeof document<`u`?e.useLayoutEffect:()=>{};typeof window<`u`&&window.document&&window.document.createElement;let m=new Map;typeof FinalizationRegistry<`u`&&new FinalizationRegistry(e=>{m.delete(e)});function h(e,t){if(e===t)return e;let n=m.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=m.get(t);return r?(r.forEach(t=>t.current=e),e):t}function g(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function _(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=v(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():v(e[n],null)})}}}function v(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function y(...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]=g(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=u(n,i):e===`id`&&n&&i?t.id=h(n,i):e===`ref`&&n&&i?t.ref=_(n,i):t[e]=i===void 0?n:i}}return t}const b=new Set([`id`]),x=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),S=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),C=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),w=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(`.`)),T=/^(data-.*)$/;function E(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)&&(b.has(t)||n&&x.has(t)||r&&S.has(t)||i&&C.has(t)||a&&(w.has(t)||t.endsWith(`Capture`)&&w.has(t.slice(0,-7)))||o?.has(t)||T.test(t))&&(s[t]=e[t]);return s}function D(e){let t=s(null),n=s(void 0),i=r(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 o(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=i(e))}}),[i])}const O=Symbol(`default`);function k({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function ee(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function te(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function A(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||O;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 ne(e,t,n){let{ref:r,...i}=A(n,e.slot)||{},a=D(o(()=>_(t,r),[t,r])),s=y(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(typeof i.style==`function`||typeof e.style==`function`?s.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}}:s.style={...i.style,...e.style}),[s,a]}function re(e=!0){let[t,n]=c(e),i=s(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return p(()=>{i.current||n(!1)},[]),[a,t]}function ie(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function ae(t,n,r){let{render:i,...a}=n,c=s(null),l=o(()=>_(r,c),[r,c]);p(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const oe={},se=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=oe[t];return r||(r=n(ae.bind(null,t)),oe[t]=r),r}});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 ce=t(!1);function le(e){let t=(t,n)=>i(ce)?null:e(t,n);return t.displayName=e.displayName||e.name,n(t)}function j(e){if(de())e.focus({preventScroll:!0});else{let t=fe(e);e.focus(),pe(t)}}let ue=null;function de(){if(ue==null){ue=!1;try{document.createElement(`div`).focus({get preventScroll(){return ue=!0,!0}})}catch{}}return ue}function fe(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 pe(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}const M=e=>e?.ownerDocument??document,N=e=>e&&`window`in e&&e.window===e?e:M(e).defaultView||window;function me(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function he(e){return me(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:he(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 ge(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)}const _e=typeof Element<`u`&&`checkVisibility`in Element.prototype;function ve(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}=N(e),{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function ye(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 be(e,t){return _e?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&ve(e)&&ye(e,t)&&(!e.parentElement||be(e.parentElement,e))}const xe=[`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`],Se=xe.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;xe.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const Ce=xe.join(`:not([hidden]):not([tabindex="-1"]),`);function we(e,t){return e.matches(Se)&&!Ee(e)&&(t?.skipVisibilityCheck||be(e))}function Te(e){return e.matches(Ce)&&be(e)&&!Ee(e)}function Ee(e){let t=e;for(;t!=null;){if(t instanceof N(t).HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}const R=typeof document<`u`?e.useLayoutEffect:()=>{};function De(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Oe(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ke(e){let t=s({isFocused:!1,observer:null});return R(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),r(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=De(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 Ae=!1;function je(e){for(;e&&!we(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=N(e),n=t.document.activeElement;if(!n||n===e)return;Ae=!0;let r=!1,i=e=>{(L(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(L(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,j(n),c()))},o=t=>{(L(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(L(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,j(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),Ae=!1,r=!1},l=requestAnimationFrame(c);return c}function Me(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 Ne(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function z(e){let t=null;return()=>(t??=e(),t)}const B=z(function(){return Ne(/^Mac/i)}),Pe=z(function(){return Ne(/^iPhone/i)}),Fe=z(function(){return Ne(/^iPad/i)||B()&&navigator.maxTouchPoints>1}),Ie=z(function(){return Pe()||Fe()}),Le=z(function(){return Me(/AppleWebKit/i)&&!Re()}),Re=z(function(){return Me(/Chrome/i)}),ze=z(function(){return Me(/Android/i)}),Be=z(function(){return Me(/Firefox/i)});function Ve(e){return e.pointerType===``&&e.isTrusted?!0:ze()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function He(e){return!ze()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}function V(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;Be()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(B()?r=!0:i=!0);let s=Le()&&B()&&!Fe()?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});V.isOpening=n,j(e),e.dispatchEvent(s),V.isOpening=!1}V.isOpening=!1;const Ue={prefix:String(Math.round(Math.random()*1e10)),current:0},We=e.createContext(Ue),Ge=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let Ke=new WeakMap;function qe(t=!1){let n=i(We),r=s(null);if(r.current===null&&!t){let t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(t){let e=Ke.get(t);e==null?Ke.set(t,{id:n.current,state:t.memoizedState}):t.memoizedState!==e.state&&(n.current=e.id,Ke.delete(t))}r.current=++n.current}return r.current}function Je(e){let t=i(We),n=qe(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function Ye(t){let n=e.useId(),[r]=c(et()),i=r?`react-aria`:`react-aria${Ue.prefix}`;return t||`${i}-${n}`}const Xe=typeof e.useId==`function`?Ye:Je;function Ze(){return!1}function Qe(){return!0}function $e(e){return()=>{}}function et(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore($e,Ze,Qe):i(Ge)}let H=null;const tt=new Set;let U=new Map,W=!1,nt=!1;const rt={Tab:!0,Escape:!0};function it(e,t){for(let n of tt)n(e,t)}function at(e){return!(e.metaKey||!B()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function ot(e){W=!0,!V.isOpening&&at(e)&&(H=`keyboard`,it(`keyboard`,e))}function G(e){H=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(W=!0,it(`pointer`,e))}function st(e){!V.isOpening&&Ve(e)&&(W=!0,H=`virtual`)}function ct(e){let t=N(L(e)),n=M(L(e));L(e)===t||L(e)===n||Ae||!e.isTrusted||(!W&&!nt&&(H=`virtual`,it(`virtual`,e)),W=!1,nt=!1)}function lt(){Ae||(W=!1,nt=!0)}function ut(e){if(typeof window>`u`||typeof document>`u`)return;let t=N(e),n=M(e);if(U.get(t))return;let r=t.HTMLElement.prototype.focus;Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){W=!0,r.apply(this,arguments)}}),n.addEventListener(`keydown`,ot,!0),n.addEventListener(`keyup`,ot,!0),n.addEventListener(`click`,st,!0),t.addEventListener(`focus`,ct,!0),t.addEventListener(`blur`,lt,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,G,!0),n.addEventListener(`pointermove`,G,!0),n.addEventListener(`pointerup`,G,!0)),t.addEventListener(`beforeunload`,()=>{dt(e)},{once:!0}),U.set(t,{focus:r})}const dt=(e,t)=>{let n=N(e),r=M(e);t&&r.removeEventListener(`DOMContentLoaded`,t),U.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:U.get(n).focus}),r.removeEventListener(`keydown`,ot,!0),r.removeEventListener(`keyup`,ot,!0),r.removeEventListener(`click`,st,!0),n.removeEventListener(`focus`,ct,!0),n.removeEventListener(`blur`,lt,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,G,!0),r.removeEventListener(`pointermove`,G,!0),r.removeEventListener(`pointerup`,G,!0)),U.delete(n))};function ft(e){let t=M(e),n;return t.readyState===`loading`?(n=()=>{ut(e)},t.addEventListener(`DOMContentLoaded`,n)):ut(e),()=>dt(e,n)}typeof document<`u`&&ft();function pt(){return H!==`pointer`}function mt(){return H}function ht(e){H=e,it(e,null)}const gt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function _t(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&&!gt.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!rt[n.key])}function vt(e,t,n){ut(),a(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{_t(!!n?.isTextInput,t,r)&&e(pt())};return tt.add(t),()=>{tt.delete(t)}},t)}let K=new Map,yt=new Set;function bt(){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=K.get(r);i||(i=new Set,K.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=K.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),K.delete(r)),K.size===0)){for(let e of yt)e();yt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,bt):bt());function xt(){for(let[e]of K)`isConnected`in e&&!e.isConnected&&K.delete(e)}function St(e){requestAnimationFrame(()=>{xt(),K.size===0?e():yt.add(e)})}function Ct(e){if(!e.isConnected)return;let t=M(e);if(mt()===`virtual`){let n=I(t);St(()=>{let r=I(t);(r===n||r===t.body)&&e.isConnected&&j(e)})}else j(e)}function wt(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Tt(e){let[t,n]=c(e),i=s(t),a=s(null),o=s(()=>{if(!a.current)return;let e=a.current.next();if(e.done){a.current=null;return}i.current===e.value?o.current():n(e.value)});return R(()=>{i.current=t,a.current&&o.current()}),[t,r(e=>{a.current=e(i.current),o.current()},[o])]}let Et=!!(typeof window<`u`&&window.document&&window.document.createElement),q=new Map,J;typeof FinalizationRegistry<`u`&&(J=new FinalizationRegistry(e=>{q.delete(e)}));function Dt(e){let[t,n]=c(e),r=s(null),i=Xe(t),o=s(null);if(J&&J.register(o,i),Et){let e=q.get(i);e&&!e.includes(r)?e.push(r):q.set(i,[r])}return R(()=>{let e=i;return()=>{J&&J.unregister(o),q.delete(e)}},[i]),a(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function Ot(e,t){if(e===t)return e;let n=q.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=q.get(t);return r?(r.forEach(t=>t.current=e),e):t}function kt(e=[]){let t=Dt(),[n,i]=Tt(t),a=r(()=>{i(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,i]);return R(a,[t,a,...e]),n}function At(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=jt(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():jt(e[n],null)})}}}function jt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Y(...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]=wt(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=u(n,i):e===`id`&&n&&i?t.id=Ot(n,i):e===`ref`&&n&&i?t.ref=At(n,i):t[e]=i===void 0?n:i}}return t}function Mt(e){let{isDisabled:t,onFocus:n,onBlur:i,onFocusChange:a}=e,o=r(e=>{if(L(e)===e.currentTarget)return i&&i(e),a&&a(!1),!0},[i,a]),s=ke(o),c=r(e=>{let t=L(e),r=M(t),i=r?I(r):I();t===e.currentTarget&&t===i&&(n&&n(e),a&&a(!0),s(e))},[a,n,s]);return{focusProps:{onFocus:!t&&(n||a||i)?c:void 0,onBlur:!t&&(i||a)?o:void 0}}}function Nt(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1,typeof n.continuePropagation==`function`&&n.continuePropagation()},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function Pt(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Nt(e.onKeyDown),onKeyUp:Nt(e.onKeyUp)}}}function Ft(e,t){R(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}let It=e.createContext(null);function Lt(e){let t=i(It)||{};Ft(t,e);let{ref:n,...r}=t;return r}function Rt(e,t){let{focusProps:n}=Mt(e),{keyboardProps:r}=Pt(e),i=Y(n,r),o=Lt(t),c=e.isDisabled?{}:o,l=s(e.autoFocus);a(()=>{l.current&&t.current&&Ct(t.current),l.current=!1},[t]);let u=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(u=void 0),{focusableProps:Y({...i,tabIndex:u},c)}}const zt=e.useInsertionEffect??R;function Bt(e){let t=s(null);return zt(()=>{t.current=e},[e]),r((...e)=>{let n=t.current;return n?.(...e)},[])}const Vt=new Set([`id`]),Ht=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),Ut=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),Wt=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Gt=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(`.`)),Kt=/^(data-.*)$/;function qt(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)&&(Vt.has(t)||n&&Ht.has(t)||r&&Ut.has(t)||i&&Wt.has(t)||a&&(Gt.has(t)||t.endsWith(`Capture`)&&Gt.has(t.slice(0,-7)))||o?.has(t)||Kt.test(t))&&(s[t]=e[t]);return s}let X=`default`,Jt=``,Z=new WeakMap;function Yt(e){if(Ie()){if(X==="default"){let t=M(e);Jt=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}X=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;Z.set(e,e.style[t]),e.style[t]=`none`}}function Xt(e){if(Ie()){if(X!==`disabled`)return;X=`restoring`,setTimeout(()=>{St(()=>{if(X===`restoring`){let t=M(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=Jt||``),Jt=``,X=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Z.has(e)){let t=Z.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),Z.delete(e)}}function Zt(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let Qt=new WeakMap;function $t(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return Zt(t);if(Qt.has(t))return Qt.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof N(n).HTMLMetaElement&&(n.nonce||n.content)||Zt(t)||void 0;return r!==void 0&&Qt.set(t,r),r}const en=e.createContext({register:()=>{}});en.displayName=`PressResponderContext`;function tn(){let e=s(new Map),t=r((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=r((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),i=r(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return a(()=>i,[i]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:i}}function nn(e){let t=i(en);if(t){let{register:n,ref:r,...i}=t;e=Y(i,e),n()}return Ft(t,e.ref),e}var rn=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 an=Symbol(`linkClicked`),on=`react-aria-pressable-style`,sn=`data-react-aria-pressable`;function cn(e){let{onPress:t,onPressChange:n,onPressStart:i,onPressEnd:l,onPressUp:u,onClick:d,isDisabled:f,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=nn(e),[y,b]=c(!1),x=s({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=tn(),w=r((e,t)=>{let r=x.current;if(f||r.didFirePressStart)return!1;let a=!0;if(r.isTriggeringEvent=!0,i){let n=new rn(`pressstart`,t,e);i(n),a=n.shouldStopPropagation}return n&&n(!0),r.isTriggeringEvent=!1,r.didFirePressStart=!0,b(!0),a},[f,i,n]),T=r((e,r,i=!0)=>{let a=x.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let o=!0;if(l){let t=new rn(`pressend`,r,e);l(t),o=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&i&&!f){let n=new rn(`press`,r,e);t(n),o&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,o},[f,l,n,t]),E=Bt(T),D=Bt(r((e,t)=>{let n=x.current;if(f)return!1;if(u){n.isTriggeringEvent=!0;let r=new rn(`pressup`,t,e);return u(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[f,u])),O=r(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&T(Q(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||Xt(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,T]),k=Bt(O);a(()=>{f&&x.current.isPressed&&k({currentTarget:x.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[f]);let ee=r(e=>{h&&O(e)},[h,O]),te=r(e=>{f||d?.(e)},[f,d]),A=r((e,t)=>{if(!f&&d){let n=new MouseEvent(`click`,e);Oe(n,t),d(De(n))}},[f,d]),ne=o(()=>{let e=x.current,t={onKeyDown(t){if(un(t.nativeEvent,t.currentTarget)&&F(t.currentTarget,L(t))){fn(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`,wt(t=>{un(t,i)&&!t.repeat&&F(i,L(t))&&e.target&&D(Q(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&B()&&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&&!V.isOpening){let n=!0;if(f&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||Ve(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(Q(t.currentTarget,t),r),a=E(Q(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&&un(t,e.target)){fn(L(t),t.key)&&t.preventDefault();let n=L(t),r=F(e.target,n);E(Q(e.target,t),`keyboard`,r),r&&A(t,e.target),C(),t.key!==`Enter`&&ln(e.target)&&F(e.target,n)&&!t[an]&&(t[an]=!0,V(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(He(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||Yt(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=je(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&&D(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,w(Q(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,E(Q(e.target,t),e.pointerType,!1),ee(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?k(t):(j(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=>{F(e.currentTarget,L(e))&&k(e)}}return t},[S,f,m,C,g,ee,w,te,A]);return a(()=>{if(!_)return;let e=M(_.current);if(!e||!e.head||e.getElementById(on))return;let t=e.createElement(`style`);t.id=on;let n=$t(e);n&&(t.nonce=n),t.textContent=`
2
+ @layer {
3
+ [${sn}] {
4
+ touch-action: pan-x pan-y pinch-zoom;
5
+ }
6
+ }
7
+ `.trim(),e.head.prepend(t)},[_]),a(()=>{let e=x.current;return()=>{g||Xt(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:Y(v,ne,{[sn]:!0})}}function ln(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function un(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&&!mn(i,n)||i instanceof N(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&ln(i))&&n!==`Enter`)}function Q(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 dn(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!ln(e)}function fn(e,t){return e instanceof HTMLInputElement?!mn(e,t):dn(e)}const pn=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function mn(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:pn.has(e.type)}function hn(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}=cn({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Rt(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=Y(y,_,qt(e,{labelable:!0}));return{isPressed:v,buttonProps:Y(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`]})}}function gn(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:i,onFocusWithinChange:a}=e,o=s({isFocusWithin:!1}),{addGlobalListener:c,removeAllGlobalListeners:l}=tn(),u=r(e=>{F(e.currentTarget,L(e))&&o.current.isFocusWithin&&!F(e.currentTarget,e.relatedTarget)&&(o.current.isFocusWithin=!1,l(),n&&n(e),a&&a(!1))},[n,a,o,l]),d=ke(u),f=r(e=>{if(!F(e.currentTarget,L(e)))return;let t=L(e),n=M(t),r=I(n);if(!o.current.isFocusWithin&&r===t){i&&i(e),a&&a(!0),o.current.isFocusWithin=!0,d(e);let t=e.currentTarget;c(n,`focus`,e=>{let r=L(e);if(o.current.isFocusWithin&&!F(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});Oe(e,t);let i=De(e);u(i)}},{capture:!0})}},[i,a,d,c,u]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:u}}}function _n(e={}){let{autoFocus:t=!1,isTextInput:n,within:i}=e,a=s({isFocused:!1,isFocusVisible:t||pt()}),[o,l]=c(!1),[u,d]=c(()=>a.current.isFocused&&a.current.isFocusVisible),f=r(()=>d(a.current.isFocused&&a.current.isFocusVisible),[]),p=r(e=>{a.current.isFocused=e,a.current.isFocusVisible=pt(),l(e),f()},[f]);vt(e=>{a.current.isFocusVisible=e,f()},[n,o],{enabled:o,isTextInput:n});let{focusProps:m}=Mt({isDisabled:i,onFocusChange:p}),{focusWithinProps:h}=gn({isDisabled:!i,onFocusWithinChange:p});return{isFocused:o,isFocusVisible:u,focusProps:i?h:m}}let vn=!1,yn=0;function bn(){vn=!0,setTimeout(()=>{vn=!1},500)}function xn(e){e.pointerType===`touch`&&bn()}function Sn(){let e=M(null);if(e!==void 0)return yn===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,xn),yn++,()=>{yn--,!(yn>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,xn)}}function Cn(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[l,u]=c(!1),d=s({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;a(Sn,[]);let{addGlobalListener:f,removeAllGlobalListeners:p}=tn(),{hoverProps:m,triggerHoverEnd:h}=o(()=>{let e=(e,r)=>{if(d.pointerType=r,i||r===`touch`||d.isHovered||!F(e.currentTarget,L(e)))return;d.isHovered=!0;let o=e.currentTarget;d.target=o,f(M(L(e)),`pointerover`,e=>{d.isHovered&&d.target&&!F(d.target,L(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:o,pointerType:r}),n&&n(!0),u(!0)},a=(e,t)=>{let i=d.target;d.pointerType=``,d.target=null,!(t===`touch`||!d.isHovered||!i)&&(d.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),u(!1))},o={};return typeof PointerEvent<`u`&&(o.onPointerEnter=t=>{vn&&t.pointerType===`mouse`||e(t,t.pointerType)},o.onPointerLeave=e=>{!i&&F(e.currentTarget,L(e))&&a(e,e.pointerType)}),{hoverProps:o,triggerHoverEnd:a}},[t,n,r,i,d,f,p]);return a(()=>{i&&h({currentTarget:d.target},d.pointerType)},[i]),{hoverProps:m,isHovered:l}}const wn=t(null),Tn=7e3;let $=null;function En(e,t=`assertive`,n=Tn){$?$.announce(e,t,n):($=new Dn,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?$.announce(e,t,n):setTimeout(()=>{$?.isAttached()&&$?.announce(e,t,n)},100))}var Dn=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=Tn){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 On=t({}),kn=le(function(t,n){[t,n]=ne(t,n,On);let r=t,{isPending:i}=r,{buttonProps:o,isPressed:c}=hn(t,n);o=jn(o,i);let{focusProps:l,isFocused:u,isFocusVisible:d}=_n(t),{hoverProps:f,isHovered:p}=Cn({...t,isDisabled:t.isDisabled||i}),m={isHovered:p,isPressed:(r.isPressed||c)&&!i,isFocused:u,isFocusVisible:d,isDisabled:t.isDisabled||!1,isPending:i??!1},h=ee({...t,values:m,defaultClassName:`react-aria-Button`}),g=Dt(o.id),_=Dt(),v=o[`aria-labelledby`];i&&(v?v=`${v} ${_}`:o[`aria-label`]&&(v=`${g} ${_}`));let y=s(i);a(()=>{let e={"aria-labelledby":v||g};(!y.current&&u&&i||y.current&&u&&!i)&&En(e,`assertive`),y.current=i},[i,u,v,g]);let b=E(t,{global:!0});return delete b.onClick,e.createElement(se.button,{...Y(b,h,o,l,f),type:o.type===`submit`&&i?`button`:o.type,id:g,ref:n,"aria-labelledby":v,slot:t.slot||void 0,"aria-disabled":i?`true`:o[`aria-disabled`],"data-disabled":t.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":p||void 0,"data-focused":u||void 0,"data-pending":i||void 0,"data-focus-visible":d||void 0},e.createElement(wn.Provider,{value:{id:_}},h.children))}),An=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function jn(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!An.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}export{P as A,se as B,R as C,ge as D,F as E,ne as F,y as G,A as H,ee as I,f as J,_ as K,re as L,N as M,le as N,I as O,k as P,te as R,Ie as S,Te as T,D as U,ie as V,E as W,mt as _,gn as a,Re as b,$t as c,Rt as d,Y as f,Ct as g,wt as h,_n as i,M as j,L as k,qt as l,Dt as m,kn as n,cn as o,kt as p,p as q,Cn as r,en as s,On as t,Bt as u,ht as v,we as w,ze as x,et as y,O as z};
@@ -1,4 +1,4 @@
1
- import { a as MultiSelectAnswer, i as BugReportAnswer, n as Locale, o as RatingAnswer, s as SingleSelectAnswer, t as PublicGetSurveyOutput } from "./index-DODfg3Bc.js";
1
+ import { a as BugReportAnswer, c as SingleSelectAnswer, n as PublicGetSurveyOutput, o as MultiSelectAnswer, r as Locale, s as RatingAnswer, t as PublicPutResponseOutput } from "./index-DLqC_qk3.js";
2
2
  import { PropsWithChildren, ReactNode } from "react";
3
3
 
4
4
  //#region src/core/types.d.ts
@@ -76,7 +76,7 @@ interface Finishable {
76
76
  * Callback is invoked after the survey response is submitted and the
77
77
  * submission network call settles.
78
78
  */
79
- onFinished?: () => void;
79
+ onFinished?: (result?: PublicPutResponseOutput) => void;
80
80
  }
81
81
  interface Closable {
82
82
  /**
@@ -174,7 +174,7 @@ interface SurveyContextValue {
174
174
  answers
175
175
  }: {
176
176
  answers: Record<Question$1['id'], Answer>;
177
- }) => Promise<void>;
177
+ }) => Promise<PublicPutResponseOutput | void>;
178
178
  dismiss: () => Promise<void> | void;
179
179
  survey: PublicGetSurveyOutput | undefined;
180
180
  }
@@ -0,0 +1 @@
1
+ import{n as e}from"./Button-D3Wb2KZB.js";import{t}from"./src-DG66KK2l.js";import{useEffect as n,useState as r}from"react";import{useLocalStorage as i}from"usehooks-ts";import{jsx as a,jsxs as o}from"react/jsx-runtime";import s from"clsx";function c(e,t){return t===void 0?!0:typeof t==`boolean`?t:t(e)}function l(e){return typeof e!=`boolean`}function u({surveyId:e,override:t}){let[r,a]=i(`cfti:${e}:respondent`,``);return n(()=>{r||a(crypto.randomUUID())},[r,a]),t||r}const d={lastRespondedAt:null,lastDismissedAt:null};async function f({client:e,surveyId:n,respondent:r,signal:i}){try{let a=await e.get(`api/v1/cfti/${encodeURIComponent(n)}/respondent/${encodeURIComponent(r)}`,{signal:i}).json(),o=t.safeParse(a);return o.success?{lastRespondedAt:o.data.lastRespondedAt?new Date(o.data.lastRespondedAt):null,lastDismissedAt:o.data.lastDismissedAt?new Date(o.data.lastDismissedAt):null}:(console.warn(`[confetti] Respondent response failed schema validation`,o.error),d)}catch{return d}}function p({client:e,surveyId:t,respondent:i,enabled:a=!0}){let[o,s]=r(d),[c,l]=r(()=>!a),[u,p]=r({client:e,surveyId:t,respondent:i,enabled:a});return(u.client!==e||u.surveyId!==t||u.respondent!==i||u.enabled!==a)&&(p({client:e,surveyId:t,respondent:i,enabled:a}),s(d),l(!a)),n(()=>{if(!a||!i||typeof window>`u`||typeof document>`u`)return;let n=null,r=()=>{n?.abort(),n=new AbortController;let r=n;f({client:e,surveyId:t,respondent:i,signal:r.signal}).then(e=>{r.signal.aborted||(s(e),l(!0))})};r();let o=()=>{document.visibilityState===`visible`&&r()};return document.addEventListener(`visibilitychange`,o),()=>{n?.abort(),document.removeEventListener(`visibilitychange`,o)}},[e,t,i,a]),{state:o,isSettled:c}}function m({client:e,surveyId:t}){let[i,a]=r(!1),[o,s]=r(!1),[c,l]=r({client:e,surveyId:t});return(c.client!==e||c.surveyId!==t)&&(l({client:e,surveyId:t}),a(!1),s(!1)),n(()=>{if(typeof window>`u`)return;let n=new AbortController;return e.head(`api/v1/cfti/${encodeURIComponent(t)}`,{signal:n.signal}).then(()=>{n.signal.aborted||a(!0)}).catch(()=>{n.signal.aborted||a(!1)}).finally(()=>{n.signal.aborted||s(!0)}),()=>{n.abort()}},[e,t]),{isAvailable:i,isSettled:o}}const h=e=>a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 44 38`,...e,children:o(`g`,{transform:`translate(-2 -2) scale(1.1)`,children:[a(`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`}),a(`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`}),a(`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`}),a(`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`})]})}),g=({onClick:t,isWidgetOpen:n,classNames:r,label:i=`Help us improve`})=>n?null:o(e,{onPress:t,className:s(`confetti-trigger`,r?.trigger),children:[a(`span`,{className:s(`confetti-trigger-icon-wrapper`,r?.iconWrapper),"aria-hidden":!0,children:a(h,{className:s(`confetti-trigger-icon`,r?.icon),width:24})}),a(`span`,{className:s(`confetti-trigger-label`,r?.label),children:i})]});export{u as a,p as i,h as n,c as o,m as r,l as s,g as t};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,o as n,r,s as i}from"./DefaultConfettiTrigger-iGndzjo2.js";import{B as a,C as o,F as s,G as c,H as l,I as u,J as d,K as f,L as p,M as m,N as h,P as g,R as _,U as v,V as y,W as b,a as x,d as S,f as C,i as w,k as T,l as E,m as D,n as O,o as k,p as A,r as j,u as M,v as N}from"./Button-D3Wb2KZB.js";import{c as ee,d as te,f as ne,h as re,l as ie,m as ae,o as oe,p as se,s as ce,u as le}from"./src-DG66KK2l.js";import{a as ue,n as de,o as fe,r as pe,t as me}from"./internals-DKNTeE-L.js";import{S as he,_ as ge,a as P,b as _e,c as ve,g as ye,h as be,i as xe,l as Se,o as Ce,p as we,r as Te,s as Ee,u as De,v as Oe,x as ke,y as Ae}from"./ModalContainer-kQ-gmZ0r.js";import F,{Suspense as je,cloneElement as Me,createContext as I,forwardRef as L,isValidElement as Ne,lazy as Pe,useCallback as R,useContext as z,useEffect as B,useMemo as V,useRef as H,useState as U}from"react";import{useTimeout as Fe}from"usehooks-ts";import{Fragment as W,jsx as G,jsxs as K}from"react/jsx-runtime";import q from"clsx";import"react-dom";function Ie(e,t,n){let r=M(e=>{n&&!e.defaultPrevented&&n(t)});B(()=>{let t=e?.current?.form;return t?.addEventListener(`reset`,r),()=>{t?.removeEventListener(`reset`,r)}},[e])}function Le(e,t,n){let{validationBehavior:r,focus:i}=e;o(()=>{if(r===`native`&&n?.current&&`setCustomValidity`in 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(ze(n.current))}});let a=H(!1),s=M(()=>{a.current||t.resetValidation()}),c=M(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&Be(r)===n.current&&(i?i():n.current?.focus(),N(`keyboard`)),e.preventDefault()}),l=M(()=>{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`&&T(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,c),e.addEventListener(`change`,l),t?.addEventListener(`reset`,s),()=>{e.removeEventListener(`invalid`,c),e.removeEventListener(`change`,l),t?.removeEventListener(`reset`,s),t&&(t.reset=r)}},[n,r])}function Re(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 ze(e){return{isInvalid:!e.validity.valid,validationDetails:Re(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function Be(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}function Ve(e=!0){let[t,n]=U(e),r=H(!1),i=R(e=>{r.current=!0,n(!!e)},[]);return o(()=>{r.current||n(!1)},[]),[i,t]}function He(e=!0){let t=D(),[n,r]=Ve(e);return{id:r?t:void 0,ref:n}}const Ue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},We={...Ue,customError:!0,valid:!1},J={isInvalid:!1,validationDetails:Ue,validationErrors:[]},Ge=I({}),Ke=`__reactAriaFormValidationState`;function Y(e){if(e.__reactAriaFormValidationState){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Ke];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return qe(e)}function qe(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:We},l=V(()=>!o||i==null?null:Xe(Ye(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=z(Ge),d=V(()=>r?Array.isArray(r)?r.flatMap(e=>Je(u[e])):Je(u[r]):[],[u,r]),[f,p]=U(u),[m,h]=U(!1);u!==f&&(p(u),h(!1));let g=V(()=>Xe(m?[]:d),[m,d]),_=H(J),[v,y]=U(J),b=H(J),x=()=>{if(!S)return;C(!1);let e=l||a||_.current;Ze(e,b.current)||(b.current=e,y(e))},[S,C]=U(!1);return B(x),{realtimeValidation:c||g||l||a||J,displayValidation:s===`native`?c||g||v:c||g||l||a||v,updateValidation(e){s===`aria`&&!Ze(v,e)?y(e):_.current=e},resetValidation(){let e=J;Ze(e,b.current)||(b.current=e,y(e)),s===`native`&&C(!1),h(!0)},commitValidation(){s===`native`&&C(!0),h(!0)}}}function Je(e){return e?Array.isArray(e)?e:[e]:[]}function Ye(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return Je(n)}return[]}function Xe(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:We}:null}function Ze(e,t){return e===t||!!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 Qe(...e){let t=new Set,n=!1,r={...Ue};for(let i of e){for(let e of i.validationErrors)t.add(e);n||=i.isInvalid;for(let e in r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function $e(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:a,name:o,form:s,children:c,isRequired:l,validationBehavior:u=`aria`,"aria-label":d,"aria-labelledby":f,"aria-describedby":p,onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:v,onClick:y}=e,b=Y({...e,value:t.isSelected}),{isInvalid:x,validationErrors:w,validationDetails:D}=b.displayValidation;Le(e,b,n);let O=e=>{e.stopPropagation(),t.setSelected(T(e).checked)},{pressProps:A,isPressed:j}=k({onPressStart:m,onPressEnd:h,onPressChange:g,onPress:_,onPressUp:v,onClick:y,isDisabled:r}),[M,N]=U(!1),{pressProps:ee}=k({onPressStart(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}m?.(e),g?.(!0),N(!0)},onPressEnd(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}h?.(e),g?.(!1),N(!1)},onPressUp(e){if(e.pointerType===`keyboard`||e.pointerType===`virtual`){e.continuePropagation();return}v?.(e)},onClick:y,onPress(r){if(r.pointerType===`keyboard`||r.pointerType===`virtual`){r.continuePropagation();return}_?.(r),t.toggle(),n.current?.focus();let{[Ke]:i}=e,{commitValidation:a}=i||b;a()},isDisabled:r||i}),{focusableProps:te}=S(e,n),ne=C(A,te),re=E(e,{labelable:!0});Ie(n,t.defaultSelected,t.setSelected);let ie=He(),ae=He();return{labelProps:C(ee,{onClick:e=>e.preventDefault()}),inputProps:C(re,{checked:t.isSelected,"aria-required":l&&u===`aria`||void 0,required:l&&u===`native`,"aria-invalid":x||e.validationState===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,"aria-describedby":[ie.id,ae.id,p].filter(Boolean).join(` `)||void 0,onChange:O,disabled:r,...a==null?{}:{value:a},name:o,form:s,type:`checkbox`,...ne}),descriptionProps:ie,errorMessageProps:ae,isSelected:t.isSelected,isPressed:j||M,isDisabled:r,isReadOnly:i,isInvalid:x||e.validationState===`invalid`,validationErrors:w,validationDetails:D}}function et(e,t,n){let{labelProps:r,inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}=$e(e,t,n),{isIndeterminate:m}=e;return B(()=>{n.current&&(n.current.indeterminate=!!m)}),{labelProps:C(r,V(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:i,descriptionProps:a,errorMessageProps:o,isSelected:s,isPressed:c,isDisabled:l,isReadOnly:u,isInvalid:d,validationErrors:f,validationDetails:p}}const tt=new WeakMap;function nt(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a=`label`}=e;t=D(t);let o=D(),s={};n&&(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a===`label`?t:void 0});let c=_e({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:c}}function rt(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:a,fieldProps:o}=nt(e),s=A([!!t,!!n,r,i]),c=A([!!t,!!n,r,i]);return o=C(o,{"aria-describedby":[s,c,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:a,fieldProps:o,descriptionProps:{id:s},errorMessageProps:{id:c}}}function it(e,t){let{isDisabled:n,name:r,form:i,validationBehavior:a=`aria`}=e,{isInvalid:o,validationErrors:s,validationDetails:c}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:d,errorMessageProps:f}=rt({...e,labelElementType:`span`,isInvalid:o,errorMessage:e.errorMessage||s});tt.set(t,{name:r,form:i,descriptionId:d.id,errorMessageId:f.id,validationBehavior:a});let p=E(e,{labelable:!0}),{focusWithinProps:m}=x({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:C(p,{role:`group`,"aria-disabled":n||void 0,...u,...m}),labelProps:l,descriptionProps:d,errorMessageProps:f,isInvalid:o,validationErrors:s,validationDetails:c}}function at(e={}){let{isReadOnly:t}=e,[n,r]=ge(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 ot(e,t,n){let r=at({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}=Y({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=H(J),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,[Ke]:{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":[m.inputProps[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}function st(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:a=!1,type:o=`text`,validationBehavior:s=`aria`}=e,[c,l]=ge(e.value,e.defaultValue||``,e.onChange),{focusableProps:u}=S(e,t),d=Y({...e,value:c}),{isInvalid:f,validationErrors:p,validationDetails:m}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:_,errorMessageProps:v}=rt({...e,isInvalid:f,errorMessage:e.errorMessage||p}),y=E(e,{labelable:!0}),b={type:o,pattern:e.pattern},[x]=U(c);return Ie(t,e.defaultValue??x,l),Le(e,d,t),{labelProps:h,inputProps:C(y,n===`input`?b:void 0,{disabled:r,readOnly:a,required:i&&s===`native`,"aria-required":i&&s===`aria`||void 0,"aria-invalid":f||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:c,onChange:e=>l(T(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(F.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,...u,...g}),descriptionProps:_,errorMessageProps:v,isInvalid:f,validationErrors:p,validationDetails:m}}const ct=new WeakMap;function lt(e,t,n){let{value:r,children:i,"aria-label":a,"aria-labelledby":o,onPressStart:s,onPressEnd:c,onPressChange:l,onPress:u,onPressUp:d,onClick:f}=e,p=e.isDisabled||t.isDisabled,m=t.selectedValue===r,h=e=>{e.stopPropagation(),t.setSelectedValue(r)},{pressProps:g,isPressed:_}=k({onPressStart:s,onPressEnd:c,onPressChange:l,onPress:u,onPressUp:d,onClick:f,isDisabled:p}),{pressProps:v,isPressed:y}=k({onPressStart:s,onPressEnd:c,onPressChange:l,onPressUp:d,onClick:f,isDisabled:p,onPress(e){u?.(e),t.setSelectedValue(r),n.current?.focus()}}),{focusableProps:b}=S(C(e,{onFocus:()=>t.setLastFocusedValue(r)}),n),x=C(g,b),w=E(e,{labelable:!0}),T=-1;t.selectedValue==null?(t.lastFocusedValue===r||t.lastFocusedValue==null)&&(T=0):t.selectedValue===r&&(T=0),p&&(T=void 0);let{name:D,form:O,descriptionId:A,errorMessageId:j,validationBehavior:M}=ct.get(t);Ie(n,t.defaultSelectedValue,t.setSelectedValue),Le({validationBehavior:M},t,n);let N=He();return{labelProps:C(v,V(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:C(w,{...x,type:`radio`,name:D,form:O,tabIndex:T,disabled:p,required:t.isRequired&&M===`native`,checked:m,value:r,onChange:h,"aria-describedby":[e[`aria-describedby`],N.id,t.isInvalid?j:null,A].filter(Boolean).join(` `)||void 0}),descriptionProps:N,isDisabled:p,isSelected:m,isPressed:_||y}}function ut(e,t){let{name:n,form:r,isReadOnly:i,isRequired:a,isDisabled:o,orientation:s=`vertical`,validationBehavior:c=`aria`}=e,{direction:l}=Ae(),{isInvalid:u,validationErrors:d,validationDetails:f}=t.displayValidation,{labelProps:p,fieldProps:h,descriptionProps:g,errorMessageProps:_}=rt({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||d}),v=E(e,{labelable:!0}),{focusWithinProps:y}=x({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),b=e=>{let n;switch(e.key){case`ArrowRight`:n=l===`rtl`&&s!==`vertical`?`prev`:`next`;break;case`ArrowLeft`:n=l===`rtl`&&s!==`vertical`?`next`:`prev`;break;case`ArrowDown`:n=`next`;break;case`ArrowUp`:n=`prev`;break;default:return}e.preventDefault();let r=Oe(e.currentTarget,{from:T(e),accept:e=>e instanceof m(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))},S=D(n);return ct.set(t,{name:S,form:r,descriptionId:g.id,errorMessageId:_.id,validationBehavior:c}),{radioGroupProps:C(v,{role:`radiogroup`,onKeyDown:b,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":i||void 0,"aria-required":a||void 0,"aria-disabled":o||void 0,"aria-orientation":s,...h,...y}),labelProps:p,descriptionProps:g,errorMessageProps:_,isInvalid:u,validationErrors:d,validationDetails:f}}const dt=I({}),X=h(function(e,t){[e,t]=s(e,t,dt);let{elementType:n=`label`,...r}=e,i=a[n];return F.createElement(i,{className:`react-aria-Label`,...r,ref:t})}),ft=I({}),Z=L(function(e,t){[e,t]=s(e,t,ft);let{elementType:n=`span`,...r}=e,i=a[n];return F.createElement(i,{className:`react-aria-Text`,...r,ref:t})});function pt(e={}){let[t,n]=ge(e.value,e.defaultValue||[],e.onChange),[r]=U(t),i=!!e.isRequired&&t.length===0,a=H(new Map),o=Y({...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(Qe(...n.values()))},validationState:e.validationState??(s?`invalid`:null),isInvalid:s,isRequired:i}}let mt=Math.round(Math.random()*1e10),ht=0;function gt(e){let t=V(()=>e.name||`radio-group-${mt}-${++ht}`,[e.name]),[n,r]=ge(e.value,e.defaultValue??null,e.onChange),[i]=U(n),[a,o]=U(null),s=Y({...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 _t=I(null),vt=L(function(e,t){return z(_t)?.isInvalid?F.createElement(yt,{...e,ref:t}):null}),yt=L((e,t)=>{let n=z(_t),r=b(e,{global:!0}),i=u({...e,defaultClassName:`react-aria-FieldError`,defaultChildren:n.validationErrors.length===0?void 0:n.validationErrors.join(` `),values:n});return i.children==null?null:F.createElement(Z,{slot:`errorMessage`,...r,...i,ref:t})}),bt=I(null),xt=I(null),St=I(null),Ct=L(function(e,t){[e,t]=s(e,t,xt);let{validationBehavior:n}=l(bt)||{},r=e.validationBehavior??n??`native`,i=pt({...e,validationBehavior:r}),[o,c]=p(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:d,labelProps:f,descriptionProps:m,errorMessageProps:h,..._}=it({...e,label:c,validationBehavior:r},i),v=u({...e,values:{isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:e.isRequired||!1,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-CheckboxGroup`}),y=b(e,{global:!0});return F.createElement(a.div,{...C(y,v,d),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},F.createElement(g,{values:[[St,i],[dt,{...f,ref:o,elementType:`span`}],[ft,{slots:{description:m,errorMessage:h}}],[_t,_]]},v.children))}),wt=L(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=s(r,t,he);let{validationBehavior:i}=l(bt)||{},o=e.validationBehavior??i??`native`,c=z(St),d=v(V(()=>f(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:p,inputProps:m,isSelected:h,isDisabled:g,isReadOnly:_,isPressed:x,isInvalid:S}=c?ot({...y(e),value:e.value,children:typeof e.children==`function`||e.children},c,d):et({...y(e),children:typeof e.children==`function`||e.children,validationBehavior:o},at(e),d),{isFocused:T,isFocusVisible:E,focusProps:D}=w(),O=g||_,{hoverProps:k,isHovered:A}=j({...e,isDisabled:O}),M=u({...e,defaultClassName:`react-aria-Checkbox`,values:{isSelected:h,isIndeterminate:e.isIndeterminate||!1,isPressed:x,isHovered:A,isFocused:T,isFocusVisible:E,isDisabled:g,isReadOnly:_,isInvalid:S,isRequired:e.isRequired||!1}}),N=b(e,{global:!0});return delete N.id,delete N.onClick,F.createElement(a.label,{...C(N,p,k,M),ref:t,slot:e.slot||void 0,"data-selected":h||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":x||void 0,"data-hovered":A||void 0,"data-focused":T||void 0,"data-focus-visible":E||void 0,"data-disabled":g||void 0,"data-readonly":_||void 0,"data-invalid":S||void 0,"data-required":e.isRequired||void 0},F.createElement(ye,{elementType:`span`},F.createElement(`input`,{...C(m,D),ref:d})),M.children)}),Tt=I({}),Et=I({});let Dt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const Ot=h(function(e,t){[e,t]=s(e,t,Et);let{hoverProps:n,isHovered:r}=j({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:o,focusProps:c}=w({isTextInput:!0,autoFocus:e.autoFocus}),l=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,d=u({...e,values:{isHovered:r,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:l},defaultClassName:`react-aria-Input`});return F.createElement(a.input,{...C(Dt(e),c,n),...d,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":l||void 0})}),kt=I(null);function At(e){let t=H({});return F.createElement(kt.Provider,{value:t},e.children)}const jt=I({isSelected:!1}),Mt=I(null),Nt=I(null),Pt=I(null),Ft=L(function(e,t){[e,t]=s(e,t,Mt);let{validationBehavior:n}=l(bt)||{},r=e.validationBehavior??n??`native`,i=gt({...e,validationBehavior:r}),[o,d]=p(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:f,labelProps:m,descriptionProps:h,errorMessageProps:_,...v}=ut({...e,label:d,validationBehavior:r},i),y=u({...e,values:{orientation:e.orientation||`vertical`,isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-RadioGroup`}),x=b(e,{global:!0});return F.createElement(a.div,{...c(x,y,f),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},F.createElement(g,{values:[[Pt,i],[dt,{...m,ref:o,elementType:`span`}],[ft,{slots:{description:h,errorMessage:_}}],[_t,v]]},F.createElement(At,null,y.children)))}),It=L(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=s(r,t,Nt);let i=F.useContext(Pt),o=v(V(()=>f(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:l,inputProps:d,isSelected:p,isDisabled:m,isPressed:h}=lt({...y(e),children:typeof e.children==`function`||e.children},i,o),{isFocused:g,isFocusVisible:_,focusProps:x}=w(),S=m||i.isReadOnly,{hoverProps:C,isHovered:T}=j({...e,isDisabled:S}),E=u({...e,defaultClassName:`react-aria-Radio`,values:{isSelected:p,isPressed:h,isHovered:T,isFocused:g,isFocusVisible:_,isDisabled:m,isReadOnly:i.isReadOnly,isInvalid:i.isInvalid,isRequired:i.isRequired}}),D=b(e,{global:!0});return delete D.id,delete D.onClick,F.createElement(a.label,{...c(D,l,C,E),ref:t,"data-selected":p||void 0,"data-pressed":h||void 0,"data-hovered":T||void 0,"data-focused":g||void 0,"data-focus-visible":_||void 0,"data-disabled":m||void 0,"data-readonly":i.isReadOnly||void 0,"data-invalid":i.isInvalid||void 0,"data-required":i.isRequired||void 0},F.createElement(ye,{elementType:`span`},F.createElement(`input`,{...c(d,x),ref:o})),F.createElement(jt.Provider,{value:{isSelected:p}},E.children))}),Lt=I({});let Rt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const zt=L(function(e,t){[e,t]=s(e,t,Lt);let{hoverProps:n,isHovered:r}=j(e),{isFocused:i,isFocusVisible:o,focusProps:c}=w({isTextInput:!0,autoFocus:e.autoFocus}),l=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,d=u({...e,values:{isHovered:r,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:l},defaultClassName:`react-aria-TextArea`});return F.createElement(a.textarea,{...C(Rt(e),c,n),...d,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":l||void 0})}),Bt=I(null),Vt=h(function(e,t){[e,t]=s(e,t,Bt);let{validationBehavior:n}=l(bt)||{},r=e.validationBehavior??n??`native`,i=H(null);[e,i]=s(e,i,ke);let[o,c]=p(!e[`aria-label`]&&!e[`aria-labelledby`]),[d,f]=U(`input`),{labelProps:m,inputProps:h,descriptionProps:_,errorMessageProps:v,...x}=st({...y(e),inputElementType:d,label:c,validationBehavior:r},i),S=R(e=>{i.current=e,e&&f(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),C=u({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:x.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),w=b(e,{global:!0});return delete w.id,F.createElement(a.div,{...w,...C,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":x.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},F.createElement(g,{values:[[dt,{...m,ref:o}],[Et,{...h,ref:S}],[Lt,{...h,ref:S}],[Tt,{role:`presentation`,isInvalid:x.isInvalid,isDisabled:e.isDisabled||!1}],[ft,{slots:{description:_,errorMessage:v}}],[_t,x]]},C.children))}),Q=e=>e===void 0||e===``||Array.isArray(e)&&e.length===0||!Array.isArray(e)&&typeof e==`object`&&ce(e),Ht=({answer:e,defaultAnswer:t})=>{if(!Q(e)||!Q(t))return e},Ut=(e,t)=>e.type===`end`?!1:e.type!==`next`||!t,Wt=({routingLogic:e,answer:t,required:n,isLastQuestion:r})=>{if(e.type!==`always`&&Q(t)&&n)return!0;let i=e.type===`always`?e.target:Q(t)?e.default:e.cases.find(e=>ue({answer:t,condition:e}))?.target??e.default;return Ut(i,r)},Gt=({originalQuestions:e,answers:t,errors:n,pointer:r=-1})=>{if(!e)return{questions:[],currentIndex:-1};let i=[...e].sort((e,t)=>e.position-t.position),a=r>=0?i[r]:void 0,o=fe(i,t,{forceReachableIds:a?[a.id]:void 0}),s=i.map((e,t)=>{let i={...e},a=n[e.id];return a&&(i.error=a),{...i,visible:r===t||o.has(e.id)}}),c=s.findIndex((e,n)=>n>r&&e.visible&&t[e.id]===void 0);return c===-1&&(c=s.findLastIndex(e=>!!e.visible)),{questions:s,currentIndex:c}},$={rating:({scale:e},t)=>le({scale:e},t),"open-ended":({max:e},t)=>ie({maxLength:e},t),"single-select":({editable:e},t)=>te({maxLength:e?.max},t),"multi-select":({editable:e,max:t},n)=>ee({maxLength:e?.max,maxSelected:t},n),statement:(e,t)=>ne(),"bug-report":(e,t)=>oe({},t)},Kt=(e,t)=>{let n=e.type;switch(n){case`rating`:{let r=$[n];return r(e,t)}case`open-ended`:{let r=$[n];return r(e,t)}case`single-select`:{let r=$[n];return r(e,t)}case`multi-select`:{let r=$[n];return r(e,t)}case`statement`:{let r=$[n];return r(e,t)}case`bug-report`:{let r=$[n];return r(e,t)}default:throw Error(`Unsupported question type`)}},qt=({questions:e,answers:t})=>{let n=Jt({questions:e,answers:t});return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==null))},Jt=({questions:e,answers:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Yt=({questions:e,errors:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),Xt={},Zt=({questions:e,answers:t,errors:n,locale:r})=>{let i={};for(let a of e){if(!a.visible||!a.required||t[a.id]!==void 0||n[a.id])continue;let e=Kt(a.properties,{required:a.required}).safeParse(void 0);e.success||(i[a.id]=be(e.error,r))}return i},Qt=e=>{let t=e.querySelector(`[data-invalid]`);if(!t)return;let n=t.getAttribute(`role`);if(n===`radiogroup`||n===`group`){t.tabIndex=-1,t.focus();return}t.querySelector(`textarea, input`)?.focus()},$t=({current:e,shouldAutoSubmit:t,onSubmitted:n,onFinished:r,children:i,locale:a})=>{let{survey:o,submit:s}=we(),[c,l]=U({}),[u,d]=U({}),[f,p]=U(null),m=V(()=>Gt({originalQuestions:o?.questions,answers:c,errors:u,pointer:e}),[o?.questions,c,u,e]),h=e??f??m.currentIndex,g=V(()=>!!o?.isBackNavigationAllowed&&h>0&&m.questions.slice(0,h).some(e=>!!e.visible),[o?.isBackNavigationAllowed,m.questions,h]),_=R((e,t)=>{let n=m.questions.find(t=>t.id===e)?.required??!1,r=Q(t);l(i=>{if(!n&&r)return i[e]===null?i:{...i,[e]:null};if(n&&r){if(!(e in i))return i;let t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}})},[m.questions]),v=R(()=>{o?.isBackNavigationAllowed&&p(t=>{let n=t??e??m.currentIndex;for(let e=n-1;e>=0;e--)if(m.questions[e]?.visible)return e;return t})},[o?.isBackNavigationAllowed,m.questions,m.currentIndex,e]),[y,b]=U(0),x=y>0,S=H(null),[C,w]=U(!1);B(()=>{y===0||!S.current||Qt(S.current)},[y]);let T=R(({answers:e})=>{Promise.resolve(s({answers:e})).then(e=>r?.(e??void 0),()=>r?.())},[r,s]),E=R(()=>{let e=Yt({questions:m.questions,errors:u}),t=Zt({questions:m.questions,answers:c,errors:e,locale:a}),r=Object.keys(t).length>0;if(Object.keys(e).length>0||r)return r&&d(e=>({...e,...t})),b(e=>e+1),!1;let i=qt({questions:m.questions,answers:c});return T({answers:i}),w(!0),n?.(),!0},[c,u,m.questions,T,n,a]),D=R(({question:r,answer:i})=>{let s=m.questions.at(r);if(!s)return{error:`Question index is invalid`};let h=Kt(s.properties,{required:s.required}).safeParse(i);if(!h.success){let e=be(h.error,a);return d(t=>{if(t[s.id]===e)return t;let n={...t};return n[s.id]=e,n}),l(e=>{if(!(s.id in e))return e;let t={...e};return delete t[s.id],t}),{error:e}}d(e=>{if(!e[s.id])return e;let t={...e};return delete t[s.id],t});let g=Q(i),_=!s.required&&g?null:i,v={...c},y=v[s.id]!==_;v[s.id]=_;let b=Gt({originalQuestions:o?.questions,answers:v,errors:u,pointer:e});y&&l(v);let x=b.questions.findIndex((e,t)=>t>r&&!!e.visible);if(f!==null&&x!==-1)return p(x),{next:x};if(p(null),b.questions.filter(({visible:e})=>!!e).every(({id:e})=>v[e]!==void 0)&&t){let e=qt({questions:b.questions,answers:v});T({answers:e}),w(!0),n?.()}return{next:b.currentIndex}},[m.questions,c,o?.questions,u,t,e,f,T,n,a]);return m.questions.length===0?G(W,{}):G(`div`,{ref:S,className:`confetti ${me}`,"data-show-errors":x||void 0,children:i({questions:m.questions,current:h,answers:c,update:D,back:v,canGoBack:g,backButtonLabel:o?.backButtonLabel??void 0,saveAnswer:_,submit:E,isSubmitted:C,errors:x?u:Xt})})},en=I(null);function tn({children:a,surveyId:o,publishableKey:s,apiBaseUrl:c,respondent:l,isSurveyVisible:u}){let f=e({surveyId:o,override:l}),p=d({publishableKey:s,apiBaseUrl:c}),{isAvailable:m,isSettled:h}=r({client:p,surveyId:o}),{state:g,isSettled:_}=t({client:p,surveyId:o,respondent:f,enabled:i(u)}),v=V(()=>({respondent:f}),[f]);return!f||!h||!_||!m||!n(g,u)?null:G(en.Provider,{value:v,children:a})}function nn(e){return z(en)?G(W,{children:e.children}):G(tn,{...e})}function rn(){let e=z(en);if(!e)throw Error(`useRespondentVisibility must be used within a RespondentVisibilityProvider`);return e}const an=({children:e,classNames:t,containerProps:n,onDismiss:r,onClose:i,closeOnFinishMs:a=3e3,locale:o})=>{let{surveyId:s,survey:c,dismiss:l}=we(),[u,d]=U(!1),[f,p]=U(!1),[m,h]=U(!1),[g,_]=U(!1);return Fe(()=>{c&&i?.()},f&&!(m||g)?a:null),K(`div`,{className:q(`confetti-dialog ${me}`,t?.dialog),id:`${s}-popover`,...n,onMouseEnter:e=>{n?.onMouseEnter?.(e),h(!0)},onMouseLeave:e=>{n?.onMouseLeave?.(e),h(!1)},onFocusCapture:e=>{n?.onFocusCapture?.(e),_(!0)},onBlurCapture:e=>{n?.onBlurCapture?.(e),e.currentTarget.contains(e.relatedTarget)||_(!1)},children:[G(Te,{className:q(`confetti-dialog-close`,t?.closeButton),iconClassName:t?.icon,locale:o,onClose:async()=>{u||(await l(),r?.()),i?.()}}),typeof e==`function`?e({setIsSubmitted:()=>d(!0),setIsFinished:()=>p(!0)}):e]})},on=3e4,sn=({maskAllInputs:e,initialEventsJson:t,locale:n}={})=>{let[r,i]=U(()=>t??null),[a,o]=U(!1),[s,c]=U(null),[l,u]=U(30),d=H(null),f=H(null),p=H(null),m=H([]);B(()=>{let e=new CustomEvent(pe,{detail:{isRecording:a}});document.dispatchEvent(e)},[a]);let h=R(()=>{f.current&&=(clearInterval(f.current),null),p.current&&=(clearTimeout(p.current),null),d.current=null,u(on/1e3)},[]),g=R(()=>{d.current?.(),h(),o(!1),i(JSON.stringify(m.current))},[h]);return{recordingEventsJson:r,isRecording:a,recordingError:s,remainingSeconds:l,startRecording:R(async()=>{o(!0),c(null),i(null),m.current=[];try{let{record:t}=await import(`./record--U99gpCM.js`);d.current=t({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=>{m.current.push(e)},blockClass:`cfti-block`,maskTextClass:`cfti-mask`,maskAllInputs:e})??null;let n=on/1e3;u(n),f.current=setInterval(()=>{--n,u(n)},1e3),p.current=setTimeout(()=>{g()},on)}catch{c(P(n).recordingError),o(!1),h()}},[e,g,h,n]),stopRecording:g,clear:R(()=>{h(),o(!1),i(null),c(null),m.current=[]},[h])}},cn=e=>e.replace(/\S/g,`*`),ln=e=>`*`.repeat(e.length),un=(e,t)=>{for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t(n):un(n,t)},dn=e=>{if(e instanceof HTMLInputElement)e.setAttribute(`value`,ln(e.getAttribute(`value`)??``));else if(e instanceof HTMLTextAreaElement)e.textContent=ln(e.textContent);else if(e instanceof HTMLSelectElement)for(let t of e.querySelectorAll(`option`))t.textContent=ln(t.textContent)},fn=({maskInputs:e})=>({name:`cfti-redact`,afterClone:t=>{let{clone:n}=t;if(n instanceof HTMLElement){for(let e of n.querySelectorAll(`.${de}`)){un(e,e=>{e.data=cn(e.data)}),dn(e);for(let t of e.querySelectorAll(`input, textarea, select`))dn(t)}if(e)for(let e of n.querySelectorAll(`input, textarea, select`))dn(e)}}}),pn=({maskAllInputs:e,initialDataUrl:t,locale:n}={})=>{let[r,i]=U(()=>t??null),[a,o]=U(!1),[s,c]=U(null);return{screenshotDataUrl:r,isCapturing:a,captureError:s,capture:R(async()=>{o(!0),c(null);try{let{snapdom:t}=await import(`./snapdom-BbRa4ZYv.js`),n=await(await t(document.documentElement,{embedFonts:!0,exclude:[`.${me}`],excludeMode:`hide`,plugins:[fn({maskInputs:!!e})],fast:!1})).toCanvas(),r=window.devicePixelRatio||1,a=Math.min(Math.round(window.innerWidth*r),n.width),o=Math.min(Math.round(window.innerHeight*r),n.height),s=document.createElement(`canvas`);s.width=a,s.height=o;let c=s.getContext(`2d`);if(!c)throw Error(`Failed to get 2D context for cropping`);c.drawImage(n,0,0,a,o,0,0,a,o),i(s.toDataURL(`image/png`))}catch{c(P(n).captureError)}finally{o(!1)}},[e,n]),clear:R(()=>{i(null),c(null)},[])}},mn=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`})]}),hn=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 gn(){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 _n(){if(typeof window>`u`||typeof navigator>`u`)return;let e=navigator,t=window.screen,n=gn();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 vn=Pe(()=>import(`./RecordingReplayer-DNYXhses.js`)),yn=({id:e,title:t,description:n,properties:r,onChange:i,required:a,error:o,classNames:s,maskAllInputs:c,defaultAnswer:l,locale:u})=>{let d=V(()=>_n(),[]),f=l&&typeof l==`object`&&`title`in l?l:void 0,[p,m]=U(()=>f?.title??``),[h,g]=U(()=>f?.description??``),{screenshotDataUrl:_,isCapturing:v,captureError:y,capture:b,clear:x}=pn({maskAllInputs:c,initialDataUrl:f?.screenshotDataUrl,locale:u}),{recordingEventsJson:S,isRecording:C,recordingError:w,remainingSeconds:T,startRecording:E,stopRecording:D,clear:k}=sn({maskAllInputs:c,initialEventsJson:f?.recordingEventsJson,locale:u}),A=V(()=>({title:p,...h?{description:h}:{},..._?{screenshotDataUrl:_}:{},...S?{recordingEventsJson:S}:{},metadata:d}),[h,d,S,_,p]);B(()=>{i(A)},[A,i]),B(()=>()=>{D()},[D]);let j=V(()=>S?JSON.parse(S):[],[S]);return G(W,{children:C?K(O,{className:q(`cf-bug-report-button`,`cf-bug-report-record-button`,s?.button,s?.recordButton),onPress:D,children:[G(mn,{}),K(`span`,{children:[30-T,`s /`,` `,30,`s`]})]}):K(`div`,{className:q(`cf-bug-report`,s?.base),children:[K(Vt,{isRequired:a,isInvalid:!!o,name:`${e}-title`,value:p,onChange:m,className:q(`cf-question`,s?.question),children:[K(`div`,{className:q(`cf-header`,s?.header),children:[K(X,{className:q(`cf-title`,s?.title),children:[t,!a&&K(`span`,{className:q(`cf-label-optional`,s?.optionalLabel),children:[` `,P(u).optional]})]}),n&&G(Z,{slot:`description`,className:q(`cf-description`,s?.description),children:n})]}),G(Ot,{placeholder:Ee(r.placeholder,u),className:q(`cf-input`,s?.input)}),G(vt,{className:q(`cf-error`,s?.error),children:o})]}),K(Vt,{name:`${e}-description`,value:h,onChange:g,className:q(`cf-question`,s?.question),children:[G(X,{className:q(`cf-title`,s?.title),children:r.detailsLabel}),G(zt,{placeholder:Ce(r.detailsPlaceholder,u),className:q(`cf-textarea`,s?.textArea),rows:4})]}),r.enableScreenshot||r.enableRecording?K(`section`,{className:q(`cf-question`,s?.question),children:[G(X,{className:q(`cf-title`,s?.title),children:P(u).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:[_?K(`div`,{className:q(`cf-bug-report-media-preview`,s?.mediaPreview),children:[G(`img`,{src:_,alt:P(u).screenshotPreview,className:q(`cf-bug-report-screenshot-img`,s?.screenshotImg)}),G(`div`,{className:q(`cf-bug-report-media-actions`,s?.mediaActions),children:G(O,{className:q(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:x,"aria-label":P(u).removeScreenshot,children:G(hn,{})})})]}):G(O,{className:q(`cf-bug-report-button`,s?.button),onPress:b,isDisabled:v,children:v?P(u).capturing:P(u).screenshot}),y&&G(`div`,{className:q(`cf-error`,s?.error),children:y})]}),r.enableRecording&&K(`div`,{className:q(`cf-bug-report-recording-section`,s?.recordingSection),children:[j.length>0?K(`div`,{className:q(`cf-bug-report-media-preview`,s?.mediaPreview),children:[G(je,{fallback:G(`span`,{className:q(`cf-bug-report-player-loading`,s?.playerLoading),"aria-label":P(u).loadingRecordingPreview}),children:G(vn,{events:j})}),G(`div`,{className:q(`cf-bug-report-media-actions`,s?.mediaActions),children:G(O,{className:q(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:k,"aria-label":P(u).removeRecording,children:G(hn,{})})})]}):G(O,{className:q(`cf-bug-report-button`,s?.button),onPress:E,children:P(u).record}),w&&G(`div`,{className:q(`cf-error`,s?.error),children:w})]})]})]}):null]})})},bn=({id:e,title:t,description:n,properties:r,onChange:i,classNames:a,required:o,error:s,defaultAnswer:c,locale:l})=>{let[u,d]=U(()=>typeof c==`string`?c:``);return B(()=>{i(u)},[i,u]),K(Vt,{isRequired:o,isInvalid:!!s,name:e,className:q(`cf-question`,a?.question),value:u,onChange:e=>{d(e),i(e)},children:[K(`div`,{className:q(`cf-header`,a?.header),children:[K(X,{className:q(`cf-title`,a?.title),children:[t,!o&&K(`span`,{className:q(`cf-label-optional`,a?.optionalLabel),children:[` `,P(l).optional]})]}),n&&G(Z,{slot:`description`,className:q(`cf-description`,a?.description),children:n})]}),G(zt,{className:q(`cf-textarea`,a?.textarea),maxLength:r.max,rows:4,placeholder:r.placeholder||P(l).startTyping}),G(vt,{className:q(`cf-error`,a?.error),children:s})]})},xn=({children:e,classNames:t,description:n,...r})=>G(wt,{...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})]})}),Sn=({children:e,classNames:t,...n})=>G(wt,{...n,children:G(`div`,{className:q(`cf-tag-label`,t?.tagLabel),children:e})}),Cn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s,defaultAnswer:c,locale:l})=>{let u=!!n.editable,d=De(n.editable?.label,l),f=n.display??`checkbox`,p=Array.isArray(c)?c:[],m=new Set(n.options.map(e=>e.value)),h=p.find(e=>!m.has(e)),[g,_]=U(()=>{let e=p.filter(e=>m.has(e));return h!==void 0&&u&&e.push(se),e}),[v,y]=U(()=>h!==void 0&&u?h:``),b=H(null),x=H(null),S=V(()=>{let e=g.indexOf(se);if(e===-1)return g;let t=[...g];return t[e]=v||`__CONFETTI_CHECKBOX_Others`,t},[v,g]),C=f===`tag`;return B(()=>{i(S)},[i,S]),G(Ct,{isRequired:o,isInvalid:!!s,name:a,value:g,onChange:_,className:q(`cf-question`,r?.question),children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(X,{className:q(`cf-title`,r?.title),children:[e,!o&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,P(l).optional]})]}),t&&G(Z,{slot:`description`,className:q(`cf-description`,r?.description),children:t})]}),K(`div`,{className:q(`cf-response-choices`,f===`tag`&&`cf-response-choices-tag`,r?.group),children:[n.options.map((e,t)=>G(C?Sn:xn,{className:q(`cf-choice`,C&&[`cf-tag`,r?.tag],!C&&[`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.label??e.value},t)),u&&(C?K(W,{children:[G(Sn,{inputRef:b,onChange:e=>{x.current&&e&&requestAnimationFrame(()=>{x.current&&x.current.focus()})},className:q(`cf-choice cf-tag`,r?.tag),value:`__CONFETTI_CHECKBOX_Others`,children:d}),G(Ot,{"data-visible":i.value.includes(`__CONFETTI_CHECKBOX_Others`)||void 0,value:v,onChange:e=>{y(e.target.value)},ref:x,className:q(`cf-input cf-tag-input`,r?.othersInput)})]}):K(`div`,{className:q(`cf-choice cf-others-choice`,r?.othersChoice),children:[G(xn,{inputRef:b,onChange:e=>{x.current&&e&&requestAnimationFrame(()=>{x.current&&x.current.focus()})},className:q(`cf-checkbox`,r?.checkbox),value:`__CONFETTI_CHECKBOX_Others`,classNames:{indicator:r?.indicator,svg:r?.svg},description:n.editable?.description,children:d}),G(Ot,{value:v,onChange:e=>{y(e.target.value)},tabIndex:i.value.includes(`__CONFETTI_CHECKBOX_Others`)?0:-1,ref:x,onFocus:()=>{b.current?.checked===!1&&b.current.click()},className:q(`cf-input`,r?.othersInput)})]}))]}),G(vt,{className:q(`cf-error`,r?.error),children:s})]})})},wn=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`})]}),Tn=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`})]}),En=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`})]}),Dn=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`})]}),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 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01`})]}),kn=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`})}),An=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`})}),jn=({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(It,{className:q(`cf-rating-star`,n?.ratingStar),value:a,"data-filled":o?`true`:void 0,children:G(o?An:kn,{})},t)})})},Mn=({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(It,{className:q(`cf-rating-number`,t?.ratingNumber),value:i,children:r},n)})}),Nn=({properties:e,classNames:t,state:n})=>{let r=V(()=>[wn,En,Dn,On,Tn],[]),i=V(()=>[En,Dn,On],[]);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(It,{className:q(`cf-rating-emoji`,t?.ratingEmoji),value:s,children:c&&G(c,{})},a)})}):G(Mn,{properties:e,classNames:t,state:n})},Pn=e=>{switch(e.properties.display??`star`){case`emoji`:return G(Nn,{...e});case`number`:return G(Mn,{...e});case`star`:return G(jn,{...e})}},Fn=({properties:e,title:t,description:n,classNames:r,onChange:i,id:a,error:o,required:s,defaultAnswer:c,locale:l})=>{let[u,d]=U(()=>typeof c==`number`?String(c):null),f=V(()=>u?Number(u):void 0,[u]);return B(()=>{i(f)},[i,f]),G(Ft,{isRequired:s,isInvalid:!!o,name:a,className:q(`cf-question`,r?.question),value:u,onChange:d,children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(X,{className:q(`cf-title`,r?.title),children:[t,!s&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,P(l).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(vt,{className:q(`cf-error`,r?.error),children:o})]})})},In=({classNames:e,className:t,description:n,...r})=>G(It,{...r,className:q(t,e?.radio),children:_(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})]}))}),Ln=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s,defaultAnswer:c,locale:l})=>{let u=!!n.editable,d=De(n.editable?.label,l),f=typeof c==`string`?c:null,p=f!==null&&n.options.some(e=>e.value===f),[m,h]=U(()=>f===null?null:p?f:u?ae:null),[g,_]=U(()=>f!==null&&!p&&u?f:``),v=H(null),y=H(null),b=V(()=>m===`__CONFETTI_RADIO_Others`?g||`__CONFETTI_RADIO_Others`:m??void 0,[g,m]);return B(()=>{i(b)},[i,b]),G(Ft,{isRequired:o,isInvalid:!!s,name:a,onChange:e=>{h(e),e===`__CONFETTI_RADIO_Others`&&requestAnimationFrame(()=>{y.current&&y.current.focus()})},value:m,className:q(`cf-question`,r?.question),children:({state:i})=>K(W,{children:[K(`div`,{className:q(`cf-header`,r?.header),children:[K(X,{className:q(`cf-title`,r?.title),children:[e,!o&&K(`span`,{className:q(`cf-label-optional`,r?.optionalLabel),children:[` `,P(l).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(In,{classNames:{indicator:r?.indicator,radio:q(`cf-choice cf-radio`,r?.radio)},value:e.value,description:e.description,children:e.label??e.value},t)),u&&K(`div`,{className:q(`cf-choice cf-others-choice`,r?.othersChoice),children:[G(In,{inputRef:v,value:`__CONFETTI_RADIO_Others`,classNames:{indicator:r?.indicator,radio:q(`cf-radio`,r?.radio)},description:n.editable?.description,children:d}),G(Ot,{tabIndex:i.selectedValue===`__CONFETTI_RADIO_Others`?0:-1,ref:y,value:g,onChange:e=>_(e.target.value),onFocus:()=>{v.current?.checked===!1&&v.current.click()},className:q(`cf-input`,r?.othersInput)})]})]}),G(vt,{className:q(`cf-error`,r?.error),children:s})]})})},Rn=({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})]})}),zn=({question:e,onChange:t,error:n,maskAllInputs:r,defaultAnswer:i,locale:a})=>{switch(e.properties.type){case`rating`:return G(Fn,{...e,properties:e.properties,onChange:t,error:n,defaultAnswer:i,locale:a},e.id);case`open-ended`:return G(bn,{...e,properties:e.properties,onChange:t,error:n,defaultAnswer:i,locale:a},e.id);case`single-select`:return G(Ln,{...e,properties:e.properties,onChange:t,error:n,defaultAnswer:i,locale:a},e.id);case`multi-select`:return G(Cn,{...e,properties:e.properties,onChange:t,error:n,defaultAnswer:i,locale:a},e.id);case`statement`:return G(Rn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`bug-report`:return G(yn,{...e,properties:e.properties,onChange:t,error:n,maskAllInputs:r,defaultAnswer:i,locale:a},e.id)}return G(`div`,{children:P(a).unsupportedQuestionType},e.id)},Bn=({title:e,description:t,classNames:n,onClose:r,locale:i})=>{let{survey:a}=we();if(!a)return null;let o=t||a.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(X,{className:q(`cf-title`,n?.title),children:e||Se(a.confirmation.title,i)}),o&&G(Z,{slot:`description`,className:q(`cf-description`,n?.description),children:o})]})}),G(O,{className:`cf-submit-button`,onPress:()=>{r?.()},children:ve(a.confirmation.buttonText,i)})]})},Vn=({onPress:e,children:t,locale:n})=>xe()?null:G(O,{className:`cf-back-button`,onPress:e,children:t===void 0?P(n).back:t}),Hn=({question:e,answer:t,isLastQuestion:n,locale:r})=>{if(e.properties.buttonLabel)return e.properties.buttonLabel;let i=P(r);return Wt({routingLogic:e.routingLogic,answer:t,required:e.required,isLastQuestion:n})?!e.required&&Q(t)?i.skip:i.next:i.submit},Un=({onPress:e,isDisabled:t,children:n,locale:r})=>xe()?null:G(O,{isDisabled:t,className:`cf-submit-button`,onPress:e,children:n===void 0?P(r).submit:n}),Wn=e=>{switch(e){case`multi-select`:return[];case`bug-report`:return{title:``};case`statement`:return;default:return``}},Gn=e=>!Q(e),Kn=({onSubmit:e,children:t,question:n,isLastQuestion:r,defaultAnswer:i,backButton:a,saveAnswer:o,locale:s})=>{let c=xe(),[l,u]=U(i??Wn(n.properties.type)),d=V(()=>Kt(n.properties,{required:n.required}),[n.properties,n.required]),f=V(()=>{let e=d.safeParse(l);if(!e.success)return be(e.error,s)},[l,d,s]),p=V(()=>Hn({question:n,answer:l,isLastQuestion:r,locale:s}),[l,r,s,n]),m=R(()=>{switch(n.properties.type){case`statement`:if(n.properties.buttonUrl&&typeof window<`u`){let e=re.safeParse(n.properties.buttonUrl).data;e&&window.open(e,`_blank`)}return e(void 0);default:return e(l)}},[l,e,n.properties]),h=Gn(i),g=V(()=>{switch(n.properties.type){case`rating`:case`single-select`:return!!n.properties.shouldAutoProgress;default:return!1}},[n.properties])&&!h,_=R(t=>{u(t),g&&Gn(t)&&d.safeParse(t).success&&e(t)},[g,d,e]),v=V(()=>{if(!a||!Ne(a))return a;let e=a;return Me(e,{onPress:()=>{let t=Ht({answer:l,defaultAnswer:i});t!==void 0&&o?.(t),e.props.onPress?.()}})},[a,l,i,o]);return K(W,{children:[t({onChange:_,question:n,error:f,defaultAnswer:i}),!c&&K(`div`,{className:`cf-button-row`,children:[v,(!g||!n.required)&&G(Un,{isDisabled:!!f,onPress:m,children:p})]})]})},qn=({onSubmit:e,children:t,locale:n})=>K(W,{children:[t,G(Un,{onPress:e,locale:n})]});export{zn as a,Fn as c,an as d,en as f,$t as h,Bn as i,Cn as l,rn as m,Kn as n,Rn as o,nn as p,Vn as r,Ln as s,qn as t,bn as u};
@@ -1,4 +1,4 @@
1
- import { n as Locale } from "./index-DODfg3Bc.js";
1
+ import { r as Locale } from "./index-DLqC_qk3.js";
2
2
 
3
3
  //#region src/components/container/ModalContainer.d.ts
4
4
  interface ModalContainerProps {
@@ -0,0 +1,5 @@
1
+ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,I as s,J as c,K as l,M as u,O as d,P as f,S as p,T as m,U as h,W as g,_,a as v,b as ee,c as te,f as ne,g as re,h as ie,j as y,k as b,l as ae,m as oe,p as se,q as ce,s as le,t as ue,u as de,w as fe,x as pe,y as me,z as he}from"./Button-D3Wb2KZB.js";import{i as ge,n as _e,r as ve}from"./src-DG66KK2l.js";import{i as ye,r as be,t as xe}from"./internals-DKNTeE-L.js";import x,{createContext as S,forwardRef as Se,useCallback as C,useContext as w,useEffect as T,useMemo as E,useReducer as Ce,useRef as D,useState as O}from"react";import{useTimeout as we}from"usehooks-ts";import{z as k}from"zod";import{Fragment as Te,jsx as A,jsxs as Ee}from"react/jsx-runtime";import j from"clsx";import De,{flushSync as Oe}from"react-dom";const ke=S(null);S(null),S(null),S(null),S(null);const Ae=S({});S(null);const je=S(null);function Me(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 Ne(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function M(e){let t=null;return()=>(t??=e(),t)}const Pe=M(function(){return Ne(/^Mac/i)}),Fe=M(function(){return Ne(/^iPhone/i)}),Ie=M(function(){return Ne(/^iPad/i)||Pe()&&navigator.maxTouchPoints>1}),Le=M(function(){return Fe()||Ie()}),Re=M(function(){return Me(/AppleWebKit/i)&&(Le()||!ze())}),ze=M(function(){return Me(/Chrome|CriOS|CrMo/i)});String(Math.round(Math.random()*1e10));const Be=x.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement,x.useId;function Ve(){return!1}function He(){return!0}function Ue(e){return()=>{}}function We(){return typeof x.useSyncExternalStore==`function`?x.useSyncExternalStore(Ue,Ve,He):w(Be)}function Ge(){return!1}const Ke=(e=document)=>{if(!Ge())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function qe(e){if(Ge()&&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 Je(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}const Ye=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Xe(e){return e instanceof HTMLInputElement&&!Ye.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let N=typeof document<`u`&&window.visualViewport;function Ze(){let e=We(),[t,n]=O(()=>e?{width:0,height:0}:Qe());return T(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{N&&N.scale>1||e(Qe())},r,i=t=>{N&&N.scale>1||Xe(qe(t))&&(r=requestAnimationFrame(()=>{let t=Ke();(!t||!Xe(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(Qe()),Le()&&Re()&&window.addEventListener(`blur`,i,!0),N?N.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),Le()&&Re()&&window.removeEventListener(`blur`,i,!0),N?N.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function Qe(){return{width:N?Math.min(N.width*N.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:N?N.height*N.scale:document.documentElement.clientHeight}}function $e(e,t=!0){let[n,r]=O(!0),i=n&&t;return ce(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),tt(e,i,C(()=>r(!1),[])),i}function et(e,t){let[n,r]=O(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`);break}let i=n===`exiting`;return tt(e,i,C(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function tt(e,t,n){ce(()=>{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||Oe(()=>{n()})}),()=>{r=!0}}},[e,t,n])}const nt=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function rt(e){return e instanceof HTMLInputElement&&!nt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function it(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=oe(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}}const at=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),ot=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function st(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 at.has(t.script)}let t=e.split(`-`)[0];return ot.has(t)}const ct=Symbol.for(`react-aria.i18n.locale`);function lt(){let e=typeof window<`u`&&window[ct]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:st(e)?`rtl`:`ltr`}}let ut=lt(),P=new Set;function dt(){ut=lt();for(let e of P)e(ut)}function ft(){let e=me(),[t,n]=O(ut);return T(()=>(P.size===0&&window.addEventListener(`languagechange`,dt),P.add(n),()=>{P.delete(n),P.size===0&&window.removeEventListener(`languagechange`,dt)}),[]),e?{locale:typeof window<`u`&&window[ct]||`en-US`,direction:`ltr`}:t}const pt=x.createContext(null);function mt(){let e=ft();return w(pt)||e}const ht=Symbol.for(`react-aria.i18n.locale`),gt=Symbol.for(`react-aria.i18n.strings`);let F;var _t=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=vt(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[ht];if(F===void 0){let t=window[gt];if(!t)return null;F={};for(let r in t)F[r]=new e({[n]:t[r]},n)}let r=F?.[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 vt(e,t,n=`en-US`){if(t[e])return t[e];let r=yt(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function yt(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const bt=new Map,xt=new Map;var St=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=bt.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),bt.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=xt.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),xt.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}};const Ct=new WeakMap;function wt(e){let t=Ct.get(e);return t||(t=new _t(e),Ct.set(e,t)),t}function Tt(e,t){return t&&_t.getGlobalDictionaryForPackage(t)||wt(e)}function Et(e,t){let{locale:n}=mt(),r=Tt(e,t);return E(()=>new St(n,r),[n,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(!i(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let a=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(a),a.currentNode=r,this._currentSetFor.add(a),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return i(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function Ot(t,n,r,i){return e()?new Dt(t,n,r,i):t.createTreeWalker(n,r,i)}const kt=x.createContext(null),At=`react-aria-focus-scope-restore`;let I=null;function jt(e){let{children:t,contain:r,restoreFocus:i,autoFocus:a}=e,o=D(null),s=D(null),c=D([]),{parentNode:l}=w(kt)||{},u=E(()=>new Kt({scopeRef:c}),[c]);n(()=>{let e=l||W.root;if(W.getTreeNode(e.scopeRef)&&I&&!V(I,e.scopeRef)){let t=W.getTreeNode(I);t&&(e=t)}e.addChild(u),W.addNode(u)},[u,l]),n(()=>{let e=W.getTreeNode(c);e&&(e.contain=!!r)},[r]),n(()=>{let e=o.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==s.current;)t.push(e),e.addEventListener(At,n),e=e.nextSibling;return c.current=t,()=>{for(let e of t)e.removeEventListener(At,n)}},[t]),Vt(c,i,r),Ft(c,r),Ut(c,i,r),Bt(c,a),T(()=>{let e=d(y(c.current?c.current[0]:void 0)),t=null;if(z(e,c.current)){for(let n of W.traverse())n.scopeRef&&z(e,n.scopeRef.current)&&(t=n);t===W.getTreeNode(c)&&(I=t.scopeRef)}},[c]),n(()=>()=>{let e=W.getTreeNode(c)?.parent?.scopeRef??null;(c===I||V(c,I))&&(!e||W.getTreeNode(e))&&(I=e),W.removeTreeNode(c)},[c]);let f=E(()=>Mt(c),[]),p=E(()=>({focusManager:f,parentNode:u}),[u,f]);return x.createElement(kt.Provider,{value:p},x.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,x.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:s}))}function Mt(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||d(y(n[0]??void 0)),c=n[0].previousElementSibling,l=U(L(n),{tabbable:i,accept:o},n);l.currentNode=z(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&H(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||d(y(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=U(L(n),{tabbable:i,accept:o},n);l.currentNode=z(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&H(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=U(L(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&H(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=U(L(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&H(o,!0),o}}}function L(e){return e[0].parentElement}function R(e){let t=W.getTreeNode(I);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Nt(e){if(!e.form)return Array.from(y(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=u(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function Pt(e){if(e.checked)return!0;let t=Nt(e);return t.length>0&&!t.some(e=>e.checked)}function Ft(e,t){let r=D(void 0),i=D(void 0);n(()=>{let n=e.current;if(!t){i.current&&=(cancelAnimationFrame(i.current),void 0);return}let a=y(n?n[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!R(e)||t.isComposing)return;let n=d(a),r=e.current;if(!r||!z(n,r))return;let i=U(L(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&&(H(o,!0),o instanceof u(o).HTMLInputElement&&o.select())},s=t=>{(!I||V(I,e))&&z(b(t),e.current)?(I=e,r.current=b(t)):R(e)&&!B(b(t),e)?r.current?r.current.focus():I&&I.current&&zt(I.current):R(e)&&(r.current=b(t))},c=t=>{i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{let n=_(),i=(n===`virtual`||n===null)&&pe()&&ee(),o=d(a);if(!i&&o&&R(e)&&!B(o,e)){I=e;let n=b(t);n&&n.isConnected?(r.current=n,r.current?.focus()):I.current&&zt(I.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),n?.forEach(e=>e.addEventListener(`focusin`,s,!1)),n?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),n?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),n?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),n(()=>()=>{i.current&&cancelAnimationFrame(i.current)},[i])}function It(e){return B(e)}function z(e,t){return!e||!t?!1:t.some(t=>i(t,e))}function B(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of W.traverse(W.getTreeNode(t)))if(n&&z(e,n.current))return!0;return!1}function Lt(e){return B(e,I)}function V(e,t){let n=W.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function H(e,t=!1){if(e!=null&&!t)try{re(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Rt(e,t=!0){let n=e[0].previousElementSibling,r=L(e),i=U(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=L(e),i=U(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function zt(e,t=!0){H(Rt(e,t))}function Bt(e,t){let n=x.useRef(t);T(()=>{n.current&&(I=e,!z(d(y(e.current?e.current[0]:void 0)),I.current)&&e.current&&zt(e.current)),n.current=!1},[e])}function Vt(e,t,r){n(()=>{if(t||r)return;let n=e.current,i=y(n?n[0]:void 0),a=t=>{let n=b(t);z(n,e.current)?I=e:It(n)||(I=null)};return i.addEventListener(`focusin`,a,!1),n?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),n?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,r])}function Ht(e){let t=W.getTreeNode(I);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function Ut(e,t,r){let i=D(typeof document<`u`?d(y(e.current?e.current[0]:void 0)):null);n(()=>{let n=e.current,i=y(n?n[0]:void 0);if(!t||r)return;let a=()=>{(!I||V(I,e))&&z(d(i),e.current)&&(I=e)};return i.addEventListener(`focusin`,a,!1),n?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),n?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,r]),n(()=>{let n=y(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!R(e)||t.isComposing)return;let r=n.activeElement;if(!B(r,e)||!Ht(e))return;let i=W.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=U(n.body,{tabbable:!0});o.currentNode=r;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===n.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!B(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(B(s,e));t.preventDefault(),t.stopPropagation(),s?H(s,!0):It(a)?H(a,!0):r.blur()}};return r||n.addEventListener(`keydown`,i,!0),()=>{r||n.removeEventListener(`keydown`,i,!0)}},[e,t,r]),n(()=>{let n=y(e.current?e.current[0]:void 0);if(!t)return;let r=W.getTreeNode(e);if(r)return r.nodeToRestore=i.current??void 0,()=>{let r=W.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=d(n);if(t&&i&&(a&&B(a,e)||a===n.body&&Ht(e))){let t=W.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){Wt(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&W.getTreeNode(n.scopeRef)){Wt(Rt(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function Wt(e){e.dispatchEvent(new CustomEvent(At,{bubbles:!0,cancelable:!0}))&&H(e)}function U(e,t,n){let r=t?.tabbable?m:fe,a=y(e?.nodeType===Node.ELEMENT_NODE?e:null),o=Ot(a,e||a,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!Pt(e)||o.currentNode.tagName===`INPUT`&&o.currentNode.type===`radio`&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||z(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(o.currentNode=t.from),o}var Gt=class e{constructor(){this.fastMap=new Map,this.root=new Kt({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 Kt({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&&z(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}},Kt=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 W=new Gt;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=typeof document<`u`?x.useInsertionEffect??x.useLayoutEffect:()=>{};function Xt(e,t,n){let[r,i]=O(e||t),a=D(r),o=D(e!==void 0),s=e!==void 0;T(()=>{o.current,o.current=s},[s]);let c=s?e:r;Yt(()=>{a.current=c});let[,l]=Ce(()=>({}),{});return[c,C((e,...t)=>{let r=typeof e==`function`?e(a.current):e;Object.is(a.current,r)||(a.current=r,i(r),l(),n?.(r,...t))},[n])]}const Zt={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 Qt(e={}){let{style:t,isFocusable:n}=e,[r,i]=O(!1),{focusWithinProps:a}=v({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=E(()=>r?t:t?{...Zt,...t}:Zt,[r]);return{visuallyHiddenProps:{...a,style:o}}}function $t(e){let{children:t,elementType:n=`div`,isFocusable:r,style:i,...a}=e,{visuallyHiddenProps:o}=Qt(e);return x.createElement(n,ne(a,o),t)}const en=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function tn(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}let G=new WeakMap,K=[];function nn(t,n){let r=u(t?.[0]),a=n instanceof r.Element?{root:n}:n,o=a?.root??document.body,s=a?.shouldUseInert&&en,c=new Set(t),l=new Set,d=e=>s&&e instanceof r.HTMLElement?e.inert:e.getAttribute(`aria-hidden`)===`true`,f=(e,t)=>{s&&e instanceof r.HTMLElement?e.inert=t:t?e.setAttribute(`aria-hidden`,`true`):(e.removeAttribute(`aria-hidden`),e instanceof r.HTMLElement&&(e.inert=!1))},p=new Set;if(e())for(let e of t){let t=e;for(;t&&t!==o;){let e=t.getRootNode();`shadowRoot`in e&&p.add(e.shadowRoot),t=e.parentNode}}let m=e=>{for(let t of e.querySelectorAll(`[data-live-announcer], [data-react-aria-top-layer]`))c.add(t);let t=e=>{if(l.has(e)||c.has(e)||e.parentElement&&l.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of c)if(i(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=Ot(y(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&h(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;e!=null;)h(e),e=n.nextNode()}},h=e=>{let t=G.get(e)??0;d(e)&&t===0||(t===0&&f(e,!0),l.add(e),G.set(e,t+1))};K.length&&K[K.length-1].disconnect(),m(o);let g=new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){if(n.target.isConnected&&![...c,...l].some(e=>i(e,n.target)))for(let e of n.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&tn(e)?c.add(e):e instanceof Element&&m(e);if(e()){for(let e of p)if(!e.isConnected){g.disconnect();break}}}});g.observe(o,{childList:!0,subtree:!0});let _=new Set;if(e())for(let t of p){let n=new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){if(n.target.isConnected&&![...c,...l].some(e=>i(e,n.target)))for(let e of n.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&tn(e)?c.add(e):e instanceof Element&&m(e);if(e()){for(let e of p)if(!e.isConnected){g.disconnect();break}}}});n.observe(t,{childList:!0,subtree:!0}),_.add(n)}let v={visibleNodes:c,hiddenNodes:l,observe(){g.observe(o,{childList:!0,subtree:!0})},disconnect(){g.disconnect()}};return K.push(v),()=>{if(g.disconnect(),e())for(let e of _)e.disconnect();for(let e of l){let t=G.get(e);t!=null&&(t===1?(f(e,!1),G.delete(e)):G.set(e,t-1))}v===K[K.length-1]?(K.pop(),K.length&&K[K.length-1].observe()):K.splice(K.indexOf(v),1)}}function rn({children:e}){let t=E(()=>({register:()=>{}}),[]);return x.createElement(le.Provider,{value:t},e)}const an=S({});function on(){return w(an)??{}}const sn=x.createContext(null);function cn(e){let t=me(),{portalContainer:n=t?null:document.body,isExiting:r}=e,[i,a]=O(!1),o=E(()=>({contain:i,setContain:a}),[i,a]),{getContainer:s}=on();if(!e.portalContainer&&s&&(n=s()),!n)return null;let c=e.children;return e.disableFocusManagement||(c=x.createElement(jt,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!r},c)),c=x.createElement(sn.Provider,{value:o},x.createElement(rn,null,c)),De.createPortal(c,n)}function ln(){let e=w(sn)?.setContain;n(()=>{e?.(!0)},[e])}function un(e,t){let{role:n=`dialog`}=e,i=se();i=e[`aria-label`]?void 0:i;let a=D(!1);return T(()=>{if(t.current&&!r(t.current)){re(t.current);let e=setTimeout(()=>{(d()===t.current||d()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),re(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),ln(),D(!1),T(()=>{}),{dialogProps:{...ae(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]||i,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:i}}}function dn(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=D({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=de(e=>{n&&fn(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=de(e=>{n&&n(e)});T(()=>{let e=a.current;if(r)return;let n=t.current,i=y(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&fn(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 fn(e,t){if(e.button>0)return!1;let n=b(e);if(n){let e=n.ownerDocument;if(!e||!i(e.documentElement,n)||n.closest(`[data-react-aria-top-layer]`))return!1}return t.current?!e.composedPath().includes(t.current):!1}var pn={};pn={dismiss:`تجاهل`};var mn={};mn={dismiss:`Отхвърляне`};var hn={};hn={dismiss:`Odstranit`};var gn={};gn={dismiss:`Luk`};var _n={};_n={dismiss:`Schließen`};var vn={};vn={dismiss:`Απόρριψη`};var yn={};yn={dismiss:`Dismiss`};var bn={};bn={dismiss:`Descartar`};var xn={};xn={dismiss:`Lõpeta`};var Sn={};Sn={dismiss:`Hylkää`};var Cn={};Cn={dismiss:`Rejeter`};var wn={};wn={dismiss:`התעלם`};var Tn={};Tn={dismiss:`Odbaci`};var En={};En={dismiss:`Elutasítás`};var Dn={};Dn={dismiss:`Ignora`};var On={};On={dismiss:`閉じる`};var kn={};kn={dismiss:`무시`};var An={};An={dismiss:`Atmesti`};var jn={};jn={dismiss:`Nerādīt`};var Mn={};Mn={dismiss:`Lukk`};var Nn={};Nn={dismiss:`Negeren`};var Pn={};Pn={dismiss:`Zignoruj`};var Fn={};Fn={dismiss:`Descartar`};var In={};In={dismiss:`Dispensar`};var Ln={};Ln={dismiss:`Revocare`};var Rn={};Rn={dismiss:`Пропустить`};var zn={};zn={dismiss:`Zrušiť`};var Bn={};Bn={dismiss:`Opusti`};var Vn={};Vn={dismiss:`Odbaci`};var Hn={};Hn={dismiss:`Avvisa`};var Un={};Un={dismiss:`Kapat`};var Wn={};Wn={dismiss:`Скасувати`};var Gn={};Gn={dismiss:`取消`};var Kn={};Kn={dismiss:`關閉`};var qn={};qn={"ar-AE":pn,"bg-BG":mn,"cs-CZ":hn,"da-DK":gn,"de-DE":_n,"el-GR":vn,"en-US":yn,"es-ES":bn,"et-EE":xn,"fi-FI":Sn,"fr-FR":Cn,"he-IL":wn,"hr-HR":Tn,"hu-HU":En,"it-IT":Dn,"ja-JP":On,"ko-KR":kn,"lt-LT":An,"lv-LV":jn,"nb-NO":Mn,"nl-NL":Nn,"pl-PL":Pn,"pt-BR":Fn,"pt-PT":In,"ro-RO":Ln,"ru-RU":Rn,"sk-SK":zn,"sl-SI":Bn,"sr-SP":Vn,"sv-SE":Hn,"tr-TR":Un,"uk-UA":Wn,"zh-CN":Gn,"zh-TW":Kn};function Jn(e){return e&&e.__esModule?e.default:e}function Yn(e){let{onDismiss:t,...n}=e,r=it(n,Et(Jn(qn),`@react-aria/overlays`).format(`dismiss`)),i=()=>{t&&t()};return x.createElement($t,null,x.createElement(`button`,{...r,tabIndex:-1,onClick:i,style:{width:1,height:1}}))}const q=[];function Xn(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,c=D(void 0);T(()=>{if(i&&!q.includes(t))return q.push(t),()=>{let e=q.indexOf(t);e>=0&&q.splice(e,1)}},[i,t]);let l=()=>{q[q.length-1]===t&&n&&n()},u=e=>{let n=q[q.length-1];c.current=n,(!s||s(b(e)))&&n===t&&e.stopPropagation()},d=e=>{(!s||s(b(e)))&&(q[q.length-1]===t&&e.stopPropagation(),c.current===t&&l()),c.current=void 0},f=e=>{e.key===`Escape`&&!o&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),l())};dn({ref:t,onInteractOutside:a&&i?d:void 0,onInteractOutsideStart:u});let{focusWithinProps:p}=v({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||Lt(e.relatedTarget)||(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:f,...p},underlayProps:{}}}const J=typeof document<`u`&&window.visualViewport;let Y=0,Zn;function Qn(e={}){let{isDisabled:t}=e;n(()=>{if(!t)return Y++,Y===1&&(Zn=p()?er():$n()),()=>{Y--,Y===0&&Zn()}},[t])}function $n(){let e=window.innerWidth-document.documentElement.clientWidth;return ie(e>0&&(`scrollbarGutter`in document.documentElement.style?X(document.documentElement,`scrollbarGutter`,`stable`):X(document.documentElement,`paddingRight`,`${e}px`)),X(document.documentElement,`overflow`,`hidden`))}function er(){let e=X(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=b(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=te();a&&(i.nonce=a),i.textContent=`@layer {
2
+ * {
3
+ overscroll-behavior: contain;
4
+ }
5
+ }`,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=b(e),n=e.relatedTarget;n&&rt(n)?(n.focus({preventScroll:!0}),nr(n,rt(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=d(),n=t!=null&&rt(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&nr(this,n)};let l=ie(tr(document,`touchstart`,r,{passive:!1,capture:!0}),tr(document,`touchmove`,o,{passive:!1,capture:!0}),tr(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function X(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function tr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function nr(e,t){t||!J?rr(e):J.addEventListener(`resize`,()=>rr(e),{once:!0})}function rr(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;J&&(n=Math.min(n,J.offsetTop+J.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 ir(e,t,n){let{overlayProps:r,underlayProps:i}=Xn({...e,isOpen:t.isOpen,onClose:t.close},n);return Qn({isDisabled:!t.isOpen}),ln(),T(()=>{if(t.isOpen&&n.current)return nn([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:ne(r),underlayProps:i}}function ar(e){let[t,n]=Xt(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:C(()=>{n(!0)},[n]),close:C(()=>{n(!1)},[n]),toggle:C(()=>{n(!t)},[n,t])}}const or=S(null),Z=S(null),sr=Se(function(e,n){let r=e[`aria-labelledby`];[e,n]=a(e,n,or);let{dialogProps:i,titleProps:c}=un({...e,"aria-labelledby":r},n),l=w(Z);!i[`aria-label`]&&!i[`aria-labelledby`]&&e[`aria-labelledby`]&&(i[`aria-labelledby`]=e[`aria-labelledby`]);let u=s({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:l?.close||(()=>{})}}),d=g(e,{global:!0});return x.createElement(t.section,{...o(d,u,i),render:e.render,ref:n,slot:e.slot||void 0},x.createElement(f,{values:[[Ae,{slots:{[he]:{},title:{...c,level:2}}}],[ue,{slots:{[he]:{},close:{onPress:()=>l?.close()}}}]]},u.children))}),cr=S(null),lr=S(null),ur=Se(function(e,t){if(w(lr))return x.createElement(mr,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,children:s,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d,...f}=e;return x.createElement(fr,{isDismissable:n,isKeyboardDismissDisabled:r,isOpen:i,defaultOpen:a,onOpenChange:o,isEntering:c,isExiting:l,UNSTABLE_portalContainer:u,shouldCloseOnInteractOutside:d},x.createElement(mr,{...f,modalRef:t},s))});function dr(e,t){[e,t]=a(e,t,cr);let n=w(Z),r=ar(e),i=e.isOpen!=null||e.defaultOpen!=null||!n?r:n,o=h(t),s=D(null),c=et(o,i.isOpen),l=et(s,i.isOpen),u=c||l||e.isExiting||!1,d=me();return!i.isOpen&&!u||d?null:x.createElement(pr,{...e,state:i,isExiting:u,overlayRef:o,modalRef:s})}const fr=Se(dr);function pr({UNSTABLE_portalContainer:e,...n}){let r=n.modalRef,{state:i}=n,{modalProps:a,underlayProps:c}=ir(n,i,r),l=$e(n.overlayRef)||n.isEntering||!1,u=s({...n,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:l,isExiting:n.isExiting,state:i}}),d=Ze(),p;if(typeof document<`u`){let e=Je(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().height%1;p=e.scrollHeight-t}let m={...u.style,"--visual-viewport-height":d.height+`px`,"--page-height":p===void 0?void 0:p+`px`};return x.createElement(cn,{isExiting:n.isExiting,portalContainer:e},x.createElement(t.div,{...o(g(n,{global:!0}),c),...u,style:m,ref:n.overlayRef,"data-entering":l||void 0,"data-exiting":n.isExiting||void 0},x.createElement(f,{values:[[lr,{modalProps:a,modalRef:r,isExiting:n.isExiting,isDismissable:n.isDismissable}],[Z,i]]},u.children)))}function mr(e){let{modalProps:n,modalRef:r,isExiting:i,isDismissable:a}=w(lr),c=w(Z),u=h(E(()=>l(e.modalRef,r),[e.modalRef,r])),d=$e(u),f=s({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:d,isExiting:i,state:c}});return x.createElement(t.div,{...o(g(e,{global:!0}),n),...f,ref:u,"data-entering":d||void 0,"data-exiting":i||void 0},a&&x.createElement(Yn,{onDismiss:c.close}),f.children)}const hr={en:{required:`This field is required`,selectOption:`Please select an option`,fillFreeText:`Please fill out the free text field`,selectAtLeastOne:`Please select at least one option`,selectRating:`Please select a rating`,titleRequired:`Title is required`,invalidImage:`Invalid image data URL`,invalidRecording:`Invalid recording events`,invalidInput:`Invalid input`,maxLength:`Please enter less than {max} characters`,maxSelected:`Please select less than {max} options`},zh:{required:`此字段为必填项`,selectOption:`请选择一个选项`,fillFreeText:`请填写文本框`,selectAtLeastOne:`请至少选择一个选项`,selectRating:`请选择评分`,titleRequired:`标题为必填项`,invalidImage:`图片数据网址无效`,invalidRecording:`录制事件无效`,invalidInput:`输入无效`,maxLength:`请输入少于 {max} 个字符`,maxSelected:`请选择少于 {max} 个选项`},ms:{required:`Ruangan ini diperlukan`,selectOption:`Sila pilih satu pilihan`,fillFreeText:`Sila isikan ruangan teks`,selectAtLeastOne:`Sila pilih sekurang-kurangnya satu pilihan`,selectRating:`Sila pilih penilaian`,titleRequired:`Tajuk diperlukan`,invalidImage:`URL data imej tidak sah`,invalidRecording:`Acara rakaman tidak sah`,invalidInput:`Masukan tidak sah`,maxLength:`Sila masukkan kurang daripada {max} aksara`,maxSelected:`Sila pilih kurang daripada {max} pilihan`},ta:{required:`இந்தப் புலம் தேவை`,selectOption:`ஒரு விருப்பத்தைத் தேர்ந்தெடுக்கவும்`,fillFreeText:`உரைப் புலத்தில் விவரங்களை உள்ளிடவும்`,selectAtLeastOne:`குறைந்தது ஒரு விருப்பத்தையாவது தேர்ந்தெடுக்கவும்`,selectRating:`மதிப்பீட்டைத் தேர்ந்தெடுக்கவும்`,titleRequired:`தலைப்பு தேவை`,invalidImage:`படத்தின் URL தவறானது`,invalidRecording:`தவறான பதிவு நிகழ்வுகள்`,invalidInput:`தவறான உள்ளீடு`,maxLength:`{max} எழுத்துகளுக்கு மிகாமல் உள்ளிடவும்`,maxSelected:`அதிகபட்சம் {max} விருப்பங்களைத் தேர்ந்தெடுக்கவும்`}},gr=(e=`en`)=>hr[e],_r=/^Please enter less than (\d+) characters$/,vr=/^Please select less than (\d+) options$/,yr=(e,t)=>{let n=gr(t),r=e.match(_r);if(r)return n.maxLength.replace(`{max}`,r[1]??``);let i=e.match(vr);if(i)return n.maxSelected.replace(`{max}`,i[1]??``);switch(e){case`This field is required`:return n.required;case`Please select an option`:return n.selectOption;case`Please fill out the free text field`:return n.fillFreeText;case`Please select at least one option`:return n.selectAtLeastOne;case`Please select a rating`:return n.selectRating;case`Title is required`:return n.titleRequired;case`Invalid image data URL`:return n.invalidImage;case`Invalid recording events`:return n.invalidRecording;case`Invalid input`:return n.invalidInput;default:return e}};function br(e,t){let n=e.issues[0];return yr(n?.message??`Invalid input`,t)}function xr(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e)}const Sr=[`id`,`email`,`name`],Q=e=>k.custom(t=>typeof t==`object`&&!!t&&typeof Reflect.get(t,e)==`function`),Cr=Q(`get_distinct_id`),wr=Q(`get_session_id`),Tr=Q(`getUser`),Er=Q(`getInternalContext`),Dr=k.string(),Or=k.record(k.string(),k.unknown()),kr=k.object({session_id:k.string().optional()}),Ar=(e,t)=>{if(typeof window>`u`)return;let n=t.safeParse(Reflect.get(window,e));return n.success?n.data:void 0},jr=()=>{try{let e=Ar(`posthog`,Cr);if(!e)return;let t=Dr.safeParse(e.get_distinct_id());return t.success?t.data:void 0}catch{return}},Mr=()=>{try{let e=Ar(`posthog`,wr);if(!e)return;let t=Dr.safeParse(e.get_session_id());return t.success?t.data:void 0}catch{return}},Nr=()=>{try{let e=Ar(`DD_RUM`,Tr);if(!e)return;let t=Or.safeParse(e.getUser());return!t.success||Object.keys(t.data).length===0?void 0:t.data}catch{return}},Pr=()=>{try{let e=Ar(`DD_RUM`,Er);if(!e)return;let t=kr.safeParse(e.getInternalContext());return t.success?t.data.session_id:void 0}catch{return}},Fr=e=>{let t={...e},n=Nr(),r;if(n)try{r=JSON.stringify(n)}catch{r=void 0}let i=[[`posthog_distinct_id`,jr()],[`posthog_session_id`,Mr()],[`datadog_rum_user`,r],[`datadog_rum_session_id`,Pr()],...Sr.map(e=>[`datadog_rum_user_${e}`,xr(n?.[e])])];for(let[e,n]of i)Object.prototype.hasOwnProperty.call(t,e)||n===void 0||n.trim()===``||(t[e]=n);return t},Ir=(e,t=!1)=>t?Fr(e):e,Lr=S({}),Rr=()=>w(Lr),zr=S({}),Br=({type:e,children:t})=>{let n=E(()=>({type:e}),[e]);return A(zr.Provider,{value:n,children:t})},Vr=()=>w(zr),Hr=S(null),Ur=({children:e,surveyId:t,publishableKey:n,respondent:r,metadata:i={},autoInjectAnalyticsMetadata:a=!1,locale:o,apiBaseUrl:s})=>{let{type:l}=Vr(),u=Rr(),d=u.version??`0.9.1`,f=u.build,p=c({publishableKey:n,apiBaseUrl:s}),m=D(void 0),[h,g]=O(),_=h?.client===p&&h.surveyId===t?h.data:void 0;T(()=>{let e=new AbortController;return(async()=>{try{let n=`api/v1/cfti/${encodeURIComponent(t)}${o?`?locale=${encodeURIComponent(o)}`:``}`,r=await p.get(n,{signal:e.signal}).json(),i=ge.safeParse(r);if(!i.success||e.signal.aborted)return;g({client:p,surveyId:t,data:i.data})}catch{}})(),()=>e.abort()},[p,o,t]);let v=C(async({answers:e})=>{let n=crypto.randomUUID(),o=ve({metadata:Ir(i,a)}),s=await p.put(`api/v1/cfti/${encodeURIComponent(t)}/response/${encodeURIComponent(n)}`,{json:{respondent:r,data:e,metadata:o.metadata,warnings:o.warnings,telemetry:{...l!==void 0&&{type:l},version:d,...f&&{build:f}}}}).json();return _e.parse({...s,createdAt:new Date(s.createdAt)})},[a,f,p,i,r,t,d,l]),ee=C(()=>{p.post(`api/v1/cfti/${encodeURIComponent(t)}/respondent/${encodeURIComponent(r)}/event`,{json:{type:`dismiss`}}).catch(()=>{})},[p,r,t]);return T(()=>{let e=m.current;e?.client===p&&e.surveyId===t&&e.respondent===r||_&&r&&(m.current={client:p,surveyId:t,respondent:r},p.post(`api/v1/cfti/${encodeURIComponent(t)}/respondent/${encodeURIComponent(r)}/event`,{json:{type:`view`}}).catch(()=>{}))},[p,r,_,t]),_?A(Hr.Provider,{value:{submit:v,dismiss:ee,surveyId:t,survey:_,metadata:i},children:e}):null},Wr=e=>w(Hr)?A(Te,{children:e.children}):A(Ur,{...e}),Gr=()=>{let e=w(Hr);if(!e)throw Error(`useSurvey must be used within a SurveyProvider`);return e},Kr={en:{skip:`Skip`,next:`Next`,back:`Back`,submit:`Submit`,submitAnotherResponse:`Submit another response`,other:`Other`,dismiss:`Dismiss`,close:`Close`,optional:`(optional)`,startTyping:`Start typing...`,feedbackSubmitted:`Feedback submitted!`,surveyDialog:`Survey`,unsupportedQuestionType:`Unsupported question type`,bugReportTitlePlaceholder:`Brief description of the issue`,bugReportDetailsPlaceholder:`Steps to reproduce, expected vs actual behavior, etc.`,attachments:`Attachments`,capturing:`Capturing...`,screenshot:`Screenshot`,screenshotPreview:`Screenshot preview`,removeScreenshot:`Remove screenshot`,loadingRecordingPreview:`Loading recording preview...`,removeRecording:`Remove recording`,record:`Record`,captureError:`Failed to capture screenshot. Please try again.`,recordingError:`Failed to start recording. Please try again.`},zh:{skip:`跳过`,next:`下一步`,back:`上一步`,submit:`提交`,submitAnotherResponse:`提交另一份回复`,other:`其他`,dismiss:`忽略`,close:`关闭`,optional:`(选填)`,startTyping:`开始输入…`,feedbackSubmitted:`反馈已提交!`,surveyDialog:`调查对话框`,unsupportedQuestionType:`不支持的问题类型`,bugReportTitlePlaceholder:`在此输入问题标题`,bugReportDetailsPlaceholder:`在此输入问题内容`,attachments:`附件`,capturing:`截屏中…`,screenshot:`截图`,screenshotPreview:`截图预览`,removeScreenshot:`移除截图`,loadingRecordingPreview:`录像加载中…`,removeRecording:`移除录像`,record:`录制`,captureError:`截图失败,请重试。`,recordingError:`录制启动失败,请重试。`},ms:{skip:`Langkau`,next:`Seterusnya`,back:`Kembali`,submit:`Hantar`,submitAnotherResponse:`Hantar respons lain`,other:`Lain-lain`,dismiss:`Tutup`,close:`Tutup`,optional:`(Pilihan)`,startTyping:`Mula menaip...`,feedbackSubmitted:`Maklum balas dihantar!`,surveyDialog:`Tinjauan`,unsupportedQuestionType:`Jenis soalan tidak disokong`,bugReportTitlePlaceholder:`Penerangan ringkas tentang isu`,bugReportDetailsPlaceholder:`Langkah untuk mengulang semula, tingkah laku dijangka berbanding sebenar, dll.`,attachments:`Lampiran`,capturing:`Sedang menangkap...`,screenshot:`Tangkapan skrin`,screenshotPreview:`Pratonton tangkapan skrin`,removeScreenshot:`Alih keluar tangkapan skrin`,loadingRecordingPreview:`Memuatkan pratonton rakaman...`,removeRecording:`Alih keluar rakaman`,record:`Rakam`,captureError:`Gagal menangkap tangkapan skrin. Sila cuba lagi.`,recordingError:`Gagal memulakan rakaman. Sila cuba lagi.`},ta:{skip:`தவிர்க்கவும்`,next:`அடுத்து`,back:`பின்செல்`,submit:`சமர்ப்பிக்கவும்`,submitAnotherResponse:`மற்றொரு பதிலைச் சமர்ப்பிக்கவும்`,other:`மற்றவை`,dismiss:`மூடு`,close:`மூடு`,optional:`(கட்டாயமில்லை)`,startTyping:`தட்டச்சு செய்யத் தொடங்கவும்...`,feedbackSubmitted:`கருத்து சமர்ப்பிக்கப்பட்டது!`,surveyDialog:`கருத்துக்கணிப்பு`,unsupportedQuestionType:`ஆதரிக்கப்படாத கேள்வி வகை`,bugReportTitlePlaceholder:`சிக்கலின் சுருக்கமான விளக்கம்`,bugReportDetailsPlaceholder:`சிக்கல் எப்படி ஏற்பட்டது, நீங்கள் என்ன எதிர்பார்த்தீர்கள், மேலும் என்ன நடந்தது என்பதை விவரிக்கவும்`,attachments:`இணைப்புகள்`,capturing:`ஸ்கிரீன்ஷாட் எடுக்கப்படுகிறது...`,screenshot:`ஸ்கிரீன்ஷாட்`,screenshotPreview:`ஸ்கிரீன்ஷாட் முன்னோட்டம்`,removeScreenshot:`ஸ்கிரீன்ஷாட்டை அகற்று`,loadingRecordingPreview:`பதிவு முன்னோட்டம் தயாராகிறது...`,removeRecording:`பதிவை அகற்று`,record:`பதிவுசெய்`,captureError:`ஸ்கிரீன்ஷாட் எடுக்க முடியவில்லை. மீண்டும் முயற்சிக்கவும்.`,recordingError:`பதிவைத் தொடங்க முடியவில்லை. மீண்டும் முயற்சிக்கவும்.`}},$=(e=`en`)=>Kr[e],qr=(e,t,n)=>e===Kr.en[t]?$(n)[t]:e,Jr=(e,t,n)=>!e||e===Kr.en[t]?$(n)[t]:e,Yr=(e,t)=>qr(e,`other`,t),Xr=(e,t)=>Jr(e,`close`,t),Zr=(e,t)=>Jr(e,`feedbackSubmitted`,t),Qr=(e,t)=>Jr(e,`bugReportTitlePlaceholder`,t),$r=(e,t)=>Jr(e,`bugReportDetailsPlaceholder`,t),ei=()=>{let[e,t]=O(!1);return T(()=>{let e=e=>{let n=ye.safeParse(e);n.error||t(n.data.detail.isRecording)};return document.addEventListener(be,e),()=>{document.removeEventListener(be,e)}},[]),e},ti=({className:e,iconClassName:t,onClose:n,locale:r})=>ei()?null:A(`button`,{type:`button`,className:e,"aria-label":$(r).dismiss,onClick:n,children:A(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`none`,className:t,children:A(`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`})})}),ni=({children:e,classNames:t,isDismissable:n,onDismiss:r,onClose:i,closeOnFinishMs:a,isSubmitted:o,onSubmitted:s,locale:c})=>{let{survey:l,surveyId:u,dismiss:d}=Gr(),[f,p]=O(!1);return we(()=>{l&&i?.()},f?a:null),Ee(sr,{"aria-label":$(c).surveyDialog,id:`${u}-popover`,className:j(`confetti-modal-dialog ${xe}`,t?.dialog),children:[n&&A(ti,{className:j(`confetti-modal-dialog-close`,t?.closeButton),iconClassName:t?.icon,locale:c,onClose:async()=>{!o&&!f&&(await d(),r?.()),i?.()}}),typeof e==`function`?e({setIsSubmitted:()=>s?.(),setIsFinished:()=>p(!0)}):e]})},ri=({children:e,classNames:t,onDismiss:n,onClose:r,isDismissable:i=!0,closeOnFinishMs:a=3e3,locale:o})=>{let{dismiss:s}=Gr(),[c,l]=O(!1);return A(fr,{isOpen:!0,isDismissable:i,isKeyboardDismissDisabled:!i,onOpenChange:async e=>{e||(c||(await s(),n?.()),r?.())},className:j(`confetti-modal-overlay ${xe}`,t?.overlay),children:A(ur,{className:j(`confetti-modal ${xe}`,t?.modal),children:A(ni,{classNames:t,isDismissable:i,onDismiss:n,onClose:r,closeOnFinishMs:a,isSubmitted:c,onSubmitted:()=>l(!0),locale:o,children:e})})})};export{ke as S,Xt as _,$ as a,it as b,Xr as c,Hr as d,Wr as f,$t as g,br as h,ei as i,Zr as l,Br as m,ni as n,$r as o,Gr as p,ti as r,Qr as s,ri as t,Yr as u,U as v,je as x,mt as y};
@@ -1,2 +1,2 @@
1
- import { r as ModalContent } from "./ModalContainer-QddeK25W.js";
1
+ import { r as ModalContent } from "./ModalContainer-DnTgSV6A.js";
2
2
  export { ModalContent as UnstableModalContent };
@@ -1 +1 @@
1
- import{n as e}from"./ModalContainer-fwJ97Uo-.js";export{e as UnstableModalContent};
1
+ import{n as e}from"./ModalContainer-kQ-gmZ0r.js";export{e as UnstableModalContent};
@@ -1,6 +1,6 @@
1
- import { c as MultiSelectQuestionProperties, d as StatementQuestionProperties, f as TextQuestionProperties, l as RatingQuestionProperties, n as Locale, u as SingleSelectQuestionProperties } from "./index-DODfg3Bc.js";
2
- import { n as ModalContainerProps, t as ModalContainer } from "./ModalContainer-QddeK25W.js";
3
- import { C as ConfettiState, _ as useSurvey, a as BaseFieldProps, b as Answer, c as ConfettiProviderProps, d as RespondentVisibilityProviderProps, g as SurveyProviderProps, h as SurveyProvider, i as BugReportOptions, k as Question, l as RespondentVisibilityContext, m as SurveyContext, n as Confetti, o as Question$1, p as useRespondentVisibility, r as ConfettiProps, s as ConfettiProvider, t as BaseConfettiProps, u as RespondentVisibilityProvider, v as ConfettiController, y as ConfettiControllerProps } from "./Confetti-CWPpRhr1.js";
1
+ import { d as SingleSelectQuestionProperties, f as StatementQuestionProperties, l as MultiSelectQuestionProperties, p as TextQuestionProperties, r as Locale, u as RatingQuestionProperties } from "./index-DLqC_qk3.js";
2
+ import { n as ModalContainerProps, t as ModalContainer } from "./ModalContainer-DnTgSV6A.js";
3
+ import { C as ConfettiState, _ as useSurvey, a as BaseFieldProps, b as Answer, c as ConfettiProviderProps, d as RespondentVisibilityProviderProps, g as SurveyProviderProps, h as SurveyProvider, i as BugReportOptions, k as Question, l as RespondentVisibilityContext, m as SurveyContext, n as Confetti, o as Question$1, p as useRespondentVisibility, r as ConfettiProps, s as ConfettiProvider, t as BaseConfettiProps, u as RespondentVisibilityProvider, v as ConfettiController, y as ConfettiControllerProps } from "./Confetti-Ch8bCyn_.js";
4
4
  import { HTMLAttributes, JSX, PropsWithChildren, SVGProps } from "react";
5
5
 
6
6
  //#region src/components/container/PopoverContainer.d.ts
@@ -1 +1 @@
1
- import{n as e,t}from"./DefaultConfettiTrigger-9WLnJcVv.js";import{d as n,f as r,p as i,r as a,t as o}from"./ModalContainer-fwJ97Uo-.js";import{a as s,c,d as l,f as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x}from"./Embed-p80c52cK.js";import{ErrorBoundary as S}from"react-error-boundary";import{Fragment as C,jsx as w}from"react/jsx-runtime";const T=({children:e,respondent:t,isSurveyVisible:n,...i})=>{let{respondent:a}=m();return w(r,{...i,respondent:a,children:e})},E=({children:e,...t})=>w(_,{...t,children:w(T,{...t,children:e})}),D=({children:e,onFinished:t,shouldAutoSubmit:n,...r})=>w(S,{fallback:w(C,{}),children:w(E,{...r,children:w(d,{shouldAutoSubmit:n,onFinished:t,children:e})})});export{v as BackButton,a as CloseButton,D as Confetti,d as ConfettiController,E as ConfettiProvider,e as ConfettiTriggerIcon,t as DefaultConfettiTrigger,b as Embed,h as Flow,x as FreeText,o as ModalContainer,p as MultiChoice,l as PopoverContainer,c as Rating,u as RespondentVisibilityContext,_ as RespondentVisibilityProvider,y as SingleChoice,g as Statement,n as SurveyContext,r as SurveyProvider,s as SurveyQuestionFactory,f as ThankYouMessage,m as useRespondentVisibility,i as useSurvey};
1
+ import{n as e,t}from"./DefaultConfettiTrigger-iGndzjo2.js";import{d as n,f as r,p as i,r as a,t as o}from"./ModalContainer-kQ-gmZ0r.js";import{a as s,c,d as l,f as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x}from"./Embed-Ci53s3wI.js";import{ErrorBoundary as S}from"react-error-boundary";import{Fragment as C,jsx as w}from"react/jsx-runtime";const T=({children:e,respondent:t,isSurveyVisible:n,...i})=>{let{respondent:a}=m();return w(r,{...i,respondent:a,children:e})},E=({children:e,...t})=>w(_,{...t,children:w(T,{...t,children:e})}),D=({children:e,onFinished:t,shouldAutoSubmit:n,...r})=>w(S,{fallback:w(C,{}),children:w(E,{...r,children:w(d,{shouldAutoSubmit:n,onFinished:t,children:e})})});export{v as BackButton,a as CloseButton,D as Confetti,d as ConfettiController,E as ConfettiProvider,e as ConfettiTriggerIcon,t as DefaultConfettiTrigger,b as Embed,h as Flow,x as FreeText,o as ModalContainer,p as MultiChoice,l as PopoverContainer,c as Rating,u as RespondentVisibilityContext,_ as RespondentVisibilityProvider,y as SingleChoice,g as Statement,n as SurveyContext,r as SurveyProvider,s as SurveyQuestionFactory,f as ThankYouMessage,m as useRespondentVisibility,i as useSurvey};
@@ -4,6 +4,6 @@
4
4
  );--confetti-tag-border-radius: var(--confetti-input-border-radius);--confetti-background-color: #ffffff;--confetti-box-shadow:
5
5
  0 4px 6px -4px rgba(16, 24, 40, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);--confetti-focus-shadow: 0 0 0 2px rgba(9, 9, 11, 0.3);--confetti-submit-button-color: #18181b;--confetti-submit-button-text-color: #fafafa;--confetti-rating-bg-color: white;--confetti-rating-text-color: #09090b;--confetti-rating-active-bg-color: #09090b;--confetti-rating-active-text-color: white;--confetti-indicator-active-bg-color: var(--confetti-rating-active-bg-color);--confetti-indicator-active-dot-color: var(
6
6
  --confetti-rating-active-text-color
7
- );--confetti-bug-report-button-color: #18181b;--confetti-bug-report-record-button-color: #ff2c2c;--confetti-bug-report-record-button-active-color: #dc2626;--confetti-bug-report-button-text-color: white;--confetti-bug-report-overlay-color: rgba(9, 9, 11, 0.4);--confetti-text-primary-color: #09090b;--confetti-text-subtle-color: #71717a;--confetti-error-color: #dc2626;--confetti-trigger-bg-color: #18181b;--confetti-trigger-text-color: #fafafa;--confetti-trigger-size: 40px;--confetti-widget-color: #e0a045;--confetti-widget-text-color: white;--confetti-scrollbar-thumb-color: var(--confetti-border-color);--confetti-scrollbar-track-color: var(--confetti-background-color);--confetti-outline-color: rgba(9, 9, 11, 0.8);--confetti-input-background: white;--confetti-input-text-color: #020617;--confetti-disabled-button-opacity: 0.6;}@keyframes confetti-record-pulse{0%, 100%{background-color:var(--pulse-color-start)}50%{background-color:color-mix( in srgb, var(--pulse-color-start), rgb(70, 70, 70) 20% )}}@keyframes confetti-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.confetti-trigger{font-size:var(--confetti-font-scale);cursor:pointer;position:relative;display:inline-grid;grid-template-columns:0fr;align-items:center;justify-content:center;min-width:var(--confetti-trigger-size);height:var(--confetti-trigger-size);padding:0;border:none;border-radius:9999px;background:var(--confetti-trigger-bg-color);color:var(--confetti-trigger-text-color);overflow:hidden;transition:grid-template-columns 220ms ease, background 220ms ease}.confetti-trigger .confetti-trigger-icon-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;opacity:1;transition:opacity 180ms ease;pointer-events:none}.confetti-trigger .confetti-trigger-label{opacity:0;pointer-events:none;min-width:0;overflow:hidden;padding:0 20px;font-size:0.875em;font-weight:500;line-height:20px;white-space:nowrap;transition:opacity 180ms ease}.confetti-trigger:hover,.confetti-trigger:focus-visible,.confetti-trigger[data-hovered],.confetti-trigger[data-focus-visible]{grid-template-columns:1fr}.confetti-trigger:focus-visible .confetti-trigger-icon-wrapper{opacity:0}.confetti-trigger:hover .confetti-trigger-icon-wrapper,.confetti-trigger[data-hovered] .confetti-trigger-icon-wrapper,.confetti-trigger[data-focus-visible] .confetti-trigger-icon-wrapper{opacity:0}.confetti-trigger:focus-visible .confetti-trigger-label{opacity:1}.confetti-trigger:hover .confetti-trigger-label,.confetti-trigger[data-hovered] .confetti-trigger-label,.confetti-trigger[data-focus-visible] .confetti-trigger-label{opacity:1}.confetti-trigger:focus-visible,.confetti-trigger[data-focus-visible]{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-dialog{width:var(--confetti-max-width);max-height:95dvh;overflow:auto;max-width:100%;background:transparent;position:relative;box-shadow:var(--confetti-box-shadow);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-border-radius);background:var(--confetti-background-color);padding:var(--confetti-box-padding)}.confetti-dialog .confetti-dialog-close{position:absolute;top:8px;right:8px;background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;transition:background 200ms}.confetti-dialog .confetti-dialog-close svg{width:16px;height:16px;color:var(--confetti-text-subtle-color)}.confetti-dialog .confetti-dialog-close:hover{background:rgba(0, 0, 0, 0.05)}.confetti-dialog .confetti-dialog-close:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-dialog .cf-header .cf-title{padding-right:20px}.confetti-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--confetti-z-index);background:rgba(0, 0, 0, 0.4);display:flex;justify-content:center;overflow-y:auto;overscroll-behavior:none;padding:10vh 0}.confetti-modal{margin:auto}.confetti-modal .confetti-modal-dialog{width:var(--confetti-max-width);max-width:100%;position:relative;box-shadow:var(--confetti-box-shadow);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-border-radius);background:var(--confetti-background-color);padding:var(--confetti-box-padding)}.confetti-modal .confetti-modal-dialog:focus-visible{outline:none}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close{position:absolute;top:8px;right:8px;background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;transition:background 200ms}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close svg{width:16px;height:16px;color:var(--confetti-text-subtle-color)}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close:hover{background:rgba(0, 0, 0, 0.05)}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-modal .confetti-modal-dialog .cf-header .cf-title{padding-right:20px}.confetti{font-family:var(--confetti-font-family);display:flex;flex-direction:column;gap:16px;color:var(--confetti-text-primary-color);font-size:var(--confetti-font-scale);width:100%}.confetti .cf-button-row{display:flex;align-items:center;justify-content:space-between;gap:var(--confetti-button-row-gap)}.confetti .cf-submit-button{margin-left:auto;color:var(--confetti-submit-button-text-color);background:var(--confetti-submit-button-color);padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;transition:transform 200ms;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-submit-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-submit-button[data-disabled]{opacity:var(--confetti-disabled-button-opacity);cursor:not-allowed;-ms-transform:none;transform:none}.confetti .cf-submit-button:hover{background:color-mix( in srgb, white 10%, var(--confetti-submit-button-color) )}.confetti .cf-submit-button:active{background:color-mix( in srgb, white 5%, var(--confetti-submit-button-color) )}.confetti .cf-back-button{color:var(--confetti-text-primary-color);background:transparent;border:none;padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-back-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-back-button:hover{background:color-mix(in srgb, currentColor 8%, transparent)}.confetti .sr-only{clip:rect(0, 0, 0, 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.confetti .cf-response-choices{display:flex;flex-direction:column;gap:12px}.confetti .cf-choice{font-size:1em;cursor:pointer;padding:8px 10px;border-radius:var(--confetti-choice-border-radius);border:1px solid var(--confetti-border-color);transition:background 200ms ease-out}.confetti .cf-choice:hover{background:var( --confetti-hover-background-color, color-mix( in srgb, var(--confetti-text-primary-color) 4%, var(--confetti-background-color) ) )}.confetti .cf-choice .cf-choice-label{gap:8px;display:inline-flex;align-items:center}.confetti .cf-choice .cf-choice-description{font-size:0.875em;margin-left:26px;white-space:pre-wrap;word-wrap:anywhere;color:var(--confetti-text-subtle-color)}.confetti .cf-response-choices-tag{flex-direction:row;flex-wrap:wrap;gap:8px}.confetti .cf-tag-input{display:none}.confetti .cf-tag-input[data-visible='true']{display:inline}.confetti .cf-tag{border-radius:var(--confetti-tag-border-radius);padding:6px 12px;font-weight:500;font-size:0.875em;transition:background 200ms ease-out, border-color 200ms ease-out}.confetti .cf-tag[data-selected='true']{background:var(--confetti-indicator-active-bg-color);border-color:var(--confetti-indicator-active-bg-color);color:var(--confetti-indicator-active-dot-color)}.confetti .cf-tag[data-focus-visible='true']{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-tag:active{scale:0.96}.confetti .cf-radio,.confetti .cf-checkbox{cursor:pointer;display:flex;flex-direction:column;position:relative;align-items:start;color:var(--confetti-text-primary-color);forced-color-adjust:none}.confetti .cf-checkbox{--checkmark-color: var(--confetti-indicator-active-dot-color);}.confetti .cf-checkbox .cf-checkbox-indicator{background:white;border:1px solid var(--confetti-border-color);width:18px;height:18px;box-sizing:border-box;border-radius:4px;transition:color 200ms ease-out;display:flex;align-items:center;justify-content:center;flex-shrink:0}.confetti .cf-checkbox svg{width:calc(100% - 8px);height:calc(100% - 8px);fill:none;stroke:var(--checkmark-color);stroke-width:3px;stroke-dasharray:22px;stroke-dashoffset:66;stroke-linecap:round;stroke-linejoin:round;transition:all 200ms}.confetti .cf-checkbox[data-focus-visible='true'] .cf-checkbox-indicator{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-checkbox[data-selected] .cf-checkbox-indicator,.confetti .cf-checkbox[data-indeterminate] .cf-checkbox-indicator{background:var(--confetti-indicator-active-bg-color);border:none}.confetti .cf-checkbox[data-selected] svg,.confetti .cf-checkbox[data-indeterminate] svg{stroke-dashoffset:44}.confetti .cf-checkbox[data-indeterminate] svg{stroke:none;fill:var(--checkmark-color)}.confetti .cf-radio{-webkit-tap-highlight-color:transparent;--dot-color: var(--confetti-indicator-active-dot-color);}.confetti .cf-radio .cf-radio-indicator{position:relative;width:18px;height:18px;flex-shrink:0;box-sizing:border-box;border-radius:50%;transition:color 200ms ease-out;border:1px solid var(--confetti-border-color);background:white}.confetti .cf-radio .cf-radio-indicator::after{content:'';position:absolute;top:1px;right:1px;bottom:1px;left:1px;border-radius:inherit;background:transparent;transition:scale 200ms;scale:0}.confetti .cf-radio[data-selected] .cf-radio-indicator{background:var(--confetti-indicator-active-bg-color);border-color:var(--confetti-indicator-active-bg-color)}.confetti .cf-radio[data-selected] .cf-radio-indicator::after{background:var(--dot-color);scale:0.4}.confetti .cf-radio[data-disabled]{color:var(--text-color-disabled);--dot-color: var(--text-color-disabled);}.confetti .cf-radio[data-focus-visible='true'] .cf-radio-indicator{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-input,.confetti .cf-textarea{background:var(--confetti-input-background);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-input-border-radius);color:var(--confetti-input-text-color);padding:10px;transition:border-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.15s ease-out}.confetti .cf-input:focus,.confetti .cf-textarea:focus{border-color:var(--confetti-outline-color);box-shadow:var(--confetti-focus-shadow);outline:none}.confetti .cf-question{display:flex;flex-direction:column;gap:16px}.confetti .cf-question .cf-error{display:none;color:var(--confetti-error-color);font-size:0.875em;line-height:20px}.confetti .cf-question .cf-header{display:flex;flex-direction:column;gap:2px}.confetti .cf-question .cf-title{line-height:24px;font-weight:500}.confetti .cf-question .cf-label-optional{font-weight:400;color:var(--confetti-text-subtle-color)}.confetti .cf-question .cf-description{font-size:0.875em;line-height:20px;font-weight:400;white-space:pre-wrap;word-wrap:anywhere;color:var(--confetti-text-subtle-color)}.confetti .cf-question .cf-others-choice{display:flex;flex-direction:column;gap:8px}.confetti[data-show-errors] .cf-question .cf-error{display:block}.confetti .cf-bug-report{display:flex;flex-direction:column;gap:16px}.confetti .cf-bug-report .cf-bug-report-screenshot-section,.confetti .cf-bug-report .cf-bug-report-recording-section{display:flex;flex-direction:column;gap:8px}.confetti .cf-bug-report .cf-bug-report-actions{display:flex;flex-direction:column;gap:12px}.confetti .cf-bug-report .cf-bug-report-button-action{padding:8px 8px}.confetti .cf-bug-report .cf-bug-report-media-preview{position:relative;width:100%;aspect-ratio:16 / 9;border:1px solid var(--confetti-border-color);border-radius:8px;overflow:hidden;display:flex;align-items:center;justify-content:center}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-loading{width:1.5em;height:1.5em;border:2px solid var(--confetti-submit-button-color);border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:confetti-spinner 1s linear infinite}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container{height:100%;width:100%;position:relative}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-player{height:100%;width:auto;overflow:hidden}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-progress-bar{position:absolute;bottom:0;left:0;height:2px;background:var(--confetti-text-primary-color);opacity:0.5;transition-property:width;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;width:0%}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-time{position:absolute;right:4px;bottom:4px;font-size:0.75em;color:color-mix( in oklab, var(--confetti-text-primary-color) 50%, transparent )}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-media-actions{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:var(--confetti-bug-report-overlay-color);opacity:0;transition:opacity 200ms ease-out}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-media-actions:hover{opacity:1}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-screenshot-img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.confetti .cf-bug-report-button{color:var(--confetti-bug-report-button-text-color);background:var(--confetti-bug-report-button-color);padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;transition:transform 200ms;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-bug-report-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-bug-report-button[data-disabled]{opacity:var(--confetti-disabled-button-opacity);cursor:not-allowed;-ms-transform:none;transform:none}.confetti .cf-bug-report-button:hover{background:color-mix( in srgb, white 10%, var(--confetti-submit-button-color) )}.confetti .cf-bug-report-button:active{background:color-mix( in srgb, white 5%, var(--confetti-submit-button-color) )}.confetti .cf-bug-report-button.cf-bug-report-record-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 8px;--pulse-color-start: var(--confetti-bug-report-record-button-color);background-color:var(--pulse-color-start);animation:confetti-record-pulse 2s ease-in-out infinite}.confetti .cf-bug-report-button.cf-bug-report-record-button:hover{--pulse-color-start: var(
7
+ );--confetti-bug-report-button-color: #18181b;--confetti-bug-report-record-button-color: #ff2c2c;--confetti-bug-report-record-button-active-color: #dc2626;--confetti-bug-report-button-text-color: white;--confetti-bug-report-overlay-color: rgba(9, 9, 11, 0.4);--confetti-text-primary-color: #09090b;--confetti-text-subtle-color: #71717a;--confetti-error-color: #dc2626;--confetti-trigger-bg-color: #18181b;--confetti-trigger-text-color: #fafafa;--confetti-trigger-size: 40px;--confetti-widget-color: #e0a045;--confetti-widget-text-color: white;--confetti-scrollbar-thumb-color: var(--confetti-border-color);--confetti-scrollbar-track-color: var(--confetti-background-color);--confetti-outline-color: rgba(9, 9, 11, 0.8);--confetti-input-background: white;--confetti-input-text-color: #020617;--confetti-disabled-button-opacity: 0.6;}@-webkit-keyframes confetti-record-pulse{0%, 100%{background-color:var(--pulse-color-start)}}@keyframes confetti-record-pulse{0%, 100%{background-color:var(--pulse-color-start)}}@supports (color: color-mix(in lch, red, blue)){@-webkit-keyframes confetti-record-pulse{0%, 100%{background-color:var(--pulse-color-start)}50%{background-color:color-mix( in srgb, var(--pulse-color-start), rgb(70, 70, 70) 20% )}}@keyframes confetti-record-pulse{0%, 100%{background-color:var(--pulse-color-start)}50%{background-color:color-mix( in srgb, var(--pulse-color-start), rgb(70, 70, 70) 20% )}}}@-webkit-keyframes confetti-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes confetti-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.confetti-trigger{font-size:var(--confetti-font-scale);cursor:pointer;position:relative;display:inline-grid;grid-template-columns:0fr;align-items:center;justify-content:center;min-width:var(--confetti-trigger-size);height:var(--confetti-trigger-size);padding:0;border:none;border-radius:9999px;background:var(--confetti-trigger-bg-color);color:var(--confetti-trigger-text-color);overflow:hidden;transition:grid-template-columns 220ms ease, background 220ms ease;transition:grid-template-columns 220ms ease, background 220ms ease, -ms-grid-columns 220ms ease}.confetti-trigger .confetti-trigger-icon-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;opacity:1;transition:opacity 180ms ease;pointer-events:none}.confetti-trigger .confetti-trigger-label{opacity:0;pointer-events:none;min-width:0;overflow:hidden;padding:0 20px;font-size:0.875em;font-weight:500;line-height:20px;white-space:nowrap;transition:opacity 180ms ease}.confetti-trigger:hover,.confetti-trigger:focus-visible,.confetti-trigger[data-hovered],.confetti-trigger[data-focus-visible]{grid-template-columns:1fr}.confetti-trigger:focus-visible .confetti-trigger-icon-wrapper{opacity:0}.confetti-trigger:hover .confetti-trigger-icon-wrapper,.confetti-trigger[data-hovered] .confetti-trigger-icon-wrapper,.confetti-trigger[data-focus-visible] .confetti-trigger-icon-wrapper{opacity:0}.confetti-trigger:focus-visible .confetti-trigger-label{opacity:1}.confetti-trigger:hover .confetti-trigger-label,.confetti-trigger[data-hovered] .confetti-trigger-label,.confetti-trigger[data-focus-visible] .confetti-trigger-label{opacity:1}.confetti-trigger:focus-visible,.confetti-trigger[data-focus-visible]{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-dialog{width:var(--confetti-max-width);max-height:95dvh;overflow:auto;max-width:100%;background:transparent;position:relative;box-shadow:var(--confetti-box-shadow);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-border-radius);background:var(--confetti-background-color);padding:var(--confetti-box-padding)}.confetti-dialog .confetti-dialog-close{position:absolute;top:8px;right:8px;background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;transition:background 200ms}.confetti-dialog .confetti-dialog-close svg{width:16px;height:16px;color:var(--confetti-text-subtle-color)}.confetti-dialog .confetti-dialog-close:hover{background:rgba(0, 0, 0, 0.05)}.confetti-dialog .confetti-dialog-close:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-dialog .cf-header .cf-title{padding-right:20px}.confetti-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--confetti-z-index);background:rgba(0, 0, 0, 0.4);display:flex;justify-content:center;overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:none;padding:10vh 0}.confetti-modal{margin:auto}.confetti-modal .confetti-modal-dialog{width:var(--confetti-max-width);max-width:100%;position:relative;box-shadow:var(--confetti-box-shadow);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-border-radius);background:var(--confetti-background-color);padding:var(--confetti-box-padding)}.confetti-modal .confetti-modal-dialog:focus-visible{outline:none}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close{position:absolute;top:8px;right:8px;background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;transition:background 200ms}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close svg{width:16px;height:16px;color:var(--confetti-text-subtle-color)}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close:hover{background:rgba(0, 0, 0, 0.05)}.confetti-modal .confetti-modal-dialog .confetti-modal-dialog-close:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti-modal .confetti-modal-dialog .cf-header .cf-title{padding-right:20px}.confetti{font-family:var(--confetti-font-family);display:flex;flex-direction:column;gap:16px;color:var(--confetti-text-primary-color);font-size:var(--confetti-font-scale);width:100%}.confetti .cf-button-row{display:flex;align-items:center;justify-content:space-between;gap:var(--confetti-button-row-gap)}.confetti .cf-submit-button{margin-left:auto;color:var(--confetti-submit-button-text-color);background:var(--confetti-submit-button-color);padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;transition:transform 200ms;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-submit-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-submit-button[data-disabled]{opacity:var(--confetti-disabled-button-opacity);cursor:not-allowed;transform:none}.confetti .cf-submit-button:hover{background:color-mix( in srgb, white 10%, var(--confetti-submit-button-color) )}.confetti .cf-submit-button:active{background:color-mix( in srgb, white 5%, var(--confetti-submit-button-color) )}.confetti .cf-back-button{color:var(--confetti-text-primary-color);background:transparent;border:none;padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-back-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-back-button:hover{background:color-mix(in srgb, currentColor 8%, transparent)}.confetti .sr-only{clip:rect(0, 0, 0, 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.confetti .cf-response-choices{display:flex;flex-direction:column;gap:12px}.confetti .cf-choice{font-size:1em;cursor:pointer;padding:8px 10px;border-radius:var(--confetti-choice-border-radius);border:1px solid var(--confetti-border-color);transition:background 200ms ease-out}.confetti .cf-choice:hover{background:var( --confetti-hover-background-color, color-mix( in srgb, var(--confetti-text-primary-color) 4%, var(--confetti-background-color) ) )}.confetti .cf-choice .cf-choice-label{gap:8px;display:inline-flex;align-items:center}.confetti .cf-choice .cf-choice-description{font-size:0.875em;margin-left:26px;white-space:pre-wrap;word-wrap:anywhere;color:var(--confetti-text-subtle-color)}.confetti .cf-response-choices-tag{flex-direction:row;flex-wrap:wrap;gap:8px}.confetti .cf-tag-input{display:none}.confetti .cf-tag-input[data-visible='true']{display:inline}.confetti .cf-tag{border-radius:var(--confetti-tag-border-radius);padding:6px 12px;font-weight:500;font-size:0.875em;transition:background 200ms ease-out, border-color 200ms ease-out}.confetti .cf-tag[data-selected='true']{background:var(--confetti-indicator-active-bg-color);border-color:var(--confetti-indicator-active-bg-color);color:var(--confetti-indicator-active-dot-color)}.confetti .cf-tag[data-focus-visible='true']{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-tag:active{scale:0.96}.confetti .cf-radio,.confetti .cf-checkbox{cursor:pointer;display:flex;flex-direction:column;position:relative;align-items:start;color:var(--confetti-text-primary-color);forced-color-adjust:none}.confetti .cf-checkbox{--checkmark-color: var(--confetti-indicator-active-dot-color);}.confetti .cf-checkbox .cf-checkbox-indicator{background:white;border:1px solid var(--confetti-border-color);width:18px;height:18px;box-sizing:border-box;border-radius:4px;transition:color 200ms ease-out;display:flex;align-items:center;justify-content:center;flex-shrink:0}.confetti .cf-checkbox svg{width:calc(100% - 8px);height:calc(100% - 8px);fill:none;stroke:var(--checkmark-color);stroke-width:3px;stroke-dasharray:22px;stroke-dashoffset:66;stroke-linecap:round;stroke-linejoin:round;transition:all 200ms}.confetti .cf-checkbox[data-focus-visible='true'] .cf-checkbox-indicator{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-checkbox[data-selected] .cf-checkbox-indicator,.confetti .cf-checkbox[data-indeterminate] .cf-checkbox-indicator{background:var(--confetti-indicator-active-bg-color);border:none}.confetti .cf-checkbox[data-selected] svg,.confetti .cf-checkbox[data-indeterminate] svg{stroke-dashoffset:44}.confetti .cf-checkbox[data-indeterminate] svg{stroke:none;fill:var(--checkmark-color)}.confetti .cf-radio{-webkit-tap-highlight-color:transparent;--dot-color: var(--confetti-indicator-active-dot-color);}.confetti .cf-radio .cf-radio-indicator{position:relative;width:18px;height:18px;flex-shrink:0;box-sizing:border-box;border-radius:50%;transition:color 200ms ease-out;border:1px solid var(--confetti-border-color);background:white}.confetti .cf-radio .cf-radio-indicator::after{content:'';position:absolute;top:1px;right:1px;bottom:1px;left:1px;border-radius:inherit;background:transparent;transition:scale 200ms;scale:0}.confetti .cf-radio[data-selected] .cf-radio-indicator{background:var(--confetti-indicator-active-bg-color);border-color:var(--confetti-indicator-active-bg-color)}.confetti .cf-radio[data-selected] .cf-radio-indicator::after{background:var(--dot-color);scale:0.4}.confetti .cf-radio[data-disabled]{color:var(--text-color-disabled);--dot-color: var(--text-color-disabled);}.confetti .cf-radio[data-focus-visible='true'] .cf-radio-indicator{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-input,.confetti .cf-textarea{background:var(--confetti-input-background);border:1px solid var(--confetti-border-color);border-radius:var(--confetti-input-border-radius);color:var(--confetti-input-text-color);padding:10px;transition:border-color 0.2s ease-out, box-shadow 0.2s ease-out, transform 0.15s ease-out}.confetti .cf-input:focus,.confetti .cf-textarea:focus{border-color:var(--confetti-outline-color);box-shadow:var(--confetti-focus-shadow);outline:none}.confetti .cf-question{display:flex;flex-direction:column;gap:16px}.confetti .cf-question .cf-error{display:none;color:var(--confetti-error-color);font-size:0.875em;line-height:20px}.confetti .cf-question .cf-header{display:flex;flex-direction:column;gap:2px}.confetti .cf-question .cf-title{line-height:24px;font-weight:500}.confetti .cf-question .cf-label-optional{font-weight:400;color:var(--confetti-text-subtle-color)}.confetti .cf-question .cf-description{font-size:0.875em;line-height:20px;font-weight:400;white-space:pre-wrap;word-wrap:anywhere;color:var(--confetti-text-subtle-color)}.confetti .cf-question .cf-others-choice{display:flex;flex-direction:column;gap:8px}.confetti[data-show-errors] .cf-question .cf-error{display:block}.confetti .cf-bug-report{display:flex;flex-direction:column;gap:16px}.confetti .cf-bug-report .cf-bug-report-screenshot-section,.confetti .cf-bug-report .cf-bug-report-recording-section{display:flex;flex-direction:column;gap:8px}.confetti .cf-bug-report .cf-bug-report-actions{display:flex;flex-direction:column;gap:12px}.confetti .cf-bug-report .cf-bug-report-button-action{padding:8px 8px}.confetti .cf-bug-report .cf-bug-report-media-preview{position:relative;width:100%;aspect-ratio:16 / 9;border:1px solid var(--confetti-border-color);border-radius:8px;overflow:hidden;display:flex;align-items:center;justify-content:center}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-loading{width:1.5em;height:1.5em;border:2px solid var(--confetti-submit-button-color);border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;-webkit-animation:confetti-spinner 1s linear infinite;animation:confetti-spinner 1s linear infinite}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container{height:100%;width:100%;position:relative}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-player{height:100%;width:auto;overflow:hidden}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-progress-bar{position:absolute;bottom:0;left:0;height:2px;background:var(--confetti-text-primary-color);opacity:0.5;transition-property:width;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;width:0%}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-player-container .cf-bug-report-time{position:absolute;right:4px;bottom:4px;font-size:0.75em;color:color-mix( in oklab, var(--confetti-text-primary-color) 50%, transparent )}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-media-actions{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:var(--confetti-bug-report-overlay-color);opacity:0;transition:opacity 200ms ease-out}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-media-actions:hover{opacity:1}.confetti .cf-bug-report .cf-bug-report-media-preview .cf-bug-report-screenshot-img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.confetti .cf-bug-report-button{color:var(--confetti-bug-report-button-text-color);background:var(--confetti-bug-report-button-color);padding:8px 16px;border-radius:var(--confetti-input-border-radius);cursor:pointer;transition:transform 200ms;font-size:0.875em;font-weight:500;line-height:20px;transition:background 200ms ease-out}.confetti .cf-bug-report-button:focus-visible{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-bug-report-button[data-disabled]{opacity:var(--confetti-disabled-button-opacity);cursor:not-allowed;transform:none}.confetti .cf-bug-report-button:hover{background:color-mix( in srgb, white 10%, var(--confetti-submit-button-color) )}.confetti .cf-bug-report-button:active{background:color-mix( in srgb, white 5%, var(--confetti-submit-button-color) )}.confetti .cf-bug-report-button.cf-bug-report-record-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 8px;--pulse-color-start: var(--confetti-bug-report-record-button-color);background-color:var(--pulse-color-start);-webkit-animation:confetti-record-pulse 2s ease-in-out infinite;animation:confetti-record-pulse 2s ease-in-out infinite}.confetti .cf-bug-report-button.cf-bug-report-record-button:hover{--pulse-color-start: var(
8
8
  --confetti-bug-report-record-button-active-color
9
- );}.confetti .cf-rating-section{display:flex;flex-direction:column;gap:4px}.confetti .cf-rating-emoji{opacity:0.5}.confetti .cf-rating-display-star,.confetti .cf-rating-display-emoji{display:grid;grid-template-columns:repeat(auto-fit, 40px);justify-content:space-between;grid-gap:8px;gap:8px}.confetti .cf-rating-display-star .cf-rating-emoji,.confetti .cf-rating-display-emoji .cf-rating-emoji,.confetti .cf-rating-display-star .cf-rating-star,.confetti .cf-rating-display-emoji .cf-rating-star{font-size:1em;background-color:transparent;border:none;padding:0;transition:transform 0.15s ease-out;color:var(--confetti-rating-active-bg-color)}.confetti .cf-rating-display-star .cf-rating-emoji[data-focus-visible='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-focus-visible='true'],.confetti .cf-rating-display-star .cf-rating-star[data-focus-visible='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-focus-visible='true']{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-rating-display-star .cf-rating-emoji:hover,.confetti .cf-rating-display-emoji .cf-rating-emoji:hover,.confetti .cf-rating-display-star .cf-rating-star:hover,.confetti .cf-rating-display-emoji .cf-rating-star:hover{cursor:pointer;-ms-transform:scale(1.15);transform:scale(1.15);opacity:1!important}.confetti .cf-rating-display-star .cf-rating-emoji[data-filled='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-filled='true'],.confetti .cf-rating-display-star .cf-rating-star[data-filled='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-filled='true']{opacity:1}.confetti .cf-rating-display-star .cf-rating-emoji[data-selected='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-selected='true'],.confetti .cf-rating-display-star .cf-rating-star[data-selected='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-selected='true']{opacity:1}.confetti .cf-rating-display-star .cf-rating-emoji svg,.confetti .cf-rating-display-emoji .cf-rating-emoji svg,.confetti .cf-rating-display-star .cf-rating-star svg,.confetti .cf-rating-display-emoji .cf-rating-star svg{transition:fill 0.15s ease-out}.confetti .cf-rating-text{display:flex;justify-content:space-between;font-size:0.75em;color:var(--confetti-text-subtle-color);font-weight:500;line-height:1}.confetti .cf-rating-text .cf-rating-text-lower{flex:1;text-align:left}.confetti .cf-rating-text .cf-rating-text-upper{flex:1;text-align:right}.confetti .cf-rating-display-star .cf-rating-star[data-selected='true'] ~ .cf-rating-star{opacity:0.5}.confetti .cf-rating-display-number{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;border:1px solid var(--confetti-border-color);border-radius:8px;overflow:hidden}.confetti .cf-rating-display-number .cf-rating-number{border-right:1px solid var(--confetti-border-color);text-align:center;cursor:pointer;color:var(--confetti-rating-text-color);border-left:none;border-top:none;border-bottom:none;font-weight:700;padding:8px 0;margin-top:-1px;margin-bottom:-1px}.confetti .cf-rating-display-number .cf-rating-number:first-of-type{border-top-left-radius:8px;border-bottom-left-radius:8px}.confetti .cf-rating-display-number .cf-rating-number:last-of-type{border-top-right-radius:8px;border-bottom-right-radius:8px;border-right:0}.confetti .cf-rating-display-number .cf-rating-number[data-focus-visible='true']{box-shadow:inset 0 0 0 1px var(--confetti-outline-color)}.confetti .cf-rating-display-number .cf-rating-number[data-selected='true']{background:var(--confetti-rating-active-bg-color);color:var(--confetti-rating-active-text-color)}
9
+ );}.confetti .cf-rating-section{display:flex;flex-direction:column;gap:4px}.confetti .cf-rating-emoji{opacity:0.5}.confetti .cf-rating-display-star,.confetti .cf-rating-display-emoji{display:grid;grid-template-columns:repeat(auto-fit, 40px);justify-content:space-between;grid-gap:8px;gap:8px}.confetti .cf-rating-display-star .cf-rating-emoji,.confetti .cf-rating-display-emoji .cf-rating-emoji,.confetti .cf-rating-display-star .cf-rating-star,.confetti .cf-rating-display-emoji .cf-rating-star{font-size:1em;background-color:transparent;border:none;padding:0;transition:transform 0.15s ease-out;color:var(--confetti-rating-active-bg-color)}.confetti .cf-rating-display-star .cf-rating-emoji[data-focus-visible='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-focus-visible='true'],.confetti .cf-rating-display-star .cf-rating-star[data-focus-visible='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-focus-visible='true']{outline:2px solid var(--confetti-outline-color);outline-offset:2px}.confetti .cf-rating-display-star .cf-rating-emoji:hover,.confetti .cf-rating-display-emoji .cf-rating-emoji:hover,.confetti .cf-rating-display-star .cf-rating-star:hover,.confetti .cf-rating-display-emoji .cf-rating-star:hover{cursor:pointer;transform:scale(1.15);opacity:1!important}.confetti .cf-rating-display-star .cf-rating-emoji[data-filled='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-filled='true'],.confetti .cf-rating-display-star .cf-rating-star[data-filled='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-filled='true']{opacity:1}.confetti .cf-rating-display-star .cf-rating-emoji[data-selected='true'],.confetti .cf-rating-display-emoji .cf-rating-emoji[data-selected='true'],.confetti .cf-rating-display-star .cf-rating-star[data-selected='true'],.confetti .cf-rating-display-emoji .cf-rating-star[data-selected='true']{opacity:1}.confetti .cf-rating-display-star .cf-rating-emoji svg,.confetti .cf-rating-display-emoji .cf-rating-emoji svg,.confetti .cf-rating-display-star .cf-rating-star svg,.confetti .cf-rating-display-emoji .cf-rating-star svg{transition:fill 0.15s ease-out}.confetti .cf-rating-text{display:flex;justify-content:space-between;font-size:0.75em;color:var(--confetti-text-subtle-color);font-weight:500;line-height:1}.confetti .cf-rating-text .cf-rating-text-lower{flex:1;text-align:left}.confetti .cf-rating-text .cf-rating-text-upper{flex:1;text-align:right}.confetti .cf-rating-display-star .cf-rating-star[data-selected='true'] ~ .cf-rating-star{opacity:0.5}.confetti .cf-rating-display-number{display:grid;grid-auto-columns:1fr;grid-auto-flow:column;border:1px solid var(--confetti-border-color);border-radius:8px;overflow:hidden}.confetti .cf-rating-display-number .cf-rating-number{border-right:1px solid var(--confetti-border-color);text-align:center;cursor:pointer;color:var(--confetti-rating-text-color);border-left:none;border-top:none;border-bottom:none;font-weight:700;padding:8px 0;margin-top:-1px;margin-bottom:-1px}.confetti .cf-rating-display-number .cf-rating-number:first-of-type{border-top-left-radius:8px;border-bottom-left-radius:8px}.confetti .cf-rating-display-number .cf-rating-number:last-of-type{border-top-right-radius:8px;border-bottom-right-radius:8px;border-right:0}.confetti .cf-rating-display-number .cf-rating-number[data-focus-visible='true']{box-shadow:inset 0 0 0 1px var(--confetti-outline-color)}.confetti .cf-rating-display-number .cf-rating-number[data-selected='true']{background:var(--confetti-rating-active-bg-color);color:var(--confetti-rating-active-text-color)}