@voxket-ai/voxket-live 1.1.39 → 1.1.41
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/dist/index.cjs +5 -5
- package/dist/index.css +1 -1
- package/dist/index.js +972 -971
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
${p}px !important;
|
|
7
7
|
top: ${u}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{g.contains(m)&&g.removeChild(m)}},[t]),h.jsx(Y0,{isPresent:t,childRef:o,sizeRef:s,children:D.cloneElement(e,{ref:o})})}const X0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=Ga(Q0),u=N.useId();let d=!0,f=N.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const m of c.values())if(!m)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),N.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),D.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Z0,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(Ao.Provider,{value:f,children:e})};function Q0(){return new Map}function dh(e=!0){const t=N.useContext(Ao);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=N.useId();N.useEffect(()=>{if(e)return i(o)},[e]);const s=N.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Li=e=>e.key||"";function jc(e){const t=[];return N.Children.forEach(e,n=>{N.isValidElement(n)&&t.push(n)}),t}const Tr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=dh(s),d=N.useMemo(()=>jc(e),[e]),f=s&&!c?[]:d.map(Li),p=N.useRef(!0),m=N.useRef(d),g=Ga(()=>new Map),[v,y]=N.useState(d),[E,w]=N.useState(d);vf(()=>{p.current=!1,m.current=d;for(let T=0;T<E.length;T++){const R=Li(E[T]);f.includes(R)?g.delete(R):g.get(R)!==!0&&g.set(R,!1)}},[E,f.length,f.join("-")]);const _=[];if(d!==v){let T=[...d];for(let R=0;R<E.length;R++){const A=E[R],I=Li(A);f.includes(I)||(T.splice(R,0,A),_.push(A))}return o==="wait"&&_.length&&(T=_),w(jc(T)),y(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=N.useContext(Wa);return h.jsx(h.Fragment,{children:E.map(T=>{const R=Li(T),A=s&&!c?!1:d===E||f.includes(R),I=()=>{if(g.has(R))g.set(R,!0);else return;let b=!0;g.forEach(M=>{M||(b=!1)}),b&&(C==null||C(),w(m.current),s&&(u==null||u()),r&&r())};return h.jsx(X0,{isPresent:A,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:A?void 0:I,anchorX:a,children:T},R)})})},fh=N.createContext({strict:!1}),Bc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Nr={};for(const e in Bc)Nr[e]={isEnabled:t=>Bc[e].some(n=>!!t[n])};function J0(e){for(const t in e)Nr[t]={...Nr[t],...e[t]}}const ey=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function mo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ey.has(e)}let hh=e=>!mo(e);function ty(e){typeof e=="function"&&(hh=t=>t.startsWith("on")?!mo(t):e(t))}try{ty(require("@emotion/is-prop-valid").default)}catch{}function ny(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(hh(i)||n===!0&&mo(i)||!t&&!mo(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Mo=N.createContext({});function Ro(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const ml=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bl=["initial",...ml];function Io(e){return Ro(e.animate)||bl.some(t=>ci(e[t]))}function ph(e){return!!(Io(e)||e.variants)}function ry(e,t){if(Io(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function iy(e){const{initial:t,animate:n}=ry(e,N.useContext(Mo));return N.useMemo(()=>({initial:t,animate:n}),[$c(t),$c(n)])}function $c(e){return Array.isArray(e)?e.join(" "):e}const ui={};function oy(e){for(const t in e)ui[t]=e[t],tl(t)&&(ui[t].isCSSVariable=!0)}function gh(e,{layout:t,layoutId:n}){return Pr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ui[e]||e==="opacity")}const sy={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ay=Or.length;function ly(e,t,n){let r="",i=!0;for(let o=0;o<ay;o++){const s=Or[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=oh(a,fl[s]);if(!l){i=!1;const u=sy[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function yl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Pr.has(l)){s=!0;continue}else if(tl(l)){i[l]=c;continue}else{const u=oh(c,fl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=ly(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const xl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mh(e,t,n){for(const r in t)!_t(t[r])&&!gh(r,n)&&(e[r]=t[r])}function cy({transformTemplate:e},t){return N.useMemo(()=>{const n=xl();return yl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uy(e,t){const n=e.style||{},r={};return mh(r,n,e),Object.assign(r,cy(e,t)),r}function dy(e,t){const n={},r=uy(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const fy={offset:"stroke-dashoffset",array:"stroke-dasharray"},hy={offset:"strokeDashoffset",array:"strokeDasharray"};function py(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?fy:hy;e[o.offset]=_e.transform(-r);const s=_e.transform(t),a=_e.transform(n);e[o.array]=`${s} ${a}`}function bh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(yl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&py(d,i,o,s,!1)}const yh=()=>({...xl(),attrs:{}}),xh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gy(e,t,n,r){const i=N.useMemo(()=>{const o=yh();return bh(o,t,xh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};mh(o,e.style,e),i.style={...o,...i.style}}return i}const my=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vl(e){return typeof e!="string"||e.includes("-")?!1:!!(my.indexOf(e)>-1||/[A-Z]/u.test(e))}function by(e,t,n,{latestValues:r},i,o=!1){const a=(vl(e)?gy:dy)(t,r,i,e),l=ny(t,typeof e=="string",o),c=e!==N.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=N.useMemo(()=>_t(u)?u.get():u,[u]);return N.createElement(e,{...c,children:d})}function Vc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function wl(e,t,n,r){if(typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function ro(e){return _t(e)?e.get():e}function yy({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:xy(n,r,i,e),renderState:t()}}function xy(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ro(o[f]);let{initial:s,animate:a}=e;const l=Io(e),c=ph(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!Ro(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=wl(e,f[p]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const E in y){let w=y[E];if(Array.isArray(w)){const _=u?w.length-1:0;w=w[_]}w!==null&&(i[E]=w)}for(const E in g)i[E]=g[E]}}}return i}const vh=e=>(t,n)=>{const r=N.useContext(Mo),i=N.useContext(Ao),o=()=>yy(e,t,r,i);return n?o():Ga(o)};function El(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(_t(r[s])||t.style&&_t(t.style[s])||gh(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const vy=vh({scrapeMotionValuesFromProps:El,createRenderState:xl});function wh(e,t,n){const r=El(e,t,n);for(const i in e)if(_t(e[i])||_t(t[i])){const o=Or.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const wy=vh({scrapeMotionValuesFromProps:wh,createRenderState:yh}),Ey=Symbol.for("motionComponentSymbol");function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sy(e,t,n){return N.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xr(n)&&(n.current=r))},[t])}const Sl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ky="framerAppearId",Eh="data-"+Sl(ky),Sh=N.createContext({});function Cy(e,t,n,r,i){var g,v;const{visualElement:o}=N.useContext(Mo),s=N.useContext(fh),a=N.useContext(Ao),l=N.useContext(gl).reducedMotion,c=N.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=N.useContext(Sh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&_y(c.current,n,i,d);const f=N.useRef(!1);N.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[Eh],m=N.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return vf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),m.current=!1),u.enteringChildren=void 0)}),u}function _y(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&xr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function kh(e){if(e)return e.options.allowProjection!==!1?e.projection:kh(e.parent)}function fs(e,{forwardMotionProps:t=!1}={},n,r){n&&J0(n);const i=vl(e)?wy:vy;function o(a,l){let c;const u={...N.useContext(gl),...a,layoutId:Ty(a)},{isStatic:d}=u,f=iy(a),p=i(a,d);if(!d&&Ka){Ny(u,n);const m=Ay(u);c=m.MeasureLayout,f.visualElement=Cy(e,p,u,r,m.ProjectionNode)}return h.jsxs(Mo.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,by(e,a,Sy(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=N.forwardRef(o);return s[Ey]=e,s}function Ty({layoutId:e}){const t=N.useContext(Wa).id;return t&&e!==void 0?t+"-"+e:e}function Ny(e,t){const n=N.useContext(fh).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Rr(!1,r,"lazy-strict-mode"):wn(!1,r,"lazy-strict-mode")}}function Ay(e){const{drag:t,layout:n}=Nr;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function My(e,t){if(typeof Proxy>"u")return fs;const n=new Map,r=(o,s)=>fs(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Qa(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,fs(s,void 0,e,t)),n.get(s))})}function Ch({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ry({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Iy(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function hs(e){return e===void 0||e===1}function ma({scale:e,scaleX:t,scaleY:n}){return!hs(e)||!hs(t)||!hs(n)}function Hn(e){return ma(e)||_h(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _h(e){return zc(e.x)||zc(e.y)}function zc(e){return e&&e!=="0%"}function bo(e,t,n){const r=e-n,i=t*r;return n+i}function Uc(e,t,n,r,i){return i!==void 0&&(e=bo(e,i,r)),bo(e,n,r)+t}function ba(e,t=0,n=1,r,i){e.min=Uc(e.min,t,n,r,i),e.max=Uc(e.max,t,n,r,i)}function Th(e,{x:t,y:n}){ba(e.x,t.translate,t.scale,t.originPoint),ba(e.y,n.translate,n.scale,n.originPoint)}const Hc=.999999999999,Wc=1.0000000000001;function Oy(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&wr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Th(e,s)),r&&Hn(o.latestValues)&&wr(e,o.latestValues))}t.x<Wc&&t.x>Hc&&(t.x=1),t.y<Wc&&t.y>Hc&&(t.y=1)}function vr(e,t){e.min=e.min+t,e.max=e.max+t}function Gc(e,t,n,r,i=.5){const o=st(e.min,e.max,i);ba(e,t,n,o,r)}function wr(e,t){Gc(e.x,t.x,t.scaleX,t.scale,t.originX),Gc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nh(e,t){return Ch(Iy(e.getBoundingClientRect(),t))}function Py(e,t,n){const r=Nh(e,n),{scroll:i}=t;return i&&(vr(r.x,i.offset.x),vr(r.y,i.offset.y)),r}const Kc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Er=()=>({x:Kc(),y:Kc()}),qc=()=>({min:0,max:0}),dt=()=>({x:qc(),y:qc()}),ya={current:null},Ah={current:!1};function Dy(){if(Ah.current=!0,!!Ka)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ya.current=e.matches;e.addEventListener("change",t),t()}else ya.current=!1}const Ly=new WeakMap;function Fy(e,t,n){for(const r in t){const i=t[r],o=n[r];if(_t(i))e.addValue(r,i);else if(_t(o))e.addValue(r,_r(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,_r(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Yc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jy{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ul,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ft.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Io(n),this.isVariantNode=ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&_t(p)&&p.set(l[f])}}mount(t){var n;this.current=t,Ly.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),Ah.current||Dy(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ya.current,process.env.NODE_ENV!=="production"&&Qa(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),In(this.notifyUpdate),In(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Pr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&rt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nr){const n=Nr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Yc.length;r++){const i=Yc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=Fy(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_r(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wf(r)||Sf(r))?r=parseFloat(r):!q0(r)&&On.test(n)&&(r=ih(t,n)),this.setBaseTarget(t,_t(r)?r.get():r)),_t(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=wl(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!_t(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Xa),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){hl.render(this.render)}}class Mh extends jy{constructor(){super(...arguments),this.KeyframeResolver=L0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_t(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rh(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function By(e){return window.getComputedStyle(e)}class $y extends Mh{constructor(){super(...arguments),this.type="html",this.renderInstance=Rh}readValueFromInstance(t,n){var r;if(Pr.has(n))return(r=this.projection)!=null&&r.isProjecting?ca(n):e0(t,n);{const i=By(t),o=(tl(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nh(t,n)}build(t,n,r){yl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return El(t,n,r)}}const Ih=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Vy(e,t,n,r){Rh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ih.has(i)?i:Sl(i),t.attrs[i])}class zy extends Mh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pr.has(n)){const r=rh(n);return r&&r.default||0}return n=Ih.has(n)?n:Sl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wh(t,n,r)}build(t,n,r){bh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Vy(t,n,r,i)}mount(t){this.isSVGTag=xh(t.tagName),super.mount(t)}}const Uy=(e,t)=>vl(e)?new zy(t):new $y(t,{allowProjection:e!==N.Fragment});function Sr(e,t,n){const r=e.getProps();return wl(r,t,n!==void 0?n:r.custom,e)}const xa=e=>Array.isArray(e);function Hy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_r(n))}function Wy(e){return xa(e)?e[e.length-1]||0:e}function Gy(e,t){const n=Sr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=Wy(o[s]);Hy(e,s,a)}}function Ky(e){return!!(_t(e)&&e.add)}function va(e,t){const n=e.getValue("willChange");if(Ky(n))return n.add(t);if(!n&&En.WillChange){const r=new En.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Oh(e){return e.props[Eh]}const qy=e=>e!==null;function Yy(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(qy),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Zy={type:"spring",stiffness:500,damping:25,restSpeed:10},Xy=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Qy={type:"keyframes",duration:.8},Jy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(e,{keyframes:t})=>t.length>2?Qy:Pr.has(e)?e.startsWith("scale")?Xy(t[1]):Zy:Jy;function tx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kl=(e,t,n,r={},i,o)=>s=>{const a=dl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};tx(a)||Object.assign(u,ex(e,u)),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pa(u),u.delay===0&&(d=!0)),(En.instantAnimations||En.skipAnimations)&&(d=!0,pa(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=Yy(u.keyframes,a);if(f!==void 0){rt.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new cl(u):new S0(u)};function nx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ph(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&nx(c,u))continue;const p={delay:n,...dl(o||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===m&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const y=Oh(e);if(y){const E=window.MotionHandoffAnimation(y,u,rt);E!==null&&(p.startTime=E,g=!0)}}va(e,u),d.start(kl(u,d,f,e.shouldReduceMotion&&eh.has(u)?{type:!1}:p,e,g));const v=d.animation;v&&l.push(v)}return s&&Promise.all(l).then(()=>{rt.update(()=>{s&&Gy(e,s)})}),l}function Dh(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function wa(e,t,n={}){var l;const r=Sr(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Ph(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return rx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function rx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(wa(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Dh(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ix(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>wa(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=wa(e,t,n);else{const i=typeof t=="function"?Sr(e,t,n.custom):t;r=Promise.all(Ph(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lh(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ox=bl.length;function Fh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Fh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ox;n++){const r=bl[n],i=e.props[r];(ci(i)||i===!1)&&(t[r]=i)}return t}const sx=[...ml].reverse(),ax=ml.length;function lx(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ix(e,n,r)))}function cx(e){let t=lx(e),n=Zc(),r=!0;const i=l=>(c,u)=>{var f;const d=Sr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:m,...g}=d;c={...c,...g,...m}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Fh(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let v=0;v<ax;v++){const y=sx[v],E=n[y],w=c[y]!==void 0?c[y]:u[y],_=ci(w),C=y===l?E.isActive:null;C===!1&&(m=v);let T=w===u[y]&&w!==c[y]&&_;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),E.protectedKeys={...p},!E.isActive&&C===null||!w&&!E.prevProp||Ro(w)||typeof w=="boolean")continue;const R=ux(E.prevProp,w);let A=R||y===l&&E.isActive&&!T&&_||v>m&&_,I=!1;const b=Array.isArray(w)?w:[w];let M=b.reduce(i(y),{});C===!1&&(M={});const{prevResolvedValues:O={}}=E,L={...O,...M},j=te=>{A=!0,f.has(te)&&(I=!0,f.delete(te)),E.needsAnimating[te]=!0;const B=e.getValue(te);B&&(B.liveStyle=!1)};for(const te in L){const B=M[te],$=O[te];if(p.hasOwnProperty(te))continue;let x=!1;xa(B)&&xa($)?x=!Lh(B,$):x=B!==$,x?B!=null?j(te):f.add(te):B!==void 0&&f.has(te)?j(te):E.protectedKeys[te]=!0}E.prevProp=w,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(A=!1);const W=T&&R;A&&(!W||I)&&d.push(...b.map(te=>{const B={type:y};if(typeof te=="string"&&r&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,x=Sr($,te);if($.enteringChildren&&x){const{delayChildren:z}=x.transition||{};B.delay=Dh($.enteringChildren,e,z)}}return{animation:te,options:B}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const y=Sr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const E=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),v[y]=E??null}),d.push({animation:v})}let g=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Zc(),r=!0}}}function ux(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lh(t,e):!1}function Vn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zc(){return{animate:Vn(!0),whileInView:Vn(),whileHover:Vn(),whileTap:Vn(),whileDrag:Vn(),whileFocus:Vn(),exit:Vn()}}class Ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dx extends Ln{constructor(t){super(t),t.animationState||(t.animationState=cx(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ro(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let fx=0;class hx extends Ln{constructor(){super(...arguments),this.id=fx++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const px={animation:{Feature:dx},exit:{Feature:hx}};function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vi(e){return{point:{x:e.pageX,y:e.pageY}}}const gx=e=>t=>pl(t)&&e(t,vi(t));function Jr(e,t,n,r){return di(e,t,gx(n),r)}const jh=1e-4,mx=1-jh,bx=1+jh,Bh=.01,yx=0-Bh,xx=0+Bh;function Ot(e){return e.max-e.min}function vx(e,t,n){return Math.abs(e-t)<=n}function Xc(e,t,n,r=.5){e.origin=r,e.originPoint=st(t.min,t.max,e.origin),e.scale=Ot(n)/Ot(t),e.translate=st(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mx&&e.scale<=bx||isNaN(e.scale))&&(e.scale=1),(e.translate>=yx&&e.translate<=xx||isNaN(e.translate))&&(e.translate=0)}function ei(e,t,n,r){Xc(e.x,t.x,n.x,r?r.originX:void 0),Xc(e.y,t.y,n.y,r?r.originY:void 0)}function Qc(e,t,n){e.min=n.min+t.min,e.max=e.min+Ot(t)}function wx(e,t,n){Qc(e.x,t.x,n.x),Qc(e.y,t.y,n.y)}function Jc(e,t,n){e.min=t.min-n.min,e.max=e.min+Ot(t)}function ti(e,t,n){Jc(e.x,t.x,n.x),Jc(e.y,t.y,n.y)}function Kt(e){return[e("x"),e("y")]}const $h=({current:e})=>e?e.ownerDocument.defaultView:null,eu=(e,t)=>Math.abs(e-t);function Ex(e,t){const n=eu(e.x,t.x),r=eu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Vh{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=gs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Ex(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=f,{timestamp:v}=kt;this.history.push({...g,timestamp:v});const{onStart:y,onMove:E}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ps(p,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=gs(f.type==="pointercancel"?this.lastMoveEventInfo:ps(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,y),g&&g(f,y)},!pl(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=vi(t),l=ps(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=kt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,gs(l,this.history)),this.removeListeners=bi(Jr(this.contextWindow,"pointermove",this.handlePointerMove),Jr(this.contextWindow,"pointerup",this.handlePointerUp),Jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),In(this.updatePoint)}}function ps(e,t){return t?{point:t(e.point)}:e}function tu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gs({point:e},t){return{point:e,delta:tu(e,zh(t)),offset:tu(e,Sx(t)),velocity:kx(t,.1)}}function Sx(e){return e[0]}function zh(e){return e[e.length-1]}function kx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=zh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>tn(t)));)n--;if(!r)return{x:0,y:0};const o=un(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Cx(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?st(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?st(n,e,r.max):Math.min(e,n)),e}function nu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _x(e,{top:t,left:n,bottom:r,right:i}){return{x:nu(e.x,n,i),y:nu(e.y,t,r)}}function ru(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tx(e,t){return{x:ru(e.x,t.x),y:ru(e.y,t.y)}}function Nx(e,t){let n=.5;const r=Ot(e),i=Ot(t);return i>r?n=si(t.min,t.max-r,e.min):r>i&&(n=si(e.min,e.max-i,t.min)),vn(0,1,n)}function Ax(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ea=.35;function Mx(e=Ea){return e===!1?e=0:e===!0&&(e=Ea),{x:iu(e,"left","right"),y:iu(e,"top","bottom")}}function iu(e,t,n){return{min:ou(e,t),max:ou(e,n)}}function ou(e,t){return typeof e=="number"?e:e[t]||0}const Rx=new WeakMap;class Ix{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$0(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kt(y=>{let E=this.getAxisMotionValue(y).get()||0;if(dn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const _=w.layout.layoutBox[y];_&&(E=Ot(_)*(parseFloat(E)/100))}}this.originPoint[y]=E}),g&&rt.postRender(()=>g(d,f)),va(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(m&&this.currentDirection===null){this.currentDirection=Ox(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Kt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Vh(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:$h(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&rt.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Fi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=Cx(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&xr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_x(r.layoutBox,t):this.constraints=!1,this.elastic=Mx(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Kt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ax(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xr(t))return!1;const r=t.current;wn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Py(r,i.root,this.visualElement.getTransformPagePoint());let s=Tx(i.layout.layoutBox,o);if(n){const a=n(Ry(s));this.hasMutatedConstraints=!!a,a&&(s=Ch(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Kt(u=>{if(!Fi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return va(this.visualElement,t),r.start(kl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Kt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Kt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Kt(n=>{const{drag:r}=this.getProps();if(!Fi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-st(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=Nx({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Kt(s=>{if(!Fi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(st(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const t=this.visualElement.current,n=Jr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rt.read(r);const s=di(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Kt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Ea,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Fi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ox(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Px extends Ln{constructor(t){super(t),this.removeGroupControls=Zt,this.removeListeners=Zt,this.controls=new Ix(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zt}unmount(){this.removeGroupControls(),this.removeListeners()}}const su=e=>(t,n)=>{e&&rt.postRender(()=>e(t,n))};class Dx extends Ln{constructor(){super(...arguments),this.removePointerDownListener=Zt}onPointerDown(t){this.session=new Vh(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$h(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:su(t),onStart:su(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&rt.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Jr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const io={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function au(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=au(e,t.target.x),r=au(e,t.target.y);return`${n}% ${r}%`}},Lx={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=On.parse(e);if(i.length>5)return r;const o=On.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=st(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let ms=!1;class Fx extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;oy(jx),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),io.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,ms=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ms=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uh(e){const[t,n]=dh(),r=N.useContext(Wa);return h.jsx(Fx,{...e,layoutGroup:r,switchLayoutGroup:N.useContext(Sh),isPresent:t,safeToRemove:n})}const jx={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:Lx};function Bx(e,t,n){const r=_t(e)?e:_r(e);return r.start(kl("",r,t,n)),r.animation}const $x=(e,t)=>e.depth-t.depth;class Vx{constructor(){this.children=[],this.isDirty=!1}add(t){qa(this.children,t),this.isDirty=!0}remove(t){Ya(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($x),this.isDirty=!1,this.children.forEach(t)}}function zx(e,t){const n=Ft.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(In(r),e(o-t))};return rt.setup(r,!0),()=>In(r)}const Hh=["TopLeft","TopRight","BottomLeft","BottomRight"],Ux=Hh.length,lu=e=>typeof e=="string"?parseFloat(e):e,cu=e=>typeof e=="number"||_e.test(e);function Hx(e,t,n,r,i,o){i?(e.opacity=st(0,n.opacity??1,Wx(r)),e.opacityExit=st(t.opacity??1,0,Gx(r))):o&&(e.opacity=st(t.opacity??1,n.opacity??1,r));for(let s=0;s<Ux;s++){const a=`border${Hh[s]}Radius`;let l=uu(t,a),c=uu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||cu(l)===cu(c)?(e[a]=Math.max(st(lu(l),lu(c),r),0),(dn.test(c)||dn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=st(t.rotate||0,n.rotate||0,r))}function uu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Wx=Wh(0,.5,Rf),Gx=Wh(.5,.95,Zt);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(si(e,t,r))}function du(e,t){e.min=t.min,e.max=t.max}function Gt(e,t){du(e.x,t.x),du(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function hu(e,t,n,r,i){return e-=t,e=bo(e,1/n,r),i!==void 0&&(e=bo(e,1/i,r)),e}function Kx(e,t=0,n=1,r=.5,i,o=e,s=e){if(dn.test(t)&&(t=parseFloat(t),t=st(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=st(o.min,o.max,r);e===o&&(a-=t),e.min=hu(e.min,t,n,a,i),e.max=hu(e.max,t,n,a,i)}function pu(e,t,[n,r,i],o,s){Kx(e,t[n],t[r],t[i],t.scale,o,s)}const qx=["x","scaleX","originX"],Yx=["y","scaleY","originY"];function gu(e,t,n,r){pu(e.x,t,qx,n?n.x:void 0,r?r.x:void 0),pu(e.y,t,Yx,n?n.y:void 0,r?r.y:void 0)}function mu(e){return e.translate===0&&e.scale===1}function Gh(e){return mu(e.x)&&mu(e.y)}function bu(e,t){return e.min===t.min&&e.max===t.max}function Zx(e,t){return bu(e.x,t.x)&&bu(e.y,t.y)}function yu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Kh(e,t){return yu(e.x,t.x)&&yu(e.y,t.y)}function xu(e){return Ot(e.x)/Ot(e.y)}function vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Xx{constructor(){this.members=[]}add(t){qa(this.members,t),t.scheduleRender()}remove(t){if(Ya(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Qx(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const bs=["","X","Y","Z"],Jx=1e3;let ev=0;function ys(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Oh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qh(r)}function Yh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=ev++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rv),this.nodes.forEach(av),this.nodes.forEach(lv),this.nodes.forEach(iv)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vx)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Xa),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=uh(s)&&!G0(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=zx(f,250),io.hasAnimatedSinceResize&&(io.hasAnimatedSinceResize=!1,this.nodes.forEach(Su)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||hv,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Kh(this.targetLayout,p),E=!d&&f;if(this.options.layoutRoot||this.resumeFrom||E||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...dl(m,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,E)}else d||Su(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),In(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cv),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Eu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sv),this.nodes.forEach(tv),this.nodes.forEach(nv)):this.nodes.forEach(Eu),this.clearAllSnapshots();const a=Ft.now();kt.delta=vn(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,ss.update.process(kt),ss.preRender.process(kt),ss.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ov),this.sharedNodes.forEach(uv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ot(this.snapshot.measuredBox.x)&&!Ot(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=dt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Hn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),pv(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return dt();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(gv))){const{scroll:u}=this.root;u&&(vr(a.x,u.offset.x),vr(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=dt();if(Gt(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Gt(a,s),vr(a.x,d.offset.x),vr(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=dt();Gt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Hn(u.latestValues)&&wr(l,u.latestValues)}return Hn(this.latestValues)&&wr(l,this.latestValues),l}removeTransform(s){const a=dt();Gt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Hn(c.latestValues))continue;ma(c.latestValues)&&c.updateSnapshot();const u=dt(),d=c.measurePageBox();Gt(u,d),gu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Hn(this.latestValues)&&gu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),ti(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dt(),this.targetWithTransforms=dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gt(this.target,this.layout.layoutBox),Th(this.target,this.targetDelta)):Gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),ti(this.relativeTargetOrigin,this.target,p.target),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ma(this.parent.latestValues)||_h(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===kt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Gt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Oy(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=dt());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),ei(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!vu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Er(),this.projectionDelta=Er(),this.projectionDeltaWithTransform=Er()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Er();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=dt(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,v=this.getStack(),y=!v||v.members.length<=1,E=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(fv));this.animationProgress=0;let w;this.mixTargetDelta=_=>{const C=_/1e3;ku(d.x,s.x,C),ku(d.y,s.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dv(this.relativeTarget,this.relativeTargetOrigin,f,C),w&&Zx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=dt()),Gt(w,this.relativeTarget)),g&&(this.animationValues=u,Hx(u,c,this.latestValues,C,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(In(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{io.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_r(0)),this.currentAnimation=Bx(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Zh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||dt();const d=Ot(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Ot(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Gt(a,l),wr(a,u),ei(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Xx),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ys("z",s,c,this.animationValues);for(let u=0;u<bs.length;u++)ys(`rotate${bs[u]}`,s,c,this.animationValues),ys(`skew${bs[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Hn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Qx(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in ui){if(u[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=ui[m],E=d==="none"?u[m]:g(u[m],c);if(v){const w=v.length;for(let _=0;_<w;_++)s[v[_]]=E}else y?this.options.visualElement.renderState.vars[m]=E:s[m]=E}this.options.layoutId&&(s.pointerEvents=c===this?ro(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(wu),this.root.sharedNodes.clear()}}}function tv(e){e.updateLayout()}function nv(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Ot(f);f.min=r[d].min,f.max=f.min+p}):Zh(o,t.layoutBox,r)&&Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Ot(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=Er();ei(a,r,t.layoutBox);const l=Er();s?ei(l,e.applyTransform(i,!0),t.measuredBox):ei(l,r,t.layoutBox);const c=!Gh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=dt();ti(m,t.layoutBox,f.layoutBox);const g=dt();ti(g,r,p.layoutBox),Kh(m,g)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function rv(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function iv(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ov(e){e.clearSnapshot()}function wu(e){e.clearMeasurements()}function Eu(e){e.isLayoutDirty=!1}function sv(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Su(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function av(e){e.resolveTargetDelta()}function lv(e){e.calcProjection()}function cv(e){e.resetSkewAndRotation()}function uv(e){e.removeLeadSnapshot()}function ku(e,t,n){e.translate=st(t.translate,0,n),e.scale=st(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cu(e,t,n,r){e.min=st(t.min,n.min,r),e.max=st(t.max,n.max,r)}function dv(e,t,n,r){Cu(e.x,t.x,n.x,r),Cu(e.y,t.y,n.y,r)}function fv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hv={duration:.45,ease:[.4,0,.1,1]},_u=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Tu=_u("applewebkit/")&&!_u("chrome/")?Math.round:Zt;function Nu(e){e.min=Tu(e.min),e.max=Tu(e.max)}function pv(e){Nu(e.x),Nu(e.y)}function Zh(e,t,n){return e==="position"||e==="preserve-aspect"&&!vx(xu(t),xu(n),.2)}function gv(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const mv=Yh({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xs={current:void 0},Xh=Yh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xs.current){const e=new mv({});e.mount(window),e.setOptions({layoutScroll:!0}),xs.current=e}return xs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),bv={pan:{Feature:Dx},drag:{Feature:Px,ProjectionNode:Xh,MeasureLayout:Uh}};function Au(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&rt.postRender(()=>o(t,vi(t)))}class yv extends Ln{mount(){const{current:t}=this.node;t&&(this.unmount=V0(t,(n,r)=>(Au(this.node,r,"Start"),i=>Au(this.node,i,"End"))))}unmount(){}}class xv extends Ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mu(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&rt.postRender(()=>o(t,vi(t)))}class vv extends Ln{mount(){const{current:t}=this.node;t&&(this.unmount=W0(t,(n,r)=>(Mu(this.node,r,"Start"),(i,{success:o})=>Mu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Sa=new WeakMap,vs=new WeakMap,wv=e=>{const t=Sa.get(e.target);t&&t(e)},Ev=e=>{e.forEach(wv)};function Sv({root:e,...t}){const n=e||document;vs.has(n)||vs.set(n,{});const r=vs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ev,{root:e,...t})),r[i]}function kv(e,t,n){const r=Sv(t);return Sa.set(e,n),r.observe(e),()=>{Sa.delete(e),r.unobserve(e)}}const Cv={some:0,all:1};class _v extends Ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Cv[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return kv(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tv(t,n))&&this.startObserver()}unmount(){}}function Tv({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Nv={inView:{Feature:_v},tap:{Feature:vv},focus:{Feature:xv},hover:{Feature:yv}},Av={layout:{ProjectionNode:Xh,MeasureLayout:Uh}},Mv={...px,...Nv,...bv,...Av},Me=My(Mv,Uy);function Rv(e){const[t,n]=N.useState(()=>e.getLocalParticipant()),[r,i]=N.useState(()=>e.getMicrophoneTrack());return N.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),l=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!l,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),i(l)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function oo(e,t,n){const[r,i]=N.useState(!1),[o,s]=N.useState(!1);return N.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};return l(),e.on("track.muted",l),e.on("track.unmuted",l),e.on("connection.connected",l),()=>{e.off("track.muted",l),e.off("track.unmuted",l),e.off("connection.connected",l)}},[e,t]),{enabled:r,pending:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function Iv(e){const[t,n]=N.useState(()=>e.getRoom()),[r,i]=N.useState(()=>e.getConnectionState());return N.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function Cl(e){const[t,n]=N.useState(()=>e.getIsAgentConnected()),[r,i]=N.useState(()=>e.getCurrentSession()),[o,s]=N.useState(()=>e.getCurrentAgentInfo()),[a,l]=N.useState(()=>e.getAgentState()),[c,u]=N.useState(()=>e.getAgentAudioTrack()),[d,f]=N.useState(()=>e.getAgentVideoTrack());return N.useEffect(()=>{const p=()=>{const _=e.getIsAgentConnected(),C=e.getCurrentSession(),T=e.getCurrentAgentInfo(),R=e.getAgentState(),A=e.getAgentAudioTrack(),I=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:_,hasSession:!!C,sessionId:C==null?void 0:C.id,sessionState:C==null?void 0:C.state,hasAgentInfo:!!T,agentState:R,hasAudioTrack:!!A,hasVideoTrack:!!I}),n(_),i(C),s(T),l(R),u(A),f(I)};p();const m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},E=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()},w=()=>{console.log("🎵 useVoxketVoiceAssistant: Track subscribed event - updating audio/video tracks"),p()};return e.on("agent.connected",m),e.on("agent.speaking",m),e.on("agent.thinking",m),e.on("agent.state.changed",E),e.on("connection.disconnected",g),e.on("session.created",v),e.on("session.ended",v),e.on("session.state.changed",v),e.on("connection.connected",y),e.on("media.track.subscribed",w),e.on("media.track.unsubscribed",w),()=>{e.off("agent.connected",m),e.off("agent.speaking",m),e.off("agent.thinking",m),e.off("agent.state.changed",E),e.off("connection.disconnected",g),e.off("session.created",v),e.off("session.ended",v),e.off("session.state.changed",v),e.off("connection.connected",y),e.off("media.track.subscribed",w),e.off("media.track.unsubscribed",w)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function Ov(e){const[t,n]=N.useState(()=>e.getVideoTrackRefs()),[r,i]=N.useState(()=>e.getCameraTrackRefs()),[o,s]=N.useState(()=>e.getScreenShareTrackRefs());return N.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),s(d)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const l=e.getRoom();if(l){const c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),l.off("localTrackPublished",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:r,screenShareTrackRefs:o}}const _l="-",Pv=e=>{const t=Lv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(_l);return a[0]===""&&a.length!==1&&a.shift(),Qh(a,t)||Dv(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Qh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Qh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(_l);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Ru=/^\[(.+)\]$/,Dv=e=>{if(Ru.test(e)){const t=Ru.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lv=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ka(n[i],r,i,t);return r},ka=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Iu(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Fv(i)){ka(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ka(s,Iu(t,o),n,r)})})},Iu=(e,t)=>{let n=e;return t.split(_l).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fv=e=>e.isThemeGetter,jv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Ca="!",_a=":",Bv=_a.length,$v=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let m=0;m<i.length;m++){let g=i[m];if(s===0&&a===0){if(g===_a){o.push(i.slice(l,m)),l=m+Bv;continue}if(g==="/"){c=m;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const u=o.length===0?i:i.substring(l),d=Vv(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+_a,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Vv=e=>e.endsWith(Ca)?e.substring(0,e.length-1):e.startsWith(Ca)?e.substring(1):e,zv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},Uv=e=>({cache:jv(e.cacheSize),parseClassName:$v(e),sortModifiers:zv(e),...Pv(e)}),Hv=/\s+/,Wv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Hv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!g,y=r(v?m.substring(0,g):m);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=r(m),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const E=o(f).join(":"),w=p?E+Ca:E,_=w+y;if(s.includes(_))continue;s.push(_);const C=i(y,v);for(let T=0;T<C.length;++T){const R=C[T];s.push(w+R)}l=u+(l.length>0?" "+l:l)}return l};function Gv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jh(t))&&(r&&(r+=" "),r+=n);return r}const Jh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jh(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kv(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Uv(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Wv(l,n);return i(l,u),u}return function(){return o(Gv.apply(null,arguments))}}const yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qv=/^\d+\/\d+$/,Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>qv.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),ws=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),mn=e=>Yv.test(e),ew=()=>!0,tw=e=>Zv.test(e)&&!Xv.test(e),np=()=>!1,nw=e=>Qv.test(e),rw=e=>Jv.test(e),iw=e=>!fe(e)&&!he(e),ow=e=>Dr(e,op,np),fe=e=>ep.test(e),zn=e=>Dr(e,sp,tw),Es=e=>Dr(e,uw,Ie),Ou=e=>Dr(e,rp,np),sw=e=>Dr(e,ip,rw),ji=e=>Dr(e,ap,nw),he=e=>tp.test(e),zr=e=>Lr(e,sp),aw=e=>Lr(e,dw),Pu=e=>Lr(e,rp),lw=e=>Lr(e,op),cw=e=>Lr(e,ip),Bi=e=>Lr(e,ap,!0),Dr=(e,t,n)=>{const r=ep.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lr=(e,t,n=!1)=>{const r=tp.exec(e);return r?r[1]?t(r[1]):n:!1},rp=e=>e==="position"||e==="percentage",ip=e=>e==="image"||e==="url",op=e=>e==="length"||e==="size"||e==="bg-size",sp=e=>e==="length",uw=e=>e==="number",dw=e=>e==="family-name",ap=e=>e==="shadow",fw=()=>{const e=yt("color"),t=yt("font"),n=yt("text"),r=yt("font-weight"),i=yt("tracking"),o=yt("leading"),s=yt("breakpoint"),a=yt("container"),l=yt("spacing"),c=yt("radius"),u=yt("shadow"),d=yt("inset-shadow"),f=yt("text-shadow"),p=yt("drop-shadow"),m=yt("blur"),g=yt("perspective"),v=yt("aspect"),y=yt("ease"),E=yt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),he,fe],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],A=()=>[he,fe,l],I=()=>[or,"full","auto",...A()],b=()=>[Tn,"none","subgrid",he,fe],M=()=>["auto",{span:["full",Tn,he,fe]},Tn,he,fe],O=()=>[Tn,"auto",he,fe],L=()=>["auto","min","max","fr",he,fe],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...A()],te=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],B=()=>[e,he,fe],$=()=>[..._(),Pu,Ou,{position:[he,fe]}],x=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",lw,ow,{size:[he,fe]}],G=()=>[ws,zr,zn],k=()=>["","none","full",c,he,fe],K=()=>["",Ie,zr,zn],Z=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ie,ws,Pu,Ou],Y=()=>["","none",m,he,fe],re=()=>["none",Ie,he,fe],H=()=>["none",Ie,he,fe],Ee=()=>[Ie,he,fe],P=()=>[or,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mn],breakpoint:[mn],color:[ew],container:[mn],"drop-shadow":[mn],ease:["in","out","in-out"],font:[iw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mn],shadow:[mn],spacing:["px",Ie],text:[mn],"text-shadow":[mn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,fe,he,v]}],container:["container"],columns:[{columns:[Ie,fe,he,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",he,fe]}],basis:[{basis:[or,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,or,"auto","initial","none",fe]}],grow:[{grow:["",Ie,he,fe]}],shrink:[{shrink:["",Ie,he,fe]}],order:[{order:[Tn,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],w:[{w:[a,"screen",...te()]}],"min-w":[{"min-w":[a,"screen","none",...te()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,zr,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,Es]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ws,fe]}],"font-family":[{font:[aw,fe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,he,fe]}],"line-clamp":[{"line-clamp":[Ie,"none",he,Es]}],leading:[{leading:[o,...A()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",he,zn]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ie,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:x()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,he,fe],radial:["",he,fe],conic:[Tn,he,fe]},cw,sw]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,he,fe]}],"outline-w":[{outline:["",Ie,zr,zn]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",u,Bi,ji]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",d,Bi,ji]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ie,zn]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",f,Bi,ji]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ie,he,fe]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:x()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:Y()}],brightness:[{brightness:[Ie,he,fe]}],contrast:[{contrast:[Ie,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",p,Bi,ji]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ie,he,fe]}],"hue-rotate":[{"hue-rotate":[Ie,he,fe]}],invert:[{invert:["",Ie,he,fe]}],saturate:[{saturate:[Ie,he,fe]}],sepia:[{sepia:["",Ie,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ie,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",he,fe]}],ease:[{ease:["linear","initial",y,he,fe]}],delay:[{delay:[Ie,he,fe]}],animate:[{animate:["none",E,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,he,fe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ie,zr,zn,Es]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hw=Kv(fw);function Be(...e){return hw(Ha.clsx(e))}function Oo(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function pw(e,t){return e.capabilities[t]===!0}function Po(e){return e.sessionSettings.session_timer||null}function lp(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function cp(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function up(e){return{...e.capabilities}}function dp(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const fp=N.forwardRef(({state:e,audioTrack:t,className:n,theme:r="vox"},i)=>{var c,u,d,f,p;const o=N.useRef(null),[s,a]=N.useState(!1);N.useEffect(()=>{o.current&&(console.log("🔊 AgentTile: Audio element created:",{autoplay:o.current.autoplay,muted:o.current.muted,volume:o.current.volume,readyState:o.current.readyState,paused:o.current.paused}),a(!0))},[t]),N.useEffect(()=>{const m=o.current;if(!m)return;const g=()=>console.log("▶️ AgentTile: Audio started playing"),v=()=>console.log("⏸️ AgentTile: Audio paused"),y=()=>console.log("⏹️ AgentTile: Audio ended"),E=C=>console.error("❌ AgentTile: Audio error:",C),w=()=>console.log("⏳ AgentTile: Audio load started"),_=()=>console.log("✅ AgentTile: Audio can play");return m.addEventListener("play",g),m.addEventListener("pause",v),m.addEventListener("ended",y),m.addEventListener("error",E),m.addEventListener("loadstart",w),m.addEventListener("canplay",_),()=>{m.removeEventListener("play",g),m.removeEventListener("pause",v),m.removeEventListener("ended",y),m.removeEventListener("error",E),m.removeEventListener("loadstart",w),m.removeEventListener("canplay",_)}},[s]),console.log("🎤 AgentTile render:",{state:e,hasAudioTrack:!!t,trackSource:t==null?void 0:t.source,participantId:(c=t==null?void 0:t.participant)==null?void 0:c.identity,publicationMuted:(u=t==null?void 0:t.publication)==null?void 0:u.isMuted,audioElementReady:s,trackMediaStreamTrack:(p=(f=(d=t==null?void 0:t.publication)==null?void 0:d.track)==null?void 0:f.mediaStreamTrack)==null?void 0:p.readyState});const l=N.useMemo(()=>r==="light"?{base:"bg-black/90",highlighted:"bg-black",muted:"bg-black/30"}:{base:"bg-white/90",highlighted:"bg-white",muted:"bg-white/30"},[r]);return h.jsxs("div",{ref:i,className:Be("",n),children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Rt.AudioTrack,{ref:o,trackRef:t,volume:1}),h.jsx(Rt.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Be("flex aspect-video w-40 items-center justify-center gap-1.5"),children:h.jsx("span",{className:Be([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",`data-[lk-highlighted=true]:${l.highlighted}`,`data-[lk-muted=true]:${l.muted}`])})})]}),!t&&h.jsx("div",{className:Be("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1.5",children:Array.from({length:5}).map((m,g)=>h.jsx("span",{className:Be([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",e==="speaking"&&`animate-pulse ${l.highlighted}`,e==="thinking"&&`animate-pulse ${l.muted}`])},g))})})})]})});fp.displayName="AgentTile";const gw=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:Be(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:Be(t),children:h.jsx(Rt.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},mw=D.forwardRef(function({trackRef:t,className:n,...r},i){var o,s;return h.jsx("div",{ref:i,className:Be("bg-muted overflow-hidden rounded-md",n),children:h.jsx(Rt.VideoTrack,{trackRef:t,width:((o=t==null?void 0:t.publication.dimensions)==null?void 0:o.width)??0,height:((s=t==null?void 0:t.publication.dimensions)==null?void 0:s.height)??0,className:Be("h-full w-auto"),...r})})}),Du=Me.create(mw),bw=Me.create(fp),yw=Me.create(gw),bn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},sr={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function xw(e,t){const{localParticipant:n}=Rv(t),r=n==null?void 0:n.getTrackPublication(e);return N.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function vw({chatOpen:e,client:t,theme:n="vox"}){const{agent:{isActive:r=!1}={},session:i,state:o="idle",audioTrack:s,videoTrack:a}=t?Cl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null};console.log("🎨 MediaTiles render:",{chatOpen:e,isAgentActive:r,hasSession:!!i,sessionState:i==null?void 0:i.state,agentState:o,hasAudioTrack:!!s,hasVideoTrack:!!a});const[l]=Rt.useTracks([le.Track.Source.ScreenShare]),c=xw(le.Track.Source.Camera,t),u=c&&!c.publication.isMuted,d=l&&!l.publication.isMuted,f=u||d,p=r||i&&i.state==="active",m={...bn.transition,delay:e?0:.15},g={...bn.animate,scale:e?1:3,transition:m},v={...bn.animate,transition:m},y=m,E=m,w=a&&a.publication&&a.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:Be(sr.grid),children:[p&&h.jsx("div",{className:Be(["grid",!e&&sr.agentChatClosed,e&&f&&sr.agentChatOpenWithSecondTile,e&&!f&&sr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!w&&h.jsx(bw,{layoutId:"agent",...bn,animate:g,transition:y,state:o,audioTrack:s||void 0,theme:n,className:Be(e?"h-[90px]":"h-auto w-full")},"agent"),w&&a&&h.jsx(yw,{layoutId:"avatar",...bn,animate:v,transition:E,videoTrack:a,className:Be(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:Be(["grid",e&&sr.secondTileChatOpen,!e&&sr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&u&&h.jsx(Du,{layout:"position",layoutId:"camera",...bn,trackRef:c,transition:{...bn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),d&&h.jsx(Du,{layout:"position",layoutId:"screen",...bn,trackRef:l,transition:{...bn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const ww={card:"text-gray-100 bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] border border-gray-800/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-black/90 via-black/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(75,85,99,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-gray-500/[0.12] via-gray-600/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-gray-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-100 font-semibold",secondary:"text-gray-200",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-300 via-gray-200 to-gray-300"},micButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 text-gray-100 font-bold hover:bg-gray-900 hover:border-gray-600 hover:scale-[1.02] hover:shadow-2xl hover:shadow-gray-600/30 focus:outline-none focus:ring-2 focus:ring-gray-600 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-gray-900/60 backdrop-blur-xl rounded-2xl text-center text-gray-200 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-700/50 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-gray-400 rounded-full animate-pulse shadow-lg shadow-gray-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-800/50 rounded-3xl py-4 flex flex-col justify-end h-full bg-black/90 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-black/90 backdrop-blur-xl border-gray-800/50 shadow-xl",textarea:"bg-black/80 border border-gray-800/50 rounded-xl text-gray-100 placeholder-gray-500 font-medium px-4 py-3",sendButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 disabled:border-gray-800 disabled:opacity-40 text-gray-100 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-gray-600/30",attachButton:"text-gray-400 hover:text-gray-200 hover:bg-gray-700/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/40 hover:border-red-500/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-gray-800/70 text-gray-100 backdrop-blur-md shadow-lg border border-gray-700/50",other:"bg-gray-900/60 text-gray-100 border border-gray-700/50 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-gray-900/80 border-gray-700/50 backdrop-blur-xl shadow-xl",backButton:"text-gray-300 hover:text-gray-100 hover:bg-gray-700/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-900/70 text-gray-200 border-gray-700/50 backdrop-blur-md hover:bg-gray-800/80 hover:border-gray-600 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] text-gray-100",header:"border-gray-700/50 bg-gray-900/80 backdrop-blur-xl shadow-xl",headerButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-gray-900 via-gray-900/90 to-gray-900/60 backdrop-blur-xl border-t border-gray-700/50 shadow-2xl",controlEnabled:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 hover:shadow-xl hover:shadow-gray-600/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-900/50 hover:bg-gray-900/60 text-gray-500 border border-gray-800 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/50 hover:border-red-500/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-gray-900/70 border border-gray-700/50 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-900/60 text-gray-300",avatar:"bg-gray-800/80 text-gray-300 border-2 border-gray-700/50",nameOverlay:"bg-gradient-to-t from-gray-900 via-gray-900/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Ew={card:"text-gray-900 bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] border-[3px] border-indigo-200/60 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl shadow-indigo-200/30",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#FFFFFF]/90 via-[#FFFFFF]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(129,140,248,0.12),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 right-0 w-64 h-64 bg-gradient-to-br from-indigo-300/40 via-purple-300/25 to-transparent rounded-full blur-3xl animate-pulse-slow",cardPinkBlur:"absolute bottom-0 left-0 w-56 h-56 bg-gradient-to-tr from-blue-300/35 via-purple-200/20 to-transparent rounded-full blur-3xl",cardPulse1:"absolute top-4 right-4 w-8 h-8 bg-gradient-to-br from-indigo-400/30 to-purple-400/30 rounded-full blur-md opacity-60 animate-pulse",cardPulse2:"absolute bottom-6 left-6 w-6 h-6 bg-gradient-to-br from-blue-400/25 to-purple-400/25 rounded-full blur-md opacity-50 animate-pulse",main:"w-full flex flex-col items-center justify-center bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-900 font-semibold",secondary:"text-gray-700",muted:"text-gray-500",accent:"text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 via-purple-600 to-blue-600"},micButton:"relative w-20 h-20 backdrop-blur-xl border-2 border-indigo-400/40 rounded-3xl flex items-center justify-center hover:from-indigo-700 hover:to-purple-700 hover:border-indigo-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-indigo-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",chatButton:"relative w-20 h-20 bg-gradient-to-br from-blue-600 to-cyan-600 backdrop-blur-xl border-2 border-blue-400/40 rounded-3xl flex items-center justify-center hover:from-blue-700 hover:to-cyan-700 hover:border-blue-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-blue-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",videoButton:"relative w-20 h-20 bg-gradient-to-br from-purple-600 to-pink-600 backdrop-blur-xl border-2 border-purple-400/40 rounded-3xl flex items-center justify-center hover:from-purple-700 hover:to-pink-700 hover:border-purple-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",popupTrigger:"bg-gradient-to-r from-indigo-600 to-purple-600 backdrop-blur-xl border-2 border-indigo-400/40 text-white font-bold hover:from-indigo-700 hover:to-purple-700 hover:border-indigo-500/60 hover:scale-[1.02] hover:shadow-2xl hover:shadow-indigo-500/40 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-white transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/80 backdrop-blur-xl rounded-2xl text-center text-gray-700 text-sm font-medium transition-all duration-700 ease-in-out border border-indigo-100 shadow-lg shadow-indigo-100/20",statusIndicator:"w-2.5 h-2.5 bg-emerald-500 rounded-full animate-pulse shadow-lg shadow-emerald-500/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-indigo-100 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-white/80 backdrop-blur-xl border-indigo-100 shadow-xl",textarea:"bg-white/90 border border-indigo-100 rounded-xl text-gray-900 placeholder-gray-400 font-medium px-4 py-3 focus:border-indigo-300 focus:ring-2 focus:ring-indigo-200",sendButton:"bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 border-2 border-transparent disabled:from-gray-300 disabled:to-gray-300 disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-lg hover:shadow-indigo-500/40",attachButton:"text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-indigo-100/70 text-gray-900 backdrop-blur-md shadow-lg border border-indigo-200/50",other:"bg-white/80 text-gray-900 border border-gray-200 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-white/80 border-indigo-100 backdrop-blur-xl shadow-xl",backButton:"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-indigo-600 mb-2",suggestedResponse:{container:"bg-white/80 text-indigo-700 border-indigo-100 backdrop-blur-md hover:bg-indigo-50 hover:border-indigo-200 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] text-gray-900",header:"border-indigo-100 bg-white/80 backdrop-blur-xl shadow-xl",headerButton:"bg-white/90 hover:bg-indigo-50 border-2 border-indigo-100 hover:border-indigo-200 text-gray-900 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-500 animate-pulse shadow-lg shadow-emerald-500/60",controlsBackground:"bg-gradient-to-t from-white via-white/90 to-white/60 backdrop-blur-xl border-t border-indigo-100 shadow-2xl",controlEnabled:"bg-white/90 hover:bg-indigo-50 border-2 border-indigo-100 hover:border-indigo-200 text-gray-900 hover:scale-105 hover:shadow-xl hover:shadow-indigo-200/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-100/50 hover:bg-gray-100/60 text-gray-400 border border-gray-200 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-white/80 border border-indigo-100 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-indigo-100/80 text-indigo-700 border-2 border-indigo-200",nameOverlay:"bg-gradient-to-t from-white via-white/80 to-transparent text-gray-900 backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Sw={card:"text-white bg-gradient-to-b from-[#0a0a0a] via-[#000000] to-[#0a0a0a] border border-gray-800/30 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-[0_8px_32px_rgba(0,0,0,0.9),0_0_0_1px_rgba(255,255,255,0.08)_inset]",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-32 z-10 bg-gradient-to-b from-black/95 via-black/30 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,_rgba(255,255,255,0.03),transparent_60%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[400px] h-[200px] bg-gradient-to-b from-white/[0.03] via-white/[0.015] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[300px] h-[150px] bg-gradient-to-t from-white/[0.02] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-black p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-200 via-white to-gray-200"},micButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",popupTrigger:"bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] text-white font-bold hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.02] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] focus:outline-none focus:ring-2 focus:ring-white/30 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/[0.06] backdrop-blur-md rounded-xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-white/[0.12] ",statusIndicator:"w-2 h-2 bg-emerald-400 rounded-full animate-pulse shadow-[0_0_8px_rgba(52,211,153,0.6)]",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-white/[0.12] rounded-2xl py-4 flex flex-col justify-end h-full bg-black/90 backdrop-blur-md shadow-[0_4px_24px_rgba(0,0,0,0.6)]",chatInput:{container:"bg-black/90 backdrop-blur-md border-white/[0.12] shadow-[0_4px_16px_rgba(0,0,0,0.4)]",textarea:"bg-white/[0.08] border border-white/[0.12] rounded-xl text-white placeholder-gray-500 font-medium px-4 py-3 focus:border-white/[0.2] focus:ring-1 focus:ring-white/[0.15] transition-all",sendButton:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] disabled:border-white/[0.08] disabled:opacity-40 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-[0_4px_16px_rgba(255,255,255,0.12)]",attachButton:"text-gray-400 hover:text-white hover:bg-white/[0.08] transition-all duration-300 rounded-lg",endButton:"bg-red-500/90 hover:bg-red-500 border border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-[0_4px_16px_rgba(239,68,68,0.3)]"},chatMessage:{own:"bg-white/[0.10] text-white backdrop-blur-sm shadow-md border border-white/[0.15]",other:"bg-white/[0.06] text-white border border-white/[0.10] backdrop-blur-sm shadow-md"},chatHeader:{container:"bg-black/90 border-white/[0.12] backdrop-blur-md shadow-lg",backButton:"text-gray-400 hover:text-white hover:bg-white/[0.08] transition-all duration-300 rounded-lg"},spinner:"w-10 h-10 animate-spin text-white mb-2",suggestedResponse:{container:"bg-white/[0.08] text-white border-white/[0.15] backdrop-blur-sm hover:bg-white/[0.12] hover:border-white/[0.25] transition-all duration-300 shadow-md"},video:{container:"bg-black text-white",header:"border-white/[0.12] bg-black/90 backdrop-blur-md shadow-lg",headerButton:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] text-white hover:scale-[1.02] transition-all duration-300 rounded-lg shadow-md",statusDot:"bg-emerald-400 animate-pulse shadow-[0_0_8px_rgba(52,211,153,0.6)]",controlsBackground:"bg-gradient-to-t from-black via-black/95 to-black/70 backdrop-blur-md border-t border-white/[0.12] shadow-[0_-4px_24px_rgba(0,0,0,0.6)]",controlEnabled:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] text-white hover:scale-[1.02] hover:shadow-md hover:shadow-white/10 transition-all duration-300 font-semibold",controlDisabled:"bg-white/[0.04] hover:bg-white/[0.06] text-gray-500 border border-white/[0.08] transition-all duration-300",endCall:"bg-red-500/90 hover:bg-red-500 border border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-red-500/30",tile:"bg-white/[0.08] border border-white/[0.12] shadow-lg backdrop-blur-sm rounded-xl",placeholder:"bg-white/[0.06] text-gray-400",avatar:"bg-white/[0.10] text-gray-300 border border-white/[0.12]",nameOverlay:"bg-gradient-to-t from-black via-black/85 to-transparent text-white backdrop-blur-sm font-semibold",mutedIndicator:"bg-red-500 text-white shadow-md shadow-red-500/30 font-semibold"}},kw={card:"text-white bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] border border-[#2a3142]/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#0b1220]/90 via-[#0b1220]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(34,211,238,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-cyan-500/[0.12] via-sky-500/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-cyan-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-300 via-sky-300 to-cyan-300"},micButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-sky-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-sky-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-sky-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 text-white font-bold hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-cyan-500/30 focus:outline-none focus:ring-2 focus:ring-cyan-400/50 focus:ring-offset-2 focus:ring-offset-[#161a25] transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-[#1c2230]/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-[#2a3142]/80 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-[#2a3142]/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-[#161a25]/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-[#1c2230]/80 backdrop-blur-xl border-[#2a3142]/80 shadow-xl",textarea:"bg-[#1c2230]/60 border border-[#2a3142]/50 rounded-xl text-white placeholder-gray-400 font-medium px-4 py-3",sendButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 disabled:border-[#2a3142] disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-cyan-500/30",attachButton:"text-gray-400 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-[#243049]/70 text-white backdrop-blur-md shadow-lg border border-[#2a3142]/80",other:"bg-[#1c2230]/60 text-white border border-[#2a3142]/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-[#1c2230]/80 border-[#2a3142]/80 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-cyan-400 mb-2",suggestedResponse:{container:"bg-[#1c2230]/70 text-white border-[#2a3142]/80 backdrop-blur-md hover:bg-[#1c2230]/80 hover:border-cyan-400/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] text-white",header:"border-[#2a3142]/80 bg-[#1c2230]/80 backdrop-blur-xl shadow-xl",headerButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-[#161a25] via-[#161a25]/90 to-[#161a25]/60 backdrop-blur-xl border-t border-[#2a3142]/80 shadow-2xl",controlEnabled:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-cyan-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-[#1c2230]/50 hover:bg-[#1c2230]/60 text-white/40 border border-[#2a3142] transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-[#1c2230]/70 border border-[#2a3142]/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-[#1c2230]/60 text-white/80",avatar:"bg-[#171b26]/80 text-white border-2 border-[#2a3142]/80",nameOverlay:"bg-gradient-to-t from-[#161a25] via-[#161a25]/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Cw={card:" text-white bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col justify-between overflow-hidden relative",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"bg-clip-text text-transparent bg-gradient-to-r from-[#3B82F6] via-[#8B5CF6] to-[#EC4899]"},micButton:"relative w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"relative w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"relative w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full bg-[#1E1E2E] shadow-2xl",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Lu={dark:ww,light:Ew,vox:Sw,midnight:kw,levish:Cw};function Pt(e){return Lu[e]||Lu.vox}function Fu({timeout:e}){const[t,n]=N.useState(100),r=N.useRef(null),i=N.useRef(null);return N.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(Me.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function fi({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=D.useState(()=>Date.now()),s=()=>e.component?D.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Tr,{children:h.jsxs(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Fu,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:h.jsx(ot.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Tr,{children:h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Fu,{timeout:e.timeout}),s()]})})})}}function hi({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=N.useState(e),[a,l]=N.useState(!1);N.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),N.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(ot.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:dp(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}function Do({modality:e,theme:t,disabled:n=!1,showMicrophone:r=!1,microphoneEnabled:i=!0,microphoneLoading:o=!1,onToggleMicrophone:s,showCamera:a=!1,cameraEnabled:l=!0,cameraLoading:c=!1,onToggleCamera:u,showScreenShare:d=!1,screenShareEnabled:f=!1,screenShareLoading:p=!1,onToggleScreenShare:m,showChatToggle:g=!1,chatOpen:v=!1,onToggleChat:y,showTextInput:E=!1,textInputPlaceholder:w="Type a message...",onSendText:_,onSendAttachments:C,supportsAttachments:T=!1,showEndCall:R=!0,onEndCall:A}){var $;const I=Pt(t),[b,M]=N.useState(""),O=N.useRef(null),L=()=>{const x=b.trim();x&&_&&(_(x),M(""))},j=x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),L())},W=x=>{const z=Array.from(x.target.files||[]);z.length>0&&C&&C(z),O.current&&(O.current.value="")},oe=Be("flex items-center gap-3 px-3 py-2 w-full backdrop-blur-xl ",E?"justify-between":"justify-center",t==="light"?"bg-white/95 border-gray-200":""),te=(x,z)=>{var G,k,K;return z==="end-call"?Be("p-3 rounded-full transition-all duration-200",((G=I.video)==null?void 0:G.endCall)||"bg-red-500 text-white hover:bg-red-600",n?"opacity-50 cursor-not-allowed":"hover:scale-105"):Be("p-3 rounded-full transition-all duration-200",x?((k=I.video)==null?void 0:k.controlEnabled)||"bg-green-500 text-white":((K=I.video)==null?void 0:K.controlDisabled)||"bg-gray-500 text-white",n?"opacity-50 cursor-not-allowed":"hover:scale-105")},B=()=>h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"});return h.jsxs("div",{className:oe,children:[E&&h.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[T&&C&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>{var x;return(x=O.current)==null?void 0:x.click()},disabled:n,className:Be("p-2 rounded-full transition-all duration-200",t==="light"?"hover:bg-gray-100":"hover:bg-gray-800",n&&"opacity-50 cursor-not-allowed"),title:"Attach files",children:h.jsx(ot.Paperclip,{className:"w-5 h-5"})}),h.jsx("input",{ref:O,type:"file",multiple:!0,accept:"image/*",onChange:W,className:"hidden"})]}),h.jsx("input",{type:"text",value:b,onChange:x=>M(x.target.value),onKeyDown:j,disabled:n,placeholder:w,className:Be("flex-1 px-4 py-2 rounded-full border outline-none transition-all",t==="light"?"bg-gray-100 border-gray-300 focus:border-blue-500 text-gray-900":"bg-gray-800 border-gray-700 focus:border-blue-400 text-white",n&&"opacity-50 cursor-not-allowed")}),h.jsx("button",{onClick:L,disabled:n||!b.trim(),className:Be("p-2 rounded-full transition-all duration-200",b.trim()?(($=I.video)==null?void 0:$.controlEnabled)||"bg-blue-500 text-white hover:bg-blue-600":t==="light"?"bg-gray-200 text-gray-400":"bg-gray-700 text-gray-500",n&&"opacity-50 cursor-not-allowed",b.trim()&&!n&&"hover:scale-105"),title:"Send message",children:h.jsx(ot.SendHorizontal,{className:"w-5 h-5"})})]}),!E&&h.jsxs(h.Fragment,{children:[r&&s&&h.jsx("button",{onClick:s,disabled:n||o,className:te(i),title:i?"Mute microphone":"Unmute microphone",children:o?h.jsx(B,{}):i?h.jsx(ot.Mic,{className:"w-5 h-5"}):h.jsx(ot.MicOff,{className:"w-5 h-5"})}),a&&u&&h.jsx("button",{onClick:u,disabled:n||c,className:te(l),title:l?"Turn off camera":"Turn on camera",children:c?h.jsx(B,{}):l?h.jsx(ot.Camera,{className:"w-5 h-5"}):h.jsx(ot.CameraOff,{className:"w-5 h-5"})}),d&&m&&h.jsx("button",{onClick:m,disabled:n||p,className:te(f),title:f?"Stop screen share":"Share screen",children:p?h.jsx(B,{}):h.jsx(ot.Monitor,{className:"w-5 h-5"})}),g&&y&&h.jsx("button",{onClick:y,disabled:n,className:te(v),title:e==="voice"?v?"Hide transcription":"Show transcription":v?"Hide chat":"Show chat",children:h.jsx(ot.MessageCircle,{className:"w-5 h-5"})})]}),R&&A&&h.jsx("button",{onClick:A,disabled:n,className:te(!1,"end-call"),title:"End call",children:h.jsx(ot.PhoneOff,{className:"w-5 h-5"})})]})}Do.displayName="UnifiedControlBar";const _w=({logLevel:e}={})=>{const t=Rt.useRoomContext();D.useEffect(()=>(le.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},hp=D.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return D.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&D.createElement("title",null,n),a,l.get(o))});hp.displayName="SSRBase";const Tw=new Map([["bold",D.createElement(D.Fragment,null,D.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",D.createElement(D.Fragment,null,D.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),D.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",D.createElement(D.Fragment,null,D.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",D.createElement(D.Fragment,null,D.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",D.createElement(D.Fragment,null,D.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",D.createElement(D.Fragment,null,D.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),yo=D.forwardRef((e,t)=>D.createElement(hp,{ref:t,...e,weights:Tw}));yo.displayName="SpinnerIcon";function Nw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=D.useState(""),[s,a]=D.useState(0);return D.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),D.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(Me.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:l*.2,ease:"easeInOut"}},l))})]})}function Aw(e,t){return e.startsWith("image/")?ot.Image:e.startsWith("video/")?ot.Video:e.startsWith("audio/")?ot.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?ot.Archive:ot.FileText}function Mw(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function Rw({message:e,theme:t,isOwn:n}){const r=Pt(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,m=Aw(a),g=l||c,v=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[E,w]=D.useState(null);D.useEffect(()=>{if(f)w(f);else if(p&&a.startsWith("image/")){const R=URL.createObjectURL(p);return w(R),()=>URL.revokeObjectURL(R)}else w(null)},[f,p,a]);const _=()=>{if(f){const R=document.createElement("a");R.href=f,R.download=o,R.click()}},T=a.startsWith("image/")&&E;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[T&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:E,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:_}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
|
|
9
|
+
`),()=>{g.contains(m)&&g.removeChild(m)}},[t]),h.jsx(Y0,{isPresent:t,childRef:o,sizeRef:s,children:D.cloneElement(e,{ref:o})})}const X0=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:a,root:l})=>{const c=Ga(Q0),u=N.useId();let d=!0,f=N.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const m of c.values())if(!m)return;r&&r()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,r]);return o&&d&&(f={...f}),N.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),D.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=h.jsx(Z0,{isPresent:n,anchorX:a,root:l,children:e})),h.jsx(Ao.Provider,{value:f,children:e})};function Q0(){return new Map}function dh(e=!0){const t=N.useContext(Ao);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,o=N.useId();N.useEffect(()=>{if(e)return i(o)},[e]);const s=N.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const Li=e=>e.key||"";function jc(e){const t=[];return N.Children.forEach(e,n=>{N.isValidElement(n)&&t.push(n)}),t}const Tr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:o="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=dh(s),d=N.useMemo(()=>jc(e),[e]),f=s&&!c?[]:d.map(Li),p=N.useRef(!0),m=N.useRef(d),g=Ga(()=>new Map),[v,y]=N.useState(d),[E,w]=N.useState(d);vf(()=>{p.current=!1,m.current=d;for(let T=0;T<E.length;T++){const R=Li(E[T]);f.includes(R)?g.delete(R):g.get(R)!==!0&&g.set(R,!1)}},[E,f.length,f.join("-")]);const _=[];if(d!==v){let T=[...d];for(let R=0;R<E.length;R++){const A=E[R],I=Li(A);f.includes(I)||(T.splice(R,0,A),_.push(A))}return o==="wait"&&_.length&&(T=_),w(jc(T)),y(d),null}process.env.NODE_ENV!=="production"&&o==="wait"&&E.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=N.useContext(Wa);return h.jsx(h.Fragment,{children:E.map(T=>{const R=Li(T),A=s&&!c?!1:d===E||f.includes(R),I=()=>{if(g.has(R))g.set(R,!0);else return;let b=!0;g.forEach(M=>{M||(b=!1)}),b&&(C==null||C(),w(m.current),s&&(u==null||u()),r&&r())};return h.jsx(X0,{isPresent:A,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:o,root:l,onExitComplete:A?void 0:I,anchorX:a,children:T},R)})})},fh=N.createContext({strict:!1}),Bc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Nr={};for(const e in Bc)Nr[e]={isEnabled:t=>Bc[e].some(n=>!!t[n])};function J0(e){for(const t in e)Nr[t]={...Nr[t],...e[t]}}const ey=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function mo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ey.has(e)}let hh=e=>!mo(e);function ty(e){typeof e=="function"&&(hh=t=>t.startsWith("on")?!mo(t):e(t))}try{ty(require("@emotion/is-prop-valid").default)}catch{}function ny(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(hh(i)||n===!0&&mo(i)||!t&&!mo(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const Mo=N.createContext({});function Ro(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const ml=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bl=["initial",...ml];function Io(e){return Ro(e.animate)||bl.some(t=>ci(e[t]))}function ph(e){return!!(Io(e)||e.variants)}function ry(e,t){if(Io(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function iy(e){const{initial:t,animate:n}=ry(e,N.useContext(Mo));return N.useMemo(()=>({initial:t,animate:n}),[$c(t),$c(n)])}function $c(e){return Array.isArray(e)?e.join(" "):e}const ui={};function oy(e){for(const t in e)ui[t]=e[t],tl(t)&&(ui[t].isCSSVariable=!0)}function gh(e,{layout:t,layoutId:n}){return Pr.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ui[e]||e==="opacity")}const sy={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ay=Or.length;function ly(e,t,n){let r="",i=!0;for(let o=0;o<ay;o++){const s=Or[o],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=oh(a,fl[s]);if(!l){i=!1;const u=sy[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function yl(e,t,n){const{style:r,vars:i,transformOrigin:o}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Pr.has(l)){s=!0;continue}else if(tl(l)){i[l]=c;continue}else{const u=oh(c,fl[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=ly(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const xl=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mh(e,t,n){for(const r in t)!_t(t[r])&&!gh(r,n)&&(e[r]=t[r])}function cy({transformTemplate:e},t){return N.useMemo(()=>{const n=xl();return yl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uy(e,t){const n=e.style||{},r={};return mh(r,n,e),Object.assign(r,cy(e,t)),r}function dy(e,t){const n={},r=uy(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const fy={offset:"stroke-dashoffset",array:"stroke-dasharray"},hy={offset:"strokeDashoffset",array:"strokeDasharray"};function py(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?fy:hy;e[o.offset]=_e.transform(-r);const s=_e.transform(t),a=_e.transform(n);e[o.array]=`${s} ${a}`}function bh(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:o=1,pathOffset:s=0,...a},l,c,u){if(yl(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&py(d,i,o,s,!1)}const yh=()=>({...xl(),attrs:{}}),xh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gy(e,t,n,r){const i=N.useMemo(()=>{const o=yh();return bh(o,t,xh(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};mh(o,e.style,e),i.style={...o,...i.style}}return i}const my=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vl(e){return typeof e!="string"||e.includes("-")?!1:!!(my.indexOf(e)>-1||/[A-Z]/u.test(e))}function by(e,t,n,{latestValues:r},i,o=!1){const a=(vl(e)?gy:dy)(t,r,i,e),l=ny(t,typeof e=="string",o),c=e!==N.Fragment?{...l,...a,ref:n}:{},{children:u}=t,d=N.useMemo(()=>_t(u)?u.get():u,[u]);return N.createElement(e,{...c,children:d})}function Vc(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function wl(e,t,n,r){if(typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Vc(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function ro(e){return _t(e)?e.get():e}function yy({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:xy(n,r,i,e),renderState:t()}}function xy(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ro(o[f]);let{initial:s,animate:a}=e;const l=Io(e),c=ph(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const d=u?a:s;if(d&&typeof d!="boolean"&&!Ro(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=wl(e,f[p]);if(m){const{transitionEnd:g,transition:v,...y}=m;for(const E in y){let w=y[E];if(Array.isArray(w)){const _=u?w.length-1:0;w=w[_]}w!==null&&(i[E]=w)}for(const E in g)i[E]=g[E]}}}return i}const vh=e=>(t,n)=>{const r=N.useContext(Mo),i=N.useContext(Ao),o=()=>yy(e,t,r,i);return n?o():Ga(o)};function El(e,t,n){var o;const{style:r}=e,i={};for(const s in r)(_t(r[s])||t.style&&_t(t.style[s])||gh(s,e)||((o=n==null?void 0:n.getValue(s))==null?void 0:o.liveStyle)!==void 0)&&(i[s]=r[s]);return i}const vy=vh({scrapeMotionValuesFromProps:El,createRenderState:xl});function wh(e,t,n){const r=El(e,t,n);for(const i in e)if(_t(e[i])||_t(t[i])){const o=Or.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}const wy=vh({scrapeMotionValuesFromProps:wh,createRenderState:yh}),Ey=Symbol.for("motionComponentSymbol");function xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sy(e,t,n){return N.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xr(n)&&(n.current=r))},[t])}const Sl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ky="framerAppearId",Eh="data-"+Sl(ky),Sh=N.createContext({});function Cy(e,t,n,r,i){var g,v;const{visualElement:o}=N.useContext(Mo),s=N.useContext(fh),a=N.useContext(Ao),l=N.useContext(gl).reducedMotion,c=N.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,d=N.useContext(Sh);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&_y(c.current,n,i,d);const f=N.useRef(!1);N.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const p=n[Eh],m=N.useRef(!!p&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,p))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,p)));return vf(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),m.current&&u.animationState&&u.animationState.animateChanges())}),N.useEffect(()=>{u&&(!m.current&&u.animationState&&u.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),m.current=!1),u.enteringChildren=void 0)}),u}function _y(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:kh(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&xr(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function kh(e){if(e)return e.options.allowProjection!==!1?e.projection:kh(e.parent)}function fs(e,{forwardMotionProps:t=!1}={},n,r){n&&J0(n);const i=vl(e)?wy:vy;function o(a,l){let c;const u={...N.useContext(gl),...a,layoutId:Ty(a)},{isStatic:d}=u,f=iy(a),p=i(a,d);if(!d&&Ka){Ny(u,n);const m=Ay(u);c=m.MeasureLayout,f.visualElement=Cy(e,p,u,r,m.ProjectionNode)}return h.jsxs(Mo.Provider,{value:f,children:[c&&f.visualElement?h.jsx(c,{visualElement:f.visualElement,...u}):null,by(e,a,Sy(p,f.visualElement,l),p,d,t)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=N.forwardRef(o);return s[Ey]=e,s}function Ty({layoutId:e}){const t=N.useContext(Wa).id;return t&&e!==void 0?t+"-"+e:e}function Ny(e,t){const n=N.useContext(fh).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Rr(!1,r,"lazy-strict-mode"):wn(!1,r,"lazy-strict-mode")}}function Ay(e){const{drag:t,layout:n}=Nr;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function My(e,t){if(typeof Proxy>"u")return fs;const n=new Map,r=(o,s)=>fs(o,s,e,t),i=(o,s)=>(process.env.NODE_ENV!=="production"&&Qa(!1,"motion() is deprecated. Use motion.create() instead."),r(o,s));return new Proxy(i,{get:(o,s)=>s==="create"?r:(n.has(s)||n.set(s,fs(s,void 0,e,t)),n.get(s))})}function Ch({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ry({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Iy(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function hs(e){return e===void 0||e===1}function ma({scale:e,scaleX:t,scaleY:n}){return!hs(e)||!hs(t)||!hs(n)}function Hn(e){return ma(e)||_h(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function _h(e){return zc(e.x)||zc(e.y)}function zc(e){return e&&e!=="0%"}function bo(e,t,n){const r=e-n,i=t*r;return n+i}function Uc(e,t,n,r,i){return i!==void 0&&(e=bo(e,i,r)),bo(e,n,r)+t}function ba(e,t=0,n=1,r,i){e.min=Uc(e.min,t,n,r,i),e.max=Uc(e.max,t,n,r,i)}function Th(e,{x:t,y:n}){ba(e.x,t.translate,t.scale,t.originPoint),ba(e.y,n.translate,n.scale,n.originPoint)}const Hc=.999999999999,Wc=1.0000000000001;function Oy(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&wr(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Th(e,s)),r&&Hn(o.latestValues)&&wr(e,o.latestValues))}t.x<Wc&&t.x>Hc&&(t.x=1),t.y<Wc&&t.y>Hc&&(t.y=1)}function vr(e,t){e.min=e.min+t,e.max=e.max+t}function Gc(e,t,n,r,i=.5){const o=st(e.min,e.max,i);ba(e,t,n,o,r)}function wr(e,t){Gc(e.x,t.x,t.scaleX,t.scale,t.originX),Gc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Nh(e,t){return Ch(Iy(e.getBoundingClientRect(),t))}function Py(e,t,n){const r=Nh(e,n),{scroll:i}=t;return i&&(vr(r.x,i.offset.x),vr(r.y,i.offset.y)),r}const Kc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Er=()=>({x:Kc(),y:Kc()}),qc=()=>({min:0,max:0}),dt=()=>({x:qc(),y:qc()}),ya={current:null},Ah={current:!1};function Dy(){if(Ah.current=!0,!!Ka)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ya.current=e.matches;e.addEventListener("change",t),t()}else ya.current=!1}const Ly=new WeakMap;function Fy(e,t,n){for(const r in t){const i=t[r],o=n[r];if(_t(i))e.addValue(r,i);else if(_t(o))e.addValue(r,_r(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,_r(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Yc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jy{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ul,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ft.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Io(n),this.isVariantNode=ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&_t(p)&&p.set(l[f])}}mount(t){var n;this.current=t,Ly.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),Ah.current||Dy(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ya.current,process.env.NODE_ENV!=="production"&&Qa(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),In(this.notifyUpdate),In(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Pr.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&rt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Nr){const n=Nr[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Yc.length;r++){const i=Yc[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,s=t[o];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=Fy(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=_r(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wf(r)||Sf(r))?r=parseFloat(r):!q0(r)&&On.test(n)&&(r=ih(t,n)),this.setBaseTarget(t,_t(r)?r.get():r)),_t(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=wl(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!_t(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Xa),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){hl.render(this.render)}}class Mh extends jy{constructor(){super(...arguments),this.KeyframeResolver=L0}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_t(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Rh(e,{style:t,vars:n},r,i){const o=e.style;let s;for(s in t)o[s]=t[s];i==null||i.applyProjectionStyles(o,r);for(s in n)o.setProperty(s,n[s])}function By(e){return window.getComputedStyle(e)}class $y extends Mh{constructor(){super(...arguments),this.type="html",this.renderInstance=Rh}readValueFromInstance(t,n){var r;if(Pr.has(n))return(r=this.projection)!=null&&r.isProjecting?ca(n):e0(t,n);{const i=By(t),o=(tl(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nh(t,n)}build(t,n,r){yl(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return El(t,n,r)}}const Ih=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Vy(e,t,n,r){Rh(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Ih.has(i)?i:Sl(i),t.attrs[i])}class zy extends Mh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Pr.has(n)){const r=rh(n);return r&&r.default||0}return n=Ih.has(n)?n:Sl(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wh(t,n,r)}build(t,n,r){bh(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){Vy(t,n,r,i)}mount(t){this.isSVGTag=xh(t.tagName),super.mount(t)}}const Uy=(e,t)=>vl(e)?new zy(t):new $y(t,{allowProjection:e!==N.Fragment});function Sr(e,t,n){const r=e.getProps();return wl(r,t,n!==void 0?n:r.custom,e)}const xa=e=>Array.isArray(e);function Hy(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,_r(n))}function Wy(e){return xa(e)?e[e.length-1]||0:e}function Gy(e,t){const n=Sr(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=Wy(o[s]);Hy(e,s,a)}}function Ky(e){return!!(_t(e)&&e.add)}function va(e,t){const n=e.getValue("willChange");if(Ky(n))return n.add(t);if(!n&&En.WillChange){const r=new En.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Oh(e){return e.props[Eh]}const qy=e=>e!==null;function Yy(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(qy),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[o]}const Zy={type:"spring",stiffness:500,damping:25,restSpeed:10},Xy=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Qy={type:"keyframes",duration:.8},Jy={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(e,{keyframes:t})=>t.length>2?Qy:Pr.has(e)?e.startsWith("scale")?Xy(t[1]):Zy:Jy;function tx({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kl=(e,t,n,r={},i,o)=>s=>{const a=dl(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};tx(a)||Object.assign(u,ex(e,u)),u.duration&&(u.duration=tn(u.duration)),u.repeatDelay&&(u.repeatDelay=tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pa(u),u.delay===0&&(d=!0)),(En.instantAnimations||En.skipAnimations)&&(d=!0,pa(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!o&&t.get()!==void 0){const f=Yy(u.keyframes,a);if(f!==void 0){rt.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new cl(u):new S0(u)};function nx({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ph(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(o=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||c&&nx(c,u))continue;const p={delay:n,...dl(o||{},u)},m=d.get();if(m!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===m&&!p.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const y=Oh(e);if(y){const E=window.MotionHandoffAnimation(y,u,rt);E!==null&&(p.startTime=E,g=!0)}}va(e,u),d.start(kl(u,d,f,e.shouldReduceMotion&&eh.has(u)?{type:!1}:p,e,g));const v=d.animation;v&&l.push(v)}return s&&Promise.all(l).then(()=>{rt.update(()=>{s&&Gy(e,s)})}),l}function Dh(e,t,n,r=0,i=1){const o=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(o,s):i===1?o*r:a-o*r}function wa(e,t,n={}){var l;const r=Sr(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Ph(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return rx(e,t,c,u,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function rx(e,t,n=0,r=0,i=0,o=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(wa(l,t,{...s,delay:n+(typeof r=="function"?0:r)+Dh(e.variantChildren,l,r,i,o)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ix(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>wa(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=wa(e,t,n);else{const i=typeof t=="function"?Sr(e,t,n.custom):t;r=Promise.all(Ph(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Lh(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const ox=bl.length;function Fh(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Fh(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<ox;n++){const r=bl[n],i=e.props[r];(ci(i)||i===!1)&&(t[r]=i)}return t}const sx=[...ml].reverse(),ax=ml.length;function lx(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ix(e,n,r)))}function cx(e){let t=lx(e),n=Zc(),r=!0;const i=l=>(c,u)=>{var f;const d=Sr(e,u,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:p,transitionEnd:m,...g}=d;c={...c,...g,...m}}return c};function o(l){t=l(e)}function s(l){const{props:c}=e,u=Fh(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let v=0;v<ax;v++){const y=sx[v],E=n[y],w=c[y]!==void 0?c[y]:u[y],_=ci(w),C=y===l?E.isActive:null;C===!1&&(m=v);let T=w===u[y]&&w!==c[y]&&_;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),E.protectedKeys={...p},!E.isActive&&C===null||!w&&!E.prevProp||Ro(w)||typeof w=="boolean")continue;const R=ux(E.prevProp,w);let A=R||y===l&&E.isActive&&!T&&_||v>m&&_,I=!1;const b=Array.isArray(w)?w:[w];let M=b.reduce(i(y),{});C===!1&&(M={});const{prevResolvedValues:O={}}=E,L={...O,...M},j=te=>{A=!0,f.has(te)&&(I=!0,f.delete(te)),E.needsAnimating[te]=!0;const B=e.getValue(te);B&&(B.liveStyle=!1)};for(const te in L){const B=M[te],$=O[te];if(p.hasOwnProperty(te))continue;let x=!1;xa(B)&&xa($)?x=!Lh(B,$):x=B!==$,x?B!=null?j(te):f.add(te):B!==void 0&&f.has(te)?j(te):E.protectedKeys[te]=!0}E.prevProp=w,E.prevResolvedValues=M,E.isActive&&(p={...p,...M}),r&&e.blockInitialAnimation&&(A=!1);const W=T&&R;A&&(!W||I)&&d.push(...b.map(te=>{const B={type:y};if(typeof te=="string"&&r&&!W&&e.manuallyAnimateOnMount&&e.parent){const{parent:$}=e,x=Sr($,te);if($.enteringChildren&&x){const{delayChildren:z}=x.transition||{};B.delay=Dh($.enteringChildren,e,z)}}return{animation:te,options:B}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const y=Sr(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(v.transition=y.transition)}f.forEach(y=>{const E=e.getBaseTarget(y),w=e.getValue(y);w&&(w.liveStyle=!0),v[y]=E??null}),d.push({animation:v})}let g=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),r=!1,g?t(d):Promise.resolve()}function a(l,c){var d;if(n[l].isActive===c)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,c)}),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Zc(),r=!0}}}function ux(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Lh(t,e):!1}function Vn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zc(){return{animate:Vn(!0),whileInView:Vn(),whileHover:Vn(),whileTap:Vn(),whileDrag:Vn(),whileFocus:Vn(),exit:Vn()}}class Ln{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dx extends Ln{constructor(t){super(t),t.animationState||(t.animationState=cx(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ro(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let fx=0;class hx extends Ln{constructor(){super(...arguments),this.id=fx++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const px={animation:{Feature:dx},exit:{Feature:hx}};function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vi(e){return{point:{x:e.pageX,y:e.pageY}}}const gx=e=>t=>pl(t)&&e(t,vi(t));function Jr(e,t,n,r){return di(e,t,gx(n),r)}const jh=1e-4,mx=1-jh,bx=1+jh,Bh=.01,yx=0-Bh,xx=0+Bh;function Ot(e){return e.max-e.min}function vx(e,t,n){return Math.abs(e-t)<=n}function Xc(e,t,n,r=.5){e.origin=r,e.originPoint=st(t.min,t.max,e.origin),e.scale=Ot(n)/Ot(t),e.translate=st(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mx&&e.scale<=bx||isNaN(e.scale))&&(e.scale=1),(e.translate>=yx&&e.translate<=xx||isNaN(e.translate))&&(e.translate=0)}function ei(e,t,n,r){Xc(e.x,t.x,n.x,r?r.originX:void 0),Xc(e.y,t.y,n.y,r?r.originY:void 0)}function Qc(e,t,n){e.min=n.min+t.min,e.max=e.min+Ot(t)}function wx(e,t,n){Qc(e.x,t.x,n.x),Qc(e.y,t.y,n.y)}function Jc(e,t,n){e.min=t.min-n.min,e.max=e.min+Ot(t)}function ti(e,t,n){Jc(e.x,t.x,n.x),Jc(e.y,t.y,n.y)}function Kt(e){return[e("x"),e("y")]}const $h=({current:e})=>e?e.ownerDocument.defaultView:null,eu=(e,t)=>Math.abs(e-t);function Ex(e,t){const n=eu(e.x,t.x),r=eu(e.y,t.y);return Math.sqrt(n**2+r**2)}class Vh{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=gs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Ex(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=f,{timestamp:v}=kt;this.history.push({...g,timestamp:v});const{onStart:y,onMove:E}=this.handlers;p||(y&&y(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ps(p,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=gs(f.type==="pointercancel"?this.lastMoveEventInfo:ps(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,y),g&&g(f,y)},!pl(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=i||window;const a=vi(t),l=ps(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=kt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,gs(l,this.history)),this.removeListeners=bi(Jr(this.contextWindow,"pointermove",this.handlePointerMove),Jr(this.contextWindow,"pointerup",this.handlePointerUp),Jr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),In(this.updatePoint)}}function ps(e,t){return t?{point:t(e.point)}:e}function tu(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gs({point:e},t){return{point:e,delta:tu(e,zh(t)),offset:tu(e,Sx(t)),velocity:kx(t,.1)}}function Sx(e){return e[0]}function zh(e){return e[e.length-1]}function kx(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=zh(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>tn(t)));)n--;if(!r)return{x:0,y:0};const o=un(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Cx(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?st(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?st(n,e,r.max):Math.min(e,n)),e}function nu(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function _x(e,{top:t,left:n,bottom:r,right:i}){return{x:nu(e.x,n,i),y:nu(e.y,t,r)}}function ru(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tx(e,t){return{x:ru(e.x,t.x),y:ru(e.y,t.y)}}function Nx(e,t){let n=.5;const r=Ot(e),i=Ot(t);return i>r?n=si(t.min,t.max-r,e.min):r>i&&(n=si(e.min,e.max-i,t.min)),vn(0,1,n)}function Ax(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ea=.35;function Mx(e=Ea){return e===!1?e=0:e===!0&&(e=Ea),{x:iu(e,"left","right"),y:iu(e,"top","bottom")}}function iu(e,t,n){return{min:ou(e,t),max:ou(e,n)}}function ou(e,t){return typeof e=="number"?e:e[t]||0}const Rx=new WeakMap;class Ix{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vi(d).point)},s=(d,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$0(p),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Kt(y=>{let E=this.getAxisMotionValue(y).get()||0;if(dn.test(E)){const{projection:w}=this.visualElement;if(w&&w.layout){const _=w.layout.layoutBox[y];_&&(E=Ot(_)*(parseFloat(E)/100))}}this.originPoint[y]=E}),g&&rt.postRender(()=>g(d,f)),va(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:y}=f;if(m&&this.currentDirection===null){this.currentDirection=Ox(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),v&&v(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>Kt(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Vh(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:$h(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!r)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&rt.postRender(()=>a(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Fi(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=Cx(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;t&&xr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=_x(r.layoutBox,t):this.constraints=!1,this.elastic=Mx(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Kt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Ax(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xr(t))return!1;const r=t.current;wn(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Py(r,i.root,this.visualElement.getTransformPagePoint());let s=Tx(i.layout.layoutBox,o);if(n){const a=n(Ry(s));this.hasMutatedConstraints=!!a,a&&(s=Ch(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Kt(u=>{if(!Fi(u,n,this.currentDirection))return;let d=l&&l[u]||{};s&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return va(this.visualElement,t),r.start(kl(t,r,0,n,this.visualElement,!1))}stopAnimation(){Kt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Kt(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Kt(n=>{const{drag:r}=this.getProps();if(!Fi(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-st(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xr(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Kt(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();i[s]=Nx({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Kt(s=>{if(!Fi(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(st(l,c,i[s]))})}addListeners(){if(!this.visualElement.current)return;Rx.set(this.visualElement,this);const t=this.visualElement.current,n=Jr(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();xr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rt.read(r);const s=di(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Kt(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Ea,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function Fi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Ox(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Px extends Ln{constructor(t){super(t),this.removeGroupControls=Zt,this.removeListeners=Zt,this.controls=new Ix(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Zt}unmount(){this.removeGroupControls(),this.removeListeners()}}const su=e=>(t,n)=>{e&&rt.postRender(()=>e(t,n))};class Dx extends Ln{constructor(){super(...arguments),this.removePointerDownListener=Zt}onPointerDown(t){this.session=new Vh(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$h(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:su(t),onStart:su(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&rt.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Jr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const io={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function au(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=au(e,t.target.x),r=au(e,t.target.y);return`${n}% ${r}%`}},Lx={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=On.parse(e);if(i.length>5)return r;const o=On.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const c=st(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=c),typeof i[3+s]=="number"&&(i[3+s]/=c),o(i)}};let ms=!1;class Fx extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;oy(jx),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),ms&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),io.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,{projection:s}=r;return s&&(s.isPresent=o,ms=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),hl.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;ms=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uh(e){const[t,n]=dh(),r=N.useContext(Wa);return h.jsx(Fx,{...e,layoutGroup:r,switchLayoutGroup:N.useContext(Sh),isPresent:t,safeToRemove:n})}const jx={borderRadius:{...Vr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vr,borderTopRightRadius:Vr,borderBottomLeftRadius:Vr,borderBottomRightRadius:Vr,boxShadow:Lx};function Bx(e,t,n){const r=_t(e)?e:_r(e);return r.start(kl("",r,t,n)),r.animation}const $x=(e,t)=>e.depth-t.depth;class Vx{constructor(){this.children=[],this.isDirty=!1}add(t){qa(this.children,t),this.isDirty=!0}remove(t){Ya(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($x),this.isDirty=!1,this.children.forEach(t)}}function zx(e,t){const n=Ft.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(In(r),e(o-t))};return rt.setup(r,!0),()=>In(r)}const Hh=["TopLeft","TopRight","BottomLeft","BottomRight"],Ux=Hh.length,lu=e=>typeof e=="string"?parseFloat(e):e,cu=e=>typeof e=="number"||_e.test(e);function Hx(e,t,n,r,i,o){i?(e.opacity=st(0,n.opacity??1,Wx(r)),e.opacityExit=st(t.opacity??1,0,Gx(r))):o&&(e.opacity=st(t.opacity??1,n.opacity??1,r));for(let s=0;s<Ux;s++){const a=`border${Hh[s]}Radius`;let l=uu(t,a),c=uu(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||cu(l)===cu(c)?(e[a]=Math.max(st(lu(l),lu(c),r),0),(dn.test(c)||dn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=st(t.rotate||0,n.rotate||0,r))}function uu(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Wx=Wh(0,.5,Rf),Gx=Wh(.5,.95,Zt);function Wh(e,t,n){return r=>r<e?0:r>t?1:n(si(e,t,r))}function du(e,t){e.min=t.min,e.max=t.max}function Gt(e,t){du(e.x,t.x),du(e.y,t.y)}function fu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function hu(e,t,n,r,i){return e-=t,e=bo(e,1/n,r),i!==void 0&&(e=bo(e,1/i,r)),e}function Kx(e,t=0,n=1,r=.5,i,o=e,s=e){if(dn.test(t)&&(t=parseFloat(t),t=st(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=st(o.min,o.max,r);e===o&&(a-=t),e.min=hu(e.min,t,n,a,i),e.max=hu(e.max,t,n,a,i)}function pu(e,t,[n,r,i],o,s){Kx(e,t[n],t[r],t[i],t.scale,o,s)}const qx=["x","scaleX","originX"],Yx=["y","scaleY","originY"];function gu(e,t,n,r){pu(e.x,t,qx,n?n.x:void 0,r?r.x:void 0),pu(e.y,t,Yx,n?n.y:void 0,r?r.y:void 0)}function mu(e){return e.translate===0&&e.scale===1}function Gh(e){return mu(e.x)&&mu(e.y)}function bu(e,t){return e.min===t.min&&e.max===t.max}function Zx(e,t){return bu(e.x,t.x)&&bu(e.y,t.y)}function yu(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Kh(e,t){return yu(e.x,t.x)&&yu(e.y,t.y)}function xu(e){return Ot(e.x)/Ot(e.y)}function vu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Xx{constructor(){this.members=[]}add(t){qa(this.members,t),t.scheduleRender()}remove(t){if(Ya(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Qx(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const bs=["","X","Y","Z"],Jx=1e3;let ev=0;function ys(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qh(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Oh(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qh(r)}function Yh({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=ev++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rv),this.nodes.forEach(av),this.nodes.forEach(lv),this.nodes.forEach(iv)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vx)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Xa),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=uh(s)&&!G0(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{d=window.innerWidth}),e(s,()=>{const p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,u&&u(),u=zx(f,250),io.hasAnimatedSinceResize&&(io.hasAnimatedSinceResize=!1,this.nodes.forEach(Su)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||hv,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=c.getProps(),y=!this.targetLayout||!Kh(this.targetLayout,p),E=!d&&f;if(this.options.layoutRoot||this.resumeFrom||E||d&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...dl(m,"layout"),onPlay:g,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(u,E)}else d||Su(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),In(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cv),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wu);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Eu);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sv),this.nodes.forEach(tv),this.nodes.forEach(nv)):this.nodes.forEach(Eu),this.clearAllSnapshots();const a=Ft.now();kt.delta=vn(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,ss.update.process(kt),ss.preRender.process(kt),ss.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ov),this.sharedNodes.forEach(uv)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ot(this.snapshot.measuredBox.x)&&!Ot(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=dt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gh(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||Hn(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),pv(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:s}=this.options;if(!s)return dt();const a=s.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(gv))){const{scroll:u}=this.root;u&&(vr(a.x,u.offset.x),vr(a.y,u.offset.y))}return a}removeElementScroll(s){var l;const a=dt();if(Gt(a,s),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Gt(a,s),vr(a.x,d.offset.x),vr(a.y,d.offset.y))}return a}applyTransform(s,a=!1){const l=dt();Gt(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&wr(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Hn(u.latestValues)&&wr(l,u.latestValues)}return Hn(this.latestValues)&&wr(l,this.latestValues),l}removeTransform(s){const a=dt();Gt(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Hn(c.latestValues))continue;ma(c.latestValues)&&c.updateSnapshot();const u=dt(),d=c.measurePageBox();Gt(u,d),gu(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Hn(this.latestValues)&&gu(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==kt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!(!this.layout||!(u||d))){if(this.resolvedRelativeTargetAt=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),ti(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dt(),this.targetWithTransforms=dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wx(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Gt(this.target,this.layout.layoutBox),Th(this.target,this.targetDelta)):Gt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),ti(this.relativeTargetOrigin,this.target,p.target),Gt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ma(this.parent.latestValues)||_h(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var m;const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===kt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;Gt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Oy(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=dt());const{target:p}=s;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fu(this.prevProjectionDelta.x,this.projectionDelta.x),fu(this.prevProjectionDelta.y,this.projectionDelta.y)),ei(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!vu(this.projectionDelta.x,this.prevProjectionDelta.x)||!vu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),s){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Er(),this.projectionDelta=Er(),this.projectionDeltaWithTransform=Er()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=Er();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=dt(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=p!==m,v=this.getStack(),y=!v||v.members.length<=1,E=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(fv));this.animationProgress=0;let w;this.mixTargetDelta=_=>{const C=_/1e3;ku(d.x,s.x,C),ku(d.y,s.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ti(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dv(this.relativeTarget,this.relativeTargetOrigin,f,C),w&&Zx(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=dt()),Gt(w,this.relativeTarget)),g&&(this.animationValues=u,Hx(u,c,this.latestValues,C,E,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(In(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{io.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=_r(0)),this.currentAnimation=Bx(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),s.onUpdate&&s.onUpdate(u)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jx),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Zh(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||dt();const d=Ot(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;const f=Ot(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}Gt(a,l),wr(a,u),ei(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Xx),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&ys("z",s,c,this.animationValues);for(let u=0;u<bs.length;u++)ys(`rotate${bs[u]}`,s,c,this.animationValues),ys(`skew${bs[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=ro(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Hn(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let d=Qx(this.projectionDeltaWithTransform,this.treeScale,u);l&&(d=l(u,d)),s.transform=d;const{x:f,y:p}=this.projectionDelta;s.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in ui){if(u[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:y}=ui[m],E=d==="none"?u[m]:g(u[m],c);if(v){const w=v.length;for(let _=0;_<w;_++)s[v[_]]=E}else y?this.options.visualElement.renderState.vars[m]=E:s[m]=E}this.options.layoutId&&(s.pointerEvents=c===this?ro(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(wu),this.root.sharedNodes.clear()}}}function tv(e){e.updateLayout()}function nv(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Ot(f);f.min=r[d].min,f.max=f.min+p}):Zh(o,t.layoutBox,r)&&Kt(d=>{const f=s?t.measuredBox[d]:t.layoutBox[d],p=Ot(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=Er();ei(a,r,t.layoutBox);const l=Er();s?ei(l,e.applyTransform(i,!0),t.measuredBox):ei(l,r,t.layoutBox);const c=!Gh(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=dt();ti(m,t.layoutBox,f.layoutBox);const g=dt();ti(g,r,p.layoutBox),Kh(m,g)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function rv(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function iv(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ov(e){e.clearSnapshot()}function wu(e){e.clearMeasurements()}function Eu(e){e.isLayoutDirty=!1}function sv(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Su(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function av(e){e.resolveTargetDelta()}function lv(e){e.calcProjection()}function cv(e){e.resetSkewAndRotation()}function uv(e){e.removeLeadSnapshot()}function ku(e,t,n){e.translate=st(t.translate,0,n),e.scale=st(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Cu(e,t,n,r){e.min=st(t.min,n.min,r),e.max=st(t.max,n.max,r)}function dv(e,t,n,r){Cu(e.x,t.x,n.x,r),Cu(e.y,t.y,n.y,r)}function fv(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hv={duration:.45,ease:[.4,0,.1,1]},_u=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Tu=_u("applewebkit/")&&!_u("chrome/")?Math.round:Zt;function Nu(e){e.min=Tu(e.min),e.max=Tu(e.max)}function pv(e){Nu(e.x),Nu(e.y)}function Zh(e,t,n){return e==="position"||e==="preserve-aspect"&&!vx(xu(t),xu(n),.2)}function gv(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const mv=Yh({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xs={current:void 0},Xh=Yh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!xs.current){const e=new mv({});e.mount(window),e.setOptions({layoutScroll:!0}),xs.current=e}return xs.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),bv={pan:{Feature:Dx},drag:{Feature:Px,ProjectionNode:Xh,MeasureLayout:Uh}};function Au(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=r[i];o&&rt.postRender(()=>o(t,vi(t)))}class yv extends Ln{mount(){const{current:t}=this.node;t&&(this.unmount=V0(t,(n,r)=>(Au(this.node,r,"Start"),i=>Au(this.node,i,"End"))))}unmount(){}}class xv extends Ln{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mu(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=r[i];o&&rt.postRender(()=>o(t,vi(t)))}class vv extends Ln{mount(){const{current:t}=this.node;t&&(this.unmount=W0(t,(n,r)=>(Mu(this.node,r,"Start"),(i,{success:o})=>Mu(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Sa=new WeakMap,vs=new WeakMap,wv=e=>{const t=Sa.get(e.target);t&&t(e)},Ev=e=>{e.forEach(wv)};function Sv({root:e,...t}){const n=e||document;vs.has(n)||vs.set(n,{});const r=vs.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ev,{root:e,...t})),r[i]}function kv(e,t,n){const r=Sv(t);return Sa.set(e,n),r.observe(e),()=>{Sa.delete(e),r.unobserve(e)}}const Cv={some:0,all:1};class _v extends Ln{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Cv[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return kv(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tv(t,n))&&this.startObserver()}unmount(){}}function Tv({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Nv={inView:{Feature:_v},tap:{Feature:vv},focus:{Feature:xv},hover:{Feature:yv}},Av={layout:{ProjectionNode:Xh,MeasureLayout:Uh}},Mv={...px,...Nv,...bv,...Av},Me=My(Mv,Uy);function Rv(e){const[t,n]=N.useState(()=>e.getLocalParticipant()),[r,i]=N.useState(()=>e.getMicrophoneTrack());return N.useEffect(()=>{const o=()=>{const a=e.getLocalParticipant(),l=e.getMicrophoneTrack();console.log("🎤 useVoxketLocalParticipant: Updating state:",{hasParticipant:!!a,hasMicTrack:!!l,isMicEnabled:e.isMicrophoneEnabled,trackPublications:a?a.trackPublications.size:0}),n(a),i(l)};o(),e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("track.muted",o),e.on("track.unmuted",o);const s=e.getRoom();if(s){const a=()=>{console.log("🎤 Track published, updating participant state"),o()},l=()=>{console.log("🎤 Track unpublished, updating participant state"),o()};return s.on("localTrackPublished",a),s.on("localTrackUnpublished",l),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o),s.off("localTrackPublished",a),s.off("localTrackUnpublished",l)}}else return()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("track.muted",o),e.off("track.unmuted",o)}},[e]),{localParticipant:t,microphoneTrack:r}}function oo(e,t,n){const[r,i]=N.useState(!1),[o,s]=N.useState(!1);return N.useEffect(()=>{const l=()=>{let c=!1;switch(t){case"microphone":c=e.isMicrophoneEnabled;break;case"camera":c=e.isCameraEnabled;break;case"screenShare":c=e.isScreenShareEnabled;break}console.log(`🎬 useVoxketTrackToggle: ${t} enabled state updated:`,{oldEnabled:r,newEnabled:c,changed:r!==c}),i(c)};return l(),e.on("track.muted",l),e.on("track.unmuted",l),e.on("connection.connected",l),()=>{e.off("track.muted",l),e.off("track.unmuted",l),e.off("connection.connected",l)}},[e,t]),{enabled:r,pending:o,toggle:async l=>{try{s(!0);const c=l!==void 0?l:!r;switch(console.log(`🎬 useVoxketTrackToggle: ${t} toggle called`,{currentEnabled:r,targetEnabled:c,forceEnabled:l}),t){case"microphone":await e.toggleMicrophone(c);break;case"camera":await e.toggleCamera(c);break;case"screenShare":c?(console.log("🎬 useVoxketTrackToggle: Starting screen share"),await e.startScreenShare()):(console.log("🎬 useVoxketTrackToggle: Stopping screen share"),await e.stopScreenShare());break}console.log(`🎬 useVoxketTrackToggle: ${t} toggle completed`)}catch(c){console.error(`🎬 useVoxketTrackToggle: ${t} toggle failed:`,c)}finally{s(!1)}}}}function Iv(e){const[t,n]=N.useState(()=>e.getRoom()),[r,i]=N.useState(()=>e.getConnectionState());return N.useEffect(()=>{const o=()=>{n(e.getRoom()),i(e.getConnectionState())};return e.on("connection.connected",o),e.on("connection.disconnected",o),e.on("connection.connecting",o),()=>{e.off("connection.connected",o),e.off("connection.disconnected",o),e.off("connection.connecting",o)}},[e]),t}function Cl(e){const[t,n]=N.useState(()=>e.getIsAgentConnected()),[r,i]=N.useState(()=>e.getCurrentSession()),[o,s]=N.useState(()=>e.getCurrentAgentInfo()),[a,l]=N.useState(()=>e.getAgentState()),[c,u]=N.useState(()=>e.getAgentAudioTrack()),[d,f]=N.useState(()=>e.getAgentVideoTrack());return N.useEffect(()=>{const p=()=>{const _=e.getIsAgentConnected(),C=e.getCurrentSession(),T=e.getCurrentAgentInfo(),R=e.getAgentState(),A=e.getAgentAudioTrack(),I=e.getAgentVideoTrack();console.log("🤖 useVoxketVoiceAssistant: Updating state:",{isAgentConnected:_,hasSession:!!C,sessionId:C==null?void 0:C.id,sessionState:C==null?void 0:C.state,hasAgentInfo:!!T,agentState:R,hasAudioTrack:!!A,hasVideoTrack:!!I}),n(_),i(C),s(T),l(R),u(A),f(I)};p();const m=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent connected event"),p()},g=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent disconnected event"),p()},v=()=>{console.log("🤖 useVoxketVoiceAssistant: Session changed event"),p()},y=()=>{console.log("🤖 useVoxketVoiceAssistant: Connection changed event"),p()},E=()=>{console.log("🤖 useVoxketVoiceAssistant: Agent state changed event"),p()},w=()=>{console.log("🎵 useVoxketVoiceAssistant: Track subscribed event - updating audio/video tracks"),p()};return e.on("agent.connected",m),e.on("agent.speaking",m),e.on("agent.thinking",m),e.on("agent.state.changed",E),e.on("connection.disconnected",g),e.on("session.created",v),e.on("session.ended",v),e.on("session.state.changed",v),e.on("connection.connected",y),e.on("media.track.subscribed",w),e.on("media.track.unsubscribed",w),()=>{e.off("agent.connected",m),e.off("agent.speaking",m),e.off("agent.thinking",m),e.off("agent.state.changed",E),e.off("connection.disconnected",g),e.off("session.created",v),e.off("session.ended",v),e.off("session.state.changed",v),e.off("connection.connected",y),e.off("media.track.subscribed",w),e.off("media.track.unsubscribed",w)}},[e]),{agent:{isActive:t,info:o},session:r,state:a,audioTrack:c,videoTrack:d}}function Ov(e){const[t,n]=N.useState(()=>e.getVideoTrackRefs()),[r,i]=N.useState(()=>e.getCameraTrackRefs()),[o,s]=N.useState(()=>e.getScreenShareTrackRefs());return N.useEffect(()=>{const a=()=>{const c=e.getVideoTrackRefs(),u=e.getCameraTrackRefs(),d=e.getScreenShareTrackRefs();console.log("📹 useVoxketVideoTracks: Updating tracks:",{videoCount:c.length,cameraCount:u.length,screenShareCount:d.length}),n(c),i(u),s(d)};a(),e.on("connection.connected",a),e.on("connection.disconnected",a),e.on("track.muted",a),e.on("track.unmuted",a),e.on("participant.joined",a),e.on("participant.left",a);const l=e.getRoom();if(l){const c=()=>{console.log("📹 Track event, updating video tracks"),a()};return l.on("localTrackPublished",c),l.on("localTrackUnpublished",c),l.on("trackPublished",c),l.on("trackUnpublished",c),l.on("trackSubscribed",c),l.on("trackUnsubscribed",c),()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a),l.off("localTrackPublished",c),l.off("localTrackUnpublished",c),l.off("trackPublished",c),l.off("trackUnpublished",c),l.off("trackSubscribed",c),l.off("trackUnsubscribed",c)}}else return()=>{e.off("connection.connected",a),e.off("connection.disconnected",a),e.off("track.muted",a),e.off("track.unmuted",a),e.off("participant.joined",a),e.off("participant.left",a)}},[e]),{videoTrackRefs:t,cameraTrackRefs:r,screenShareTrackRefs:o}}const _l="-",Pv=e=>{const t=Lv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(_l);return a[0]===""&&a.length!==1&&a.shift(),Qh(a,t)||Dv(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Qh=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Qh(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(_l);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId},Ru=/^\[(.+)\]$/,Dv=e=>{if(Ru.test(e)){const t=Ru.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lv=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)ka(n[i],r,i,t);return r},ka=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Iu(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Fv(i)){ka(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{ka(s,Iu(t,o),n,r)})})},Iu=(e,t)=>{let n=e;return t.split(_l).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Fv=e=>e.isThemeGetter,jv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},Ca="!",_a=":",Bv=_a.length,$v=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,a=0,l=0,c;for(let m=0;m<i.length;m++){let g=i[m];if(s===0&&a===0){if(g===_a){o.push(i.slice(l,m)),l=m+Bv;continue}if(g==="/"){c=m;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const u=o.length===0?i:i.substring(l),d=Vv(u),f=d!==u,p=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+_a,o=r;r=s=>s.startsWith(i)?o(s.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Vv=e=>e.endsWith(Ca)?e.substring(0,e.length-1):e.startsWith(Ca)?e.substring(1):e,zv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(s=>{s[0]==="["||t[s]?(i.push(...o.sort(),s),o=[]):o.push(s)}),i.push(...o.sort()),i}},Uv=e=>({cache:jv(e.cacheSize),parseClassName:$v(e),sortModifiers:zv(e),...Pv(e)}),Hv=/\s+/,Wv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],a=e.trim().split(Hv);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:g}=n(u);if(d){l=u+(l.length>0?" "+l:l);continue}let v=!!g,y=r(v?m.substring(0,g):m);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=r(m),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const E=o(f).join(":"),w=p?E+Ca:E,_=w+y;if(s.includes(_))continue;s.push(_);const C=i(y,v);for(let T=0;T<C.length;++T){const R=C[T];s.push(w+R)}l=u+(l.length>0?" "+l:l)}return l};function Gv(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Jh(t))&&(r&&(r+=" "),r+=n);return r}const Jh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Jh(e[r]))&&(n&&(n+=" "),n+=t);return n};function Kv(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=Uv(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Wv(l,n);return i(l,u),u}return function(){return o(Gv.apply(null,arguments))}}const yt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qv=/^\d+\/\d+$/,Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Xv=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>qv.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Tn=e=>!!e&&Number.isInteger(Number(e)),ws=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),mn=e=>Yv.test(e),ew=()=>!0,tw=e=>Zv.test(e)&&!Xv.test(e),np=()=>!1,nw=e=>Qv.test(e),rw=e=>Jv.test(e),iw=e=>!fe(e)&&!he(e),ow=e=>Dr(e,op,np),fe=e=>ep.test(e),zn=e=>Dr(e,sp,tw),Es=e=>Dr(e,uw,Ie),Ou=e=>Dr(e,rp,np),sw=e=>Dr(e,ip,rw),ji=e=>Dr(e,ap,nw),he=e=>tp.test(e),zr=e=>Lr(e,sp),aw=e=>Lr(e,dw),Pu=e=>Lr(e,rp),lw=e=>Lr(e,op),cw=e=>Lr(e,ip),Bi=e=>Lr(e,ap,!0),Dr=(e,t,n)=>{const r=ep.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Lr=(e,t,n=!1)=>{const r=tp.exec(e);return r?r[1]?t(r[1]):n:!1},rp=e=>e==="position"||e==="percentage",ip=e=>e==="image"||e==="url",op=e=>e==="length"||e==="size"||e==="bg-size",sp=e=>e==="length",uw=e=>e==="number",dw=e=>e==="family-name",ap=e=>e==="shadow",fw=()=>{const e=yt("color"),t=yt("font"),n=yt("text"),r=yt("font-weight"),i=yt("tracking"),o=yt("leading"),s=yt("breakpoint"),a=yt("container"),l=yt("spacing"),c=yt("radius"),u=yt("shadow"),d=yt("inset-shadow"),f=yt("text-shadow"),p=yt("drop-shadow"),m=yt("blur"),g=yt("perspective"),v=yt("aspect"),y=yt("ease"),E=yt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[..._(),he,fe],T=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],A=()=>[he,fe,l],I=()=>[or,"full","auto",...A()],b=()=>[Tn,"none","subgrid",he,fe],M=()=>["auto",{span:["full",Tn,he,fe]},Tn,he,fe],O=()=>[Tn,"auto",he,fe],L=()=>["auto","min","max","fr",he,fe],j=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],oe=()=>["auto",...A()],te=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],B=()=>[e,he,fe],$=()=>[..._(),Pu,Ou,{position:[he,fe]}],x=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",lw,ow,{size:[he,fe]}],G=()=>[ws,zr,zn],k=()=>["","none","full",c,he,fe],K=()=>["",Ie,zr,zn],Z=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ie,ws,Pu,Ou],Y=()=>["","none",m,he,fe],re=()=>["none",Ie,he,fe],H=()=>["none",Ie,he,fe],Ee=()=>[Ie,he,fe],P=()=>[or,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mn],breakpoint:[mn],color:[ew],container:[mn],"drop-shadow":[mn],ease:["in","out","in-out"],font:[iw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mn],shadow:[mn],spacing:["px",Ie],text:[mn],"text-shadow":[mn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,fe,he,v]}],container:["container"],columns:[{columns:[Ie,fe,he,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Tn,"auto",he,fe]}],basis:[{basis:[or,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,or,"auto","initial","none",fe]}],grow:[{grow:["",Ie,he,fe]}],shrink:[{shrink:["",Ie,he,fe]}],order:[{order:[Tn,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...j(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...j()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":j()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],w:[{w:[a,"screen",...te()]}],"min-w":[{"min-w":[a,"screen","none",...te()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",n,zr,zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,he,Es]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ws,fe]}],"font-family":[{font:[aw,fe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,he,fe]}],"line-clamp":[{"line-clamp":[Ie,"none",he,Es]}],leading:[{leading:[o,...A()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",he,zn]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ie,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:x()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Tn,he,fe],radial:["",he,fe],conic:[Tn,he,fe]},cw,sw]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,he,fe]}],"outline-w":[{outline:["",Ie,zr,zn]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",u,Bi,ji]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",d,Bi,ji]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ie,zn]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",f,Bi,ji]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ie,he,fe]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:x()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:Y()}],brightness:[{brightness:[Ie,he,fe]}],contrast:[{contrast:[Ie,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",p,Bi,ji]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ie,he,fe]}],"hue-rotate":[{"hue-rotate":[Ie,he,fe]}],invert:[{invert:["",Ie,he,fe]}],saturate:[{saturate:[Ie,he,fe]}],sepia:[{sepia:["",Ie,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Ie,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",he,fe]}],ease:[{ease:["linear","initial",y,he,fe]}],delay:[{delay:[Ie,he,fe]}],animate:[{animate:["none",E,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,he,fe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ie,zr,zn,Es]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hw=Kv(fw);function Be(...e){return hw(Ha.clsx(e))}function Oo(e){var i;if(!e)return{sessionSettings:{},capabilities:{},modality:"voice"};const t={session_timer:((i=e.session_settings)==null?void 0:i.session_timer)||null},n=e.capabilities||{},r=e.modality||"voice";return{sessionSettings:t,capabilities:n,modality:r}}function pw(e,t){return e.capabilities[t]===!0}function Po(e){return e.sessionSettings.session_timer||null}function lp(e){const t=e.capabilities;return{userVideoEnabled:t.user_video_enabled!==!1,agentAvatarEnabled:t.agent_avatar_enabled!==!1,screenshareEnabled:t.screenshare_session_enabled!==!1}}function cp(e){const t=e.capabilities;return{suggestedReplyEnabled:t.suggested_reply_enabled!==!1,attachmentsEnabled:t.support_in_chat_attachments!==!1}}function up(e){return{...e.capabilities}}function dp(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}const fp=N.forwardRef(({state:e,audioTrack:t,className:n,theme:r="vox"},i)=>{var c,u,d,f,p;const o=N.useRef(null),[s,a]=N.useState(!1);N.useEffect(()=>{o.current&&(console.log("🔊 AgentTile: Audio element created:",{autoplay:o.current.autoplay,muted:o.current.muted,volume:o.current.volume,readyState:o.current.readyState,paused:o.current.paused}),a(!0))},[t]),N.useEffect(()=>{const m=o.current;if(!m)return;const g=()=>console.log("▶️ AgentTile: Audio started playing"),v=()=>console.log("⏸️ AgentTile: Audio paused"),y=()=>console.log("⏹️ AgentTile: Audio ended"),E=C=>console.error("❌ AgentTile: Audio error:",C),w=()=>console.log("⏳ AgentTile: Audio load started"),_=()=>console.log("✅ AgentTile: Audio can play");return m.addEventListener("play",g),m.addEventListener("pause",v),m.addEventListener("ended",y),m.addEventListener("error",E),m.addEventListener("loadstart",w),m.addEventListener("canplay",_),()=>{m.removeEventListener("play",g),m.removeEventListener("pause",v),m.removeEventListener("ended",y),m.removeEventListener("error",E),m.removeEventListener("loadstart",w),m.removeEventListener("canplay",_)}},[s]),console.log("🎤 AgentTile render:",{state:e,hasAudioTrack:!!t,trackSource:t==null?void 0:t.source,participantId:(c=t==null?void 0:t.participant)==null?void 0:c.identity,publicationMuted:(u=t==null?void 0:t.publication)==null?void 0:u.isMuted,audioElementReady:s,trackMediaStreamTrack:(p=(f=(d=t==null?void 0:t.publication)==null?void 0:d.track)==null?void 0:f.mediaStreamTrack)==null?void 0:p.readyState});const l=N.useMemo(()=>r==="light"?{base:"bg-black/90",highlighted:"bg-black",muted:"bg-black/30"}:{base:"bg-white/90",highlighted:"bg-white",muted:"bg-white/30"},[r]);return h.jsxs("div",{ref:i,className:Be("",n),children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Rt.AudioTrack,{ref:o,trackRef:t,volume:1}),h.jsx(Rt.BarVisualizer,{barCount:5,state:e,options:{minHeight:5},trackRef:t,className:Be("flex aspect-video w-40 items-center justify-center gap-1.5"),children:h.jsx("span",{className:Be([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",`data-[lk-highlighted=true]:${l.highlighted}`,`data-[lk-muted=true]:${l.muted}`])})})]}),!t&&h.jsx("div",{className:Be("flex aspect-video w-40 items-center justify-center"),children:h.jsx("div",{className:"flex flex-col items-center justify-center",children:h.jsx("div",{className:"flex gap-1.5",children:Array.from({length:5}).map((m,g)=>h.jsx("span",{className:Be([`${l.base} min-h-2 w-2 rounded-full`,"origin-center transition-colors duration-250 ease-linear",e==="speaking"&&`animate-pulse ${l.highlighted}`,e==="thinking"&&`animate-pulse ${l.muted}`])},g))})})})]})});fp.displayName="AgentTile";const gw=({videoTrack:e,className:t,ref:n})=>{var r,i;return!e||!e.publication||!e.participant?h.jsx("div",{ref:n,className:Be(t),children:h.jsx("div",{className:"w-full h-full bg-gray-200 rounded-md flex items-center justify-center",children:h.jsx("span",{className:"text-gray-500",children:"No video available"})})}):h.jsx("div",{ref:n,className:Be(t),children:h.jsx(Rt.VideoTrack,{trackRef:e,width:((r=e.publication.dimensions)==null?void 0:r.width)??0,height:((i=e.publication.dimensions)==null?void 0:i.height)??0,className:"rounded-md"})})},mw=D.forwardRef(function({trackRef:t,className:n,...r},i){var o,s;return h.jsx("div",{ref:i,className:Be("bg-muted overflow-hidden rounded-md",n),children:h.jsx(Rt.VideoTrack,{trackRef:t,width:((o=t==null?void 0:t.publication.dimensions)==null?void 0:o.width)??0,height:((s=t==null?void 0:t.publication.dimensions)==null?void 0:s.height)??0,className:Be("h-full w-auto"),...r})})}),Du=Me.create(mw),bw=Me.create(fp),yw=Me.create(gw),bn={initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{type:"spring",stiffness:675,damping:75,mass:1}},sr={grid:["h-full w-full","grid gap-x-2 place-content-center","grid-cols-[1fr_1fr] grid-rows-[90px_1fr_90px]"],agentChatOpenWithSecondTile:["col-start-1 row-start-1","self-center justify-self-end"],agentChatOpenWithoutSecondTile:["col-start-1 row-start-1","col-span-2","place-content-center"],agentChatClosed:["col-start-1 row-start-1","col-span-2","place-content-center"],secondTileChatOpen:["col-start-2 row-start-1","self-center justify-self-start"],secondTileChatClosed:["col-start-2 row-start-3","place-content-end"]};function xw(e,t){const{localParticipant:n}=Rv(t),r=n==null?void 0:n.getTrackPublication(e);return N.useMemo(()=>r&&n?{source:e,participant:n,publication:r}:void 0,[e,r,n])}function vw({chatOpen:e,client:t,theme:n="vox"}){const{agent:{isActive:r=!1}={},session:i,state:o="idle",audioTrack:s,videoTrack:a}=t?Cl(t):{agent:{isActive:!1},session:null,state:"idle",audioTrack:null,videoTrack:null};console.log("🎨 MediaTiles render:",{chatOpen:e,isAgentActive:r,hasSession:!!i,sessionState:i==null?void 0:i.state,agentState:o,hasAudioTrack:!!s,hasVideoTrack:!!a});const[l]=Rt.useTracks([le.Track.Source.ScreenShare]),c=xw(le.Track.Source.Camera,t),u=c&&!c.publication.isMuted,d=l&&!l.publication.isMuted,f=u||d,p=r||i&&i.state==="active",m={...bn.transition,delay:e?0:.15},g={...bn.animate,scale:e?1:3,transition:m},v={...bn.animate,transition:m},y=m,E=m,w=a&&a.publication&&a.participant;return h.jsx("div",{className:"relative w-full h-full z-10 flex items-center justify-center",children:h.jsx("div",{className:"relative w-full h-full max-w-2xl px-4 md:px-0",children:h.jsxs("div",{className:Be(sr.grid),children:[p&&h.jsx("div",{className:Be(["grid",!e&&sr.agentChatClosed,e&&f&&sr.agentChatOpenWithSecondTile,e&&!f&&sr.agentChatOpenWithoutSecondTile]),children:h.jsxs("div",{className:"h-full flex items-center justify-center",children:[!w&&h.jsx(bw,{layoutId:"agent",...bn,animate:g,transition:y,state:o,audioTrack:s||void 0,theme:n,className:Be(e?"h-[90px]":"h-auto w-full")},"agent"),w&&a&&h.jsx(yw,{layoutId:"avatar",...bn,animate:v,transition:E,videoTrack:a,className:Be(e?"h-[90px] [&>video]:h-[90px] [&>video]:w-auto":"h-auto w-full")},"avatar")]})}),h.jsx("div",{className:Be(["grid",e&&sr.secondTileChatOpen,!e&&sr.secondTileChatClosed]),children:h.jsxs("div",{className:"w-full px-10 flex items-center shadow-2xl justify-between",children:[c&&u&&h.jsx(Du,{layout:"position",layoutId:"camera",...bn,trackRef:c,transition:{...bn.transition,delay:e?0:.15},className:"h-[60px] order-1"},"camera"),d&&h.jsx(Du,{layout:"position",layoutId:"screen",...bn,trackRef:l,transition:{...bn.transition,delay:e?0:.15},className:"h-[70px] order-2"},"screen")]})})]})})})}const ww={card:"text-gray-100 bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] border border-gray-800/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-black/90 via-black/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(75,85,99,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-gray-500/[0.12] via-gray-600/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-gray-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-100 font-semibold",secondary:"text-gray-200",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-300 via-gray-200 to-gray-300"},micButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 rounded-3xl flex items-center justify-center hover:bg-gray-900 hover:border-gray-600 hover:scale-105 hover:shadow-2xl hover:shadow-gray-600/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-gray-900/90 backdrop-blur-xl border-2 border-gray-700/50 text-gray-100 font-bold hover:bg-gray-900 hover:border-gray-600 hover:scale-[1.02] hover:shadow-2xl hover:shadow-gray-600/30 focus:outline-none focus:ring-2 focus:ring-gray-600 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-gray-900/60 backdrop-blur-xl rounded-2xl text-center text-gray-200 text-sm font-medium transition-all duration-700 ease-in-out border border-gray-700/50 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-gray-400 rounded-full animate-pulse shadow-lg shadow-gray-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-gray-800/50 rounded-3xl py-4 flex flex-col justify-end h-full bg-black/90 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-black/90 backdrop-blur-xl border-gray-800/50 shadow-xl",textarea:"bg-black/80 border border-gray-800/50 rounded-xl text-gray-100 placeholder-gray-500 font-medium px-4 py-3",sendButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 disabled:border-gray-800 disabled:opacity-40 text-gray-100 font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-gray-600/30",attachButton:"text-gray-400 hover:text-gray-200 hover:bg-gray-700/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/40 hover:border-red-500/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-gray-800/70 text-gray-100 backdrop-blur-md shadow-lg border border-gray-700/50",other:"bg-gray-900/60 text-gray-100 border border-gray-700/50 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-gray-900/80 border-gray-700/50 backdrop-blur-xl shadow-xl",backButton:"text-gray-300 hover:text-gray-100 hover:bg-gray-700/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-gray-400 mb-2",suggestedResponse:{container:"bg-gray-900/70 text-gray-200 border-gray-700/50 backdrop-blur-md hover:bg-gray-800/80 hover:border-gray-600 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0a0a0a] via-[#121212] to-[#0a0a0a] text-gray-100",header:"border-gray-700/50 bg-gray-900/80 backdrop-blur-xl shadow-xl",headerButton:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-gray-900 via-gray-900/90 to-gray-900/60 backdrop-blur-xl border-t border-gray-700/50 shadow-2xl",controlEnabled:"bg-gray-900/90 hover:bg-gray-900 border-2 border-gray-700/50 hover:border-gray-600 text-gray-100 hover:scale-105 hover:shadow-xl hover:shadow-gray-600/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-900/50 hover:bg-gray-900/60 text-gray-500 border border-gray-800 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-500/50 hover:border-red-500/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-gray-900/70 border border-gray-700/50 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-900/60 text-gray-300",avatar:"bg-gray-800/80 text-gray-300 border-2 border-gray-700/50",nameOverlay:"bg-gradient-to-t from-gray-900 via-gray-900/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Ew={card:"text-gray-900 bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] border-[3px] border-indigo-200/60 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl shadow-indigo-200/30",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#FFFFFF]/90 via-[#FFFFFF]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(129,140,248,0.12),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 right-0 w-64 h-64 bg-gradient-to-br from-indigo-300/40 via-purple-300/25 to-transparent rounded-full blur-3xl animate-pulse-slow",cardPinkBlur:"absolute bottom-0 left-0 w-56 h-56 bg-gradient-to-tr from-blue-300/35 via-purple-200/20 to-transparent rounded-full blur-3xl",cardPulse1:"absolute top-4 right-4 w-8 h-8 bg-gradient-to-br from-indigo-400/30 to-purple-400/30 rounded-full blur-md opacity-60 animate-pulse",cardPulse2:"absolute bottom-6 left-6 w-6 h-6 bg-gradient-to-br from-blue-400/25 to-purple-400/25 rounded-full blur-md opacity-50 animate-pulse",main:"w-full flex flex-col items-center justify-center bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-gray-900 font-semibold",secondary:"text-gray-700",muted:"text-gray-500",accent:"text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 via-purple-600 to-blue-600"},micButton:"relative w-20 h-20 backdrop-blur-xl border-2 border-indigo-400/40 rounded-3xl flex items-center justify-center hover:from-indigo-700 hover:to-purple-700 hover:border-indigo-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-indigo-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",chatButton:"relative w-20 h-20 bg-gradient-to-br from-blue-600 to-cyan-600 backdrop-blur-xl border-2 border-blue-400/40 rounded-3xl flex items-center justify-center hover:from-blue-700 hover:to-cyan-700 hover:border-blue-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-blue-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",videoButton:"relative w-20 h-20 bg-gradient-to-br from-purple-600 to-pink-600 backdrop-blur-xl border-2 border-purple-400/40 rounded-3xl flex items-center justify-center hover:from-purple-700 hover:to-pink-700 hover:border-purple-500/60 hover:scale-105 hover:shadow-2xl hover:shadow-purple-500/40 transition-all duration-500 ease-out group overflow-hidden text-white",popupTrigger:"bg-gradient-to-r from-indigo-600 to-purple-600 backdrop-blur-xl border-2 border-indigo-400/40 text-white font-bold hover:from-indigo-700 hover:to-purple-700 hover:border-indigo-500/60 hover:scale-[1.02] hover:shadow-2xl hover:shadow-indigo-500/40 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:ring-offset-white transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/80 backdrop-blur-xl rounded-2xl text-center text-gray-700 text-sm font-medium transition-all duration-700 ease-in-out border border-indigo-100 shadow-lg shadow-indigo-100/20",statusIndicator:"w-2.5 h-2.5 bg-emerald-500 rounded-full animate-pulse shadow-lg shadow-emerald-500/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-indigo-100 rounded-3xl py-4 flex flex-col justify-end h-full bg-white/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-white/80 backdrop-blur-xl border-indigo-100 shadow-xl",textarea:"bg-white/90 border border-indigo-100 rounded-xl text-gray-900 placeholder-gray-400 font-medium px-4 py-3 focus:border-indigo-300 focus:ring-2 focus:ring-indigo-200",sendButton:"bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 border-2 border-transparent disabled:from-gray-300 disabled:to-gray-300 disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-lg hover:shadow-indigo-500/40",attachButton:"text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-indigo-100/70 text-gray-900 backdrop-blur-md shadow-lg border border-indigo-200/50",other:"bg-white/80 text-gray-900 border border-gray-200 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-white/80 border-indigo-100 backdrop-blur-xl shadow-xl",backButton:"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-indigo-600 mb-2",suggestedResponse:{container:"bg-white/80 text-indigo-700 border-indigo-100 backdrop-blur-md hover:bg-indigo-50 hover:border-indigo-200 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#F8F9FC] via-[#FFFFFF] to-[#F8F9FC] text-gray-900",header:"border-indigo-100 bg-white/80 backdrop-blur-xl shadow-xl",headerButton:"bg-white/90 hover:bg-indigo-50 border-2 border-indigo-100 hover:border-indigo-200 text-gray-900 hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-500 animate-pulse shadow-lg shadow-emerald-500/60",controlsBackground:"bg-gradient-to-t from-white via-white/90 to-white/60 backdrop-blur-xl border-t border-indigo-100 shadow-2xl",controlEnabled:"bg-white/90 hover:bg-indigo-50 border-2 border-indigo-100 hover:border-indigo-200 text-gray-900 hover:scale-105 hover:shadow-xl hover:shadow-indigo-200/30 transition-all duration-300 font-semibold",controlDisabled:"bg-gray-100/50 hover:bg-gray-100/60 text-gray-400 border border-gray-200 transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-white/80 border border-indigo-100 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-gray-50 text-gray-600",avatar:"bg-indigo-100/80 text-indigo-700 border-2 border-indigo-200",nameOverlay:"bg-gradient-to-t from-white via-white/80 to-transparent text-gray-900 backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Sw={card:"text-white bg-gradient-to-b from-[#0a0a0a] via-[#000000] to-[#0a0a0a] border border-gray-800/30 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-[0_8px_32px_rgba(0,0,0,0.9),0_0_0_1px_rgba(255,255,255,0.08)_inset]",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-32 z-10 bg-gradient-to-b from-black/95 via-black/30 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,_rgba(255,255,255,0.03),transparent_60%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[400px] h-[200px] bg-gradient-to-b from-white/[0.03] via-white/[0.015] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[300px] h-[150px] bg-gradient-to-t from-white/[0.02] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-black p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-gray-400",accent:"text-transparent bg-clip-text bg-gradient-to-r from-gray-200 via-white to-gray-200"},micButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] rounded-2xl flex items-center justify-center hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.03] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] transition-all duration-300 ease-out group overflow-hidden",popupTrigger:"bg-white/[0.10] backdrop-blur-sm border border-white/[0.2] text-white font-bold hover:bg-white/[0.15] hover:border-white/[0.35] hover:scale-[1.02] hover:shadow-[0_8px_24px_rgba(255,255,255,0.15)] focus:outline-none focus:ring-2 focus:ring-white/30 focus:ring-offset-2 focus:ring-offset-black transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-white/[0.06] backdrop-blur-md rounded-xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-white/[0.12] ",statusIndicator:"w-2 h-2 bg-emerald-400 rounded-full animate-pulse shadow-[0_0_8px_rgba(52,211,153,0.6)]",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-white/[0.12] rounded-2xl py-4 flex flex-col justify-end h-full bg-black/90 backdrop-blur-md shadow-[0_4px_24px_rgba(0,0,0,0.6)]",chatInput:{container:"bg-black/90 backdrop-blur-md border-white/[0.12] shadow-[0_4px_16px_rgba(0,0,0,0.4)]",textarea:"bg-white/[0.08] border border-white/[0.12] rounded-xl text-white placeholder-gray-500 font-medium px-4 py-3 focus:border-white/[0.2] focus:ring-1 focus:ring-white/[0.15] transition-all",sendButton:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] disabled:border-white/[0.08] disabled:opacity-40 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-[0_4px_16px_rgba(255,255,255,0.12)]",attachButton:"text-gray-400 hover:text-white hover:bg-white/[0.08] transition-all duration-300 rounded-lg",endButton:"bg-red-500/90 hover:bg-red-500 border border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-[0_4px_16px_rgba(239,68,68,0.3)]"},chatMessage:{own:"bg-white/[0.10] text-white backdrop-blur-sm shadow-md border border-white/[0.15]",other:"bg-white/[0.06] text-white border border-white/[0.10] backdrop-blur-sm shadow-md"},chatHeader:{container:"bg-black/90 border-white/[0.12] backdrop-blur-md shadow-lg",backButton:"text-gray-400 hover:text-white hover:bg-white/[0.08] transition-all duration-300 rounded-lg"},spinner:"w-10 h-10 animate-spin text-white mb-2",suggestedResponse:{container:"bg-white/[0.08] text-white border-white/[0.15] backdrop-blur-sm hover:bg-white/[0.12] hover:border-white/[0.25] transition-all duration-300 shadow-md"},video:{container:"bg-black text-white",header:"border-white/[0.12] bg-black/90 backdrop-blur-md shadow-lg",headerButton:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] text-white hover:scale-[1.02] transition-all duration-300 rounded-lg shadow-md",statusDot:"bg-emerald-400 animate-pulse shadow-[0_0_8px_rgba(52,211,153,0.6)]",controlsBackground:"bg-gradient-to-t from-black via-black/95 to-black/70 backdrop-blur-md border-t border-white/[0.12] shadow-[0_-4px_24px_rgba(0,0,0,0.6)]",controlEnabled:"bg-white/[0.12] hover:bg-white/[0.18] border border-white/[0.2] hover:border-white/[0.35] text-white hover:scale-[1.02] hover:shadow-md hover:shadow-white/10 transition-all duration-300 font-semibold",controlDisabled:"bg-white/[0.04] hover:bg-white/[0.06] text-gray-500 border border-white/[0.08] transition-all duration-300",endCall:"bg-red-500/90 hover:bg-red-500 border border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-[1.02] transition-all duration-300 shadow-md hover:shadow-red-500/30",tile:"bg-white/[0.08] border border-white/[0.12] shadow-lg backdrop-blur-sm rounded-xl",placeholder:"bg-white/[0.06] text-gray-400",avatar:"bg-white/[0.10] text-gray-300 border border-white/[0.12]",nameOverlay:"bg-gradient-to-t from-black via-black/85 to-transparent text-white backdrop-blur-sm font-semibold",mutedIndicator:"bg-red-500 text-white shadow-md shadow-red-500/30 font-semibold"}},kw={card:"text-white bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] border border-[#2a3142]/50 w-full h-full flex flex-col justify-between overflow-hidden relative shadow-2xl",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-40 z-10 bg-gradient-to-b from-[#0b1220]/90 via-[#0b1220]/40 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(circle_at_50%_-20%,_rgba(34,211,238,0.08),transparent_50%)] opacity-100",cardPurpleBlur:"absolute top-0 left-1/2 -translate-x-1/2 w-[600px] h-[300px] bg-gradient-to-b from-cyan-500/[0.12] via-sky-500/[0.06] to-transparent blur-3xl",cardPinkBlur:"absolute bottom-0 left-1/2 -translate-x-1/2 w-[500px] h-[250px] bg-gradient-to-t from-cyan-600/[0.08] via-transparent to-transparent blur-3xl",cardPulse1:"hidden",cardPulse2:"hidden",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] shadow-2xl p-0 overflow-hidden h-full relative",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-300 via-sky-300 to-cyan-300"},micButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",chatButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-sky-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-sky-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-sky-500/30 transition-all duration-500 ease-out group overflow-hidden",videoButton:"relative w-20 h-20 bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 rounded-3xl flex items-center justify-center hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-105 hover:shadow-2xl hover:shadow-cyan-500/30 transition-all duration-500 ease-out group overflow-hidden",popupTrigger:"bg-[#171b26]/90 backdrop-blur-xl border-2 border-cyan-500/30 text-white font-bold hover:bg-[#171b26] hover:border-cyan-400/50 hover:scale-[1.02] hover:shadow-2xl hover:shadow-cyan-500/30 focus:outline-none focus:ring-2 focus:ring-cyan-400/50 focus:ring-offset-2 focus:ring-offset-[#161a25] transition-all duration-300",promptSlider:"absolute w-full py-4 px-6 bg-[#1c2230]/60 backdrop-blur-xl rounded-2xl text-center text-white/90 text-sm font-medium transition-all duration-700 ease-in-out border border-[#2a3142]/80 shadow-xl",statusIndicator:"w-2.5 h-2.5 bg-emerald-400 rounded-full animate-pulse shadow-lg shadow-emerald-400/60",pulseRings:{ring1:"hidden",ring2:"hidden",ring3:"hidden"},controlBar:"border border-[#2a3142]/80 rounded-3xl py-4 flex flex-col justify-end h-full bg-[#161a25]/80 backdrop-blur-xl shadow-2xl",chatInput:{container:"bg-[#1c2230]/80 backdrop-blur-xl border-[#2a3142]/80 shadow-xl",textarea:"bg-[#1c2230]/60 border border-[#2a3142]/50 rounded-xl text-white placeholder-gray-400 font-medium px-4 py-3",sendButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 disabled:border-[#2a3142] disabled:opacity-40 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-cyan-500/30",attachButton:"text-gray-400 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl",endButton:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/40 hover:border-red-400/60 text-white font-bold hover:scale-105 transition-all duration-300 shadow-xl hover:shadow-red-500/40"},chatMessage:{own:"bg-[#243049]/70 text-white backdrop-blur-md shadow-lg border border-[#2a3142]/80",other:"bg-[#1c2230]/60 text-white border border-[#2a3142]/80 backdrop-blur-md shadow-lg"},chatHeader:{container:"bg-[#1c2230]/80 border-[#2a3142]/80 backdrop-blur-xl shadow-xl",backButton:"text-white/80 hover:text-white hover:bg-[#2a3142]/30 transition-all duration-300 rounded-xl"},spinner:"w-10 h-10 animate-spin text-cyan-400 mb-2",suggestedResponse:{container:"bg-[#1c2230]/70 text-white border-[#2a3142]/80 backdrop-blur-md hover:bg-[#1c2230]/80 hover:border-cyan-400/30 transition-all duration-300 shadow-lg"},video:{container:"bg-gradient-to-b from-[#0e1218] via-[#161a25] to-[#0e1218] text-white",header:"border-[#2a3142]/80 bg-[#1c2230]/80 backdrop-blur-xl shadow-xl",headerButton:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 transition-all duration-300 rounded-xl shadow-lg",statusDot:"bg-emerald-400 animate-pulse shadow-lg shadow-emerald-400/60",controlsBackground:"bg-gradient-to-t from-[#161a25] via-[#161a25]/90 to-[#161a25]/60 backdrop-blur-xl border-t border-[#2a3142]/80 shadow-2xl",controlEnabled:"bg-[#171b26]/90 hover:bg-[#171b26] border-2 border-cyan-500/30 hover:border-cyan-400/50 text-white hover:scale-105 hover:shadow-xl hover:shadow-cyan-500/30 transition-all duration-300 font-semibold",controlDisabled:"bg-[#1c2230]/50 hover:bg-[#1c2230]/60 text-white/40 border border-[#2a3142] transition-all duration-300",endCall:"bg-red-600/90 hover:bg-red-600 border-2 border-red-400/50 hover:border-red-400/70 text-white font-bold hover:scale-105 transition-all duration-300 shadow-2xl hover:shadow-red-500/50",tile:"bg-[#1c2230]/70 border border-[#2a3142]/80 shadow-2xl backdrop-blur-md rounded-2xl",placeholder:"bg-[#1c2230]/60 text-white/80",avatar:"bg-[#171b26]/80 text-white border-2 border-[#2a3142]/80",nameOverlay:"bg-gradient-to-t from-[#161a25] via-[#161a25]/80 to-transparent text-white backdrop-blur-sm font-bold",mutedIndicator:"bg-red-600 text-white shadow-xl shadow-red-500/40 font-semibold"}},Cw={card:" text-white bg-gradient-to-br from-[#171727] to-[#12121F] border border-gray-800 w-full h-full flex flex-col justify-between overflow-hidden relative",cardTopGradient:"pointer-events-none absolute top-0 left-0 w-full h-10 z-10 bg-gradient-to-b from-[#171727]/90 to-transparent",cardRadial:"absolute inset-0 bg-[radial-gradient(ellipse_at_center,_var(--tw-gradient-stops))] from-[#3B82F6]/15 via-transparent to-transparent",cardPurpleBlur:"absolute top-0 right-0 w-32 h-32 bg-gradient-to-br from-[#8B5CF6]/25 to-transparent rounded-full blur-2xl",cardPinkBlur:"absolute bottom-0 left-0 w-24 h-24 bg-gradient-to-tr from-[#EC4899]/20 to-transparent rounded-full blur-xl",cardPulse1:"absolute -top-2 -left-2 w-6 h-6 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full blur-sm opacity-50 animate-pulse",cardPulse2:"absolute -bottom-2 -right-2 w-4 h-4 bg-gradient-to-br from-[#EC4899] to-[#8B5CF6] rounded-full blur-sm opacity-40 animate-pulse",main:"w-full flex flex-col items-center justify-center max-w-md mx-auto bg-gradient-to-br from-[#171727] to-[#12121F] rounded-2xl shadow-xl p-0 overflow-hidden h-full",text:{primary:"text-white font-semibold",secondary:"text-white/95",muted:"text-white/70",accent:"bg-clip-text text-transparent bg-gradient-to-r from-[#3B82F6] via-[#8B5CF6] to-[#EC4899]"},micButton:"relative w-20 h-20 bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 mic-glow shadow-2xl group",chatButton:"relative w-20 h-20 bg-gradient-to-br from-[#10B981] to-[#059669] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",videoButton:"relative w-20 h-20 bg-gradient-to-br from-[#8B5CF6] to-[#EC4899] rounded-full flex items-center justify-center hover:scale-105 transition-all duration-300 shadow-2xl group",popupTrigger:"bg-gradient-to-br from-[#3B82F6] to-[#8B5CF6] text-white font-medium hover:from-[#2563EB] hover:to-[#7C3AED] focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-900 shadow-xl",promptSlider:"absolute w-full py-3 px-2 bg-[#1E1E2E] rounded-xl text-center text-gray-200 text-sm transition-opacity duration-700 ease-in-out border border-gray-700",statusIndicator:"w-2 h-2 bg-[#10B981] rounded-full animate-pulse",pulseRings:{ring1:"w-32 h-32 rounded-full border-2 border-[#3B82F6]/40 pulse-ring",ring2:"absolute w-28 h-28 rounded-full border-2 border-[#8B5CF6]/30 pulse-ring",ring3:"absolute w-24 h-24 rounded-full border-2 border-[#EC4899]/20 pulse-ring"},controlBar:"border border-border rounded-3xl py-4 flex flex-col justify-end h-full bg-[#1E1E2E] shadow-2xl",chatInput:{container:"bg-[#1E1E2E] border-gray-700",textarea:"bg-[#1E1E2E] border-none text-white placeholder-gray-400",sendButton:"bg-[#3B82F6] hover:bg-[#2563EB] disabled:bg-gray-600 disabled:opacity-50 text-white",attachButton:"text-gray-400 hover:text-gray-300 hover:bg-gray-700",endButton:"bg-red-900/20 hover:bg-red-800/30 text-red-400 border-red-800"},chatMessage:{own:"bg-[#1E1E2E]/80 text-white",other:"bg-[#1E1E2E] text-white border border-gray-700"},chatHeader:{container:"bg-[#1E1E2E] border-gray-700",backButton:"text-gray-400 hover:text-white hover:bg-gray-700"},spinner:"w-10 h-10 animate-spin text-blue-400 mb-2",suggestedResponse:{container:"bg-[#221f3f] text-white border-none"},video:{container:"bg-gradient-to-br from-[#171727] to-[#12121F] text-white",header:"border-gray-700 bg-[#1E1E2E]/80",headerButton:"bg-[#1E1E2E] hover:bg-gray-700 text-gray-300",statusDot:"bg-[#10B981] animate-pulse",controlsBackground:"bg-[#1E1E2E]/90 backdrop-blur-sm border-t border-gray-700",controlEnabled:"bg-[#3B82F6] hover:bg-[#2563EB] text-white",controlDisabled:"bg-gray-700 hover:bg-gray-600 text-gray-300",endCall:"bg-red-600 hover:bg-red-700 text-white",tile:"bg-[#1E1E2E] border border-gray-700 shadow-xl",placeholder:"bg-[#1E1E2E] text-gray-300",avatar:"bg-gray-700 text-gray-300",nameOverlay:"bg-black/70 text-white",mutedIndicator:"bg-red-600/80 text-white"}},Lu={dark:ww,light:Ew,vox:Sw,midnight:kw,levish:Cw};function Pt(e){return Lu[e]||Lu.vox}function Fu({timeout:e}){const[t,n]=N.useState(100),r=N.useRef(null),i=N.useRef(null);return N.useEffect(()=>{if(!e||e<=0)return;n(100),i.current=Date.now();const o=()=>{if(!e||i.current===null)return;const s=Date.now()-i.current,a=Math.max(0,100-s/e*100);n(a),a>0&&(r.current=requestAnimationFrame(o))};return r.current=requestAnimationFrame(o),()=>{r.current&&cancelAnimationFrame(r.current)}},[e]),!e||e<=0?null:h.jsx("div",{className:"w-full h-1 relative top-1 rounded-t-4xl bg-gray-700 overflow-hidden",children:h.jsx(Me.div,{className:"h-1 rounded-t-4xl dark:bg-white bg-blue-200 ",initial:{width:"100%"},animate:{width:`${Math.max(t,2)}%`},transition:{duration:.1,ease:"linear"},style:{minWidth:"2%"}})})}function fi({interaction:e,theme:t,onDismiss:n,client:r,addLocalMessage:i}){var a;if(!e||!e.isVisible||!e.component)return null;const[o]=D.useState(()=>Date.now()),s=()=>e.component?D.createElement(e.component,{handler:e.handler||void 0,timeout:e.timeout,loadData:async c=>{console.log("InteractiveComponent: Loading data:",c)},presentationMode:e.presentationMode,data:e.data,client:r,addLocalMessage:i}):h.jsx("div",{className:"p-4 text-red-500",children:"Component not found"});switch(e.presentationMode){case"fullscreen":return h.jsx(Tr,{children:h.jsxs(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-black",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx(Fu,{timeout:e.timeout}),h.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/80 text-white border-b border-gray-700",children:[h.jsx("h3",{className:"text-lg font-semibold",children:e.methodName.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}),h.jsx("button",{onClick:n||((a=e.handler)==null?void 0:a.dismissView),className:"p-2 rounded-full bg-white/20 hover:bg-white/30 text-white transition-colors",children:h.jsx(ot.X,{className:"w-5 h-5"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s()})]})});case"embedded":default:return h.jsx(Tr,{children:h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-fit rounded-lg ",children:h.jsxs("div",{children:[h.jsx(Fu,{timeout:e.timeout}),s()]})})})}}function hi({duration:e,theme:t="vox",onTimerExpired:n,className:r="",showIcon:i=!0}){const[o,s]=N.useState(e),[a,l]=N.useState(!1);N.useEffect(()=>{if(o<=0){l(!0),n==null||n();return}const u=setInterval(()=>{s(d=>{const f=d-1;return f<=0?(l(!0),n==null||n(),0):f})},1e3);return()=>clearInterval(u)},[o,n]),N.useEffect(()=>{s(e),l(!1)},[e]);const c=()=>a?"text-red-500":o<=60?"text-orange-500":o<=300?"text-yellow-500":t==="dark"?"text-gray-300":"text-gray-600";return h.jsxs("div",{className:`flex items-center gap-1 text-sm ${c()} ${r}`,children:[i&&h.jsx(ot.Clock,{className:"w-4 h-4"}),h.jsx("span",{className:"font-mono",children:dp(o)}),a&&h.jsx("span",{className:"text-xs ml-1 text-red-500",children:"(Expired)"})]})}function Do({modality:e,theme:t,disabled:n=!1,showMicrophone:r=!1,microphoneEnabled:i=!0,microphoneLoading:o=!1,onToggleMicrophone:s,showCamera:a=!1,cameraEnabled:l=!0,cameraLoading:c=!1,onToggleCamera:u,showScreenShare:d=!1,screenShareEnabled:f=!1,screenShareLoading:p=!1,onToggleScreenShare:m,showChatToggle:g=!1,chatOpen:v=!1,onToggleChat:y,showTextInput:E=!1,textInputPlaceholder:w="Type a message...",onSendText:_,onSendAttachments:C,supportsAttachments:T=!1,showEndCall:R=!0,onEndCall:A}){var $;const I=Pt(t),[b,M]=N.useState(""),O=N.useRef(null),L=()=>{const x=b.trim();x&&_&&(_(x),M(""))},j=x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),L())},W=x=>{const z=Array.from(x.target.files||[]);z.length>0&&C&&C(z),O.current&&(O.current.value="")},oe=Be("flex items-center gap-3 px-2 sm:px-3 py-2 w-full backdrop-blur-xl overflow-hidden",E?"justify-between":"justify-center",t==="light"?"bg-white/95 border-gray-200":""),te=(x,z)=>{var G,k,K;return z==="end-call"?Be("p-3 rounded-full transition-all duration-200",((G=I.video)==null?void 0:G.endCall)||"bg-red-500 text-white hover:bg-red-600",n?"opacity-50 cursor-not-allowed":"hover:scale-105"):Be("p-3 rounded-full transition-all duration-200",x?((k=I.video)==null?void 0:k.controlEnabled)||"bg-green-500 text-white":((K=I.video)==null?void 0:K.controlDisabled)||"bg-gray-500 text-white",n?"opacity-50 cursor-not-allowed":"hover:scale-105")},B=()=>h.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-current border-t-transparent"});return h.jsxs("div",{className:oe,children:[E&&h.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[T&&C&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>{var x;return(x=O.current)==null?void 0:x.click()},disabled:n,className:Be("p-2 rounded-full transition-all duration-200",t==="light"?"hover:bg-gray-100":"hover:bg-gray-800",n&&"opacity-50 cursor-not-allowed"),title:"Attach files",children:h.jsx(ot.Paperclip,{className:"w-5 h-5"})}),h.jsx("input",{ref:O,type:"file",multiple:!0,accept:"image/*",onChange:W,className:"hidden"})]}),h.jsx("input",{type:"text",value:b,onChange:x=>M(x.target.value),onKeyDown:j,disabled:n,placeholder:w,className:Be("flex-1 min-w-0 px-4 py-2 rounded-full border outline-none transition-all",t==="light"?"bg-gray-100 border-gray-300 focus:border-blue-500 text-gray-900":"bg-gray-800 border-gray-700 focus:border-blue-400 text-white",n&&"opacity-50 cursor-not-allowed")}),h.jsx("button",{onClick:L,disabled:n||!b.trim(),className:Be("p-2 rounded-full transition-all duration-200",b.trim()?(($=I.video)==null?void 0:$.controlEnabled)||"bg-blue-500 text-white hover:bg-blue-600":t==="light"?"bg-gray-200 text-gray-400":"bg-gray-700 text-gray-500",n&&"opacity-50 cursor-not-allowed",b.trim()&&!n&&"hover:scale-105"),title:"Send message",children:h.jsx(ot.SendHorizontal,{className:"w-5 h-5"})})]}),!E&&h.jsxs(h.Fragment,{children:[r&&s&&h.jsx("button",{onClick:s,disabled:n||o,className:te(i),title:i?"Mute microphone":"Unmute microphone",children:o?h.jsx(B,{}):i?h.jsx(ot.Mic,{className:"w-5 h-5"}):h.jsx(ot.MicOff,{className:"w-5 h-5"})}),a&&u&&h.jsx("button",{onClick:u,disabled:n||c,className:te(l),title:l?"Turn off camera":"Turn on camera",children:c?h.jsx(B,{}):l?h.jsx(ot.Camera,{className:"w-5 h-5"}):h.jsx(ot.CameraOff,{className:"w-5 h-5"})}),d&&m&&h.jsx("button",{onClick:m,disabled:n||p,className:te(f),title:f?"Stop screen share":"Share screen",children:p?h.jsx(B,{}):h.jsx(ot.Monitor,{className:"w-5 h-5"})}),g&&y&&h.jsx("button",{onClick:y,disabled:n,className:te(v),title:e==="voice"?v?"Hide transcription":"Show transcription":v?"Hide chat":"Show chat",children:h.jsx(ot.MessageCircle,{className:"w-5 h-5"})})]}),R&&A&&h.jsx("button",{onClick:A,disabled:n,className:te(!1,"end-call"),title:"End call",children:h.jsx(ot.PhoneOff,{className:"w-5 h-5"})})]})}Do.displayName="UnifiedControlBar";const _w=({logLevel:e}={})=>{const t=Rt.useRoomContext();D.useEffect(()=>(le.setLogLevel(e??"debug"),window.__lk_room=t,()=>{window.__lk_room=void 0}),[t,e])},hp=D.forwardRef((e,t)=>{const{alt:n,color:r="currentColor",size:i="1em",weight:o="regular",mirrored:s=!1,children:a,weights:l,...c}=e;return D.createElement("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,fill:r,viewBox:"0 0 256 256",transform:s?"scale(-1, 1)":void 0,...c},!!n&&D.createElement("title",null,n),a,l.get(o))});hp.displayName="SSRBase";const Tw=new Map([["bold",D.createElement(D.Fragment,null,D.createElement("path",{d:"M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"}))],["duotone",D.createElement(D.Fragment,null,D.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),D.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["fill",D.createElement(D.Fragment,null,D.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"}))],["light",D.createElement(D.Fragment,null,D.createElement("path",{d:"M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"}))],["regular",D.createElement(D.Fragment,null,D.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"}))],["thin",D.createElement(D.Fragment,null,D.createElement("path",{d:"M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"}))]]),yo=D.forwardRef((e,t)=>D.createElement(hp,{ref:t,...e,weights:Tw}));yo.displayName="SpinnerIcon";function Nw({text:e,isComplete:t,isRealTimeStream:n=!1,speed:r=50}){const[i,o]=D.useState(""),[s,a]=D.useState(0);return D.useEffect(()=>{if(n){o(e);return}if(t){o(e);return}if(s<e.length){const l=setTimeout(()=>{o(e.slice(0,s+1)),a(s+1)},r);return()=>clearTimeout(l)}},[e,s,t,r,n]),D.useEffect(()=>{n||(a(0),o(""))},[e,n]),h.jsxs("span",{className:"relative",children:[h.jsx("span",{className:"inline-block",children:i}),!t&&h.jsx("span",{className:"inline-flex items-center ml-1",children:[0,1,2].map(l=>h.jsx(Me.span,{className:"w-1.5 h-1.5 bg-current rounded-full mx-0.5",animate:{y:[0,-4,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:l*.2,ease:"easeInOut"}},l))})]})}function Aw(e,t){return e.startsWith("image/")?ot.Image:e.startsWith("video/")?ot.Video:e.startsWith("audio/")?ot.Music:e.includes("zip")||e.includes("rar")||e.includes("archive")?ot.Archive:ot.FileText}function Mw(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}function Rw({message:e,theme:t,isOwn:n}){const r=Pt(t),i=e.metadata,o=(i==null?void 0:i.fileName)||"Unknown file",s=(i==null?void 0:i.fileSize)||0,a=(i==null?void 0:i.mimeType)||"application/octet-stream",l=i==null?void 0:i.downloading,c=i==null?void 0:i.uploading,u=(i==null?void 0:i.downloadProgress)||0,d=(i==null?void 0:i.uploadProgress)||0,f=i==null?void 0:i.downloadUrl,p=i==null?void 0:i.file,m=Aw(a),g=l||c,v=l?u:d,y=l?"Downloading...":c?"Uploading...":"Complete",[E,w]=D.useState(null);D.useEffect(()=>{if(f)w(f);else if(p&&a.startsWith("image/")){const R=URL.createObjectURL(p);return w(R),()=>URL.revokeObjectURL(R)}else w(null)},[f,p,a]);const _=()=>{if(f){const R=document.createElement("a");R.href=f,R.download=o,R.click()}},T=a.startsWith("image/")&&E;return h.jsxs("div",{className:"flex flex-col gap-2 max-w-full sm:max-w-sm",children:[T&&h.jsxs("div",{className:"relative rounded-lg overflow-hidden",children:[h.jsx("img",{src:E,alt:o,className:"max-w-full h-auto max-h-48 object-cover rounded-lg cursor-pointer",onClick:_}),h.jsx("div",{className:"absolute inset-0 bg-black/0 hover:bg-black/10 transition-colors duration-200 cursor-pointer"})]}),h.jsxs("div",{className:`
|
|
10
10
|
flex items-center gap-3 p-3 rounded-lg border transition-all duration-200
|
|
11
11
|
${t==="light"?"bg-gray-50 border-gray-200 hover:bg-gray-100":"bg-gray-800/50 border-gray-700 hover:bg-gray-700/50"}
|
|
12
12
|
`,children:[h.jsx("div",{className:`
|
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
`},c]}}const KT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],YT=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ZT=[...qT,...YT],XT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_g=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Tg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QT=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),JT=_g.concat(Tg).sort().reverse();function eN(e){const t=KT(e),n=JT,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},c=function(w,_,C){return{className:w,begin:_,relevance:C}},u={$pattern:/[a-z-]+/,keyword:r,attribute:XT.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},m={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QT.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+ZT.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_g.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Tg.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,v,E,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function tN(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function nN(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,i,o,s]}}function rN(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,l];return[c,u,d,f].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function iN(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function oN(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,v,y="\\1")=>{const E=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",g,")"),v,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,y,r)},p=(g,v,y)=>t.concat(t.concat("(?:",g,")"),v,/(?:\\.|[^\\\/])*?/,y,r),m=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",t.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function sN(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(j,W)=>{W.data._beginMatch=j[1]||j[2]},"on:end":(j,W)=>{W.data._beginMatch!==j[1]&&W.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
53
53
|
]`,m={scope:"string",variants:[u,c,d,f]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:y,literal:(j=>{const W=[];return j.forEach(oe=>{W.push(oe),oe.toLowerCase()===oe?W.push(oe.toUpperCase()):W.push(oe.toLowerCase())}),W})(v),built_in:E},C=j=>j.map(W=>W.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",C(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(r,"\\b(?!\\()"),A={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},b={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[I,s,A,e.C_BLOCK_COMMENT_MODE,m,g,T]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",C(y).join("\\b|"),"|",C(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[b]};b.contains.push(M);const O=[I,A,e.C_BLOCK_COMMENT_MODE,m,g,T],L={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...O]},...O,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:_,contains:[L,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,M,A,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",L,s,A,e.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,g]}}function aN(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function lN(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function cN(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${f})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,d]}]}}function uN(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function dN(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function fN(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},T=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=T,g.contains=T;const b=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:T}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(b).concat(c).concat(T)}}function hN(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:a,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},o]}}const pN=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),gN=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],mN=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],bN=[...gN,...mN],yN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),vN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function EN(e){const t=pN(e),n=vN,r=xN,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+bN.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wN.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:yN.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function SN(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function kN(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,m=[...c,...l].filter(C=>!u.includes(C)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(C){return t.concat(/\b/,t.either(...C.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:E(f),relevance:0};function _(C,{exceptions:T,when:R}={}){const A=R;return T=T||[],C.map(I=>I.match(/\|\d+$/)||T.includes(I)?I:A(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(m,{when:C=>C.length<3}),literal:o,type:a,built_in:d},contains:[{scope:"type",match:E(s)},w,y,g,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Ng(e){return e?typeof e=="string"?e:e.source:null}function Kr(e){return Ge("(?=",e,")")}function Ge(...e){return e.map(n=>Ng(n)).join("")}function CN(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Mt(...e){return"("+(CN(e).capture?"":"?:")+e.map(r=>Ng(r)).join("|")+")"}const Wl=e=>Ge(/\b/,e,/\w$/.test(e)?/\b/:/\B/),_N=["Protocol","Type"].map(Wl),Pd=["init","self"].map(Wl),TN=["Any","Self"],$s=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Dd=["false","nil","true"],NN=["assignment","associativity","higherThan","left","lowerThan","none","right"],AN=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Ld=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ag=Mt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Mg=Mt(Ag,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Vs=Ge(Ag,Mg,"*"),Rg=Mt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),So=Mt(Rg,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ln=Ge(Rg,So,"*"),qi=Ge(/[A-Z]/,So,"*"),MN=["attached","autoclosure",Ge(/convention\(/,Mt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ge(/objc\(/,ln,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],RN=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function IN(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Mt(..._N,...Pd)],className:{2:"keyword"}},o={match:Ge(/\./,Mt(...$s)),relevance:0},s=$s.filter(se=>typeof se=="string").concat(["_|0"]),a=$s.filter(se=>typeof se!="string").concat(TN).map(Wl),l={variants:[{className:"keyword",match:Mt(...a,...Pd)}]},c={$pattern:Mt(/\b\w+/,/#\w+/),keyword:s.concat(AN),literal:Dd},u=[i,o,l],d={match:Ge(/\./,Mt(...Ld)),relevance:0},f={className:"built_in",match:Ge(/\b/,Mt(...Ld),/(?=\()/)},p=[d,f],m={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:Vs},{match:`\\.(\\.|${Mg})+`}]},v=[m,g],y="([0-9]_*)+",E="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(se="")=>({className:"subst",variants:[{match:Ge(/\\/,se,/[0\\tnr"']/)},{match:Ge(/\\/,se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(se="")=>({className:"subst",match:Ge(/\\/,se,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(se="")=>({className:"subst",label:"interpol",begin:Ge(/\\/,se,/\(/),end:/\)/}),R=(se="")=>({begin:Ge(se,/"""/),end:Ge(/"""/,se),contains:[_(se),C(se),T(se)]}),A=(se="")=>({begin:Ge(se,/"/),end:Ge(/"/,se),contains:[_(se),T(se)]}),I={className:"string",variants:[R(),R("#"),R("##"),R("###"),A(),A("#"),A("##"),A("###")]},b=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:b},O=se=>{const be=Ge(se,/\//),ke=Ge(/\//,se);return{begin:be,end:ke,contains:[...b,{scope:"comment",begin:`#(?!.*${ke})`,end:/$/}]}},L={scope:"regexp",variants:[O("###"),O("##"),O("#"),M]},j={match:Ge(/`/,ln,/`/)},W={className:"variable",match:/\$\d+/},oe={className:"variable",match:`\\$${So}+`},te=[j,W,oe],B={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:RN,contains:[...v,w,I]}]}},$={scope:"keyword",match:Ge(/@/,Mt(...MN),Kr(Mt(/\(/,/\s+/)))},x={scope:"meta",match:Ge(/@/,ln)},z=[B,$,x],G={match:Kr(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ge(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,So,"+")},{className:"type",match:qi,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ge(/\s+&\s+/,Kr(qi)),relevance:0}]},k={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...z,m,G]};G.contains.push(k);const K={match:Ge(ln,/\s*:/),keywords:"_|0",relevance:0},Z={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",K,...r,L,...u,...p,...v,w,I,...te,...z,G]},X={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,G]},ie={begin:Mt(Kr(Ge(ln,/\s*:/)),Kr(Ge(ln,/\s+/,ln,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ln}]},Y={begin:/\(/,end:/\)/,keywords:c,contains:[ie,...r,...u,...v,w,I,...z,G,Z],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Mt(j.match,ln,Vs)],className:{1:"keyword",3:"title.function"},contains:[X,Y,t],illegal:[/\[/,/%/]},H={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,Y,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,Vs],className:{1:"keyword",3:"title"}},P={begin:[/precedencegroup/,/\s+/,qi],className:{1:"keyword",3:"title"},contains:[G],keywords:[...NN,...Dd],end:/}/},ne={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Se={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},pe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ln,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[X,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:qi},...u],relevance:0}]};for(const se of I.variants){const be=se.contains.find(ye=>ye.label==="interpol");be.keywords=c;const ke=[...u,...p,...v,w,I,...te];be.contains=[...ke,{begin:/\(/,end:/\)/,contains:["self",...ke]}]}return{name:"Swift",keywords:c,contains:[...r,re,H,ne,Se,pe,Ee,P,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},L,...u,...p,...v,w,I,...te,...z,G,Z]}}const ko="[A-Za-z$_][0-9A-Za-z$_]*",Ig=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Og=["true","false","null","undefined","NaN","Infinity"],Pg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Dg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Lg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jg=[].concat(Lg,Pg,Dg);function ON(e){const t=e.regex,n=(B,{after:$})=>{const x="</"+B[0].slice(1);return B.input.indexOf(x,$)!==-1},r=ko,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,$)=>{const x=B[0].length+B.index,z=B.input[x];if(z==="<"||z===","){$.ignoreMatch();return}z===">"&&(n(B,{after:x})||$.ignoreMatch());let G;const k=B.input.substring(x);if(G=k.match(/^\s*=/)){$.ignoreMatch();return}if((G=k.match(/^\s+extends\s+/))&&G.index===0){$.ignoreMatch();return}}},a={$pattern:ko,keyword:Ig,literal:Og,built_in:jg,"variable.language":Fg},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,v,{match:/\$\d+/},d];f.contains=w.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(w)});const _=[].concat(E,f.contains),C=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:C},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},A={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Pg,...Dg]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},b={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(B){return t.concat("(?!",B.join("|"),")")}const L={match:t.concat(/\b/,O([...Lg,"super","import"].map(B=>`${B}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},oe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(oe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,g,v,E,{match:/\$\d+/},d,A,{scope:"attr",match:r+t.lookahead(":"),relevance:0},te,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:oe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},L,M,R,W,{match:/\$[(.]/}]}}function PN(e){const t=e.regex,n=ON(e),r=ko,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:ko,keyword:Ig.concat(l),literal:Og,built_in:jg.concat(i),"variable.language":Fg},u={className:"meta",begin:"@"+r},d=(g,v,y)=>{const E=g.contains.findIndex(w=>w.label===v);if(E===-1)throw new Error("can not find mode to replace");g.contains.splice(E,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const f=n.contains.find(g=>g.scope==="attr"),p=Object.assign({},f,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,p]),n.contains=n.contains.concat([u,o,s,p]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",a);const m=n.contains.find(g=>g.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function DN(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function LN(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,l,c,a]}}function FN(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function jN(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,o,s],y=[...v];return y.pop(),y.push(a),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const BN={arduino:vT,bash:wT,c:ET,cpp:ST,csharp:kT,css:OT,diff:PT,go:DT,graphql:LT,ini:FT,java:jT,javascript:UT,json:HT,kotlin:GT,less:eN,lua:tN,makefile:nN,markdown:rN,objectivec:iN,perl:oN,php:sN,"php-template":aN,plaintext:lN,python:cN,"python-repl":uN,r:dN,ruby:fN,rust:hN,scss:EN,shell:SN,sql:kN,swift:IN,typescript:PN,vbnet:DN,wasm:LN,xml:FN,yaml:jN};var zs,Fd;function $N(){if(Fd)return zs;Fd=1;function e(S){return S instanceof Map?S.clear=S.delete=S.set=function(){throw new Error("map is read-only")}:S instanceof Set&&(S.add=S.clear=S.delete=function(){throw new Error("set is read-only")}),Object.freeze(S),Object.getOwnPropertyNames(S).forEach(F=>{const q=S[F],ce=typeof q;(ce==="object"||ce==="function")&&!Object.isFrozen(q)&&e(q)}),S}class t{constructor(F){F.data===void 0&&(F.data={}),this.data=F.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(S){return S.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(S,...F){const q=Object.create(null);for(const ce in S)q[ce]=S[ce];return F.forEach(function(ce){for(const Qe in ce)q[Qe]=ce[Qe]}),q}const i="</span>",o=S=>!!S.scope,s=(S,{prefix:F})=>{if(S.startsWith("language:"))return S.replace("language:","language-");if(S.includes(".")){const q=S.split(".");return[`${F}${q.shift()}`,...q.map((ce,Qe)=>`${ce}${"_".repeat(Qe+1)}`)].join(" ")}return`${F}${S}`};class a{constructor(F,q){this.buffer="",this.classPrefix=q.classPrefix,F.walk(this)}addText(F){this.buffer+=n(F)}openNode(F){if(!o(F))return;const q=s(F.scope,{prefix:this.classPrefix});this.span(q)}closeNode(F){o(F)&&(this.buffer+=i)}value(){return this.buffer}span(F){this.buffer+=`<span class="${F}">`}}const l=(S={})=>{const F={children:[]};return Object.assign(F,S),F};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(F){this.top.children.push(F)}openNode(F){const q=l({scope:F});this.add(q),this.stack.push(q)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(F){return this.constructor._walk(F,this.rootNode)}static _walk(F,q){return typeof q=="string"?F.addText(q):q.children&&(F.openNode(q),q.children.forEach(ce=>this._walk(F,ce)),F.closeNode(q)),F}static _collapse(F){typeof F!="string"&&F.children&&(F.children.every(q=>typeof q=="string")?F.children=[F.children.join("")]:F.children.forEach(q=>{c._collapse(q)}))}}class u extends c{constructor(F){super(),this.options=F}addText(F){F!==""&&this.add(F)}startScope(F){this.openNode(F)}endScope(){this.closeNode()}__addSublanguage(F,q){const ce=F.root;q&&(ce.scope=`language:${q}`),this.add(ce)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(S){return S?typeof S=="string"?S:S.source:null}function f(S){return g("(?=",S,")")}function p(S){return g("(?:",S,")*")}function m(S){return g("(?:",S,")?")}function g(...S){return S.map(q=>d(q)).join("")}function v(S){const F=S[S.length-1];return typeof F=="object"&&F.constructor===Object?(S.splice(S.length-1,1),F):{}}function y(...S){return"("+(v(S).capture?"":"?:")+S.map(ce=>d(ce)).join("|")+")"}function E(S){return new RegExp(S.toString()+"|").exec("").length-1}function w(S,F){const q=S&&S.exec(F);return q&&q.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(S,{joinWith:F}){let q=0;return S.map(ce=>{q+=1;const Qe=q;let ut=d(ce),ge="";for(;ut.length>0;){const de=_.exec(ut);if(!de){ge+=ut;break}ge+=ut.substring(0,de.index),ut=ut.substring(de.index+de[0].length),de[0][0]==="\\"&&de[1]?ge+="\\"+String(Number(de[1])+Qe):(ge+=de[0],de[0]==="("&&q++)}return ge}).map(ce=>`(${ce})`).join(F)}const T=/\b\B/,R="[a-zA-Z]\\w*",A="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",b="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",M="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L=(S={})=>{const F=/^#![ ]*\//;return S.binary&&(S.begin=g(F,/.*\b/,S.binary,/\b.*/)),r({scope:"meta",begin:F,end:/$/,relevance:0,"on:begin":(q,ce)=>{q.index!==0&&ce.ignoreMatch()}},S)},j={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[j]},oe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[j]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},B=function(S,F,q={}){const ce=r({scope:"comment",begin:S,end:F,contains:[]},q);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Qe=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:g(/[ ]+/,"(",Qe,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},$=B("//","$"),x=B("/\\*","\\*/"),z=B("#","$"),G={scope:"number",begin:I,relevance:0},k={scope:"number",begin:b,relevance:0},K={scope:"number",begin:M,relevance:0},Z={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},X={scope:"title",begin:R,relevance:0},ie={scope:"title",begin:A,relevance:0},Y={begin:"\\.\\s*"+A,relevance:0};var H=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:K,BINARY_NUMBER_RE:M,COMMENT:B,C_BLOCK_COMMENT_MODE:x,C_LINE_COMMENT_MODE:$,C_NUMBER_MODE:k,C_NUMBER_RE:b,END_SAME_AS_BEGIN:function(S){return Object.assign(S,{"on:begin":(F,q)=>{q.data._beginMatch=F[1]},"on:end":(F,q)=>{q.data._beginMatch!==F[1]&&q.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:R,MATCH_NOTHING_RE:T,METHOD_GUARD:Y,NUMBER_MODE:G,NUMBER_RE:I,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:oe,REGEXP_MODE:Z,RE_STARTERS_RE:O,SHEBANG:L,TITLE_MODE:X,UNDERSCORE_IDENT_RE:A,UNDERSCORE_TITLE_MODE:ie});function Ee(S,F){S.input[S.index-1]==="."&&F.ignoreMatch()}function P(S,F){S.className!==void 0&&(S.scope=S.className,delete S.className)}function ne(S,F){F&&S.beginKeywords&&(S.begin="\\b("+S.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",S.__beforeBegin=Ee,S.keywords=S.keywords||S.beginKeywords,delete S.beginKeywords,S.relevance===void 0&&(S.relevance=0))}function Se(S,F){Array.isArray(S.illegal)&&(S.illegal=y(...S.illegal))}function pe(S,F){if(S.match){if(S.begin||S.end)throw new Error("begin & end are not supported with match");S.begin=S.match,delete S.match}}function se(S,F){S.relevance===void 0&&(S.relevance=1)}const be=(S,F)=>{if(!S.beforeMatch)return;if(S.starts)throw new Error("beforeMatch cannot be used with starts");const q=Object.assign({},S);Object.keys(S).forEach(ce=>{delete S[ce]}),S.keywords=q.keywords,S.begin=g(q.beforeMatch,f(q.begin)),S.starts={relevance:0,contains:[Object.assign(q,{endsParent:!0})]},S.relevance=0,delete q.beforeMatch},ke=["of","and","for","in","not","or","if","then","parent","list","value"],ye="keyword";function ct(S,F,q=ye){const ce=Object.create(null);return typeof S=="string"?Qe(q,S.split(" ")):Array.isArray(S)?Qe(q,S):Object.keys(S).forEach(function(ut){Object.assign(ce,ct(S[ut],F,ut))}),ce;function Qe(ut,ge){F&&(ge=ge.map(de=>de.toLowerCase())),ge.forEach(function(de){const Te=de.split("|");ce[Te[0]]=[ut,xt(Te[0],Te[1])]})}}function xt(S,F){return F?Number(F):Ke(S)?0:1}function Ke(S){return ke.includes(S.toLowerCase())}const ue={},mt=S=>{console.error(S)},qe=(S,...F)=>{console.log(`WARN: ${S}`,...F)},V=(S,F)=>{ue[`${S}/${F}`]||(console.log(`Deprecated as of ${S}. ${F}`),ue[`${S}/${F}`]=!0)},J=new Error;function we(S,F,{key:q}){let ce=0;const Qe=S[q],ut={},ge={};for(let de=1;de<=F.length;de++)ge[de+ce]=Qe[de],ut[de+ce]=!0,ce+=E(F[de-1]);S[q]=ge,S[q]._emit=ut,S[q]._multi=!0}function Oe(S){if(Array.isArray(S.begin)){if(S.skip||S.excludeBegin||S.returnBegin)throw mt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),J;if(typeof S.beginScope!="object"||S.beginScope===null)throw mt("beginScope must be object"),J;we(S,S.begin,{key:"beginScope"}),S.begin=C(S.begin,{joinWith:""})}}function Fe(S){if(Array.isArray(S.end)){if(S.skip||S.excludeEnd||S.returnEnd)throw mt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),J;if(typeof S.endScope!="object"||S.endScope===null)throw mt("endScope must be object"),J;we(S,S.end,{key:"endScope"}),S.end=C(S.end,{joinWith:""})}}function At(S){S.scope&&typeof S.scope=="object"&&S.scope!==null&&(S.beginScope=S.scope,delete S.scope)}function Qt(S){At(S),typeof S.beginScope=="string"&&(S.beginScope={_wrap:S.beginScope}),typeof S.endScope=="string"&&(S.endScope={_wrap:S.endScope}),Oe(S),Fe(S)}function Bt(S){function F(ge,de){return new RegExp(d(ge),"m"+(S.case_insensitive?"i":"")+(S.unicodeRegex?"u":"")+(de?"g":""))}class q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(de,Te){Te.position=this.position++,this.matchIndexes[this.matchAt]=Te,this.regexes.push([Te,de]),this.matchAt+=E(de)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const de=this.regexes.map(Te=>Te[1]);this.matcherRe=F(C(de,{joinWith:"|"}),!0),this.lastIndex=0}exec(de){this.matcherRe.lastIndex=this.lastIndex;const Te=this.matcherRe.exec(de);if(!Te)return null;const vt=Te.findIndex(($r,es)=>es>0&&$r!==void 0),ht=this.matchIndexes[vt];return Te.splice(0,vt),Object.assign(Te,ht)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(de){if(this.multiRegexes[de])return this.multiRegexes[de];const Te=new q;return this.rules.slice(de).forEach(([vt,ht])=>Te.addRule(vt,ht)),Te.compile(),this.multiRegexes[de]=Te,Te}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(de,Te){this.rules.push([de,Te]),Te.type==="begin"&&this.count++}exec(de){const Te=this.getMatcher(this.regexIndex);Te.lastIndex=this.lastIndex;let vt=Te.exec(de);if(this.resumingScanAtSamePosition()&&!(vt&&vt.index===this.lastIndex)){const ht=this.getMatcher(0);ht.lastIndex=this.lastIndex+1,vt=ht.exec(de)}return vt&&(this.regexIndex+=vt.position+1,this.regexIndex===this.count&&this.considerAll()),vt}}function Qe(ge){const de=new ce;return ge.contains.forEach(Te=>de.addRule(Te.begin,{rule:Te,type:"begin"})),ge.terminatorEnd&&de.addRule(ge.terminatorEnd,{type:"end"}),ge.illegal&&de.addRule(ge.illegal,{type:"illegal"}),de}function ut(ge,de){const Te=ge;if(ge.isCompiled)return Te;[P,pe,Qt,be].forEach(ht=>ht(ge,de)),S.compilerExtensions.forEach(ht=>ht(ge,de)),ge.__beforeBegin=null,[ne,Se,se].forEach(ht=>ht(ge,de)),ge.isCompiled=!0;let vt=null;return typeof ge.keywords=="object"&&ge.keywords.$pattern&&(ge.keywords=Object.assign({},ge.keywords),vt=ge.keywords.$pattern,delete ge.keywords.$pattern),vt=vt||/\w+/,ge.keywords&&(ge.keywords=ct(ge.keywords,S.case_insensitive)),Te.keywordPatternRe=F(vt,!0),de&&(ge.begin||(ge.begin=/\B|\b/),Te.beginRe=F(Te.begin),!ge.end&&!ge.endsWithParent&&(ge.end=/\B|\b/),ge.end&&(Te.endRe=F(Te.end)),Te.terminatorEnd=d(Te.end)||"",ge.endsWithParent&&de.terminatorEnd&&(Te.terminatorEnd+=(ge.end?"|":"")+de.terminatorEnd)),ge.illegal&&(Te.illegalRe=F(ge.illegal)),ge.contains||(ge.contains=[]),ge.contains=[].concat(...ge.contains.map(function(ht){return Wt(ht==="self"?ge:ht)})),ge.contains.forEach(function(ht){ut(ht,Te)}),ge.starts&&ut(ge.starts,de),Te.matcher=Qe(Te),Te}if(S.compilerExtensions||(S.compilerExtensions=[]),S.contains&&S.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return S.classNameAliases=r(S.classNameAliases||{}),ut(S)}function Dt(S){return S?S.endsWithParent||Dt(S.starts):!1}function Wt(S){return S.variants&&!S.cachedVariants&&(S.cachedVariants=S.variants.map(function(F){return r(S,{variants:null},F)})),S.cachedVariants?S.cachedVariants:Dt(S)?r(S,{starts:S.starts?r(S.starts):null}):Object.isFrozen(S)?r(S):S}var wt="11.11.1";class rn extends Error{constructor(F,q){super(F),this.name="HTMLInjectionError",this.html=q}}const Et=n,rr=r,ir=Symbol("nomatch"),Br=7,Bn=function(S){const F=Object.create(null),q=Object.create(null),ce=[];let Qe=!0;const ut="Could not find the language '{}', did you forget to load/include a language module?",ge={disableAutodetect:!0,name:"Plain text",contains:[]};let de={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function Te(ee){return de.noHighlightRe.test(ee)}function vt(ee){let xe=ee.className+" ";xe+=ee.parentNode?ee.parentNode.className:"";const De=de.languageDetectRe.exec(xe);if(De){const Je=Cn(De[1]);return Je||(qe(ut.replace("{}",De[1])),qe("Falling back to no-highlight mode for this block.",ee)),Je?De[1]:"no-highlight"}return xe.split(/\s+/).find(Je=>Te(Je)||Cn(Je))}function ht(ee,xe,De){let Je="",bt="";typeof xe=="object"?(Je=ee,De=xe.ignoreIllegals,bt=xe.language):(V("10.7.0","highlight(lang, code, ...args) has been deprecated."),V("10.7.0",`Please use highlight(code, options) instead.
|
|
54
54
|
https://github.com/highlightjs/highlight.js/issues/2277`),bt=ee,Je=xe),De===void 0&&(De=!0);const Jt={code:Je,language:bt};Mi("before:highlight",Jt);const _n=Jt.result?Jt.result:$r(Jt.language,Jt.code,De);return _n.code=Jt.code,Mi("after:highlight",_n),_n}function $r(ee,xe,De,Je){const bt=Object.create(null);function Jt(ae,me){return ae.keywords[me]}function _n(){if(!Ne.keywords){St.addText(et);return}let ae=0;Ne.keywordPatternRe.lastIndex=0;let me=Ne.keywordPatternRe.exec(et),Re="";for(;me;){Re+=et.substring(ae,me.index);const ze=sn.case_insensitive?me[0].toLowerCase():me[0],Ct=Jt(Ne,ze);if(Ct){const[gn,Gm]=Ct;if(St.addText(Re),Re="",bt[ze]=(bt[ze]||0)+1,bt[ze]<=Br&&(Oi+=Gm),gn.startsWith("_"))Re+=me[0];else{const Km=sn.classNameAliases[gn]||gn;on(me[0],Km)}}else Re+=me[0];ae=Ne.keywordPatternRe.lastIndex,me=Ne.keywordPatternRe.exec(et)}Re+=et.substring(ae),St.addText(Re)}function Ri(){if(et==="")return;let ae=null;if(typeof Ne.subLanguage=="string"){if(!F[Ne.subLanguage]){St.addText(et);return}ae=$r(Ne.subLanguage,et,!0,mc[Ne.subLanguage]),mc[Ne.subLanguage]=ae._top}else ae=ts(et,Ne.subLanguage.length?Ne.subLanguage:null);Ne.relevance>0&&(Oi+=ae.relevance),St.__addSublanguage(ae._emitter,ae.language)}function $t(){Ne.subLanguage!=null?Ri():_n(),et=""}function on(ae,me){ae!==""&&(St.startScope(me),St.addText(ae),St.endScope())}function fc(ae,me){let Re=1;const ze=me.length-1;for(;Re<=ze;){if(!ae._emit[Re]){Re++;continue}const Ct=sn.classNameAliases[ae[Re]]||ae[Re],gn=me[Re];Ct?on(gn,Ct):(et=gn,_n(),et=""),Re++}}function hc(ae,me){return ae.scope&&typeof ae.scope=="string"&&St.openNode(sn.classNameAliases[ae.scope]||ae.scope),ae.beginScope&&(ae.beginScope._wrap?(on(et,sn.classNameAliases[ae.beginScope._wrap]||ae.beginScope._wrap),et=""):ae.beginScope._multi&&(fc(ae.beginScope,me),et="")),Ne=Object.create(ae,{parent:{value:Ne}}),Ne}function pc(ae,me,Re){let ze=w(ae.endRe,Re);if(ze){if(ae["on:end"]){const Ct=new t(ae);ae["on:end"](me,Ct),Ct.isMatchIgnored&&(ze=!1)}if(ze){for(;ae.endsParent&&ae.parent;)ae=ae.parent;return ae}}if(ae.endsWithParent)return pc(ae.parent,me,Re)}function Vm(ae){return Ne.matcher.regexIndex===0?(et+=ae[0],1):(os=!0,0)}function zm(ae){const me=ae[0],Re=ae.rule,ze=new t(Re),Ct=[Re.__beforeBegin,Re["on:begin"]];for(const gn of Ct)if(gn&&(gn(ae,ze),ze.isMatchIgnored))return Vm(me);return Re.skip?et+=me:(Re.excludeBegin&&(et+=me),$t(),!Re.returnBegin&&!Re.excludeBegin&&(et=me)),hc(Re,ae),Re.returnBegin?0:me.length}function Um(ae){const me=ae[0],Re=xe.substring(ae.index),ze=pc(Ne,ae,Re);if(!ze)return ir;const Ct=Ne;Ne.endScope&&Ne.endScope._wrap?($t(),on(me,Ne.endScope._wrap)):Ne.endScope&&Ne.endScope._multi?($t(),fc(Ne.endScope,ae)):Ct.skip?et+=me:(Ct.returnEnd||Ct.excludeEnd||(et+=me),$t(),Ct.excludeEnd&&(et=me));do Ne.scope&&St.closeNode(),!Ne.skip&&!Ne.subLanguage&&(Oi+=Ne.relevance),Ne=Ne.parent;while(Ne!==ze.parent);return ze.starts&&hc(ze.starts,ae),Ct.returnEnd?0:me.length}function Hm(){const ae=[];for(let me=Ne;me!==sn;me=me.parent)me.scope&&ae.unshift(me.scope);ae.forEach(me=>St.openNode(me))}let Ii={};function gc(ae,me){const Re=me&&me[0];if(et+=ae,Re==null)return $t(),0;if(Ii.type==="begin"&&me.type==="end"&&Ii.index===me.index&&Re===""){if(et+=xe.slice(me.index,me.index+1),!Qe){const ze=new Error(`0 width match regex (${ee})`);throw ze.languageName=ee,ze.badRule=Ii.rule,ze}return 1}if(Ii=me,me.type==="begin")return zm(me);if(me.type==="illegal"&&!De){const ze=new Error('Illegal lexeme "'+Re+'" for mode "'+(Ne.scope||"<unnamed>")+'"');throw ze.mode=Ne,ze}else if(me.type==="end"){const ze=Um(me);if(ze!==ir)return ze}if(me.type==="illegal"&&Re==="")return et+=`
|
|
55
|
-
`,1;if(is>1e5&&is>me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return et+=Re,Re.length}const sn=Cn(ee);if(!sn)throw mt(ut.replace("{}",ee)),new Error('Unknown language: "'+ee+'"');const Wm=Bt(sn);let rs="",Ne=Je||Wm;const mc={},St=new de.__emitter(de);Hm();let et="",Oi=0,$n=0,is=0,os=!1;try{if(sn.__emitTokens)sn.__emitTokens(xe,St);else{for(Ne.matcher.considerAll();;){is++,os?os=!1:Ne.matcher.considerAll(),Ne.matcher.lastIndex=$n;const ae=Ne.matcher.exec(xe);if(!ae)break;const me=xe.substring($n,ae.index),Re=gc(me,ae);$n=ae.index+Re}gc(xe.substring($n))}return St.finalize(),rs=St.toHTML(),{language:ee,value:rs,relevance:Oi,illegal:!1,_emitter:St,_top:Ne}}catch(ae){if(ae.message&&ae.message.includes("Illegal"))return{language:ee,value:Et(xe),illegal:!0,relevance:0,_illegalBy:{message:ae.message,index:$n,context:xe.slice($n-100,$n+100),mode:ae.mode,resultSoFar:rs},_emitter:St};if(Qe)return{language:ee,value:Et(xe),illegal:!1,relevance:0,errorRaised:ae,_emitter:St,_top:Ne};throw ae}}function es(ee){const xe={value:Et(ee),illegal:!1,relevance:0,_top:ge,_emitter:new de.__emitter(de)};return xe._emitter.addText(ee),xe}function ts(ee,xe){xe=xe||de.languages||Object.keys(F);const De=es(ee),Je=xe.filter(Cn).filter(dc).map($t=>$r($t,ee,!1));Je.unshift(De);const bt=Je.sort(($t,on)=>{if($t.relevance!==on.relevance)return on.relevance-$t.relevance;if($t.language&&on.language){if(Cn($t.language).supersetOf===on.language)return 1;if(Cn(on.language).supersetOf===$t.language)return-1}return 0}),[Jt,_n]=bt,Ri=Jt;return Ri.secondBest=_n,Ri}function Mm(ee,xe,De){const Je=xe&&q[xe]||De;ee.classList.add("hljs"),ee.classList.add(`language-${Je}`)}function ns(ee){let xe=null;const De=vt(ee);if(Te(De))return;if(Mi("before:highlightElement",{el:ee,language:De}),ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ee);return}if(ee.children.length>0&&(de.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ee)),de.throwUnescapedHTML))throw new rn("One of your code blocks includes unescaped HTML.",ee.innerHTML);xe=ee;const Je=xe.textContent,bt=De?ht(Je,{language:De,ignoreIllegals:!0}):ts(Je);ee.innerHTML=bt.value,ee.dataset.highlighted="yes",Mm(ee,De,bt.language),ee.result={language:bt.language,re:bt.relevance,relevance:bt.relevance},bt.secondBest&&(ee.secondBest={language:bt.secondBest.language,relevance:bt.secondBest.relevance}),Mi("after:highlightElement",{el:ee,result:bt,text:Je})}function Rm(ee){de=rr(de,ee)}const Im=()=>{Ai(),V("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Om(){Ai(),V("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let cc=!1;function Ai(){function ee(){Ai()}if(document.readyState==="loading"){cc||window.addEventListener("DOMContentLoaded",ee,!1),cc=!0;return}document.querySelectorAll(de.cssSelector).forEach(ns)}function Pm(ee,xe){let De=null;try{De=xe(S)}catch(Je){if(mt("Language definition for '{}' could not be registered.".replace("{}",ee)),Qe)mt(Je);else throw Je;De=ge}De.name||(De.name=ee),F[ee]=De,De.rawDefinition=xe.bind(null,S),De.aliases&&uc(De.aliases,{languageName:ee})}function Dm(ee){delete F[ee];for(const xe of Object.keys(q))q[xe]===ee&&delete q[xe]}function Lm(){return Object.keys(F)}function Cn(ee){return ee=(ee||"").toLowerCase(),F[ee]||F[q[ee]]}function uc(ee,{languageName:xe}){typeof ee=="string"&&(ee=[ee]),ee.forEach(De=>{q[De.toLowerCase()]=xe})}function dc(ee){const xe=Cn(ee);return xe&&!xe.disableAutodetect}function Fm(ee){ee["before:highlightBlock"]&&!ee["before:highlightElement"]&&(ee["before:highlightElement"]=xe=>{ee["before:highlightBlock"](Object.assign({block:xe.el},xe))}),ee["after:highlightBlock"]&&!ee["after:highlightElement"]&&(ee["after:highlightElement"]=xe=>{ee["after:highlightBlock"](Object.assign({block:xe.el},xe))})}function jm(ee){Fm(ee),ce.push(ee)}function Bm(ee){const xe=ce.indexOf(ee);xe!==-1&&ce.splice(xe,1)}function Mi(ee,xe){const De=ee;ce.forEach(function(Je){Je[De]&&Je[De](xe)})}function $m(ee){return V("10.7.0","highlightBlock will be removed entirely in v12.0"),V("10.7.0","Please use highlightElement now."),ns(ee)}Object.assign(S,{highlight:ht,highlightAuto:ts,highlightAll:Ai,highlightElement:ns,highlightBlock:$m,configure:Rm,initHighlighting:Im,initHighlightingOnLoad:Om,registerLanguage:Pm,unregisterLanguage:Dm,listLanguages:Lm,getLanguage:Cn,registerAliases:uc,autoDetection:dc,inherit:rr,addPlugin:jm,removePlugin:Bm}),S.debugMode=function(){Qe=!1},S.safeMode=function(){Qe=!0},S.versionString=wt,S.regex={concat:g,lookahead:f,either:y,optional:m,anyNumberOfTimes:p};for(const ee in H)typeof H[ee]=="object"&&e(H[ee]);return Object.assign(S,H),S},pn=Bn({});return pn.newInstance=()=>Bn({}),zs=pn,pn.HighlightJS=pn,pn.default=pn,zs}var VN=$N();const zN=Lo(VN),jd={},UN="hljs-";function HN(e){const t=zN.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,c,u){const d=u||jd,f=typeof d.prefix=="string"?d.prefix:UN;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:WN,classPrefix:f});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(l,c){const d=(c||jd).subset||i();let f=-1,p=0,m;for(;++f<d.length;){const g=d[f];if(!t.getLanguage(g))continue;const v=n(g,l,c);v.data&&v.data.relevance!==void 0&&v.data.relevance>p&&(p=v.data.relevance,m=v)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&t.registerLanguage(u,l[u])}}function s(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const d=l[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function a(l){return!!t.getLanguage(l)}}class WN{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const GN={};function KN(e){const t=e||GN,n=t.aliases,r=t.detect||!1,i=t.languages||BN,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=HN(i);if(n&&c.registerAlias(n),s){const u=s.indexOf("-");l=u===-1?s:s.slice(0,u)}return function(u,d){Vo(u,"element",function(f,p,m){if(f.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=qN(f);if(g===!1||!g&&!r||g&&o&&o.includes(g))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const v=fT(f,{whitespace:"pre"});let y;try{y=g?c.highlight(g,v,{prefix:s}):c.highlightAuto(v,{prefix:s,subset:a})}catch(E){const w=E;if(g&&/Unknown language/.test(w.message)){d.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,f],cause:w,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!g&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function qN(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function YN({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var c,u;const i=Pt(t),o=e.sender.name?e.sender.name.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2):"U",s=D.useMemo(()=>{var d,f;return((d=e==null?void 0:e.metadata)==null?void 0:d.format)==="markdown"||((f=e==null?void 0:e.metadata)==null?void 0:f.markdown)===!0||Pw(e.content)},[e.content,e.metadata]),a=D.useMemo(()=>s?Dw(e.content):e.content,[e.content,s]),l=D.useMemo(()=>Iw(t),[t]);return h.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-
|
|
56
|
-
relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover min-w-0 max-w-
|
|
55
|
+
`,1;if(is>1e5&&is>me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return et+=Re,Re.length}const sn=Cn(ee);if(!sn)throw mt(ut.replace("{}",ee)),new Error('Unknown language: "'+ee+'"');const Wm=Bt(sn);let rs="",Ne=Je||Wm;const mc={},St=new de.__emitter(de);Hm();let et="",Oi=0,$n=0,is=0,os=!1;try{if(sn.__emitTokens)sn.__emitTokens(xe,St);else{for(Ne.matcher.considerAll();;){is++,os?os=!1:Ne.matcher.considerAll(),Ne.matcher.lastIndex=$n;const ae=Ne.matcher.exec(xe);if(!ae)break;const me=xe.substring($n,ae.index),Re=gc(me,ae);$n=ae.index+Re}gc(xe.substring($n))}return St.finalize(),rs=St.toHTML(),{language:ee,value:rs,relevance:Oi,illegal:!1,_emitter:St,_top:Ne}}catch(ae){if(ae.message&&ae.message.includes("Illegal"))return{language:ee,value:Et(xe),illegal:!0,relevance:0,_illegalBy:{message:ae.message,index:$n,context:xe.slice($n-100,$n+100),mode:ae.mode,resultSoFar:rs},_emitter:St};if(Qe)return{language:ee,value:Et(xe),illegal:!1,relevance:0,errorRaised:ae,_emitter:St,_top:Ne};throw ae}}function es(ee){const xe={value:Et(ee),illegal:!1,relevance:0,_top:ge,_emitter:new de.__emitter(de)};return xe._emitter.addText(ee),xe}function ts(ee,xe){xe=xe||de.languages||Object.keys(F);const De=es(ee),Je=xe.filter(Cn).filter(dc).map($t=>$r($t,ee,!1));Je.unshift(De);const bt=Je.sort(($t,on)=>{if($t.relevance!==on.relevance)return on.relevance-$t.relevance;if($t.language&&on.language){if(Cn($t.language).supersetOf===on.language)return 1;if(Cn(on.language).supersetOf===$t.language)return-1}return 0}),[Jt,_n]=bt,Ri=Jt;return Ri.secondBest=_n,Ri}function Mm(ee,xe,De){const Je=xe&&q[xe]||De;ee.classList.add("hljs"),ee.classList.add(`language-${Je}`)}function ns(ee){let xe=null;const De=vt(ee);if(Te(De))return;if(Mi("before:highlightElement",{el:ee,language:De}),ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ee);return}if(ee.children.length>0&&(de.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ee)),de.throwUnescapedHTML))throw new rn("One of your code blocks includes unescaped HTML.",ee.innerHTML);xe=ee;const Je=xe.textContent,bt=De?ht(Je,{language:De,ignoreIllegals:!0}):ts(Je);ee.innerHTML=bt.value,ee.dataset.highlighted="yes",Mm(ee,De,bt.language),ee.result={language:bt.language,re:bt.relevance,relevance:bt.relevance},bt.secondBest&&(ee.secondBest={language:bt.secondBest.language,relevance:bt.secondBest.relevance}),Mi("after:highlightElement",{el:ee,result:bt,text:Je})}function Rm(ee){de=rr(de,ee)}const Im=()=>{Ai(),V("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Om(){Ai(),V("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let cc=!1;function Ai(){function ee(){Ai()}if(document.readyState==="loading"){cc||window.addEventListener("DOMContentLoaded",ee,!1),cc=!0;return}document.querySelectorAll(de.cssSelector).forEach(ns)}function Pm(ee,xe){let De=null;try{De=xe(S)}catch(Je){if(mt("Language definition for '{}' could not be registered.".replace("{}",ee)),Qe)mt(Je);else throw Je;De=ge}De.name||(De.name=ee),F[ee]=De,De.rawDefinition=xe.bind(null,S),De.aliases&&uc(De.aliases,{languageName:ee})}function Dm(ee){delete F[ee];for(const xe of Object.keys(q))q[xe]===ee&&delete q[xe]}function Lm(){return Object.keys(F)}function Cn(ee){return ee=(ee||"").toLowerCase(),F[ee]||F[q[ee]]}function uc(ee,{languageName:xe}){typeof ee=="string"&&(ee=[ee]),ee.forEach(De=>{q[De.toLowerCase()]=xe})}function dc(ee){const xe=Cn(ee);return xe&&!xe.disableAutodetect}function Fm(ee){ee["before:highlightBlock"]&&!ee["before:highlightElement"]&&(ee["before:highlightElement"]=xe=>{ee["before:highlightBlock"](Object.assign({block:xe.el},xe))}),ee["after:highlightBlock"]&&!ee["after:highlightElement"]&&(ee["after:highlightElement"]=xe=>{ee["after:highlightBlock"](Object.assign({block:xe.el},xe))})}function jm(ee){Fm(ee),ce.push(ee)}function Bm(ee){const xe=ce.indexOf(ee);xe!==-1&&ce.splice(xe,1)}function Mi(ee,xe){const De=ee;ce.forEach(function(Je){Je[De]&&Je[De](xe)})}function $m(ee){return V("10.7.0","highlightBlock will be removed entirely in v12.0"),V("10.7.0","Please use highlightElement now."),ns(ee)}Object.assign(S,{highlight:ht,highlightAuto:ts,highlightAll:Ai,highlightElement:ns,highlightBlock:$m,configure:Rm,initHighlighting:Im,initHighlightingOnLoad:Om,registerLanguage:Pm,unregisterLanguage:Dm,listLanguages:Lm,getLanguage:Cn,registerAliases:uc,autoDetection:dc,inherit:rr,addPlugin:jm,removePlugin:Bm}),S.debugMode=function(){Qe=!1},S.safeMode=function(){Qe=!0},S.versionString=wt,S.regex={concat:g,lookahead:f,either:y,optional:m,anyNumberOfTimes:p};for(const ee in H)typeof H[ee]=="object"&&e(H[ee]);return Object.assign(S,H),S},pn=Bn({});return pn.newInstance=()=>Bn({}),zs=pn,pn.HighlightJS=pn,pn.default=pn,zs}var VN=$N();const zN=Lo(VN),jd={},UN="hljs-";function HN(e){const t=zN.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,c,u){const d=u||jd,f=typeof d.prefix=="string"?d.prefix:UN;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:WN,classPrefix:f});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,g=m.data;return g.language=p.language,g.relevance=p.relevance,m}function r(l,c){const d=(c||jd).subset||i();let f=-1,p=0,m;for(;++f<d.length;){const g=d[f];if(!t.getLanguage(g))continue;const v=n(g,l,c);v.data&&v.data.relevance!==void 0&&v.data.relevance>p&&(p=v.data.relevance,m=v)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&t.registerLanguage(u,l[u])}}function s(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const d=l[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function a(l){return!!t.getLanguage(l)}}class WN{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const GN={};function KN(e){const t=e||GN,n=t.aliases,r=t.detect||!1,i=t.languages||BN,o=t.plainText,s=t.prefix,a=t.subset;let l="hljs";const c=HN(i);if(n&&c.registerAlias(n),s){const u=s.indexOf("-");l=u===-1?s:s.slice(0,u)}return function(u,d){Vo(u,"element",function(f,p,m){if(f.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const g=qN(f);if(g===!1||!g&&!r||g&&o&&o.includes(g))return;Array.isArray(f.properties.className)||(f.properties.className=[]),f.properties.className.includes(l)||f.properties.className.unshift(l);const v=fT(f,{whitespace:"pre"});let y;try{y=g?c.highlight(g,v,{prefix:s}):c.highlightAuto(v,{prefix:s,subset:a})}catch(E){const w=E;if(g&&/Unknown language/.test(w.message)){d.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[m,f],cause:w,place:f.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!g&&y.data&&y.data.language&&f.properties.className.push("language-"+y.data.language),y.children.length>0&&(f.children=y.children)})}}function qN(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const i=String(t[n]);if(i==="no-highlight"||i==="nohighlight")return!1;!r&&i.slice(0,5)==="lang-"&&(r=i.slice(5)),!r&&i.slice(0,9)==="language-"&&(r=i.slice(9))}return r}function YN({message:e,theme:t,isOwn:n,isStreaming:r=!1}){var c,u;const i=Pt(t),o=e.sender.name?e.sender.name.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2):"U",s=D.useMemo(()=>{var d,f;return((d=e==null?void 0:e.metadata)==null?void 0:d.format)==="markdown"||((f=e==null?void 0:e.metadata)==null?void 0:f.markdown)===!0||Pw(e.content)},[e.content,e.metadata]),a=D.useMemo(()=>s?Dw(e.content):e.content,[e.content,s]),l=D.useMemo(()=>Iw(t),[t]);return h.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"} mb-4 px-3`,children:h.jsxs("div",{className:`relative group ${n?"flex-row-reverse":"flex-row"} flex items-end gap-3 w-full min-w-0`,children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${n?t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700":t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:o}),h.jsxs("div",{className:`
|
|
56
|
+
relative px-3 py-2 rounded-2xl break-words shadow-lg backdrop-blur-sm message-bubble message-hover min-w-0 max-w-[85%] overflow-hidden
|
|
57
57
|
${n?`${i.chatMessage.own} rounded-br-md`:`${i.chatMessage.other} rounded-bl-md`}
|
|
58
58
|
${r?"shimmer":""}
|
|
59
59
|
transition-all duration-200 group-hover:scale-[1.02]
|
|
60
|
-
`,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx("div",{className:"leading-relaxed text-sm overflow-hidden",children:((c=e.metadata)==null?void 0:c.type)==="attachment"?h.jsx(Rw,{message:e,theme:t,isOwn:n}):r&&!n?h.jsx(Nw,{text:e.content,isComplete:!r,isRealTimeStream:((u=e.metadata)==null?void 0:u.streaming)===!0,speed:35}):s?h.jsx(GC,{remarkPlugins:[oT],rehypePlugins:[KN],components:l,children:a}):h.jsx("span",{className:"whitespace-pre-wrap break-words",children:Ow(e.content,t)})}),h.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function ZN({theme:e}){const t=Pt(e);return h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${e==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"AI"}),h.jsx("div",{className:`
|
|
60
|
+
`,style:{wordWrap:"break-word",overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx("div",{className:"leading-relaxed text-sm overflow-hidden min-w-0",children:((c=e.metadata)==null?void 0:c.type)==="attachment"?h.jsx(Rw,{message:e,theme:t,isOwn:n}):r&&!n?h.jsx(Nw,{text:e.content,isComplete:!r,isRealTimeStream:((u=e.metadata)==null?void 0:u.streaming)===!0,speed:35}):s?h.jsx(GC,{remarkPlugins:[oT],rehypePlugins:[KN],components:l,children:a}):h.jsx("span",{className:"whitespace-pre-wrap break-words",style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:Ow(e.content,t)})}),h.jsx("div",{className:"text-xs",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})})}function ZN({theme:e}){const t=Pt(e);return h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${e==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:"AI"}),h.jsx("div",{className:`
|
|
61
61
|
relative px-4 py-3 rounded-2xl rounded-bl-md shadow-lg backdrop-blur-sm
|
|
62
62
|
${t.chatMessage.other}
|
|
63
63
|
transition-all duration-200
|
|
64
|
-
`,children:h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx("span",{className:`text-sm ${e==="light"?"text-gray-600":"text-gray-400"}`,children:"Thinking"}),[0,1,2].map(n=>h.jsx(Me.div,{className:`w-1 h-1 rounded-full ${e==="light"?"bg-gray-400":"bg-gray-500"}`,animate:{y:[0,-3,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:n*.2,ease:"easeInOut"}},n))]})})})]})})}function XN(){return h.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[h.jsx("div",{className:"text-2xl mb-2",children:"✅"}),h.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function QN(){return h.jsxs("div",{className:"flex items-center gap-2 text-orange-600 dark:text-orange-400",children:[h.jsx("span",{className:"text-lg",children:"⏰"}),h.jsx("span",{className:"text-sm font-medium",children:"Request timed out"})]})}function JN({toolData:e}){return h.jsxs("div",{className:"flex items-center text-blue-600 dark:text-blue-400",children:[h.jsx("span",{className:"text-lg",children:"🛠️"}),h.jsx("span",{className:"text-sm font-medium",children:"Tool executed"})]})}function eA(e){const[t,n]=D.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[r,i]=D.useState(()=>{const c=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),u=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!c&&!u}),[o,s]=D.useState(new Set),[a,l]=D.useState([]);return{messages:t,setMessages:n,isLoading:r,setIsLoading:i,streamingMessages:o,setStreamingMessages:s,pendingMessages:a,setPendingMessages:l}}function tA(e){const[t,n]=D.useState("idle"),[r,i]=D.useState([]);return D.useEffect(()=>{(()=>{const u=e.getAgentState();n(u||"idle")})();const s=()=>n("thinking"),a=()=>n("speaking"),l=()=>n("idle"),c=u=>{console.log("Tool executed:",u),i(d=>[...d,u]),n("tool_execution"),setTimeout(()=>n("idle"),1e3)};return e.on("agent.thinking",s),e.on("agent.speaking",a),e.on("agent.idle",l),e.on("tool.executed",c),()=>{e.off("agent.thinking",s),e.off("agent.speaking",a),e.off("agent.idle",l),e.off("tool.executed",c)}},[e]),{agentState:t,setAgentState:n,toolExecutions:r,setToolExecutions:i}}function nA(e){const[t,n]=D.useState(()=>e.getCurrentInteraction());return D.useEffect(()=>{const r=e.getCurrentInteraction();r?(console.log("ChatView: Restoring interaction state on mount/client change:",r.methodName),n(r)):n(null)},[e]),{currentInteraction:t,setCurrentInteraction:n}}function rA(){const e=D.useRef(null),[t,n]=D.useState(!0),r=D.useCallback((a=!1)=>{if(e.current){const l=e.current;a?l.scrollTop=l.scrollHeight:l.scrollTo({top:l.scrollHeight,behavior:"smooth"})}},[]),i=D.useCallback(()=>{if(e.current){const{scrollTop:a,scrollHeight:l,clientHeight:c}=e.current;return l-a-c<100}return!0},[]),o=D.useCallback(()=>{const a=i();n(a)},[i]),s=D.useCallback((a=!1)=>{t&&r(a)},[t,r]);return{messagesContainerRef:e,shouldAutoScroll:t,setShouldAutoScroll:n,scrollToBottom:r,smartScrollToBottom:s,handleScroll:o}}function iA(){const[e,t]=D.useState(!1),[n,r]=D.useState(!1);return D.useEffect(()=>{const i=()=>{const o=navigator.userAgent.toLowerCase(),a=["android","iphone","ipad","mobile","tablet"].some(d=>o.includes(d)),l="ontouchstart"in window||navigator.maxTouchPoints>0,c=window.innerWidth<=768,u=a||l&&c;t(u),u&&r(!0)};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isFullscreen:n,setIsFullscreen:r}}function Gl({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:o,showTimer:s=!0}){const a=D.useMemo(()=>{const P=e.getCurrentAgentInfo();return Oo(P)},[e]),{suggestedReplyEnabled:l,attachmentsEnabled:c}=D.useMemo(()=>cp(a),[a]),u=D.useMemo(()=>Po(a),[a]),{messages:d,setMessages:f,setIsLoading:p,streamingMessages:m,setStreamingMessages:g,pendingMessages:v,setPendingMessages:y}=eA(e),{agentState:E,toolExecutions:w}=tA(e),{currentInteraction:_,setCurrentInteraction:C}=nA(e),{messagesContainerRef:T,shouldAutoScroll:R,setShouldAutoScroll:A,smartScrollToBottom:I,handleScroll:b,scrollToBottom:M}=rA(),{isMobile:O,isFullscreen:L,setIsFullscreen:j}=iA(),[W,oe]=D.useState(new Set),[te,B]=D.useState([]),$=Pt(t);D.useEffect(()=>(L&&O&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{L&&O&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[L,O]);const x=e.getCurrentAgentInfo(),z=(x==null?void 0:x.name)||"AI Assistant",G=z.split(" ").map(P=>P[0]).join("").toUpperCase().slice(0,2),k=D.useCallback(P=>{const ne={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:P,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};f(Se=>[...Se,ne])},[f]);D.useEffect(()=>{if(R&&d.length>0){I(!0);const P=setTimeout(()=>{R&&I(!1)},10);return()=>clearTimeout(P)}},[d.length,I,R]),D.useEffect(()=>{if(_&&R){I(!0);const P=setTimeout(()=>{R&&I(!1)},50);return()=>clearTimeout(P)}},[_,I,R]),D.useEffect(()=>{w.forEach(P=>{const ne=`${P.created_at}-${P.type}`;W.has(ne)||(console.log("Processing tool execution:",ne),oe(Se=>new Set(Se).add(ne)),setTimeout(()=>{const Se={id:`tool_${ne}`,content:"",timestamp:new Date,sender:{id:"system",name:"System",type:"agent"},metadata:{type:"toolExecution",view:h.jsx(JN,{toolData:P})}};console.log("Adding tool message with timestamp:",Se.timestamp),f(pe=>{if(pe.some(ke=>ke.id===Se.id))return console.log("Tool message already exists, skipping"),pe;console.log("Adding tool message to end of",pe.length,"messages");const be=[...pe,Se];return console.log("New messages array length:",be.length),be}),setTimeout(()=>{R&&I(!0)},0)},100))})},[w,W,f,R,I]),D.useEffect(()=>{const P=pe=>{if(console.log("ChatView: Received message:",pe),p(!1),_&&pe.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",_.methodName),y(se=>[...se,pe]);return}f(se=>{var ke;if(se.some(ye=>ye.id===pe.id))return console.log("ChatView: Message already exists, skipping:",pe.id),se;if(console.log("ChatView: Adding new message:",pe.id),pe.sender.type==="agent"&&(g(ye=>new Set(ye).add(pe.id)),!((ke=pe.metadata)!=null&&ke.streaming))){const ye=pe.content.length*35+1e3;setTimeout(()=>{g(ct=>{const xt=new Set(ct);return xt.delete(pe.id),xt})},ye)}return[...se,pe]}),setTimeout(()=>{R&&I(!0)},0)},ne=pe=>{var se;if(console.log("ChatView: Updated message:",pe),_&&pe.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",_.methodName),y(be=>{const ke=be.findIndex(ye=>ye.id===pe.id);if(ke>=0){const ye=[...be];return ye[ke]=pe,ye}else return[...be,pe]});return}f(be=>be.map(ke=>ke.id===pe.id?{...pe}:ke)),setTimeout(()=>{R&&I(!0)},0),(se=pe.metadata)!=null&&se.streaming||g(be=>{const ke=new Set(be);return ke.delete(pe.id),ke})},Se=pe=>{console.log("ChatView: Sent message:",pe),p(!1),f(se=>se.some(ke=>ke.id===pe.id)?(console.log("ChatView: Sent message already exists, skipping:",pe.id),se):(console.log("ChatView: Adding sent message:",pe.id),[...se,pe])),setTimeout(()=>{R&&I(!0)},0)};return e.on("chat.message.received",P),e.on("chat.message.updated",ne),e.on("chat.message.sent",Se),()=>{e.off("chat.message.received",P),e.off("chat.message.updated",ne),e.off("chat.message.sent",Se)}},[e,_,R,I,p,f,g,y]),D.useEffect(()=>{const P=se=>{console.log("ChatView: RPC interaction started:",se);const be=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",be==null?void 0:be.methodName),C(be),R&&(I(!0),setTimeout(()=>{R&&I(!1)},100))},ne=se=>{if(console.log("ChatView: RPC interaction completed:",se),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages"),f(be=>{const ke=[...be];return v.forEach(ye=>{var xt;if(!ke.some(Ke=>Ke.id===ye.id)&&(console.log("ChatView: Adding queued message:",ye.id),ke.push(ye),ye.sender.type==="agent"&&(g(Ke=>new Set(Ke).add(ye.id)),!((xt=ye.metadata)!=null&&xt.streaming)))){const Ke=ye.content.length*35+1e3;setTimeout(()=>{g(ue=>{const mt=new Set(ue);return mt.delete(ye.id),mt})},Ke)}}),ke}),y([]),setTimeout(()=>{R&&I(!0)},0)),se&&se.response&&se.response.success){let be=null;se.response.successView?be=se.response.successView:se.successView&&(be=se.successView),f(ke=>{const ye=[...ke].reverse().findIndex(ue=>ue.sender.type==="participant");let ct=ke.length;ye!==-1&&(ct=ke.length-ye);const xt={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:be||h.jsx(XN,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(xt);const Ke=[...ke];return Ke.splice(ct,0,xt),Ke})}},Se=async se=>{_&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after timeout"),f(ke=>{const ye=[...ke];return v.forEach(ct=>{var Ke;if(!ye.some(ue=>ue.id===ct.id)&&(ye.push(ct),ct.sender.type==="agent"&&(g(ue=>new Set(ue).add(ct.id)),!((Ke=ct.metadata)!=null&&Ke.streaming)))){const ue=ct.content.length*35+1e3;setTimeout(()=>{g(mt=>{const qe=new Set(mt);return qe.delete(ct.id),qe})},ue)}}),ye}),y([]),setTimeout(()=>{R&&I(!0)},0));let be=null;se&&se.response&&se.response.timeoutView?be=se.response.timeoutView:se&&se.timeoutView&&(be=se.timeoutView),f(ke=>{const ye={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:z,type:"agent"},metadata:{type:"timeoutView",view:be||h.jsx(QN,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(ye),[...ke,ye]}),setTimeout(()=>{e.getCurrentInteraction()||C(null)},100)},pe=async se=>{console.log("ChatView: RPC interaction dismissed:",se),console.log("ChatView: Current interaction before dismiss:",_==null?void 0:_.methodName),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after dismissal"),f(be=>{const ke=[...be];return v.forEach(ye=>{var xt;if(!ke.some(Ke=>Ke.id===ye.id)&&(ke.push(ye),ye.sender.type==="agent"&&(g(Ke=>new Set(Ke).add(ye.id)),!((xt=ye.metadata)!=null&&xt.streaming)))){const Ke=ye.content.length*35+1e3;setTimeout(()=>{g(ue=>{const mt=new Set(ue);return mt.delete(ye.id),mt})},Ke)}}),ke}),y([]),setTimeout(()=>{R&&I(!0)},0)),setTimeout(()=>{const be=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(be==null?void 0:be.methodName)||"null"),be===null&&C(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",P),e.on("rpc.interaction.completed",ne),e.on("rpc.interaction.timeout",Se),e.on("rpc.interaction.dismissed",pe),()=>{e.off("rpc.interaction.started",P),e.off("rpc.interaction.completed",ne),e.off("rpc.interaction.timeout",Se),e.off("rpc.interaction.dismissed",pe)}},[e,R,I,z,v,_,C,f,g,y]),D.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(_==null?void 0:_.methodName)||"none")},[i,_]);const K=async P=>{try{_&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),C(null)),await e.sendChatMessage(P)}catch(ne){console.error("Failed to send message:",ne)}},Z=async P=>{try{_&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),C(null)),await e.sendAttachments(P),console.log("Attachments sent successfully:",P.map(ne=>ne.name))}catch(ne){console.error("Failed to send attachments:",ne)}};D.useEffect(()=>{const P=ne=>{B(Array.isArray(ne)?ne:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",P),()=>{e.off("suggested.response",P)}},[e]);const X=L&&O?"fullscreen":i,ie=X==="fullscreen"?L&&O?`fixed inset-0 z-[9999] flex flex-col h-[100svh] w-screen min-h-0 ${$.main}`:"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm max-h-full overflow-hidden contain-layout",Y=X==="fullscreen"?L&&O?`flex items-center w-full justify-between px-3 h-11 ${$.chatHeader.container} border-b`:`flex items-center w-full justify-between px-5 h-12 border-b ${$.chatHeader.container}`:`flex items-center w-full justify-between px-4 h-12 border-b ${$.chatHeader.container}`,re=X==="fullscreen"?L&&O?"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide w-full p-4 chat-scrollable min-h-0",H="flex-shrink-0 !w-full",Ee=()=>{j(!1),n&&n()};return h.jsxs("div",{className:`${ie} relative`,children:[h.jsx("div",{className:Y,children:h.jsxs("div",{className:"flex items-center justify-between w-full",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:`!font-semibold !text-sm pl-3 leading-tight ${L&&O?"":$.text.primary}`,children:"Transcription"}),E==="idle"&&h.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${t==="light"?"bg-gray-100 text-gray-600":"bg-gray-700 text-gray-400"}`,children:"Idle"})]}),s&&u&&h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx(hi,{duration:u,theme:t,onTimerExpired:()=>{console.log("Session timer expired")},showIcon:!1,className:"text-xs"})}),n&&h.jsx(Me.button,{onClick:Ee,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1.5 rounded-md transition-all duration-200 ${L&&O?"hover:bg-white/10 text-white/70 hover:text-white":t==="light"?"hover:bg-gray-100 text-gray-400 hover:text-gray-600":"hover:bg-gray-700/40 text-gray-400 hover:text-gray-200"}`,"aria-label":"Close chat",children:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),h.jsx("div",{ref:T,className:`${re}`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:b,children:d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-12",children:[h.jsx(Me.div,{animate:{scale:[1,1.05,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:G}),h.jsxs("p",{className:`text-base mb-2 ${L&&O?"text-white":$.text.secondary}`,children:[z," is joining..."]}),h.jsx("p",{className:`text-xs ${L&&O?"text-gray-300":$.text.muted}`,children:"Your conversation will begin shortly"})]}):h.jsx("div",{className:"w-full space-y-3 py-4 px-2",children:h.jsxs("div",{className:"space-y-3",children:[d.map((P,ne)=>{var Se,pe,se,be;return h.jsx("div",{children:((Se=P.metadata)==null?void 0:Se.type)==="successView"?h.jsx("div",{className:"flex w-full justify-end mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Me.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.own} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((pe=P.metadata)==null?void 0:pe.type)==="timeoutView"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((se=P.metadata)==null?void 0:se.type)==="visualization"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((be=P.metadata)==null?void 0:be.type)==="toolExecution"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-1",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):h.jsx(YN,{message:P,theme:t,isOwn:P.sender.type==="participant",isStreaming:m.has(P.id)})},P.id)}),E==="thinking"&&!_&&h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},children:h.jsx(ZN,{theme:t})}),_&&_.presentationMode==="embedded"&&h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Me.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx(fi,{interaction:_,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},_.methodName),h.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})]})})}),!R&&h.jsx(Me.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{A(!0),M(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),l&&te.length>0&&h.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide flex-shrink-0",children:te.map((P,ne)=>{var Se;return h.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
|
|
64
|
+
`,children:h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs("div",{className:"flex items-center space-x-1",children:[h.jsx("span",{className:`text-sm ${e==="light"?"text-gray-600":"text-gray-400"}`,children:"Thinking"}),[0,1,2].map(n=>h.jsx(Me.div,{className:`w-1 h-1 rounded-full ${e==="light"?"bg-gray-400":"bg-gray-500"}`,animate:{y:[0,-3,0],opacity:[.4,1,.4],scale:[.8,1,.8]},transition:{duration:.8,repeat:1/0,repeatType:"mirror",delay:n*.2,ease:"easeInOut"}},n))]})})})]})})}function XN(){return h.jsxs("div",{className:"max-w-xs mx-auto bg-green-50 border border-green-200 rounded-lg shadow p-3 flex flex-col items-center",children:[h.jsx("div",{className:"text-2xl mb-2",children:"✅"}),h.jsx("div",{className:"text-green-700 font-semibold text-sm mb-1",children:"Success!"}),h.jsx("div",{className:"text-xs text-gray-600 text-center mb-1",children:"Your action was completed successfully."})]})}function QN(){return h.jsxs("div",{className:"flex items-center gap-2 text-orange-600 dark:text-orange-400",children:[h.jsx("span",{className:"text-lg",children:"⏰"}),h.jsx("span",{className:"text-sm font-medium",children:"Request timed out"})]})}function JN({toolData:e}){return h.jsxs("div",{className:"flex items-center text-blue-600 dark:text-blue-400",children:[h.jsx("span",{className:"text-lg",children:"🛠️"}),h.jsx("span",{className:"text-sm font-medium",children:"Tool executed"})]})}function eA(e){const[t,n]=D.useState(()=>e&&typeof e.getChatMessages=="function"?e.getChatMessages():[]),[r,i]=D.useState(()=>{const c=e&&typeof e.getCurrentSession=="function"&&!!e.getCurrentSession(),u=e&&typeof e.getChatMessages=="function"&&e.getChatMessages().length>0;return!c&&!u}),[o,s]=D.useState(new Set),[a,l]=D.useState([]);return{messages:t,setMessages:n,isLoading:r,setIsLoading:i,streamingMessages:o,setStreamingMessages:s,pendingMessages:a,setPendingMessages:l}}function tA(e){const[t,n]=D.useState("idle"),[r,i]=D.useState([]);return D.useEffect(()=>{(()=>{const u=e.getAgentState();n(u||"idle")})();const s=()=>n("thinking"),a=()=>n("speaking"),l=()=>n("idle"),c=u=>{console.log("Tool executed:",u),i(d=>[...d,u]),n("tool_execution"),setTimeout(()=>n("idle"),1e3)};return e.on("agent.thinking",s),e.on("agent.speaking",a),e.on("agent.idle",l),e.on("tool.executed",c),()=>{e.off("agent.thinking",s),e.off("agent.speaking",a),e.off("agent.idle",l),e.off("tool.executed",c)}},[e]),{agentState:t,setAgentState:n,toolExecutions:r,setToolExecutions:i}}function nA(e){const[t,n]=D.useState(()=>e.getCurrentInteraction());return D.useEffect(()=>{const r=e.getCurrentInteraction();r?(console.log("ChatView: Restoring interaction state on mount/client change:",r.methodName),n(r)):n(null)},[e]),{currentInteraction:t,setCurrentInteraction:n}}function rA(){const e=D.useRef(null),[t,n]=D.useState(!0),r=D.useCallback((a=!1)=>{if(e.current){const l=e.current;a?l.scrollTop=l.scrollHeight:l.scrollTo({top:l.scrollHeight,behavior:"smooth"})}},[]),i=D.useCallback(()=>{if(e.current){const{scrollTop:a,scrollHeight:l,clientHeight:c}=e.current;return l-a-c<100}return!0},[]),o=D.useCallback(()=>{const a=i();n(a)},[i]),s=D.useCallback((a=!1)=>{t&&r(a)},[t,r]);return{messagesContainerRef:e,shouldAutoScroll:t,setShouldAutoScroll:n,scrollToBottom:r,smartScrollToBottom:s,handleScroll:o}}function iA(){const[e,t]=D.useState(!1),[n,r]=D.useState(!1);return D.useEffect(()=>{const i=()=>{const o=navigator.userAgent.toLowerCase(),a=["android","iphone","ipad","mobile","tablet"].some(d=>o.includes(d)),l="ontouchstart"in window||navigator.maxTouchPoints>0,c=window.innerWidth<=768,u=a||l&&c;t(u),u&&r(!0)};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isFullscreen:n,setIsFullscreen:r}}function Gl({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i="widget",onEndChat:o,showTimer:s=!0}){const a=D.useMemo(()=>{const P=e.getCurrentAgentInfo();return Oo(P)},[e]),{suggestedReplyEnabled:l,attachmentsEnabled:c}=D.useMemo(()=>cp(a),[a]),u=D.useMemo(()=>Po(a),[a]),{messages:d,setMessages:f,setIsLoading:p,streamingMessages:m,setStreamingMessages:g,pendingMessages:v,setPendingMessages:y}=eA(e),{agentState:E,toolExecutions:w}=tA(e),{currentInteraction:_,setCurrentInteraction:C}=nA(e),{messagesContainerRef:T,shouldAutoScroll:R,setShouldAutoScroll:A,smartScrollToBottom:I,handleScroll:b,scrollToBottom:M}=rA(),{isMobile:O,isFullscreen:L,setIsFullscreen:j}=iA(),[W,oe]=D.useState(new Set),[te,B]=D.useState([]),$=Pt(t);D.useEffect(()=>(L&&O&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.height="100%",document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen().catch(console.log)),()=>{L&&O&&(document.body.style.overflow="unset",document.body.style.position="unset",document.body.style.width="unset",document.body.style.height="unset",document.fullscreenElement&&document.exitFullscreen().catch(console.log))}),[L,O]);const x=e.getCurrentAgentInfo(),z=(x==null?void 0:x.name)||"AI Assistant",G=z.split(" ").map(P=>P[0]).join("").toUpperCase().slice(0,2),k=D.useCallback(P=>{const ne={id:`local_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:P,timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{isLocal:!0}};f(Se=>[...Se,ne])},[f]);D.useEffect(()=>{if(R&&d.length>0){I(!0);const P=setTimeout(()=>{R&&I(!1)},10);return()=>clearTimeout(P)}},[d.length,I,R]),D.useEffect(()=>{if(_&&R){I(!0);const P=setTimeout(()=>{R&&I(!1)},50);return()=>clearTimeout(P)}},[_,I,R]),D.useEffect(()=>{w.forEach(P=>{const ne=`${P.created_at}-${P.type}`;W.has(ne)||(console.log("Processing tool execution:",ne),oe(Se=>new Set(Se).add(ne)),setTimeout(()=>{const Se={id:`tool_${ne}`,content:"",timestamp:new Date,sender:{id:"system",name:"System",type:"agent"},metadata:{type:"toolExecution",view:h.jsx(JN,{toolData:P})}};console.log("Adding tool message with timestamp:",Se.timestamp),f(pe=>{if(pe.some(ke=>ke.id===Se.id))return console.log("Tool message already exists, skipping"),pe;console.log("Adding tool message to end of",pe.length,"messages");const be=[...pe,Se];return console.log("New messages array length:",be.length),be}),setTimeout(()=>{R&&I(!0)},0)},100))})},[w,W,f,R,I]),D.useEffect(()=>{const P=pe=>{if(console.log("ChatView: Received message:",pe),p(!1),_&&pe.sender.type==="agent"){console.log("ChatView: Queuing agent message due to active interaction:",_.methodName),y(se=>[...se,pe]);return}f(se=>{var ke;if(se.some(ye=>ye.id===pe.id))return console.log("ChatView: Message already exists, skipping:",pe.id),se;if(console.log("ChatView: Adding new message:",pe.id),pe.sender.type==="agent"&&(g(ye=>new Set(ye).add(pe.id)),!((ke=pe.metadata)!=null&&ke.streaming))){const ye=pe.content.length*35+1e3;setTimeout(()=>{g(ct=>{const xt=new Set(ct);return xt.delete(pe.id),xt})},ye)}return[...se,pe]}),setTimeout(()=>{R&&I(!0)},0)},ne=pe=>{var se;if(console.log("ChatView: Updated message:",pe),_&&pe.sender.type==="agent"){console.log("ChatView: Queuing agent message update due to active interaction:",_.methodName),y(be=>{const ke=be.findIndex(ye=>ye.id===pe.id);if(ke>=0){const ye=[...be];return ye[ke]=pe,ye}else return[...be,pe]});return}f(be=>be.map(ke=>ke.id===pe.id?{...pe}:ke)),setTimeout(()=>{R&&I(!0)},0),(se=pe.metadata)!=null&&se.streaming||g(be=>{const ke=new Set(be);return ke.delete(pe.id),ke})},Se=pe=>{console.log("ChatView: Sent message:",pe),p(!1),f(se=>se.some(ke=>ke.id===pe.id)?(console.log("ChatView: Sent message already exists, skipping:",pe.id),se):(console.log("ChatView: Adding sent message:",pe.id),[...se,pe])),setTimeout(()=>{R&&I(!0)},0)};return e.on("chat.message.received",P),e.on("chat.message.updated",ne),e.on("chat.message.sent",Se),()=>{e.off("chat.message.received",P),e.off("chat.message.updated",ne),e.off("chat.message.sent",Se)}},[e,_,R,I,p,f,g,y]),D.useEffect(()=>{const P=se=>{console.log("ChatView: RPC interaction started:",se);const be=e.getCurrentInteraction();console.log("ChatView: Got interaction from client:",be==null?void 0:be.methodName),C(be),R&&(I(!0),setTimeout(()=>{R&&I(!1)},100))},ne=se=>{if(console.log("ChatView: RPC interaction completed:",se),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages"),f(be=>{const ke=[...be];return v.forEach(ye=>{var xt;if(!ke.some(Ke=>Ke.id===ye.id)&&(console.log("ChatView: Adding queued message:",ye.id),ke.push(ye),ye.sender.type==="agent"&&(g(Ke=>new Set(Ke).add(ye.id)),!((xt=ye.metadata)!=null&&xt.streaming)))){const Ke=ye.content.length*35+1e3;setTimeout(()=>{g(ue=>{const mt=new Set(ue);return mt.delete(ye.id),mt})},Ke)}}),ke}),y([]),setTimeout(()=>{R&&I(!0)},0)),se&&se.response&&se.response.success){let be=null;se.response.successView?be=se.response.successView:se.successView&&(be=se.successView),f(ke=>{const ye=[...ke].reverse().findIndex(ue=>ue.sender.type==="participant");let ct=ke.length;ye!==-1&&(ct=ke.length-ye);const xt={id:`success_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"participant",name:"You",type:"participant"},metadata:{type:"successView",view:be||h.jsx(XN,{})}};e&&typeof e.addChatMessage=="function"&&e.addChatMessage(xt);const Ke=[...ke];return Ke.splice(ct,0,xt),Ke})}},Se=async se=>{_&&(console.log("ChatView: Dismissing active interaction due to timeout"),e.dismissCurrentInteraction()),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after timeout"),f(ke=>{const ye=[...ke];return v.forEach(ct=>{var Ke;if(!ye.some(ue=>ue.id===ct.id)&&(ye.push(ct),ct.sender.type==="agent"&&(g(ue=>new Set(ue).add(ct.id)),!((Ke=ct.metadata)!=null&&Ke.streaming)))){const ue=ct.content.length*35+1e3;setTimeout(()=>{g(mt=>{const qe=new Set(mt);return qe.delete(ct.id),qe})},ue)}}),ye}),y([]),setTimeout(()=>{R&&I(!0)},0));let be=null;se&&se.response&&se.response.timeoutView?be=se.response.timeoutView:se&&se.timeoutView&&(be=se.timeoutView),f(ke=>{const ye={id:`timeout_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,content:"",timestamp:new Date,sender:{id:"agent",name:z,type:"agent"},metadata:{type:"timeoutView",view:be||h.jsx(QN,{})}};return e&&typeof e.addChatMessage=="function"&&e.addChatMessage(ye),[...ke,ye]}),setTimeout(()=>{e.getCurrentInteraction()||C(null)},100)},pe=async se=>{console.log("ChatView: RPC interaction dismissed:",se),console.log("ChatView: Current interaction before dismiss:",_==null?void 0:_.methodName),C(null),v.length>0&&(console.log("ChatView: Processing",v.length,"queued messages after dismissal"),f(be=>{const ke=[...be];return v.forEach(ye=>{var xt;if(!ke.some(Ke=>Ke.id===ye.id)&&(ke.push(ye),ye.sender.type==="agent"&&(g(Ke=>new Set(Ke).add(ye.id)),!((xt=ye.metadata)!=null&&xt.streaming)))){const Ke=ye.content.length*35+1e3;setTimeout(()=>{g(ue=>{const mt=new Set(ue);return mt.delete(ye.id),mt})},Ke)}}),ke}),y([]),setTimeout(()=>{R&&I(!0)},0)),setTimeout(()=>{const be=e.getCurrentInteraction();console.log("ChatView: Latest interaction from client after dismiss:",(be==null?void 0:be.methodName)||"null"),be===null&&C(null)},50),console.log("ChatView: Set currentInteraction to null after dismiss")};return e.on("rpc.interaction.started",P),e.on("rpc.interaction.completed",ne),e.on("rpc.interaction.timeout",Se),e.on("rpc.interaction.dismissed",pe),()=>{e.off("rpc.interaction.started",P),e.off("rpc.interaction.completed",ne),e.off("rpc.interaction.timeout",Se),e.off("rpc.interaction.dismissed",pe)}},[e,R,I,z,v,_,C,f,g,y]),D.useEffect(()=>{console.log("ChatView: Display type changed to:",i,"Current interaction:",(_==null?void 0:_.methodName)||"none")},[i,_]);const K=async P=>{try{_&&(console.log("ChatView: Dismissing active interaction due to user message send"),e.dismissCurrentInteraction(),C(null)),await e.sendChatMessage(P)}catch(ne){console.error("Failed to send message:",ne)}},Z=async P=>{try{_&&(console.log("ChatView: Dismissing active interaction due to user attachment send"),e.dismissCurrentInteraction(),C(null)),await e.sendAttachments(P),console.log("Attachments sent successfully:",P.map(ne=>ne.name))}catch(ne){console.error("Failed to send attachments:",ne)}};D.useEffect(()=>{const P=ne=>{B(Array.isArray(ne)?ne:["tes","hello how are you","algebra make me learn that ","what is the meaning of life"])};return e.on("suggested.response",P),()=>{e.off("suggested.response",P)}},[e]);const X=L&&O?"fullscreen":i,ie=X==="fullscreen"?L&&O?`fixed inset-0 z-[9999] flex flex-col h-[100svh] w-screen min-h-0 ${$.main}`:"flex flex-col h-full w-full max-w-none":"flex flex-col h-full w-full backdrop-blur-sm max-h-full overflow-hidden contain-layout",Y=X==="fullscreen"?L&&O?`flex items-center w-full justify-between px-3 h-11 ${$.chatHeader.container} border-b`:`flex items-center w-full justify-between px-5 h-12 border-b ${$.chatHeader.container}`:`flex items-center w-full justify-between px-4 h-12 border-b ${$.chatHeader.container}`,re=X==="fullscreen"?L&&O?"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-4 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide p-6 w-full max-w-none chat-scrollable min-h-0":"flex-1 overflow-y-auto overflow-x-hidden scrollbar-hide w-full p-4 chat-scrollable min-h-0",H="flex-shrink-0 !w-full",Ee=()=>{j(!1),n&&n()};return h.jsxs("div",{className:`${ie} relative`,children:[h.jsx("div",{className:Y,children:h.jsxs("div",{className:"flex items-center justify-between w-full",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:`!font-semibold !text-sm pl-3 leading-tight ${L&&O?"":$.text.primary}`,children:"Transcription"}),E==="idle"&&h.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${t==="light"?"bg-gray-100 text-gray-600":"bg-gray-700 text-gray-400"}`,children:"Idle"})]}),s&&u&&h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx(hi,{duration:u,theme:t,onTimerExpired:()=>{console.log("Session timer expired")},showIcon:!1,className:"text-xs"})}),n&&h.jsx(Me.button,{onClick:Ee,whileHover:{scale:1.05},whileTap:{scale:.95},className:`p-1.5 rounded-md transition-all duration-200 ${L&&O?"hover:bg-white/10 text-white/70 hover:text-white":t==="light"?"hover:bg-gray-100 text-gray-400 hover:text-gray-600":"hover:bg-gray-700/40 text-gray-400 hover:text-gray-200"}`,"aria-label":"Close chat",children:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),h.jsx("div",{ref:T,className:`${re}`,style:{scrollBehavior:"smooth",scrollbarWidth:"none",contain:"layout style paint",overscrollBehavior:"contain"},onScroll:b,children:d.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-12",children:[h.jsx(Me.div,{animate:{scale:[1,1.05,1]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},className:"w-16 h-16 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-bold text-xl mb-6 shadow-xl",children:G}),h.jsxs("p",{className:`text-base mb-2 ${L&&O?"text-white":$.text.secondary}`,children:[z," is joining..."]}),h.jsx("p",{className:`text-xs ${L&&O?"text-gray-300":$.text.muted}`,children:"Your conversation will begin shortly"})]}):h.jsx("div",{className:"w-full space-y-3 py-4 px-3",children:h.jsxs("div",{className:"space-y-3",children:[d.map((P,ne)=>{var Se,pe,se,be;return h.jsx("div",{children:((Se=P.metadata)==null?void 0:Se.type)==="successView"?h.jsx("div",{className:"flex w-full justify-end mb-4 px-3",children:h.jsxs("div",{className:"relative group flex-row-reverse flex items-end gap-3 w-full min-w-0",children:[h.jsx(Me.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to-gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-br-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.own} min-w-0 max-w-[85%] break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((pe=P.metadata)==null?void 0:pe.type)==="timeoutView"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-3",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 w-full min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-[85%] break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((se=P.metadata)==null?void 0:se.type)==="visualization"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-3",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 w-full min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-[85%] break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):((be=P.metadata)==null?void 0:be.type)==="toolExecution"?h.jsx("div",{className:"flex w-full justify-start mb-4 px-3",children:h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 w-full min-w-0",children:[h.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-[85%] break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[P.metadata.view,h.jsx("div",{className:`text-xs ${$.text.muted} mt-1 opacity-70 transition-opacity duration-200`,children:P.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})}):h.jsx(YN,{message:P,theme:t,isOwn:P.sender.type==="participant",isStreaming:m.has(P.id)})},P.id)}),E==="thinking"&&!_&&h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.3},children:h.jsx(ZN,{theme:t})}),_&&_.presentationMode==="embedded"&&h.jsxs("div",{className:"relative group flex-row flex items-end gap-3 max-w-[85%] min-w-0",children:[h.jsx(Me.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1},className:`w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-semibold flex-shrink-0 shadow-lg ${t==="light"?"bg-gradient-to-br from-blue-500 to-purple-600":"bg-gradient-to-br from-gray-600 to_gray-700"}`,children:G}),h.jsxs("div",{className:`flex h-full flex-col justify-between border px-3 py-2 rounded-2xl shadow-lg backdrop-bl-sm message-bubble rounded-bl-md message-hover border-gray-200 dark:border-gray-700 ${$.chatMessage.other} min-w-0 max-w-full break-words overflow-hidden`,style:{overflowWrap:"anywhere",wordBreak:"break-word",hyphens:"auto"},children:[h.jsx(fi,{interaction:_,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},_.methodName),h.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:`text-xs ${$.text.muted} mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200`,children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]})]})})}),!R&&h.jsx(Me.button,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},onClick:()=>{A(!0),M(!1)},className:`absolute right-6 bottom-20 z-10 p-3 rounded-full shadow-lg backdrop-blur-sm border transition-all duration-200 hover:scale-105 ${t==="light"?"bg-white/90 text-gray-600 border-gray-200 hover:bg-white hover:text-gray-800":"bg-gray-800/90 text-gray-300 border-gray-700 hover:bg-gray-700 hover:text-white"}`,"aria-label":"Scroll to bottom",children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})}),l&&te.length>0&&h.jsx("div",{className:"w-full flex overflow-x-auto gap-2 px-4 py-2 mb-1 scrollbar-hide flex-shrink-0",children:te.map((P,ne)=>{var Se;return h.jsx("button",{className:`whitespace-nowrap px-3 py-1 rounded-full border shadow-sm flex-shrink-0 transition-all duration-150 font-medium text-sm focus:outline-none focus:ring-2 focus:ring-blue-400/40
|
|
65
65
|
${t==="light"?"bg-white text-blue-700 border-blue-200 hover:bg-blue-50 hover:text-blue-900":t==="dark"?"bg-gray-800 text-blue-300 border-gray-700 hover:bg-gray-700 hover:text-white":((Se=$.suggestedResponse)==null?void 0:Se.container)||"bg-gradient-to-br from-blue-500 to-purple-600 text-white border-blue-400 hover:from-blue-600 hover:to-purple-700"}
|
|
66
66
|
`,style:{boxShadow:t==="vox"?"0 2px 8px 0 rgba(80,60,200,0.10)":void 0,borderWidth:1},onClick:()=>{K(P),B([])},children:P},P+ne)})}),_&&_.presentationMode!=="embedded"&&h.jsx(fi,{interaction:_,theme:t,onDismiss:()=>e.dismissCurrentInteraction(),client:e,addLocalMessage:k},_.methodName),h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},className:H,children:h.jsx(Do,{modality:"chat",theme:t,disabled:r,showTextInput:!0,textInputPlaceholder:"Type a message...",onSendText:K,onSendAttachments:c?Z:void 0,supportsAttachments:c,showEndCall:!!o,onEndCall:o})})]})}const Bg=N.forwardRef(({disabled:e,sessionStarted:t,participantName:n="User",loadingText:r="Waiting for agent to connect...",theme:i="vox",client:o,displayType:s="widget",onBack:a},l)=>{var G,k,K,Z,X,ie;const[c,u]=N.useState(!1),[d,f]=N.useState(!1),[p,m]=N.useState(!1),[g,v]=N.useState(()=>{var Y;return((Y=o==null?void 0:o.getCurrentInteraction)==null?void 0:Y.call(o))||null}),[y,E]=N.useState(()=>t),w=N.useRef(null),_=N.useMemo(()=>{var re;const Y=(re=o==null?void 0:o.getCurrentAgentInfo)==null?void 0:re.call(o);return Oo(Y)},[o]),C=N.useMemo(()=>Po(_),[_]);N.useMemo(()=>up(_),[_]);const T=N.useRef(null),[R,A]=N.useState(64);N.useLayoutEffect(()=>{const Y=T.current;if(!Y)return;const re=()=>A(Y.offsetHeight||64);re();const H=new ResizeObserver(()=>re());return H.observe(Y),window.addEventListener("resize",re),()=>{H.disconnect(),window.removeEventListener("resize",re)}},[]),_w();const{agent:{isActive:I=!1}={}}=o?Cl(o):{agent:{isActive:!1}},b=oo(o,"microphone"),M=Pt(i),O=N.useMemo(()=>o!=null&&o.getCurrentSession?!!o.getCurrentSession():!1,[o]),L=N.useMemo(()=>o!=null&&o.getIsAgentConnected&&o.getIsAgentConnected()||p,[o,p]),j=I||L;N.useEffect(()=>{j&&y&&E(!1)},[j,y]),N.useEffect(()=>{if(t&&!j){const Y=setTimeout(()=>{O&&!j&&(console.log("⚡ SessionView: Auto-connecting agent after room connection"),m(!0),f(!1))},3e3),re=setTimeout(()=>{j||(console.warn("⏱️ SessionView: Agent connection timeout after 30s"),f(!0))},3e4);return()=>{clearTimeout(Y),clearTimeout(re)}}else j&&f(!1)},[t,j,O]),N.useEffect(()=>{if(!o)return;const Y=()=>{v(null),u(!1),f(!1)};return o.on("connection.disconnected",Y),()=>o.off("connection.disconnected",Y)},[o]),N.useEffect(()=>{if(!o)return;const Y=()=>{console.log("✅ SessionView: Agent connected event received"),m(!0),f(!1),E(!1)},re=Y,H=Y,Ee=ne=>{console.log("👤 SessionView: Participant joined:",ne),ne.isLocal||Y()},P=()=>{m(!1),t&&E(!0)};return o.on("agent.connected",Y),o.on("agent.speaking",re),o.on("agent.thinking",H),o.on("participant.joined",Ee),o.on("connection.disconnected",P),()=>{o.off("agent.connected",Y),o.off("agent.speaking",re),o.off("agent.thinking",H),o.off("participant.joined",Ee),o.off("connection.disconnected",P)}},[o,t]),N.useEffect(()=>{if(!o)return;const Y=()=>v(o.getCurrentInteraction()),re=()=>v(null);return o.on("rpc.interaction.started",Y),o.on("rpc.interaction.completed",re),o.on("rpc.interaction.timeout",re),o.on("rpc.interaction.dismissed",re),()=>{o.off("rpc.interaction.started",Y),o.off("rpc.interaction.completed",re),o.off("rpc.interaction.timeout",re),o.off("rpc.interaction.dismissed",re)}},[o]),N.useEffect(()=>{var re;if(!o)return;const Y=(re=o.getCurrentInteraction)==null?void 0:re.call(o);v(Y||null)},[o]),N.useEffect(()=>{var re,H;const Y=((H=(re=o==null?void 0:o.getCurrentSession)==null?void 0:re.call(o))==null?void 0:H.id)||null;w.current,w.current=Y},[o]),N.useEffect(()=>{g&&c&&u(!1)},[g,c]);const W=N.useCallback(Y=>{},[]),oe=N.useCallback(()=>{var Y,re,H;try{g&&(v(null),(Y=o==null?void 0:o.dismissCurrentInteraction)==null||Y.call(o)),u(!1),f(!1),(re=o==null?void 0:o.endSession)==null||re.call(o),(H=o==null?void 0:o.disconnect)==null||H.call(o),a==null||a()}catch(Ee){console.error("Failed to end call:",Ee),v(null),u(!1),f(!1),a==null||a()}},[o,g,a]),te=Be("w-full flex flex-col",s==="fullscreen"?"w-full max-w-none mx-0 h-full":"w-full mx-auto",M.main,s==="fullscreen"?"max-w-none":"","overflow-hidden h-full"),B=a&&(s==="popup"||s==="fullscreen"),$=N.useMemo(()=>d?"Agent is taking longer than expected...":O?"Room connected. Waiting for agent...":r,[d,O,r]),x=N.useMemo(()=>d?"Please check your connection or try again.":O?"The agent will join shortly.":"Agent is connecting... This may take a moment.",[d,O]),z=o.getCurrentAgentInfo();return y?h.jsxs("main",{ref:l,className:Be(te,"relative",e&&"pointer-events-none opacity-50"),children:[(B||C)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((G=M.chatHeader)==null?void 0:G.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:(z==null?void 0:z.agentName)||"Voice Session"})}),C&&h.jsx(hi,{duration:C,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsx("div",{className:"flex-1 flex items-center justify-center w-full",children:h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(Me.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:h.jsx(yo,{className:M.spinner,weight:"bold"})}),h.jsx(Me.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:$}),h.jsx(Me.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:x}),d&&a&&h.jsx(Me.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((k=M.chatHeader)==null?void 0:k.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})})]}):h.jsxs("main",{ref:l,className:Be(te,"relative",e&&"pointer-events-none opacity-50"),style:{minHeight:0},children:[(B||C)&&h.jsxs("div",{className:`flex items-center justify-between w-full p-4 border-b ${((K=M.chatHeader)==null?void 0:K.container)||"border-gray-200"}`,children:[h.jsx("div",{children:h.jsx("h3",{className:`font-semibold ${M.text.primary}`,children:"Voice Session"})}),C&&h.jsx(hi,{duration:C,theme:i,onTimerExpired:()=>{console.log("Session timer expired")}})]}),h.jsxs("div",{className:"w-full flex-1 flex flex-col items-center px-0 min-h-0 overflow-hidden relative",children:[!j&&h.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full min-h-[180px]",children:[h.jsx(Me.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mb-4",children:h.jsx(yo,{className:M.spinner,weight:"bold"})}),h.jsx(Me.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`text-sm opacity-80 ${M.text.muted} text-center max-w-xs`,children:$}),h.jsx(Me.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:2},className:`text-xs ${M.text.muted} mt-2 text-center opacity-60`,children:x}),d&&a&&h.jsx(Me.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:a,className:`mt-4 px-4 py-2 rounded-lg ${((Z=M.chatHeader)==null?void 0:Z.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]}),j&&h.jsxs(h.Fragment,{children:[c&&h.jsx("div",{className:Be("absolute inset-0 flex flex-col min-h-0 transition-[opacity,transform] duration-300 ease-out z-10",M.main),style:{bottom:0,top:0,left:0,right:0},children:h.jsx(Gl,{client:o,theme:i,displayType:s==="fullscreen"?"fullscreen":"widget",disabled:e,onBack:()=>u(!1),showTimer:!1})}),!c&&h.jsxs("div",{className:Be("flex-1 flex flex-col items-center w-full h-full min-h-0",(g==null?void 0:g.presentationMode)==="embedded"?"justify-end":"justify-center"),children:[h.jsx(Me.div,{className:"w-full flex justify-center",animate:{y:(g==null?void 0:g.presentationMode)==="embedded"?-8:0},transition:{duration:.3,ease:"easeOut"},children:h.jsx(vw,{chatOpen:c,client:o,theme:i},`media-tiles-${((ie=(X=o==null?void 0:o.getCurrentSession)==null?void 0:X.call(o))==null?void 0:ie.id)||"no-session"}`)}),h.jsx(Tr,{mode:"wait",children:g&&g.presentationMode==="embedded"&&h.jsx(Me.div,{initial:{opacity:0,y:20,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:20,height:0},transition:{duration:.3,ease:"easeOut"},className:Be("w-full relative mt-4 flex justify-center",s==="fullscreen"?"max-w-4xl":"max-w-md"),children:h.jsx("div",{className:"bg-white/10 backdrop-blur-sm rounded-xl border border-white/20 shadow-lg overflow-hidden",children:h.jsx(fi,{interaction:g,theme:i,onDismiss:()=>{var Y;return(Y=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:Y.call(o)},client:o,addLocalMessage:W})})},`embedded-${g.methodName}`)})]})]})]}),h.jsx(Tr,{mode:"wait",children:g&&g.presentationMode!=="embedded"&&!c&&h.jsx("div",{className:Be("absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm",s==="fullscreen"?"bg-black/70":"bg-black/50"),children:h.jsx(Me.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{duration:.2,ease:"easeOut"},className:Be("relative w-full overflow-hidden",s==="fullscreen"?"max-w-2xl mx-8 max-h-[85vh]":"max-w-lg mx-4 max-h-[80vh]","bg-white dark:bg-gray-900 rounded-2xl shadow-2xl","border border-gray-200 dark:border-gray-700"),children:h.jsx(fi,{interaction:g,theme:i,onDismiss:()=>{var Y;return(Y=o==null?void 0:o.dismissCurrentInteraction)==null?void 0:Y.call(o)},client:o,addLocalMessage:W})},`modal-${g.methodName}`)})}),h.jsx("div",{ref:T,className:"relative z-30 mt-auto w-full",children:h.jsx(Do,{modality:"voice",theme:i,disabled:e,showMicrophone:!0,microphoneEnabled:b.enabled,microphoneLoading:b.pending,onToggleMicrophone:()=>b.toggle(),showChatToggle:!0,chatOpen:c,onToggleChat:()=>u(!c),showEndCall:!0,onEndCall:oe})})]})});Bg.displayName="SessionView";function Bd({trackRef:e,participant:t,isLocal:n=!1,className:r="",theme:i}){var l;const o=Pt(i),s=(t==null?void 0:t.name)||(t==null?void 0:t.identity)||(n?"You":"Participant"),a=(e==null?void 0:e.publication)&&!e.publication.isMuted;return h.jsxs("div",{className:`relative rounded-lg overflow-hidden ${o.video.tile} ${r}`,children:[a?h.jsx(Rt.VideoTrack,{trackRef:e,className:"w-full h-full object-cover"}):h.jsx("div",{className:`w-full h-full flex items-center justify-center ${o.video.placeholder}`,children:h.jsx("div",{className:"text-center",children:h.jsx("div",{className:`w-16 h-16 mx-auto mb-2 rounded-full flex items-center justify-center ${o.video.avatar}`,children:h.jsx(ot.User,{className:"w-8 h-8"})})})}),h.jsx("div",{className:`absolute bottom-2 left-2 px-2 py-1 rounded text-xs ${o.video.nameOverlay}`,children:s}),((l=e==null?void 0:e.publication)==null?void 0:l.isMuted)&&h.jsx("div",{className:`absolute top-2 right-2 p-1 rounded ${o.video.mutedIndicator}`,children:h.jsx(ot.CameraOff,{className:"w-4 h-4"})})]})}function $g({client:e,theme:t="vox",onBack:n,disabled:r=!1,displayType:i,onEndCall:o}){var K;const s=Pt(t),[a,l]=D.useState(!1),[c,u]=D.useState(!1),d=D.useMemo(()=>{const Z=e.getCurrentAgentInfo();return Oo(Z)},[e]),{userVideoEnabled:f,agentAvatarEnabled:p,screenshareEnabled:m}=D.useMemo(()=>lp(d),[d]),g=D.useMemo(()=>Po(d),[d]),v=D.useRef(null),[y,E]=D.useState(64);D.useLayoutEffect(()=>{const Z=v.current;if(!Z)return;const X=()=>E(Z.offsetHeight||64);X();const ie=new ResizeObserver(()=>X());return ie.observe(Z),window.addEventListener("resize",X),()=>{ie.disconnect(),window.removeEventListener("resize",X)}},[]);const[w,_]=D.useState(null),C=Iv(e),{videoTrackRefs:T,screenShareTrackRefs:R}=Ov(e),{agent:{isActive:A=!1}={},state:I="idle",audioTrack:b}=e?Cl(e):{agent:{isActive:!1},state:"idle",audioTrack:null},M=D.useMemo(()=>e.getRemoteParticipants(),[e,C]),O=oo(e,"microphone"),L=oo(e,"camera"),j=oo(e,"screenShare"),W=D.useCallback(async()=>{L.pending||await L.toggle()},[L]),oe=D.useCallback(async()=>{j.pending||await j.toggle()},[j]),te=D.useCallback(()=>{l(Z=>!Z)},[]),B=D.useCallback(()=>{o?o():n&&n()},[o,n]);D.useEffect(()=>{if(!e)return;const Z=X=>{console.log("📺 Video: Interactive UI state updated:",X),_(X)};return e.on("interactive.ui.update",Z),e.on("interactive.ui.show",Z),()=>{e.off("interactive.ui.update",Z),e.off("interactive.ui.show",Z)}},[e]),D.useEffect(()=>{if(A)u(!1);else{const Z=setTimeout(()=>{A||u(!0)},3e4);return()=>{clearTimeout(Z)}}},[A]);const $=C==null?void 0:C.localParticipant,x=D.useMemo(()=>(e?e.getCameraTrackRefs():[]).find(Z=>Z.participant===$),[e,$]),G=T.filter(Z=>Z.participant!==$)[0],k=D.useMemo(()=>(R||[]).find(Z=>Z.participant===$),[R,$]);return h.jsxs("div",{className:`flex flex-col h-full ${s.video.container} relative`,children:[h.jsxs("div",{className:`flex items-center justify-between p-4 border-b ${s.video.header}`,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${s.video.statusDot}`}),h.jsx("span",{className:"font-medium",children:"Video Call"}),h.jsxs("span",{className:"text-sm opacity-70",children:[M.length+1," participant",M.length!==0?"s":""]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[g&&h.jsx(hi,{duration:g,theme:t,onTimerExpired:()=>{console.log("Session timer expired")}}),h.jsx("button",{className:`p-2 rounded-lg transition-colors ${s.video.headerButton}`,title:"Layout options",children:h.jsx(ot.LayoutGrid,{className:"w-4 h-4"})})]})]}),h.jsxs("div",{className:"relative flex-1 min-h-0",children:[!A&&h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsxs("div",{className:"text-center",children:[h.jsx(Me.div,{animate:{rotate:360,scale:[1,1.1,1]},transition:{rotate:{duration:2,repeat:1/0,ease:"linear"},scale:{duration:1,repeat:1/0,ease:"easeInOut"}},className:"w-12 h-12 mx-auto",children:h.jsx(yo,{className:s.spinner,weight:"bold"})}),c&&n&&h.jsx(Me.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.5},onClick:n,className:`mt-4 px-4 py-2 rounded-lg ${((K=s.chatHeader)==null?void 0:K.backButton)||"bg-gray-100 hover:bg-gray-200"} transition-colors`,children:"Go Back"})]})}),A&&!a&&h.jsx("div",{className:"p-4 min-h-0 h-full",children:h.jsxs("div",{className:"relative w-full h-full overflow-hidden",children:[p?G?h.jsx(Bd,{trackRef:G,participant:G.participant,isLocal:!1,theme:t,className:"w-full h-full"}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsx(ot.Users,{className:"w-12 h-12 mx-auto mb-4 opacity-50"})})}):h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{className:"text-center",children:h.jsxs("div",{className:"mb-4",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gradient-to-br from-[#6721a4] to-[#5c64f6] flex items-center justify-center",children:h.jsx(ot.User,{className:"w-8 h-8 text-white"})}),A&&(b?h.jsx(Rt.BarVisualizer,{barCount:5,state:I,options:{minHeight:5},trackRef:b,className:"flex items-center justify-center gap-1",children:h.jsx("span",{className:Be(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear","data-[lk-highlighted=true]:bg-[#5c64f6]","data-[lk-muted=true]:bg-[#222222]"])})}):h.jsx("div",{className:"flex items-center justify-center gap-1",children:Array.from({length:5}).map((Z,X)=>h.jsx("span",{className:Be(["bg-[#6721a4] min-h-2 w-2 rounded-full","origin-center transition-colors duration-250 ease-linear",I==="speaking"&&"bg-[#5c64f6]",I==="thinking"&&"animate-pulse bg-yellow-500"])},X))}))]})})}),k&&h.jsx("div",{className:"absolute bottom-4 left-0 sm:left-0 z-10 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsxs("div",{className:"relative w-full h-full bg-black/40",children:[h.jsx(Rt.VideoTrack,{trackRef:k,className:"w-full h-full object-contain"}),h.jsx("div",{className:`absolute top-1 left-1 px-1.5 py-0.5 rounded text-xs ${s.video.nameOverlay}`,children:h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(ot.Monitor,{className:"w-3 h-3"}),h.jsx("span",{className:"text-xs",children:"Sharing"})]})})]})}),x&&f&&h.jsx("div",{className:"absolute bottom-4 right-0 w-32 sm:w-36 h-20 sm:h-24 rounded-lg overflow-hidden shadow-xl border border-white/20",children:h.jsx(Bd,{trackRef:x,participant:$||void 0,isLocal:!0,theme:t,className:"w-full h-full"})})]})})]}),h.jsx(Tr,{mode:"wait",children:a&&h.jsx(Me.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeOut"},className:Be("absolute left-0 right-0 top-0 flex flex-col z-20",t==="light"?"bg-white":"bg-gray-900/95 backdrop-blur-sm"),style:{bottom:`${y}px`},children:h.jsx(Gl,{client:e,theme:t,displayType:i==="fullscreen"?"fullscreen":"widget",disabled:r,onBack:()=>l(!1),showTimer:!1})})}),h.jsx("div",{ref:v,className:"relative z-30 mt-auto",children:h.jsx(Do,{modality:"video",theme:t,disabled:r,showMicrophone:!0,microphoneEnabled:O.enabled,microphoneLoading:O.pending,onToggleMicrophone:()=>O.toggle(),showCamera:f,cameraEnabled:L.enabled,cameraLoading:L.pending,onToggleCamera:W,showScreenShare:m,screenShareEnabled:j.enabled,screenShareLoading:j.pending,onToggleScreenShare:oe,showChatToggle:!0,chatOpen:a,onToggleChat:te,showEndCall:!0,onEndCall:B})})]})}const $d=e=>e,oA=()=>{let e=$d;return{configure(t){e=t},generate(t){return e(t)},reset(){e=$d}}},sA=oA();function Pn(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Jn(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":Pn(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Yi={exports:{}},Zi={exports:{}},$e={};/** @license React v16.13.1
|
|
67
67
|
* react-is.production.min.js
|