UNPKG

speechly

Version:

A React component for text-to-speech functionality using the Speechify API

152 lines (147 loc) 323 kB
(function($e,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],H):($e=typeof globalThis<"u"?globalThis:$e||self,H($e.Speechly={},$e.React,$e.ReactDOM))})(this,function($e,H,Js){"use strict";function Zs(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const w=Zs(H),on=Zs(Js);function Qs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ei(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Pn={exports:{}},sn={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ti;function _d(){if(ti)return sn;ti=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var a in o)a!=="key"&&(s[a]=o[a])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return sn.Fragment=t,sn.jsx=n,sn.jsxs=n,sn}var an={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ni;function Cd(){return ni||(ni=1,process.env.NODE_ENV!=="production"&&function(){function e(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===j?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case f:return"Fragment";case v:return"Profiler";case p:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList";case P:return"Activity"}if(typeof A=="object")switch(typeof A.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),A.$$typeof){case h:return"Portal";case y:return(A.displayName||"Context")+".Provider";case b:return(A._context.displayName||"Context")+".Consumer";case C:var M=A.render;return A=A.displayName,A||(A=M.displayName||M.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case _:return M=A.displayName||null,M!==null?M:e(A.type)||"Memo";case S:M=A._payload,A=A._init;try{return e(A(M))}catch{}}return null}function t(A){return""+A}function n(A){try{t(A);var M=!1}catch{M=!0}if(M){M=console;var q=M.error,X=typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object";return q.call(M,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",X),t(A)}}function r(A){if(A===f)return"<>";if(typeof A=="object"&&A!==null&&A.$$typeof===S)return"<...>";try{var M=e(A);return M?"<"+M+">":"<...>"}catch{return"<...>"}}function o(){var A=I.A;return A===null?null:A.getOwner()}function s(){return Error("react-stack-top-frame")}function i(A){if(W.call(A,"key")){var M=Object.getOwnPropertyDescriptor(A,"key").get;if(M&&M.isReactWarning)return!1}return A.key!==void 0}function a(A,M){function q(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",M))}q.isReactWarning=!0,Object.defineProperty(A,"key",{get:q,configurable:!0})}function c(){var A=e(this.type);return k[A]||(k[A]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),A=this.props.ref,A!==void 0?A:null}function l(A,M,q,X,K,se,Q,F){return q=se.ref,A={$$typeof:g,type:A,key:M,props:se,_owner:K},(q!==void 0?q:null)!==null?Object.defineProperty(A,"ref",{enumerable:!1,get:c}):Object.defineProperty(A,"ref",{enumerable:!1,value:null}),A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(A,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(A,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(A,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A}function u(A,M,q,X,K,se,Q,F){var Y=M.children;if(Y!==void 0)if(X)if(B(Y)){for(X=0;X<Y.length;X++)d(Y[X]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Y);if(W.call(M,"key")){Y=e(A);var oe=Object.keys(M).filter(function(ee){return ee!=="key"});X=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",D[Y+X]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,X,Y,oe,Y),D[Y+X]=!0)}if(Y=null,q!==void 0&&(n(q),Y=""+q),i(M)&&(n(M.key),Y=""+M.key),"key"in M){q={};for(var J in M)J!=="key"&&(q[J]=M[J])}else q=M;return Y&&a(q,typeof A=="function"?A.displayName||A.name||"Unknown":A),l(A,Y,se,K,o(),q,Q,F)}function d(A){typeof A=="object"&&A!==null&&A.$$typeof===g&&A._store&&(A._store.validated=1)}var m=H,g=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),y=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),I=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,B=Array.isArray,U=console.createTask?console.createTask:function(){return null};m={"react-stack-bottom-frame":function(A){return A()}};var L,k={},O=m["react-stack-bottom-frame"].bind(m,s)(),R=U(r(s)),D={};an.Fragment=f,an.jsx=function(A,M,q,X,K){var se=1e4>I.recentlyCreatedOwnerStacks++;return u(A,M,q,!1,X,K,se?Error("react-stack-top-frame"):O,se?U(r(A)):R)},an.jsxs=function(A,M,q,X,K){var se=1e4>I.recentlyCreatedOwnerStacks++;return u(A,M,q,!0,X,K,se?Error("react-stack-top-frame"):O,se?U(r(A)):R)}}()),an}var ri;function Ad(){return ri||(ri=1,process.env.NODE_ENV==="production"?Pn.exports=_d():Pn.exports=Cd()),Pn.exports}var x=Ad(),oi=Symbol.for("immer-nothing"),si=Symbol.for("immer-draftable"),Re=Symbol.for("immer-state"),Td=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Se(e,...t){if(process.env.NODE_ENV!=="production"){const n=Td[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var It=Object.getPrototypeOf;function Dt(e){return!!e&&!!e[Re]}function mt(e){var t;return e?ii(e)||Array.isArray(e)||!!e[si]||!!((t=e.constructor)!=null&&t[si])||Dn(e)||Ln(e):!1}var Rd=Object.prototype.constructor.toString();function ii(e){if(!e||typeof e!="object")return!1;const t=It(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Rd}function Mn(e,t){In(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function In(e){const t=e[Re];return t?t.type_:Array.isArray(e)?1:Dn(e)?2:Ln(e)?3:0}function eo(e,t){return In(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ai(e,t,n){const r=In(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Nd(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Dn(e){return e instanceof Map}function Ln(e){return e instanceof Set}function gt(e){return e.copy_||e.base_}function to(e,t){if(Dn(e))return new Map(e);if(Ln(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ii(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Re];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){const i=o[s],a=r[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(It(e),r)}else{const r=It(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function cn(e,t=!1){return jn(e)||Dt(e)||!mt(e)||(In(e)>1&&(e.set=e.add=e.clear=e.delete=kd),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>cn(r,!0))),e}function kd(){Se(2)}function jn(e){return Object.isFrozen(e)}var Od={};function vt(e){const t=Od[e];return t||Se(0,e),t}var ln;function ci(){return ln}function Pd(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function li(e,t){t&&(vt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function no(e){ro(e),e.drafts_.forEach(Md),e.drafts_=null}function ro(e){e===ln&&(ln=e.parent_)}function ui(e){return ln=Pd(ln,e)}function Md(e){const t=e[Re];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function di(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Re].modified_&&(no(t),Se(4)),mt(e)&&(e=Fn(t,e),t.parent_||Bn(t,e)),t.patches_&&vt("Patches").generateReplacementPatches_(n[Re].base_,e,t.patches_,t.inversePatches_)):e=Fn(t,n,[]),no(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==oi?e:void 0}function Fn(e,t,n){if(jn(t))return t;const r=t[Re];if(!r)return Mn(t,(o,s)=>fi(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Bn(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let s=o,i=!1;r.type_===3&&(s=new Set(o),o.clear(),i=!0),Mn(s,(a,c)=>fi(e,r,o,a,c,n,i)),Bn(e,o,!1),n&&e.patches_&&vt("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function fi(e,t,n,r,o,s,i){if(process.env.NODE_ENV!=="production"&&o===n&&Se(5),Dt(o)){const a=s&&t&&t.type_!==3&&!eo(t.assigned_,r)?s.concat(r):void 0,c=Fn(e,o,a);if(ai(n,r,c),Dt(c))e.canAutoFreeze_=!1;else return}else i&&n.add(o);if(mt(o)&&!jn(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Fn(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&Bn(e,o)}}function Bn(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cn(t,n)}function Id(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ci(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=oo;n&&(o=[r],s=un);const{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,a}var oo={get(e,t){if(t===Re)return e;const n=gt(e);if(!eo(n,t))return Dd(e,n,t);const r=n[t];return e.finalized_||!mt(r)?r:r===so(e.base_,t)?(ao(e),e.copy_[t]=co(r,e)):r},has(e,t){return t in gt(e)},ownKeys(e){return Reflect.ownKeys(gt(e))},set(e,t,n){const r=pi(gt(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=so(gt(e),t),s=o==null?void 0:o[Re];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Nd(n,o)&&(n!==void 0||eo(e.base_,t)))return!0;ao(e),io(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return so(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ao(e),io(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gt(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Se(11)},getPrototypeOf(e){return It(e.base_)},setPrototypeOf(){Se(12)}},un={};Mn(oo,(e,t)=>{un[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),un.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Se(13),un.set.call(this,e,t,void 0)},un.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Se(14),oo.set.call(this,e[0],t,n,e[0])};function so(e,t){const n=e[Re];return(n?gt(n):e)[t]}function Dd(e,t,n){var o;const r=pi(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function pi(e,t){if(!(t in e))return;let n=It(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=It(n)}}function io(e){e.modified_||(e.modified_=!0,e.parent_&&io(e.parent_))}function ao(e){e.copy_||(e.copy_=to(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ld=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const s=n;n=t;const i=this;return function(c=s,...l){return i.produce(c,u=>n.call(this,u,...l))}}typeof n!="function"&&Se(6),r!==void 0&&typeof r!="function"&&Se(7);let o;if(mt(t)){const s=ui(this),i=co(t,void 0);let a=!0;try{o=n(i),a=!1}finally{a?no(s):ro(s)}return li(s,r),di(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===oi&&(o=void 0),this.autoFreeze_&&cn(o,!0),r){const s=[],i=[];vt("Patches").generateReplacementPatches_(t,o,s,i),r(s,i)}return o}else Se(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,c=>t(c,...a));let r,o;return[this.produce(t,n,(i,a)=>{r=i,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){mt(e)||Se(8),Dt(e)&&(e=jd(e));const t=ui(this),n=co(e,void 0);return n[Re].isManual_=!0,ro(t),n}finishDraft(e,t){const n=e&&e[Re];(!n||!n.isManual_)&&Se(9);const{scope_:r}=n;return li(r,t),di(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=vt("Patches").applyPatches_;return Dt(e)?r(e,t):this.produce(e,o=>r(o,t))}};function co(e,t){const n=Dn(e)?vt("MapSet").proxyMap_(e,t):Ln(e)?vt("MapSet").proxySet_(e,t):Id(e,t);return(t?t.scope_:ci()).drafts_.push(n),n}function jd(e){return Dt(e)||Se(10,e),hi(e)}function hi(e){if(!mt(e)||jn(e))return e;const t=e[Re];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=to(e,t.scope_.immer_.useStrictShallowCopy_)}else n=to(e,!0);return Mn(n,(r,o)=>{ai(n,r,hi(o))}),t&&(t.finalized_=!1),n}var Ne=new Ld,Fd=Ne.produce;Ne.produceWithPatches.bind(Ne),Ne.setAutoFreeze.bind(Ne),Ne.setUseStrictShallowCopy.bind(Ne),Ne.applyPatches.bind(Ne),Ne.createDraft.bind(Ne),Ne.finishDraft.bind(Ne);function Bd(e){var t=H.useState(function(){return cn(typeof e=="function"?e():e,!0)}),n=t[1];return[t[0],H.useCallback(function(r){n(typeof r=="function"?Fd(r):cn(r))},[])]}function mi(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=mi(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function lo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mi(e))&&(r&&(r+=" "),r+=t);return r}/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ud=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),gi=e=>{const t=Wd(e);return t.charAt(0).toUpperCase()+t.slice(1)},vi=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Vd=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var $d={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zd=H.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>H.createElement("svg",{ref:c,...$d,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vi("lucide",o),...!s&&!Vd(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>H.createElement(l,u)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _e=(e,t)=>{const n=H.forwardRef(({className:r,...o},s)=>H.createElement(zd,{ref:s,iconNode:t,className:vi(`lucide-${Ud(gi(e))}`,`lucide-${e}`,r),...o}));return n.displayName=gi(e),n};/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hd=_e("audio-lines",[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bi=_e("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yi=_e("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qd=_e("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gd=_e("circle-play",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wi=_e("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yd=_e("file-audio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xd=_e("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kd=_e("mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jd=_e("pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zd=_e("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qd=_e("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xi=_e("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** * @license lucide-react v0.501.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ef=_e("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ei(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Si(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ei(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Ei(e[o],null)}}}}function pe(...e){return w.useCallback(Si(...e),e)}function tf(e,t){const n=w.createContext(t),r=s=>{const{children:i,...a}=s,c=w.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=w.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Un(e,t=[]){let n=[];function r(s,i){const a=w.createContext(i),c=n.length;n=[...n,i];const l=d=>{var v;const{scope:m,children:g,...h}=d,f=((v=m==null?void 0:m[e])==null?void 0:v[c])||a,p=w.useMemo(()=>h,Object.values(h));return x.jsx(f.Provider,{value:p,children:g})};l.displayName=s+"Provider";function u(d,m){var f;const g=((f=m==null?void 0:m[e])==null?void 0:f[c])||a,h=w.useContext(g);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>w.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,nf(o,...t)]}function nf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var we=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},rf=w[" useId ".trim().toString()]||(()=>{}),of=0;function Lt(e){const[t,n]=w.useState(rf());return we(()=>{n(r=>r??String(of++))},[e]),e||(t?`radix-${t}`:"")}var sf=w[" useInsertionEffect ".trim().toString()]||we;function uo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=af({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=w.useRef(e!==void 0);w.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=w.useCallback(u=>{var d;if(a){const m=cf(u)?u(e):u;m!==e&&((d=i.current)==null||d.call(i,m))}else s(u)},[a,e,s,i]);return[c,l]}function af({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),s=w.useRef(t);return sf(()=>{s.current=t},[t]),w.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function cf(e){return typeof e=="function"}function jt(e){const t=uf(e),n=w.forwardRef((r,o)=>{const{children:s,...i}=r,a=w.Children.toArray(s),c=a.find(ff);if(c){const l=c.props.children,u=a.map(d=>d===c?w.Children.count(l)>1?w.Children.only(null):w.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...i,ref:o,children:w.isValidElement(l)?w.cloneElement(l,void 0,u):null})}return x.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var lf=jt("Slot");function uf(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const i=hf(o),a=pf(s,o.props);return o.type!==w.Fragment&&(a.ref=r?Si(r,i):i),w.cloneElement(o,a)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var df=Symbol("radix.slottable");function ff(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===df}function pf(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{s(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function hf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=mf.reduce((e,t)=>{const n=jt(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gf(e,t){e&&on.flushSync(()=>e.dispatchEvent(t))}function bt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vf(e,t=globalThis==null?void 0:globalThis.document){const n=bt(e);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var bf="DismissableLayer",fo="dismissableLayer.update",yf="dismissableLayer.pointerDownOutside",wf="dismissableLayer.focusOutside",_i,Ci=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=w.useContext(Ci),[u,d]=w.useState(null),m=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=w.useState({}),h=pe(t,_=>d(_)),f=Array.from(l.layers),[p]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=f.indexOf(p),b=u?f.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,C=b>=v,E=Sf(_=>{const S=_.target,P=[...l.branches].some(j=>j.contains(S));!C||P||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},m),T=_f(_=>{const S=_.target;[...l.branches].some(j=>j.contains(S))||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},m);return vf(_=>{b===l.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},m),w.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(_i=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ai(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=_i)}},[u,m,n,l]),w.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ai())},[u,l]),w.useEffect(()=>{const _=()=>g({});return document.addEventListener(fo,_),()=>document.removeEventListener(fo,_)},[]),x.jsx(le.div,{...c,ref:h,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:ue(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ue(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ue(e.onPointerDownCapture,E.onPointerDownCapture)})});po.displayName=bf;var xf="DismissableLayerBranch",Ef=w.forwardRef((e,t)=>{const n=w.useContext(Ci),r=w.useRef(null),o=pe(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(le.div,{...e,ref:o})});Ef.displayName=xf;function Sf(e,t=globalThis==null?void 0:globalThis.document){const n=bt(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Ti(yf,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _f(e,t=globalThis==null?void 0:globalThis.document){const n=bt(e),r=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!r.current&&Ti(wf,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ai(){const e=new CustomEvent(fo);document.dispatchEvent(e)}function Ti(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?gf(o,s):o.dispatchEvent(s)}var ho="focusScope.autoFocusOnMount",mo="focusScope.autoFocusOnUnmount",Ri={bubbles:!1,cancelable:!0},Cf="FocusScope",go=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=w.useState(null),l=bt(o),u=bt(s),d=w.useRef(null),m=pe(t,f=>c(f)),g=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let f=function(y){if(g.paused||!a)return;const C=y.target;a.contains(C)?d.current=C:ot(d.current,{select:!0})},p=function(y){if(g.paused||!a)return;const C=y.relatedTarget;C!==null&&(a.contains(C)||ot(d.current,{select:!0}))},v=function(y){if(document.activeElement===document.body)for(const E of y)E.removedNodes.length>0&&ot(a)};document.addEventListener("focusin",f),document.addEventListener("focusout",p);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",p),b.disconnect()}}},[r,a,g.paused]),w.useEffect(()=>{if(a){Oi.add(g);const f=document.activeElement;if(!a.contains(f)){const v=new CustomEvent(ho,Ri);a.addEventListener(ho,l),a.dispatchEvent(v),v.defaultPrevented||(Af(Of(Ni(a)),{select:!0}),document.activeElement===f&&ot(a))}return()=>{a.removeEventListener(ho,l),setTimeout(()=>{const v=new CustomEvent(mo,Ri);a.addEventListener(mo,u),a.dispatchEvent(v),v.defaultPrevented||ot(f??document.body,{select:!0}),a.removeEventListener(mo,u),Oi.remove(g)},0)}}},[a,l,u,g]);const h=w.useCallback(f=>{if(!n&&!r||g.paused)return;const p=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,v=document.activeElement;if(p&&v){const b=f.currentTarget,[y,C]=Tf(b);y&&C?!f.shiftKey&&v===C?(f.preventDefault(),n&&ot(y,{select:!0})):f.shiftKey&&v===y&&(f.preventDefault(),n&&ot(C,{select:!0})):v===b&&f.preventDefault()}},[n,r,g.paused]);return x.jsx(le.div,{tabIndex:-1,...i,ref:m,onKeyDown:h})});go.displayName=Cf;function Af(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ot(r,{select:t}),document.activeElement!==n)return}function Tf(e){const t=Ni(e),n=ki(t,e),r=ki(t.reverse(),e);return[n,r]}function Ni(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ki(e,t){for(const n of e)if(!Rf(n,{upTo:t}))return n}function Rf(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Nf(e){return e instanceof HTMLInputElement&&"select"in e}function ot(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Nf(e)&&t&&e.select()}}var Oi=kf();function kf(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Pi(e,t),e.unshift(t)},remove(t){var n;e=Pi(e,t),(n=e[0])==null||n.resume()}}}function Pi(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Of(e){return e.filter(t=>t.tagName!=="A")}var Pf="Portal",vo=w.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=w.useState(!1);we(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Js.createPortal(x.jsx(le.div,{...r,ref:t}),i):null});vo.displayName=Pf;function Mf(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Wn=e=>{const{present:t,children:n}=e,r=If(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=pe(r.ref,Df(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:s}):null};Wn.displayName="Presence";function If(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),s=w.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Mf(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=Vn(r.current);s.current=a==="mounted"?l:"none"},[a]),we(()=>{const l=r.current,u=o.current;if(u!==e){const m=s.current,g=Vn(l);e?c("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),we(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=g=>{const f=Vn(r.current).includes(g.animationName);if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},m=g=>{g.target===t&&(s.current=Vn(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Vn(e){return(e==null?void 0:e.animationName)||"none"}function Df(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bo=0;function Mi(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ii()),document.body.insertAdjacentElement("beforeend",e[1]??Ii()),bo++,()=>{bo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bo--}},[])}function Ii(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ze=function(){return ze=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ze.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Lf(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var $n="right-scroll-bar-position",zn="width-before-scroll-bar",jf="with-scroll-bars-hidden",Ff="--removed-body-scroll-bar-size";function yo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Bf(e,t){var n=H.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Uf=typeof window<"u"?w.useLayoutEffect:w.useEffect,Li=new WeakMap;function Wf(e,t){var n=Bf(null,function(r){return e.forEach(function(o){return yo(o,r)})});return Uf(function(){var r=Li.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||yo(a,null)}),s.forEach(function(a){o.has(a)||yo(a,i)})}Li.set(n,e)},[e]),n}function Vf(e){return e}function $f(e,t){t===void 0&&(t=Vf);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function zf(e){e===void 0&&(e={});var t=$f(null);return t.options=ze({async:!0,ssr:!1},e),t}var ji=function(e){var t=e.sideCar,n=Di(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,ze({},n))};ji.isSideCarExport=!0;function Hf(e,t){return e.useMedium(t),ji}var Fi=zf(),wo=function(){},Hn=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:wo,onWheelCapture:wo,onTouchMoveCapture:wo}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,m=e.sideCar,g=e.noIsolation,h=e.inert,f=e.allowPinchZoom,p=e.as,v=p===void 0?"div":p,b=e.gapMode,y=Di(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,E=Wf([n,t]),T=ze(ze({},y),o);return w.createElement(w.Fragment,null,u&&w.createElement(C,{sideCar:Fi,removeScrollBar:l,shards:d,noIsolation:g,inert:h,setCallbacks:s,allowPinchZoom:!!f,lockRef:n,gapMode:b}),i?w.cloneElement(w.Children.only(a),ze(ze({},T),{ref:E})):w.createElement(v,ze({},T,{className:c,ref:E}),a))});Hn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hn.classNames={fullWidth:zn,zeroRight:$n};var qf=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Gf(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qf();return t&&e.setAttribute("nonce",t),e}function Yf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Xf(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Kf=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Gf())&&(Yf(t,n),Xf(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jf=function(){var e=Kf();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Bi=function(){var e=Jf(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Zf={left:0,top:0,right:0,gap:0},xo=function(e){return parseInt(e||"",10)||0},Qf=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xo(n),xo(r),xo(o)]},ep=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Zf;var t=Qf(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tp=Bi(),Ft="data-scroll-locked",np=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(jf,` { overflow: hidden `).concat(r,`; padding-right: `).concat(a,"px ").concat(r,`; } body[`).concat(Ft,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(s,`px; padding-right: `).concat(i,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat($n,` { right: `).concat(a,"px ").concat(r,`; } .`).concat(zn,` { margin-right: `).concat(a,"px ").concat(r,`; } .`).concat($n," .").concat($n,` { right: 0 `).concat(r,`; } .`).concat(zn," .").concat(zn,` { margin-right: 0 `).concat(r,`; } body[`).concat(Ft,`] { `).concat(Ff,": ").concat(a,`px; } `)},Ui=function(){var e=parseInt(document.body.getAttribute(Ft)||"0",10);return isFinite(e)?e:0},rp=function(){w.useEffect(function(){return document.body.setAttribute(Ft,(Ui()+1).toString()),function(){var e=Ui()-1;e<=0?document.body.removeAttribute(Ft):document.body.setAttribute(Ft,e.toString())}},[])},op=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;rp();var s=w.useMemo(function(){return ep(o)},[o]);return w.createElement(tp,{styles:np(s,!t,o,n?"":"!important")})},Eo=!1;if(typeof window<"u")try{var qn=Object.defineProperty({},"passive",{get:function(){return Eo=!0,!0}});window.addEventListener("test",qn,qn),window.removeEventListener("test",qn,qn)}catch{Eo=!1}var Bt=Eo?{passive:!1}:!1,sp=function(e){return e.tagName==="TEXTAREA"},Wi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sp(e)&&n[t]==="visible")},ip=function(e){return Wi(e,"overflowY")},ap=function(e){return Wi(e,"overflowX")},Vi=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=$i(e,r);if(o){var s=zi(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},lp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$i=function(e,t){return e==="v"?ip(t):ap(t)},zi=function(e,t){return e==="v"?cp(t):lp(t)},up=function(e,t){return e==="h"&&t==="rtl"?-1:1},dp=function(e,t,n,r,o){var s=up(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,m=0;do{var g=zi(e,a),h=g[0],f=g[1],p=g[2],v=f-p-s*h;(h||v)&&$i(e,a)&&(d+=v,m+=h),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(m)<1)&&(l=!0),l},Gn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Hi=function(e){return[e.deltaX,e.deltaY]},qi=function(e){return e&&"current"in e?e.current:e},fp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pp=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},hp=0,Ut=[];function mp(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(hp++)[0],s=w.useState(Bi)[0],i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Lf([e.lockRef.current],(e.shards||[]).map(qi),!0).filter(Boolean);return f.forEach(function(p){return p.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(p){return p.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(f,p){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var v=Gn(f),b=n.current,y="deltaX"in f?f.deltaX:b[0]-v[0],C="deltaY"in f?f.deltaY:b[1]-v[1],E,T=f.target,_=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in f&&_==="h"&&T.type==="range")return!1;var S=Vi(_,T);if(!S)return!0;if(S?E=_:(E=_==="v"?"h":"v",S=Vi(_,T)),!S)return!1;if(!r.current&&"changedTouches"in f&&(y||C)&&(r.current=E),!E)return!0;var P=r.current||E;return dp(P,p,f,P==="h"?y:C)},[]),c=w.useCallback(function(f){var p=f;if(!(!Ut.length||Ut[Ut.length-1]!==s)){var v="deltaY"in p?Hi(p):Gn(p),b=t.current.filter(function(E){return E.name===p.type&&(E.target===p.target||p.target===E.shadowParent)&&fp(E.delta,v)})[0];if(b&&b.should){p.cancelable&&p.preventDefault();return}if(!b){var y=(i.current.shards||[]).map(qi).filter(Boolean).filter(function(E){return E.contains(p.target)}),C=y.length>0?a(p,y[0]):!i.current.noIsolation;C&&p.cancelable&&p.preventDefault()}}},[]),l=w.useCallback(function(f,p,v,b){var y={name:f,delta:p,target:v,should:b,shadowParent:gp(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),u=w.useCallback(function(f){n.current=Gn(f),r.current=void 0},[]),d=w.useCallback(function(f){l(f.type,Hi(f),f.target,a(f,e.lockRef.current))},[]),m=w.useCallback(function(f){l(f.type,Gn(f),f.target,a(f,e.lockRef.current))},[]);w.useEffect(function(){return Ut.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Bt),document.addEventListener("touchmove",c,Bt),document.addEventListener("touchstart",u,Bt),function(){Ut=Ut.filter(function(f){return f!==s}),document.removeEventListener("wheel",c,Bt),document.removeEventListener("touchmove",c,Bt),document.removeEventListener("touchstart",u,Bt)}},[]);var g=e.removeScrollBar,h=e.inert;return w.createElement(w.Fragment,null,h?w.createElement(s,{styles:pp(o)}):null,g?w.createElement(op,{gapMode:e.gapMode}):null)}function gp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vp=Hf(Fi,mp);var So=w.forw