@talkjs/web-components 0.0.35 → 0.0.36
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/default.cjs +5 -5
- package/default.js +12 -12
- package/package.json +1 -1
package/default.cjs
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
</div>
|
|
90
90
|
`,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,E=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let A=0,g=0,O=0;for(let S=0;S<=a;S++){const T=Math.round(S*m);if(T>A){const y=Math.round(g*c*i),_=y+Math.round(O*c*i)||1;let D=c-y;t.barAlign==="top"?D=0:t.barAlign==="bottom"&&(D=u-_),r[E](A*(h+p),D,h,_,f),A=T,g=0,O=0}const I=Math.abs(o[S]||0),C=Math.abs(s[S]||0);I>g&&(g=I),C>O&&(O=C)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const A=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,A),h=m,p=0}const E=Math.abs(a[f]||0);E>p&&(p=E)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Wr.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const E=t.barWidth||.5,A=E+(t.barGap||E/2);c%A!=0&&(c=Math.floor(c/A)*A)}const h=E=>{if(E<0||E>=p||d[E])return;d[E]=!0;const A=E*c,g=Math.min(u-A,c);if(g<=0)return;const O=e.map(S=>{const T=Math.floor(A/u*S.length),I=Math.floor((A+g)/u*S.length);return S.slice(T,I)});this.renderSingleCanvas(O,t,g,i,A,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:E}=this.scrollContainer,A=Math.floor(E/u*p);Object.keys(d).length>Wr.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(A-1),h(A),h(A+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return je(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return je(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}}Wr.MAX_CANVAS_WIDTH=8e3,Wr.MAX_NODES=10;class tO extends _o{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}}class ap extends _o{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return je(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then(t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()}).then(t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t)).then(t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var e;if(!this.paused)return;this.paused=!1,(e=this.bufferNode)===null||e===void 0||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,(e=this.bufferNode)===null||e===void 0||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return je(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,r;const i=e-this.currentTime;(t=this.bufferNode)===null||t===void 0||t.stop(this.audioContext.currentTime+i),(r=this.bufferNode)===null||r===void 0||r.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(e){return je(this,void 0,void 0,function*(){return this.audioContext.setSinkId(e)})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return(e=this._duration)!==null&&e!==void 0?e:((t=this.buffer)===null||t===void 0?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let r=0;r<t;r++)e.push(this.buffer.getChannelData(r));return e}}const nO={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};class Qi extends eO{static create(e){return new Qi(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new ap:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},nO,e),this.timer=new tO;const r=t?void 0:this.getMediaElement();this.renderer=new Wr(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).catch(()=>null)})}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}}))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",()=>{const e=this.updateProgress();this.emit("timeupdate",e)}),this.onMediaEvent("play",()=>{this.emit("play"),this.timer.start()}),this.onMediaEvent("pause",()=>{this.emit("pause"),this.timer.stop()}),this.onMediaEvent("emptied",()=>{this.timer.stop()}),this.onMediaEvent("ended",()=>{this.emit("finish")}),this.onMediaEvent("seeking",()=>{this.emit("seeking",this.getCurrentTime())}),this.onMediaEvent("error",e=>{this.emit("error",e.error)}))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",(e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))}),this.renderer.on("dblclick",(e,t)=>{this.emit("dblclick",e,t)}),this.renderer.on("scroll",(e,t,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),this.renderer.on("render",()=>{this.emit("redraw")}),this.renderer.on("rendered",()=>{this.emit("redrawcomplete")}),this.renderer.on("dragstart",e=>{this.emit("dragstart",e)}),this.renderer.on("dragend",e=>{this.emit("dragend",e)}));{let e;this.subscriptions.push(this.renderer.on("drag",t=>{if(!this.options.interact)return;let r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach(e=>e()),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),e.mediaControls!=null&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",()=>{this.plugins=this.plugins.filter(t=>t!==e)})),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,r,i){return je(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield Q0.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof ap&&(a.duration=s)}if(r)this.decodedData=op.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield op.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return je(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return je(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return je(this,void 0,void 0,function*(){return this.isPlaying()?this.pause():this.play()})}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return je(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}}function Zs({src:n,onError:e,filename:t,className:r=""}){const i=Q(null),o=Q(),s=Q(),[a,l]=ie(!1),[u,c]=ie(0),[d,h]=ie(1),p=Q(),[f,m]=ie(!1),E=ne(ce().t$);Y(()=>{o.current=new Audio;const O={normalize:!0,height:50,container:i.current};function S(){const C=o.current;C&&(C.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(C.load(),l(!1)):(m(!0),l(!1),e==null||e()))}const T=t.slice(t.lastIndexOf(".")+1);if(function(C){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(C)}(t)&&T==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))O.backend="WebAudio",s.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),s.current.controls=!1;else{const C=o.current;C.addEventListener("error",S),C.src=n,C.preload="auto",C.preservesPitch=!0,O.media=C}p.current=function(C){var k,L,H,N,w,$,U,G;if(!C.container)return;const y=getComputedStyle(C.container),_=(k=eo.parse(y.color))!=null?k:new eo(255,255,255,1),D=_.withAlpha(_.alpha/2);return Qi.create({...C,barGap:(L=C.barGap)!=null?L:2,barRadius:(H=C.barRadius)!=null?H:0,barWidth:(N=C.barWidth)!=null?N:2,barHeight:C.barHeight,hideScrollbar:!0,cursorWidth:(w=C.cursorWidth)!=null?w:0,cursorColor:C.cursorColor,height:($=C.height)!=null?$:24,progressColor:(U=C.progressColor)!=null?U:D.toRgbaString(),waveColor:(G=C.waveColor)!=null?G:D.toRgbaString()})}(O);const I=p.current;return I.on("finish",()=>{o.current.loop=!0,l(!1)}),I.on("ready",C=>c(Math.trunc(C))),I.on("timeupdate",C=>c(Math.trunc(C))),O.backend==="WebAudio"&&I.load(n).catch(()=>{m(!0),l(!1),e==null||e()}),()=>{var C;(C=o.current)==null||C.removeEventListener("error",S),o.current=void 0,I.destroy(),p.current=void 0}},[n,t,e]);const A=ee(()=>{var O;if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l((O=p.current.isPlaying())!=null?O:!1);else{const S=o.current;S.paused?S.play():S.pause(),S.loop=!1,!S.paused&&S.ended&&(S.load(),S.play()),l(!S.paused)}},[]),g=ee(O=>{p.current.setPlaybackRate(O),h(O)},[]);return v("div",f?{}:{className:`t-audio-player ${r}`,children:[v("button",{onClick:A,children:v(Rs,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?E.ARIA_PAUSE_AUDIO:E.ARIA_PLAY_AUDIO})}),v("div",{className:"t-waveform",ref:i}),v("div",{className:"t-duration",children:_c(u)}),v(Rr,{type:"menu",popoverComponent:iO,popoverProps:{playbackSpeed:d,selectPlaybackSpeed:g},className:"t-playback-speed","aria-label":E.ARIA_SET_PLAYBACK_SPEED,children:[d,"x",v(Rs,{type:"updown",className:"t-up-down-icon","aria-hidden":!0})]})]})}Qi.BasePlugin=class extends _o{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},Qi.dom=Z0;const rO=[.25,.5,.75,1,1.25,1.5,2];function iO({playbackSpeed:n,selectPlaybackSpeed:e}){return v("div",{className:"t-playback-speed-menu",children:[v("div",{className:"t-playback-heading",children:"Playback Speed"}),rO.map(t=>v(An,{className:"t-menu-item",onSelect:()=>e(t),children:[v("span",{className:"t-playback-checkmark",children:n===t?"✓ ":""}),t,"x"]},t))]})}const oO=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,sO=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/;class eo{constructor(e,t,r,i){this.red=e,this.green=t,this.blue=r,this.alpha=i}static parse(e){var r;const t=(r=e.match(oO))!=null?r:e.match(sO);if(t){const[i,o,s,a,l="1"]=t;return new eo(Number(o),Number(s),Number(a),Number(l))}return null}withAlpha(e){return new eo(this.red,this.green,this.blue,e)}toRgbaString(){const{red:e,green:t,blue:r,alpha:i}=this;return i!==1?`rgba(${e}, ${t}, ${r}, ${i})`:`rgb(${e}, ${t}, ${r})`}}const lA=/^\/.*[^\\]\/[im]*$/;function lp(n){return lA.test(n)?!Cs(n).test(""):!1}function Cs(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function uA(n){const e=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+e+"$","i")}function aO(n,e){const t=Sm(e),r=uA(n);return t!==void 0&&r.test(t)}const lO=/^[]/g;function cA(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function Zl(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(Zl||(Zl={}));const yr=Zl,uO=new RegExp(":arslan:|"+/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g.source,"g"),cO=/\uFE0F/g,dO="";function hO(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(dO)<0?t.replace(cO,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class dA{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,forbiddenWords:s,suppressLinks:a,suppressEmailAddresses:l,suppressPhoneNumbers:u,replacement:c}){if(yr.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=a!==!1,this.suppressEmailAddresses=l!==!1,this.suppressPhoneNumbers=u!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(d=>d).map(d=>d.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(lp).map(d=>Cs(d)),this.forbiddenMatches=(o||[]).filter(lp).map(d=>Cs(d)),s){const d=s.split(`
|
|
91
91
|
`).map(h=>h.trim().toLowerCase()).filter(h=>h.length>0&&!h.startsWith("#")).map(h=>cA(h));d.length&&this.forbiddenMatches.push(new RegExp(`\\b(${d.join("|")})\\b`,"gi"))}yr(()=>this.allowedMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),yr(()=>this.forbiddenMatches.every(d=>d.flags.includes("g")),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),c=c==null?void 0:c.trim(),this.replacement=c&&c.length>0?c:void 0}shouldSuppress({isContentBySender:e}){return this.mode==="all"||this.mode==="otherOnly"&&!e}}function uc(n){var t,r,i,o,s,a,l,u,c,d,h,p,f;let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(t=n.formattedLinks)!=null?t:"plaintext",markup:(r=n.markup)!=null?r:!1,useFallbackMentions:(i=n.useFallbackMentions)!=null?i:!1,sameTabLinkRules:(o=n.sameTabLinkRules)!=null?o:[],enableEmojiImageFallback:(s=n.enableEmojiImageFallback)!=null?s:!1,highlight:(a=n.highlight)!=null?a:[],contactInfo:(l=n.contactInfo)!=null?l:!1,suppression:(u=n.suppression)!=null?u:new dA({mode:"off"}),contactInfoHiddenText:(h=(d=n.contactInfoHiddenText)!=null?d:(c=n.suppression)==null?void 0:c.replacement)!=null?h:e,customEmojiUrls:(p=n.customEmojiUrls)!=null?p:{},enableActions:(f=n.enableActions)!=null?f:!0}}function pO({id:n,text:e}){var i;const t=ce(),r=ne(()=>{var a;if(t.type==="ConversationListStore")return;const o=t.state$.extCurrentConversationId.get(),s=o&&t.state$.participants.child(o).get();return(a=s==null?void 0:s.find(l=>l.user.id===n))==null?void 0:a.user});return v("span",{className:"t-mention","t-is-current-user":ne(t.extUserId$)===n?"":void 0,children:`@${(i=r==null?void 0:r.name)!=null?i:e}`})}function fO({message:n,type:e,action:t,params:r,children:i}){const o=mo(),s=ee(l=>{l.preventDefault(),o.triggerMessageAction(n,t,r)},[o,n,t,r]),a={"t-action":t,onClick:s};return e==="actionButton"?v("button",{...a,type:"button",children:i}):v("a",{...a,href:"#",children:i})}function Xr(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return el(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return mO(r,e);case"bulletlist":case"bulletList":return[de("ul",null,...Xr(r.children,e))];case"autolink":case"autoLink":case"link":return AO(r,e);case"codeblock":case"codeBlock":return[v("code",{"data-language":r.language,children:el(r.text,e.highlight)})];case"codespan":case"codeSpan":return v("code",{children:el((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return yr.falsy(e.useFallbackMentions),v(pO,{id:r.id,text:r.text},r.id);case"suppressed":return[v("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[v(EO,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return _O(r,e);case"customemoji":case"customEmoji":return r.text;default:yr.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function el(n,e){if(e.length===0)return[n];const t=function(i){const o=i.map(a=>a.trim()).filter(a=>a);if(o.length===0)return lO;const s=o.map(cA).join("|");return new RegExp(s,"gi")}(e),r=Vs(n,t).map(i=>({offset:i.index,matchedText:i[0]}));return Sl(n,r,({matchedText:i})=>[v("span",{className:"highlighted-text",children:i})])}const mO=(n,e)=>[de({bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type],null,...Xr(n.children,e))];function EO({unicode:n}){const[e,t]=ie(()=>n!==":arslan:");return Y(()=>{e&&!_m(n)&&t(!1)},[]),e?v("span",{className:"t-emoji",children:n}):v("img",{className:"t-emoji",src:hO(n),alt:n})}const AO=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":return[de("a",{target:function(r,i){for(const o of r)if(lA.test(o)){if(Cs(o).test(i))return"_top"}else if(aO(o,i))return"_top";return"_blank"}(e.sameTabLinkRules,n.url),href:n.url,rel:"noreferrer"},...Xr(t,e))];case"plaintext":return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[de(xe,null,...Xr(t,e))];default:yr.never(e.formattedLinks)}},_O=(n,e)=>e.enableActions?[de(fO,{type:n.type==="actionlink"?"actionLink":n.type==="actionbutton"?"actionButton":n.type,action:n.action,params:n.params,message:e.message},...Xr(n.children,e))]:n.children;function gO(n,e){return Zo(n,uc(e))}function Zo(n,e){return n.flatMap(t=>{if(typeof t=="string"){let r=[t];return r=tl(r,i=>function(o,s){const{suppression:{forbiddenMatches:a,allowedMatches:l}}=s,u=rc(a,c=>Vs(o,c)).filter(([c])=>!l.some(d=>c.match(d)!==null)).map(c=>({offset:c.index,matchedText:c[0]}));return Sl(o,u,()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}])}(i,e)),r=tl(r,i=>function(o){return Sl(o,function(s){const a=[];let l;for(;l=uO.exec(s);){const u=l[0],c=l.index;a.push({offset:c,matchedText:u})}return a}(o),s=>[{type:"emoji",text:s.matchedText}])}(i)),r=tl(r,i=>function(o,s){if(s.contactInfo!=="suppress")return[o];const a=[];if((s.suppression.suppressEmailAddresses||s.suppression.suppressLinks)&&a.push(XE),s.suppression.suppressPhoneNumbers&&a.push(WE),a.length===0)return[o];const l=JE(o,{multilineSteps:[],singlelineSteps:a}),u=l.map(c=>typeof c=="string"?c:up(c.url,s.suppression)?c.text:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"});return sc(u)}(i,e)),r}switch(t.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:t.type,children:Zo(t.children,e)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return t;case"mention":return{type:"mention",id:t.id,text:t.text};case"autolink":case"autoLink":return function(r,i){return i.contactInfo==="link"?r:i.contactInfo==="suppress"?up(r.url,i.suppression)?r:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:r.text}(t,e);case"link":return{type:"link",url:t.url,children:Zo(t.children,e)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:t.type,action:t.action,params:t.params,children:Zo(t.children,e)}}})}function tl(n,e){return rc(n,t=>typeof t=="string"?e(t):[t])}function up(n,e){if(e.allowedMatches.some(t=>n.match(t)!==null))return!0;if(e.forbiddenMatches.some(t=>n.match(t)!==null))return!1;if(n.startsWith("mailto:")){const t=n.substring(7).replace(/^.*@/,"");return!e.suppressEmailAddresses||cp(e.allowedHostnames,t)}if(n.startsWith("tel:")){const t=n.substring(4).replace(/[^0-9]/g,"");return!e.suppressPhoneNumbers||e.allowedPhoneNrs.some(r=>t.endsWith(r))}{const t=Sm(n);return!e.suppressLinks||!t||cp(e.allowedHostnames,t)}}function cp(n,e){for(const t of n)if(uA(t).test(e))return!0;return!1}function cc({block:n,nonInteractive:e,message:t,className:r=""}){const i=!e,{nodes:o,roleOptions:s}=function(l,u){var g;const c=ce(),d=ne(c.app$.role);pe.defined(d);const h=u.type==="UserMessage",p=((g=u.sender)==null?void 0:g.id)===c.extUserId$.peek(),f=d.suppressContactInfo,m=h&&f.shouldSuppress({isContentBySender:p}),E=gO(l.children,{contactInfo:m?"suppress":"link",suppression:f}),A={sameTabLinkRules:d.sameTabLinkRules,contactInfoHiddenText:d.suppressContactInfo.replacement||`(${c.t$.peek().CONTACT_INFORMATION_HIDDEN})`};return{nodes:E,roleOptions:A}}(n,t),a=function(l,u={},c){return Xr(l,{...uc(u),message:c})}(o,{enableEmojiImageFallback:!0,formattedLinks:i?"link":"plaintext",enableActions:i,...s},t);return de("span",{className:`t-text ${r}`},...a)}function hA(n){const e=kt(),t=ce(),{className:r="",...i}=n,o=ne(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return v("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>{var a;return v(DO,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+((a=n.message.editedAt)!=null?a:0))})})}function DO({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:pe.never(a)}}(r,e);return v(o,{block:e,common:n,message:t,downloadUrl:i})}const OO=27;function go(n,e,t=!0){const r=ee(o=>{o.keyCode===OO&&n()},[n]),i=ee(o=>{o.target.closest(e)===null&&n()},[e,n]);Y(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}const SO=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{grid-template-columns:repeat(auto-fill,var(--total-emoji-size));padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}";function pA(n){const[e,t]=ie();return Y(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function dc(n){const{onClose:e,onEmojiSelected:t}=Dg(),r=Q(null),i=pA(xu);return Y(()=>{if(!i)return;pe.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,SO);const a=u=>{var d;const c=(d=u.detail.unicode)!=null?d:u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),Y(()=>{var o;i&&r.current&&((o=r.current.shadowRoot.getElementById("search"))==null||o.focus())},[i]),go(()=>e(),".t-emoji-picker"),v("div",i?{className:"t-emoji-picker",children:v("emoji-picker",{ref:r,class:n.colorScheme})}:{className:"t-emoji-picker","t-loading":"",children:v(ac,{})})}function fA({messageId:n,colorScheme:e}){const{closePopover:t}=Uu(),r=mo();return v("div",{className:"t-reaction-picker",children:v(fm.Provider,{value:{onClose:t,onEmojiSelected:i=>{r.addReaction(n,i),t()}},children:v(dc,{colorScheme:e})})})}function Ql(){return Ql=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ql.apply(this,arguments)}function mA(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function eu(n,e){return eu=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},eu(n,e)}function EA(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,eu(n,e)}function AA(){}function _A(){}_A.resetWarningCache=AA;function dp(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:_A,resetWarningCache:AA};t.PropTypes=t})();const hp=!1,gA=dt.createContext(null);var Ci="unmounted",Fn="exited",Pn="entering",Ar="entered",tu="exiting",Zt=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=Fn,o.appearStatus=Pn):s=Ar:s=r.unmountOnExit||r.mountOnEnter?Ci:Fn,o.state={status:s},o.nextCallback=null,o}EA(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===Ci?{status:Fn}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==Pn&&o!==Ar&&(i=Pn):o!==Pn&&o!==Ar||(i=tu)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===Pn?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===Fn&&this.setState({status:Ci})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[dt.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||hp?this.safeSetState({status:Ar},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:Pn},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:Ar},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:dt.findDOMNode(this);i&&!hp?(this.props.onExit(s),this.safeSetState({status:tu},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:Fn},function(){r.props.onExited(s)})})})):this.safeSetState({status:Fn},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:dt.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===Ci)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=mA(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return dt.createElement(gA.Provider,{value:null},typeof o=="function"?o(r,s):dt.cloneElement(dt.Children.only(o),s))},e}(dt.Component);function hr(){}Zt.contextType=gA,Zt.propTypes={},Zt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:hr,onEntering:hr,onEntered:hr,onExit:hr,onExiting:hr,onExited:hr},Zt.UNMOUNTED=Ci,Zt.EXITED=Fn,Zt.ENTERING=Pn,Zt.ENTERED=Ar,Zt.EXITING=tu;var nl=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=dp(r.className,i):r.setAttribute("class",dp(r.className&&r.className.baseVal||"",i)));var r,i})},nu=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}EA(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&nl(r,s),a&&nl(r,a),l&&nl(r,l)},t.render=function(){var r=this.props;r.classNames;var i=mA(r,["classNames"]);return dt.createElement(Zt,Ql({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(dt.Component);nu.defaultProps={classNames:""},nu.propTypes={};const TO={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function DA(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=TO[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function OA({focused:n,setFocused:e,buttonId:t}){Et(()=>{var a;const s=t(n);s&&((a=document.getElementById(s))==null||a.scrollIntoView({block:"nearest"}))},[n,t]);const r=ee(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=Z(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=ee(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function SA(n){const[e,t]=ie([]),[r,i]=ie([]),[o,s]=ie(0),[a,l]=ie(0),u=pA(xu),c=Z(()=>u&&new u.value.Database({}),[u]),d=po(),h=ne(d.state$.suggestEmojiQuery);Y(()=>{c&&(h?async function(){const g=await c.getPreferredSkinTone();l(g);let O=await c.getEmojiBySearchQuery(h);if(O=O.filter(S=>S.url||function(T){return T.version<=gm&&!CO.includes(T.unicode)}(S)),function(S,T){T.sort((I,C)=>{var D,k;const y=(D=I.shortcodes)==null?void 0:D.find(L=>L.startsWith(S)),_=(k=C.shortcodes)==null?void 0:k.find(L=>L.startsWith(S));return y&&!_?-1:!y&&_?1:y&&_?y.length-_.length:0})}(h.substring(1),O),s(0),t(O),O.length>0&&i(O),h.endsWith(":")){const S=h.slice(1,-1),T=O.find(I=>{var C;return(C=I.shortcodes)==null?void 0:C.includes(S)});T&&d.selectEmoji(Ii(T,g))}}():t([]))},[h,d,c]);const p=ee(g=>{const O=e[g];return O&&"emoji-button-"+Ii(O,a)},[e,a]),{containerProps:f,itemProps:m}=OA({focused:o,setFocused:s,buttonId:p}),E=e.length>0;go(()=>d.closeSuggester(),".t-emoji-suggest-bar",E),Y(()=>{if(E)return d.listenKeydown("emoji",g=>DA(g,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const O=e[o];pe.defined(O),d.selectEmoji(Ii(O,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,E,a]);const A=Q(null);return v(nu,{in:E,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:A,children:v("div",{className:"t-emoji-suggest-bar",ref:A,...f,children:r.map((g,O)=>v(RO,{emoji:g,skinTone:a,focused:O===o,onSelect:S=>d.selectEmoji(S),...m(O)},Ii(g,a)))})})}function Ii(n,e){return ru(n)?TA(n,e):n.name}function ru(n){return!!n.unicode}function RO(n){var l;const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=((l=e.shortcodes)!=null?l:[]).join(", "),a=ru(e)?[e.unicode,s].join(", "):s;return v("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(Ii(e,r)),...o,children:ru(e)?TA(e,r):null})}function TA(n,e){var r,i;const t=(r=n.skins)==null?void 0:r.find(o=>o.tone===e);return(i=t==null?void 0:t.unicode)!=null?i:n.unicode}const CO=["🏻","🏼","🏽","🏾","🏿"],IO=["top","right","bottom","left"],iu=Math.min,br=Math.max,Is=Math.round,Bo=Math.floor,zt=n=>({x:n,y:n}),vO={left:"right",right:"left",bottom:"top",top:"bottom"},NO={start:"end",end:"start"};function hc(n,e){return typeof n=="function"?n(e):n}function to(n){return n.split("-")[0]}function pc(n){return n.split("-")[1]}function RA(n){return n==="y"?"height":"width"}const yO=new Set(["top","bottom"]);function Tr(n){return yO.has(to(n))?"y":"x"}function CA(n){return Tr(n)==="x"?"y":"x"}function ou(n){return n.replace(/start|end/g,e=>NO[e])}const pp=["left","right"],fp=["right","left"],bO=["top","bottom"],kO=["bottom","top"];function LO(n,e,t,r){const i=pc(n);let o=function(s,a,l){switch(s){case"top":case"bottom":return l?a?fp:pp:a?pp:fp;case"left":case"right":return a?bO:kO;default:return[]}}(to(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ou)))),o}function Ho(n){return n.replace(/left|right|bottom|top/g,e=>vO[e])}function vs(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function mp(n,e,t){let{reference:r,floating:i}=n;const o=Tr(e),s=CA(e),a=RA(s),l=to(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(pc(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function su(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=hc(e,n),f=function(T){return typeof T!="number"?function(I){return{top:0,right:0,bottom:0,left:0,...I}}(T):{top:T,right:T,bottom:T,left:T}}(p),m=a[h?d==="floating"?"reference":"floating":d],E=vs(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),A=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,g=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),O=await(o.isElement==null?void 0:o.isElement(g))&&await(o.getScale==null?void 0:o.getScale(g))||{x:1,y:1},S=vs(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:g,strategy:l}):A);return{top:(E.top-S.top+f.top)/O.y,bottom:(S.bottom-E.bottom+f.bottom)/O.y,left:(E.left-S.left+f.left)/O.x,right:(S.right-E.right+f.right)/O.x}}function Ep(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function Ap(n){return IO.some(e=>n[e]>=0)}function Qs(){return typeof window!="undefined"}function Kr(n){return IA(n)?(n.nodeName||"").toLowerCase():"#document"}function ft(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Vt(n){var e;return(e=(IA(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function IA(n){return!!Qs()&&(n instanceof Node||n instanceof ft(n).Node)}function It(n){return!!Qs()&&(n instanceof Element||n instanceof ft(n).Element)}function Gt(n){return!!Qs()&&(n instanceof HTMLElement||n instanceof ft(n).HTMLElement)}function _p(n){return!(!Qs()||typeof ShadowRoot=="undefined")&&(n instanceof ShadowRoot||n instanceof ft(n).ShadowRoot)}const wO=new Set(["inline","contents"]);function no(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=vt(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!wO.has(i)}const MO=new Set(["table","td","th"]);function FO(n){return MO.has(Kr(n))}const PO=[":popover-open",":modal"];function Ns(n){return PO.some(e=>{try{return n.matches(e)}catch(t){return!1}})}const xO=["transform","translate","scale","rotate","perspective"],BO=["transform","translate","scale","rotate","perspective","filter"],HO=["paint","layout","strict","content"];function au(n){const e=fc(),t=It(n)?vt(n):n;return xO.some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||BO.some(r=>(t.willChange||"").includes(r))||HO.some(r=>(t.contain||"").includes(r))}function fc(){return!(typeof CSS=="undefined"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const UO=new Set(["html","body","#document"]);function kr(n){return UO.has(Kr(n))}function vt(n){return ft(n).getComputedStyle(n)}function ea(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function On(n){if(Kr(n)==="html")return n;const e=n.assignedSlot||n.parentNode||_p(n)&&n.host||Vt(n);return _p(e)?e.host:e}function vA(n){const e=On(n);return kr(e)?n.ownerDocument?n.ownerDocument.body:n.body:Gt(e)&&no(e)?e:vA(e)}function ro(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=vA(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=ft(i);if(o){const a=lu(s);return e.concat(s,s.visualViewport||[],no(i)?i:[],a&&t?ro(a):[])}return e.concat(i,ro(i,[],t))}function lu(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function NA(n){const e=vt(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Gt(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Is(t)!==o||Is(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function mc(n){return It(n)?n:n.contextElement}function Lr(n){const e=mc(n);if(!Gt(e))return zt(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=NA(e);let s=(o?Is(t.width):t.width)/r,a=(o?Is(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const $O=zt(0);function yA(n){const e=ft(n);return fc()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:$O}function rr(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=mc(n);let s=zt(1);e&&(r?It(r)&&(s=Lr(r)):s=Lr(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==ft(h))&&p}(o,t,r)?yA(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=ft(o),p=r&&It(r)?ft(r):r;let f=h,m=lu(f);for(;m&&r&&p!==f;){const E=Lr(m),A=m.getBoundingClientRect(),g=vt(m),O=A.left+(m.clientLeft+parseFloat(g.paddingLeft))*E.x,S=A.top+(m.clientTop+parseFloat(g.paddingTop))*E.y;l*=E.x,u*=E.y,c*=E.x,d*=E.y,l+=O,u+=S,f=ft(m),m=lu(f)}}return vs({width:c,height:d,x:l,y:u})}function ys(n,e){const t=ea(n).scrollLeft;return e?e.left+t:rr(Vt(n)).left+t}function bA(n,e){const t=n.getBoundingClientRect();return{x:t.left+e.scrollLeft-ys(n,t),y:t.top+e.scrollTop}}const jO=new Set(["absolute","fixed"]);function gp(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=ft(i),a=Vt(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const f=fc();(!f||f&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}const p=ys(a);if(p<=0){const f=a.ownerDocument,m=f.body,E=getComputedStyle(m),A=f.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,g=Math.abs(a.clientWidth-m.clientWidth-A);g<=25&&(u-=g)}else p<=25&&(u+=p);return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=Vt(i),s=ea(i),a=i.ownerDocument.body,l=br(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=br(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+ys(i);const d=-s.scrollTop;return vt(a).direction==="rtl"&&(c+=br(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(Vt(n));else if(It(e))r=function(i,o){const s=rr(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=Gt(i)?Lr(i):zt(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=yA(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return vs(r)}function kA(n,e){const t=On(n);return!(t===e||!It(t)||kr(t))&&(vt(t).position==="fixed"||kA(t,e))}function zO(n,e,t){const r=Gt(e),i=Vt(e),o=t==="fixed",s=rr(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ys(i)}if(r||!r&&!o)if((Kr(e)!=="body"||no(i))&&(a=ea(e)),r){const d=rr(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?zt(0):bA(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function rl(n){return vt(n).position==="static"}function Dp(n,e){if(!Gt(n)||vt(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Vt(n)===t&&(t=t.ownerDocument.body),t}function Op(n,e){const t=ft(n);if(Ns(n))return t;if(!Gt(n)){let i=On(n);for(;i&&!kr(i);){if(It(i)&&!rl(i))return i;i=On(i)}return t}let r=Dp(n,e);for(;r&&FO(r)&&rl(r);)r=Dp(r,e);return r&&kr(r)&&rl(r)&&!au(r)?t:r||function(i){let o=On(i);for(;Gt(o)&&!kr(o);){if(au(o))return o;if(Ns(o))return null;o=On(o)}return null}(n)||t}const VO={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=Vt(r),a=!!e&&Ns(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=zt(1);const c=zt(0),d=Gt(r);if((d||!d&&!o)&&((Kr(r)!=="body"||no(s))&&(l=ea(r)),Gt(r))){const p=rr(r);u=Lr(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?zt(0):bA(s,l);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:Vt,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Ns(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=ro(u,[],!1).filter(E=>It(E)&&Kr(E)!=="body"),p=null;const f=vt(u).position==="fixed";let m=f?On(u):u;for(;It(m)&&!kr(m);){const E=vt(m),A=au(m);A||E.position!=="fixed"||(p=null),(f?!A&&!p:!A&&E.position==="static"&&p&&jO.has(p.position)||no(m)&&!A&&kA(u,m))?h=h.filter(g=>g!==m):p=E,m=On(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=gp(e,c,i);return u.top=br(d.top,u.top),u.right=iu(d.right,u.right),u.bottom=iu(d.bottom,u.bottom),u.left=br(d.left,u.left),u},gp(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Op,getElementRects:async function(n){const e=this.getOffsetParent||Op,t=this.getDimensions,r=await t(n.floating);return{reference:zO(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=NA(n);return{width:e,height:t}},getScale:Lr,isElement:It,isRTL:function(n){return vt(n).direction==="rtl"}};function Sp(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function YO(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=mc(n),c=i||o?[...u?ro(u):[],...ro(e)]:[];c.forEach(E=>{i&&E.addEventListener("scroll",t,{passive:!0}),o&&E.addEventListener("resize",t)});const d=u&&a?function(E,A){let g,O=null;const S=Vt(E);function T(){var I;clearTimeout(g),(I=O)==null||I.disconnect(),O=null}return function I(C,y){C===void 0&&(C=!1),y===void 0&&(y=1),T();const _=E.getBoundingClientRect(),{left:D,top:k,width:L,height:H}=_;if(C||A(),!L||!H)return;const N={rootMargin:-Bo(k)+"px "+-Bo(S.clientWidth-(D+L))+"px "+-Bo(S.clientHeight-(k+H))+"px "+-Bo(D)+"px",threshold:br(0,iu(1,y))||1};let w=!0;function $(U){const G=U[0].intersectionRatio;if(G!==y){if(!w)return I();G?I(!1,G):g=setTimeout(()=>{I(!1,1e-7)},1e3)}G!==1||Sp(_,E.getBoundingClientRect())||I(),w=!1}try{O=new IntersectionObserver($,{...N,root:S.ownerDocument})}catch(U){O=new IntersectionObserver($,N)}O.observe(E)}(!0),T}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(E=>{let[A]=E;A&&A.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var g;(g=f)==null||g.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?rr(n):null;return l&&function E(){const A=rr(n);m&&!Sp(m,A)&&t(),m=A,h=requestAnimationFrame(E)}(),t(),()=>{var E;c.forEach(A=>{i&&A.removeEventListener("scroll",t),o&&A.removeEventListener("resize",t)}),d==null||d(),(E=f)==null||E.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const GO=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=hc(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const A=to(i),g=Tr(a),O=to(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),T=h||(O||!m?[Ho(a)]:function(N){const w=Ho(N);return[ou(N),w,ou(w)]}(a)),I=f!=="none";!h&&I&&T.push(...LO(a,m,f,S));const C=[a,...T],y=await su(e,E),_=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&_.push(y[A]),d){const N=function(w,$,U){U===void 0&&(U=!1);const G=pc(w),z=CA(w),V=RA(z);let K=z==="x"?G===(U?"end":"start")?"right":"left":G==="start"?"bottom":"top";return $.reference[V]>$.floating[V]&&(K=Ho(K)),[K,Ho(K)]}(i,s,S);_.push(y[N[0]],y[N[1]])}if(D=[...D,{placement:i,overflows:_}],!_.every(N=>N<=0)){var k,L;const N=(((k=o.flip)==null?void 0:k.index)||0)+1,w=C[N];if(w&&(!(d==="alignment"&&g!==Tr(w))||D.every(U=>Tr(U.placement)!==g||U.overflows[0]>0)))return{data:{index:N,overflows:D},reset:{placement:w}};let $=(L=D.filter(U=>U.overflows[0]<=0).sort((U,G)=>U.overflows[1]-G.overflows[1])[0])==null?void 0:L.placement;if(!$)switch(p){case"bestFit":{var H;const U=(H=D.filter(G=>{if(I){const z=Tr(G.placement);return z===g||z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(z=>z>0).reduce((z,V)=>z+V,0)]).sort((G,z)=>G[1]-z[1])[0])==null?void 0:H[0];U&&($=U);break}case"initialPlacement":$=a}if(i!==$)return{reset:{placement:$}}}return{}}}},WO=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=hc(n,e);switch(r){case"referenceHidden":{const o=Ep(await su(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ap(o)}}}case"escaped":{const o=Ep(await su(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:Ap(o)}}}default:return{}}}}},XO=(n,e,t)=>{const r=new Map,i={platform:VO,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:E,y:A}=mp(m,u,f),g=u,O={},S=0;for(let T=0;T<p.length;T++){const{name:I,fn:C}=p[T],{x:y,y:_,data:D,reset:k}=await C({x:E,y:A,initialPlacement:u,placement:g,strategy:c,middlewareData:O,rects:m,platform:h,elements:{reference:s,floating:a}});E=y!=null?y:E,A=_!=null?_:A,O={...O,[I]:{...O[I],...D}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(m=k.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):k.rects),{x:E,y:A}=mp(m,g,f)),T=-1)}return{x:E,y:A,placement:g,strategy:c,middlewareData:O}})(n,e,{...i,platform:o})};var Qo=typeof document!="undefined"?Et:function(){};function bs(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!bs(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!bs(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function LA(n){return typeof window=="undefined"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Tp(n,e){const t=LA(n);return Math.round(e*t)/t}function il(n){const e=Q(n);return Qo(()=>{e.current=n}),e}const KO=(n,e)=>({...GO(n),options:[n,e]}),JO=(n,e)=>({...WO(n),options:[n,e]});var wA={exports:{}},MA=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ks=MA.join(","),FA=typeof Element=="undefined",ir=FA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,es=!FA&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n==null?void 0:n.ownerDocument},io=function(n,e){var t;e===void 0&&(e=!0);var r=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"inert");return r===""||r==="true"||e&&n&&io(n.parentNode)},PA=function(n,e,t){if(io(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(ks));return e&&ir.call(n,ks)&&r.unshift(n),r=r.filter(t)},Ls=function(n,e,t){for(var r=[],i=Array.from(n);i.length;){var o=i.shift();if(!io(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),a=s.length?s:o.children,l=Ls(a,!0,t);t.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{ir.call(o,ks)&&t.filter(o)&&(e||!n.includes(o))&&r.push(o);var u=o.shadowRoot||typeof t.getShadowRoot=="function"&&t.getShadowRoot(o),c=!io(u,!1)&&(!t.shadowRootFilter||t.shadowRootFilter(o));if(u&&c){var d=Ls(u===!0?o.children:u.children,!0,t);t.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else i.unshift.apply(i,o.children)}}return r},xA=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},gn=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"}(n))&&!xA(n)?0:n.tabIndex},qO=function(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex},BA=function(n){return n.tagName==="INPUT"},ZO=function(n){return function(e){return BA(e)&&e.type==="radio"}(n)&&!function(e){if(!e.name)return!0;var t,r=e.form||es(e),i=function(s){return r.querySelectorAll('input[type="radio"][name="'+s+'"]')};if(typeof window!="undefined"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")t=i(window.CSS.escape(e.name));else try{t=i(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var o=function(s,a){for(var l=0;l<s.length;l++)if(s[l].checked&&s[l].form===a)return s[l]}(t,e.form);return!o||o===e}(n)},Rp=function(n){var e=n.getBoundingClientRect(),t=e.width,r=e.height;return t===0&&r===0},QO=function(n,e){var t=e.displayCheck,r=e.getShadowRoot;if(t==="full-native"&&"checkVisibility"in n)return!n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(n).visibility==="hidden")return!0;var i=ir.call(n,"details>summary:first-of-type")?n.parentElement:n;if(ir.call(i,"details:not([open]) *"))return!0;if(t&&t!=="full"&&t!=="full-native"&&t!=="legacy-full"){if(t==="non-zero-area")return Rp(n)}else{if(typeof r=="function"){for(var o=n;n;){var s=n.parentElement,a=es(n);if(s&&!s.shadowRoot&&r(s)===!0)return Rp(n);n=n.assignedSlot?n.assignedSlot:s||a===n.ownerDocument?s:a.host}n=o}if(function(l){var u,c,d,h,p=l&&es(l),f=(u=p)===null||u===void 0?void 0:u.host,m=!1;if(p&&p!==l)for(m=!!((c=f)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(f)||l!=null&&(h=l.ownerDocument)!==null&&h!==void 0&&h.contains(l));!m&&f;){var E,A,g;m=!((A=f=(E=p=es(f))===null||E===void 0?void 0:E.host)===null||A===void 0||(g=A.ownerDocument)===null||g===void 0||!g.contains(f))}return m}(n))return!n.getClientRects().length;if(t!=="legacy-full")return!0}return!1},ws=function(n,e){return!(e.disabled||io(e)||function(t){return BA(t)&&t.type==="hidden"}(e)||QO(e,n)||function(t){return t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"})}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var o=r.children.item(i);if(o.tagName==="LEGEND")return!!ir.call(r,"fieldset[disabled] *")||!o.contains(t)}return!0}r=r.parentElement}return!1}(e))},uu=function(n,e){return!(ZO(e)||gn(e)<0||!ws(n,e))},eS=function(n){var e=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},HA=function(n){var e=[],t=[];return n.forEach(function(r,i){var o=!!r.scopeParent,s=o?r.scopeParent:r,a=function(u,c){var d=gn(u);return d<0&&c&&!xA(u)?0:d}(s,o),l=o?HA(r.candidates):s;a===0?o?e.push.apply(e,l):e.push(s):t.push({documentOrder:i,tabIndex:a,item:r,isScope:o,content:l})}),t.sort(qO).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},UA=function(n,e){var t;return t=(e=e||{}).getShadowRoot?Ls([n],e.includeContainer,{filter:uu.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:eS}):PA(n,e.includeContainer,uu.bind(null,e)),HA(t)},Ec=function(n,e){return(e=e||{}).getShadowRoot?Ls([n],e.includeContainer,{filter:ws.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):PA(n,e.includeContainer,ws.bind(null,e))},xn=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return ir.call(n,ks)!==!1&&uu(e,n)},tS=MA.concat("iframe").join(","),ts=function(n,e){if(e=e||{},!n)throw new Error("No node provided");return ir.call(n,tS)!==!1&&ws(e,n)};const nS=Object.freeze(Object.defineProperty({__proto__:null,focusable:Ec,getTabIndex:gn,isFocusable:ts,isTabbable:xn,tabbable:UA},Symbol.toStringTag,{value:"Module"}));function ol(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function rS(n,e,t){return(e=function(r){var i=function(o,s){if(typeof o!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var l=a.call(o,s);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}(r,"string");return typeof i=="symbol"?i:i+""}(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Cp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ip(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cp(Object(t),!0).forEach(function(r){rS(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function iS(n){return function(e){if(Array.isArray(e))return ol(e)}(n)||function(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||function(e,t){if(e){if(typeof e=="string")return ol(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ol(e,t):void 0}}(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
92
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var oS=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},sS=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ui=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},aS=function(n){return Ui(n)&&!n.shiftKey},lS=function(n){return Ui(n)&&n.shiftKey},vp=function(n){return setTimeout(n,0)},ui=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},Uo=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},uS=[];const cS=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||uS,o=Ip({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:aS,isKeyBackward:lS},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(_,D,k){return _&&_[D]!==void 0?_[D]:o[k||D]},l=function(_,D){var k=typeof(D==null?void 0:D.composedPath)=="function"?D.composedPath():void 0;return s.containerGroups.findIndex(function(L){var H=L.container,N=L.tabbableNodes;return H.contains(_)||(k==null?void 0:k.includes(H))||N.find(function(w){return w===_})})},u=function(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=D.hasFallback,L=k!==void 0&&k,H=D.params,N=H===void 0?[]:H,w=o[_];if(typeof w=="function"&&(w=w.apply(void 0,iS(N))),w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var $=w;if(typeof w=="string"){try{$=r.querySelector(w)}catch(U){throw new Error("`".concat(_,'` appears to be an invalid selector; error="').concat(U.message,'"'))}if(!$&&!L)throw new Error("`".concat(_,"` as selector refers to no known node"))}return $},c=function(){var _=u("initialFocus",{hasFallback:!0});if(_===!1)return!1;if(_===void 0||_&&!ts(_,o.tabbableOptions))if(l(r.activeElement)>=0)_=r.activeElement;else{var D=s.tabbableGroups[0];_=D&&D.firstTabbableNode||u("fallbackFocus")}else _===null&&(_=u("fallbackFocus"));if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},d=function(){if(s.containerGroups=s.containers.map(function(_){var D=UA(_,o.tabbableOptions),k=Ec(_,o.tabbableOptions),L=D.length>0?D[0]:void 0,H=D.length>0?D[D.length-1]:void 0,N=k.find(function(U){return xn(U)}),w=k.slice().reverse().find(function(U){return xn(U)}),$=!!D.find(function(U){return gn(U)>0});return{container:_,tabbableNodes:D,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:L,lastTabbableNode:H,firstDomTabbableNode:N,lastDomTabbableNode:w,nextTabbableNode:function(U){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],z=D.indexOf(U);return z<0?G?k.slice(k.indexOf(U)+1).find(function(V){return xn(V)}):k.slice(0,k.indexOf(U)).reverse().find(function(V){return xn(V)}):D[z+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(_){return _.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(_){var D=_.activeElement;if(D)return D.shadowRoot&&D.shadowRoot.activeElement!==null?h(D.shadowRoot):D},p=function(_){_!==!1&&_!==h(document)&&(_&&_.focus?(_.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=_,function(D){return D.tagName&&D.tagName.toLowerCase()==="input"&&typeof D.select=="function"}(_)&&_.select()):p(c()))},f=function(_){var D=u("setReturnFocus",{params:[_]});return D||D!==!1&&_},m=function(_){var D=_.target,k=_.event,L=_.isBackward,H=L!==void 0&&L;D=D||Uo(k),d();var N=null;if(s.tabbableGroups.length>0){var w=l(D,k),$=w>=0?s.containerGroups[w]:void 0;if(w<0)N=H?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(H){var U=s.tabbableGroups.findIndex(function(oe){var M=oe.firstTabbableNode;return D===M});if(U<0&&($.container===D||ts(D,o.tabbableOptions)&&!xn(D,o.tabbableOptions)&&!$.nextTabbableNode(D,!1))&&(U=w),U>=0){var G=U===0?s.tabbableGroups.length-1:U-1,z=s.tabbableGroups[G];N=gn(D)>=0?z.lastTabbableNode:z.lastDomTabbableNode}else Ui(k)||(N=$.nextTabbableNode(D,!1))}else{var V=s.tabbableGroups.findIndex(function(oe){var M=oe.lastTabbableNode;return D===M});if(V<0&&($.container===D||ts(D,o.tabbableOptions)&&!xn(D,o.tabbableOptions)&&!$.nextTabbableNode(D))&&(V=w),V>=0){var K=V===s.tabbableGroups.length-1?0:V+1,J=s.tabbableGroups[K];N=gn(D)>=0?J.firstTabbableNode:J.firstDomTabbableNode}else Ui(k)||(N=$.nextTabbableNode(D))}}else N=u("fallbackFocus");return N},E=function(_){var D=Uo(_);l(D,_)>=0||(ui(o.clickOutsideDeactivates,_)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):ui(o.allowOutsideClick,_)||_.preventDefault())},A=function(_){var D=Uo(_),k=l(D,_)>=0;if(k||D instanceof Document)k&&(s.mostRecentlyFocusedNode=D);else{var L;_.stopImmediatePropagation();var H=!0;if(s.mostRecentlyFocusedNode)if(gn(s.mostRecentlyFocusedNode)>0){var N=l(s.mostRecentlyFocusedNode),w=s.containerGroups[N].tabbableNodes;if(w.length>0){var $=w.findIndex(function(U){return U===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<w.length&&(L=w[$+1],H=!1):$-1>=0&&(L=w[$-1],H=!1))}}else s.containerGroups.some(function(U){return U.tabbableNodes.some(function(G){return gn(G)>0})})||(H=!1);else H=!1;H&&(L=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(L||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},g=function(_){(o.isKeyForward(_)||o.isKeyBackward(_))&&function(D){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=D;var L=m({event:D,isBackward:k});L&&(Ui(D)&&D.preventDefault(),p(L))}(_,o.isKeyBackward(_))},O=function(_){(function(D){return(D==null?void 0:D.key)==="Escape"||(D==null?void 0:D.key)==="Esc"||(D==null?void 0:D.keyCode)===27})(_)&&ui(o.escapeDeactivates,_)!==!1&&(_.preventDefault(),t.deactivate())},S=function(_){var D=Uo(_);l(D,_)>=0||ui(o.clickOutsideDeactivates,_)||ui(o.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},T=function(){if(s.active)return oS(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?vp(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),r.addEventListener("keydown",O),t},I=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",g,!0),r.removeEventListener("keydown",O),t},C=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(_){_.some(function(D){return Array.from(D.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,y=function(){C&&(C.disconnect(),s.active&&!s.paused&&s.containers.map(function(_){C.observe(_,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(_){if(s.active)return this;var D=a(_,"onActivate"),k=a(_,"onPostActivate"),L=a(_,"checkCanFocusTrap");L||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),D==null||D();var H=function(){L&&d(),T(),y(),k==null||k()};return L?(L(s.containers.concat()).then(H,H),this):(H(),this)},deactivate:function(_){if(!s.active)return this;var D=Ip({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},_);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,y(),sS(i,t);var k=a(D,"onDeactivate"),L=a(D,"onPostDeactivate"),H=a(D,"checkCanReturnFocus"),N=a(D,"returnFocus","returnFocusOnDeactivate");k==null||k();var w=function(){vp(function(){N&&p(f(s.nodeFocusedBeforeActivation)),L==null||L()})};return N&&H?(H(f(s.nodeFocusedBeforeActivation)).then(w,w),this):(w(),this)},pause:function(_){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,_)):this},unpause:function(_){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,_)):this},updateContainerElements:function(_){var D=[].concat(_).filter(Boolean);return s.containers=D.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),y(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(_,D){if(s.paused===_)return this;if(s.paused=_,_){var k=a(D,"onPause"),L=a(D,"onPostPause");k==null||k(),I(),y(),L==null||L()}else{var H=a(D,"onUnpause"),N=a(D,"onPostUnpause");H==null||H(),d(),T(),y(),N==null||N()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),dS=Bu(cS),hS=Bu(nS);function wr(n){return wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(n)}var sl,al;function pS(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,jA(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function fS(n,e,t){return e=Ms(e),function(r,i){if(i&&(wr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,$A()?Reflect.construct(e,t||[],Ms(n).constructor):e.apply(n,t))}function $A(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($A=function(){return!!n})()}function Ms(n){return Ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ms(n)}function cu(n,e){return cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},cu(n,e)}function jA(n){var e=function(t,r){if(wr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(wr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return wr(e)=="symbol"?e:e+""}var vi=im,mS=dS.createFocusTrap,ES=hS.isFocusable,AS=parseInt((sl=(al=/^(\d+)\./.exec(vi.version))===null||al===void 0?void 0:al[1])!==null&&sl!==void 0?sl:0,10),du=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=jA(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=fS(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cu(e,t)}(n,vi.Component),pS(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||ES(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?vi.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===vi.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return vi.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(AS>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();du.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:mS},wA.exports=du;var _S=wA.exports.FocusTrap=du;function zA(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=Z(()=>({anchor:Np(r),boundary:i?Np(i):void 0}),[r,i]);let c=[];u&&(c=[KO({boundary:u}),JO({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:g="absolute",middleware:O=[],platform:S,elements:{reference:T,floating:I}={},transform:C=!0,whileElementsMounted:y,open:_}=E,[D,k]=ie({x:0,y:0,strategy:g,placement:A,middlewareData:{},isPositioned:!1}),[L,H]=ie(O);bs(L,O)||H(O);const[N,w]=ie(null),[$,U]=ie(null),G=ee(Ee=>{Ee!==J.current&&(J.current=Ee,w(Ee))},[]),z=ee(Ee=>{Ee!==oe.current&&(oe.current=Ee,U(Ee))},[]),V=T||N,K=I||$,J=Q(null),oe=Q(null),M=Q(D),le=y!=null,ve=il(y),Ne=il(S),at=il(_),Ot=ee(()=>{if(!J.current||!oe.current)return;const Ee={placement:A,strategy:g,middleware:L};Ne.current&&(Ee.platform=Ne.current),XO(J.current,oe.current,Ee).then(lr=>{const wt={...lr,isPositioned:at.current!==!1};ti.current&&!bs(M.current,wt)&&(M.current=wt,yu(()=>{k(wt)}))})},[L,A,g,Ne,at]);Qo(()=>{_===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,k(Ee=>({...Ee,isPositioned:!1})))},[_]);const ti=Q(!1);Qo(()=>(ti.current=!0,()=>{ti.current=!1}),[]),Qo(()=>{if(V&&(J.current=V),K&&(oe.current=K),V&&K){if(ve.current)return ve.current(V,K,Ot);Ot()}},[V,K,Ot,ve,le]);const Lt=Z(()=>({reference:J,floating:oe,setReference:G,setFloating:z}),[G,z]),Le=Z(()=>({reference:V,floating:K}),[V,K]),Kt=Z(()=>{const Ee={position:g,left:0,top:0};if(!Le.floating)return Ee;const lr=Tp(Le.floating,D.x),wt=Tp(Le.floating,D.y);return C?{...Ee,transform:"translate("+lr+"px, "+wt+"px)",...LA(Le.floating)>=1.5&&{willChange:"transform"}}:{position:g,left:lr,top:wt}},[g,C,Le.floating,D.x,D.y]);return Z(()=>({...D,update:Ot,refs:Lt,elements:Le,floatingStyles:Kt}),[D,Ot,Lt,Le,Kt])}({placement:t,middleware:c,whileElementsMounted:YO});Et(()=>{l&&d.setReference(l)},[d,l]);const f=o?v(_S,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:v("div",{children:[e,v("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return v("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function Np(n){return typeof n=="string"?document.querySelector(n):n}function VA(n){const e=ce(),t=po(),r=ne(t.state$.suggestMentionQuery),i=function(E,A=10){const g=ar(Hu),[O,S]=ie(null);return Y(()=>{const T=g.conversation(E).subscribeParticipants(C=>S(C));let I=10;for(;I<A;){const C=Math.min(A-I,50);T.loadMore(C),I+=C}return()=>{T.unsubscribe()}},[E,g,A]),O}(ne(e.state$.extCurrentConversationId),r?100:0),o=Z(()=>(i!=null?i:[]).map(E=>E.user),[i]),[s,a]=ie(0),l=Z(()=>Object.fromEntries(o.map(E=>[E.id,yg(E.name)])),[o]),u=Z(()=>{if(!r)return[];const E=yp(r);return E===""?o:o.filter(A=>l[A.id].some(g=>function(O,S){return Rd(O.substring(0,S.length),S)}(g,E)))},[r,o,l]),c=Q(void 0);Y(()=>{if(c.current){const E=u.findIndex(A=>A.id===c.current);a(E===-1?0:E)}},[u]),Y(()=>{var E;c.current=(E=u[s])==null?void 0:E.id},[s,u]);const d=ee(E=>{var g;const A=(g=u[E])==null?void 0:g.id;return A&&"mention-button-"+A},[u]),{containerProps:h,itemProps:p}=OA({focused:s,setFocused:a,buttonId:d});if(Y(()=>{if(u.length!==0)return t.listenKeydown("mention",E=>DA(E,{dir:"ttb",focused:s,setFocused:a,itemCount:u.length,onSpace(){if(r){const A=u[s];if(Rd(A.name,yp(r)))return t.selectMention(A),!0}return!1},onConfirm(){const A=u[s];t.selectMention(A)}})),()=>{t.listenKeydown("mention",void 0)}},[t,s,u,r]),go(()=>t.closeSuggester(),".t-mention-suggest-list",u.length>0),u.length===0)return null;const f=document.querySelector(".ProseMirror-suggestion");let m;if(f){let E=f.getBoundingClientRect();m={getBoundingClientRect(){const A=f.getBoundingClientRect();return A.width>0&&(E=A),E}}}return v(zA,{className:"t-mention-suggest-list",...h,anchorElement:m,children:u.map((E,A)=>v(gS,{user:E,isFocused:A===s,onSelect:()=>t.selectMention(E),...p(A)},E.id))})}const gS=cn(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return v("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function yp(n){return pe(n[0]==="@"),n.substring(1)}function bp(n,e,t){const r=Ec(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const DS=Nt(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Uu(),o=Q(null);Nn(e,()=>o.current),Y(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=ee(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),g=l.shiftKey?bp(A,c,-1):function(O,S){return bp(O,S,1)}(A,c);return g==null||g.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return v("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function Rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=ie(void 0),u=Q(null),[c,d]=ie(!1);go(ee(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?v(DS,{triggerElement:u.current,children:v(e,{...t})}):v(e,{...t});return v(Og.Provider,{value:{closePopover:()=>d(!1)},children:[v(OS,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&v(zA,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const OS=Nt(function(n,e){const{onTrigger:t,...r}=n,i=ee(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return v("button",{...r,ref:e,onClick:t,onKeyDown:i})});function An(n){const{onSelect:e,...t}=n,{closePopover:r}=Uu(),i=ee(o=>{o.key!=="Enter"&&o.key!==" "||(r(),e==null||e())},[e,r]);return v("div",{tabIndex:-1,role:"menuitem",onClick:ee(()=>{r(),e==null||e()},[r,e]),onKeyDown:i,"t-menu-item":"",...t})}function YA(n){return Om(n)}function or(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
92
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var oS=function(n,e){if(n.length>0){var t=n[n.length-1];t!==e&&t._setPausedState(!0)}var r=n.indexOf(e);r===-1||n.splice(r,1),n.push(e)},sS=function(n,e){var t=n.indexOf(e);t!==-1&&n.splice(t,1),n.length>0&&!n[n.length-1]._isManuallyPaused()&&n[n.length-1]._setPausedState(!1)},Ui=function(n){return(n==null?void 0:n.key)==="Tab"||(n==null?void 0:n.keyCode)===9},aS=function(n){return Ui(n)&&!n.shiftKey},lS=function(n){return Ui(n)&&n.shiftKey},vp=function(n){return setTimeout(n,0)},ui=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return typeof n=="function"?n.apply(void 0,t):n},Uo=function(n){return n.target.shadowRoot&&typeof n.composedPath=="function"?n.composedPath()[0]:n.target},uS=[];const cS=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(n,e){var t,r=(e==null?void 0:e.document)||document,i=(e==null?void 0:e.trapStack)||uS,o=Ip({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:aS,isKeyBackward:lS},e),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a=function(_,D,k){return _&&_[D]!==void 0?_[D]:o[k||D]},l=function(_,D){var k=typeof(D==null?void 0:D.composedPath)=="function"?D.composedPath():void 0;return s.containerGroups.findIndex(function(L){var H=L.container,N=L.tabbableNodes;return H.contains(_)||(k==null?void 0:k.includes(H))||N.find(function(w){return w===_})})},u=function(_){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=D.hasFallback,L=k!==void 0&&k,H=D.params,N=H===void 0?[]:H,w=o[_];if(typeof w=="function"&&(w=w.apply(void 0,iS(N))),w===!0&&(w=void 0),!w){if(w===void 0||w===!1)return w;throw new Error("`".concat(_,"` was specified but was not a node, or did not return a node"))}var $=w;if(typeof w=="string"){try{$=r.querySelector(w)}catch(U){throw new Error("`".concat(_,'` appears to be an invalid selector; error="').concat(U.message,'"'))}if(!$&&!L)throw new Error("`".concat(_,"` as selector refers to no known node"))}return $},c=function(){var _=u("initialFocus",{hasFallback:!0});if(_===!1)return!1;if(_===void 0||_&&!ts(_,o.tabbableOptions))if(l(r.activeElement)>=0)_=r.activeElement;else{var D=s.tabbableGroups[0];_=D&&D.firstTabbableNode||u("fallbackFocus")}else _===null&&(_=u("fallbackFocus"));if(!_)throw new Error("Your focus-trap needs to have at least one focusable element");return _},d=function(){if(s.containerGroups=s.containers.map(function(_){var D=UA(_,o.tabbableOptions),k=Ec(_,o.tabbableOptions),L=D.length>0?D[0]:void 0,H=D.length>0?D[D.length-1]:void 0,N=k.find(function(U){return xn(U)}),w=k.slice().reverse().find(function(U){return xn(U)}),$=!!D.find(function(U){return gn(U)>0});return{container:_,tabbableNodes:D,focusableNodes:k,posTabIndexesFound:$,firstTabbableNode:L,lastTabbableNode:H,firstDomTabbableNode:N,lastDomTabbableNode:w,nextTabbableNode:function(U){var G=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],z=D.indexOf(U);return z<0?G?k.slice(k.indexOf(U)+1).find(function(V){return xn(V)}):k.slice(0,k.indexOf(U)).reverse().find(function(V){return xn(V)}):D[z+(G?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function(_){return _.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function(_){return _.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(_){var D=_.activeElement;if(D)return D.shadowRoot&&D.shadowRoot.activeElement!==null?h(D.shadowRoot):D},p=function(_){_!==!1&&_!==h(document)&&(_&&_.focus?(_.focus({preventScroll:!!o.preventScroll}),s.mostRecentlyFocusedNode=_,function(D){return D.tagName&&D.tagName.toLowerCase()==="input"&&typeof D.select=="function"}(_)&&_.select()):p(c()))},f=function(_){var D=u("setReturnFocus",{params:[_]});return D||D!==!1&&_},m=function(_){var D=_.target,k=_.event,L=_.isBackward,H=L!==void 0&&L;D=D||Uo(k),d();var N=null;if(s.tabbableGroups.length>0){var w=l(D,k),$=w>=0?s.containerGroups[w]:void 0;if(w<0)N=H?s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:s.tabbableGroups[0].firstTabbableNode;else if(H){var U=s.tabbableGroups.findIndex(function(oe){var M=oe.firstTabbableNode;return D===M});if(U<0&&($.container===D||ts(D,o.tabbableOptions)&&!xn(D,o.tabbableOptions)&&!$.nextTabbableNode(D,!1))&&(U=w),U>=0){var G=U===0?s.tabbableGroups.length-1:U-1,z=s.tabbableGroups[G];N=gn(D)>=0?z.lastTabbableNode:z.lastDomTabbableNode}else Ui(k)||(N=$.nextTabbableNode(D,!1))}else{var V=s.tabbableGroups.findIndex(function(oe){var M=oe.lastTabbableNode;return D===M});if(V<0&&($.container===D||ts(D,o.tabbableOptions)&&!xn(D,o.tabbableOptions)&&!$.nextTabbableNode(D))&&(V=w),V>=0){var K=V===s.tabbableGroups.length-1?0:V+1,J=s.tabbableGroups[K];N=gn(D)>=0?J.firstTabbableNode:J.firstDomTabbableNode}else Ui(k)||(N=$.nextTabbableNode(D))}}else N=u("fallbackFocus");return N},E=function(_){var D=Uo(_);l(D,_)>=0||(ui(o.clickOutsideDeactivates,_)?t.deactivate({returnFocus:o.returnFocusOnDeactivate}):ui(o.allowOutsideClick,_)||_.preventDefault())},A=function(_){var D=Uo(_),k=l(D,_)>=0;if(k||D instanceof Document)k&&(s.mostRecentlyFocusedNode=D);else{var L;_.stopImmediatePropagation();var H=!0;if(s.mostRecentlyFocusedNode)if(gn(s.mostRecentlyFocusedNode)>0){var N=l(s.mostRecentlyFocusedNode),w=s.containerGroups[N].tabbableNodes;if(w.length>0){var $=w.findIndex(function(U){return U===s.mostRecentlyFocusedNode});$>=0&&(o.isKeyForward(s.recentNavEvent)?$+1<w.length&&(L=w[$+1],H=!1):$-1>=0&&(L=w[$-1],H=!1))}}else s.containerGroups.some(function(U){return U.tabbableNodes.some(function(G){return gn(G)>0})})||(H=!1);else H=!1;H&&(L=m({target:s.mostRecentlyFocusedNode,isBackward:o.isKeyBackward(s.recentNavEvent)})),p(L||s.mostRecentlyFocusedNode||c())}s.recentNavEvent=void 0},g=function(_){(o.isKeyForward(_)||o.isKeyBackward(_))&&function(D){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];s.recentNavEvent=D;var L=m({event:D,isBackward:k});L&&(Ui(D)&&D.preventDefault(),p(L))}(_,o.isKeyBackward(_))},O=function(_){(function(D){return(D==null?void 0:D.key)==="Escape"||(D==null?void 0:D.key)==="Esc"||(D==null?void 0:D.keyCode)===27})(_)&&ui(o.escapeDeactivates,_)!==!1&&(_.preventDefault(),t.deactivate())},S=function(_){var D=Uo(_);l(D,_)>=0||ui(o.clickOutsideDeactivates,_)||ui(o.allowOutsideClick,_)||(_.preventDefault(),_.stopImmediatePropagation())},T=function(){if(s.active)return oS(i,t),s.delayInitialFocusTimer=o.delayInitialFocus?vp(function(){p(c())}):p(c()),r.addEventListener("focusin",A,!0),r.addEventListener("mousedown",E,{capture:!0,passive:!1}),r.addEventListener("touchstart",E,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),r.addEventListener("keydown",O),t},I=function(){if(s.active)return r.removeEventListener("focusin",A,!0),r.removeEventListener("mousedown",E,!0),r.removeEventListener("touchstart",E,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",g,!0),r.removeEventListener("keydown",O),t},C=typeof window!="undefined"&&"MutationObserver"in window?new MutationObserver(function(_){_.some(function(D){return Array.from(D.removedNodes).some(function(k){return k===s.mostRecentlyFocusedNode})})&&p(c())}):void 0,y=function(){C&&(C.disconnect(),s.active&&!s.paused&&s.containers.map(function(_){C.observe(_,{subtree:!0,childList:!0})}))};return t={get active(){return s.active},get paused(){return s.paused},activate:function(_){if(s.active)return this;var D=a(_,"onActivate"),k=a(_,"onPostActivate"),L=a(_,"checkCanFocusTrap");L||d(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=h(r),D==null||D();var H=function(){L&&d(),T(),y(),k==null||k()};return L?(L(s.containers.concat()).then(H,H),this):(H(),this)},deactivate:function(_){if(!s.active)return this;var D=Ip({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},_);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,I(),s.active=!1,s.paused=!1,y(),sS(i,t);var k=a(D,"onDeactivate"),L=a(D,"onPostDeactivate"),H=a(D,"checkCanReturnFocus"),N=a(D,"returnFocus","returnFocusOnDeactivate");k==null||k();var w=function(){vp(function(){N&&p(f(s.nodeFocusedBeforeActivation)),L==null||L()})};return N&&H?(H(f(s.nodeFocusedBeforeActivation)).then(w,w),this):(w(),this)},pause:function(_){return s.active?(s.manuallyPaused=!0,this._setPausedState(!0,_)):this},unpause:function(_){return s.active?(s.manuallyPaused=!1,i[i.length-1]!==this?this:this._setPausedState(!1,_)):this},updateContainerElements:function(_){var D=[].concat(_).filter(Boolean);return s.containers=D.map(function(k){return typeof k=="string"?r.querySelector(k):k}),s.active&&d(),y(),this}},Object.defineProperties(t,{_isManuallyPaused:{value:function(){return s.manuallyPaused}},_setPausedState:{value:function(_,D){if(s.paused===_)return this;if(s.paused=_,_){var k=a(D,"onPause"),L=a(D,"onPostPause");k==null||k(),I(),y(),L==null||L()}else{var H=a(D,"onUnpause"),N=a(D,"onPostUnpause");H==null||H(),d(),T(),y(),N==null||N()}return this}}}),t.updateContainerElements(n),t}},Symbol.toStringTag,{value:"Module"})),dS=Bu(cS),hS=Bu(nS);function wr(n){return wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(n)}var sl,al;function pS(n,e,t){return e&&function(r,i){for(var o=0;o<i.length;o++){var s=i[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(r,jA(s.key),s)}}(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function fS(n,e,t){return e=Ms(e),function(r,i){if(i&&(wr(i)=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(r)}(n,$A()?Reflect.construct(e,t||[],Ms(n).constructor):e.apply(n,t))}function $A(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($A=function(){return!!n})()}function Ms(n){return Ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ms(n)}function cu(n,e){return cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},cu(n,e)}function jA(n){var e=function(t,r){if(wr(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,r);if(wr(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n,"string");return wr(e)=="symbol"?e:e+""}var vi=im,mS=dS.createFocusTrap,ES=hS.isFocusable,AS=parseInt((sl=(al=/^(\d+)\./.exec(vi.version))===null||al===void 0?void 0:al[1])!==null&&sl!==void 0?sl:0,10),du=function(){function n(e){var t;(function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),function(o,s,a){(s=jA(s))in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a}(t=fS(this,n,[e]),"getNodeForOption",function(o){var s,a=(s=this.internalOptions[o])!==null&&s!==void 0?s:this.originalOptions[o];if(typeof a=="function"){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];a=a.apply(void 0,u)}if(a===!0&&(a=void 0),!a){if(a===void 0||a===!1)return a;throw new Error("`".concat(o,"` was specified but was not a node, or did not return a node"))}var d,h=a;if(typeof a=="string"&&!(h=(d=this.getDocument())===null||d===void 0?void 0:d.querySelector(a)))throw new Error("`".concat(o,"` as selector refers to no known node"));return h}),t.handleDeactivate=t.handleDeactivate.bind(t),t.handlePostDeactivate=t.handlePostDeactivate.bind(t),t.handleClickOutsideDeactivates=t.handleClickOutsideDeactivates.bind(t),t.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:t.handleDeactivate,onPostDeactivate:t.handlePostDeactivate,clickOutsideDeactivates:t.handleClickOutsideDeactivates},t.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var r=e.focusTrapOptions;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i!=="returnFocusOnDeactivate"&&i!=="onDeactivate"&&i!=="onPostDeactivate"&&i!=="checkCanReturnFocus"&&i!=="clickOutsideDeactivates"?t.internalOptions[i]=r[i]:t.originalOptions[i]=r[i]);return t.outsideClick=null,t.focusTrapElements=e.containerElements||[],t.updatePreviousElement(),t}return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cu(e,t)}(n,vi.Component),pS(n,[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document!="undefined"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var e=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return e||e!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var e=this.getDocument();e&&(this.previouslyFocusedElement=e.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(e){var t=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,e):this.originalOptions.clickOutsideDeactivates;return t&&(this.outsideClick={target:e.target,allowDeactivation:t}),t}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var e=this,t=function(){var r=e.getReturnFocusNode(),i=!(!e.originalOptions.returnFocusOnDeactivate||r==null||!r.focus||e.outsideClick&&(!e.outsideClick.allowDeactivation||ES(e.outsideClick.target,e.internalOptions.tabbableOptions))),o=e.internalOptions.preventScroll,s=o!==void 0&&o;i&&r.focus({preventScroll:s}),e.originalOptions.onPostDeactivate&&e.originalOptions.onPostDeactivate.call(null),e.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(t,t):t()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(e){if(this.focusTrap){e.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var t=!e.active&&this.props.active,r=e.active&&!this.props.active,i=!e.paused&&this.props.paused,o=e.paused&&!this.props.paused;if(t&&(this.updatePreviousElement(),this.focusTrap.activate()),r)return void this.deactivateTrap();i&&this.focusTrap.pause(),o&&this.focusTrap.unpause()}else e.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var e=this,t=this.props.children?vi.Children.only(this.props.children):void 0;if(t){if(t.type&&t.type===vi.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return vi.cloneElement(t,{ref:function(r){var i=e.props.containerElements;t&&(AS>=19?typeof t.props.ref=="function"?t.props.ref(r):t.props.ref&&(t.props.ref.current=r):typeof t.ref=="function"?t.ref(r):t.ref&&(t.ref.current=r)),e.focusTrapElements=i||[r]}})}return null}}])}();du.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:mS},wA.exports=du;var _S=wA.exports.FocusTrap=du;function zA(n){var m;const{children:e,preferredPlacement:t="top-start",anchorElement:r,boundaryElement:i,trapFocus:o=!1,initialFocus:s,...a}=n,{anchor:l,boundary:u}=Z(()=>({anchor:Np(r),boundary:i?Np(i):void 0}),[r,i]);let c=[];u&&(c=[KO({boundary:u}),JO({boundary:u})]);const{refs:d,floatingStyles:h,middlewareData:p}=function(E){E===void 0&&(E={});const{placement:A="bottom",strategy:g="absolute",middleware:O=[],platform:S,elements:{reference:T,floating:I}={},transform:C=!0,whileElementsMounted:y,open:_}=E,[D,k]=ie({x:0,y:0,strategy:g,placement:A,middlewareData:{},isPositioned:!1}),[L,H]=ie(O);bs(L,O)||H(O);const[N,w]=ie(null),[$,U]=ie(null),G=ee(Ee=>{Ee!==J.current&&(J.current=Ee,w(Ee))},[]),z=ee(Ee=>{Ee!==oe.current&&(oe.current=Ee,U(Ee))},[]),V=T||N,K=I||$,J=Q(null),oe=Q(null),M=Q(D),le=y!=null,ve=il(y),Ne=il(S),at=il(_),Ot=ee(()=>{if(!J.current||!oe.current)return;const Ee={placement:A,strategy:g,middleware:L};Ne.current&&(Ee.platform=Ne.current),XO(J.current,oe.current,Ee).then(lr=>{const wt={...lr,isPositioned:at.current!==!1};ti.current&&!bs(M.current,wt)&&(M.current=wt,yu(()=>{k(wt)}))})},[L,A,g,Ne,at]);Qo(()=>{_===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,k(Ee=>({...Ee,isPositioned:!1})))},[_]);const ti=Q(!1);Qo(()=>(ti.current=!0,()=>{ti.current=!1}),[]),Qo(()=>{if(V&&(J.current=V),K&&(oe.current=K),V&&K){if(ve.current)return ve.current(V,K,Ot);Ot()}},[V,K,Ot,ve,le]);const Lt=Z(()=>({reference:J,floating:oe,setReference:G,setFloating:z}),[G,z]),Le=Z(()=>({reference:V,floating:K}),[V,K]),Kt=Z(()=>{const Ee={position:g,left:0,top:0};if(!Le.floating)return Ee;const lr=Tp(Le.floating,D.x),wt=Tp(Le.floating,D.y);return C?{...Ee,transform:"translate("+lr+"px, "+wt+"px)",...LA(Le.floating)>=1.5&&{willChange:"transform"}}:{position:g,left:lr,top:wt}},[g,C,Le.floating,D.x,D.y]);return Z(()=>({...D,update:Ot,refs:Lt,elements:Le,floatingStyles:Kt}),[D,Ot,Lt,Le,Kt])}({placement:t,middleware:c,whileElementsMounted:YO});Et(()=>{l&&d.setReference(l)},[d,l]);const f=o?v(_S,{focusTrapOptions:{initialFocus:s,fallbackFocus:".t-fallback-focus",tabbableOptions:{getShadowRoot:!0}},children:v("div",{children:[e,v("span",{className:"t-fallback-focus",tabIndex:-1})]})}):e;return v("div",{ref:d.setFloating,style:{...h,zIndex:1e3,visibility:(m=p.hide)!=null&&m.referenceHidden?"hidden":"visible"},...a,children:f})}function Np(n){return typeof n=="string"?document.querySelector(n):n}function VA(n){const e=ce(),t=po(),r=ne(t.state$.suggestMentionQuery),i=function(E,A=10){const g=ar(Hu),[O,S]=ie(null);return Y(()=>{const T=g.conversation(E).subscribeParticipants(I=>S(I));return A>10&&T.connected.then(async()=>{for(;T.state.type==="active"&&!T.state.loadedAll&&T.state.latestSnapshot!==null&&T.state.latestSnapshot.length<A;){const I=Math.min(A-T.state.latestSnapshot.length,50);await T.loadMore(I)}}),()=>{T.unsubscribe()}},[E,g,A]),O}(ne(e.state$.extCurrentConversationId),r?1e3:0),o=Z(()=>(i!=null?i:[]).map(E=>E.user),[i]),[s,a]=ie(0),l=Z(()=>Object.fromEntries(o.map(E=>[E.id,yg(E.name)])),[o]),u=Z(()=>{if(!r)return[];const E=yp(r);return E===""?o:o.filter(A=>l[A.id].some(g=>function(O,S){return Rd(O.substring(0,S.length),S)}(g,E)))},[r,o,l]),c=Q(void 0);Y(()=>{if(c.current){const E=u.findIndex(A=>A.id===c.current);a(E===-1?0:E)}},[u]),Y(()=>{var E;c.current=(E=u[s])==null?void 0:E.id},[s,u]);const d=ee(E=>{var g;const A=(g=u[E])==null?void 0:g.id;return A&&"mention-button-"+A},[u]),{containerProps:h,itemProps:p}=OA({focused:s,setFocused:a,buttonId:d});if(Y(()=>{if(u.length!==0)return t.listenKeydown("mention",E=>DA(E,{dir:"ttb",focused:s,setFocused:a,itemCount:u.length,onSpace(){if(r){const A=u[s];if(Rd(A.name,yp(r)))return t.selectMention(A),!0}return!1},onConfirm(){const A=u[s];t.selectMention(A)}})),()=>{t.listenKeydown("mention",void 0)}},[t,s,u,r]),go(()=>t.closeSuggester(),".t-mention-suggest-list",u.length>0),u.length===0)return null;const f=document.querySelector(".ProseMirror-suggestion");let m;if(f){let E=f.getBoundingClientRect();m={getBoundingClientRect(){const A=f.getBoundingClientRect();return A.width>0&&(E=A),E}}}return v(zA,{className:"t-mention-suggest-list",...h,anchorElement:m,children:u.map((E,A)=>v(gS,{user:E,isFocused:A===s,onSelect:()=>t.selectMention(E),...p(A)},E.id))})}const gS=cn(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return v("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function yp(n){return pe(n[0]==="@"),n.substring(1)}function bp(n,e,t){const r=Ec(n),i=r.indexOf(e);return i===-1?null:r[i+t]||null}const DS=Nt(function(n,e){const{children:t,triggerElement:r}=n,{closePopover:i}=Uu(),o=Q(null);Nn(e,()=>o.current),Y(()=>{var a;(a=o.current)==null||a.focus()},[]);const s=ee(a=>{(function(l,u,c,d){var E;const h=u.querySelectorAll("[t-menu-item]"),p=document.activeElement;if(!p||!p.hasAttribute("t-menu-item")&&!p.hasAttribute("t-menu"))return;const f=Array.from(h).indexOf(p);let m;switch(l.key){case"ArrowDown":m=Math.min(f+1,h.length-1);break;case"ArrowUp":m=Math.max(f-1,0),f===-1&&(m=h.length-1);break;case"Home":m=0;break;case"End":m=h.length-1;break;case"Tab":{const A=c.closest("t-chatbox,t-conversation-list,.t-chatbox,.t-conversation-list"),g=l.shiftKey?bp(A,c,-1):function(O,S){return bp(O,S,1)}(A,c);return g==null||g.focus(),void d()}default:return}(E=h[m])==null||E.focus()})(a,o.current,r,i)},[i,r]);return v("div",{"t-menu":"",role:"menu",tabIndex:-1,ref:o,onKeyDown:s,children:t})});function Rr(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",initialFocus:o,...s}=n,[a,l]=ie(void 0),u=Q(null),[c,d]=ie(!1);go(ee(()=>{var p;d(!1),(p=u.current)==null||p.focus()},[]),"[t-popover-content]",c);const h=i==="menu"?v(DS,{triggerElement:u.current,children:v(e,{...t})}):v(e,{...t});return v(Og.Provider,{value:{closePopover:()=>d(!1)},children:[v(OS,{...s,"aria-haspopup":i==="menu"?"menu":"true","aria-expanded":c,onTrigger:()=>d(!0),ref:p=>(f=>{var E;const m=(E=f==null?void 0:f.closest("[t-menu-boundary]"))!=null?E:void 0;u.current=f,l(m)})(p),children:r}),c&&v(zA,{"t-popover-content":"",anchorElement:u.current,boundaryElement:a,preferredPlacement:"bottom-start",trapFocus:i==="popover",initialFocus:i==="menu"?"t-menu":o,role:i==="menu"?void 0:"dialog",children:h})]})}const OS=Nt(function(n,e){const{onTrigger:t,...r}=n,i=ee(o=>{o.key!=="Enter"&&o.key!==" "||t()},[t]);return v("button",{...r,ref:e,onClick:t,onKeyDown:i})});function An(n){const{onSelect:e,...t}=n,{closePopover:r}=Uu(),i=ee(o=>{o.key!=="Enter"&&o.key!==" "||(r(),e==null||e())},[e,r]);return v("div",{tabIndex:-1,role:"menuitem",onClick:ee(()=>{r(),e==null||e()},[r,e]),onKeyDown:i,"t-menu-item":"",...t})}function YA(n){return Om(n)}function or(n){var e;return(e=n.photoUrl)!=null?e:function(t,r){const i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
93
93
|
<rect x="0" y="0" width="100" height="100" fill="${Om(t)}"/>
|
|
94
94
|
<text x="50%" y="54%" dominant-baseline="middle" font-size="34" font-family="San Francisco, Segoe UI, Helvetica Neue, Arial, Helvetica, sans-serif" fill="#fff" text-anchor="middle">${r}</text>
|
|
95
95
|
</svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+Cg(i)}(n.id,Ng(n.name))}function Do(n){return n<1024?n+" B":n<1048576?Math.floor(n/1024)+" KB":n<1073741824?Math.floor(n/1048576)+" MB":n<1099511627776?Math.floor(n/1073741824)+" GB":Math.floor(n/1099511627776)+" TB"}function Ac({latitude:n,longitude:e}){const t=n+","+e;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${t}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${t}&key=${q0}`,linkUrl:`https://maps.google.com/maps?q=${t}&z=15`}}function GA(n,e){const[t,r]=ie({long:"",short:""});return Et(()=>{let i,o=!0;const s=()=>{const l=Date.now(),u=function(c,d,h){const p=c-d;let f,m,E;const A=new Date(d),g={month:"short",day:"numeric"};if(p<Lp)return{changeTimeout:5e3,short:h.JUST_NOW,long:h.JUST_NOW};if(p<wp)f=Lp,m="MINUTES",E=h.MINUTES;else if(p<Mp)f=wp,m="HOURS",E=h.HOURS;else{if(!(p<SS)){if(A.getFullYear()===new Date(c).getFullYear()){const S=A.toLocaleDateString(h.locale,g);return{changeTimeout:void 0,short:S,long:S}}{const S=A.toLocaleDateString(h.locale,{...g,year:"numeric"});return{changeTimeout:void 0,short:S,long:S}}}f=Mp,m="DAYS",E=h.DAYS}const O=Math.floor(p/f);return{changeTimeout:f,short:O+E,long:TS(O,m.toLowerCase(),h.locale)}}(l,n>l?l-2e3:n,e);return r(u),u},a=()=>{const l=s();o&&l.changeTimeout&&(i=window.setTimeout(a,l.changeTimeout))};return s(),i=window.setTimeout(a,100),()=>{o=!1,clearTimeout(i)}},[e,n]),t}function _c(n){n=Math.floor(n);const e=Math.floor(n/3600);n%=3600;const t=Math.floor(n/60);n%=60;const r=o=>o.toString().padStart(2,"0");let i=`${r(t)}:${r(n)}`;return e>0&&(i=`${r(e)}:${i}`),i}const kp=864e5;function WA(n,e){const t=Date.now(),r=(i=n,o=t,Math.floor((o-i)/kp));var i,o;if(r<0||r===0)return e.TODAY;if(r===1)return e.YESTERDAY;const s={weekday:"long"},a=new Date(n);if(r<7)return a.toLocaleDateString(e.locale,s);const l=new Date(t);return function(c,d){return Math.floor((d-c)/(365*kp))}(l.setFullYear(l.getFullYear()-1),n)===0?a.toLocaleDateString(e.locale,{...s,month:"long",day:"numeric"}):a.toLocaleDateString(e.locale,{...s,year:"numeric",month:"long",day:"numeric"})}const Lp=6e4,wp=36e5,Mp=864e5,SS=6048e5;function TS(n,e,t){return new Intl.RelativeTimeFormat(t).format(-n,e)}function F(n,...e){const t=K0.bind(de)(n,...e);return Array.isArray(t)?de(xe,{},...t):t}function XA({children:n,className:e,...t}){return v("div",{className:"t-attach-overlay "+e,...t,children:n})}function RS({uploadState:n}){const{uploaded:e,errored:t}=n;go(()=>n.closePreview("cancel"),".t-upload-preview");const r=Q(null);Y(()=>{e&&r.current.focus()},[e]);const i=ne(ce().t$);return v(XA,{className:"t-upload-preview",children:v("div",{className:"t-preview",children:[v(CS,{upload:n.upload,uploaded:e}),t&&v("div",{className:"t-error-row",children:i.UPLOAD_ERROR}),v("div",{className:"t-send-row",children:[v("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),!t&&e&&v("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function CS({upload:n,uploaded:e}){const t=ne(ce().t$);return n.type!=="location"?v(xe,{children:[v(vS,{upload:n}),v(NS,{upload:n,uploaded:e,t})]}):e?v(IS,{location:n.location}):v("div",{className:"t-loading",children:v(ac,{})})}function IS({location:n}){const{imageUrl:e,linkUrl:t}=Ac(n);return v("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${JSON.stringify(e)}) center center / cover no-repeat`}})}const vS=cn(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=v("div",{className:"video-container",children:v(yS,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else n.type==="image"?e=v("div",{className:"t-img-container",children:v("img",{src:URL.createObjectURL(t)})}):n.type==="audio"&&(e=v(Zs,{src:URL.createObjectURL(t),filename:t.name}));return e}),NS=cn(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),v("div",{className:`t-filename-row ${i}`,children:v("div",{className:o,children:r})})});function yS(n){const{videoType:e,...t}=n;return v("video",{...t})}function bS(){const n=kt(),e=ce(),t=ei(),r=ne(e.state$.isUserConnected),i=ne(e.state$.userPermissions);return v(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function kS({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=po(),i=function(){const m=ce(),E=Ct(()=>{const O=m.extUserId$.get(),S=m.errors$.get(),T=m.authTokenState$.get(),I=O&&m.currentUser$.get(),C=m.state$.currentConversation.get(),y=m.state$.extCurrentConversationId.get(),_=y&&m.state$.participants.child(y).get(),D=m.app$.get();return m.device$.get(),S.serverError?"server-error":S.wrongAppId?"wrong-app-id":T==="loading"||T==="idle"?"loading-token":T==="invalid"?"invalid-token":T==="expired"?"expired-token":T==="valid"?S.unknownUser?"unknown-user":S.unknownConversation?"loading-conv-failed":I&&C&&_&&D?"loaded":"loading-data":void pe.unreachable()}),A=Ct({type:"loading"});zr(O=>{const S=E.get(),T=m.state$.extCurrentConversationId.peek(),I=m.extUserId$.peek(),C=m.appId$.peek();function y(_){A.set({type:"loading"});const D=setTimeout(()=>{A.set(_)},5e3);return()=>clearTimeout(D)}switch(S){case"invalid-token":A.set({type:"auth-failed"});break;case"expired-token":A.set({type:"expired-token"});break;case"wrong-app-id":A.set({type:"wrong-app-id",appId:C});break;case"server-error":A.set({type:"server-error"});break;case"loading-data":case"loading-token":A.set({type:"loading"});break;case"loaded":A.set({type:"loaded",conversationId:T,userId:I});break;case"loading-conv-failed":O.onCleanup=y({type:"inaccessible-conversation",userId:I,conversationId:T});break;case"unknown-user":O.onCleanup=y({type:"unknown-user",userId:I});break;default:pe.never(S)}});const g=Ct({type:"loading"});return zr(O=>{if(A.type.get()==="loading"){g.set({type:"invisible-loading"});const S=setTimeout(()=>{g.set({type:"loading"})},1e3);O.onCleanup=()=>{clearTimeout(S)}}else g.set(A.get())}),ne(g)}(),{attachFile:o,shareLocation:s,uploadState:a}=X0({onClose:()=>r.focus()});Y(()=>{r.uploadFile=o},[r,o]);const[l,u]=ie(!1),c=ce(),d=ne(()=>c.app$.get()?c.state$.userPermissions.canShareFile.get():void 0),h=ee(m=>{o(m.dataTransfer.files[0]),m.preventDefault(),u(!1)},[o]),p=ee(m=>{m.preventDefault(),u(!0)},[]),f=ee(m=>{m.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?v(xe,{}):i.type==="loading"?v(iA,{}):i.type==="inaccessible-conversation"?v(Y0,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?v(qs,{appId:n,chatboxState:i}):i.type=="expired-token"?v(oA,{}):i.type==="loaded"?v("div",{className:"t-chatbox-content",onDragOver:d?p:void 0,onDragLeave:d?f:void 0,onDrop:d?h:void 0,children:[e&&v(bS,{}),v(U0,{extConversationId:i.conversationId}),t&&v(rA,{attachFile:o,shareLocation:s}),a&&v(RS,{uploadState:a}),l&&v(XA,{className:"t-drop-overlay",children:v(Rs,{type:"attach"})})]}):v(xe,{})}function LS(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=uc(a);return ns(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${bo(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${bo(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${bo(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${bo(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
|
|
@@ -1067,7 +1067,7 @@ The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),sms
|
|
|
1067
1067
|
<div className="t-theme-audio-block">
|
|
1068
1068
|
<${Zs} src=${n.url} filename=${n.filename} />
|
|
1069
1069
|
|
|
1070
|
-
<a className="t-body-text" href=${e}>
|
|
1070
|
+
<a className="t-body-text" href=${e} target="_blank">
|
|
1071
1071
|
<${r}
|
|
1072
1072
|
type="attachment"
|
|
1073
1073
|
className="t-attachment-icon"
|
|
@@ -1079,7 +1079,7 @@ The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),sms
|
|
|
1079
1079
|
</div>
|
|
1080
1080
|
`}function lT({block:n,downloadUrl:e,common:t}){const{Icon:r}=t.theme;return F`
|
|
1081
1081
|
<div className="t-theme-file-block">
|
|
1082
|
-
<a className="t-body-text" href=${e}>
|
|
1082
|
+
<a className="t-body-text" href=${e} target="_blank">
|
|
1083
1083
|
<${r}
|
|
1084
1084
|
type="attachment"
|
|
1085
1085
|
className="t-attachment-icon"
|
|
@@ -1102,7 +1102,7 @@ The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),sms
|
|
|
1102
1102
|
</div>
|
|
1103
1103
|
</a>
|
|
1104
1104
|
|
|
1105
|
-
<a href=${e} className="t-body-text">
|
|
1105
|
+
<a href=${e} className="t-body-text" target="_blank">
|
|
1106
1106
|
<${r} className="download-icon" type="download" common=${t} />
|
|
1107
1107
|
<span>${n.filename}</span>
|
|
1108
1108
|
<span className="t-filesize"> (${Do(n.size)})</span>
|
|
@@ -1143,7 +1143,7 @@ The {{app.name}} team`},smsSettings:{enabled:a.includes("sms_notifications"),sms
|
|
|
1143
1143
|
</div>
|
|
1144
1144
|
</div>
|
|
1145
1145
|
|
|
1146
|
-
<a href=${e} className="t-body-text">
|
|
1146
|
+
<a href=${e} className="t-body-text" target="_blank">
|
|
1147
1147
|
<${r} className="download-icon" type="download" common=${t} />
|
|
1148
1148
|
<span>${n.filename}</span>
|
|
1149
1149
|
<span className="t-filesize"> (${Do(n.size)})</span>
|
package/default.js
CHANGED
|
@@ -14190,17 +14190,17 @@ function pS(n) {
|
|
|
14190
14190
|
const e = ce(), t = po(), r = ne(t.state$.suggestMentionQuery), i = function(E, A = 10) {
|
|
14191
14191
|
const g = sr(Bu), [O, S] = ie(null);
|
|
14192
14192
|
return Y(() => {
|
|
14193
|
-
const T = g.conversation(E).subscribeParticipants((
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
|
|
14193
|
+
const T = g.conversation(E).subscribeParticipants((I) => S(I));
|
|
14194
|
+
return A > 10 && T.connected.then(async () => {
|
|
14195
|
+
for (; T.state.type === "active" && !T.state.loadedAll && T.state.latestSnapshot !== null && T.state.latestSnapshot.length < A; ) {
|
|
14196
|
+
const I = Math.min(A - T.state.latestSnapshot.length, 50);
|
|
14197
|
+
await T.loadMore(I);
|
|
14198
|
+
}
|
|
14199
|
+
}), () => {
|
|
14200
14200
|
T.unsubscribe();
|
|
14201
14201
|
};
|
|
14202
14202
|
}, [E, g, A]), O;
|
|
14203
|
-
}(ne(e.state$.extCurrentConversationId), r ?
|
|
14203
|
+
}(ne(e.state$.extCurrentConversationId), r ? 1e3 : 0), o = Z(() => (i != null ? i : []).map((E) => E.user), [i]), [s, a] = ie(0), l = Z(() => Object.fromEntries(o.map((E) => [E.id, gg(E.name)])), [o]), u = Z(() => {
|
|
14204
14204
|
if (!r) return [];
|
|
14205
14205
|
const E = Cp(r);
|
|
14206
14206
|
return E === "" ? o : o.filter((A) => l[A.id].some((g) => function(O, S) {
|
|
@@ -16634,7 +16634,7 @@ function oT({ block: n, downloadUrl: e, common: t }) {
|
|
|
16634
16634
|
<div className="t-theme-audio-block">
|
|
16635
16635
|
<${lc} src=${n.url} filename=${n.filename} />
|
|
16636
16636
|
|
|
16637
|
-
<a className="t-body-text" href=${e}>
|
|
16637
|
+
<a className="t-body-text" href=${e} target="_blank">
|
|
16638
16638
|
<${r}
|
|
16639
16639
|
type="attachment"
|
|
16640
16640
|
className="t-attachment-icon"
|
|
@@ -16650,7 +16650,7 @@ function sT({ block: n, downloadUrl: e, common: t }) {
|
|
|
16650
16650
|
const { Icon: r } = t.theme;
|
|
16651
16651
|
return F`
|
|
16652
16652
|
<div className="t-theme-file-block">
|
|
16653
|
-
<a className="t-body-text" href=${e}>
|
|
16653
|
+
<a className="t-body-text" href=${e} target="_blank">
|
|
16654
16654
|
<${r}
|
|
16655
16655
|
type="attachment"
|
|
16656
16656
|
className="t-attachment-icon"
|
|
@@ -16677,7 +16677,7 @@ function aT({ block: n, downloadUrl: e, common: t }) {
|
|
|
16677
16677
|
</div>
|
|
16678
16678
|
</a>
|
|
16679
16679
|
|
|
16680
|
-
<a href=${e} className="t-body-text">
|
|
16680
|
+
<a href=${e} className="t-body-text" target="_blank">
|
|
16681
16681
|
<${r} className="download-icon" type="download" common=${t} />
|
|
16682
16682
|
<span>${n.filename}</span>
|
|
16683
16683
|
<span className="t-filesize"> (${Qs(n.size)})</span>
|
|
@@ -16729,7 +16729,7 @@ function cT({ block: n, downloadUrl: e, common: t }) {
|
|
|
16729
16729
|
</div>
|
|
16730
16730
|
</div>
|
|
16731
16731
|
|
|
16732
|
-
<a href=${e} className="t-body-text">
|
|
16732
|
+
<a href=${e} className="t-body-text" target="_blank">
|
|
16733
16733
|
<${r} className="download-icon" type="download" common=${t} />
|
|
16734
16734
|
<span>${n.filename}</span>
|
|
16735
16735
|
<span className="t-filesize"> (${Qs(n.size)})</span>
|